CMS 3D CMS Logo

HGCalDDDConstants.h
Go to the documentation of this file.
1 #ifndef HGCalCommonData_HGCalDDDConstants_h
2 #define HGCalCommonData_HGCalDDDConstants_h
3 
14 #include <string>
15 #include <vector>
16 #include <iostream>
20 
21 #include <unordered_map>
22 
24 
25 public:
26 
27  typedef std::array<std::vector<int32_t>, 2> simrecovecs;
28 
31 
32  std::pair<int,int> assignCell(float x, float y, int lay, int subSec,
33  bool reco) const;
34  std::pair<int,int> assignCellSquare(float x, float y, float h, float bl,
35  float tl, float alpha,
36  float cellSize) const;
37  std::pair<int,int> assignCellHexagon(float x, float y) const;
38  double cellSizeHex(int type) const;
39  std::pair<int,int> findCell(int cell, int lay, int subSec, bool reco) const;
40  std::pair<int,int> findCellSquare(int cell, float h, float bl, float tl,
41  float alpha, float cellSize) const;
42  HGCalGeometryMode geomMode() const {return mode_;}
43  bool isValid(int lay, int mod, int cell, bool reco) const;
44  bool isValidCell(int layindex, int wafer, int cell) const;
45  unsigned int layers(bool reco) const;
46  unsigned int layersInit(bool reco) const;
47  std::pair<float,float> locateCell(int cell, int lay, int type,
48  bool reco) const;
49  std::pair<float,float> locateCellHex(int cell, int wafer, bool reco) const;
50  int levelTop() const {return hgpar_->levelT_;}
51  int maxCells(bool reco) const;
52  int maxCells(int lay, bool reco) const;
53  int maxCellsSquare(float h, float bl, float tl, float alpha,
54  float cellSize) const;
55  int maxModules() const {return modHalf_;}
56  int maxRows(int lay, bool reco) const;
57  double minSlope() const {return hgpar_->slopeMin_;}
58  int modules(int lay, bool reco) const;
59  int modulesInit(int lay, bool reco) const;
60  std::pair<int,int> newCell(int cell, int layer, int sector, int subsector,
61  int incrx, int incry, bool half) const;
62  std::pair<int,int> newCell(int cell, int layer, int subsector, int incrz,
63  bool half) const;
64  int newCell(int kx, int ky, int lay, int subSec) const;
65  std::vector<int> numberCells(int lay, bool reco) const;
66  std::vector<int> numberCellsSquare(float h, float bl, float tl,
67  float alpha, float cellSize) const;
68  int numberCellsHexagon(int wafer) const;
69  std::pair<int,int> rowColumnWafer(const int wafer) const;
70  int sectors() const {return hgpar_->nSectors_;}
71  std::pair<int,int> simToReco(int cell, int layer, int mod, bool half) const;
72  unsigned int volumes() const {return hgpar_->moduleLayR_.size();}
73  int waferFromCopy(int copy) const;
74  void waferFromPosition(const double x, const double y,
75  int& wafer, int& icell,
76  int& celltyp) const;
77  bool waferInLayer(int wafer, int lay, bool reco) const;
78  std::pair<double,double> waferPosition(int wafer, bool reco=true) const;
79  int wafers() const;
80  int waferToCopy(int wafer) const {return ((wafer>=0)&&(wafer< (int)(hgpar_->waferCopy_.size()))) ? hgpar_->waferCopy_[wafer] : (int)(hgpar_->waferCopy_.size());}
81  // wafer transverse thickness classification (2 = coarse, 1 = fine)
82  int waferTypeT(int wafer) const {return ((wafer>=0)&&(wafer<(int)(hgpar_->waferTypeT_.size()))) ? hgpar_->waferTypeT_[wafer] : 0;}
83  // wafer longitudinal thickness classification (1 = 100um, 2 = 200um, 3=300um)
84  int waferTypeL(int wafer) const {return ((wafer>=0)&&(wafer<(int)(hgpar_->waferTypeL_.size()))) ? hgpar_->waferTypeL_[wafer] : 0;}
85  bool isHalfCell(int waferType, int cell) const;
86  double waferZ(int layer, bool reco) const;
87 
88  HGCalParameters::hgtrap getModule(unsigned int k, bool hexType, bool reco) const;
89  std::vector<HGCalParameters::hgtrap> getModules() const;
90 
91  unsigned int getTrFormN() const {return hgpar_->trformIndex_.size();}
92  HGCalParameters::hgtrform getTrForm(unsigned int k) const {return hgpar_->getTrForm(k);}
93  std::vector<HGCalParameters::hgtrform> getTrForms() const ;
94 
95  std::pair<int,float> getIndex(int lay, bool reco) const;
96 
97 private:
98  int cellHex(double xx, double yy, const double& cellR,
99  const std::vector<double>& posX,
100  const std::vector<double>& posY) const;
101  void getParameterSquare(int lay, int subSec, bool reco, float& h, float& bl,
102  float& tl, float& alpha) const;
103  bool waferInLayer(int wafer, int lay) const;
104 
106  constexpr static double tan30deg_ = 0.5773502693;
107  double rmax_, hexside_;
110  std::array<uint32_t,2> tot_layers_;
111  simrecovecs max_modules_layer_;
112 };
113 
114 #endif
bool isHalfCell(int waferType, int cell) const
type
Definition: HCALResponse.h:21
float alpha
Definition: AMPTWrapper.h:95
bool isValid(int lay, int mod, int cell, bool reco) const
std::vector< int > numberCellsSquare(float h, float bl, float tl, float alpha, float cellSize) const
std::vector< HGCalParameters::hgtrap > getModules() const
int maxCellsSquare(float h, float bl, float tl, float alpha, float cellSize) const
std::array< uint32_t, 2 > tot_layers_
void waferFromPosition(const double x, const double y, int &wafer, int &icell, int &celltyp) const
std::vector< int > moduleLayR_
double cellSizeHex(int type) const
HGCalParameters::hgtrform getTrForm(unsigned int k) const
unsigned int layersInit(bool reco) const
HGCalDDDConstants(const HGCalParameters *hp, const std::string name)
std::array< std::vector< int32_t >, 2 > simrecovecs
int maxRows(int lay, bool reco) const
std::vector< int > numberCells(int lay, bool reco) const
std::pair< int, int > findCellSquare(int cell, float h, float bl, float tl, float alpha, float cellSize) const
std::pair< int, int > assignCellSquare(float x, float y, float h, float bl, float tl, float alpha, float cellSize) const
int modulesInit(int lay, bool reco) const
std::pair< float, float > locateCell(int cell, int lay, int type, bool reco) const
std::vector< uint32_t > trformIndex_
#define constexpr
int cellHex(double xx, double yy, const double &cellR, const std::vector< double > &posX, const std::vector< double > &posY) const
std::pair< float, float > locateCellHex(int cell, int wafer, bool reco) const
int modules(int lay, bool reco) const
std::pair< int, int > simToReco(int cell, int layer, int mod, bool half) const
unsigned int getTrFormN() const
unsigned int layers(bool reco) const
int numberCellsHexagon(int wafer) const
std::vector< HGCalParameters::hgtrform > getTrForms() const
std::pair< int, int > assignCellHexagon(float x, float y) const
std::pair< double, double > waferPosition(int wafer, bool reco=true) const
susybsm::HSCParticleRefProd hp
Definition: classes.h:27
hgtrform getTrForm(unsigned int k) const
std::pair< int, int > findCell(int cell, int lay, int subSec, bool reco) const
std::pair< int, float > getIndex(int lay, bool reco) const
double minSlope() const
HGCalGeometryMode geomMode() const
bool isValidCell(int layindex, int wafer, int cell) const
int waferTypeL(int wafer) const
int sectors() const
HGCalGeometryMode
std::pair< int, int > rowColumnWafer(const int wafer) const
double waferZ(int layer, bool reco) const
int k[5][pyjets_maxn]
int waferFromCopy(int copy) const
void getParameterSquare(int lay, int subSec, bool reco, float &h, float &bl, float &tl, float &alpha) const
int waferToCopy(int wafer) const
HGCalGeometryMode mode_
std::pair< int, int > newCell(int cell, int layer, int sector, int subsector, int incrx, int incry, bool half) const
simrecovecs max_modules_layer_
int levelTop() const
fixed size matrix
std::vector< int > waferCopy_
std::pair< int, int > assignCell(float x, float y, int lay, int subSec, bool reco) const
std::vector< int > waferTypeT_
int maxModules() const
HGCalParameters::hgtrap getModule(unsigned int k, bool hexType, bool reco) const
const HGCalParameters * hgpar_
int maxCells(bool reco) const
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
int waferTypeT(int wafer) const
std::vector< int > waferTypeL_
static double tan30deg_
bool waferInLayer(int wafer, int lay, bool reco) const
unsigned int volumes() const