Re: Analysis for Material Radiation length [message #14220 is a reply to message #14219] |
Wed, 21 November 2012 15:40 |
Mohammad Al-Turany
Messages: 518 Registered: April 2004 Location: GSI, Germany
|
first-grade participant |
From: *gsi.de
|
|
Hallo Ajay,
In your macro you have:
....
Quote: | TFile* f = new TFile(inFile.c_str()); // the sim file you want to analyse
TTree *t=(TTree *) f->Get("cbmsim") ;
TFile* file = new TFile("Simulation_par.root");
file->Get("FairBaseParSet");
TClonesArray* mc_array=new TClonesArray("PndMCTrack");
t->SetBranchAddress("MCTrack",&mc_array);//Branch names
TClonesArray* rad_array=new TClonesArray("FairRadLenPoint");
t->SetBranchAddress("RadLen",&rad_array);
// TGeoManager *geoMan = (TGeoManager*) gDirectory->Get("FAIRGeom");
TGeoManager *geoMan = (TGeoManager*) gDirectory->Get("FairBaseParSet");
// PndGeoHandling* fGeoH = new PndGeoHandling();
...
|
You do not need to call the line in RED it is even wrong, when you call
file->Get("FairBaseParSet");
the geometry is read in memory and the "gGeoManager" global pointer is valid, just use it and it should work! Simply remove the line in RED and use directly gGeoManager, i.e:
TGeoNode* node = gGeoManager->FindNode(point.x(),point.y(),point.z());
regards,
Mohammad
[Updated on: Wed, 21 November 2012 15:41] Report message to a moderator
|
|
|