20 #include "G4VPhysicalVolume.hh"
21 #include "G4VTouchable.hh"
28 : _needUpdateUnitID(
false),
29 _needUpdateData(
false),
34 _currentObjectType(Undefined) {
35 edm::LogInfo(
"ForwardSim") <<
"Creating TotemT1Organization";
45 return const_cast<TotemT1Organization*>(
this)->getUnitID(aStep);
50 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
51 G4VPhysicalVolume* physVol;
53 for (
ii = 0;
ii < touch->GetHistoryDepth();
ii++) {
54 physVol = touch->GetVolume(
ii);
57 LogDebug(
"ForwardSim") <<
"physVol=" << physVol->GetName() <<
", level=" <<
ii
58 <<
", physVol->GetCopyNo()=" << physVol->GetCopyNo();
61 if (physVol->GetName() ==
"TotemT1" && physVol->GetCopyNo() == 1)
63 if (physVol->GetName() ==
"TotemT1" && physVol->GetCopyNo() == 2)
67 touch = aStep->GetPreStepPoint()->GetTouchable();
68 physVol = touch->GetVolume(0);
70 currLAOT = physVol->GetCopyNo();
76 if (touch->GetVolume(1)) {
78 if (touch->GetVolume(2))
100 LogDebug(
"ForwardSim") <<
"_currentUnitID=" << currentUnitID;
116 LogDebug(
"ForwardSim") <<
"_currentDetectorPosition=" << currentDetectorPosition;
133 LogDebug(
"ForwardSim") <<
"_currentPlane=" << currentPlane;
149 LogDebug(
"ForwardSim") <<
"_currentCSC=" << currentCSC;
165 LogDebug(
"ForwardSim") <<
"_currentLayer=" << currentLayer;
181 LogDebug(
"ForwardSim") <<
"_currentObjectType=" << currentObjectType;
188 int result(static_cast<int>(objectType));
191 edm::LogInfo(
"ForwardSim") <<
"Invalid ObjectType value (" << objectType <<
"). Now is \"Undefined\"";
207 LogDebug(
"ForwardSim") <<
"UnitID update needed.";
209 const_cast<TotemT1Organization*>(
this)->_FromDataToUnitID();
212 LogDebug(
"ForwardSim") <<
"UnitID update not needed.";
220 LogDebug(
"ForwardSim") <<
"Data update needed.";
222 const_cast<TotemT1Organization*>(
this)->_FromUnitIDToData();
225 LogDebug(
"ForwardSim") <<
"Data update not needed.";
231 int currDP, currCSC, currOT, currPLA;
232 unsigned long currPL, currLA;
246 splitter.Split(currPLA, currPL, currLA);
249 LogDebug(
"ForwardSim") <<
"currDP=" << currDP <<
", currPL=" << currPL <<
", currCSC=" << currCSC
250 <<
", currLA=" << currLA <<
", currOT=" << currOT <<
", currPLA=" << currPLA
279 int currDP, currPL, currCSC, currLA, currOT;
303 <<
"). Now is \"Undefined\"";
312 if (_currentCSC < -1 || _currentCSC > 5) {
333 int currPLA(merger.
Merge(currPL, currLA));
337 LogDebug(
"ForwardSim") <<
"currDP=" << currDP <<
", currPL=" << currPL <<
", currCSC=" << currCSC
338 <<
", currLA=" << currLA <<
", currOT=" << currOT <<
", currPLA=" << currPLA