CMS 3D CMS Logo

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 20 of file CaloHitMaker.h.

Member Typedef Documentation

◆ Plane3D

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

Definition at line 24 of file CaloHitMaker.h.

◆ XYZPoint

Definition at line 23 of file CaloHitMaker.h.

◆ XYZVector

Definition at line 22 of file CaloHitMaker.h.

Constructor & Destructor Documentation

◆ CaloHitMaker()

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

Definition at line 12 of file CaloHitMaker.cc.

14  : myCalorimeter(theCalo),
15  theCaloProperties(nullptr),
16  base_(basedet),
17  subdetn_(subdetn),
18  onCal_(cal),
19  showerType_(sht) {
20  // std::cout << " FamosCalorimeter " << basedet << " " << cal << std::endl;
21  EMSHOWER = (sht == 0);
22  HADSHOWER = (sht == 1);
23  MIP = (sht == 2);
24  if (base_ == DetId::Ecal && (subdetn_ == EcalBarrel || subdetn == EcalEndcap) && onCal_)
26  // is it really necessary to cast here ?
29  if (base_ == DetId::Hcal && cal)
31 
32  if (theCaloProperties) {
35  } else {
36  moliereRadius = 999;
37  interactionLength = 999;
38  }
39 }

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.

◆ ~CaloHitMaker()

virtual CaloHitMaker::~CaloHitMaker ( )
inlinevirtual

Definition at line 27 of file CaloHitMaker.h.

27 { ; }

Member Function Documentation

◆ addHit()

virtual bool CaloHitMaker::addHit ( double  r,
double  phi,
unsigned  layer = 0 
)
pure virtual

◆ getCalorimeter()

const CaloGeometryHelper* CaloHitMaker::getCalorimeter ( ) const
inline

Definition at line 33 of file CaloHitMaker.h.

33  {
34  // std::cout << "CaloHitMaker is returning myCalorimeter " << myCalorimeter << std::endl;
35  return myCalorimeter;
36  }

References myCalorimeter.

◆ getHits()

virtual const std::map<CaloHitID, float>& CaloHitMaker::getHits ( )
pure virtual

◆ intersect()

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 41 of file CaloHitMaker.cc.

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  // t=-(p.A()*a.X()+p.B()*a.Y()+p.C()*a.Z()+p.D());
55  t = -(AAA * a.X() + BBB * a.Y() + CCC * a.Z() + DDD);
56  t /= denom;
57  if (debug)
58  std::cout << " T = " << t << std::endl;
59  if (segment) {
60  if (t >= 0 && t <= 1)
61  return XYZPoint(a.X() + (b.X() - a.X()) * t, a.Y() + (b.Y() - a.Y()) * t, a.Z() + (b.Z() - a.Z()) * t);
62  } else {
63  return XYZPoint(a.X() + (b.X() - a.X()) * t, a.Y() + (b.Y() - a.Y()) * t, a.Z() + (b.Z() - a.Z()) * t);
64  }
65  }
66 
67  return XYZPoint(0., 0., 0.);
68 }

References a, b, gather_cfg::cout, debug, makePileupJSON::denom, AlCaHLTBitMon_ParallelJobs::p, and submitPVValidationJobs::t.

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

◆ setSpotEnergy()

virtual void CaloHitMaker::setSpotEnergy ( double  e)
pure virtual

Member Data Documentation

◆ base_

DetId::Detector CaloHitMaker::base_
private

Definition at line 55 of file CaloHitMaker.h.

Referenced by CaloHitMaker().

◆ EMSHOWER

bool CaloHitMaker::EMSHOWER
protected

◆ HADSHOWER

bool CaloHitMaker::HADSHOWER
protected

◆ hitMap_

std::map<CaloHitID, float> CaloHitMaker::hitMap_
protected

◆ interactionLength

double CaloHitMaker::interactionLength
protected

Definition at line 47 of file CaloHitMaker.h.

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

◆ MIP

bool CaloHitMaker::MIP
protected

Definition at line 52 of file CaloHitMaker.h.

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

◆ moliereRadius

double CaloHitMaker::moliereRadius
protected

◆ myCalorimeter

const CaloGeometryHelper* CaloHitMaker::myCalorimeter
protected

◆ onCal_

int CaloHitMaker::onCal_
private

Definition at line 57 of file CaloHitMaker.h.

Referenced by CaloHitMaker().

◆ showerType_

unsigned CaloHitMaker::showerType_
protected

Definition at line 60 of file CaloHitMaker.h.

◆ spotEnergy

double CaloHitMaker::spotEnergy
protected

◆ subdetn_

int CaloHitMaker::subdetn_
private

Definition at line 56 of file CaloHitMaker.h.

Referenced by CaloHitMaker().

◆ theCaloProperties

const CalorimeterProperties* CaloHitMaker::theCaloProperties
protected

Definition at line 45 of file CaloHitMaker.h.

Referenced by CaloHitMaker().

CaloHitMaker::XYZPoint
math::XYZVector XYZPoint
Definition: CaloHitMaker.h:23
Calorimeter::hcalProperties
const HCALProperties * hcalProperties(int onHcal) const
HCAL properties.
Definition: Calorimeter.cc:88
CaloHitMaker::base_
DetId::Detector base_
Definition: CaloHitMaker.h:55
makePileupJSON.denom
denom
Definition: makePileupJSON.py:146
Calorimeter::ecalProperties
const ECALProperties * ecalProperties(int onEcal) const
ECAL properties.
Definition: Calorimeter.cc:78
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DetId::Hcal
Definition: DetId.h:28
XYZVector
math::XYZVector XYZVector
Definition: RawParticle.h:26
CaloHitMaker::EMSHOWER
bool EMSHOWER
Definition: CaloHitMaker.h:50
CaloHitMaker::interactionLength
double interactionLength
Definition: CaloHitMaker.h:47
Calorimeter::layer1Properties
const PreshowerLayer1Properties * layer1Properties(int onLayer1) const
Preshower Layer1 properties.
Definition: Calorimeter.cc:103
EcalBarrel
Definition: EcalSubdetector.h:10
CaloHitMaker::MIP
bool MIP
Definition: CaloHitMaker.h:52
debug
#define debug
Definition: HDRShower.cc:19
CaloHitMaker::subdetn_
int subdetn_
Definition: CaloHitMaker.h:56
CaloHitMaker::showerType_
unsigned showerType_
Definition: CaloHitMaker.h:60
CalorimeterProperties::interactionLength
virtual double interactionLength() const =0
Interaction length in cm.
b
double b
Definition: hdecay.h:118
EcalEndcap
Definition: EcalSubdetector.h:10
a
double a
Definition: hdecay.h:119
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CalorimeterProperties::moliereRadius
virtual double moliereRadius() const =0
Moliere Radius in cm.
DetId::Ecal
Definition: DetId.h:27
CaloHitMaker::myCalorimeter
const CaloGeometryHelper * myCalorimeter
Definition: CaloHitMaker.h:44
CaloHitMaker::HADSHOWER
bool HADSHOWER
Definition: CaloHitMaker.h:51
EcalPreshower
Definition: EcalSubdetector.h:10
CaloHitMaker::theCaloProperties
const CalorimeterProperties * theCaloProperties
Definition: CaloHitMaker.h:45
CaloHitMaker::onCal_
int onCal_
Definition: CaloHitMaker.h:57
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
CaloHitMaker::moliereRadius
double moliereRadius
Definition: CaloHitMaker.h:46