27 #include "G4StepPoint.hh"
28 #include "G4VProcess.hh"
30 #include "G4SystemOfUnits.hh"
51 rTracker(1200. *
CLHEP::mm),
52 zTracker(3000. *
CLHEP::mm),
76 rotType =
"TrackerFrameRotation";
78 #ifdef FAKEFRAMEROTATION
80 rotType =
"FakeFrameRotation";
84 <<
" Criteria for Saving Tracker SimTracks: \n"
87 <<
"\n FrameRotation type " << rotType <<
" rTracker(cm)= " <<
rTracker / CLHEP::cm
88 <<
" zTracker(cm)= " <<
zTracker / CLHEP::cm
95 std::vector<std::string>
temp;
107 LogDebug(
"TrackerSimDebug") <<
" Entering a new Step " << aStep->GetTotalEnergyDeposit() <<
" "
108 << aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetName();
129 const G4Track* gTrack = (*bot)();
132 if (gTrack->GetCreatorProcess()) {
133 edm::LogVerbatim(
"TrackerSim") <<
" -> PROCESS CREATOR : " << gTrack->GetCreatorProcess()->GetProcessName();
142 const G4ThreeVector&
pos = gTrack->GetPosition();
143 LogDebug(
"TrackerSimDebug") <<
" update(..) of " << gTrack->GetDefinition()->GetParticleName()
144 <<
" trackID= " << gTrack->GetTrackID() <<
" E(MeV)= " << gTrack->GetKineticEnergy()
145 <<
" Ecut= " <<
energyCut <<
" R(mm)= " <<
pos.perp() <<
" Z(mm)= " <<
pos.z();
155 if (gTrack->GetKineticEnergy() >
energyCut) {
157 info->storeTrack(
true);
166 info->putInHistory();
167 LogDebug(
"TrackerSimDebug") <<
" Track inside the tracker selected for HISTORY"
168 <<
" Track ID= " << gTrack->GetTrackID();
179 oldVolume->GetLogicalVolume()->GetName(),
211 const G4Track* theTrack = aStep->GetTrack();
218 if (0.0 == theTrack->GetDefinition()->GetPDGCharge()) {
219 theEntryPoint = theExitPoint;
227 const G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
228 float thePabs = preStepPoint->GetMomentum().mag() /
GeV;
229 float theTof = preStepPoint->GetGlobalTime() / nanosecond;
230 float theEnergyLoss = aStep->GetTotalEnergyDeposit() /
GeV;
233 int theTrackID = theTrack->GetTrackID();
234 if (theDetUnitId == 0) {
235 edm::LogWarning(
"TkAccumulatingSensitiveDetector::createHit") <<
" theDetUnitId is not valid for " << GetName();
236 throw cms::Exception(
"TkAccumulatingSensitiveDetector::createHit")
237 <<
"cannot get theDetUnitId for G4Track " << theTrackID;
243 unsigned int theTrackIDInsideTheSimHit = theTrackID;
246 if (!
temp->storeTrack()) {
248 theTrackIDInsideTheSimHit = theTrack->GetParentID();
249 LogDebug(
"TrackerSimDebug") <<
" TkAccumulatingSensitiveDetector::createHit(): setting the TrackID from "
250 << theTrackIDInsideTheSimHit <<
" to the mother one " << theTrackIDInsideTheSimHit
251 <<
" " << theEnergyLoss;
253 LogDebug(
"TrackerSimDebug") <<
" TkAccumulatingSensitiveDetector:createHit(): leaving the current TrackID "
254 << theTrackIDInsideTheSimHit;
257 const G4ThreeVector& gmd = preStepPoint->GetMomentumDirection();
260 ((G4TouchableHistory*)(preStepPoint->GetTouchable()))->GetHistory()->GetTopTransform().TransformAxis(gmd);
262 float theThetaAtEntry = lnmd.
theta();
263 float thePhiAtEntry = lnmd.
phi();
272 theTrackIDInsideTheSimHit,
288 oldVolume = preStepPoint->GetPhysicalVolume();
289 pname = theTrack->GetDefinition()->GetParticleName();
292 <<
" p= " << aStep->GetPreStepPoint()->GetMomentum().mag() <<
" "
303 float theEnergyLoss = aStep->GetTotalEnergyDeposit() /
GeV;
308 LogDebug(
"TrackerSimDebug") <<
" updateHit: for " << aStep->GetTrack()->GetDefinition()->GetParticleName()
309 <<
" trackID= " << aStep->GetTrack()->GetTrackID() <<
" deltaEloss= " << theEnergyLoss
317 const G4Track* theTrack = aStep->GetTrack();
320 if (0.0 == theTrack->GetDefinition()->GetPDGCharge())
324 int theTrackID = theTrack->GetTrackID();
327 << theDetUnitId <<
"," << theTrackID <<
") Step length(mm)= " << aStep->GetStepLength()
328 <<
" Edep= " << aStep->GetTotalEnergyDeposit()
329 <<
" p= " << aStep->GetPreStepPoint()->GetMomentum().mag();
334 const float tolerance2 = 0.0025f;
342 LogDebug(
"TrackerSimDebug") <<
" Saving the last hit in a ROU " << GetName();
349 eventno = (*i)()->GetEventID();