QwGeant4
QweakSimCerenkov_PMTSD Class Reference

#include <QweakSimCerenkov_PMTSD.hh>

Inherits G4VSensitiveDetector.

+ Collaboration diagram for QweakSimCerenkov_PMTSD:

Public Member Functions

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

Private Attributes

QweakSimUserInformationmyUserInfo
 
QweakSimCerenkovDetector_PMTHitsCollectionCerenkovDetector_PMTHitsCollection
 
G4int CerenkovDetectorPMT_CollectionID
 

Detailed Description

Definition at line 15 of file QweakSimCerenkov_PMTSD.hh.

Constructor & Destructor Documentation

QweakSimCerenkov_PMTSD::QweakSimCerenkov_PMTSD ( G4String  name,
QweakSimUserInformation myUserInfo 
)

Definition at line 17 of file QweakSimCerenkov_PMTSD.cc.

References CerenkovDetectorPMT_CollectionID, and myUserInfo.

18 :G4VSensitiveDetector(name)
19 {
20  collectionName.insert("PMTHitCollection");
22  myUserInfo = userInfo;
23 }
QweakSimCerenkov_PMTSD::~QweakSimCerenkov_PMTSD ( )
virtual

Definition at line 26 of file QweakSimCerenkov_PMTSD.cc.

27 {
28 
29 }

Member Function Documentation

void QweakSimCerenkov_PMTSD::EndOfEvent ( G4HCofThisEvent *  HCE)

Definition at line 84 of file QweakSimCerenkov_PMTSD.cc.

85 {
86 
87 }
QweakSimTrajectory * QweakSimCerenkov_PMTSD::GetParentTrajectory ( G4int  parentID)

Definition at line 90 of file QweakSimCerenkov_PMTSD.cc.

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

91 {
92  G4TrajectoryContainer* trajectoryContainer =
93  G4RunManager::GetRunManager()->GetCurrentEvent()->GetTrajectoryContainer();
94 
95  if(trajectoryContainer==0)
96  {
97  G4cout << " Could not find the TrajectoryContainer" << G4endl;
98  return 0;
99  }
100 // TrajectoryVector* vect = container->GetVector();
101 //
102 // (G4VTrajectory**) tr = vect->begin();
103 //
104 // while(tr != vect->end())
105 // {
106 // QweakSimTrajectory* tr1 = (QweakSimTrajectory*)(*tr);
107 // if(tr1->GetTrackID()==parentID) return tr1;
108 // tr++;
109 // }
110 
111 G4int i = 0;
112 
113 G4int n_trajectories = trajectoryContainer->entries();
114 
115 while(i != n_trajectories)
116 {
117 
118  QweakSimTrajectory* trj = (QweakSimTrajectory*)((*trajectoryContainer)[i]);
119  G4cout << " Current charge of possible parent track = " <<trj->GetCharge() << "--- Parent ID = "
120  << trj->GetTrackID() << G4endl;
121  if(trj->GetTrackID()==parentID) return trj;
122  i++;
123 }
124 
125 return 0;
126 }
Stores the information about the various tracks.
G4int GetTrackID() const
G4double GetCharge() const

+ Here is the call graph for this function:

void QweakSimCerenkov_PMTSD::Initialize ( G4HCofThisEvent *  HCE)

Definition at line 32 of file QweakSimCerenkov_PMTSD.cc.

References CerenkovDetector_PMTHitsCollection, and CerenkovDetectorPMT_CollectionID.

33 {
34  CerenkovDetector_PMTHitsCollection = new QweakSimCerenkovDetector_PMTHitsCollection(SensitiveDetectorName,collectionName[0]);
35 
37  { CerenkovDetectorPMT_CollectionID = G4SDManager::GetSDMpointer()->GetCollectionID(CerenkovDetector_PMTHitsCollection); }
39 }
G4THitsCollection< QweakSimCerenkov_PMTHit > QweakSimCerenkovDetector_PMTHitsCollection
QweakSimCerenkovDetector_PMTHitsCollection * CerenkovDetector_PMTHitsCollection
G4bool QweakSimCerenkov_PMTSD::ProcessHits ( G4Step *  ,
G4TouchableHistory *   
)
inline

