CMS 3D CMS Logo

CrystalPad.h
Go to the documentation of this file.
1 #ifndef FastSimulation_CaloGeometryTools_CrystalPad
2 #define FastSimulation_CaloGeometryTools_CrystalPad
3 
5 
6 #include "CLHEP/Vector/TwoVector.h"
8 //#include "Math/GenVector/Transform3D.h"
10 //C++ headers
11 #include <vector>
12 
13 class CrystalPad {
14 public:
19 
20  CrystalPad() { dummy_ = true; };
22  CrystalPad(unsigned number, const std::vector<CLHEP::Hep2Vector>& corners);
26  CrystalPad(unsigned number,
27  int onEcal,
28  const std::vector<XYZPoint>& corners,
29  const XYZPoint& origin,
30  const XYZVector& vec1,
31  const XYZVector& vec2);
32 
33  CrystalPad(unsigned number,
34  const std::vector<XYZPoint>& corners,
35  const Transform3D&,
36  double scaf = 1.,
37  bool bothdirections = false);
38 
39  CrystalPad(const CrystalPad& right);
40 
41  CrystalPad& operator=(const CrystalPad& rhs);
42 
43  ~CrystalPad() { ; };
44 
46  bool inside(const CLHEP::Hep2Vector& point, bool debug = false) const;
48  // bool globalinside(XYZPoint) const;
49 
51  // CLHEP::Hep2Vector localPoint(XYZPoint point) const;
52 
54  inline const std::vector<CLHEP::Hep2Vector>& getCorners() const { return corners_; }
55 
57  void resetCorners();
58 
60  void print() const;
61 
63  inline double survivalProbability() const { return survivalProbability_; };
64  inline void setSurvivalProbability(double val) { survivalProbability_ = val; };
65 
67  CLHEP::Hep2Vector& edge(unsigned iside, int n);
68 
70  CLHEP::Hep2Vector& edge(CaloDirection);
71 
73  inline unsigned getNumber() const { return number_; };
74 
76  /*
77  inline XYZPoint originalCoordinates(CLHEP::Hep2Vector point) const
78  {
79  XYZPoint p(point.x(),point.y(),0.);
80  return trans_.Inverse() * p;
81  }
82  */
83 
84  inline bool operator==(const CrystalPad& quad) const {
85  // std::cout << " First " << quad.getCellID() << " Second " << this->getCellID() << std::endl;
86  return quad.getNumber() == this->getNumber();
87  }
88 
89  inline bool operator<(const CrystalPad& quad) const { return (center_.mag() < quad.center().mag()); }
90 
92  void extrems(double& xmin, double& xmax, double& ymin, double& ymax) const;
93 
95  inline const CLHEP::Hep2Vector& center() const { return center_; }
96 
98  void getDrawingCoordinates(std::vector<float>& x, std::vector<float>& y) const;
99 
100 private:
101  static std::vector<CLHEP::Hep2Vector> aVector;
102 
103  std::vector<CLHEP::Hep2Vector> corners_;
104  std::vector<CLHEP::Hep2Vector> dir_;
105  unsigned number_;
107  ROOT::Math::Rotation3D rotation_;
110  CLHEP::Hep2Vector center_;
111  double epsilon_;
112  bool dummy_;
114 
115 public:
117  class padEqual {
118  public:
119  padEqual(unsigned cell)
120  : ref_(cell){
121  // std::cout << " quadEqual " << ref_ << std::endl;
122  };
123  ~padEqual() { ; };
124  inline bool operator()(const CrystalPad& quad) const { return (ref_ == quad.getNumber()); }
125 
126  private:
127  unsigned ref_;
128  };
129 };
130 
131 #include <iosfwd>
132 std::ostream& operator<<(std::ostream& o, CrystalPad& quad);
133 
134 #endif
DDAxes::y
CrystalPad::yscalefactor_
double yscalefactor_
Definition: CrystalPad.h:113
CaloDirection
CaloDirection
Codes the local directions in the cell lattice.
Definition: CaloDirection.h:9
CaloDirection.h
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
CrystalPad::dir_
std::vector< CLHEP::Hep2Vector > dir_
Definition: CrystalPad.h:104
vec1
std::vector< double > vec1
Definition: HCALResponse.h:15
CrystalPad::operator<
bool operator<(const CrystalPad &quad) const
Definition: CrystalPad.h:89
CrystalPad::operator=
CrystalPad & operator=(const CrystalPad &rhs)
Definition: CrystalPad.cc:17
CrystalPad::getCorners
const std::vector< CLHEP::Hep2Vector > & getCorners() const
Check that the point (in the global frame) is inside the crystal.
Definition: CrystalPad.h:54
operator<<
std::ostream & operator<<(std::ostream &o, CrystalPad &quad)
Definition: CrystalPad.cc:274
CrystalPad::getDrawingCoordinates
void getDrawingCoordinates(std::vector< float > &x, std::vector< float > &y) const
for graphic debugging
Definition: CrystalPad.cc:284
CrystalPad::Transform3D
ROOT::Math::Transform3DPJ Transform3D
Definition: CrystalPad.h:17
CrystalPad::Point
ROOT::Math::Transform3DPJ::Point Point
Definition: CrystalPad.h:18
XYZVector
math::XYZVector XYZVector
Definition: RawParticle.h:26
CrystalPad::dummy_
bool dummy_
Definition: CrystalPad.h:112
CrystalPad::padEqual::~padEqual
~padEqual()
Definition: CrystalPad.h:123
DDAxes::x
CrystalPad::print
void print() const
print
Definition: CrystalPad.cc:205
CrystalPad::survivalProbability_
double survivalProbability_
Definition: CrystalPad.h:109
vec2
std::vector< vec1 > vec2
Definition: HCALResponse.h:16
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:42
CrystalPad::center
const CLHEP::Hep2Vector & center() const
get the center
Definition: CrystalPad.h:95
CrystalPad::padEqual::operator()
bool operator()(const CrystalPad &quad) const
Definition: CrystalPad.h:124
CrystalPad::padEqual::padEqual
padEqual(unsigned cell)
Definition: CrystalPad.h:119
CrystalPad::padEqual
equality operator
Definition: CrystalPad.h:117
CrystalPad
Definition: CrystalPad.h:13
debug
#define debug
Definition: HDRShower.cc:19
L1TOccupancyClient_cfi.ymax
ymax
Definition: L1TOccupancyClient_cfi.py:43
contentValuesFiles.number
number
Definition: contentValuesFiles.py:53
CrystalPad::edge
CLHEP::Hep2Vector & edge(unsigned iside, int n)
access to the corners in direction iside; n=0,1
Definition: CrystalPad.cc:222
CrystalPad::XYZVector
math::XYZVector XYZVector
Definition: CrystalPad.h:15
CrystalPad::trans_
Transform3D trans_
Definition: CrystalPad.h:106
ROOT::Math::Transform3DPJ::Point
PositionVector3D< Cartesian3D< double >, DefaultCoordinateSystemTag > Point
Definition: Transform3DPJ.h:65
CrystalPad::rotation_
ROOT::Math::Rotation3D rotation_
Definition: CrystalPad.h:107
CrystalPad::aVector
static std::vector< CLHEP::Hep2Vector > aVector
Definition: CrystalPad.h:101
CrystalPad::padEqual::ref_
unsigned ref_
Definition: CrystalPad.h:127
CrystalPad::CrystalPad
CrystalPad()
Definition: CrystalPad.h:20
CrystalPad::extrems
void extrems(double &xmin, double &xmax, double &ymin, double &ymax) const
xmin xmax, ymin ymax of the quad
Definition: CrystalPad.cc:246
CrystalPad::survivalProbability
double survivalProbability() const
access methods to the survivalProbability
Definition: CrystalPad.h:63
CrystalPad::number_
unsigned number_
Definition: CrystalPad.h:105
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
CrystalPad::setSurvivalProbability
void setSurvivalProbability(double val)
Definition: CrystalPad.h:64
CrystalPad::corners_
std::vector< CLHEP::Hep2Vector > corners_
Definition: CrystalPad.h:103
ROOT::Math::Transform3DPJ
Definition: Transform3DPJ.h:62
CrystalPad::getNumber
unsigned getNumber() const
access to the number
Definition: CrystalPad.h:73
XYZPoint
math::XYZVector XYZPoint
Definition: CalorimetryManager.cc:69
CrystalPad::epsilon_
double epsilon_
Definition: CrystalPad.h:111
Transform3DPJ.h
heppy_batch.val
val
Definition: heppy_batch.py:351
CrystalPad::center_
CLHEP::Hep2Vector center_
Definition: CrystalPad.h:110
L1TOccupancyClient_cfi.ymin
ymin
Definition: L1TOccupancyClient_cfi.py:43
TrackerOfflineValidation_Dqm_cff.xmax
xmax
Definition: TrackerOfflineValidation_Dqm_cff.py:11
CrystalPad::XYZPoint
math::XYZVector XYZPoint
Definition: CrystalPad.h:16
TrackerOfflineValidation_Dqm_cff.xmin
xmin
Definition: TrackerOfflineValidation_Dqm_cff.py:10
point
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
CrystalPad::inside
bool inside(const CLHEP::Hep2Vector &point, bool debug=false) const
Check that the point (in the local frame) is inside the crystal.
Definition: CrystalPad.cc:127
Vector3D.h
CrystalPad::operator==
bool operator==(const CrystalPad &quad) const
get the coordinates in the original frame
Definition: CrystalPad.h:84
CrystalPad::~CrystalPad
~CrystalPad()
Definition: CrystalPad.h:43
CrystalPad::translation_
XYZVector translation_
Definition: CrystalPad.h:108
CrystalPad::resetCorners
void resetCorners()
Rescale the Quad to allow for some inaccuracy ...
Definition: CrystalPad.cc:261