Message: Re: How to fill ntuple with vector for geant4.10.01? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Re: How to fill ntuple with vector for geant4.10.01? 

Forum: Analysis
Re: Question How to fill ntuple with vector for geant4.10.01? (Vladimir Baranov)
Re: None Re: How to fill ntuple with vector for geant4.10.01? (Ivana Hrivnacova)
Re: Feedback Re: How to fill ntuple with vector for geant4.10.01? (Vladimir Baranov)
Date: 12 Mar, 2015
From: Frederik Wauters <Frederik Wauters>

I am still struggling to get mu ntuples filled.

What I want to do:

-----------------

 Save the interactions (processes, position) of my primary particle in a detector. 

What I have:

------------

In RunAction.cc:

  //Make NTuple
  void NC1RunAction::BeginOfRunAction(const G4Run*)  {
   ...
  analysisManager->CreateNtuple("Germanium", "Germanium detector hits");
  analysisManager->CreateNtupleDColumn("Edep");
  analysisManager->CreateNtupleIColumn("Interactions",interactions);
  analysisManager->FinishNtuple();
  }

  //Clear vectors, called at beginning of an event
  void NC1RunAction::ClearVectors()  {
  ...
  interactions.clear();
  }

In RunAction.hh:

   ...
   void SetInteraction(G4int value) { interactions.push_back(value); };
   ...  
 private:
    std::vector<G4int> interactions;
   ....

What (not) works:

----------------

  * The "Edep" double gets set in EventAction and shows up in the output
  * The vector values of "interactions" get set correctly from EventAction
  * The vector exists in the output, but is empty

? :

---

  * What am I doing wrong?
  * Is it possible to post a working example?

thanks

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: How to fill ntuple with vector for geant4.10.01?   (Ivana Hrivnacova - 16 Mar, 2015)
(_ More: Re: How to fill ntuple with vector for geant4.10.01?   (Frederik Wauters - 16 Mar, 2015)
(_ None: Re: How to fill ntuple with vector for geant4.10.01?   (Ivana Hrivnacova - 16 Mar, 2015)
1 More: Re: How to fill ntuple with vector for geant4.10.01?   (Frederik Wauters - 16 Mar, 2015)
2 None: Re: How to fill ntuple with vector for geant4.10.01?   (Ivana Hrivnacova - 17 Mar, 2015)
1 More: Re: How to fill ntuple with vector for geant4.10.01?   (Frederik Wauters - 18 Mar, 2015)
... 8 Message(s)
 Add Message Add Message
to: "Re: How to fill ntuple with vector for geant4.10.01?"

 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 ]