Definition at line 23 of file QweakSimCerenkov_PMTSD.hh.

23  {
24  // ProcessHits_constStep(aStep, ROhist);
25  return true;
26  };
G4bool QweakSimCerenkov_PMTSD::ProcessHits_constStep ( const G4Step *  aStep,
G4TouchableHistory *  ROhist 
)

Definition at line 42 of file QweakSimCerenkov_PMTSD.cc.

References CerenkovDetector_PMTHitsCollection, myUserInfo, QweakSimUserInformation::SetCurrentPMTHit(), QweakSimCerenkov_PMTHit::StoreDetectorID(), QweakSimCerenkov_PMTHit::StoreHitID(), QweakSimCerenkov_PMTHit::StoreHitTime(), QweakSimCerenkov_PMTHit::StorePhotonEnergy(), and QweakSimCerenkov_PMTHit::StorePMTID().

Referenced by QweakSimSteppingAction::UserSteppingAction().

43 {
44 
45  if (aStep->GetTrack()->GetDefinition() != G4OpticalPhoton::OpticalPhotonDefinition())
46  return false;
47 
48  G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
49  G4StepPoint* postStepPoint = aStep->GetPostStepPoint();
50 // G4VPhysicalVolume* thePrePV = preStepPoint->GetPhysicalVolume();
51 // G4VPhysicalVolume* thePostPV = postStepPoint->GetPhysicalVolume();
52 
53  G4TouchableHistory* theTouchable = (G4TouchableHistory*)(preStepPoint->GetTouchable());
54 // G4VPhysicalVolume* physVol = theTouchable->GetVolume();
55 
56  if (postStepPoint->GetStepStatus() != fGeomBoundary) return false;
57 
58  //if( physVol->GetName().compare("Cathode_Physical")!=0 ) return false;
59 
60  if (preStepPoint->GetStepStatus() != fGeomBoundary) return false; // Entering Geometry
61 
62  G4double currentPhotonEnergy = aStep->GetTrack()->GetTotalEnergy();
63  G4double currentHitTime = aStep->GetTrack()->GetGlobalTime();
64  G4int MotherCopyNo = theTouchable->GetVolume(1)->GetCopyNo();
66  G4int MotherReplicaNo2 = theTouchable->GetReplicaNumber(3); // Several MotherVolumes
67 
68 // std::cout<<"store hit info: detector "<<MotherReplicaNo2<<" PMTID "<<MotherCopyNo<<std::endl;
69  aHit->StoreDetectorID(MotherReplicaNo2); // which octant (number to be converted)
70  aHit->StorePMTID(MotherCopyNo); // left or right pmt
71 
72  aHit->StorePhotonEnergy(currentPhotonEnergy);
73  aHit->StoreHitTime(currentHitTime);
74  G4int hitCount = CerenkovDetector_PMTHitsCollection->insert(aHit);
75  aHit->StoreHitID(hitCount);
76  //aHit->SetHitValid(False);
77  myUserInfo->SetCurrentPMTHit(aHit,MotherCopyNo);
78 
79  return true;
80 }
void StorePhotonEnergy(G4double eng)
QweakSimUserInformation * myUserInfo
void StoreDetectorID(G4int detector_ID)
void SetCurrentPMTHit(QweakSimCerenkov_PMTHit *hit, G4int side)
QweakSimCerenkovDetector_PMTHitsCollection * CerenkovDetector_PMTHitsCollection
void StoreHitTime(G4double time)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

QweakSimCerenkovDetector_PMTHitsCollection* QweakSimCerenkov_PMTSD::CerenkovDetector_PMTHitsCollection
private

Definition at line 36 of file QweakSimCerenkov_PMTSD.hh.

Referenced by Initialize(), and ProcessHits_constStep().

G4int QweakSimCerenkov_PMTSD::CerenkovDetectorPMT_CollectionID
private

Definition at line 38 of file QweakSimCerenkov_PMTSD.hh.

Referenced by Initialize(), and QweakSimCerenkov_PMTSD().

QweakSimUserInformation* QweakSimCerenkov_PMTSD::myUserInfo
private

Definition at line 34 of file QweakSimCerenkov_PMTSD.hh.

Referenced by ProcessHits_constStep(), and QweakSimCerenkov_PMTSD().


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