This routine will be called when the appropriate signal arrives.
174 G4Track* theTrack = aStep->GetTrack();
175 int id = theTrack->GetTrackID();
179 if (trkInfo ==
nullptr) {
180 edm::LogError(
"CaloSim") <<
"CaloTrkProcessing: No trk info !!!! abort ";
181 throw cms::Exception(
"Unknown",
"CaloTrkProcessing") <<
"cannot get trkInfo for Track " <<
id <<
"\n";
193 if (prestepLV < 0 && poststepLV >= 0) {
195 edm::LogVerbatim(
"DoFineCalo") <<
"Track " <<
id <<
" entered a fine volume:" 196 <<
" pdgid=" << theTrack->GetDefinition()->GetPDGEncoding()
197 <<
" theTrack->GetCurrentStepNumber()=" << theTrack->GetCurrentStepNumber()
198 <<
" prestepLV=" << prestepLV <<
" poststepLV=" << poststepLV
199 <<
" GetKineticEnergy[GeV]=" << theTrack->GetKineticEnergy() / CLHEP::GeV
200 <<
" prestepPosition[cm]=(" 201 << theTrack->GetStep()->GetPreStepPoint()->GetPosition().x() / CLHEP::cm <<
"," 202 << theTrack->GetStep()->GetPreStepPoint()->GetPosition().y() / CLHEP::cm <<
"," 203 << theTrack->GetStep()->GetPreStepPoint()->GetPosition().z() / CLHEP::cm <<
")" 204 <<
" poststepPosition[cm]=(" 205 << theTrack->GetStep()->GetPostStepPoint()->GetPosition().x() / CLHEP::cm <<
"," 206 << theTrack->GetStep()->GetPostStepPoint()->GetPosition().y() / CLHEP::cm <<
"," 207 << theTrack->GetStep()->GetPostStepPoint()->GetPosition().z() / CLHEP::cm <<
")" 208 <<
" position[cm]=(" << theTrack->GetPosition().x() / CLHEP::cm <<
"," 209 << theTrack->GetPosition().y() / CLHEP::cm <<
"," 210 << theTrack->GetPosition().z() / CLHEP::cm <<
")" 211 <<
" vertex_position[cm]=(" << theTrack->GetVertexPosition().x() / CLHEP::cm <<
"," 212 << theTrack->GetVertexPosition().y() / CLHEP::cm <<
"," 213 << theTrack->GetVertexPosition().z() / CLHEP::cm <<
")" 214 <<
" GetVertexKineticEnergy[GeV]=" 215 << theTrack->GetVertexKineticEnergy() / CLHEP::GeV;
220 edm::LogVerbatim(
"DoFineCalo") <<
"Track " <<
id <<
" marked as boundary-crossing; sanity check:" 221 <<
" theTrack->GetTrackID()=" << theTrack->GetTrackID()
227 edm::LogVerbatim(
"DoFineCalo") <<
"Track " <<
id <<
" REENTERED a fine volume;" 228 <<
" not counting this boundary crossing!";
234 else if (prestepLV >= 0 && poststepLV < 0) {
235 edm::LogVerbatim(
"DoFineCalo") <<
"Track " <<
id <<
" exited a fine volume:" 236 <<
" theTrack->GetCurrentStepNumber()=" << theTrack->GetCurrentStepNumber()
237 <<
" prestepLV=" << prestepLV <<
" poststepLV=" << poststepLV
238 <<
" GetKineticEnergy[GeV]=" << theTrack->GetKineticEnergy() / CLHEP::GeV
239 <<
" prestepPosition[cm]=(" 240 << theTrack->GetStep()->GetPreStepPoint()->GetPosition().x() / CLHEP::cm <<
"," 241 << theTrack->GetStep()->GetPreStepPoint()->GetPosition().y() / CLHEP::cm <<
"," 242 << theTrack->GetStep()->GetPreStepPoint()->GetPosition().z() / CLHEP::cm <<
")" 243 <<
" poststepPosition[cm]=(" 244 << theTrack->GetStep()->GetPostStepPoint()->GetPosition().x() / CLHEP::cm <<
"," 245 << theTrack->GetStep()->GetPostStepPoint()->GetPosition().y() / CLHEP::cm <<
"," 246 << theTrack->GetStep()->GetPostStepPoint()->GetPosition().z() / CLHEP::cm <<
")";
254 edm::LogVerbatim(
"CaloSim") <<
"CaloTrkProcessing set IDonCaloSurface to " <<
id <<
" at step Number " 255 << theTrack->GetCurrentStepNumber();
257 trkInfo->
setIDonCaloSurface(
id, 0, 0, theTrack->GetDefinition()->GetPDGEncoding(), theTrack->GetMomentum().mag());
259 if (theTrack->GetKineticEnergy() / CLHEP::MeV >
eMin_)
268 edm::LogVerbatim(
"CaloSim") <<
"CaloTrkProcessing Entered for " <<
id <<
" at stepNumber " 269 << theTrack->GetCurrentStepNumber() <<
" IDonCaloSur.. " 274 G4StepPoint* postStepPoint = aStep->GetPostStepPoint();
275 const G4VTouchable* post_touch = postStepPoint->GetTouchable();
284 G4StepPoint* postStepPoint = aStep->GetPostStepPoint();
285 const G4VTouchable* post_touch = postStepPoint->GetTouchable();
288 G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
289 const G4VTouchable* pre_touch = preStepPoint->GetTouchable();
291 if (inside >= 0 || (theTrack->GetCurrentStepNumber() == 1)) {
293 id, ical, inside, theTrack->GetDefinition()->GetPDGEncoding(), theTrack->GetMomentum().mag());
298 if (theTrack->GetKineticEnergy() / CLHEP::MeV >
eMin_)
301 edm::LogVerbatim(
"CaloSim") <<
"CaloTrkProcessing: set ID on Calo " << ical <<
" surface (Inside " << inside
302 <<
") to " <<
id <<
" of a Track with Kinetic Energy " 303 << theTrack->GetKineticEnergy() / CLHEP::MeV <<
" MeV";
Log< level::Info, true > LogVerbatim
Log< level::Error, false > LogError
int isItInside(const G4VTouchable *, int, int)
std::vector< Detector > fineDetectors_
int isItCalo(const G4VTouchable *, const std::vector< Detector > &)
std::vector< Detector > detectors_