CMS 3D CMS Logo

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

#include <HGCNumberingScheme.h>

Public Types

enum  HGCNumberingParameters { HGCCellSize }
 

Public Member Functions

int assignCell (float x, float y, int layer)
 maps a hit position to a sequential cell in a trapezoid surface defined by h,b,t More...
 
std::pair< float, float > getLocalCoords (int cell, int layer)
 inverts the cell number in a trapezoid surface to local coordinates More...
 
uint32_t getUnitID (ForwardSubdetector subdet, int layer, int module, int cell, int iz, const G4ThreeVector &pos)
 assigns the det id to a hit More...
 
 HGCNumberingScheme (const HGCalDDDConstants &hgc, std::string &name)
 
 ~HGCNumberingScheme ()
 

Private Member Functions

 HGCNumberingScheme ()=delete
 

Private Attributes

const HGCalDDDConstantshgcons_
 

Detailed Description

Definition at line 13 of file HGCNumberingScheme.h.

Member Enumeration Documentation

Enumerator
HGCCellSize 

Definition at line 17 of file HGCNumberingScheme.h.

Constructor & Destructor Documentation

HGCNumberingScheme::HGCNumberingScheme ( const HGCalDDDConstants hgc,
std::string &  name 
)

Definition at line 18 of file HGCNumberingScheme.cc.

References dataset::name.

19  :
20  hgcons_(hgc) {
21  edm::LogInfo("HGCSim") << "Creating HGCNumberingScheme for " << name;
22 }
const HGCalDDDConstants & hgcons_
HGCNumberingScheme::~HGCNumberingScheme ( )

Definition at line 24 of file HGCNumberingScheme.cc.

24  {
25  edm::LogInfo("HGCSim") << "Deleting HGCNumberingScheme";
26 }
HGCNumberingScheme::HGCNumberingScheme ( )
privatedelete

Member Function Documentation

int HGCNumberingScheme::assignCell ( float  x,
float  y,
int  layer 
)

maps a hit position to a sequential cell in a trapezoid surface defined by h,b,t

Definition at line 74 of file HGCNumberingScheme.cc.

References HGCalDDDConstants::assignCell(), and hgcons_.

74  {
75 
76  std::pair<int,int> phicell = hgcons_.assignCell(x,y,layer,0,false);
77  return phicell.second;
78 }
std::pair< int, int > assignCell(float x, float y, int lay, int subSec, bool reco) const
const HGCalDDDConstants & hgcons_
std::pair< float, float > HGCNumberingScheme::getLocalCoords ( int  cell,
int  layer 
)

inverts the cell number in a trapezoid surface to local coordinates

Definition at line 80 of file HGCNumberingScheme.cc.

References hgcons_, and HGCalDDDConstants::locateCell().

80  {
81 
82  return hgcons_.locateCell(cell,layer,0,false);
83 }
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
const HGCalDDDConstants & hgcons_
uint32_t HGCNumberingScheme::getUnitID ( ForwardSubdetector  subdet,
int  layer,
int  module,
int  cell,
int  iz,
const G4ThreeVector &  pos 
)

assigns the det id to a hit

Definition at line 28 of file HGCNumberingScheme.cc.

References TauDecayModes::dec, HGCalDDDConstants::geomMode(), HGCalGeometryMode::Hexagon, HGCalGeometryMode::HexagonFull, hgcons_, HGCalDDDConstants::isValidHex(), HGCalTestNumbering::packHexagonIndex(), HGCalDDDConstants::waferFromCopy(), and HGCalDDDConstants::waferFromPosition().

30  {
31  // module is the copy number of the wafer as placed in the layer
32  int icell(0), celltyp(0), wafer(0);
33  uint32_t index(0);
35  if (cell >= 0) {
36  wafer = hgcons_.waferFromCopy(module);
37  celltyp = cell/1000;
38  icell = cell%1000;
39  } else {
40  hgcons_.waferFromPosition(pos.x(),pos.y(),wafer,icell,celltyp);
41  }
42  if (wafer >= 0) {
43  if (celltyp != 1) celltyp = 0;
44  index = HGCalTestNumbering::packHexagonIndex((int)subdet,iz,layer,wafer,
45  celltyp,icell);
46  }
48  wafer = hgcons_.waferFromCopy(module);
49  celltyp = cell/1000;
50  icell = cell%1000;
51  if (celltyp != 1) celltyp = 0;
52 
53  index = HGCalTestNumbering::packHexagonIndex((int)subdet,iz,layer,wafer,
54  celltyp,icell);
55  //check if it fits
56  if (!hgcons_.isValidHex(layer,wafer,icell,false)) {
57  index = 0;
58  edm::LogError("HGCSim") << "[HGCNumberingScheme] ID out of bounds :"
59  << " Subdet= " << subdet << " Zside= " << iz
60  << " Layer= " << layer << " Wafer= " << wafer
61  << ":" << module << " CellType= " << celltyp
62  << " Cell= " << icell;
63  }
64  }
65 #ifdef EDM_ML_DEBUG
66  edm::LogVerbatim("HGCSim") << "HGCNumberingScheme::i/p " << subdet << ":"
67  << layer << ":" << module << ":" << iz << ":"
68  << wafer << ":" << celltyp << ":" << icell << ":"
69  << std::hex << index << std::dec;
70 #endif
71  return index;
72 }
void waferFromPosition(const double x, const double y, int &wafer, int &icell, int &celltyp) const
static uint32_t packHexagonIndex(int subdet, int z, int lay, int wafer, int celltyp, int cell)
bool isValidHex(int lay, int mod, int cell, bool reco) const
HGCalGeometryMode::GeometryMode geomMode() const
int waferFromCopy(int copy) const
Definition: vlib.h:208
const HGCalDDDConstants & hgcons_

Member Data Documentation

const HGCalDDDConstants& HGCNumberingScheme::hgcons_
private

Definition at line 42 of file HGCNumberingScheme.h.

Referenced by assignCell(), getLocalCoords(), and getUnitID().