MCTrack [message #5410] |
Thu, 15 November 2007 12:47 |
Klaus Götzen
Messages: 293 Registered: June 2006 Location: GSI
|
first-grade participant |
From: *ikf.physik.uni-frankfurt.de
|
|
Hi!
I somehow stumbling always about the same problems... my question is, where and when the MCTrack array is created and filled, so that I can access that from a task.
What I'd like to do is to access the MCTrack array of a simulated event, without running a transport code. My simple idea would be to init an arbitrary event generator, which produces the tracks and somehow stores these primaries.
A code snippet form my macro looks like:
.
.
.
CbmRunSim *fRun = new CbmRunSim();
fRun->SetOutputFile("fastsim.root");
CbmPrimaryGenerator* primGen = new CbmPrimaryGenerator();
fRun->SetGenerator(primGen);
CbmEvtGenGenerator* evtGen = new CbmEvtGenGenerator("output.evt");
primGen->AddGenerator(evtGen);
primGen->DoTracking(kFALSE);
CbmFastSim* fastSim = new CbmFastSim();
fRun->AddTask(fastSim);
.
.
.
but in my task CbmFastSim MCTrack is not accessible, I get the message
-E- CbmRootManager Branch: MCTrack not found in Tree
-W- CbmFastSim::Init: No MCStack array!
Most likely this is no big deal to solve. Somebody has a hint for me?
Cheers,
Klaus
|
|
|
Re: MCTrack [message #5411 is a reply to message #5410] |
Thu, 15 November 2007 13:20 |
Mohammad Al-Turany
Messages: 518 Registered: April 2004 Location: GSI, Germany
|
first-grade participant |
From: *gsi.de
|
|
Hi klaus,
The MCTrack is filled when finishing an event (in your case
after filling the Stack). but your task is trying to access the
MCTrack in the initialization phase of a simulation session
(CbmRunSim!). So either you do this in two steps:
1. in your macro, remove the CbmFastSim and run it. It will
produce an output file(fastsim.root)
In fact, here you just copy the information from your event
generator format to a format similar to the full simulation
(There is not transport at all here)
2. create a new macro (Analysis macro, ie: CbmRunAna), set
input file (output of step 1), add
your task , and you will see the MCTrack and can use them
Or:
if you want to do it in one step, you have to use Stack, instead of MCTrack:
CbmStack *fStack= gMC->GetStack();
and from CbmStack you have access to all info on the fly
before they are filtered(if?) and written out as an array of
MCTracks
regards
Mohammad
|
|
|
|
Re: MCTrack [message #5413 is a reply to message #5412] |
Thu, 15 November 2007 14:24 |
StefanoSpataro
Messages: 2736 Registered: June 2005 Location: Torino
|
first-grade participant |
From: *physik.uni-giessen.de
|
|
Hi,
gMC is a global variable which is defined by root/vmc, not by PandaRoot but somewhere "higher" (such as gStyle gROOT and similar) in TVirtualMC.h, and it is of a TVirtualMC type (of course)
I don't know if these informations can be of help.
[Updated on: Thu, 15 November 2007 14:31] Report message to a moderator
|
|
|
|
|
|
|
Re: MCTrack [message #5418 is a reply to message #5417] |
Thu, 15 November 2007 15:47 |
Klaus Götzen
Messages: 293 Registered: June 2006 Location: GSI
|
first-grade participant |
From: *ikf.physik.uni-frankfurt.de
|
|
Hi Mohammad and Stefano!
Thanks a lot, now everything basically works as I wanted!
Best regards,
Klaus
|
|
|