CMS 3D CMS Logo

TotemT2OrganizationGem.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Forward
4 // Class : TotemT2OrganizationGem
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
20 
21 #include "G4VPhysicalVolume.hh"
22 #include "G4VTouchable.hh"
23 
24 //
25 // constructors and destructor
26 //
27 
29  edm::LogVerbatim("ForwardSim") << "Creating TotemT2OrganizationGem";
30 }
31 
33 
34 uint32_t TotemT2OrganizationGem ::getUnitID(const G4Step* aStep) const {
35  G4VPhysicalVolume* physVol;
36  uint32_t UNITA = 0;
37  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
38 
39 #ifdef SCRIVI
40  for (int ii = 0; ii < touch->GetHistoryDepth(); ii++) {
41  physVol = touch->GetVolume(ii);
42  LogDebug("ForwardSim") << "physVol=" << physVol->GetName() << ", level=" << ii
43  << ", physVol->GetCopyNo()=" << physVol->GetCopyNo();
44  }
45 #endif
46 
47  physVol = touch->GetVolume(0);
48 
49  std::string dName = ForwardName::getName(physVol->GetName());
50  if (dName == "TotemT2gem")
51  UNITA = 10 + physVol->GetCopyNo();
52  else if (dName == "TotemT2gem_supporto")
53  UNITA = 20 + physVol->GetCopyNo();
54  else if (dName == "TotemT2gem_detector7r")
55  UNITA = 100 + physVol->GetCopyNo() + (touch->GetVolume(2)->GetCopyNo()) * 1000;
56  else if (dName == "TotemT2gem_HC7r")
57  UNITA = 200 + touch->GetVolume(1)->GetCopyNo() + (touch->GetVolume(3)->GetCopyNo()) * 1000;
58  else if (dName == "TotemT2gem_drift7r")
59  UNITA = 300 + touch->GetVolume(1)->GetCopyNo() + (touch->GetVolume(3)->GetCopyNo()) * 1000;
60  else if (dName == "TotemT2gem_driftspace7r")
61  UNITA = 400 + touch->GetVolume(1)->GetCopyNo() + (touch->GetVolume(3)->GetCopyNo()) * 1000;
62  else if (dName == "TotemT2gem_GEMa7r")
63  UNITA = 500 + touch->GetVolume(1)->GetCopyNo() + (touch->GetVolume(3)->GetCopyNo()) * 1000;
64  else if (dName == "TotemT2gem_GEMb7r")
65  UNITA = 600 + touch->GetVolume(1)->GetCopyNo() + (touch->GetVolume(3)->GetCopyNo()) * 1000;
66  else if (dName == "TotemT2gem_GEMc7r")
67  UNITA = 700 + touch->GetVolume(1)->GetCopyNo() + (touch->GetVolume(3)->GetCopyNo()) * 1000;
68  else if (dName == "TotemT2gem_GAS7r")
69  UNITA = 800 + touch->GetVolume(1)->GetCopyNo() + (touch->GetVolume(3)->GetCopyNo()) * 1000;
70  else if (dName == "TotemT2gem_GEMa17r")
71  UNITA = 900 + touch->GetVolume(1)->GetCopyNo() + (touch->GetVolume(3)->GetCopyNo()) * 1000;
72  else if (dName == "TotemT2gem_GEMb17r")
73  UNITA = 1000 + touch->GetVolume(1)->GetCopyNo() + (touch->GetVolume(3)->GetCopyNo()) * 1000;
74  else if (dName == "TotemT2gem_GEMc17r")
75  UNITA = 1100 + touch->GetVolume(1)->GetCopyNo() + (touch->GetVolume(3)->GetCopyNo()) * 1000;
76  else if (dName == "TotemT2gem_GAS17r")
77  UNITA = 1200 + touch->GetVolume(1)->GetCopyNo() + (touch->GetVolume(3)->GetCopyNo()) * 1000;
78  else if (dName == "TotemT2gem_GEMa27r")
79  UNITA = 1300 + touch->GetVolume(1)->GetCopyNo() + (touch->GetVolume(3)->GetCopyNo()) * 1000;
80  else if (dName == "TotemT2gem_GEMb27r")
81  UNITA = 1400 + touch->GetVolume(1)->GetCopyNo() + (touch->GetVolume(3)->GetCopyNo()) * 1000;
82  else if (dName == "TotemT2gem_GEMc27r")
83  UNITA = 1500 + touch->GetVolume(1)->GetCopyNo() + (touch->GetVolume(3)->GetCopyNo()) * 1000;
84  else if (dName == "TotemT2gem_GAS27r")
85  UNITA = 1600 + touch->GetVolume(1)->GetCopyNo() + (touch->GetVolume(3)->GetCopyNo()) * 1000;
86  else if (dName == "TotemT2gem_strips7r")
87  UNITA = 1700 + touch->GetVolume(1)->GetCopyNo() + (touch->GetVolume(3)->GetCopyNo()) * 1000;
88  else if (dName == "TotemT2gem_isol7r")
89  UNITA = 1800 + touch->GetVolume(1)->GetCopyNo() + (touch->GetVolume(3)->GetCopyNo()) * 1000;
90  else if (dName == "TotemT2gem_pads7r")
91  UNITA = 1900 + touch->GetVolume(1)->GetCopyNo() + (touch->GetVolume(3)->GetCopyNo()) * 1000;
92  else if (dName == "TotemT2gem_HC17r")
93  UNITA = 2000 + touch->GetVolume(1)->GetCopyNo() + (touch->GetVolume(3)->GetCopyNo()) * 1000;
94 
95  return UNITA;
96 }
Log< level::Info, true > LogVerbatim
uint32_t getUnitID(const G4Step *aStep) const override
ii
Definition: cuy.py:589
std::string getName(const G4String &)
Definition: ForwardName.cc:3
#define LogDebug(id)