File indexing completed on 2023-03-17 11:00:38
0001 #ifndef CaloSegment_h
0002 #define CaloSegment_h
0003
0004
0005
0006
0007
0008
0009
0010 #include "FastSimulation/CaloGeometryTools/interface/CaloPoint.h"
0011
0012 #include <string>
0013
0014 class CaloGeometryHelper;
0015 class CaloSegment {
0016 public:
0017 typedef math::XYZVector XYZVector;
0018 typedef math::XYZVector XYZPoint;
0019
0020 enum Material { PbWO4 = 0, CRACK = 1, GAP = 2, PS = 3, HCAL = 4, ECALHCALGAP = 5, PSEEGAP = 6 };
0021
0022 CaloSegment(const CaloPoint& in,
0023 const CaloPoint& out,
0024 double si,
0025 double siX0,
0026 double liX0,
0027 Material mat,
0028 const CaloGeometryHelper*);
0029 ~CaloSegment() { ; }
0030
0031 inline double sEntrance() const { return sentrance_; };
0032
0033 inline double sExit() const { return sexit_; };
0034
0035 inline double sX0Entrance() const { return sX0entrance_; };
0036
0037 inline double sX0Exit() const { return sX0exit_; };
0038
0039 inline double sL0Entrance() const { return sL0entrance_; };
0040
0041 inline double sL0Exit() const { return sL0exit_; };
0042
0043 inline double length() const { return length_; };
0044
0045 inline double X0length() const { return X0length_; };
0046
0047 inline double L0length() const { return L0length_; };
0048
0049 inline const CaloPoint& entrance() const { return entrance_; };
0050
0051 inline const CaloPoint& exit() const { return exit_; };
0052
0053
0054 inline bool operator<(const CaloSegment& s) const { return sentrance_ < s.sEntrance() && sexit_ < sExit(); }
0055
0056 inline Material material() const { return material_; };
0057
0058 inline DetId::Detector whichDetector() const { return detector_; };
0059
0060 XYZPoint positionAtDepthincm(double depth) const;
0061
0062 XYZPoint positionAtDepthinX0(double depth) const;
0063
0064 XYZPoint positionAtDepthinL0(double depth) const;
0065
0066
0067 double x0FromCm(double cm) const;
0068
0069 private:
0070
0071 CaloPoint entrance_;
0072 CaloPoint exit_;
0073 double sentrance_;
0074 double sexit_;
0075 double sX0entrance_;
0076 double sX0exit_;
0077 double length_;
0078 double X0length_;
0079 double sL0entrance_;
0080 double sL0exit_;
0081 double L0length_;
0082 Material material_;
0083 DetId::Detector detector_;
0084
0085 public:
0086
0087 class inX0Segment {
0088 public:
0089
0090 inX0Segment(double depth)
0091 : ref_(depth){
0092
0093 };
0094 ~inX0Segment() { ; };
0095
0096
0097
0098
0099
0100 bool operator()(const CaloSegment& segment) const {
0101 return (ref_ > segment.sX0Entrance() && ref_ < segment.sX0Exit());
0102 }
0103
0104 private:
0105
0106 double ref_;
0107 };
0108
0109 class inL0Segment {
0110 public:
0111
0112 inL0Segment(double depth)
0113 : ref_(depth){
0114
0115 };
0116 ~inL0Segment() { ; };
0117
0118
0119
0120
0121
0122 bool operator()(const CaloSegment& segment) const {
0123 return (ref_ > segment.sL0Entrance() && ref_ < segment.sL0Exit());
0124 }
0125
0126 private:
0127
0128 double ref_;
0129 };
0130
0131 class inSegment {
0132 public:
0133
0134 inSegment(double depth)
0135 : ref_(depth){
0136
0137 };
0138 ~inSegment() { ; };
0139
0140
0141
0142
0143
0144 bool operator()(const CaloSegment& segment) const {
0145
0146 return (ref_ > segment.sEntrance() && ref_ < segment.sExit());
0147 }
0148
0149 private:
0150
0151 double ref_;
0152 };
0153 };
0154 #include <iosfwd>
0155 std::ostream& operator<<(std::ostream& o, const CaloSegment& cid);
0156
0157 #endif