Hi, Rooters,
I’m doing analysis based on other guy’s scripts. The scripts produce a ROOT file.
Due to some reasons, I need to convert all of these branches affiliated to the produced ROOT file into histograms. The number of branches is variable and depends on different cut conditions.
Ideally, I hoep I can produce histograms using this kind of calling :
“TNtuple->GetListOfBranches->Fill()” .
This way, I can produce histograms by,
for(it = ListOfBranches->First(); it <= ListOfBranches->Last(); it++){
hist_name->Fill();
}
After checking the objects of a TNtuple, surprisingly, I found
(1). the values are all “0”, see [1] please;
(2). The Draw("") command produce a null TCanvas, see [2] please.
Does it mean there is no way to produce histograms from a TNtuple / TTree ?
Or, I misunderstood something ?
Thanks !
Best regards,
Junhui
[1].
root [7] TObjArray * tmp = hitSumm->GetListOfBranches()
root [8] tmp.ls()
OBJ: TObjArray TObjArray An array of objects : 0
OBJ: TBranch runID runID : 0 at: 0x38678d0
OBJ: TBranch ohdu ohdu : 0 at: 0x3875b60
OBJ: TBranch nSat nSat : 0 at: 0x3876120
OBJ: TBranch flag flag : 0 at: 0x38766e0
OBJ: TBranch xMin xMin : 0 at: 0x3876ca0
OBJ: TBranch xMax xMax : 0 at: 0x3877260
OBJ: TBranch yMin yMin : 0 at: 0x3877820
OBJ: TBranch yMax yMax : 0 at: 0x3877de0
OBJ: TBranch E0 E0 : 0 at: 0x38783a0
OBJ: TBranch n0 n0 : 0 at: 0x3878960
OBJ: TBranch xBary0 xBary0 : 0 at: 0x3878f20
OBJ: TBranch yBary0 yBary0 : 0 at: 0x38794e0
OBJ: TBranch xVar0 xVar0 : 0 at: 0x3879aa0
OBJ: TBranch yVar0 yVar0 : 0 at: 0x387a060
OBJ: TBranch E1 E1 : 0 at: 0x387a620
OBJ: TBranch n1 n1 : 0 at: 0x387abe0
OBJ: TBranch xBary1 xBary1 : 0 at: 0x387b1a0
OBJ: TBranch yBary1 yBary1 : 0 at: 0x387b760
OBJ: TBranch xVar1 xVar1 : 0 at: 0x387bd20
OBJ: TBranch yVar1 yVar1 : 0 at: 0x387c2e0
OBJ: TBranch E2 E2 : 0 at: 0x387c8a0
OBJ: TBranch n2 n2 : 0 at: 0x387ce60
OBJ: TBranch xBary2 xBary2 : 0 at: 0x387d420
OBJ: TBranch yBary2 yBary2 : 0 at: 0x387d9e0
OBJ: TBranch xVar2 xVar2 : 0 at: 0x387dfa0
OBJ: TBranch yVar2 yVar2 : 0 at: 0x387e560
OBJ: TBranch E3 E3 : 0 at: 0x387eb20
OBJ: TBranch n3 n3 : 0 at: 0x387f0e0
OBJ: TBranch xBary3 xBary3 : 0 at: 0x387f6a0
OBJ: TBranch yBary3 yBary3 : 0 at: 0x387fc60
OBJ: TBranch xVar3 xVar3 : 0 at: 0x3880220
OBJ: TBranch yVar3 yVar3 : 0 at: 0x38807e0
[2]
root [15] tmp->Last()->Draw("")
Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1