CMS 3D CMS Logo

CaloHitMaker.cc
Go to the documentation of this file.
9 
11 
12 CaloHitMaker::CaloHitMaker(const CaloGeometryHelper * theCalo,DetId::Detector basedet,int subdetn,int cal,unsigned sht)
13  :myCalorimeter(theCalo),theCaloProperties(nullptr),base_(basedet),subdetn_(subdetn),onCal_(cal),showerType_(sht)
14 {
15  // std::cout << " FamosCalorimeter " << basedet << " " << cal << std::endl;
16  EMSHOWER=(sht==0);
17  HADSHOWER=(sht==1);
18  MIP=(sht==2);
21  // is it really necessary to cast here ?
25 
27  {
30  }
31  else
32  {
33  moliereRadius=999;
35  }
36 }
37 
38 
41  double& t,bool segment, bool debug)
42 {
43  t=-9999.;
44  // En Attendant //
45  XYZVector normal = p.Normal();
46  double AAA = normal.X();
47  double BBB = normal.Y();
48  double CCC = normal.Z();
49  // double DDD = p.Distance(Point(0.,0.,0.));
50  double DDD = p.HesseDistance();
51  // double denom = p.A()*(b.X()-a.X()) + p.B()*(b.Y()-a.Y()) + p.C()*(b.Z()-a.Z());
52  double denom = AAA*(b.X()-a.X()) + BBB*(b.Y()-a.Y()) + CCC*(b.Z()-a.Z());
53  if(denom!=0.)
54  {
55  // t=-(p.A()*a.X()+p.B()*a.Y()+p.C()*a.Z()+p.D());
56  t=-(AAA*a.X()+BBB*a.Y()+CCC*a.Z()+DDD);
57  t/=denom;
58  if(debug) std::cout << " T = " << t <<std::endl;
59  if(segment)
60  {
61  if(t>=0&&t<=1)
62  return XYZPoint(a.X()+(b.X()-a.X())*t,
63  a.Y()+(b.Y()-a.Y())*t,
64  a.Z()+(b.Z()-a.Z())*t);
65  }
66  else
67  {
68  return XYZPoint(a.X()+(b.X()-a.X())*t,
69  a.Y()+(b.Y()-a.Y())*t,
70  a.Z()+(b.Z()-a.Z())*t);
71  }
72 
73 
74  }
75 
76  return XYZPoint(0.,0.,0.);
77 }
const ECALProperties * ecalProperties(int onEcal) const
ECAL properties.
Definition: Calorimeter.cc:76
const CalorimeterProperties * theCaloProperties
Definition: CaloHitMaker.h:48
#define nullptr
math::XYZVector XYZPoint
Definition: CaloHitMaker.h:26
const PreshowerLayer1Properties * layer1Properties(int onLayer1) const
Preshower Layer1 properties.
Definition: Calorimeter.cc:103
const CaloGeometryHelper * myCalorimeter
Definition: CaloHitMaker.h:47
virtual double interactionLength() const =0
Interaction length in cm.
const HCALProperties * hcalProperties(int onHcal) const
HCAL properties.
Definition: Calorimeter.cc:87
static XYZPoint intersect(const Plane3D &p, const XYZPoint &a, const XYZPoint &b, double &t, bool segment, bool debug=false)
Definition: CaloHitMaker.cc:40
ROOT::Math::Plane3D::Point Point
Definition: CaloHitMaker.cc:10
#define debug
Definition: HDRShower.cc:19
Detector
Definition: DetId.h:26
ROOT::Math::Plane3D Plane3D
Definition: CaloHitMaker.h:27
double interactionLength
Definition: CaloHitMaker.h:50
double b
Definition: hdecay.h:120
double moliereRadius
Definition: CaloHitMaker.h:49
double a
Definition: hdecay.h:121
math::XYZVector XYZVector
Definition: CaloHitMaker.h:25
DetId::Detector base_
Definition: CaloHitMaker.h:58
virtual double moliereRadius() const =0
Moliere Radius in cm.
CaloHitMaker(const CaloGeometryHelper *calo, DetId::Detector det, int subdetn, int cal, unsigned sht=0)
Definition: CaloHitMaker.cc:12