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>
17 #include <CLHEP/Geometry/Transform3D.h>
18 
20 
21 class DDCompactView;
22 class DDFilteredView;
23 
25 
26 public:
27 
28  struct hgtrap {
29  hgtrap(int lay0, float bl0, float tl0, float h0, float dz0, float alpha0):
30  lay(lay0),bl(bl0),tl(tl0),h(h0),dz(dz0),alpha(alpha0),cellSize(0) {}
31  int lay;
32  float bl, tl, h, dz, alpha, cellSize;
33  };
34  struct hgtrform {
35  hgtrform(int zp0, int lay0, int sec0, int subsec0): zp(zp0), lay(lay0), sec(sec0), subsec(subsec0),used(false) {}
36  int zp, lay, sec, subsec;
37  bool used;
38  CLHEP::Hep3Vector h3v;
39  CLHEP::HepRotation hr;
40  };
41 
42 
45 
46  std::pair<int,int> assignCell(float x, float y, int lay, int subSec,
47  bool reco) const;
48  std::pair<int,int> assignCell(float x, float y, float h, float bl, float tl,
49  float alpha, float cellSize) const;
50  std::pair<int,int> findCell(int cell, int lay, int subSec, bool reco) const;
51  std::pair<int,int> findCell(int cell, float h, float bl, float tl,
52  float alpha, float cellSize) const;
53  bool isValid(int lay, int mod, int cell, bool reco) const;
54  unsigned int layers(bool reco) const {return (reco ? depthIndex.size() : layerIndex.size());}
55  std::pair<float,float> locateCell(int cell, int lay, int subSec,
56  bool reco) const;
57  int maxCells(bool reco) const;
58  int maxCells(int lay, bool reco) const;
59  int maxCells(float h, float bl, float tl, float alpha,
60  float cellSize) const;
61  int maxRows(int lay, bool reco) const;
62  std::pair<int,int> newCell(int cell, int layer, int sector, int subsector,
63  int incrx, int incry, bool half) const;
64  std::pair<int,int> newCell(int cell, int layer, int subsector, int incrz,
65  bool half) const;
66  int newCell(int kx, int ky, int lay, int subSec) const;
67  std::vector<int> numberCells(int lay, bool reco) const;
68  std::vector<int> numberCells(float h, float bl, float tl, float alpha,
69  float cellSize) const;
70  int sectors() const {return nSectors;}
71  std::pair<int,int> simToReco(int cell, int layer, bool half) const;
72 
73  std::vector<hgtrap>::const_iterator getFirstModule(bool reco=false) const { return (reco ? moduler_.begin() : modules_.begin()); }
74  std::vector<hgtrap>::const_iterator getLastModule(bool reco=false) const { return (reco ? moduler_.end() : modules_.end()); }
75  std::vector<hgtrform>::const_iterator getFirstTrForm() const { return trform_.begin(); }
76  std::vector<hgtrform>::const_iterator getLastTrForm() const { return trform_.end(); }
77 
78 private:
79  void initialize(const DDCompactView& cpv, std::string name);
80  void loadGeometry(const DDFilteredView& fv, const std::string& tag);
81  void loadSpecPars(const DDFilteredView& fv);
82  std::vector<double> getDDDArray(const std::string &,
83  const DDsvalues_type &, int &) const;
84  std::pair<int,float> getIndex(int lay, bool reco) const;
85 
87  std::vector<double> cellSize_;
88  std::vector<hgtrap> modules_, moduler_;
89  std::vector<hgtrform> trform_;
90  std::vector<int> layer_, layerIndex;
92 };
93 
94 #endif
float alpha
Definition: AMPTWrapper.h:95
hgtrform(int zp0, int lay0, int sec0, int subsec0)
bool isValid(int lay, int mod, int cell, bool reco) const
std::vector< double > cellSize_
std::vector< hgtrap >::const_iterator getLastModule(bool reco=false) const
std::vector< hgtrap >::const_iterator getFirstModule(bool reco=false) const
int maxRows(int lay, bool reco) const
std::vector< int > numberCells(int lay, bool reco) const
std::vector< int > depth_
std::vector< hgtrap > moduler_
type of data representation of DDCompactView
Definition: DDCompactView.h:77
std::vector< int > depthIndex
void loadGeometry(const DDFilteredView &fv, const std::string &tag)
unsigned int layers(bool reco) const
void initialize(const DDCompactView &cpv, std::string name)
std::pair< int, int > findCell(int cell, int lay, int subSec, bool reco) const
std::pair< int, float > getIndex(int lay, bool reco) const
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
std::maps an index to a DDValue. The index corresponds to the index assigned to the name of the std::...
Definition: DDsvalues.h:19
std::vector< int > cellFactor_
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
void loadSpecPars(const DDFilteredView &fv)
int sectors() const
std::pair< int, int > simToReco(int cell, int layer, bool half) const
std::vector< hgtrform >::const_iterator getFirstTrForm() const
std::vector< hgtrform > trform_
std::vector< int > layer_
std::vector< int > layerGroup_
std::vector< double > getDDDArray(const std::string &, const DDsvalues_type &, int &) const
HGCalDDDConstants(const DDCompactView &cpv, std::string &name)
std::pair< int, int > newCell(int cell, int layer, int sector, int subsector, int incrx, int incry, bool half) const
std::pair< int, int > assignCell(float x, float y, int lay, int subSec, bool reco) const
hgtrap(int lay0, float bl0, float tl0, float h0, float dz0, float alpha0)
volatile std::atomic< bool > shutdown_flag false
std::pair< float, float > locateCell(int cell, int lay, int subSec, bool reco) const
std::vector< hgtrap > modules_
int maxCells(bool reco) const
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
std::vector< hgtrform >::const_iterator getLastTrForm() const
std::vector< int > layerIndex