QwGeant4
QweakSimPMTOnly_PMTSD Class Reference

#include <QweakSimPMTOnly_PMTSD.hh>

Inherits G4VSensitiveDetector.

+ Collaboration diagram for QweakSimPMTOnly_PMTSD:

Public Member Functions

 QweakSimPMTOnly_PMTSD (G4String name, QweakSimUserInformation *userInfo)
 
 ~QweakSimPMTOnly_PMTSD ()
 
void Initialize (G4HCofThisEvent *HCE)
 
virtual G4bool ProcessHits (G4Step *aStep, G4TouchableHistory *)
 
G4bool ProcessHits_constStep (const G4Step *, G4TouchableHistory *)
 
void EndOfEvent (G4HCofThisEvent *HCE)
 
QweakSimTrajectoryGetParentTrajectory (G4int parentID)
 

Private Attributes

QweakSimUserInformationmyUserInfo
 
QweakSimPMTOnly_PMTHitsCollectionPMTOnly_PMTHitsCollection
 
G4int PMTOnlyPMT_CollectionID
 

Detailed Description

Definition at line 20 of file QweakSimPMTOnly_PMTSD.hh.

Constructor & Destructor Documentation

QweakSimPMTOnly_PMTSD::QweakSimPMTOnly_PMTSD ( G4String  name,
QweakSimUserInformation userInfo 
)

Definition at line 20 of file QweakSimPMTOnly_PMTSD.cc.

References myUserInfo, and PMTOnlyPMT_CollectionID.

21 :G4VSensitiveDetector(name)
22 {
23  collectionName.insert("PMTHitCollection");
25  myUserInfo = userInfo;
26 }
QweakSimUserInformation * myUserInfo
QweakSimPMTOnly_PMTSD::~QweakSimPMTOnly_PMTSD ( )

Definition at line 29 of file QweakSimPMTOnly_PMTSD.cc.

30 {
31 }

Member Function Documentation

void QweakSimPMTOnly_PMTSD::EndOfEvent ( G4HCofThisEvent *  HCE)

Definition at line 71 of file QweakSimPMTOnly_PMTSD.cc.

72 {
73 }
QweakSimTrajectory * QweakSimPMTOnly_PMTSD::GetParentTrajectory ( G4int  parentID)

Definition at line 76 of file QweakSimPMTOnly_PMTSD.cc.

References QweakSimTrajectory::GetCharge(), and QweakSimTrajectory::GetTrackID().

77 {
78  G4TrajectoryContainer* trajectoryContainer =
79  G4RunManager::GetRunManager()->GetCurrentEvent()->GetTrajectoryContainer();
80 
81  if(trajectoryContainer==0) {
82  G4cout << " Could not find the TrajectoryContainer" << G4endl;
83  return 0;
84  }
85 
86  G4int i = 0;
87  G4int n_entries = trajectoryContainer->entries();
88  while( i < n_entries) {
89  QweakSimTrajectory* trj = (QweakSimTrajectory*)((*trajectoryContainer)[i]);
90  G4cout << " Current charge of possible parent track = " <<trj->GetCharge() << "--- Parent ID = "
91  << trj->GetTrackID() << G4endl;
92  if(trj->GetTrackID()==parentID) return trj;
93  i++;
94  }
95 
96  return 0;
97 }
Stores the information about the various tracks.
G4int GetTrackID() const
G4double GetCharge() const

+ Here is the call graph for this function:

void QweakSimPMTOnly_PMTSD::Initialize ( G4HCofThisEvent *  HCE)

Definition at line 34 of file QweakSimPMTOnly_PMTSD.cc.

References PMTOnly_PMTHitsCollection, and PMTOnlyPMT_CollectionID.

35 {
36  PMTOnly_PMTHitsCollection = new QweakSimPMTOnly_PMTHitsCollection(SensitiveDetectorName,collectionName[0]);
37 
39  { PMTOnlyPMT_CollectionID = G4SDManager::GetSDMpointer()->GetCollectionID(PMTOnly_PMTHitsCollection); }
40  HCE->AddHitsCollection(PMTOnlyPMT_CollectionID , PMTOnly_PMTHitsCollection);
41 }
QweakSimPMTOnly_PMTHitsCollection * PMTOnly_PMTHitsCollection
G4THitsCollection< QweakSimPMTOnly_PMTHit > QweakSimPMTOnly_PMTHitsCollection
G4bool QweakSimPMTOnly_PMTSD::ProcessHits ( G4Step *  aStep,
G4TouchableHistory *   
)
virtual

Definition at line 43 of file QweakSimPMTOnly_PMTSD.cc.

43  {
44  return false;
45 }
G4bool QweakSimPMTOnly_PMTSD::ProcessHits_constStep ( const G4Step *  aStep,
G4TouchableHistory *   
)

Definition at line 48 of file QweakSimPMTOnly_PMTSD.cc.

References PMTOnly_PMTHitsCollection, QweakSimPMTOnly_PMTHit::StoreHitID(), and QweakSimPMTOnly_PMTHit::StorePhotonEnergy().

Referenced by QweakSimSteppingAction::UserSteppingAction().

49 {
50  // Make sure that this is a
51  if (aStep->GetTrack()->GetDefinition() != G4OpticalPhoton::OpticalPhotonDefinition())
52  return false;
53 
54  G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
55  G4StepPoint* postStepPoint = aStep->GetPostStepPoint();
56 
57  if (postStepPoint->GetStepStatus() != fGeomBoundary) return false;
58  if (preStepPoint->GetStepStatus() != fGeomBoundary) return false; // Entering Volume
59 
60  G4double currentPhotonEnergy = aStep->GetTrack()->GetTotalEnergy();
62 
63  aHit->StorePhotonEnergy(currentPhotonEnergy);
64  G4int hitCount = PMTOnly_PMTHitsCollection->insert(aHit);
65  aHit->StoreHitID(hitCount);
66 
67  return true;
68 }
QweakSimPMTOnly_PMTHitsCollection * PMTOnly_PMTHitsCollection
void StorePhotonEnergy(G4double eng)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

QweakSimUserInformation* QweakSimPMTOnly_PMTSD::myUserInfo
private

Definition at line 38 of file QweakSimPMTOnly_PMTSD.hh.

Referenced by QweakSimPMTOnly_PMTSD().

QweakSimPMTOnly_PMTHitsCollection* QweakSimPMTOnly_PMTSD::PMTOnly_PMTHitsCollection
private

Definition at line 39 of file QweakSimPMTOnly_PMTSD.hh.

Referenced by Initialize(), and ProcessHits_constStep().

G4int QweakSimPMTOnly_PMTSD::PMTOnlyPMT_CollectionID
private

Definition at line 40 of file QweakSimPMTOnly_PMTSD.hh.

Referenced by Initialize(), and QweakSimPMTOnly_PMTSD().


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