Hello,
If I create a TTree branch with an array of variable length like this (User’s Guide):
{
TFile *f = new TFile("peter.root","recreate");
Int_t nPhot;
Float_t E[500];
TTree* nEmcPhotons = new TTree("nEmcPhotons","EMC Photons");
nEmcPhotons->Branch("nPhot",&nPhot,"nPhot/I");
nEmcPhotons->Branch("E",E,"E[nPhot]/F");
}
Does “nPhot” have to be of Int_t type?
In all the examples I could find it is Int_t but I am not sure if it is required.
Thank you!!!
Sergei.
brun
2
Yes, if nPhot is used as an array counter in some other branches,
it must be of type integer.
Rene
Dear Rene,
It looks like I did not explain the question well enough.
The question really was if nPhot can be any of the following types:
Char_t
UChar_t
Short_t
UShort_t
Int_t
UInt_t
Long64_t
ULong64_t
or it can be only of the type Int_t
?
Sergei.
Dear Rene,
Thank you!!!
So far in almost all my code I was using UInt_t for this purpose, i.e.
UInt_t nPhot;
nEmcPhotons->Branch("nPhot",&nPhot,"nPhot/i");
(the nPhot branch has 'i" type too - not “I”).
Does it mean that I should be worried that all those results could be incorrect?
Sergei.