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 
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 {
26 
28  // Change this. CaloProperties from FamosShower should be used instead
29  double radLenIncm=999999;
30  double intLenIncm=999999;
31  detector_=in.whichDetector();
32  if(detector_!=out.whichDetector()&&mat!=CRACK&&mat!=GAP&&mat!=ECALHCALGAP)
33  {
34  std::cout << " Problem in the segments " << detector_ << " " << out.whichDetector() <<std::endl;
35  }
36  switch (mat)
37  {
38  case PbWO4:
39  {
40 
41  int det = 0;
42  if (in.whichSubDetector()==EcalBarrel) det = 1;
43  if (in.whichSubDetector()==EcalEndcap) det = 2;
44 
45  radLenIncm =
46  myCalorimeter->ecalProperties(det)->radLenIncm();
47  intLenIncm =
48  myCalorimeter->ecalProperties(det)->interactionLength();
49  }
50  break;
51  case CRACK:
52  {
53  radLenIncm=8.9;//cracks : Al
54  intLenIncm=35.4;
55  }
56  break;
57  case PS:
58  {
59  radLenIncm =
60  myCalorimeter->layer1Properties(1)->radLenIncm();
61  intLenIncm =
62  myCalorimeter->layer1Properties(1)->interactionLength();
63  }
64  break;
65  case HCAL:
66  {
67  radLenIncm =
68  myCalorimeter->hcalProperties(1)->radLenIncm();
69  intLenIncm =
70  myCalorimeter->hcalProperties(1)->interactionLength();
71  }
72  break;
73  case ECALHCALGAP:
74  {
75  // From Olga's & Patrick's talk PRS/JetMET 21 Sept 2004
76  radLenIncm = 22.3;
77  intLenIncm = 140;
78  }
79  break;
80  case PSEEGAP:
81  {
82  // according to Sunanda 0.19 X0 (0.08X0 of polyethylene), support (0.06X0 of aluminium) + other stuff
83  // in the geometry 12 cm between layer and entrance of EE. Polyethylene is rather 48 and Al 8.9 (PDG)
84  // for the inLen, just rescale according to PDG (85cm)
85  radLenIncm = myCalorimeter->layer2Properties(1)->pseeRadLenIncm();
86  intLenIncm = myCalorimeter->layer2Properties(1)->pseeIntLenIncm();
87  }
88  break;
89  default:
90  radLenIncm=999999;
91  }
92  sX0exit_ = sX0entrance_+(sexit_-sentrance_)/radLenIncm;
93  sL0exit_ = sL0entrance_+(sexit_-sentrance_)/intLenIncm;
94  if(mat==GAP)
95  {
97  sL0exit_=sL0entrance_;
98  }
101  L0length_ = sL0exit_-sL0entrance_;
102 }
103 
106 {
107  if (depth<sentrance_||depth>sexit_) return XYZPoint();
108  return XYZPoint(entrance_+((depth-sentrance_)/(sexit_-sentrance_)*(exit_-entrance_)));
109 }
110 
113 {
114  if (depth<sX0entrance_||depth>sX0exit_) return XYZPoint();
115  return XYZPoint(entrance_+((depth-sX0entrance_)/(sX0exit_-sX0entrance_)*(exit_-entrance_)));
116 }
117 
120 {
121  if (depth<sL0entrance_||depth>sL0exit_) return XYZPoint();
122  return XYZPoint(entrance_+((depth-sL0entrance_)/(sL0exit_-sL0entrance_)*(exit_-entrance_)));
123 }
124 
125 double
126 CaloSegment::x0FromCm(double cm) const{
127  return sX0entrance_+cm/length_*X0length_;
128 }
129 
130 std::ostream & operator<<(std::ostream& ost ,const CaloSegment& seg)
131 {
132  ost << " DetId " ;
133  if(!seg.entrance().getDetId().null())
134  ost << seg.entrance().getDetId()() ;
135  else
136  {
137  ost << seg.entrance().whichDetector() ;
138  // ost<< " Entrance side " << seg.entrance().getSide()
139  ost << " Point " << (math::XYZVector)seg.entrance() << std::endl;
140  }
141  ost << "DetId " ;
142  if(!seg.exit().getDetId().null())
143  ost << seg.exit().getDetId()() ;
144  else
145  ost << seg.exit().whichDetector() ;
146 
147  // ost << " Exit side " << seg.exit().getSide()
148  ost << " Point " << (math::XYZVector)seg.exit() << " "
149  << seg.length() << " cm "
150  << seg.X0length() << " X0 "
151  << seg.L0length() << " Lambda0 " ;
152  switch (seg.material())
153  {
154  case CaloSegment::PbWO4:
155  ost << "PbWO4 " ;
156  break;
157  case CaloSegment::CRACK:
158  ost << "CRACK ";
159  break;
160  case CaloSegment::PS:
161  ost << "PS ";
162  break;
163  case CaloSegment::HCAL:
164  ost << "HCAL ";
165  break;
167  ost << "ECAL-HCAL GAP ";
168  break;
170  ost << "PS-ECAL GAP";
171  break;
172  default:
173  ost << "GAP " ;
174  }
175  return ost;
176 }
177 
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: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
const PreshowerLayer2Properties * layer2Properties(int onLayer2) const
Preshower Layer2 properties.
Definition: Calorimeter.cc:108
T sqrt(T t)
Definition: SSEVec.h:46
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:11
XYZPoint positionAtDepthinL0(double depth) const
space point corresponding to this depth (in L0)
Definition: CaloSegment.cc:119
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:126
double sX0entrance_
Definition: CaloSegment.h:74
tuple cout
Definition: gather_cfg.py:121
double L0length_
Definition: CaloSegment.h:80
XYZPoint positionAtDepthincm(double depth) const
space point corresponding to this depth (in cm)
Definition: CaloSegment.cc:105
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: 18.5 for Standard ECAL.