|Message: Ntuple number of entries are same as primary||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
Dear Geant4 experts
I need your help. I am thinking this problem is coming from the TNtuple problem so I am posting in here.
I created several classes to collect the results and store in ROOT file format. Hence, I used analysismanager.
The problem is when I plot the histogram (e.g Neutron energy spectra) from Ntuple, the number of entries shown in the root is exactly same as the number of protons that I set (i.e. 500000).
I used the same setup to create ASCII file and this works well I have more than 500000. However, when I try to store the data in ROOT file format, it is fixed at 500000.
Following lines are the lines I put in run.cc for filling the ntuple
analysisManager->FillH1(0,log10(fCapEnergy)); analysisManager->FillH1(1,log10(fDirEnergy)); analysisManager->FillH1(2,fDirAngle); analysisManager->FillH1(3,fNAngle); analysisManager->FillH1(4,fNEnergy); analysisManager->FillH2(0,fCapPosX,fCapPosY); analysisManager->FillH2(1,fNPosX,fNPosY);
//fill 1st ntuples = Captureneutrons analysisManager->FillNtupleFColumn(0,0,fCapEnergy); // ID=0 analysisManager->FillNtupleDColumn(0,1,fCapPosX); // ID=1 analysisManager->FillNtupleDColumn(0,2,fCapPosY); // ID=2 analysisManager->FillNtupleDColumn(0,3,fCapPosZ); // ID=3 analysisManager->AddNtupleRow(0);
//fill 2nd ntuples = direction of neutron from the target analysisManager->FillNtupleFColumn(1,0,fDirEnergy); // ID=0 analysisManager->FillNtupleFColumn(1,1,fDirAngle); // ID=1 analysisManager->AddNtupleRow(1);
//fill 3rd nutple = first interaction analysisManager->FillNtupleFColumn(2,0,fNAngle); // ID=0 analysisManager->FillNtupleDColumn(2,1,fNPosX); // ID=1 analysisManager->FillNtupleDColumn(2,2,fNPosY); //ID=2 analysisManager->FillNtupleDColumn(2,3,fNPosZ); //ID=3 analysisManager->FillNtupleFColumn(2,4,fNEnergy); //ID=4 analysisManager->AddNtupleRow(2);
All these are stored in one file called totalN.root
I do not understand why I get the same number of neutrons as the number of particles I run with.
Could anyone tell me why it is happening like this and how to fix this?
I really appreciate all your help.
Attachment: http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2018/06/15/09.33-83769-SteppingAction.cc http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2018/06/15/09.33-75369-Run.cc http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2018/06/15/09.33-29775-RunAction.cc http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2018/06/15/09.33-40355-plotNtuple.C http://hypernews.slac.stanford.edu/HyperNews/geant4/get/AUX/2018/06/15/09.33-68173-test.gif
|Inline Depth:||Outline Depth:||Add message:|