CMS 3D CMS Logo

CaloSegment.h
Go to the documentation of this file.
1 #ifndef CaloSegment_h
2 #define CaloSegment_h
3 
9 //FAMOS headers
11 
12 #include <string>
13 
14 class CaloGeometryHelper;
15 class CaloSegment {
16 public:
19 
20  enum Material { PbWO4 = 0, CRACK = 1, GAP = 2, PS = 3, HCAL = 4, ECALHCALGAP = 5, PSEEGAP = 6 };
21 
22  CaloSegment(const CaloPoint& in,
23  const CaloPoint& out,
24  double si,
25  double siX0,
26  double liX0,
27  Material mat,
28  const CaloGeometryHelper*);
29  ~CaloSegment() { ; }
31  inline double sEntrance() const { return sentrance_; };
33  inline double sExit() const { return sexit_; };
35  inline double sX0Entrance() const { return sX0entrance_; };
37  inline double sX0Exit() const { return sX0exit_; };
39  inline double sL0Entrance() const { return sL0entrance_; };
41  inline double sL0Exit() const { return sL0exit_; };
43  inline double length() const { return length_; };
45  inline double X0length() const { return X0length_; };
47  inline double L0length() const { return L0length_; };
49  inline const CaloPoint& entrance() const { return entrance_; };
51  inline const CaloPoint& exit() const { return exit_; };
52 
54  inline bool operator<(const CaloSegment& s) const { return sentrance_ < s.sEntrance() && sexit_ < sExit(); }
56  inline Material material() const { return material_; };
58  inline DetId::Detector whichDetector() const { return detector_; };
60  XYZPoint positionAtDepthincm(double depth) const;
62  XYZPoint positionAtDepthinX0(double depth) const;
64  XYZPoint positionAtDepthinL0(double depth) const;
65 
67  double x0FromCm(double cm) const;
68 
69 private:
70  // static ECALProperties myCaloProperties;
71  CaloPoint entrance_;
72  CaloPoint exit_;
73  double sentrance_;
74  double sexit_;
75  double sX0entrance_;
76  double sX0exit_;
77  double length_;
78  double X0length_;
79  double sL0entrance_;
80  double sL0exit_;
81  double L0length_;
84 
85 public:
87  class inX0Segment {
88  public:
89  // inSegment(const CaloSegment & ref):segment_(ref){;};
91  : ref_(depth) {
92  //std::cout << "inSegment " << std::endl;
93  };
94  ~inX0Segment() { ; };
95  // in X0 !!!
96  // bool operator() (double value) const
97  // {
98  // return (value>segment_.sX0Entrance()&&value<segment_.sX0Exit());
99  // }
100  bool operator()(const CaloSegment& segment) const {
101  return (ref_ > segment.sX0Entrance() && ref_ < segment.sX0Exit());
102  }
103 
104  private:
105  // const CaloSegment & segment_;
106  double ref_;
107  };
108 
109  class inL0Segment {
110  public:
111  // inSegment(const CaloSegment & ref):segment_(ref){;};
113  : ref_(depth) {
114  //std::cout << "inSegment " << std::endl;
115  };
116  ~inL0Segment() { ; };
117  // in X0 !!!
118  // bool operator() (double value) const
119  // {
120  // return (value>segment_.sX0Entrance()&&value<segment_.sX0Exit());
121  // }
122  bool operator()(const CaloSegment& segment) const {
123  return (ref_ > segment.sL0Entrance() && ref_ < segment.sL0Exit());
124  }
125 
126  private:
127  // const CaloSegment & segment_;
128  double ref_;
129  };
130 
131  class inSegment {
132  public:
133  // inSegment(const CaloSegment & ref):segment_(ref){;};
134  inSegment(double depth)
135  : ref_(depth) {
136  //std::cout << "inSegment " << std::endl;
137  };
138  ~inSegment() { ; };
139  // in X0 !!!
140  // bool operator() (double value) const
141  // {
142  // return (value>segment_.sX0Entrance()&&value<segment_.sX0Exit());
143  // }
144  bool operator()(const CaloSegment& segment) const {
145  // std::cout << " Entrance " << segment.sEntrance() << " Exit " << segment.sExit() << " " << ref_ << " " << segment.whichDetector() << std::endl;
146  return (ref_ > segment.sEntrance() && ref_ < segment.sExit());
147  }
148 
149  private:
150  // const CaloSegment & segment_;
151  double ref_;
152  };
153 };
154 #include <iosfwd>
155 std::ostream& operator<<(std::ostream& o, const CaloSegment& cid);
156 
157 #endif
bool operator()(const CaloSegment &segment) const
Definition: CaloSegment.h:144
double sL0Entrance() const
absciss of the entrance (in L0)
Definition: CaloSegment.h:39
inX0Segment(double depth)
Definition: CaloSegment.h:90
math::XYZVector XYZPoint
Definition: CaloSegment.h:18
double sX0Exit() const
absciss of the exit (in X0)
Definition: CaloSegment.h:37
CaloPoint entrance_
Definition: CaloSegment.h:71
double sexit_
Definition: CaloSegment.h:74
DetId::Detector whichDetector() const
In which detector.
Definition: CaloSegment.h:58
std::ostream & operator<<(std::ostream &o, const CaloSegment &cid)
Definition: CaloSegment.cc:103
inL0Segment(double depth)
Definition: CaloSegment.h:112
double X0length_
Definition: CaloSegment.h:78
XYZPoint positionAtDepthinX0(double depth) const
space point corresponding to this depth (in X0)
Definition: CaloSegment.cc:89
double sL0exit_
Definition: CaloSegment.h:80
const CaloPoint & exit() const
last point of the segment (there are only two)
Definition: CaloSegment.h:51
double sEntrance() const
absciss of the entrance (in cm)
Definition: CaloSegment.h:31
XYZPoint positionAtDepthincm(double depth) const
space point corresponding to this depth (in cm)
Definition: CaloSegment.cc:83
double sX0exit_
Definition: CaloSegment.h:76
Material material() const
material
Definition: CaloSegment.h:56
inSegment(double depth)
Definition: CaloSegment.h:134
double sentrance_
Definition: CaloSegment.h:73
double L0length() const
length of the segment (in L9)
Definition: CaloSegment.h:47
double sL0entrance_
Definition: CaloSegment.h:79
CaloPoint exit_
Definition: CaloSegment.h:72
Definition: HCAL.py:1
This class is used to determine if a point lies in the segment.
Definition: CaloSegment.h:87
math::XYZVector XYZVector
Definition: CaloSegment.h:17
double sExit() const
absciss of the exit (in cm)
Definition: CaloSegment.h:33
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
const CaloPoint & entrance() const
first point of the segment
Definition: CaloSegment.h:49
CaloSegment(const CaloPoint &in, const CaloPoint &out, double si, double siX0, double liX0, Material mat, const CaloGeometryHelper *)
Definition: CaloSegment.cc:11
Detector
Definition: DetId.h:24
double length() const
length of the segment (in cm)
Definition: CaloSegment.h:43
DetId::Detector detector_
Definition: CaloSegment.h:83
Material material_
Definition: CaloSegment.h:82
bool operator()(const CaloSegment &segment) const
Definition: CaloSegment.h:100
double length_
Definition: CaloSegment.h:77
math::XYZVector XYZPoint
bool operator()(const CaloSegment &segment) const
Definition: CaloSegment.h:122
double X0length() const
length of the segment (in X0)
Definition: CaloSegment.h:45
double sL0Exit() const
absciss of the exit (in L0)
Definition: CaloSegment.h:41
double sX0entrance_
Definition: CaloSegment.h:75
XYZPoint positionAtDepthinL0(double depth) const
space point corresponding to this depth (in L0)
Definition: CaloSegment.cc:95
double x0FromCm(double cm) const
cm to X0 conversion
Definition: CaloSegment.cc:101
double L0length_
Definition: CaloSegment.h:81
bool operator<(const CaloSegment &s) const
ordering operator wrt to the particle direction
Definition: CaloSegment.h:54
double sX0Entrance() const
absciss of the entrance (in X0)
Definition: CaloSegment.h:35