#include <FastSimulation/CaloHitMakers/interface/CaloHitMaker.h>
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 CaloGeometryHelper * | getCalorimeter () const |
virtual const std::map < uint32_t, 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) |
computes the intersection between a straight line defined by a & b and a plan | |
Protected Attributes | |
bool | EMSHOWER |
bool | HADSHOWER |
std::map< uint32_t, float > | hitMap_ |
double | interactionLength |
double | moliereRadius |
const CaloGeometryHelper * | myCalorimeter |
unsigned | showerType_ |
double | spotEnergy |
const CalorimeterProperties * | theCaloProperties |
Private Attributes | |
DetId::Detector | base_ |
int | onCal_ |
int | subdetn_ |
Definition at line 20 of file CaloHitMaker.h.
Reimplemented in EcalHitMaker, HcalHitMaker, and PreshowerHitMaker.
Definition at line 25 of file CaloHitMaker.h.
Reimplemented in EcalHitMaker, HcalHitMaker, and PreshowerHitMaker.
Definition at line 24 of file CaloHitMaker.h.
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(), CalorimeterProperties::moliereRadius(), moliereRadius, myCalorimeter, onCal_, subdetn_, and theCaloProperties.
00011 :myCalorimeter(theCalo),theCaloProperties(NULL),base_(basedet),subdetn_(subdetn),onCal_(cal),showerType_(sht) 00012 { 00013 // std::cout << " FamosCalorimeter " << basedet << " " << cal << std::endl; 00014 EMSHOWER=(sht==0); 00015 HADSHOWER=(sht==1); 00016 if(base_==DetId::Ecal&&(subdetn_==EcalBarrel||subdetn==EcalEndcap)&&onCal_) 00017 theCaloProperties = (CalorimeterProperties*)myCalorimeter->ecalProperties(onCal_); 00018 // is it really necessary to cast here ? 00019 if(base_==DetId::Ecal&&subdetn_==EcalPreshower&&onCal_) 00020 theCaloProperties = (PreshowerProperties*)myCalorimeter->layer1Properties(onCal_); 00021 if(base_==DetId::Hcal&&cal) theCaloProperties = myCalorimeter->hcalProperties(onCal_); 00022 00023 if(theCaloProperties) 00024 { 00025 moliereRadius=theCaloProperties->moliereRadius(); 00026 interactionLength=theCaloProperties->interactionLength(); 00027 } 00028 else 00029 { 00030 moliereRadius=999; 00031 interactionLength=999; 00032 } 00033 }
virtual CaloHitMaker::~CaloHitMaker | ( | ) | [inline, virtual] |
virtual bool CaloHitMaker::addHit | ( | double | r, | |
double | phi, | |||
unsigned | layer = 0 | |||
) | [pure virtual] |
Implemented in EcalHitMaker, HcalHitMaker, and PreshowerHitMaker.
const CaloGeometryHelper* CaloHitMaker::getCalorimeter | ( | ) | const [inline] |
Definition at line 35 of file CaloHitMaker.h.
References myCalorimeter.
00036 { 00037 // std::cout << "CaloHitMaker is returning myCalorimeter " << myCalorimeter << std::endl; 00038 return myCalorimeter; 00039 }
virtual const std::map<uint32_t,float>& CaloHitMaker::getHits | ( | ) | [pure virtual] |
Implemented in EcalHitMaker, HcalHitMaker, and PreshowerHitMaker.
CaloHitMaker::XYZPoint CaloHitMaker::intersect | ( | const Plane3D & | p, | |
const XYZPoint & | a, | |||
const XYZPoint & | b, | |||
double & | t, | |||
bool | segment, | |||
bool | debug = false | |||
) | [static, protected] |
computes the intersection between a straight line defined by a & b and a plan
Definition at line 37 of file CaloHitMaker.cc.
References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().
Referenced by EcalHitMaker::ecalCellLine(), EcalHitMaker::getPads(), and PreshowerHitMaker::PreshowerHitMaker().
00039 { 00040 t=-9999.; 00041 // En Attendant // 00042 XYZVector normal = p.Normal(); 00043 double AAA = normal.X(); 00044 double BBB = normal.Y(); 00045 double CCC = normal.Z(); 00046 // double DDD = p.Distance(Point(0.,0.,0.)); 00047 double DDD = p.HesseDistance(); 00048 // double denom = p.A()*(b.X()-a.X()) + p.B()*(b.Y()-a.Y()) + p.C()*(b.Z()-a.Z()); 00049 double denom = AAA*(b.X()-a.X()) + BBB*(b.Y()-a.Y()) + CCC*(b.Z()-a.Z()); 00050 if(denom!=0.) 00051 { 00052 // t=-(p.A()*a.X()+p.B()*a.Y()+p.C()*a.Z()+p.D()); 00053 t=-(AAA*a.X()+BBB*a.Y()+CCC*a.Z()+DDD); 00054 t/=denom; 00055 if(debug) std::cout << " T = " << t <<std::endl; 00056 if(segment) 00057 { 00058 if(t>=0&&t<=1) 00059 return XYZPoint(a.X()+(b.X()-a.X())*t, 00060 a.Y()+(b.Y()-a.Y())*t, 00061 a.Z()+(b.Z()-a.Z())*t); 00062 } 00063 else 00064 { 00065 return XYZPoint(a.X()+(b.X()-a.X())*t, 00066 a.Y()+(b.Y()-a.Y())*t, 00067 a.Z()+(b.Z()-a.Z())*t); 00068 } 00069 00070 00071 } 00072 00073 return XYZPoint(0.,0.,0.); 00074 }
virtual void CaloHitMaker::setSpotEnergy | ( | double | e | ) | [pure virtual] |
Implemented in EcalHitMaker, HcalHitMaker, and PreshowerHitMaker.
DetId::Detector CaloHitMaker::base_ [private] |
bool CaloHitMaker::EMSHOWER [protected] |
Definition at line 52 of file CaloHitMaker.h.
Referenced by HcalHitMaker::addHit(), CaloHitMaker(), EcalHitMaker::getPads(), HcalHitMaker::HcalHitMaker(), HcalHitMaker::setDepth(), and EcalHitMaker::setTrackParameters().
bool CaloHitMaker::HADSHOWER [protected] |
Definition at line 53 of file CaloHitMaker.h.
Referenced by CaloHitMaker(), EcalHitMaker::getPads(), and HcalHitMaker::setDepth().
std::map<uint32_t,float> CaloHitMaker::hitMap_ [protected] |
Definition at line 63 of file CaloHitMaker.h.
Referenced by HcalHitMaker::addHit(), PreshowerHitMaker::addHit(), HcalHitMaker::getHits(), and EcalHitMaker::getHits().
double CaloHitMaker::interactionLength [protected] |
Definition at line 49 of file CaloHitMaker.h.
Referenced by CaloHitMaker(), EcalHitMaker::getPads(), and HcalHitMaker::HcalHitMaker().
double CaloHitMaker::moliereRadius [protected] |
Definition at line 48 of file CaloHitMaker.h.
Referenced by PreshowerHitMaker::addHit(), CaloHitMaker(), EcalHitMaker::getPads(), and HcalHitMaker::HcalHitMaker().
const CaloGeometryHelper* CaloHitMaker::myCalorimeter [protected] |
Definition at line 46 of file CaloHitMaker.h.
Referenced by HcalHitMaker::addHit(), PreshowerHitMaker::addHit(), EcalHitMaker::buildGeometry(), EcalHitMaker::buildSegments(), CaloHitMaker(), EcalHitMaker::configureGeometry(), EcalHitMaker::EcalHitMaker(), getCalorimeter(), EcalHitMaker::hcalCellLine(), EcalHitMaker::preshowerCellLine(), and PreshowerHitMaker::PreshowerHitMaker().
int CaloHitMaker::onCal_ [private] |
unsigned CaloHitMaker::showerType_ [protected] |
Definition at line 62 of file CaloHitMaker.h.
double CaloHitMaker::spotEnergy [protected] |
Definition at line 50 of file CaloHitMaker.h.
Referenced by EcalHitMaker::addHit(), HcalHitMaker::addHit(), PreshowerHitMaker::addHit(), EcalHitMaker::addHitDepth(), HcalHitMaker::setSpotEnergy(), EcalHitMaker::setSpotEnergy(), and PreshowerHitMaker::setSpotEnergy().
int CaloHitMaker::subdetn_ [private] |
const CalorimeterProperties* CaloHitMaker::theCaloProperties [protected] |