TClonesArray with fStreamerType: 501 error while filling/reading a TClonesArray of TLorentzVectors

I have a problem with an element, a TClonesArray of TLorentzVector, of an event class.
The same class is also used for real data or generated data from MC, but it arises when
used with pythia8
At running time I get the following error message:
Error in TBranchElement::SetAddress: TClonesArray with fStreamerType: 501

When browsing the element of the class with TBrowser, I have the structure but:
root [3] Error in TBranchElement::SetAddress: TClonesArray with fStreamerType: 501
Error in TTreeFormula::DefinedVariable: l_had.Energy() is a datamember of DISEvent BUT is not yet of a supported type (501)
Error in TTreeFormula::Compile: Part of the Variable “disRD.l_had.Energy()” exists but some of it is not accessible or useable
Info in TSelectorDraw::AbortProcess: Variable compilation failed: {disRD.l_had.Energy(),}

In the Class DISEvent I have:
TClonesArray * l_had ; // [HadNb] 4-vector of the outgoing hadron (pion mass)

the Branch is created as follows:
rBran = rTree->Branch(“disRD”, “DISEvent”, &rEvt, 64000, 4);
with
DISEvent * rEvt = new DISEvent();

The LinkDef.h class is:
#ifdef CINT
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class DISEvent+;
#pragma link C++ struct DISEvent+;
#endif

I’m using root and gcc from:
source /cvmfs/sft.cern.ch/lcg/views/LCG_99_LHCB_1/x86_64-centos7-gcc10-opt/setup.csh

Thanks for help


Please read tips for efficient and successful posting and posting code

ROOT Version: 022/06
Platform: centos7
Compiler: Not Provided


Adding info of the streamer:

StreamerInfo for class: DISEvent, version=1, checksum=0xc56ac235
TObject BASE offset= 0 type=66 Basic ROOT object
int EventA offset= 0 type= 3 event unique number
int TrgMsk offset= 0 type= 3 trigger Mask
int SelV offset= 0 type= 3 masks for the selected vertex
TVector3 v_vtx offset= 0 type=61 3-vector of the vertex in the target
TLorentzVector l_li offset= 0 type=61 4-vector of the incoming muon
TLorentzVector l_ls offset= 0 type=61 4-vector of the scattered muon
TLorentzVector l_pr offset= 0 type=61 4-vector of the target proton
TLorentzVector l_gs offset= 0 type=61 4-vector of the virtual photon Gamma*
TLorentzVector l_hs offset= 0 type=61 4-vector of the hadronic system (Gamma*+proton)
float Q2 offset= 0 type= 5 invariant Mass of the virtual photon
float xbj offset= 0 type= 5 Bjorken-x of the event
float y offset= 0 type= 5 y of the event
float W offset= 0 type= 5 invariant mass of the hadroninc system (Gamma*+proton)
float phi_s offset= 0 type= 5 azimuthal angle of the spin in the GNS
int HadNb offset= 0 type= 6 Number of hadrons in the event
int* SelH offset= 0 type=43 [HadNb] Mask for the selected Hadron
int* ch offset= 0 type=43 [HadNb] hadron Charge (+/0/-)
float* zh offset= 0 type=45 [HadNb] z_h of the hadron (from invariants - pion mass)
float* pth offset= 0 type=45 [HadNb] P_Th of the hadron with respect to the Gamma*
float* xFyh offset= 0 type=45 [HadNb] x_F of the hadron
float* etah offset= 0 type=45 [HadNb] rapidity of the hadron (in GNS)
float* phi_h offset= 0 type=45 [HadNb] azimuthal angle of the hadron in the GNS
TClonesArray* l_had offset= 0 type=501 [HadNb] 4-vector of the outgoing hadron (pion mass) (TLorentzVector)

Dear @bressan ,

Thanks for reaching out! If possible, I would suggest to retry with more recent ROOT versions, ideally latest 6.28, available with LCG103. Other than that, I invite @pcanal to take a look at this one.

Cheers,
Vincenzo

Dear Vincenzo

I’ve found the origin of the problem (the code was working before
but I’ve changed a bit the class and left a comment to the line )

The original class was like this…

   /// number of particle
  Int_t HadNb          ; // Number of hadrons in the event
  Int_t   * SelH       ; // [HadNb] Mask for the selected Hadron
  //                        - bit 1 
  Int_t   * ch         ; // [HadNb] hadron Charge (+/0/-)
  Float_t * zh         ; // [HadNb] z_h  of the hadron (from invariants - pion mass)
  Float_t * pth        ; // [HadNb] P_Th of the hadron with respect to the Gamma*
  Float_t * xFyh       ; // [HadNb] x_F  of the hadron 
  Float_t * etah       ; // [HadNb] rapidity of the hadron (in GNS)
  Float_t * phi_h      ; // [HadNb] azimuthal angle of the hadron in the GNS
  TClonesArray * l_had ;    

while updating (with some cut and cut and paste in between) I’ve kept the comment in the last line

  /// number of particle
  Int_t HadNb          ; // Number of hadrons in the event
  Int_t   * SelH       ; // [HadNb] Mask for the selected Hadron
  //                        - bit 1 
  Int_t   * ch         ; // [HadNb] hadron Charge (+/0/-)
  Float_t * zh         ; // [HadNb] z_h  of the hadron (from invariants - pion mass)
  Float_t * pth        ; // [HadNb] P_Th of the hadron with respect to the Gamma*
  Float_t * xFyh       ; // [HadNb] x_F  of the hadron 
  Float_t * etah       ; // [HadNb] rapidity of the hadron (in GNS)
  Float_t * phi_h      ; // [HadNb] azimuthal angle of the hadron in the GNS
  TClonesArray * l_had ; // [HadNb] 4-vector of the outgoing hadron (pion mass)   

The originaI shows a type 64 for l_had, while for the second it shows 501…
I’ve forgot that the comment are read for variable length

Seams fine now.
Thanks

Andrea

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.