Hi,
I need some help helping myself. I’ve got a pretty simple set of root classes that I’m trying to write out:
[code]class EventInfo
{
public:
int nJets;
std::vector Jets;
};
class JetInfo
{
public:
double defaultTagWeight;
TLorentzVector v;
};[/code]
I create a pretty plane file and tree:
m_rootTree = new TTree ("usertree", "A tree man");
m_event = new EventInfo();
m_rootTree->Branch("event", "EventInfo", &m_event, 6400, 99);
m_rootTree->SetAutoSave();
and do the normal sorts of things to fill it:
m_event->nJets = nJets;
m_event->Jets.clear();
loop over jets:
JetInfo info;
info.v.SetPtEtaPhiM(jet.pt(), jet.eta(), jet.phi(), jet.m());
info.defaultTagWeight = jet.getFlavourTagWeight();
m_event.push_back(info);
m_rootTree->Fill();
But when I run I get an access violation under the TTree::Fill on the first event:
#0 0xb6e0707c in TStreamerInfo::WriteBufferAux<TVirtualCollectionProxy> ()
from /opt/atlas/software/15.2.0/15.2.0/LCGCMT/LCGCMT_56a/InstallArea/i686-slc4-gcc34-opt/lib/libRIO.so
#1 0xb6e048c0 in TStreamerInfo::WriteBufferSTL ()
from /opt/atlas/software/15.2.0/15.2.0/LCGCMT/LCGCMT_56a/InstallArea/i686-slc4-gcc34-opt/lib/libRIO.so
#2 0xb646b585 in TBranchElement::FillLeaves ()
from /opt/atlas/software/15.2.0/15.2.0/LCGCMT/LCGCMT_56a/InstallArea/i686-slc4-gcc34-opt/lib/libTree.so
#3 0xb6465bed in TBranch::Fill ()
from /opt/atlas/software/15.2.0/15.2.0/LCGCMT/LCGCMT_56a/InstallArea/i686-slc4-gcc34-opt/lib/libTree.so
#4 0xb646acb6 in TBranchElement::Fill ()
from /opt/atlas/software/15.2.0/15.2.0/LCGCMT/LCGCMT_56a/InstallArea/i686-slc4-gcc34-opt/lib/libTree.so
#5 0xb646acd4 in TBranchElement::Fill ()
from /opt/atlas/software/15.2.0/15.2.0/LCGCMT/LCGCMT_56a/InstallArea/i686-slc4-gcc34-opt/lib/libTree.so
#6 0xb646acd4 in TBranchElement::Fill ()
from /opt/atlas/software/15.2.0/15.2.0/LCGCMT/LCGCMT_56a/InstallArea/i686-slc4-gcc34-opt/lib/libTree.so
#7 0xb64b30ac in TTree::Fill ()
This smells to me like I’ve forgotten some class dictionary (I’m using the ATLAS reflex infrastructure to generate these dictionaries). But I think I’ve included everything I need.
One odd thing to note (perhaps I do have the dictionaries?): If I don’t actually push_back any jets, then it writes out just fine. Further, when I inspect the TTree with TBrowser I can see the elements of TLorentzVector and decay length all there just fine (but, of course, empty!).
How can I debug this to see what I’ve done wrong? Many thanks!
-Gordon
P.S. I would have included a small snippit of code to demo the problem, but of course it always works when I try to distil it down. Sorry! There is something about what I’m doing in combination with the ATLAS envrionment that is causing this.