CMS 3D CMS Logo

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

#include <SimG4CMS/PPS/interface/PPSPixelOrganization.h>

Inheritance diagram for PPSPixelOrganization:
PPSVDetectorOrganization PPSPixelNumberingScheme

Public Member Functions

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

Private Attributes

int currentArm_
 
int currentPlane_
 
int currentRP_
 
int currentStation_
 
int currentUnitID_
 

Detailed Description

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

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

Definition at line 25 of file PPSPixelOrganization.h.

Constructor & Destructor Documentation

PPSPixelOrganization::PPSPixelOrganization ( )

Definition at line 20 of file PPSPixelOrganization.cc.

22  edm::LogInfo("PPSSim") << "Creating PPSPixelOrganization";
23 }
Log< level::Info, false > LogInfo
PPSPixelOrganization::~PPSPixelOrganization ( )
overridedefault

Member Function Documentation

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

Implements PPSVDetectorOrganization.

Definition at line 29 of file PPSPixelOrganization.cc.

References currentArm_, currentPlane_, currentRP_, currentStation_, gpuClustering::id, cuy::ii, and GetRecoTauVFromDQM_MC_cff::kk.

29  {
30  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
31  G4VPhysicalVolume* physVol;
32  int ii = 0;
33  bool foundEnvelop = false;
34  bool foundPhysVol = false;
35 
36  while (ii < touch->GetHistoryDepth() && (foundEnvelop == false || foundPhysVol == false)) {
37  physVol = touch->GetVolume(ii);
38 
39  edm::LogInfo("PPSSim") << "physVol=" << physVol->GetName() << ", level=" << ii
40  << ", physVol->GetCopyNo()=" << physVol->GetCopyNo();
41 
42  if (physVol->GetName().contains("Envelop")) {
43  currentPlane_ = physVol->GetCopyNo() - 1;
44  foundEnvelop = true;
45  } else if (physVol->GetName().contains("RP_box_primary_vacuum")) {
46  int cpy_no = physVol->GetCopyNo();
47  currentArm_ = (cpy_no / 100) % 10;
48  currentStation_ = (cpy_no / 10) % 10;
49  currentRP_ = cpy_no % 10;
50  foundPhysVol = true;
51  }
52  ++ii;
53  }
54 
55  if (foundPhysVol) {
56  edm::LogInfo("PPSSim") << "Arm, RP, plane = " << currentArm_ << " " << currentRP_ << " " << currentPlane_;
57  } else {
58  edm::LogError("PPSSim") << "Physical volume RP_box_primary_vacuum not found. Cannot determine CTPPSPixelDetId.";
59  }
60 
62  uint32_t kk = id.rawId();
63  edm::LogInfo("PPSSim") << " ID " << kk;
64  return id.rawId();
65 }
uint16_t *__restrict__ id
Log< level::Error, false > LogError
int ii
Definition: cuy.py:589
Log< level::Info, false > LogInfo

Member Data Documentation

int PPSPixelOrganization::currentArm_
private

Definition at line 37 of file PPSPixelOrganization.h.

Referenced by unitID().

int PPSPixelOrganization::currentPlane_
private

Definition at line 40 of file PPSPixelOrganization.h.

Referenced by unitID().

int PPSPixelOrganization::currentRP_
private

Definition at line 39 of file PPSPixelOrganization.h.

Referenced by unitID().

int PPSPixelOrganization::currentStation_
private

Definition at line 38 of file PPSPixelOrganization.h.

Referenced by unitID().

int PPSPixelOrganization::currentUnitID_
private

Definition at line 36 of file PPSPixelOrganization.h.