CMS 3D CMS Logo

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