CMS 3D CMS Logo

List of all members | Public Member Functions
PPSStripOrganization Class Reference

#include <PPSStripOrganization.h>

Inheritance diagram for PPSStripOrganization:
TotemRPVDetectorOrganization

Public Member Functions

 PPSStripOrganization ()
 
uint32_t unitID (const G4Step *aStep) override
 
 ~PPSStripOrganization () override=default
 
- Public Member Functions inherited from TotemRPVDetectorOrganization
 TotemRPVDetectorOrganization ()
 
virtual ~TotemRPVDetectorOrganization ()
 

Detailed Description

Definition at line 7 of file PPSStripOrganization.h.

Constructor & Destructor Documentation

◆ PPSStripOrganization()

PPSStripOrganization::PPSStripOrganization ( )
inline

Definition at line 9 of file PPSStripOrganization.h.

9 {}

◆ ~PPSStripOrganization()

PPSStripOrganization::~PPSStripOrganization ( )
overridedefault

Member Function Documentation

◆ unitID()

uint32_t PPSStripOrganization::unitID ( const G4Step *  aStep)
overridevirtual

Implements TotemRPVDetectorOrganization.

Definition at line 11 of file PPSStripOrganization.cc.

References protons_cff::arm, hgcalTestNeighbor_cfi::detector, DetId::rawId(), and relativeConstraints::station.

11  {
12  unsigned int arm = 0;
13  unsigned int station = 0;
14  unsigned int roman_pot = 0;
15 
16  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
17  G4VPhysicalVolume* physVol = touch->GetVolume(0);
18  unsigned int detector = physVol->GetCopyNo();
19  edm::LogVerbatim("PPSStripSim") << "PPSStripSim: PhysVol= " << physVol->GetName() << " coNum=" << detector;
20 
21  G4VPhysicalVolume* physVolVac = touch->GetVolume(2);
22  if (nullptr == physVolVac) {
23  edm::LogError("PPSStripSim") << "Physical volume RP_box_primary_vacuum not found for " << physVol->GetName()
24  << "; cannot determine TotemRPDetId.";
25  } else {
26  int cpy_no = physVolVac->GetCopyNo();
27  arm = (cpy_no / 100) % 10;
28  station = (cpy_no / 10) % 10;
29  roman_pot = cpy_no % 10;
30  }
31  edm::LogVerbatim("PPSStripSim") << " arm=" << arm << " station=" << station << " roman_pot=" << roman_pot
32  << " detector=" << detector;
33  return TotemRPDetId(arm, station, roman_pot, detector).rawId();
34 }
Detector ID class for TOTEM Si strip detectors.
Definition: TotemRPDetId.h:30
Log< level::Info, true > LogVerbatim
Log< level::Error, false > LogError
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57