CMS 3D CMS Logo

PPSStripOrganization.cc
Go to the documentation of this file.
2 
5 
6 #include "G4VPhysicalVolume.hh"
7 #include "G4VTouchable.hh"
8 #include "G4Step.hh"
9 
10 #include <iostream>
11 
12 uint32_t PPSStripOrganization::unitID(const G4Step* aStep) {
13  G4VPhysicalVolume* physVol;
14  unsigned int arm = 0;
15  unsigned int station = 0;
16  unsigned int roman_pot = 0;
17  unsigned int detector = 0;
18 
19  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
20 
21  for (int ii = 0; ii < touch->GetHistoryDepth(); ii++) {
22  physVol = touch->GetVolume(ii);
23  if (physVol->GetName() == "RP_Silicon_Detector") {
24  detector = physVol->GetCopyNo();
25  } else if (physVol->GetName() == "RP_box_primary_vacuum") {
26  int cpy_no = physVol->GetCopyNo();
27  arm = (cpy_no / 100) % 10;
28  station = (cpy_no / 10) % 10;
29  roman_pot = cpy_no % 10;
30  }
31  }
32  return TotemRPDetId(arm, station, roman_pot, detector).rawId();
33 }
MessageLogger.h
relativeConstraints.station
station
Definition: relativeConstraints.py:67
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
PPSStripOrganization.h
TotemRPDetId.h
hgcalTestNeighbor_cfi.detector
detector
Definition: hgcalTestNeighbor_cfi.py:6
PPSStripOrganization::unitID
uint32_t unitID(const G4Step *aStep) override
Definition: PPSStripOrganization.cc:12
cuy.ii
ii
Definition: cuy.py:590
TotemRPDetId
Detector ID class for TOTEM Si strip detectors.
Definition: TotemRPDetId.h:29