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 | Private Attributes
PreshowerHitMaker Class Reference

#include <PreshowerHitMaker.h>

Inheritance diagram for PreshowerHitMaker:
CaloHitMaker

Public Types

typedef ROOT::Math::Transform3DPJ Transform3D
 
typedef math::XYZVector XYZPoint
 
typedef math::XYZVector XYZVector
 
- Public Types inherited from CaloHitMaker
typedef ROOT::Math::Plane3D Plane3D
 
typedef math::XYZVector XYZPoint
 
typedef math::XYZVector XYZVector
 

Public Member Functions

bool addHit (double r, double phi, unsigned layer=0)
 
const std::map< unsigned, float > & getHits ()
 
float layer1Calibrated () const
 
float layer2Calibrated () const
 
 PreshowerHitMaker (CaloGeometryHelper *calo, const XYZPoint &, const XYZVector &, const XYZPoint &, const XYZVector &, const LandauFluctuationGenerator *aGenerator)
 
void setMipEnergy (double e1, double e2)
 
void setSpotEnergy (double e)
 
float totalCalibrated () const
 
float totalLayer1 () const
 
float totalLayer2 () const
 
 ~PreshowerHitMaker ()
 
- Public Member Functions inherited from CaloHitMaker
 CaloHitMaker (const CaloGeometryHelper *calo, DetId::Detector det, int subdetn, int cal, unsigned sht=0)
 
const CaloGeometryHelpergetCalorimeter () const
 
virtual ~CaloHitMaker ()
 

Private Attributes

float anglecorrection1_
 
float anglecorrection2_
 
bool layer1valid_
 
bool layer2valid_
 
Transform3D locToGlobal1_
 
Transform3D locToGlobal2_
 
double mip1_
 
double mip2_
 
XYZVector psLayer1Dir_
 
XYZPoint psLayer1Entrance_
 
XYZVector psLayer2Dir_
 
XYZPoint psLayer2Entrance_
 
const LandauFluctuationGeneratortheGenerator
 The Landau Fluctuation generator. More...
 
float totalLayer1_
 
float totalLayer2_
 

Additional Inherited Members

- Static Protected Member Functions inherited from CaloHitMaker
static XYZPoint intersect (const Plane3D &p, const XYZPoint &a, const XYZPoint &b, double &t, bool segment, bool debug=false)
 
- Protected Attributes inherited from CaloHitMaker
bool EMSHOWER
 
bool HADSHOWER
 
std::map< uint32_t, float > hitMap_
 
double interactionLength
 
bool MIP
 
double moliereRadius
 
const CaloGeometryHelpermyCalorimeter
 
unsigned showerType_
 
double spotEnergy
 
const CalorimeterPropertiestheCaloProperties
 

Detailed Description

Definition at line 10 of file PreshowerHitMaker.h.

Member Typedef Documentation

Definition at line 16 of file PreshowerHitMaker.h.

Definition at line 15 of file PreshowerHitMaker.h.

Definition at line 14 of file PreshowerHitMaker.h.

Constructor & Destructor Documentation

PreshowerHitMaker::PreshowerHitMaker ( CaloGeometryHelper calo,
const XYZPoint layer1entrance,
const XYZVector layer1dir,
const XYZPoint layer2entrance,
const XYZVector layer2dir,
const LandauFluctuationGenerator aGenerator 
)

Definition at line 18 of file PreshowerHitMaker.cc.

References anglecorrection1_, anglecorrection2_, CaloHitMaker::intersect(), layer1valid_, layer2valid_, locToGlobal1_, locToGlobal2_, CaloHitMaker::myCalorimeter, CaloGeometryHelper::preshowerZPosition(), psLayer1Entrance_, psLayer2Entrance_, and detailsBasic3DVector::z.

