This routine will be called when the appropriate signal arrives.
175 G4Track* theTrack = aStep->GetTrack();
176 int id = theTrack->GetTrackID();
180 if (trkInfo ==
nullptr) {
181 edm::LogError(
"CaloSim") <<
"CaloTrkProcessing: No trk info !!!! abort ";
182 throw cms::Exception(
"Unknown",
"CaloTrkProcessing") <<
"cannot get trkInfo for Track " <<
id <<
"\n";
194 if (prestepLV < 0 && poststepLV >= 0) {
196 edm::LogVerbatim(
"DoFineCalo") <<
"Track " <<
id <<
" entered a fine volume:" 197 <<
" pdgid=" << theTrack->GetDefinition()->GetPDGEncoding()
198 <<
" theTrack->GetCurrentStepNumber()=" << theTrack->GetCurrentStepNumber()
199 <<
" prestepLV=" << prestepLV <<
" poststepLV=" << poststepLV
200 <<
" GetKineticEnergy[GeV]=" << theTrack->GetKineticEnergy() / CLHEP::GeV
201 <<
" prestepPosition[cm]=(" 202 << theTrack->GetStep()->GetPreStepPoint()->GetPosition().x() / CLHEP::cm <<
"," 203 << theTrack->GetStep()->GetPreStepPoint()->GetPosition().y() / CLHEP::cm <<
"," 204 << theTrack->GetStep()->GetPreStepPoint()->GetPosition().z() / CLHEP::cm <<
")" 205 <<
" poststepPosition[cm]=(" 206 << theTrack->GetStep()->GetPostStepPoint()->GetPosition().x() / CLHEP::cm <<
"," 207 << theTrack->GetStep()->GetPostStepPoint()->GetPosition().y() / CLHEP::cm <<
"," 208 << theTrack->GetStep()->GetPostStepPoint()->GetPosition().z() / CLHEP::cm <<
")" 209 <<
" position[cm]=(" << theTrack->GetPosition().x() / CLHEP::cm <<
"," 210 << theTrack->GetPosition().y() / CLHEP::cm <<
"," 211 << theTrack->GetPosition().z() / CLHEP::cm <<
")" 212 <<
" vertex_position[cm]=(" << theTrack->GetVertexPosition().x() / CLHEP::cm <<
"," 213 << theTrack->GetVertexPosition().y() / CLHEP::cm <<
"," 214 << theTrack->GetVertexPosition().z() / CLHEP::cm <<
")" 215 <<
" GetVertexKineticEnergy[GeV]=" 216 << theTrack->GetVertexKineticEnergy() / CLHEP::GeV;
221 edm::LogVerbatim(
"DoFineCalo") <<
"Track " <<
id <<
" marked as boundary-crossing; sanity check:" 222 <<
" theTrack->GetTrackID()=" << theTrack->GetTrackID()
228 edm::LogVerbatim(
"DoFineCalo") <<
"Track " <<
id <<
" REENTERED a fine volume;" 229 <<
" not counting this boundary crossing!";
235 else if (prestepLV >= 0 && poststepLV < 0) {
236 edm::LogVerbatim(
"DoFineCalo") <<
"Track " <<
id <<
" exited a fine volume:" 237 <<
" theTrack->GetCurrentStepNumber()=" << theTrack->GetCurrentStepNumber()
238 <<
" prestepLV=" << prestepLV <<
" poststepLV=" << poststepLV
239 <<
" GetKineticEnergy[GeV]=" << theTrack->GetKineticEnergy() / CLHEP::GeV
240 <<
" prestepPosition[cm]=(" 241 << theTrack->GetStep()->GetPreStepPoint()->GetPosition().x() / CLHEP::cm <<
"," 242 << theTrack->GetStep()->GetPreStepPoint()->GetPosition().y() / CLHEP::cm <<
"," 243 << theTrack->GetStep()->GetPreStepPoint()->GetPosition().z() / CLHEP::cm <<
")" 244 <<
" poststepPosition[cm]=(" 245 << theTrack->GetStep()->GetPostStepPoint()->GetPosition().x() / CLHEP::cm <<
"," 246 << theTrack->GetStep()->GetPostStepPoint()->GetPosition().y() / CLHEP::cm <<
"," 247 << theTrack->GetStep()->GetPostStepPoint()->GetPosition().z() / CLHEP::cm <<
")";
255 edm::LogVerbatim(
"CaloSim") <<
"CaloTrkProcessing set IDonCaloSurface to " <<
id <<
" at step Number " 256 << theTrack->GetCurrentStepNumber();
258 trkInfo->
setIDonCaloSurface(
id, 0, 0, theTrack->GetDefinition()->GetPDGEncoding(), theTrack->GetMomentum().mag());
260 if (theTrack->GetKineticEnergy() / CLHEP::MeV >
eMin_)
269 edm::LogVerbatim(
"CaloSim") <<
"CaloTrkProcessing Entered for " <<
id <<
" at stepNumber " 270 << theTrack->GetCurrentStepNumber() <<
" IDonCaloSur.. " 275 G4StepPoint* postStepPoint = aStep->GetPostStepPoint();
276 const G4VTouchable* post_touch = postStepPoint->GetTouchable();
285 G4StepPoint* postStepPoint = aStep->GetPostStepPoint();
286 const G4VTouchable* post_touch = postStepPoint->GetTouchable();
289 G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
290 const G4VTouchable* pre_touch = preStepPoint->GetTouchable();
292 if (inside >= 0 || (theTrack->GetCurrentStepNumber() == 1)) {
294 id, ical, inside, theTrack->GetDefinition()->GetPDGEncoding(), theTrack->GetMomentum().mag());
299 if (theTrack->GetKineticEnergy() / CLHEP::MeV >
eMin_)
302 edm::LogVerbatim(
"CaloSim") <<
"CaloTrkProcessing: set ID on Calo " << ical <<
" surface (Inside " << inside
303 <<
") to " <<
id <<
" of a Track with Kinetic Energy " 304 << 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_