Public Member Functions | Private Types | Private Attributes | List of all members
LBNEEventAction Class Reference

#include <LBNEEventAction.hh>

Inheritance diagram for LBNEEventAction:

Public Member Functions

 LBNEEventAction ()
 
 ~LBNEEventAction ()
 
void BeginOfEventAction (const G4Event *)
 
void EndOfEventAction (const G4Event *)
 

Private Types

typedef std::map< int, int > IIMap
 
typedef std::map< int, double > IDMap
 

Private Attributes

LBNERunManagerpRunManager
 

Detailed Description

Definition at line 22 of file LBNEEventAction.hh.

Member Typedef Documentation

typedef std::map<int, double> LBNEEventAction::IDMap
private

Definition at line 35 of file LBNEEventAction.hh.

typedef std::map<int, int> LBNEEventAction::IIMap
private

Definition at line 34 of file LBNEEventAction.hh.

Constructor & Destructor Documentation

LBNEEventAction::LBNEEventAction ( )

Definition at line 25 of file LBNEEventAction.cc.

26 {
27  pRunManager=(LBNERunManager*)LBNERunManager::GetRunManager();
28 
29  if(pRunManager->GetVerboseLevel() > 0)
30  {
31  std::cout << "LBNEEventAction Constructor Called." << std::endl;
32  }
33 
34 }
LBNERunManager * pRunManager
int GetVerboseLevel() const
QTextStream & endl(QTextStream &s)
LBNEEventAction::~LBNEEventAction ( )

Definition at line 37 of file LBNEEventAction.cc.

38 {
39 
40  if(pRunManager->GetVerboseLevel() > 0)
41  {
42  std::cout << "LBNEEventAction Destructor Called." << std::endl;
43  }
44 }
LBNERunManager * pRunManager
int GetVerboseLevel() const
QTextStream & endl(QTextStream &s)

Member Function Documentation

void LBNEEventAction::BeginOfEventAction ( const G4Event *  evt)

Definition at line 47 of file LBNEEventAction.cc.

48 {
49  if(pRunManager->GetVerboseLevel() > 1)
50  {
51  G4cout << "LBNEEventAction::BeginOfEventAction called...Beginning Event #" << evt->GetEventID() << G4endl;
52  }
53  const LBNERunAction *runUserAction = reinterpret_cast<const LBNERunAction *>(G4RunManager::GetRunManager()->GetUserRunAction());
54  if (runUserAction->GetDoComputeEDepInGraphite()) {
55  LBNESteppingAction *stepAction = (LBNESteppingAction *) G4RunManager::GetRunManager()->GetUserSteppingAction();
56  stepAction->ResetEnergyDepInGraphite();
57 // std::cerr << " Ready to tally energy deposition in the graphite ... " << std::endl;
58  }
59  if (runUserAction->GetDoComputeEDepInArgonGas()) {
60  LBNESteppingAction *stepAction = (LBNESteppingAction *) G4RunManager::GetRunManager()->GetUserSteppingAction();
61  stepAction->ResetEnergyDepInArgonGas();
62 // std::cerr << " Ready to tally energy deposition in the graphite ... " << std::endl;
63  }
64  // This code does not work.. Need to be studied..
65 // if (evt->GetEventID() == -2222) {
66 //
67 // CLHEP::HepRandom::restoreEngineStatus("./rndm/beginRun_103Evt_32135.rndm");
68 // std::cerr << " Reloaded random from 103Evt_32135 " << std::endl;
69 // }
70 //
71 // if (evt->GetEventID() > 32130) {
72 // const G4Run* theRun = pRunManager->GetCurrentRun();
73 // std::ostringstream fOutRndmStrStr;
74 // fOutRndmStrStr << "./rndm/beginRun_" << theRun->GetRunID() << "Evt_" << evt->GetEventID() << ".rndm";
75 // std::string fOutRndmStr(fOutRndmStrStr.str());
76 // CLHEP::HepRandom::saveEngineStatus(fOutRndmStr.c_str());
77  // delete the previous previous file
78 // std::ostringstream fOutRndmPStrStr;
79 // fOutRndmPStrStr << "rm -f ./rndm/beginRun_" << theRun->GetRunID() << "Evt_" << evt->GetEventID()-2 << ".rndm";
80 // std::string fOutRndmPStr(fOutRndmPStrStr.str());
81 // system(fOutRndmPStr.c_str());
82  // Also get the seeds May this what we have to save...
83 // std::cerr << " The seed is now " << CLHEP::HepRandom::getTheSeed() << std::endl;
84 // }
85 
87  //--for tracking planes
89  analysis->ResetEvent();
90  }
91 
92 }
bool GetDoComputeEDepInGraphite() const
bool GetDoComputeEDepInArgonGas() const
bool GetCreateAlcoveTrackingOutput() const
static LBNEAnalysis * getInstance()
void ResetEnergyDepInGraphite() const
bool GetCreateTrkPlaneOutput() const
void ResetEnergyDepInArgonGas() const
LBNERunManager * pRunManager
int GetVerboseLevel() const
TCEvent evt
Definition: DataStructs.cxx:5
void LBNEEventAction::EndOfEventAction ( const G4Event *  evt)

Definition at line 96 of file LBNEEventAction.cc.

97 {
98  if(pRunManager->GetVerboseLevel() > 1)
99  {
100  G4cout << "LBNEEventAction::EndOfEventAction called...Ending Event # " << evt-> GetEventID() << G4endl;
101  }
103 
104  const LBNERunAction *runUserAction = reinterpret_cast<const LBNERunAction *>(G4RunManager::GetRunManager()->GetUserRunAction());
105  if (runUserAction->GetDoComputeEDepInGraphite()) {
106  const LBNESteppingAction *stepAction =
107  reinterpret_cast<const LBNESteppingAction *>
108  (G4RunManager::GetRunManager()->GetUserSteppingAction());
109  runUserAction->storeEDepInGraphite(stepAction->GetEnergyDepInGraphite());
110  }
111  if (runUserAction->GetDoComputeEDepInArgonGas()) {
112  const LBNESteppingAction *stepAction =
113  reinterpret_cast<const LBNESteppingAction *>
114  (G4RunManager::GetRunManager()->GetUserSteppingAction());
115  const double eDepH1 = stepAction->GetEnergyDepInArgonGasH1();
116  const double eDepH2 = stepAction->GetEnergyDepInArgonGasH2();
117  runUserAction->storeEDepInArgonGas(eDepH1, eDepH2);
118  }
119 
120  //--for tracking planes
123  analysis->FillEvent();
124  }
125 
126 }
bool GetDoComputeEDepInGraphite() const
bool GetDoComputeEDepInArgonGas() const
double GetEnergyDepInArgonGasH1() const
bool GetCreateAlcoveTrackingOutput() const
double GetEnergyDepInGraphite() const
void storeEDepInGraphite(double edep) const
static LBNEAnalysis * getInstance()
bool GetCreateTrkPlaneOutput() const
static LBNEQuickPiToNuVect * Instance()
void storeEDepInArgonGas(double edepH1, double edepH2) const
LBNERunManager * pRunManager
int GetVerboseLevel() const
TCEvent evt
Definition: DataStructs.cxx:5
double GetEnergyDepInArgonGasH2() const

Member Data Documentation

LBNERunManager* LBNEEventAction::pRunManager
private

Definition at line 39 of file LBNEEventAction.hh.


The documentation for this class was generated from the following files: