Message: Ntuple number of entries are same as primary Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Ntuple number of entries are same as primary 

Forum: Analysis
Date: 15 Jun, 2018
From: David Sangcheol Lee <David Sangcheol Lee>

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

  //fill histograms

  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:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Ntuple number of entries are same as primary   (Ivana Hrivnacova - 19 Jun, 2018)
(_ More: Re: Ntuple number of entries are same as primary   (David Sangcheol Lee - 19 Jun, 2018)
 Add Message Add Message
to: "Ntuple number of entries are same as primary"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]