24  :
26  psLayer1Entrance_(layer1entrance),
27  psLayer1Dir_(layer1dir),
28  psLayer2Entrance_(layer2entrance),
29  psLayer2Dir_(layer2dir),
30  totalLayer1_(0.),totalLayer2_(0.),
31  theGenerator(aGenerator)
32 {
33  double dummyt;
34  anglecorrection1_ = 0.;
35  anglecorrection2_ = 0.;
36  // Check if the entrance points are really on the wafers
37  // Layer 1
38  layer1valid_ = (layer1entrance.Mag2()>0.);
39  if(layer1valid_)
40  {
41  int z=(psLayer1Entrance_.z()>0)? 1:-1;
42  Plane3D plan1(0.,0.,1.,-z*myCalorimeter->preshowerZPosition(1));
43 
44  psLayer1Entrance_ = intersect(plan1,layer1entrance,layer1entrance+layer1dir,dummyt,false);
45 
46  XYZVector zaxis(0,0,1);
47  XYZVector planeVec1=(zaxis.Cross(layer1dir)).Unit();
49  Point(0,0,1),
50  Point(1,0,0),
51  (Point)psLayer1Entrance_,
52  (Point)(psLayer1Entrance_+layer1dir),
53  (Point)(psLayer1Entrance_+planeVec1));
54 
55  anglecorrection1_ = fabs(zaxis.Dot(layer1dir));
57  // std::cout << " Layer 1 entrance " << psLayer1Entrance_ << std::endl;
58  // std::cout << " Layer 1 corr " << anglecorrection1_ << std::endl;
59  }
60 
61  // Layer 2
62  layer2valid_ = (layer2entrance.Mag2()>0.);
63  if(layer2valid_)
64  {
65  int z=(psLayer2Entrance_.z()>0) ? 1:-1;
66  Plane3D plan2(0.,0.,1.,-z*myCalorimeter->preshowerZPosition(2));
67 
68  psLayer2Entrance_ = intersect(plan2,layer2entrance,layer2entrance+layer2dir,dummyt,false);
69 
70  XYZVector zaxis(0,0,1);
71  XYZVector planeVec2=(zaxis.Cross(layer2dir)).Unit();
73  Point(0,0,1),
74  Point(1,0,0),
75  (Point)psLayer2Entrance_,
76  (Point)(psLayer2Entrance_+layer2dir),
77  (Point)(psLayer2Entrance_+planeVec2));
78 
79  anglecorrection2_ = fabs(zaxis.Dot(layer2dir));
81  // std::cout << " Layer 2 entrance " << psLayer2Entrance_ << std::endl;
82  // std::cout << " Layer 2 corr " << anglecorrection2_ << std::endl;
83  }
84  // theGenerator=LandauFluctuationGenerator();
85 }
double preshowerZPosition(int layer) const
Transform3D locToGlobal1_
std::pair< double, double > Point
Definition: CaloEllipse.h:18
double double double z
const CaloGeometryHelper * myCalorimeter
Definition: CaloHitMaker.h:46
math::XYZVector XYZVector
math::XYZPoint Point
static XYZPoint intersect(const Plane3D &p, const XYZPoint &a, const XYZPoint &b, double &t, bool segment, bool debug=false)
Definition: CaloHitMaker.cc:38
ROOT::Math::Transform3DPJ Transform3D
Transform3D locToGlobal2_
const LandauFluctuationGenerator * theGenerator
The Landau Fluctuation generator.
ROOT::Math::Plane3D Plane3D
CaloHitMaker(const CaloGeometryHelper *calo, DetId::Detector det, int subdetn, int cal, unsigned sht=0)
Definition: CaloHitMaker.cc:10
PreshowerHitMaker::~PreshowerHitMaker ( )
inline

Definition at line 25 of file PreshowerHitMaker.h.

25 {;}

Member Function Documentation

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

Implements CaloHitMaker.

Definition at line 89 of file PreshowerHitMaker.cc.

