CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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;
16 {
17 
18  public:
19 
22 
24 
25  CaloSegment(const CaloPoint& in,const CaloPoint& out,double si,double siX0,double liX0,Material mat,
26  const CaloGeometryHelper * );
29  inline double sEntrance() const { return sentrance_;};
31  inline double sExit() const { return sexit_;};
33  inline double sX0Entrance() const { return sX0entrance_;};
35  inline double sX0Exit() const { return sX0exit_;};
37  inline double sL0Entrance() const { return sL0entrance_;};
39  inline double sL0Exit() const { return sL0exit_;};
41  inline double length() const { return length_;};
43  inline double X0length() const { return X0length_;};
45  inline double L0length() const { return L0length_;};
47  inline const CaloPoint& entrance() const { return entrance_;};
49  inline const CaloPoint& exit() const { return exit_;};
50 
52  inline bool operator<(const CaloSegment & s) const
53  { return sentrance_<s.sEntrance()&&sexit_<sExit(); }
55  inline Material material() const { return material_; };
57  inline DetId::Detector whichDetector() const {return detector_;};
59  XYZPoint positionAtDepthincm(double depth) const ;
61  XYZPoint positionAtDepthinX0(double depth) const;
63  XYZPoint positionAtDepthinL0(double depth) const;
64 
66  double x0FromCm(double cm) const;
67 
68  private:
69  // static ECALProperties myCaloProperties;
70  CaloPoint entrance_;
71  CaloPoint exit_;
72  double sentrance_;
73  double sexit_;
74  double sX0entrance_;
75  double sX0exit_;
76  double length_;
77  double X0length_;
78  double sL0entrance_;
79  double sL0exit_;
80  double L0length_;
83 
84  public:
87  {
88  public:
89  // inSegment(const CaloSegment & ref):segment_(ref){;};
90  inX0Segment(double depth):ref_(depth)
91  {
92  //std::cout << "inSegment " << std::endl;
93  };
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  {
102  return (ref_>segment.sX0Entrance()&&ref_<segment.sX0Exit());
103  }
104  private:
105  // const CaloSegment & segment_;
106  double ref_;
107  };
108 
110  {
111  public:
112  // inSegment(const CaloSegment & ref):segment_(ref){;};
113  inL0Segment(double depth):ref_(depth)
114  {
115  //std::cout << "inSegment " << std::endl;
116  };
118  // in X0 !!!
119 // bool operator() (double value) const
120 // {
121 // return (value>segment_.sX0Entrance()&&value<segment_.sX0Exit());
122 // }
123  bool operator()(const CaloSegment & segment) const
124  {
125  return (ref_>segment.sL0Entrance()&&ref_<segment.sL0Exit());
126  }
127  private:
128  // const CaloSegment & segment_;
129  double ref_;
130  };
131 
132  class inSegment
133  {
134  public:
135  // inSegment(const CaloSegment & ref):segment_(ref){;};
136  inSegment(double depth):ref_(depth)
137  {
138  //std::cout << "inSegment " << std::endl;
139  };
141  // in X0 !!!
142 // bool operator() (double value) const
143 // {
144 // return (value>segment_.sX0Entrance()&&value<segment_.sX0Exit());
145 // }
146  bool operator()(const CaloSegment & segment) const
147  {
148  // std::cout << " Entrance " << segment.sEntrance() << " Exit " << segment.sExit() << " " << ref_ << " " << segment.whichDetector() << std::endl;
149  return (ref_>segment.sEntrance()&&ref_<segment.sExit());
150  }
151  private:
152  // const CaloSegment & segment_;
153  double ref_;
154  };
155 };
156 #include<iosfwd>
157 std::ostream& operator <<(std::ostream& o , const CaloSegment& cid);
158 
159 #endif
bool operator<(const CaloSegment &s) const
ordering operator wrt to the particle direction
Definition: CaloSegment.h:52
bool operator()(const CaloSegment &segment) const
Definition: CaloSegment.h:100
inX0Segment(double depth)
Definition: CaloSegment.h:90
double length() const
length of the segment (in cm)
Definition: CaloSegment.h:41
math::XYZVector XYZPoint
Definition: CaloSegment.h:21
CaloPoint entrance_
Definition: CaloSegment.h:70
const CaloPoint & entrance() const
first point of the segment
Definition: CaloSegment.h:47
double X0length() const
length of the segment (in X0)
Definition: CaloSegment.h:43
double sL0Exit() const
absciss of the exit (in L0)
Definition: CaloSegment.h:39
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
double sexit_
Definition: CaloSegment.h:73
inL0Segment(double depth)
Definition: CaloSegment.h:113
double sL0Entrance() const
absciss of the entrance (in L0)
Definition: CaloSegment.h:37
XYZPoint positionAtDepthinX0(double depth) const
space point corresponding to this depth (in X0)
Definition: CaloSegment.cc:112
double X0length_
Definition: CaloSegment.h:77
double L0length() const
length of the segment (in L9)
Definition: CaloSegment.h:45
double sL0exit_
Definition: CaloSegment.h:79
Material material() const
material
Definition: CaloSegment.h:55
double sX0exit_
Definition: CaloSegment.h:75
const CaloPoint & exit() const
last point of the segment (there are only two)
Definition: CaloSegment.h:49
inSegment(double depth)
Definition: CaloSegment.h:136
double sentrance_
Definition: CaloSegment.h:72
double sX0Exit() const
absciss of the exit (in X0)
Definition: CaloSegment.h:35
double sEntrance() const
absciss of the entrance (in cm)
Definition: CaloSegment.h:29
double sExit() const
absciss of the exit (in cm)
Definition: CaloSegment.h:31
bool operator()(const CaloSegment &segment) const
Definition: CaloSegment.h:123
double sL0entrance_
Definition: CaloSegment.h:78
tuple out
Definition: dbtoconf.py:99
CaloPoint exit_
Definition: CaloSegment.h:71
This class is used to determine if a point lies in the segment.
Definition: CaloSegment.h:86
double sX0Entrance() const
absciss of the entrance (in X0)
Definition: CaloSegment.h:33
math::XYZVector XYZVector
Definition: CaloSegment.h:20
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
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
XYZPoint positionAtDepthinL0(double depth) const
space point corresponding to this depth (in L0)
Definition: CaloSegment.cc:119
DetId::Detector detector_
Definition: CaloSegment.h:82
Material material_
Definition: CaloSegment.h:81
double length_
Definition: CaloSegment.h:76
math::XYZVector XYZPoint
double x0FromCm(double cm) const
cm to X0 conversion
Definition: CaloSegment.cc:126
double sX0entrance_
Definition: CaloSegment.h:74
DetId::Detector whichDetector() const
In which detector.
Definition: CaloSegment.h:57
double L0length_
Definition: CaloSegment.h:80
XYZPoint positionAtDepthincm(double depth) const
space point corresponding to this depth (in cm)
Definition: CaloSegment.cc:105
bool operator()(const CaloSegment &segment) const
Definition: CaloSegment.h:146