However your code is quite obsolete, I would suggest to check the latest tutorial wiki pages, since the analysis structure has changed.]]>StefanoSpataro2013-11-09T18:43:57-00:00Re: loop over PndMcTracks
https://forum.gsi.de/index.phpindex.php?t=rview&goto=15701&th=4062#msg_15701
pandaroot/tutorials/apr13/
do simulation full chain with: tut_runall.sh
and analysis with tut_ana.C
I get information about MC track with:
// *** loop over MC track
for (jl=0;jl<mctrk.GetLength();++jl)
{
cout << "all MC tracks " << jl
<< " " << mctrk[jl].PdgCode()
<< " " << mctrk[jl].Px()
<< endl;
}
But when I try to extract mother particle ID and StartX:
it is the problem. Could you please tell me how I can get this?]]>Yuri Naryshkin2013-11-10T20:00:54-00:00Re: loop over PndMcTracks
https://forum.gsi.de/index.phpindex.php?t=rview&goto=15702&th=4062#msg_15702
StefanoSpataro2013-11-10T21:18:34-00:00Re: loop over PndMcTracks
https://forum.gsi.de/index.phpindex.php?t=rview&goto=15704&th=4062#msg_15704
the piece of code is:
//YN
// *** loop over MC track
for (jl=0;jl<mctrk.GetLength();++jl)
{
cout << "all MC tracks " << jl
<< " " << mctrk[jl].PdgCode()
<< " " << mctrk[jl].Px()
<< " " << mctrk[jl]->MotherID();
<< endl;
}
//YN
the error message is:
*************************************************************
initialisation for run id 372981311
*************************************************************
[ERROR ] init() ANAPidSelections not initialized
Error in <FairRuntimeDb::initContainers()>: Error occured during initialization
evt aaa1
[INFO ] The number of entries in chain is 5000
Warning: wrong member access operator '->' tut_ana.C:140:
Error: Can't call TCandidate::MotherID() in current scope tut_ana.C:140:
Possible candidates are...
(in TCandidate)
(in TFitParams)
*** Interpreter error recovered ***
all MC tracks 0 211 -0.0498608 root [1] ]]>Yuri Naryshkin2013-11-11T10:22:27-00:00Re: loop over PndMcTracks
https://forum.gsi.de/index.phpindex.php?t=rview&goto=15705&th=4062#msg_15705
For the startX I believe you should use ->Origin().).
]]>StefanoSpataro2013-11-11T11:29:27-00:00Re: loop over PndMcTracks
https://forum.gsi.de/index.phpindex.php?t=rview&goto=15707&th=4062#msg_15707
I also would like to extract FtofPoint information in the same loop
over event (of course, loop over FtofPoints is defferent)
theAnalysis->FillList(ftof, "FtofPoint");
I've got an error message:
Error in <FillList>: Unknown list key: FtofPoint
Should I add some more classes or add something else?
]]>Yuri Naryshkin2013-11-11T15:48:14-00:00Re: loop over PndMcTracks
https://forum.gsi.de/index.phpindex.php?t=rview&goto=15732&th=4062#msg_15732
I can suggest you to take a look into the macro macro/pid/track_check.C.
This macro loops over MCTrack, select only primary particles (GetMotherID()==-1), and for each mctrack it find the pid candidate correlated to such track. This is a basic scheme, but if you substitute the names with ftof classes you can do whatever you want. Also the macro pid_check.c could help you to understand the mechanism (I am not tousching them since a while then maybe they could crash, but all the basics are inside).]]>StefanoSpataro2013-11-15T15:39:25-00:00