21 #include "G4VPhysicalVolume.hh"
22 #include "G4VTouchable.hh"
28 _needUpdateData(
false),
33 _currentObjectType(Undefined) {
35 edm::LogInfo(
"ForwardSim") <<
"Creating TotemT1Organization";
53 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
54 G4VPhysicalVolume* physVol;
56 for ( ii = 0; ii < touch->GetHistoryDepth(); ii++ ){
57 physVol = touch->GetVolume(ii);
60 LogDebug(
"ForwardSim") <<
"physVol=" << physVol->GetName()
61 <<
", level=" << ii <<
", physVol->GetCopyNo()="
62 << physVol->GetCopyNo();
65 if(physVol->GetName() ==
"TotemT1" &&
67 if(physVol->GetName() ==
"TotemT1" &&
71 touch = aStep->GetPreStepPoint()->GetTouchable();
72 physVol=touch->GetVolume(0);
74 currLAOT=physVol->GetCopyNo();
80 if (touch->GetVolume(1)) {
82 if (touch->GetVolume(2))
_currentPlane=touch->GetVolume(2)->GetCopyNo();
105 LogDebug(
"ForwardSim") <<
"_currentUnitID=" << currentUnitID;
115 LogDebug(
"ForwardSim") <<
"GetCurrentDetectorPosition()="
124 LogDebug(
"ForwardSim") <<
"_currentDetectorPosition=" << currentDetectorPosition;
143 LogDebug(
"ForwardSim") <<
"_currentPlane=" << currentPlane;
161 LogDebug(
"ForwardSim") <<
"_currentCSC=" << currentCSC;
179 LogDebug(
"ForwardSim") <<
"_currentLayer=" << currentLayer;
197 LogDebug(
"ForwardSim") <<
"_currentObjectType=" << currentObjectType;
205 int result(static_cast<int>(objectType));
208 edm::LogInfo(
"ForwardSim") <<
"Invalid ObjectType value (" << objectType
209 <<
"). Now is \"Undefined\"";
226 LogDebug(
"ForwardSim") <<
"UnitID update needed.";
231 LogDebug(
"ForwardSim") <<
"UnitID update not needed.";
240 LogDebug(
"ForwardSim") <<
"Data update needed.";
245 LogDebug(
"ForwardSim") <<
"Data update not needed.";
252 int currDP, currCSC, currOT, currPLA;
253 unsigned long currPL, currLA;
267 splitter.
Split(currPLA,currPL,currLA);
270 LogDebug(
"ForwardSim") <<
"currDP=" << currDP <<
", currPL=" << currPL
271 <<
", currCSC=" << currCSC <<
", currLA=" << currLA
272 <<
", currOT=" << currOT <<
", currPLA=" << currPLA
301 int currDP, currPL, currCSC, currLA, currOT;
303 LogDebug(
"ForwardSim") <<
" CURRENT DETECTOR POSITION (0-3) "
325 edm::LogInfo(
"ForwardSim") <<
"Invalid _currentDetectorPosition value ("
327 <<
"). Now is \"Undefined\"";
331 edm::LogInfo(
"ForwardSim") <<
"Invalid _currentPlane value ("
337 if (_currentCSC<-1 || _currentCSC>5) {
345 edm::LogInfo(
"ForwardSim") <<
"Invalid _currentLayer value ("
360 int currPLA(merger.
Merge(currPL,currLA));
364 LogDebug(
"ForwardSim") <<
"currDP=" << currDP <<
", currPL=" << currPL
365 <<
", currCSC=" << currCSC <<
", currLA=" << currLA
366 <<
", currOT=" << currOT <<
", currPLA=" << currPLA
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
virtual ~TotemT1Organization()
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
void _FromDataToUnitID(void)
int FromObjectTypeToInt(ObjectType objectType)
void _FromUnitIDToData(void)