GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » General » Finding true vertex position of mother particles.
Re: Finding true vertex position of mother particles. [message #12271 is a reply to message #12270] Fri, 15 July 2011 11:11 Go to previous messageGo to previous message
donghee is currently offline  donghee
Messages: 385
Registered: January 2009
Location: Germnay
first-grade participant
From: *kph.uni-mainz.de
Hi stefano,

I'm nearly come to the end.... could you say where I made wrong with below code (part of analysis code)

Quote:


//Data accessing!
TFile *inFile = TFile::Open(inSimFile,"READ");
TTree *tree=(TTree *) inFile->Get("cbmsim") ;

TClonesArray* mc_array=new TClonesArray("PndMCTrack");
tree->SetBranchAddress("MCTrack",&mc_array);
TClonesArray* event=new TClonesArray("FairMCEventHeader");
tree->SetBranchAddress("MCEventHeader",&event);

//Event loop
PndEventReader evr(inPidFile);
while (evr.GetEvent() && i++<nEntries)
{
tree->GetEntry(i);

//Event info
FairMCEventHeader *mc_info = (FairMCEventHeader*)event->At(i);

//Print to check
cout<<mc_info->GetX()<<endl;
cout<<mc_info->GetY()<<endl;
cout<<mc_info->GetZ()<<endl;
}



Error message in root is
Quote:


Error: illegal pointer to class object mc_info 0x0 3481




Cheers,
Donghee

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: cdash changes: update your nightly builds!
Next Topic: Lambda-Lambda_bar
Goto Forum:
  


Current Time: Tue Apr 30 02:28:26 CEST 2024

Total time taken to generate the page: 0.00952 seconds