Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-07 02:12:55

0001 // -*- C++ -*-
0002 //
0003 // Package:     Forward
0004 // Class  :     TotemRPOrganization
0005 //
0006 // Implementation:
0007 //     <Notes on implementation>
0008 //
0009 // Original Author:
0010 //         Created:  Tue May 16 10:14:34 CEST 2006
0011 //
0012 
0013 // system include files
0014 
0015 // user include files
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 // constructors and destructor
0025 //
0026 TotemRPOrganization ::TotemRPOrganization() { edm::LogVerbatim("ForwardSim") << "Creating TotemRPOrganization"; }
0027 
0028 TotemRPOrganization ::~TotemRPOrganization() {}
0029 
0030 //
0031 // member functions
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   int ii = 0;
0039   for (ii = 0; ii < touch->GetHistoryDepth(); ii++) {
0040     physVol = touch->GetVolume(ii);
0041 
0042 #ifdef SCRIVI
0043     LogDebug("ForwardSim") << "physVol=" << physVol->GetName() << ", level=" << ii
0044                            << ", physVol->GetCopyNo()=" << physVol->GetCopyNo();
0045 #endif
0046   }
0047   physVol = touch->GetVolume(0);  //aStep->GetPreStepPoint()->GetPhysicalVolume();
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 }