CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 // $Id: TotemT2OrganizationGem.cc,v 1.1 2006/05/17 16:18:58 sunanda Exp $
12 //
13 
14 // system include files
15 
16 // user include files
20 
21 #include "G4VPhysicalVolume.hh"
22 #include "G4VTouchable.hh"
23 
24 //
25 // constructors and destructor
26 //
27 
29  _needUpdateUnitID(false), _needUpdateData(false),
30  _currentUnitID(-1), _currentPlane(-1), _currentCSC(-1),
31  _currentLayer(-1) {
32  edm::LogInfo("ForwardSim") << "Creating TotemT2OrganizationGem";
33 }
34 
36 }
37 
38 uint32_t TotemT2OrganizationGem :: GetUnitID(const G4Step* aStep) const {
39  return const_cast<TotemT2OrganizationGem *>(this)->GetUnitID(aStep);
40 }
41 
42 uint32_t TotemT2OrganizationGem :: GetUnitID(const G4Step* aStep) {
43 
44  G4VPhysicalVolume* physVol;
45  uint32_t UNITA = 0;
46  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
47  int ii =0;
48  for( ii = 0; ii < touch->GetHistoryDepth(); ii++ ){
49  physVol = touch->GetVolume(ii);
50 
51 #ifdef SCRIVI
52  LogDebug("ForwardSim") << "physVol=" << physVol->GetName() << ", level="
53  << ii << ", physVol->GetCopyNo()="
54  << physVol->GetCopyNo();
55 #endif
56  if (physVol->GetName() == "TotemT2gem") _currentDetectorPosition = 3;
57  }
58 
59  physVol= touch->GetVolume(0);
60 
61  if(physVol->GetName() == "TotemT2gem")UNITA = 10 + physVol->GetCopyNo() ;
62  if(physVol->GetName() == "TotemT2gem_supporto")UNITA =20 + physVol->GetCopyNo();
63  if(physVol->GetName() == "TotemT2gem_detector7r")UNITA = 100 + physVol->GetCopyNo() + (touch->GetVolume(2)->GetCopyNo())*1000;
64  if(physVol->GetName() == "TotemT2gem_HC7r")UNITA = 200 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
65  if(physVol->GetName() == "TotemT2gem_drift7r")UNITA = 300 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
66  if(physVol->GetName() == "TotemT2gem_driftspace7r")UNITA = 400 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
67  if(physVol->GetName() == "TotemT2gem_GEMa7r")UNITA = 500 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
68  if(physVol->GetName() == "TotemT2gem_GEMb7r")UNITA = 600 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
69  if(physVol->GetName() == "TotemT2gem_GEMc7r")UNITA = 700 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
70  if(physVol->GetName() == "TotemT2gem_GAS7r")UNITA = 800 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
71  if(physVol->GetName() == "TotemT2gem_GEMa17r")UNITA = 900 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
72  if(physVol->GetName() == "TotemT2gem_GEMb17r")UNITA = 1000 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
73  if(physVol->GetName() == "TotemT2gem_GEMc17r")UNITA = 1100 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
74  if(physVol->GetName() == "TotemT2gem_GAS17r")UNITA = 1200 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
75  if(physVol->GetName() == "TotemT2gem_GEMa27r")UNITA = 1300 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
76  if(physVol->GetName() == "TotemT2gem_GEMb27r")UNITA = 1400 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
77  if(physVol->GetName() == "TotemT2gem_GEMc27r")UNITA = 1500 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
78  if(physVol->GetName() == "TotemT2gem_GAS27r")UNITA = 1600 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
79  if(physVol->GetName() == "TotemT2gem_strips7r")UNITA = 1700 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
80  if(physVol->GetName() == "TotemT2gem_isol7r")UNITA = 1800 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
81  if(physVol->GetName() == "TotemT2gem_pads7r")UNITA = 1900 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
82  if(physVol->GetName() == "TotemT2gem_HC17r")UNITA = 2000 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
83 
84  return UNITA;
85 }
#define LogDebug(id)
int ii
Definition: cuy.py:588
uint32_t GetUnitID(const G4Step *aStep)