QwGeant4
QweakSimTriggerScintillator_DetectorSD Class Reference

Storing hit information of the Trigger Scintillator detector. More...

#include <QweakSimTriggerScintillator_DetectorSD.hh>

Inherits G4VSensitiveDetector.

Public Member Functions

 QweakSimTriggerScintillator_DetectorSD (G4String name)
 
 ~QweakSimTriggerScintillator_DetectorSD ()
 
void Initialize (G4HCofThisEvent *HCE)
 
G4bool ProcessHits (G4Step *aStep, G4TouchableHistory *ROhist)
 
void EndOfEvent (G4HCofThisEvent *HCE)
 

Private Attributes

QweakSimTriggerScintillator_DetectorHitsCollectionTriggerScintillator_DetectorHitsCollection
 
G4int TriggerScintillator_CollectionID
 

Detailed Description

Storing hit information of the Trigger Scintillator detector.

Placeholder for a long explaination

Definition at line 57 of file QweakSimTriggerScintillator_DetectorSD.hh.

Constructor & Destructor Documentation

QweakSimTriggerScintillator_DetectorSD::QweakSimTriggerScintillator_DetectorSD ( G4String  name)

Definition at line 15 of file QweakSimTriggerScintillator_DetectorSD.cc.

References TriggerScintillator_CollectionID.

16 :G4VSensitiveDetector(name)
17 {
18  //G4cout << G4endl << "###### Calling QweakSimTriggerScintillator_DetectorSD::QweakSimTriggerScintillator_DetectorSD() " << G4endl << G4endl;
19 
20  collectionName.insert("TriggerScintillatorCollection");
22 
23  //G4cout << G4endl << "###### Leaving QweakSimTriggerScintillator_DetectorSD::QweakSimTriggerScintillator_DetectorSD() " << G4endl << G4endl;
24 }
QweakSimTriggerScintillator_DetectorSD::~QweakSimTriggerScintillator_DetectorSD ( )

Definition at line 27 of file QweakSimTriggerScintillator_DetectorSD.cc.

28 {
29  //G4cout << G4endl << "###### Calling QweakSimTriggerScintillator_DetectorSD::~QweakSimTriggerScintillator_DetectorSD() " << G4endl << G4endl;
30 
31  //delete TriggerScintillator_HitsCollection;
32 
33 }

Member Function Documentation

void QweakSimTriggerScintillator_DetectorSD::EndOfEvent ( G4HCofThisEvent *  HCE)

Definition at line 142 of file QweakSimTriggerScintillator_DetectorSD.cc.

143 {
144  //G4cout << G4endl << "###### Calling QweakSimTriggerScintillator_DetectorSD::EndOfEvent() " << G4endl << G4endl;
145 
146 // G4int NbDCHits = DC_hitsCollection->entries();
147 
148 // G4cout << "\n-------->Hits Collection: in this event they are " << NbDCHits
149 // << " hits in the Drift Cells : " << G4endl;
150 // for (G4int i=0;i<NbDCHits;i++) (*DC_hitsCollection)[i]->Print();
151 
152 
153 
154  //G4cout << G4endl << "###### Leaving QweakSimTriggerScintillator_DetectorSD::EndOfEvent() " << G4endl << G4endl;
155 
156 }
void QweakSimTriggerScintillator_DetectorSD::Initialize ( G4HCofThisEvent *  HCE)

Definition at line 36 of file QweakSimTriggerScintillator_DetectorSD.cc.

References TriggerScintillator_CollectionID, and TriggerScintillator_DetectorHitsCollection.

37 {
38  //G4cout << G4endl << "###### Calling QweakSimTriggerScintillator_DetectorSD::Initialize() " << G4endl << G4endl;
39 
41 
42  //if(TriggerScintillator_CollectionID<0)
43 
44  TriggerScintillator_CollectionID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]);
45 
47 
48  //G4cout << G4endl << "###### Leaving QweakSimTriggerScintillator_DetectorSD::Initialize() " << G4endl << G4endl;
49 }
G4THitsCollection< QweakSimTriggerScintillator_DetectorHit > QweakSimTriggerScintillator_DetectorHitsCollection
QweakSimTriggerScintillator_DetectorHitsCollection * TriggerScintillator_DetectorHitsCollection
G4bool QweakSimTriggerScintillator_DetectorSD::ProcessHits ( G4Step *  aStep,
G4TouchableHistory *  ROhist 
)
Todo:
beware: total.neq.kinetic (testing only)

Definition at line 53 of file QweakSimTriggerScintillator_DetectorSD.cc.

References QweakSimTriggerScintillator_DetectorHit::GetLogVolume(), QweakSimTriggerScintillator_DetectorHit::StoreCellPosition(), QweakSimTriggerScintillator_DetectorHit::StoreCellRotation(), QweakSimTriggerScintillator_DetectorHit::StoreDepositedEnergy(), QweakSimTriggerScintillator_DetectorHit::StoreGlobalTime(), QweakSimTriggerScintillator_DetectorHit::StoreKineticEnergy(), QweakSimTriggerScintillator_DetectorHit::StoreLocalMomentum(), QweakSimTriggerScintillator_DetectorHit::StoreLocalPosition(), QweakSimTriggerScintillator_DetectorHit::StoreLogVolume(), QweakSimTriggerScintillator_DetectorHit::StoreMomentumDirection(), QweakSimTriggerScintillator_DetectorHit::StoreOriginVertexKineticEnergy(), QweakSimTriggerScintillator_DetectorHit::StoreOriginVertexMomentumDirection(), QweakSimTriggerScintillator_DetectorHit::StoreOriginVertexPosition(), QweakSimTriggerScintillator_DetectorHit::StoreOriginVertexTotalEnergy(), QweakSimTriggerScintillator_DetectorHit::StoreParticleName(), QweakSimTriggerScintillator_DetectorHit::StoreParticleType(), QweakSimTriggerScintillator_DetectorHit::StoreTotalEnergy(), QweakSimTriggerScintillator_DetectorHit::StoreTrackID(), QweakSimTriggerScintillator_DetectorHit::StoreWorldMomentum(), QweakSimTriggerScintillator_DetectorHit::StoreWorldPosition(), and TriggerScintillator_DetectorHitsCollection.

