CMS 3D CMS Logo

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 //
27  _needUpdateUnitID(false), _needUpdateData(false), _currentUnitID(-1),
28  _currentPlane(-1), _currentCSC(-1), _currentLayer(-1) {
29 
30  edm::LogInfo("ForwardSim") << "Creating TotemRPOrganization";
31 }
32 
34 }
35 
36 //
37 // member functions
38 //
39 
40 uint32_t TotemRPOrganization :: GetUnitID(const G4Step* aStep) const {
41  return const_cast<TotemRPOrganization *>(this)->GetUnitID(aStep);
42 }
43 
44 uint32_t TotemRPOrganization :: GetUnitID(const G4Step* aStep) {
45 
46  G4VPhysicalVolume* physVol;
47  int32_t UNITA=0;
48  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
49  int ii =0;
50  for( ii = 0; ii < touch->GetHistoryDepth(); ii++ ){
51  physVol = touch->GetVolume(ii);
52 
53 #ifdef SCRIVI
54  LogDebug("ForwardSim") << "physVol=" << physVol->GetName() << ", level="
55  << ii << ", physVol->GetCopyNo()="
56  << physVol->GetCopyNo();
57 #endif
58  if (physVol->GetName() == "myRP") _currentDetectorPosition = 3;
59 
60  }
61  physVol= touch->GetVolume(0);//aStep->GetPreStepPoint()->GetPhysicalVolume();
62 
63  if(physVol->GetName() == "myRP") UNITA=(touch->GetVolume(5)->GetCopyNo())*1111;
64 
65 #ifdef SCRIVI
66  LogDebug("ForwardSim") << "\nUNITA-RP " << UNITA << "\n\n";
67 #endif
68  return UNITA;
69 }
#define LogDebug(id)
uint32_t GetUnitID(const G4Step *aStep)
ii
Definition: cuy.py:588