File indexing completed on 2023-03-17 11:24:26
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #include "SimG4CMS/Forward/interface/TotemRPOrganization.h"
0017 #include "SimG4CMS/Forward/interface/TotemNumberMerger.h"
0018 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0019
0020 #include "G4VPhysicalVolume.hh"
0021 #include "G4VTouchable.hh"
0022
0023
0024
0025
0026 TotemRPOrganization ::TotemRPOrganization() { edm::LogVerbatim("ForwardSim") << "Creating TotemRPOrganization"; }
0027
0028 TotemRPOrganization ::~TotemRPOrganization() {}
0029
0030
0031
0032
0033
0034 uint32_t TotemRPOrganization ::getUnitID(const G4Step* aStep) const {
0035 G4VPhysicalVolume* physVol;
0036 int32_t UNITA = 0;
0037 const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
0038
0039 #ifdef SCRIVI
0040 for (int ii = 0; ii < touch->GetHistoryDepth(); ii++) {
0041 physVol = touch->GetVolume(ii);
0042 LogDebug("ForwardSim") << "physVol=" << physVol->GetName() << ", level=" << ii
0043 << ", physVol->GetCopyNo()=" << physVol->GetCopyNo();
0044 }
0045 #endif
0046
0047 physVol = touch->GetVolume(0);
0048
0049 if (physVol->GetName() == "myRP")
0050 UNITA = (touch->GetVolume(5)->GetCopyNo()) * 1111;
0051
0052 #ifdef SCRIVI
0053 LogDebug("ForwardSim") << "\nUNITA-RP " << UNITA << "\n\n";
0054 #endif
0055 return UNITA;
0056 }