20 #include "G4VPhysicalVolume.hh" 21 #include "G4VTouchable.hh" 27 _needUpdateData(
false),
32 _currentObjectType(Undefined) {
34 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
def splitter(iterator, n)
void SetCurrentUnitID(int currentUnitID)
void _checkDataUpdate(void) const
int GetCurrentDetectorPosition(void) const
ObjectType GetCurrentObjectType(void) const
int GetCurrentCSC(void) const
void SetCurrentCSC(int currentCSC)
void SetCurrentLayer(int currentLayer)
unsigned long Merge(unsigned long value1, unsigned long value2) const
void Split(unsigned long source, unsigned long &value1, unsigned long &value2) const
uint32_t GetUnitID(const G4Step *aStep)
ObjectType _currentObjectType
int GetCurrentUnitID(void) const
void _checkUnitIDUpdate(void) const
int _currentDetectorPosition
void SetCurrentDetectorPosition(int currentDetectorPosition)
void SetCurrentObjectType(ObjectType currentObjectType)
int GetCurrentLayer(void) const
void SetCurrentPlane(int currentPlane)
int GetCurrentPlane(void) const
~TotemT1Organization() override
void _FromDataToUnitID(void)
int FromObjectTypeToInt(ObjectType objectType)
void _FromUnitIDToData(void)