20 #include "G4VPhysicalVolume.hh" 21 #include "G4VTouchable.hh" 28 _needUpdateData(
false),
33 _currentObjectType(Undefined) {
35 edm::LogInfo(
"ForwardSim") <<
"Creating TotemT1Organization";
52 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
53 G4VPhysicalVolume* physVol;
55 for ( ii = 0; ii < touch->GetHistoryDepth(); ii++ ){
56 physVol = touch->GetVolume(ii);
59 LogDebug(
"ForwardSim") <<
"physVol=" << physVol->GetName()
60 <<
", level=" << ii <<
", physVol->GetCopyNo()=" 61 << physVol->GetCopyNo();
64 if(physVol->GetName() ==
"TotemT1" &&
66 if(physVol->GetName() ==
"TotemT1" &&
70 touch = aStep->GetPreStepPoint()->GetTouchable();
71 physVol=touch->GetVolume(0);
73 currLAOT=physVol->GetCopyNo();
79 if (touch->GetVolume(1)) {
81 if (touch->GetVolume(2))
_currentPlane=touch->GetVolume(2)->GetCopyNo();
104 LogDebug(
"ForwardSim") <<
"_currentUnitID=" << currentUnitID;
114 LogDebug(
"ForwardSim") <<
"getCurrentDetectorPosition()=" 123 LogDebug(
"ForwardSim") <<
"_currentDetectorPosition=" << currentDetectorPosition;
142 LogDebug(
"ForwardSim") <<
"_currentPlane=" << currentPlane;
160 LogDebug(
"ForwardSim") <<
"_currentCSC=" << currentCSC;
178 LogDebug(
"ForwardSim") <<
"_currentLayer=" << currentLayer;
196 LogDebug(
"ForwardSim") <<
"_currentObjectType=" << currentObjectType;
204 int result(static_cast<int>(objectType));
207 edm::LogInfo(
"ForwardSim") <<
"Invalid ObjectType value (" << objectType
208 <<
"). Now is \"Undefined\"";
225 LogDebug(
"ForwardSim") <<
"UnitID update needed.";
230 LogDebug(
"ForwardSim") <<
"UnitID update not needed.";
239 LogDebug(
"ForwardSim") <<
"Data update needed.";
244 LogDebug(
"ForwardSim") <<
"Data update not needed.";
251 int currDP, currCSC, currOT, currPLA;
252 unsigned long currPL, currLA;
266 splitter.
Split(currPLA,currPL,currLA);
269 LogDebug(
"ForwardSim") <<
"currDP=" << currDP <<
", currPL=" << currPL
270 <<
", currCSC=" << currCSC <<
", currLA=" << currLA
271 <<
", currOT=" << currOT <<
", currPLA=" << currPLA
300 int currDP, currPL, currCSC, currLA, currOT;
302 LogDebug(
"ForwardSim") <<
" CURRENT DETECTOR POSITION (0-3) " 324 edm::LogInfo(
"ForwardSim") <<
"Invalid _currentDetectorPosition value (" 326 <<
"). Now is \"Undefined\"";
330 edm::LogInfo(
"ForwardSim") <<
"Invalid _currentPlane value (" 336 if (_currentCSC<-1 || _currentCSC>5) {
344 edm::LogInfo(
"ForwardSim") <<
"Invalid _currentLayer value (" 359 int currPLA(merger.
Merge(currPL,currLA));
363 LogDebug(
"ForwardSim") <<
"currDP=" << currDP <<
", currPL=" << currPL
364 <<
", currCSC=" << currCSC <<
", currLA=" << currLA
365 <<
", 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