CMS 3D CMS Logo

CaloSegment.cc
Go to the documentation of this file.
1 //FAMOS headers
8 
10 
11 CaloSegment::CaloSegment(const CaloPoint& in,
12  const CaloPoint& out,
13  double si,
14  double siX0,
15  double siL0,
16  Material mat,
17  const CaloGeometryHelper* myCalorimeter)
18  : entrance_(in),
19  exit_(out),
20  sentrance_(si),
21  sX0entrance_(siX0),
22  sL0entrance_(siL0),
23  material_(mat)
24 
25 {
27  // Change this. CaloProperties from FamosShower should be used instead
28  double radLenIncm = 999999;
29  double intLenIncm = 999999;
30  detector_ = in.whichDetector();
31  if (detector_ != out.whichDetector() && mat != CRACK && mat != GAP && mat != ECALHCALGAP) {
32  std::cout << " Problem in the segments " << detector_ << " " << out.whichDetector() << std::endl;
33  }
34  switch (mat) {
35  case PbWO4: {
36  int det = 0;
37  if (in.whichSubDetector() == EcalBarrel)
38  det = 1;
39  if (in.whichSubDetector() == EcalEndcap)
40  det = 2;
41 
42  radLenIncm = myCalorimeter->ecalProperties(det)->radLenIncm();
43  intLenIncm = myCalorimeter->ecalProperties(det)->interactionLength();
44  } break;
45  case CRACK: {
46  radLenIncm = 8.9; //cracks : Al
47  intLenIncm = 35.4;
48  } break;
49  case PS: {
50  radLenIncm = myCalorimeter->layer1Properties(1)->radLenIncm();
51  intLenIncm = myCalorimeter->layer1Properties(1)->interactionLength();
52  } break;
53  case HCAL: {
54  radLenIncm = myCalorimeter->hcalProperties(1)->radLenIncm();
55  intLenIncm = myCalorimeter->hcalProperties(1)->interactionLength();
56  } break;
57  case ECALHCALGAP: {
58  // From Olga's & Patrick's talk PRS/JetMET 21 Sept 2004
59  radLenIncm = 22.3;
60  intLenIncm = 140;
61  } break;
62  case PSEEGAP: {
63  // according to Sunanda 0.19 X0 (0.08X0 of polyethylene), support (0.06X0 of aluminium) + other stuff
64  // in the geometry 12 cm between layer and entrance of EE. Polyethylene is rather 48 and Al 8.9 (PDG)
65  // for the inLen, just rescale according to PDG (85cm)
66  radLenIncm = myCalorimeter->layer2Properties(1)->pseeRadLenIncm();
67  intLenIncm = myCalorimeter->layer2Properties(1)->pseeIntLenIncm();
68  } break;
69  default:
70  radLenIncm = 999999;
71  }
72  sX0exit_ = sX0entrance_ + (sexit_ - sentrance_) / radLenIncm;
73  sL0exit_ = sL0entrance_ + (sexit_ - sentrance_) / intLenIncm;
74  if (mat == GAP) {
76  sL0exit_ = sL0entrance_;
77  }
80  L0length_ = sL0exit_ - sL0entrance_;
81 }
82 
84  if (depth < sentrance_ || depth > sexit_)
85  return XYZPoint();
86  return XYZPoint(entrance_ + ((depth - sentrance_) / (sexit_ - sentrance_) * (exit_ - entrance_)));
87 }
88 
90  if (depth < sX0entrance_ || depth > sX0exit_)
91  return XYZPoint();
92  return XYZPoint(entrance_ + ((depth - sX0entrance_) / (sX0exit_ - sX0entrance_) * (exit_ - entrance_)));
93 }
94 
96  if (depth < sL0entrance_ || depth > sL0exit_)
97  return XYZPoint();
98  return XYZPoint(entrance_ + ((depth - sL0entrance_) / (sL0exit_ - sL0entrance_) * (exit_ - entrance_)));
99 }
100 
101 double CaloSegment::x0FromCm(double cm) const { return sX0entrance_ + cm / length_ * X0length_; }
102 
103 std::ostream& operator<<(std::ostream& ost, const CaloSegment& seg) {
104  ost << " DetId ";
105  if (!seg.entrance().getDetId().null())
106  ost << seg.entrance().getDetId()();
107  else {
108  ost << seg.entrance().whichDetector();
109  // ost<< " Entrance side " << seg.entrance().getSide()
110  ost << " Point " << (math::XYZVector)seg.entrance() << std::endl;
111  }
112  ost << "DetId ";
113  if (!seg.exit().getDetId().null())
114  ost << seg.exit().getDetId()();
115  else
116  ost << seg.exit().whichDetector();
117 
118  // ost << " Exit side " << seg.exit().getSide()
119  ost << " Point " << (math::XYZVector)seg.exit() << " " << seg.length() << " cm " << seg.X0length() << " X0 "
120  << seg.L0length() << " Lambda0 ";
121  switch (seg.material()) {
122  case CaloSegment::PbWO4:
123  ost << "PbWO4 ";
124  break;
125  case CaloSegment::CRACK:
126  ost << "CRACK ";
127  break;
128  case CaloSegment::PS:
129  ost << "PS ";
130  break;
131  case CaloSegment::HCAL:
132  ost << "HCAL ";
133  break;
135  ost << "ECAL-HCAL GAP ";
136  break;
138  ost << "PS-ECAL GAP";
139  break;
140  default:
141  ost << "GAP ";
142  }
143  return ost;
144 }
const ECALProperties * ecalProperties(int onEcal) const
ECAL properties.
Definition: Calorimeter.cc:78
double length() const
length of the segment (in cm)
Definition: CaloSegment.h:43
math::XYZVector XYZPoint
Definition: CaloSegment.h:18
CaloPoint entrance_
Definition: CaloSegment.h:71
const CaloPoint & entrance() const
first point of the segment
Definition: CaloSegment.h:49
double X0length() const
length of the segment (in X0)
Definition: CaloSegment.h:45
double radLenIncm() const override
Radiation length in cm.
const PreshowerLayer1Properties * layer1Properties(int onLayer1) const
Preshower Layer1 properties.
Definition: Calorimeter.cc:103
double interactionLength() const override
Interaction length in cm.
double sexit_
Definition: CaloSegment.h:74
double radLenIncm() const override
Radiation length in cm.
XYZPoint positionAtDepthinX0(double depth) const
space point corresponding to this depth (in X0)
Definition: CaloSegment.cc:89
double X0length_
Definition: CaloSegment.h:78
double L0length() const
length of the segment (in L9)
Definition: CaloSegment.h:47
double interactionLength() const override
Interaction length in cm: 18.5 for Standard ECAL.
std::ostream & operator<<(std::ostream &ost, const CaloSegment &seg)
Definition: CaloSegment.cc:103
double sL0exit_
Definition: CaloSegment.h:80
double radLenIncm() const override
Radiation length in cm.
const PreshowerLayer2Properties * layer2Properties(int onLayer2) const
Preshower Layer2 properties.
Definition: Calorimeter.cc:110
T sqrt(T t)
Definition: SSEVec.h:19
Material material() const
material
Definition: CaloSegment.h:56
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
const HCALProperties * hcalProperties(int onHcal) const
HCAL properties.
Definition: Calorimeter.cc:88
double sX0exit_
Definition: CaloSegment.h:76
const CaloPoint & exit() const
last point of the segment (there are only two)
Definition: CaloSegment.h:51
double sentrance_
Definition: CaloSegment.h:73
double pseeIntLenIncm() const
properties of the material between ES and EE; there is about 12 cm between the two.
double sL0entrance_
Definition: CaloSegment.h:79
CaloPoint exit_
Definition: CaloSegment.h:72
Definition: HCAL.py:1
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
CaloSegment(const CaloPoint &in, const CaloPoint &out, double si, double siX0, double liX0, Material mat, const CaloGeometryHelper *)
Definition: CaloSegment.cc:11
XYZPoint positionAtDepthinL0(double depth) const
space point corresponding to this depth (in L0)
Definition: CaloSegment.cc:95
DetId::Detector detector_
Definition: CaloSegment.h:83
double length_
Definition: CaloSegment.h:77
double x0FromCm(double cm) const
cm to X0 conversion
Definition: CaloSegment.cc:101
double sX0entrance_
Definition: CaloSegment.h:75
double L0length_
Definition: CaloSegment.h:81
XYZPoint positionAtDepthincm(double depth) const
space point corresponding to this depth (in cm)
Definition: CaloSegment.cc:83
double interactionLength() const override
Muon critical energy in GeV.
double pseeRadLenIncm() const
properties of the material between ES and EE