CMS 3D CMS Logo

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