References anglecorrection1_, anglecorrection2_, funct::cos(), EcalPreshowerGeometry::getClosestCellInPlane(), Calorimeter::getEcalPreshowerGeometry(), CaloHitMaker::hitMap_, LandauFluctuationGenerator::landau(), layer1valid_, layer2valid_, locToGlobal1_, locToGlobal2_, mip1_, mip2_, CaloHitMaker::moliereRadius, CaloHitMaker::myCalorimeter, point, CaloGeometryHelper::preshowerZPosition(), funct::sin(), strip(), theGenerator, totalLayer1_, totalLayer2_, and detailsBasic3DVector::z.

Referenced by EMShower::compute().

90 {
91  if((layer==1&&!layer1valid_)||((layer==2&&!layer2valid_))) return false;
92 
95  point = (layer==1) ? locToGlobal1_((Point)point) : locToGlobal2_((Point)point);
96  // std::cout << " Point " << point << std::endl;
97  int z=(point.z()>0) ? 1: -1;
99  // std::cout << "r " << r << " Point after " << point << std::endl;
100  // std::cout << " Layer " << layer << " " << point << std::endl;
102 
103  float meanspot=(layer==1) ? mip1_ : mip2_;
104  float spote = meanspot + 0.000021*theGenerator->landau();
105  spote *= ( (layer==1) ? anglecorrection1_ : anglecorrection2_ );
106 
107  if(!strip.null())
108  {
109  uint32_t stripNumber=strip.rawId();
110  std::map<uint32_t,float>::iterator cellitr;
111  cellitr = hitMap_.find(stripNumber);
112  if( cellitr==hitMap_.end())
113  {
114  hitMap_.insert(std::pair<uint32_t,float>(stripNumber,spote));
115  }
116  else
117  {
118  cellitr->second+=spote;
119  }
120  // std::cout << " found " << stripNumber << " " << spote <<std::endl;
121  if(layer==1){
122  totalLayer1_+=spote;
123  }
124  else if (layer==2) {
125  totalLayer2_+=spote;
126  }
127  return true;
128  }
129  // std::cout << " Could not find a cell " << point << std::endl;
130  return false;
131 }
double preshowerZPosition(int layer) const
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
math::XYZVector XYZPoint
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
const EcalPreshowerGeometry * getEcalPreshowerGeometry() const
Definition: Calorimeter.h:55
Transform3D locToGlobal1_
double double double z
const CaloGeometryHelper * myCalorimeter
Definition: CaloHitMaker.h:46
double landau() const
Random generator of the dE/dX spread (Landau function)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
math::XYZPoint Point
virtual DetId getClosestCellInPlane(const GlobalPoint &r, int plane) const
Definition: DetId.h:20
Transform3D locToGlobal2_
double moliereRadius
Definition: CaloHitMaker.h:48
math::XYZVector XYZPoint
std::map< uint32_t, float > hitMap_
Definition: CaloHitMaker.h:64
const LandauFluctuationGenerator * theGenerator
The Landau Fluctuation generator.
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
Definition: DDAxes.h:10
const std::map<unsigned,float>& PreshowerHitMaker::getHits ( )
inlinevirtual

Implements CaloHitMaker.

Definition at line 30 of file PreshowerHitMaker.h.

References CaloHitMaker::hitMap_.

Referenced by CalorimetryManager::EMShowerSimulation().

30 { return hitMap_ ;} ;
std::map< uint32_t, float > hitMap_
Definition: CaloHitMaker.h:64
float PreshowerHitMaker::layer1Calibrated ( ) const
inline

Definition at line 36 of file PreshowerHitMaker.h.

References totalLayer1_.

36 { return 0.024/81.1E-6*totalLayer1_;}
float PreshowerHitMaker::layer2Calibrated ( ) const
inline

Definition at line 37 of file PreshowerHitMaker.h.

References totalLayer2_.

37 { return 0.024*0.7/81.1E-6*totalLayer2_;}
void PreshowerHitMaker::setMipEnergy ( double  e1,
double  e2 
)
inline

