Public Member Functions | Private Attributes | List of all members
larg4::SimEnergyDepositSD Class Reference

#include <SimEnergyDepositSD.h>

Inheritance diagram for larg4::SimEnergyDepositSD:

Public Member Functions

 SimEnergyDepositSD (G4String)
 
 ~SimEnergyDepositSD ()
 
void Initialize (G4HCofThisEvent *)
 
G4bool ProcessHits (G4Step *, G4TouchableHistory *)
 
const sim::SimEnergyDepositCollectionGetHits () const
 

Private Attributes

sim::SimEnergyDepositCollection hitCollection
 

Detailed Description

Definition at line 29 of file SimEnergyDepositSD.h.

Constructor & Destructor Documentation

larg4::SimEnergyDepositSD::SimEnergyDepositSD ( G4String  name)

Definition at line 32 of file SimEnergyDepositSD.cc.

33 : G4VSensitiveDetector(name) {
34  hitCollection.clear();
35 }
static QCString name
Definition: declinfo.cpp:673
sim::SimEnergyDepositCollection hitCollection
larg4::SimEnergyDepositSD::~SimEnergyDepositSD ( )

Definition at line 39 of file SimEnergyDepositSD.cc.

39  {
40 
41 }

Member Function Documentation

const sim::SimEnergyDepositCollection& larg4::SimEnergyDepositSD::GetHits ( ) const
inline

Definition at line 35 of file SimEnergyDepositSD.h.

35 { return hitCollection; }
sim::SimEnergyDepositCollection hitCollection
void larg4::SimEnergyDepositSD::Initialize ( G4HCofThisEvent *  HCE)

Definition at line 45 of file SimEnergyDepositSD.cc.

45  {
46  hitCollection.clear();
47  }
sim::SimEnergyDepositCollection hitCollection
G4bool larg4::SimEnergyDepositSD::ProcessHits ( G4Step *  aStep,
G4TouchableHistory *   
)

Definition at line 50 of file SimEnergyDepositSD.cc.

50  {
51  G4double edep = aStep->GetTotalEnergyDeposit()/CLHEP::MeV;
52 
53  if (edep == 0.) return false;
54  //std::cout << "7777777777777777: "<< aStep->GetTotalEnergyDeposit()/CLHEP::MeV << " " << aStep->GetTotalEnergyDeposit() <<std::endl;
55  const int electronsperMeV= 10000;
56  int nrelec=(int)round(edep*electronsperMeV);
57  if (aStep->GetTrack()->GetDynamicParticle()->GetCharge() == 0) return false;
58  G4int photons = 0;
59  G4SteppingManager* fpSteppingManager = G4EventManager::GetEventManager()
60  ->GetTrackingManager()->GetSteppingManager();
61  G4StepStatus stepStatus = fpSteppingManager->GetfStepStatus();
62  if (stepStatus != fAtRestDoItProc) {
63  G4ProcessVector* procPost = fpSteppingManager->GetfPostStepDoItVector();
64  size_t MAXofPostStepLoops = fpSteppingManager->GetMAXofPostStepLoops();
65  for (size_t i3 = 0; i3 < MAXofPostStepLoops; i3++) {
66  /*
67  if ((*procPost)[i3]->GetProcessName() == "Cerenkov") {
68  G4Cerenkov* proc =(G4Cerenkov*) (*procPost)[i3];
69  photons+=proc->GetNumPhotons();
70  }
71  */
72  if ((*procPost)[i3]->GetProcessName() == "Scintillation") {
73  G4Scintillation* proc1 = (G4Scintillation*) (*procPost)[i3];
74  photons += proc1->GetNumPhotons();
75  }
76  }
77  }
78  geo::Point_t start = geo::Point_t(
79  aStep->GetPreStepPoint()->GetPosition().x()/CLHEP::cm,
80  aStep->GetPreStepPoint()->GetPosition().y()/CLHEP::cm,
81  aStep->GetPreStepPoint()->GetPosition().z()/CLHEP::cm);
83  aStep->GetPostStepPoint()->GetPosition().x()/CLHEP::cm,
84  aStep->GetPostStepPoint()->GetPosition().y()/CLHEP::cm,
85  aStep->GetPostStepPoint()->GetPosition().z()/CLHEP::cm);
87  nrelec,
88  1.0,
89  edep,
90  start,
91  end,
92  aStep->GetPreStepPoint()->GetGlobalTime() / CLHEP::ns,
93  aStep->GetPostStepPoint()->GetGlobalTime() /CLHEP::ns,
94  aStep->GetTrack()->GetTrackID(),
95  aStep->GetTrack()->GetParticleDefinition()->GetPDGEncoding() );
96  hitCollection.push_back(newHit);
97  return true;
98  }// end ProcessHits
static constexpr double cm
Definition: Units.h:68
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
sim::SimEnergyDepositCollection hitCollection
static constexpr double MeV
Definition: Units.h:129
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
Energy deposition in the active material.
QAsciiDict< Entry > ns

Member Data Documentation

sim::SimEnergyDepositCollection larg4::SimEnergyDepositSD::hitCollection
private

Definition at line 37 of file SimEnergyDepositSD.h.


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