Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
XrayFluoEventAction Class Reference

#include <XrayFluoEventAction.hh>

Inheritance diagram for XrayFluoEventAction:
Collaboration diagram for XrayFluoEventAction:

Public Member Functions

 XrayFluoEventAction (const XrayFluoDetectorConstruction *)
 
 XrayFluoEventAction (const XrayFluoPlaneDetectorConstruction *)
 
 XrayFluoEventAction (const XrayFluoMercuryDetectorConstruction *)
 
virtual ~XrayFluoEventAction ()
 
virtual void BeginOfEventAction (const G4Event *)
 
virtual void EndOfEventAction (const G4Event *)
 
void SetDrawFlag (G4String val)
 
void SetPrintModulo (G4int val)
 
- Public Member Functions inherited from G4UserEventAction
 G4UserEventAction ()
 
virtual ~G4UserEventAction ()
 
virtual void SetEventManager (G4EventManager *value)
 

Additional Inherited Members

- Protected Attributes inherited from G4UserEventAction
G4EventManagerfpEventManager
 

Detailed Description

Definition at line 54 of file XrayFluoEventAction.hh.

Constructor & Destructor Documentation

XrayFluoEventAction::XrayFluoEventAction ( const XrayFluoDetectorConstruction det)

Definition at line 60 of file XrayFluoEventAction.cc.

61  :drawFlag("all"),
62  HPGeCollID(0),
63  eventMessenger(0),
64  printModulo(1),
65  detectorType(0)
66 {
67  eventMessenger = new XrayFluoEventActionMessenger(this);
68 
69  if (!(det->GetPhaseSpaceFlag()) ){
70  detectorType = det->GetDetectorType();
71  HPGeCollID=-1;
72  }
73 }
XrayFluoVDetectorType * GetDetectorType() const

Here is the call graph for this function:

XrayFluoEventAction::XrayFluoEventAction ( const XrayFluoPlaneDetectorConstruction det)

Definition at line 77 of file XrayFluoEventAction.cc.

78  :drawFlag("all"),
79  HPGeCollID(-1),
80  eventMessenger(0),
81  printModulo(1),
82  detectorType(0)
83 {
84  eventMessenger = new XrayFluoEventActionMessenger(this);
85  detectorType = det->GetDetectorType();
86 }
XrayFluoVDetectorType * GetDetectorType() const

Here is the call graph for this function:

XrayFluoEventAction::XrayFluoEventAction ( const XrayFluoMercuryDetectorConstruction det)

Definition at line 90 of file XrayFluoEventAction.cc.

91  :drawFlag("all"),
92  HPGeCollID(-1),
93  eventMessenger(0),
94  printModulo(1),
95  detectorType(0)
96 {
97  eventMessenger = new XrayFluoEventActionMessenger(this);
98  detectorType = det->GetDetectorType();
99 }

Here is the call graph for this function:

XrayFluoEventAction::~XrayFluoEventAction ( )
virtual

Definition at line 103 of file XrayFluoEventAction.cc.

104 {
105  delete eventMessenger;
106  eventMessenger = 0;
107 }

Member Function Documentation

void XrayFluoEventAction::BeginOfEventAction ( const G4Event evt)
virtual

Reimplemented from G4UserEventAction.

Definition at line 111 of file XrayFluoEventAction.cc.

112 {
113 
114  G4int eventNumber = (evt->GetEventID())+1;
115  if ( eventNumber == 1){
116 
117  G4cout << "# = 100000 events" << G4endl;
118  G4cout << "1--------+---------+---------+---------+---------5e6"<<G4endl;
119  }
120 
121  if ( ((eventNumber) % 100000) == 0 ) {
122 
123  if ( eventNumber % (G4int)5e6 != 0 ) G4cout << "#" << std::flush;
124  else G4cout << "#"<< G4endl;
125  }
126 
127  if (HPGeCollID==-1)
128  {
130  HPGeCollID = SDman->GetCollectionID("HPGeCollection");
131  //the pointer points to the ID number of the sensitive detector
132  }
133 }
G4int GetCollectionID(G4String colName)
Definition: G4SDManager.cc:135
int G4int
Definition: G4Types.hh:78
G4int GetEventID() const
Definition: G4Event.hh:151
G4GLOB_DLL std::ostream G4cout
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void XrayFluoEventAction::EndOfEventAction ( const G4Event evt)
virtual

Reimplemented from G4UserEventAction.

Definition at line 137 of file XrayFluoEventAction.cc.

138 {
139 
140  if (detectorType) {
141 
142  // extracted from hits, compute the total energy deposit (and total charged
143  // track length)
144  G4HCofThisEvent* HCE = evt->GetHCofThisEvent();
145 
146  XrayFluoSensorHitsCollection* HPGeHC = 0;
147  G4int n_hit = 0;
148  G4double totEnergyDetect=0., totEnergy=0., energyD=0.;
149 
150  if (HCE) HPGeHC =
151  (XrayFluoSensorHitsCollection*)(HCE->GetHC(HPGeCollID));
152 
153  if(HPGeHC)
154  {
155  n_hit = HPGeHC->entries();
156 
157  for (G4int i=0;i<n_hit;i++)
158  {
159  totEnergy += (*HPGeHC)[i]->GetEdepTot();
160  energyD = detectorType->ResponseFunction(totEnergy);
162  analysis->analyseEnergyDep(energyD);
163  totEnergyDetect += energyD;
164  }
165  }
166  }
167 }
G4VHitsCollection * GetHC(G4int i)
G4int entries() const
int G4int
Definition: G4Types.hh:78
virtual G4double ResponseFunction(G4double)=0
static XrayFluoAnalysisManager * getInstance()
G4HCofThisEvent * GetHCofThisEvent() const
Definition: G4Event.hh:185
void analyseEnergyDep(G4double eDep)
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

void XrayFluoEventAction::SetDrawFlag ( G4String  val)
inline

Definition at line 69 of file XrayFluoEventAction.hh.

69 {drawFlag = val;};

Here is the caller graph for this function:

void XrayFluoEventAction::SetPrintModulo ( G4int  val)
inline

Definition at line 70 of file XrayFluoEventAction.hh.

70 {printModulo = val;};

Here is the caller graph for this function:


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