CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
HGCalNumberingScheme Class Reference

#include <HGCalNumberingScheme.h>

Public Member Functions

uint32_t getUnitID (int layer, int module, int cell, int iz, const G4ThreeVector &pos, double &wt)
 assigns the det id to a hit More...
 
 HGCalNumberingScheme (const HGCalDDDConstants &hgc, const DetId::Detector &det, const std::string &name)
 
 ~HGCalNumberingScheme ()
 

Private Member Functions

 HGCalNumberingScheme ()=delete
 

Private Attributes

DetId::Detector det_
 
const HGCalDDDConstantshgcons_
 
const HGCalGeometryMode::GeometryMode mode_
 
std::string name_
 

Detailed Description

Definition at line 15 of file HGCalNumberingScheme.h.

Constructor & Destructor Documentation

HGCalNumberingScheme::HGCalNumberingScheme ( const HGCalDDDConstants hgc,
const DetId::Detector det,
const std::string &  name 
)

Definition at line 13 of file HGCalNumberingScheme.cc.

References det_, and name_.

15  :
16  hgcons_(hgc), mode_(hgc.geomMode()), det_(det), name_(name) {
17 #ifdef EDM_ML_DEBUG
18  edm::LogVerbatim("HGCSim") << "Creating HGCalNumberingScheme for " << name_
19  << " Det " << det_;
20 #endif
21 }
const HGCalGeometryMode::GeometryMode mode_
const HGCalDDDConstants & hgcons_
HGCalGeometryMode::GeometryMode geomMode() const
HGCalNumberingScheme::~HGCalNumberingScheme ( )

Definition at line 23 of file HGCalNumberingScheme.cc.

23  {
24 #ifdef EDM_ML_DEBUG
25  edm::LogVerbatim("HGCSim") << "Deleting HGCalNumberingScheme";
26 #endif
27 }
HGCalNumberingScheme::HGCalNumberingScheme ( )
privatedelete

Member Function Documentation

uint32_t HGCalNumberingScheme::getUnitID ( int  layer,
int  module,
int  cell,
int  iz,
const G4ThreeVector &  pos,
double &  wt 
)

assigns the det id to a hit

Definition at line 29 of file HGCalNumberingScheme.cc.

References HGCalDDDConstants::assignCellTrap(), TauDecayModes::dec, det_, HGCalGeometryMode::Hexagon8, HGCalGeometryMode::Hexagon8Full, hgcons_, mode_, DetId::rawId(), HGCalGeometryMode::Trapezoid, HGCalDDDConstants::waferFromPosition(), and geometryCSVtoXML::xx.

31  {
32  // module is the copy number of the wafer as placed in the layer
33  uint32_t index(0);
34  wt = 1.0;
37  int cellU(0), cellV(0), waferType(-1), waferU(0), waferV(0);
38  if (cell >= 0) {
39  waferType = module/1000000;
40  waferU = module%100;
41  if ((module/10000)%10 > 0) waferU = -waferU;
42  waferV = (module/100)%100;
43  if ((module/100000)%10 > 0) waferV = -waferV;
44  cellU = cell%100;
45  cellV = (cell/100)%100;
46  } else if (mode_ == HGCalGeometryMode::Hexagon8Full) {
47  double xx = (pos.z() > 0) ? pos.x() : -pos.x();
48  hgcons_.waferFromPosition(xx,pos.y(),layer,waferU,waferV,cellU,
49  cellV,waferType,wt);
50  }
51  if (waferType >= 0) {
52  index = HGCSiliconDetId(det_,iz,waferType,layer,waferU,waferV,
53  cellU,cellV).rawId();
54 #ifdef EDM_ML_DEBUG
55  edm::LogVerbatim("HGCSim") << "OK WaferType " << waferType << " Wafer "
56  << waferU << ":" << waferV << " Cell "
57  << cellU << ":" << cellV;
58  } else {
59  edm::LogVerbatim("HGCSim") << "Bad WaferType " << waferType;
60 #endif
61  }
62  } else if (mode_ == HGCalGeometryMode::Trapezoid) {
63  std::array<int,3> id = hgcons_.assignCellTrap(pos.x(),pos.y(),pos.z(),
64  layer,false);
65  if (id[2] >= 0) {
66  index = HGCScintillatorDetId(id[2], layer, iz*id[0], id[1]).rawId();
67 #ifdef EDM_ML_DEBUG
68  edm::LogVerbatim("HGCSim") << "Eta/Phi " << id[0] << ":" << id[1]
69  << " Type " << id[2] << " Layer|iz "
70  << layer << ":" << iz << " "
72  } else {
73  edm::LogVerbatim("HGCSim") << "Eta/Phi " << id[0] << ":" << id[1]
74  << " Type " << id[2] << " Layer|iz " << layer
75  << ":" << iz;
76 #endif
77  }
78 
79  }
80 #ifdef EDM_ML_DEBUG
81  edm::LogVerbatim("HGCSim") << "HGCalNumberingScheme::i/p " << det_ << ":"
82  << layer << ":" << module << ":" << cell << ":"
83  << iz << ":" << pos.x() << ":" << pos.y() << ":"
84  << pos.z() << " ID " << std::hex << index
85  << std::dec << " wt " << wt;
86 #endif
87  return index;
88 }
void waferFromPosition(const double x, const double y, int &wafer, int &icell, int &celltyp) const
const HGCalGeometryMode::GeometryMode mode_
const HGCalDDDConstants & hgcons_
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
std::array< int, 3 > assignCellTrap(float x, float y, float z, int lay, bool reco) const
Definition: vlib.h:208

Member Data Documentation

DetId::Detector HGCalNumberingScheme::det_
private

Definition at line 34 of file HGCalNumberingScheme.h.

Referenced by getUnitID(), and HGCalNumberingScheme().

const HGCalDDDConstants& HGCalNumberingScheme::hgcons_
private

Definition at line 32 of file HGCalNumberingScheme.h.

Referenced by getUnitID().

const HGCalGeometryMode::GeometryMode HGCalNumberingScheme::mode_
private

Definition at line 33 of file HGCalNumberingScheme.h.

Referenced by getUnitID().

std::string HGCalNumberingScheme::name_
private

Definition at line 35 of file HGCalNumberingScheme.h.

Referenced by HGCalNumberingScheme().