9 #include "G4StepPoint.hh" 11 #include "G4ThreeVector.hh" 13 #include "CLHEP/Units/GlobalSystemOfUnits.h" 14 #include "CLHEP/Units/GlobalPhysicalConstants.h" 21 :
TimingSD(name, cpv, clg, p, manager) {
27 setCuts(energyCut, energyHistoryCut);
35 unsigned int detId = 0;
37 LogDebug(
"PltSD")<<
" DetID = "<<detId;
40 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
42 if (touch) level = ((touch->GetHistoryDepth())+1);
47 G4String sensorName = touch->GetVolume(2)->GetName();
48 G4String telName = touch->GetVolume(3)->GetName();
49 G4String volumeName = touch->GetVolume(4)->GetName();
50 if ( sensorName !=
"PLTSensorPlane" )
51 std::cout <<
" PltSD::setDetUnitId -w- Sensor name not PLTSensorPlane " << std::endl;
52 if ( telName !=
"Telescope" )
53 std::cout <<
" PltSD::setDetUnitId -w- Telescope name not Telescope " << std::endl;
54 if ( volumeName !=
"PLT" )
55 std::cout <<
" PltSD::setDetUnitId -w- Volume name not PLT " << std::endl;
58 int columnNum = touch->GetReplicaNumber(0);
59 int rowNum = touch->GetReplicaNumber(1);
60 int sensorNum = touch->GetReplicaNumber(2);
61 int telNum = touch->GetReplicaNumber(3);
63 int temp = touch->GetReplicaNumber(5);
66 if (temp == 2) pltNum = 0;
74 else if (telNum == 1){
77 else if (telNum == 2){
80 else if (telNum == 3){
83 else if (telNum == 4){
86 else if (telNum == 5){
89 else if (telNum == 6){
92 else if (telNum == 7){
97 int halfCarriageNum = -1;
100 if(telNum == 0 || telNum == 1 || telNum == 2 || telNum == 3)
105 if(halfCarriageNum == 1){
109 else if (telNum == 5){
112 else if (telNum == 6){
115 else if (telNum == 7){
120 detId = 10000000*pltNum+1000000*halfCarriageNum+100000*telNum+10000*sensorNum+100*rowNum+columnNum;
130 static const float tolerance2 = (
float)(0.0025 * CLHEP::mm * CLHEP::mm);
T getParameter(std::string const &) const
PltSD(const std::string &, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
const G4ThreeVector & getLocalEntryPoint() const
void setCuts(double eCut, double historyCut)
Compact representation of the geometrical detector hierarchy.
bool checkHit(const G4Step *, BscG4Hit *) override
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
const G4ThreeVector & getExitLocalP() const
uint32_t setDetUnitId(const G4Step *) override