54 {
55 // G4cout << G4endl << "###### Calling QweakSimTriggerScintillator_DetectorSD::ProcessHits() " << G4endl << G4endl;
56 
57  G4Track *track = aStep->GetTrack();
58  G4String particlename = track->GetDefinition()->GetParticleName();
59  G4int particletype = track->GetDefinition()->GetPDGEncoding();
60 
61  G4ThreeVector worldPos;
62  G4ThreeVector localPos;
63  G4ThreeVector worldMomentum;
64 
65  G4TouchableHandle theTouchable = aStep->GetPreStepPoint()->GetTouchableHandle();
66 
67  if (aStep->GetPreStepPoint()->GetStepStatus() == fGeomBoundary ) {
68  // Entering Geometry
69  worldPos = aStep->GetPreStepPoint()->GetPosition();
70  localPos = theTouchable->GetHistory()->GetTopTransform().TransformPoint(worldPos);
71  worldMomentum = aStep->GetPreStepPoint()->GetMomentum();
72  } else {
73  return false;
74  }
75 
76  G4ThreeVector localMomentum = theTouchable->GetHistory()->GetTopTransform().TransformPoint(worldMomentum);
77 
78  // Vertex: where this track was generated
79  G4ThreeVector originVertexPosition = aStep->GetTrack()->GetVertexPosition();
80  G4ThreeVector originVertexMomentumDirection = aStep->GetTrack()->GetVertexMomentumDirection();
81  G4double originVertexKineticEnergy = aStep->GetTrack()->GetVertexKineticEnergy();
82 
83  G4double currentKineticEnergy = aStep->GetTrack()->GetKineticEnergy();
84  G4double currentTotalEnergy = aStep->GetTrack()->GetTotalEnergy();
85  G4ThreeVector currentMomentumDirection = aStep->GetTrack()->GetMomentumDirection();
86 
87  G4int trackID = aStep->GetTrack()->GetTrackID();
88 
89  G4int MotherCopyNo = theTouchable->GetVolume(1)->GetCopyNo(); // one Mother Volume
90 
92 
93  // Energy deposited in TS
94  G4double depositedEnergy = aStep->GetTotalEnergyDeposit();
95  aHit->StoreDepositedEnergy(depositedEnergy);
96 
97  aHit->StoreTrackID(trackID);
98 
99  aHit->StoreGlobalTime(aStep->GetPreStepPoint()->GetGlobalTime());
100 
101  aHit->StoreParticleName(particlename);
102  aHit->StoreParticleType(particletype);
103 
104  aHit->StoreWorldPosition(worldPos);
105  aHit->StoreLocalPosition(localPos);
106 
107  aHit->StoreWorldMomentum(worldMomentum);
108  aHit->StoreLocalMomentum(localMomentum);
109 
110  aHit->StoreOriginVertexPosition(originVertexPosition);
111  aHit->StoreOriginVertexKineticEnergy(originVertexKineticEnergy);
112  aHit->StoreOriginVertexTotalEnergy(originVertexKineticEnergy); /// \todo beware: total.neq.kinetic (testing only)
113  aHit->StoreOriginVertexMomentumDirection(originVertexMomentumDirection);
114 
115  aHit->StoreMomentumDirection(currentMomentumDirection);
116  aHit->StoreKineticEnergy(currentKineticEnergy);
117  aHit->StoreTotalEnergy(currentTotalEnergy);
118 
119  // check if it is first touch
120  if(!(aHit->GetLogVolume()))
121  {
122  // store translation and rotation matrix of the drift cell
123  // for the sake of drawing the hit
124  aHit->StoreLogVolume(theTouchable->GetVolume()->GetLogicalVolume());
125  G4AffineTransform aTrans = theTouchable->GetHistory()->GetTopTransform();
126  aTrans.Invert();
127  aHit->StoreCellRotation(aTrans.NetRotation());
128  aHit->StoreCellPosition(aTrans.NetTranslation());
129  }
130 
131 // G4cout << "%%%%%%%%%%%%%%%%%%%%%%% before inserting the hit" << G4endl;
132 
134 
135 // G4cout << G4endl << "###### Leaving QweakSimTriggerScintillatorSD::ProcessHits() " << G4endl << G4endl;
136 
137  return true;
138 }
QweakSimTriggerScintillator_DetectorHitsCollection * TriggerScintillator_DetectorHitsCollection

+ Here is the call graph for this function:

Field Documentation

G4int QweakSimTriggerScintillator_DetectorSD::TriggerScintillator_CollectionID
private
QweakSimTriggerScintillator_DetectorHitsCollection* QweakSimTriggerScintillator_DetectorSD::TriggerScintillator_DetectorHitsCollection
private

Definition at line 70 of file QweakSimTriggerScintillator_DetectorSD.hh.

Referenced by Initialize(), and ProcessHits().


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