CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
TotemRPOrganization Class Reference

#include <SimG4CMS/Forward/interface/TotemRPOrganization.h>

Inheritance diagram for TotemRPOrganization:
TotemVDetectorOrganization TotemRPNumberingScheme

Public Member Functions

uint32_t GetUnitID (const G4Step *aStep)
 
uint32_t GetUnitID (const G4Step *aStep) const
 
 TotemRPOrganization ()
 
virtual ~TotemRPOrganization ()
 
- Public Member Functions inherited from TotemVDetectorOrganization
 TotemVDetectorOrganization ()
 
virtual ~TotemVDetectorOrganization ()
 

Private Attributes

int _currentCSC
 
int _currentDetectorPosition
 
int _currentLayer
 
int _currentPlane
 
int _currentUnitID
 
bool _needUpdateData
 
bool _needUpdateUnitID
 

Detailed Description

Description: This class manages the UnitID that labels TotemRP sensitive volumes

Usage: Used in TotemSD to get unique ID of sensitive detector element

Definition at line 30 of file TotemRPOrganization.h.

Constructor & Destructor Documentation

TotemRPOrganization::TotemRPOrganization ( )

Definition at line 27 of file TotemRPOrganization.cc.

27  :
30 
31  edm::LogInfo("ForwardSim") << "Creating TotemRPOrganization";
32 }
TotemRPOrganization::~TotemRPOrganization ( )
virtual

Definition at line 34 of file TotemRPOrganization.cc.

34  {
35 }

Member Function Documentation

uint32_t TotemRPOrganization::GetUnitID ( const G4Step *  aStep)

Definition at line 45 of file TotemRPOrganization.cc.

References _currentDetectorPosition, and LogDebug.

Referenced by GetUnitID().

45  {
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 TotemRPOrganization::GetUnitID ( const G4Step *  aStep) const
virtual

Implements TotemVDetectorOrganization.

Definition at line 41 of file TotemRPOrganization.cc.

References GetUnitID().

41  {
42  return const_cast<TotemRPOrganization *>(this)->GetUnitID(aStep);
43 }
uint32_t GetUnitID(const G4Step *aStep)

Member Data Documentation

int TotemRPOrganization::_currentCSC
private

Definition at line 51 of file TotemRPOrganization.h.

int TotemRPOrganization::_currentDetectorPosition
private

Definition at line 49 of file TotemRPOrganization.h.

Referenced by GetUnitID().

int TotemRPOrganization::_currentLayer
private

Definition at line 52 of file TotemRPOrganization.h.

int TotemRPOrganization::_currentPlane
private

Definition at line 50 of file TotemRPOrganization.h.

int TotemRPOrganization::_currentUnitID
private

Definition at line 48 of file TotemRPOrganization.h.

bool TotemRPOrganization::_needUpdateData
private

Definition at line 46 of file TotemRPOrganization.h.

bool TotemRPOrganization::_needUpdateUnitID
private

Definition at line 45 of file TotemRPOrganization.h.