20 #include "G4VPhysicalVolume.hh" 21 #include "G4VTouchable.hh" 28 : _needUpdateUnitID(
false),
29 _needUpdateData(
false),
34 _currentObjectType(Undefined) {
35 edm::LogInfo(
"ForwardSim") <<
"Creating TotemT1Organization";
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.";
212 LogDebug(
"ForwardSim") <<
"UnitID update not needed.";
220 LogDebug(
"ForwardSim") <<
"Data update needed.";
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
void setCurrentObjectType(ObjectType currentObjectType)
def splitter(iterator, n)
uint32_t getUnitID(const G4Step *aStep) const override
void _checkDataUpdate(void) const
unsigned long Merge(unsigned long value1, unsigned long value2) const
void setCurrentDetectorPosition(int currentDetectorPosition)
void setCurrentLayer(int currentLayer)
void setCurrentUnitID(int currentUnitID)
void Split(unsigned long source, unsigned long &value1, unsigned long &value2) const
ObjectType _currentObjectType
int getCurrentDetectorPosition(void) const
void _checkUnitIDUpdate(void) const
int _currentDetectorPosition
int getCurrentUnitID(void) const
int getCurrentPlane(void) const
int getCurrentCSC(void) const
void setCurrentPlane(int currentPlane)
int getCurrentLayer(void) const
void setCurrentCSC(int currentCSC)
~TotemT1Organization() override
void _FromDataToUnitID(void)
int fromObjectTypeToInt(ObjectType objectType)
void _FromUnitIDToData(void)
ObjectType getCurrentObjectType(void) const