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  }
73  sL0exit_ = sL0entrance_ + (sexit_ - sentrance_) / intLenIncm;
74  if (mat == GAP) {
77  }
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();
93 }
94 
96  if (depth < sL0entrance_ || depth > sL0exit_)
97  return XYZPoint();
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 }
CaloSegment::XYZPoint
math::XYZVector XYZPoint
Definition: CaloSegment.h:18
Calorimeter::hcalProperties
const HCALProperties * hcalProperties(int onHcal) const
HCAL properties.
Definition: Calorimeter.cc:88
CaloSegment::PS
Definition: CaloSegment.h:20
Calorimeter::ecalProperties
const ECALProperties * ecalProperties(int onEcal) const
ECAL properties.
Definition: Calorimeter.cc:78
PreshowerLayer1Properties.h
PreshowerProperties::interactionLength
double interactionLength() const override
Muon critical energy in GeV.
Definition: PreshowerProperties.h:39
Calorimeter::layer2Properties
const PreshowerLayer2Properties * layer2Properties(int onLayer2) const
Preshower Layer2 properties.
Definition: Calorimeter.cc:110
gather_cfg.cout
cout
Definition: gather_cfg.py:144
HCALProperties::radLenIncm
double radLenIncm() const override
Radiation length in cm.
Definition: HCALProperties.h:37
CaloSegment.h
Calorimeter::layer1Properties
const PreshowerLayer1Properties * layer1Properties(int onLayer1) const
Preshower Layer1 properties.
Definition: Calorimeter.cc:103
EcalBarrel
Definition: EcalSubdetector.h:10
operator<<
std::ostream & operator<<(std::ostream &ost, const CaloSegment &seg)
Definition: CaloSegment.cc:103
CaloSegment::entrance_
CaloPoint entrance_
Definition: CaloSegment.h:71
CaloSegment::GAP
Definition: CaloSegment.h:20
CaloSegment::PSEEGAP
Definition: CaloSegment.h:20
CaloSegment::sL0exit_
double sL0exit_
Definition: CaloSegment.h:80
CaloSegment::material
Material material() const
material
Definition: CaloSegment.h:56
CaloSegment::PbWO4
Definition: CaloSegment.h:20
CaloSegment::sexit_
double sexit_
Definition: CaloSegment.h:74
PreshowerLayer2Properties::pseeIntLenIncm
double pseeIntLenIncm() const
properties of the material between ES and EE; there is about 12 cm between the two.
Definition: PreshowerLayer2Properties.h:36
PreshowerProperties::radLenIncm
double radLenIncm() const override
Radiation length in cm.
Definition: PreshowerProperties.h:28
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
HCALProperties::interactionLength
double interactionLength() const override
Interaction length in cm.
Definition: HCALProperties.h:56
CaloSegment::positionAtDepthinX0
XYZPoint positionAtDepthinX0(double depth) const
space point corresponding to this depth (in X0)
Definition: CaloSegment.cc:89
CaloSegment::L0length
double L0length() const
length of the segment (in L9)
Definition: CaloSegment.h:47
Calorimetry_cff.radLenIncm
radLenIncm
Definition: Calorimetry_cff.py:132
CaloSegment::HCAL
Definition: CaloSegment.h:20
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
CaloSegment::exit_
CaloPoint exit_
Definition: CaloSegment.h:72
EcalSubdetector.h
EcalEndcap
Definition: EcalSubdetector.h:10
CaloSegment::X0length_
double X0length_
Definition: CaloSegment.h:78
CaloSegment
Definition: CaloSegment.h:15
CaloSegment::Material
Material
Definition: CaloSegment.h:20
CaloSegment::entrance
const CaloPoint & entrance() const
first point of the segment
Definition: CaloSegment.h:49
CaloGeometryHelper.h
CaloSegment::CRACK
Definition: CaloSegment.h:20
CaloSegment::detector_
DetId::Detector detector_
Definition: CaloSegment.h:83
recoMuon::in
Definition: RecoMuonEnumerators.h:6
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
CaloSegment::length_
double length_
Definition: CaloSegment.h:77
CaloSegment::exit
const CaloPoint & exit() const
last point of the segment (there are only two)
Definition: CaloSegment.h:51
mag2
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
Definition: Basic3DVectorLD.h:124
PreshowerLayer2Properties.h
CaloSegment::positionAtDepthincm
XYZPoint positionAtDepthincm(double depth) const
space point corresponding to this depth (in cm)
Definition: CaloSegment.cc:83
CaloSegment::sX0exit_
double sX0exit_
Definition: CaloSegment.h:76
CaloSegment::sX0entrance_
double sX0entrance_
Definition: CaloSegment.h:75
HCALProperties.h
CaloSegment::sentrance_
double sentrance_
Definition: CaloSegment.h:73
PreshowerLayer2Properties::pseeRadLenIncm
double pseeRadLenIncm() const
properties of the material between ES and EE
Definition: PreshowerLayer2Properties.h:38
ECALProperties::radLenIncm
double radLenIncm() const override
Radiation length in cm.
Definition: ECALProperties.h:32
CaloSegment::L0length_
double L0length_
Definition: CaloSegment.h:81
CaloSegment::CaloSegment
CaloSegment(const CaloPoint &in, const CaloPoint &out, double si, double siX0, double liX0, Material mat, const CaloGeometryHelper *)
Definition: CaloSegment.cc:11
CaloSegment::length
double length() const
length of the segment (in cm)
Definition: CaloSegment.h:43
CaloSegment::sL0entrance_
double sL0entrance_
Definition: CaloSegment.h:79
CaloSegment::ECALHCALGAP
Definition: CaloSegment.h:20
CaloSegment::positionAtDepthinL0
XYZPoint positionAtDepthinL0(double depth) const
space point corresponding to this depth (in L0)
Definition: CaloSegment.cc:95
ECALProperties::interactionLength
double interactionLength() const override
Interaction length in cm: 18.5 for Standard ECAL.
Definition: ECALProperties.h:49
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
CaloSegment::x0FromCm
double x0FromCm(double cm) const
cm to X0 conversion
Definition: CaloSegment.cc:101
CaloGeometryHelper
Definition: CaloGeometryHelper.h:18
ECALProperties.h
CaloSegment::X0length
double X0length() const
length of the segment (in X0)
Definition: CaloSegment.h:45