Hi,
I have a question regarding how TRef access the object from file.
For systematics study, I’m scaling the jet 4-mom by +/-1 and need to propagate that to the missingEt computation.
In order to not have to do this all over the place, I’m trying to do it once at the beginning of the event loop, changing the actual values of the jet TLorentzVector read from the ntuple, since i’m accessing this via pointer:
b_jetA[idxJetBr]->GetEntry(jentry);
std::vector<Jet>* _jetA = Nt.jetA[idxJetBr];
for(unsigned int ii=0; ii<jetA->size(); ii++){
Jet* _j = &(*jetA)[ii];
std::cout << "Jet before "; _j->print();
TLorentzVector _corrLv= _j->lv().operator*( scaleJet(_j) );
_j->setLV( _corrLv );
std::cout << "Jet after "; _j->print();
}
This all works find each time I access jets form Nt.jetA[] vector…
However, when I access the same jet via a TRef from another branch/object, the TRef returns the value of the jets from the ntuple and not the one from memory.
for(unsigned int io=0; io< _metJetA.size(); io++){
const UCI::MetObject* _obj = _metJetA[io];
UCI::Jet* _j = (UCI::Jet*) _obj->ref().GetObject(); //Grabbing jet contributing to Met
std::cout<< "\tRefJet "; _j->print(); //returns values from file
}
From reading the documentation on TRef/TBranchRef, I was under the impression that once the object is loaded into memory it is not read back from file via TRef.
I’m a doing something obviously wrong or is there a way to change this behavior ?
Cheers
-a