7 #include "G4SDManager.hh" 9 #include "G4StepPoint.hh" 10 #include "G4Transform3D.hh" 11 #include "G4LogicalVolumeStore.hh" 12 #include "G4TouchableHistory.hh" 20 G4VSensitiveDetector(iname)
29 G4SDManager * SDman = G4SDManager::GetSDMpointer();
30 SDman->AddNewDetector(
this);
32 const std::vector<std::string>& lvNames = clg.
logicalNames(iname);
34 for (
auto & lvname : lvNames) {
38 edm::LogInfo(
"SensitiveDetector") <<
" <" << iname <<
"> : Assigns SD to LVs " 51 G4LogicalVolumeStore * theStore = G4LogicalVolumeStore::GetInstance();
52 for (
auto & lv : *theStore)
54 if (vname == lv->GetName()) {
55 lv->SetSensitiveDetector(
this);
62 const G4StepPoint * preStepPoint = step->GetPreStepPoint();
63 const G4ThreeVector& globalCoordinates = preStepPoint->GetPosition();
65 G4TouchableHistory * theTouchable=(G4TouchableHistory *)(preStepPoint->GetTouchable());
66 const G4ThreeVector localCoordinates = theTouchable->GetHistory()
67 ->GetTopTransform().TransformPoint(globalCoordinates);
73 const G4StepPoint * postStepPoint = step->GetPostStepPoint();
74 const G4ThreeVector& globalCoordinates = postStepPoint->GetPosition();
76 const G4StepPoint * preStepPoint = step->GetPreStepPoint();
77 G4TouchableHistory * theTouchable = (G4TouchableHistory *)(preStepPoint->GetTouchable());
78 const G4ThreeVector localCoordinates = theTouchable->GetHistory()
79 ->GetTopTransform().TransformPoint(globalCoordinates);
85 const G4StepPoint * preStepPoint = step->GetPreStepPoint();
86 G4TouchableHistory * theTouchable=(G4TouchableHistory *)(preStepPoint->GetTouchable());
87 G4ThreeVector localCoordinates = theTouchable->GetHistory()
88 ->GetTopTransform().TransformPoint(preStepPoint->GetPosition());
94 const G4ThreeVector& globalCoordinates = step->GetPostStepPoint()->GetPosition();
95 G4TouchableHistory * theTouchable = (G4TouchableHistory *)(step->GetPreStepPoint()->GetTouchable());
96 G4ThreeVector localCoordinates = theTouchable->GetHistory()
97 ->GetTopTransform().TransformPoint(globalCoordinates);
109 const G4Track* CurrentTrk = aStep->GetTrack();
110 const G4ThreeVector& CurrentPos = CurrentTrk->GetPosition();
111 double xyz = CurrentPos.x() + CurrentPos.y() + CurrentPos.z();
112 const G4ThreeVector& CurrentMom = CurrentTrk->GetMomentum();
113 xyz += CurrentMom.x() + CurrentMom.y() + CurrentMom.z();
117 const G4VPhysicalVolume* pCurrentVol = aStep->GetPreStepPoint()->GetPhysicalVolume();
118 const G4String& NameOfVol = pCurrentVol->GetName();
119 throw SimG4Exception(
"SimG4CoreSensitiveDetector: Corrupted Event - NaN detected in volume "
SensitiveDetector(const std::string &iname, const DDCompactView &cpv, const SensitiveDetectorCatalog &, edm::ParameterSet const &p)
Local3DPoint ConvertToLocal3DPoint(const G4ThreeVector &point) const
~SensitiveDetector() override
const std::vector< std::string > & logicalNames(const std::string &readoutName) const
type of data representation of DDCompactView
void AssignSD(const std::string &vname)
std::string const collectionName[nCollections]
Local3DPoint FinalStepPosition(const G4Step *step, coordinates) const
std::vector< std::string > namesOfSD
void EndOfEvent(G4HCofThisEvent *eventHC) override
Local3DPoint LocalPostStepPosition(const G4Step *step) const
void setNames(const std::vector< std::string > &)
Local3DPoint LocalPreStepPosition(const G4Step *step) const
void Initialize(G4HCofThisEvent *eventHC) override
void NaNTrap(const G4Step *step) const
Local3DPoint InitialStepPosition(const G4Step *step, coordinates) const