test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  unsigned int layers(bool reco) const;
45  unsigned int layersInit(bool reco) const;
46  std::pair<float,float> locateCell(int cell, int lay, int type,
47  bool reco) const;
48  std::pair<float,float> locateCellHex(int cell, int wafer, bool reco) const;
49  int maxCells(bool reco) const;
50  int maxCells(int lay, bool reco) const;
51  int maxCellsSquare(float h, float bl, float tl, float alpha,
52  float cellSize) const;
53  int maxRows(int lay, bool reco) const;
54  int modules(int lay, bool reco) const;
55  int modulesInit(int lay, bool reco) const;
56  std::pair<int,int> newCell(int cell, int layer, int sector, int subsector,
57  int incrx, int incry, bool half) const;
58  std::pair<int,int> newCell(int cell, int layer, int subsector, int incrz,
59  bool half) const;
60  int newCell(int kx, int ky, int lay, int subSec) const;
61  std::vector<int> numberCells(int lay, bool reco) const;
62  std::vector<int> numberCellsSquare(float h, float bl, float tl,
63  float alpha, float cellSize) const;
64  int numberCellsHexagon(int wafer) const;
65  int sectors() const {return hgpar_->nSectors_;}
66  std::pair<int,int> simToReco(int cell, int layer, int mod, bool half) const;
67  unsigned int volumes() const {return hgpar_->moduleLayR_.size();}
68  int waferFromCopy(int copy) const;
69  bool waferInLayer(int wafer, int lay, bool reco) const;
70  std::pair<double,double> waferPosition(int wafer) const;
71  int wafers() const;
72  int waferToCopy(int wafer) const {return ((wafer>=0)&&(wafer< (int)(hgpar_->waferCopy_.size()))) ? hgpar_->waferCopy_[wafer] : (int)(hgpar_->waferCopy_.size());}
73  int waferTypeT(int wafer) const {return ((wafer>=0)&&(wafer<(int)(hgpar_->waferTypeT_.size()))) ? hgpar_->waferTypeT_[wafer] : 0;}
74  double waferZ(int layer, bool reco) const;
75 
76  HGCalParameters::hgtrap getModule(unsigned int k, bool hexType, bool reco) const;
77  std::vector<HGCalParameters::hgtrap> getModules() const;
78 
79  unsigned int getTrFormN() const {return hgpar_->trformIndex_.size();}
80  HGCalParameters::hgtrform getTrForm(unsigned int k) const {return hgpar_->getTrForm(k);}
81  std::vector<HGCalParameters::hgtrform> getTrForms() const ;
82 
83  std::pair<int,float> getIndex(int lay, bool reco) const;
84 
85 private:
86  int cellHex(double xx, double yy, const double& cellR,
87  const std::vector<double>& posX,
88  const std::vector<double>& posY) const;
89  void getParameterSquare(int lay, int subSec, bool reco, float& h, float& bl,
90  float& tl, float& alpha) const;
91  bool waferInLayer(int wafer, int lay) const;
92 
94  constexpr static double tan30deg_ = 0.5773502693;
95  double rmax_;
97  int32_t tot_wafers_;
98  std::array<uint32_t,2> tot_layers_;
100 };
101 
102 #endif
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
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::array< uint32_t, 2 > tot_layers_
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
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
HGCalGeometryMode geomMode() const
int sectors() const
std::pair< double, double > waferPosition(int wafer) const
HGCalGeometryMode
double waferZ(int layer, bool reco) const
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_
std::vector< int > waferCopy_
std::pair< int, int > assignCell(float x, float y, int lay, int subSec, bool reco) const
std::vector< int > waferTypeT_
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
static double tan30deg_
bool waferInLayer(int wafer, int lay, bool reco) const
unsigned int volumes() const