CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TotemRPOrganization.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Forward
4 // Class : TotemRPOrganization
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author:
10 // Created: Tue May 16 10:14:34 CEST 2006
11 //
12 
13 // system include files
14 
15 // user include files
19 
20 #include "G4VPhysicalVolume.hh"
21 #include "G4VTouchable.hh"
22 
23 //
24 // constructors and destructor
25 //
26 TotemRPOrganization ::TotemRPOrganization() { edm::LogVerbatim("ForwardSim") << "Creating TotemRPOrganization"; }
27 
29 
30 //
31 // member functions
32 //
33 
34 uint32_t TotemRPOrganization ::getUnitID(const G4Step* aStep) const {
35  G4VPhysicalVolume* physVol;
36  int32_t UNITA = 0;
37  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
38  int ii = 0;
39  for (ii = 0; ii < touch->GetHistoryDepth(); ii++) {
40  physVol = touch->GetVolume(ii);
41 
42 #ifdef SCRIVI
43  LogDebug("ForwardSim") << "physVol=" << physVol->GetName() << ", level=" << ii
44  << ", physVol->GetCopyNo()=" << physVol->GetCopyNo();
45 #endif
46  }
47  physVol = touch->GetVolume(0); //aStep->GetPreStepPoint()->GetPhysicalVolume();
48 
49  if (physVol->GetName() == "myRP")
50  UNITA = (touch->GetVolume(5)->GetCopyNo()) * 1111;
51 
52 #ifdef SCRIVI
53  LogDebug("ForwardSim") << "\nUNITA-RP " << UNITA << "\n\n";
54 #endif
55  return UNITA;
56 }
Log< level::Info, true > LogVerbatim
int ii
Definition: cuy.py:589
uint32_t getUnitID(const G4Step *aStep) const override
#define LogDebug(id)