7 #include "G4Geantino.hh"
8 #include "G4ChargedGeantino.hh"
19 const std::string& hitCollectionName,
21 G4VSensitiveDetector(
name ),
23 m_sTGCSimHitCollection( hitCollectionName ),
24 m_baseDepth{baseDepth} {}
34 G4Track* currentTrack = aStep->GetTrack();
35 int charge=currentTrack->GetDefinition()->GetPDGCharge();
37 bool geantinoHit = (currentTrack->GetDefinition()==G4Geantino::GeantinoDefinition()) ||
38 (currentTrack->GetDefinition()==G4ChargedGeantino::ChargedGeantinoDefinition());
40 if (!
charge && (!geantinoHit))
return false;
42 G4StepPoint* postStep=aStep->GetPostStepPoint();
43 const G4Step* post_Step=aStep->GetTrack()->GetStep();
47 G4StepPoint* preStep = aStep->GetPreStepPoint();
50 int pdgCode=currentTrack->GetDefinition()->GetPDGEncoding();
52 float globalTime=postStep->GetGlobalTime();
55 float depositEnergy=post_Step->GetTotalEnergyDeposit();
57 if (depositEnergy<0.0001 && (!geantinoHit))
return false;
59 const G4TouchableHistory* touchHist =
static_cast<const G4TouchableHistory*
>(aStep->GetPreStepPoint()->GetTouchable());
63 int nLayer=touchHist->GetVolume(
m_baseDepth)->GetCopyNo();
64 std::string
chName=touchHist->GetVolume(1+
m_baseDepth)->GetLogicalVolume()->GetName();
70 ATH_MSG_VERBOSE(
"Volume name: "<<
chName<<
", nLayer: "<<nLayer<<
", subType: "<<subType<<
", iRing: "<<iRing);
75 G4ThreeVector posH=postStep->GetPosition();
76 if (subType[1]==
'L') posH.rotateZ(
M_PI/8.);
77 double phiHit=posH.phi();
78 if(phiHit<=0) phiHit+=2.*
M_PI;
81 if (subType[1]==
'L')
iPhi-=1;
84 if (position.z()<0) iSide=-1;
89 if (subType[3]==
'C') mLayer=1;
90 else if (subType[3]==
'P') mLayer=2;
92 else if (subType[1]==
'L')
94 if (subType[3]==
'P') mLayer=1;
95 else if (subType[3]==
'C') mLayer=2;
98 if (mLayer != 1 && mLayer !=2) G4cout <<
" something is wrong - multilayer index is " << mLayer << G4endl;
104 preStep->GetKineticEnergy(),preposition);