27#include <CLHEP/Vector/Rotation.h>
28#include <CLHEP/Vector/ThreeVector.h>
30#include <G4CollectionNameVector.hh>
31#include <G4FastHit.hh>
32#include <G4FastTrack.hh>
33#include <G4RotationMatrix.hh>
34#include <G4StepPoint.hh>
35#include <G4THitsCollection.hh>
36#include <G4ThreeVector.hh>
37#include <G4VSensitiveDetector.hh>
38#include <G4VUserEventInformation.hh>
42#include "G4EventManager.hh"
43#include "G4HCofThisEvent.hh"
44#include "G4SDManager.hh"
55 collectionName.insert(
"hits");
63 , fMeshSizeOfCells(aSize)
65 collectionName.insert(
"hits");
92 G4double edep = aStep->GetTotalEnergyDeposit();
107 if(hit->GetTime() == -1 || hit->GetTime() > aStep->GetTrack()->GetGlobalTime())
108 hit->SetTime(aStep->GetTrack()->GetGlobalTime());
112 if(hit->GetType() != 1)
138 if(hit->GetTime() == -1 || hit->GetTime() > aTrack->GetPrimaryTrack()->GetGlobalTime())
140 hit->SetTime(aTrack->GetPrimaryTrack()->GetGlobalTime());
157 G4EventManager::GetEventManager()->GetConstCurrentEvent()->GetUserInformation());
168 G4RotationMatrix rotMatrix = G4RotationMatrix();
171 rotMatrix.rotateZ(-particlePhi);
172 rotMatrix.rotateY(-particleTheta);
173 G4RotationMatrix rotMatrixInv = CLHEP::inverseOf(rotMatrix);
175 delta = rotMatrix * delta;
193 hit->SetPhiId(phiNo);
194 hit->SetRhoId(rhoNo);
196 hit->SetRot(rotMatrixInv);
G4THitsCollection< Par04Hit > Par04HitsCollection
G4double GetEnergy() const
G4ThreeVector GetPosition() const
Hit class to store energy deposited in the sensitive detector.
G4ThreeVector fMeshSizeOfCells
Size of mesh readout cells in cylindrical coordinates.
G4ThreeVector fEntrancePosition
Retrieved once per event: position of entering particle.
std::unordered_map< G4int, std::unique_ptr< Par04Hit > > fHitsMap
Map of hits to be used in runtime.
G4ThreeVector fMeshNbOfCells
Number of mesh readout cells in cylindrical coordinates.
Par04Hit * RetrieveAndSetupHit(G4ThreeVector aPosition)
Process energy deposit - common part for full and fast simulation It is invoked from ProcessHits() me...
Par04SensitiveDetector(G4String aName)
virtual void Initialize(G4HCofThisEvent *HCE) final
Create hit collection.
virtual G4bool ProcessHits(G4Step *aStep, G4TouchableHistory *aROhist) final
Process energy deposit from the full simulation.
virtual ~Par04SensitiveDetector()
G4int fHitCollectionID
ID of collection of hits.
virtual void EndOfEvent(G4HCofThisEvent *aHC) final
Rewrite hits map to a vector.
G4ThreeVector fEntranceDirection
Retrieved once per event: direction of entering particle.
Par04HitsCollection * fHitsCollection
Collection of hits.