CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
GflashPiKShowerProfile Class Reference

#include <GflashPiKShowerProfile.h>

Inheritance diagram for GflashPiKShowerProfile:
GflashHadronShowerProfile

Public Member Functions

 GflashPiKShowerProfile (const edm::ParameterSet &parSet)
 
void loadParameters ()
 
 ~GflashPiKShowerProfile ()
 
- Public Member Functions inherited from GflashHadronShowerProfile
std::vector< GflashHit > & getGflashHitList ()
 
GflashShowinogetGflashShowino ()
 
 GflashHadronShowerProfile (const edm::ParameterSet &parSet)
 
void hadronicParameterization ()
 
void initialize (int showerType, double energy, double globalTime, double charge, Gflash3Vector &position, Gflash3Vector &momentum)
 
virtual ~GflashHadronShowerProfile ()
 

Additional Inherited Members

- Protected Member Functions inherited from GflashHadronShowerProfile
double depthScale (double ssp, double ssp0, double length)
 
void doCholeskyReduction (double **cc, double **vv, const int ndim)
 
double fLnE1 (double einc, const double *par)
 
double fTanh (double einc, const double *par)
 
double gammaProfile (double alpha, double beta, double depth, double lengthUnit)
 
void getFluctuationVector (double *lowTriangle, double *correlationVector)
 
int getNumberOfSpots (Gflash::CalorimeterNumber kCalor)
 
double hoProfile (double pathLength, double refDepth)
 
Gflash3Vector locateHitPosition (GflashTrajectoryPoint &point, double lateralArm)
 
double longitudinalProfile ()
 
double medianLateralArm (double depth, Gflash::CalorimeterNumber kCalor)
 
void setEnergyScale (double einc, const Gflash3Vector &ssp)
 
double twoGammaProfile (double *par, double depth, Gflash::CalorimeterNumber kIndex)
 
- Protected Attributes inherited from GflashHadronShowerProfile
double averageSpotEnergy [Gflash::kNumberCalorimeter]
 
double energyScale [Gflash::kNumberCalorimeter]
 
double lateralPar [Gflash::kNumberCalorimeter][Gflash::Nrpar]
 
double longEcal [Gflash::NPar]
 
double longHcal [Gflash::NPar]
 
double theBField
 
bool theGflashHcalOuter
 
std::vector< GflashHittheGflashHitList
 
GflashHistogramtheHisto
 
edm::ParameterSet theParSet
 
GflashShowinotheShowino
 

Detailed Description

Definition at line 6 of file GflashPiKShowerProfile.h.

Constructor & Destructor Documentation

GflashPiKShowerProfile::GflashPiKShowerProfile ( const edm::ParameterSet parSet)
inline

Definition at line 12 of file GflashPiKShowerProfile.h.

12  :
13  GflashHadronShowerProfile (parSet) {};
GflashHadronShowerProfile(const edm::ParameterSet &parSet)
GflashPiKShowerProfile::~GflashPiKShowerProfile ( )
inline

Definition at line 14 of file GflashPiKShowerProfile.h.

14 {};

Member Function Documentation

void GflashPiKShowerProfile::loadParameters ( )
virtual

Reimplemented from GflashHadronShowerProfile.

Definition at line 4 of file GflashPiKShowerProfile.cc.

References GflashHadronShowerProfile::depthScale(), GflashHadronShowerProfile::energyScale, create_public_lumi_plots::exp, GflashHadronShowerProfile::fTanh(), GflashShowino::getEnergy(), GflashHadronShowerProfile::getFluctuationVector(), GflashShowino::getPositionAtShower(), GflashShowino::getShowerType(), i, j, Gflash::kENCA, Gflash::kESPM, Gflash::kHB, Gflash::kHE, GflashHadronShowerProfile::lateralPar, Gflash::LengthCrystalEB, Gflash::LengthCrystalEE, dqm-mbProfile::log, GflashHadronShowerProfile::longEcal, GflashHadronShowerProfile::longHcal, bookConverter::max, Gflash::NPar, Gflash::Nrpar, Gflash::pion_correl_hadem, Gflash::pion_emscale, Gflash::pion_hadscale, Gflash::pion_par, Gflash::pion_rho, Gflash::pion_rpar, position, diffTwoXMLs::r1, diffTwoXMLs::r2, Gflash::RFrontCrystalEB, Gflash::Rmin, mathSSE::sqrt(), GflashHadronShowerProfile::theShowino, Gflash::ZFrontCrystalEE, and Gflash::Zmin.

