Differences between Histo and Ntuple [message #16539] |
Wed, 07 May 2014 16:11 |
Mamen
Messages: 55 Registered: January 2009 Location: Mainz
|
continuous participant |
From: *kph.uni-mainz.de
|
|
Dear all,
I'm trying to learn how to save data into a root file using both a histogram or an ntuple.
For the histogram I get reasonable plots, but for the ntuple I get strange events/particles plotted at -1000.
My code looks like follows:
TH1F *eppx = new TH1F ("eppx", "eppx (All)", 200, -2000, 5000.);
(.../...)
RhoTuple *ntp = new RhoTuple("RecoTuple","Reco_analysis");
(.../...)
PndAnalysis* theAnalysis = new PndAnalysis();
if (nevts==0) nevts= theAnalysis->GetEntries();
// *** RhoCandLists for the analysis
RhoCandList eplus;
(.../...)
while (theAnalysis->GetEvent() && i++<nevts)
{
if ((i%100)==0) cout<<"evt " << i << endl;
// *** Select with no PID info ('All'); type and mass are set
theAnalysis->FillList(chrg, "Charged");
theAnalysis->FillList(eplus, "ElectronAllPlus");
(.../...)
for (j=0;j<eplus.GetLength();++j)
{
eppx->Fill(eplus[j]->Px());
ntp->Column("eppx", (Float_t) eplus[j]->Px(), -999.0f);
ntp->DumpData();
}
(.../...)
}
out->cd();
eppx->Write();
out->Save();
ntp->GetInternalTree()->Write();
out->Close();
However, I get strange results when I open the output rootfile (see uploaded files).
Am I doing something wrong? Does somebody know where these events at -1000 in the ntuple saved data come from?
Thanks a lot in advance!
Best regards,
Mamen
|
|
|