GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Analysis » Different results for same information extracted in different ways
Re: Different results for same information extracted in different ways [message #17492 is a reply to message #17491] Mon, 10 November 2014 17:13 Go to previous messageGo to previous message
Klaus Götzen is currently offline  Klaus Götzen
Messages: 293
Registered: June 2006
Location: GSI
first-grade participant
From: *gsi.de
Hi Mamen,


you are setting the branch addresses with wrong type, feppx and eppid are arrays[ncnd]. If you check, you see

root [5] epempi0Tuple.Print("feppx*")
******************************************************************************
*Br    0 :feppx     : feppx[ncnd]/F                                          *
*Entries :   477980 : Total  Size=    3999009 bytes  File Size  =    2757478 *

root [6] epempi0Tuple.Print("eppid*")
******************************************************************************
*Br    0 :eppid     : eppid[ncnd]/I                                          *
*Entries :   477980 : Total  Size=    3999002 bytes  File Size  =    1021207 *


The number 477980 is exactly the number of events you see in your second approach.

You should do the loop like this:

  float feppx[100];
  int eppid[100];
  int ncnd;

  epempi0TupleReco->SetBranchAddress("feppx", &feppx);
  epempi0TupleReco->SetBranchAddress("eppid", &eppid);
  epempi0TupleReco->SetBranchAddress("ncnd", &ncnd);

  TH1F *Reco2;
  Reco2 = new TH1F("Fill", "Fill", NBINS, BINMIN, BINMAX);

  long NEntriesReco=(long)epempi0TupleReco->GetEntries();

  for (int k=0; k<NEntriesReco; k++)
  {
    epempi0TupleReco->GetEntry(k);
	  
    if (k % 100000 == 0 && k != 0) cout<<"*** Reco Loop *** Getting Entry: "<< k << endl;

    for (int kk=0;kk<ncnd;++kk) 
       Reco2->Fill(feppx[kk]);
   }


With that I get the output:

File: epempi0-W2-10-Delta0-bw-LargeQ2-Merged.root
Number of events in the Histogram using Project: 
 Total_int (0-9)         Integral (1-8)          GetEntries
500104                  500104                  500104
*** Reco Loop *** Getting Entry: 100000
*** Reco Loop *** Getting Entry: 200000
*** Reco Loop *** Getting Entry: 300000
*** Reco Loop *** Getting Entry: 400000
Number of events in the Histogram looping over TTree: 
 Total_intF (0-9)        IntegralF (1-8)                 GetEntriesF
500104                  500104                  500104



Best,
Klaus
 
Read Message icon9.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: vertex reconstruction without fitting?
Next Topic: Vertex fitter for two consecutive decays
Goto Forum:
  


Current Time: Fri Oct 04 16:05:54 CEST 2024

Total time taken to generate the page: 0.00875 seconds