5 {
6  double einc = theShowino->getEnergy();
8  int showerType = theShowino->getShowerType();
9 
10  // energy scale
11  double energyMeanHcal = 0.0;
12  double energySigmaHcal = 0.0;
13 
14  double r1 = 0.0;
15  double r2 = 0.0;
16 
17  if(showerType == 0 || showerType == 1 || showerType == 4 || showerType == 5) {
18 
19  //@@@ energy dependent energyRho based on tuning with testbeam data
20  double energyRho = fTanh(einc,Gflash::pion_correl_hadem);
21 
22  if(showerType == 0 || showerType == 1) {
23  do {
24  r1 = CLHEP::RandGaussQ::shoot();
25 
27 
28  //LogNormal mean and sigma of Hcal energy
29  energyMeanHcal = (fTanh(einc,Gflash::pion_hadscale[0]) +
31  energySigmaHcal = (fTanh(einc,Gflash::pion_hadscale[2]) +
33 
34  r2 = CLHEP::RandGaussQ::shoot();
35  energyScale[Gflash::kHB] = exp(energyMeanHcal+energySigmaHcal*(energyRho*r1 + sqrt(1.0- energyRho*energyRho)*r2 ));
36  } while ( energyScale[Gflash::kESPM] < 0 || energyScale[Gflash::kHB] > einc*1.5 );
37  }
38  else {
39  do {
40  r1 = CLHEP::RandGaussQ::shoot();
42 
43  //@@@extend depthScale for HE
44  energyMeanHcal = (fTanh(einc,Gflash::pion_hadscale[0]) +
46  energySigmaHcal = (fTanh(einc,Gflash::pion_hadscale[2]) +
48  r2 = CLHEP::RandGaussQ::shoot();
49  energyScale[Gflash::kHE] = exp(energyMeanHcal+energySigmaHcal*(energyRho*r1 + sqrt(1.0- energyRho*energyRho)*r2 ));
50  } while ( energyScale[Gflash::kENCA] < 0 || energyScale[Gflash::kHE] > einc*1.5 );
51  }
52  }
53  else if(showerType == 2 || showerType == 3 || showerType == 6 || showerType == 7) {
54  //Hcal response for mip-like pions (mip)
55 
56  energyMeanHcal = fTanh(einc,Gflash::pion_hadscale[4]);
57  energySigmaHcal = fTanh(einc,Gflash::pion_hadscale[5]);
58 
59  double gap_corr = einc*fTanh(einc,Gflash::pion_hadscale[6]);
60 
61  if(showerType == 2 || showerType == 3) {
63 
64  do {
65  r1 = CLHEP::RandGaussQ::shoot();
66  energyScale[Gflash::kHB] = exp(energyMeanHcal+energySigmaHcal*r1);
67  } while ( energyScale[Gflash::kHB] > einc*1.5 );
68 
69  if(showerType == 2) {
71  - gap_corr*depthScale(position.getRho(),Gflash::Rmin[Gflash::kHB],28.));
72  }
73  }
74  else if(showerType == 6 || showerType == 7 ) {
76 
77  do {
78  r1 = CLHEP::RandGaussQ::shoot();
79  energyMeanHcal += std::log(1.0-fTanh(einc,Gflash::pion_hadscale[7]));
80  energyScale[Gflash::kHE] = exp(energyMeanHcal+energySigmaHcal*r1);
81  } while ( energyScale[Gflash::kHE] > einc*1.5 );
82 
83  if(showerType == 6) {
85  - gap_corr*depthScale(std::fabs(position.getZ()),Gflash::Zmin[Gflash::kHE],66.));
86  }
87  }
88  }
89 
90  // parameters for the longitudinal profiles
91  //@@@check longitudinal profiles of endcaps for possible variations
92 
93  double *rhoHcal = new double [2*Gflash::NPar];
94  double *correlationVectorHcal = new double [Gflash::NPar*(Gflash::NPar+1)/2];
95 
96  //@@@until we have a separate parameterization for Endcap
97 
98  if(showerType>3) {
99  showerType -= 4;
100  }
101  //no separate parameterization before crystal
102  if(showerType==0) showerType = 1;
103 
104  //Hcal parameters are always needed regardless of showerType
105  for(int i = 0 ; i < 2*Gflash::NPar ; i++ ) {
106  rhoHcal[i] = fTanh(einc,Gflash::pion_rho[i + showerType*2*Gflash::NPar]);
107  }
108 
109  getFluctuationVector(rhoHcal,correlationVectorHcal);
110 
111  double normalZ[Gflash::NPar];
112  for (int i = 0; i < Gflash::NPar ; i++) normalZ[i] = CLHEP::RandGaussQ::shoot();
113 
114  for(int i = 0 ; i < Gflash::NPar ; i++) {
115  double correlationSum = 0.0;
116 
117  for(int j = 0 ; j < i+1 ; j++) {
118  correlationSum += correlationVectorHcal[i*(i+1)/2+j]*normalZ[j];
119  }
120  longHcal[i] = fTanh(einc,Gflash::pion_par[i+showerType*Gflash::NPar]) +
121  fTanh(einc,Gflash::pion_par[i+(4+showerType)*Gflash::NPar])*correlationSum;
122  }
123  delete [] rhoHcal;
124  delete [] correlationVectorHcal;
125 
126  // lateral parameters for Hcal
127 
128  for (int i = 0 ; i < Gflash::Nrpar ; i++) {
129  lateralPar[Gflash::kHB][i] = fTanh(einc,Gflash::pion_rpar[i+showerType*Gflash::Nrpar]);
131  }
132 
133  //Ecal parameters are needed if and only if the shower starts inside the crystal
134 
135  if(showerType == 1) {
136 
137  double *rhoEcal = new double [2*Gflash::NPar];
138  double *correlationVectorEcal = new double [Gflash::NPar*(Gflash::NPar+1)/2];
139  for(int i = 0 ; i < 2*Gflash::NPar ; i++ ) rhoEcal[i] = fTanh(einc,Gflash::pion_rho[i]);
140 
141  getFluctuationVector(rhoEcal,correlationVectorEcal);
142 
143  for(int i = 0 ; i < Gflash::NPar ; i++) normalZ[i] = CLHEP::RandGaussQ::shoot();
144  for(int i = 0 ; i < Gflash::NPar ; i++) {
145  double correlationSum = 0.0;
146 
147  for(int j = 0 ; j < i+1 ; j++) {
148  correlationSum += correlationVectorEcal[i*(i+1)/2+j]*normalZ[j];
149  }
150  longEcal[i] = fTanh(einc,Gflash::pion_par[i]) +
151  0.5*fTanh(einc,Gflash::pion_par[i+4*Gflash::NPar])*correlationSum;
152  }
153 
154  delete [] rhoEcal;
155  delete [] correlationVectorEcal;
156 
157  // lateral parameters for Ecal
158 
159  for (int i = 0 ; i < Gflash::Nrpar ; i++) {
162  }
163  }
164 
165 }
const double pion_rpar[4 *Nrpar][5]
const double ZFrontCrystalEE
double fTanh(double einc, const double *par)
int i
Definition: DBlmapReader.cc:9
double lateralPar[Gflash::kNumberCalorimeter][Gflash::Nrpar]
const double pion_hadscale[8][5]
double getEnergy()
Definition: GflashShowino.h:24
int getShowerType()
Definition: GflashShowino.h:23
const double pion_par[8 *NPar][5]
const int Nrpar
T sqrt(T t)
Definition: SSEVec.h:18
const double LengthCrystalEE
int j
Definition: DBlmapReader.cc:9
const double pion_correl_hadem[5]
const double LengthCrystalEB
Gflash3Vector & getPositionAtShower()
Definition: GflashShowino.h:27
const int NPar
const double RFrontCrystalEB
const double Zmin[kNumberCalorimeter]
CLHEP::Hep3Vector Gflash3Vector
Definition: Gflash3Vector.h:6
const double pion_rho[8 *NPar][5]
static int position[264][3]
Definition: ReadPGInfo.cc:509
void getFluctuationVector(double *lowTriangle, double *correlationVector)
double depthScale(double ssp, double ssp0, double length)
const double Rmin[kNumberCalorimeter]
const double pion_emscale[2][5]
double energyScale[Gflash::kNumberCalorimeter]