Dear all,
I was given a tree filled with vector’s and tried to read it with TSelector, but failed because of the following name clashes (C-style comments added by me, C++ comments by MakeSelector):
/* (…) */
//TLorentzVector lep_l;
/ UInt_t fUniqueID; /
/ UInt_t fBits; /
/ UInt_t fP_fUniqueID; /
/ UInt_t fP_fBits; /
/ Double_t fP_fX; /
/ Double_t fP_fY; /
/ Double_t fP_fZ; /
/ Double_t fE; /
/ (…) */
//TLorentzVector lep_nl;
/ UInt_t fUniqueID; /
/ UInt_t fBits; /
/ UInt_t fP_fUniqueID; /
/ UInt_t fP_fBits; /
/ Double_t fP_fX; /
/ Double_t fP_fY; /
/ Double_t fP_fZ; /
/ Double_t fE; /
/ (…) */
Now, one of the branches is supposed to contain TLorentzVector’s representing jets. I tried to change the .h file this way (commenting away everything written by MakeSelector):
std::vector* jetVec;
TBranch* b_jetVec;
and later
fChain->SetBranchAddress(“jet”, &jetVec, &b_jetVec);
Then, inside Process(), I wrote few simple lines:
b_RunNumber->GetEntry(entry);
b_EventNumber->GetEntry(entry);
cerr << "event " << EventNumber << " from run " << RunNumber << “:” << endl;
b_jetVec->GetEntry(entry);
cerr << " b_jetVec " << b_jetVec << endl;
cerr << " jetVec " << jetVec << endl;
unsigned nJets = jetVec->size();
cerr << " nJets " << nJets << endl;
The jetVec->size() statement makes a crash, as it is shown by this output:
event 27702 from run 116830:
b_jetVec 0x7fbc4a53def0
jetVec 0x7fbc00000002
*** Break *** segmentation violation
Thread 3 (process 45022):
#0 0x00007fff8d854192 in __workq_kernreturn ()
#1 0x00007fff8d678594 in _pthread_wqthread ()
#2 0x00007fff8d679b85 in start_wqthread ()
Thread 2 (process 45022):
#0 0x00007fff8d8547e6 in kevent ()
#1 0x00007fff8b3315be in _dispatch_mgr_invoke ()
#2 0x00007fff8b33014e in _dispatch_mgr_thread ()
Thread 1 (process 45022):
#0 0x00007fff8d854168 in wait4 ()
#1 0x00007fff8d62c5f5 in system ()
#2 0x000000010bf8a98a in TUnixSystem::StackTrace ()
#3 0x0000004100000111 in ?? ()
It seems that jetVec is a valid pointer (at least, it’s not null), but cannot use it.
Do you have any suggestion?
Thanks a lot,
Diego