CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Protected Member Functions | Protected Attributes | Private Attributes
CaloHitMaker Class Referenceabstract

#include <CaloHitMaker.h>

Inheritance diagram for CaloHitMaker:
EcalHitMaker HcalHitMaker PreshowerHitMaker

Public Types

typedef ROOT::Math::Plane3D Plane3D
 
typedef math::XYZVector XYZPoint
 
typedef math::XYZVector XYZVector
 

Public Member Functions

virtual bool addHit (double r, double phi, unsigned layer=0)=0
 
 CaloHitMaker (const CaloGeometryHelper *calo, DetId::Detector det, int subdetn, int cal, unsigned sht=0)
 
const CaloGeometryHelpergetCalorimeter () const
 
virtual const std::map
< CaloHitID, float > & 
getHits ()=0
 
virtual void setSpotEnergy (double e)=0
 
virtual ~CaloHitMaker ()
 

Static Protected Member Functions

static XYZPoint intersect (const Plane3D &p, const XYZPoint &a, const XYZPoint &b, double &t, bool segment, bool debug=false)
 

Protected Attributes

bool EMSHOWER
 
bool HADSHOWER
 
std::map< CaloHitID, float > hitMap_
 
double interactionLength
 
bool MIP
 
double moliereRadius
 
const CaloGeometryHelpermyCalorimeter
 
unsigned showerType_
 
double spotEnergy
 
const CalorimeterPropertiestheCaloProperties
 

Private Attributes

DetId::Detector base_
 
int onCal_
 
int subdetn_
 

Detailed Description

Definition at line 21 of file CaloHitMaker.h.

Member Typedef Documentation

typedef ROOT::Math::Plane3D CaloHitMaker::Plane3D

Definition at line 27 of file CaloHitMaker.h.

Definition at line 26 of file CaloHitMaker.h.

Definition at line 25 of file CaloHitMaker.h.

Constructor & Destructor Documentation

CaloHitMaker::CaloHitMaker ( const CaloGeometryHelper calo,
DetId::Detector  det,
int  subdetn,
int  cal,
unsigned  sht = 0 
)

Definition at line 10 of file CaloHitMaker.cc.

References base_, DetId::Ecal, EcalBarrel, EcalEndcap, EcalPreshower, Calorimeter::ecalProperties(), EMSHOWER, HADSHOWER, DetId::Hcal, Calorimeter::hcalProperties(), CalorimeterProperties::interactionLength(), interactionLength, Calorimeter::layer1Properties(), MIP, CalorimeterProperties::moliereRadius(), moliereRadius, myCalorimeter, onCal_, subdetn_, and theCaloProperties.

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 }
const ECALProperties * ecalProperties(int onEcal) const
ECAL properties.
Definition: Calorimeter.cc:75
const CalorimeterProperties * theCaloProperties
Definition: CaloHitMaker.h:48
#define NULL
Definition: scimark2.h:8
const PreshowerLayer1Properties * layer1Properties(int onLayer1) const
Preshower Layer1 properties.
Definition: Calorimeter.cc:102
const CaloGeometryHelper * myCalorimeter
Definition: CaloHitMaker.h:47
unsigned showerType_
Definition: CaloHitMaker.h:64
const HCALProperties * hcalProperties(int onHcal) const
HCAL properties.
Definition: Calorimeter.cc:86
virtual double moliereRadius() const =0
Moliere Radius in cm.
double interactionLength
Definition: CaloHitMaker.h:50
double moliereRadius
Definition: CaloHitMaker.h:49
DetId::Detector base_
Definition: CaloHitMaker.h:58
virtual double interactionLength() const =0
Interaction length in cm.
virtual CaloHitMaker::~CaloHitMaker ( )
inlinevirtual

Definition at line 30 of file CaloHitMaker.h.

30 {;}

Member Function Documentation

virtual bool CaloHitMaker::addHit ( double  r,
double  phi,
unsigned  layer = 0 
)
pure virtual
const CaloGeometryHelper* CaloHitMaker::getCalorimeter ( ) const
inline

Definition at line 36 of file CaloHitMaker.h.

References myCalorimeter.

37  {
38  // std::cout << "CaloHitMaker is returning myCalorimeter " << myCalorimeter << std::endl;
39  return myCalorimeter;
40  }
const CaloGeometryHelper * myCalorimeter
Definition: CaloHitMaker.h:47
virtual const std::map<CaloHitID,float>& CaloHitMaker::getHits ( )
pure virtual
CaloHitMaker::XYZPoint CaloHitMaker::intersect ( const Plane3D p,
const XYZPoint a,
const XYZPoint b,
double &  t,
bool  segment,
bool  debug = false 
)
staticprotected

computes the intersection between a straight line defined by a & b and a plan

Definition at line 38 of file CaloHitMaker.cc.

References gather_cfg::cout.

Referenced by EcalHitMaker::ecalCellLine(), EcalHitMaker::getPads(), and PreshowerHitMaker::PreshowerHitMaker().

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 }
math::XYZVector XYZPoint
Definition: CaloHitMaker.h:26
math::XYZVector XYZVector
#define debug
Definition: HDRShower.cc:19
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
tuple cout
Definition: gather_cfg.py:121
virtual void CaloHitMaker::setSpotEnergy ( double  e)
pure virtual

Member Data Documentation

DetId::Detector CaloHitMaker::base_
private

Definition at line 58 of file CaloHitMaker.h.

Referenced by CaloHitMaker().

bool CaloHitMaker::EMSHOWER
protected
bool CaloHitMaker::HADSHOWER
protected
std::map<CaloHitID,float> CaloHitMaker::hitMap_
protected
double CaloHitMaker::interactionLength
protected

Definition at line 50 of file CaloHitMaker.h.

Referenced by CaloHitMaker(), EcalHitMaker::getPads(), and HcalHitMaker::HcalHitMaker().

bool CaloHitMaker::MIP
protected

Definition at line 55 of file CaloHitMaker.h.

Referenced by HcalHitMaker::addHit(), and CaloHitMaker().

double CaloHitMaker::moliereRadius
protected
const CaloGeometryHelper* CaloHitMaker::myCalorimeter
protected
int CaloHitMaker::onCal_
private

Definition at line 60 of file CaloHitMaker.h.

Referenced by CaloHitMaker().

unsigned CaloHitMaker::showerType_
protected

Definition at line 64 of file CaloHitMaker.h.

double CaloHitMaker::spotEnergy
protected
int CaloHitMaker::subdetn_
private

Definition at line 59 of file CaloHitMaker.h.

Referenced by CaloHitMaker().

const CalorimeterProperties* CaloHitMaker::theCaloProperties
protected

Definition at line 48 of file CaloHitMaker.h.

Referenced by CaloHitMaker().