Definition at line 32 of file PreshowerHitMaker.h.

References mip1_, and mip2_.

Referenced by CalorimetryManager::EMShowerSimulation().

32 { mip1_=e1 ; mip2_=e2;}
void PreshowerHitMaker::setSpotEnergy ( double  e)
inlinevirtual

Implements CaloHitMaker.

Definition at line 27 of file PreshowerHitMaker.h.

References alignCSCRings::e, and CaloHitMaker::spotEnergy.

Referenced by EMShower::compute().

27 { spotEnergy=e;}
double spotEnergy
Definition: CaloHitMaker.h:50
float PreshowerHitMaker::totalCalibrated ( ) const
inline

Definition at line 38 of file PreshowerHitMaker.h.

References totalLayer1_, and totalLayer2_.

38 { return 0.024/81.1E-6*(totalLayer1_+0.7*totalLayer2_);}
float PreshowerHitMaker::totalLayer1 ( ) const
inline

Definition at line 34 of file PreshowerHitMaker.h.

References totalLayer1_.

34 { return totalLayer1_;}
float PreshowerHitMaker::totalLayer2 ( ) const
inline

Definition at line 35 of file PreshowerHitMaker.h.

References totalLayer2_.

35 { return totalLayer2_;}

Member Data Documentation

float PreshowerHitMaker::anglecorrection1_
private

Definition at line 50 of file PreshowerHitMaker.h.

Referenced by addHit(), and PreshowerHitMaker().

float PreshowerHitMaker::anglecorrection2_
private

Definition at line 51 of file PreshowerHitMaker.h.

Referenced by addHit(), and PreshowerHitMaker().

bool PreshowerHitMaker::layer1valid_
private

Definition at line 46 of file PreshowerHitMaker.h.

Referenced by addHit(), and PreshowerHitMaker().

bool PreshowerHitMaker::layer2valid_
private

Definition at line 47 of file PreshowerHitMaker.h.

Referenced by addHit(), and PreshowerHitMaker().

Transform3D PreshowerHitMaker::locToGlobal1_
private

Definition at line 48 of file PreshowerHitMaker.h.

Referenced by addHit(), and PreshowerHitMaker().

Transform3D PreshowerHitMaker::locToGlobal2_
private

Definition at line 49 of file PreshowerHitMaker.h.

Referenced by addHit(), and PreshowerHitMaker().

double PreshowerHitMaker::mip1_
private

Definition at line 52 of file PreshowerHitMaker.h.

Referenced by addHit(), and setMipEnergy().

double PreshowerHitMaker::mip2_
private

Definition at line 52 of file PreshowerHitMaker.h.

Referenced by addHit(), and setMipEnergy().

XYZVector PreshowerHitMaker::psLayer1Dir_
private

Definition at line 43 of file PreshowerHitMaker.h.

XYZPoint PreshowerHitMaker::psLayer1Entrance_
private

Definition at line 42 of file PreshowerHitMaker.h.

Referenced by PreshowerHitMaker().

XYZVector PreshowerHitMaker::psLayer2Dir_
private

Definition at line 45 of file PreshowerHitMaker.h.

XYZPoint PreshowerHitMaker::psLayer2Entrance_
private

Definition at line 44 of file PreshowerHitMaker.h.

Referenced by PreshowerHitMaker().

const LandauFluctuationGenerator* PreshowerHitMaker::theGenerator
private

The Landau Fluctuation generator.

Definition at line 56 of file PreshowerHitMaker.h.

Referenced by addHit().

float PreshowerHitMaker::totalLayer1_
private

Definition at line 53 of file PreshowerHitMaker.h.

Referenced by addHit(), layer1Calibrated(), totalCalibrated(), and totalLayer1().

float PreshowerHitMaker::totalLayer2_
private

Definition at line 54 of file PreshowerHitMaker.h.

Referenced by addHit(), layer2Calibrated(), totalCalibrated(), and totalLayer2().