Geant4  10.02.p03
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)
 

Private Member Functions

G4double RandomCut (G4double)
 

Private Attributes

G4String drawFlag
 
G4int HPGeCollID
 
XrayFluoEventActionMessengereventMessenger
 
G4int printModulo
 
XrayFluoVDetectorTypedetectorType
 

Additional Inherited Members

- Protected Attributes inherited from G4UserEventAction
G4EventManagerfpEventManager
 

Detailed Description

Definition at line 54 of file XrayFluoEventAction.hh.

Constructor & Destructor Documentation

◆ XrayFluoEventAction() [1/3]

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 {
68 
69  if (!(det->GetPhaseSpaceFlag()) ){
71  HPGeCollID=-1;
72  }
73 }
XrayFluoEventActionMessenger * eventMessenger
XrayFluoVDetectorType * detectorType
XrayFluoVDetectorType * GetDetectorType() const
Here is the call graph for this function:

◆ XrayFluoEventAction() [2/3]

XrayFluoEventAction::XrayFluoEventAction ( const XrayFluoPlaneDetectorConstruction det)

Definition at line 77 of file XrayFluoEventAction.cc.

Here is the call graph for this function:

◆ XrayFluoEventAction() [3/3]

XrayFluoEventAction::XrayFluoEventAction ( const XrayFluoMercuryDetectorConstruction det)

Definition at line 90 of file XrayFluoEventAction.cc.

Here is the call graph for this function:

◆ ~XrayFluoEventAction()

XrayFluoEventAction::~XrayFluoEventAction ( )
virtual

Definition at line 103 of file XrayFluoEventAction.cc.

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

Member Function Documentation

◆ BeginOfEventAction()

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
G4GLOB_DLL std::ostream G4cout
G4int GetEventID() const
Definition: G4Event.hh:151
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:

◆ EndOfEventAction()

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 =
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 }
int G4int
Definition: G4Types.hh:78
virtual G4double ResponseFunction(G4double)=0
static XrayFluoAnalysisManager * getInstance()
XrayFluoVDetectorType * detectorType
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:

◆ RandomCut()

G4double XrayFluoEventAction::RandomCut ( G4double  energy)
private

Definition at line 172 of file XrayFluoEventAction.cc.

174 {
175  G4double efficiency = 1.;
176  G4double F = 0.15;
177  G4double epsilon = 2.96 * eV;
178  G4double deltaE = 220 * eV;
179  G4double EdepDetect = 0.;
180 
181  G4double Random = G4UniformRand();
182 
183  if ( Random<efficiency )
184  {
185  G4double sigma = std::sqrt(F*epsilon*energy+std::pow(deltaE/2355,2));
186  EdepDetect = G4RandGauss::shoot(energy, sigma );
187 
188  }
189  else {EdepDetect = 0.;}
190 
191  return EdepDetect;
192 }
ThreeVector shoot(const G4int Ap, const G4int Af)
#define G4UniformRand()
Definition: Randomize.hh:97
double energy
Definition: plottest35.C:25
static const double eV
Definition: G4SIunits.hh:212
double G4double
Definition: G4Types.hh:76
double epsilon(double density, double temperature)
Here is the call graph for this function:

◆ SetDrawFlag()

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:

◆ SetPrintModulo()

void XrayFluoEventAction::SetPrintModulo ( G4int  val)
inline

Definition at line 70 of file XrayFluoEventAction.hh.

Here is the caller graph for this function:

Member Data Documentation

◆ detectorType

XrayFluoVDetectorType* XrayFluoEventAction::detectorType
private

Definition at line 86 of file XrayFluoEventAction.hh.

◆ drawFlag

G4String XrayFluoEventAction::drawFlag
private

Definition at line 70 of file XrayFluoEventAction.hh.

◆ eventMessenger

XrayFluoEventActionMessenger* XrayFluoEventAction::eventMessenger
private

Definition at line 78 of file XrayFluoEventAction.hh.

◆ HPGeCollID

G4int XrayFluoEventAction::HPGeCollID
private

Definition at line 75 of file XrayFluoEventAction.hh.

◆ printModulo

G4int XrayFluoEventAction::printModulo
private

Definition at line 79 of file XrayFluoEventAction.hh.


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