CMS 3D CMS Logo

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