CMS 3D CMS Logo

List of all members | Public Member Functions
GflashProtonShowerProfile Class Reference

#include <GflashProtonShowerProfile.h>

Inheritance diagram for GflashProtonShowerProfile:
GflashHadronShowerProfile

Public Member Functions

 GflashProtonShowerProfile (const edm::ParameterSet &parSet)
 
void loadParameters () override
 
 ~GflashProtonShowerProfile () override
 
- 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 GflashProtonShowerProfile.h.

Constructor & Destructor Documentation

◆ GflashProtonShowerProfile()

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

Definition at line 11 of file GflashProtonShowerProfile.h.

11 : GflashHadronShowerProfile(parSet){};

◆ ~GflashProtonShowerProfile()

GflashProtonShowerProfile::~GflashProtonShowerProfile ( )
inlineoverride

Definition at line 12 of file GflashProtonShowerProfile.h.

12 {};

Member Function Documentation

◆ loadParameters()

void GflashProtonShowerProfile::loadParameters ( )
overridevirtual

Reimplemented from GflashHadronShowerProfile.

Definition at line 4 of file GflashProtonShowerProfile.cc.

4  {
5  double einc = theShowino->getEnergy();
7  int showerType = theShowino->getShowerType();
8 
9  // energy scale
10  double energyMeanHcal = 0.0;
11  double energySigmaHcal = 0.0;
12 
13  double r1 = 0.0;
14  double r2 = 0.0;
15 
16  if (showerType == 0 || showerType == 1 || showerType == 4 || showerType == 5) {
17  //@@@ energy dependent energyRho based on tuning with testbeam data
18  double energyRho = fTanh(einc, Gflash::pro_correl_hadem);
19 
20  if (showerType == 0 || showerType == 1) {
21  do {
22  r1 = CLHEP::RandGaussQ::shoot();
23 
25  einc * (fTanh(einc, Gflash::pro_emscale[0]) + fTanh(einc, Gflash::pro_emscale[1]) * r1);
26 
27  // LogNormal mean and sigma of Hcal energy
28  energyMeanHcal = (fTanh(einc, Gflash::pro_hadscale[0]) +
29  fTanh(einc, Gflash::pro_hadscale[1]) *
31  energySigmaHcal = (fTanh(einc, Gflash::pro_hadscale[2]) +
32  fTanh(einc, Gflash::pro_hadscale[3]) *
34 
35  r2 = CLHEP::RandGaussQ::shoot();
37  exp(energyMeanHcal + energySigmaHcal * (energyRho * r1 + sqrt(1.0 - energyRho * energyRho) * r2));
38  } while (energyScale[Gflash::kESPM] < 0 || energyScale[Gflash::kHB] > einc * 1.5);
39  } else {
40  do {
41  r1 = CLHEP::RandGaussQ::shoot();
43  einc * (fTanh(einc, Gflash::pro_emscale[0]) + fTanh(einc, Gflash::pro_emscale[1]) * r1);
44 
45  //@@@extend depthScale for HE
46  energyMeanHcal = (fTanh(einc, Gflash::pro_hadscale[0]) +
47  fTanh(einc, Gflash::pro_hadscale[1]) *
49  energySigmaHcal =
50  (fTanh(einc, Gflash::pro_hadscale[2]) +
51  fTanh(einc, Gflash::pro_hadscale[3]) *
53  r2 = CLHEP::RandGaussQ::shoot();
55  exp(energyMeanHcal + energySigmaHcal * (energyRho * r1 + sqrt(1.0 - energyRho * energyRho) * r2));
56  } while (energyScale[Gflash::kENCA] < 0 || energyScale[Gflash::kHE] > einc * 1.5);
57  }
58  } else if (showerType == 2 || showerType == 3 || showerType == 6 || showerType == 7) {
59  // Hcal response for mip-like pions (mip)
60 
61  energyMeanHcal = fTanh(einc, Gflash::pro_hadscale[4]);
62  energySigmaHcal = fTanh(einc, Gflash::pro_hadscale[5]);
63 
64  double gap_corr = einc * fTanh(einc, Gflash::pro_hadscale[6]);
65 
66  if (showerType == 2 || showerType == 3) {
68 
69  do {
70  r1 = CLHEP::RandGaussQ::shoot();
71  energyScale[Gflash::kHB] = exp(energyMeanHcal + energySigmaHcal * r1);
72  } while (energyScale[Gflash::kHB] > einc * 1.5);
73 
74  if (showerType == 2) {
76  0.0, energyScale[Gflash::kHB] - gap_corr * depthScale(position.getRho(), Gflash::Rmin[Gflash::kHB], 28.));
77  }
78  } else if (showerType == 6 || showerType == 7) {
80 
81  do {
82  r1 = CLHEP::RandGaussQ::shoot();
83  energyMeanHcal += std::log(1.0 - fTanh(einc, Gflash::pro_hadscale[7]));
84  energyScale[Gflash::kHE] = exp(energyMeanHcal + energySigmaHcal * r1);
85  } while (energyScale[Gflash::kHE] > einc * 1.5);
86 
87  if (showerType == 6) {
89  std::max(0.0,
91  gap_corr * depthScale(std::fabs(position.getZ()), Gflash::Zmin[Gflash::kHE], 66.));
92  }
93  }
94  }
95 
96  // parameters for the longitudinal profiles
97  //@@@check longitudinal profiles of endcaps for possible variations
98 
99  double *rhoHcal = new double[2 * Gflash::NPar];
100  double *correlationVectorHcal = new double[Gflash::NPar * (Gflash::NPar + 1) / 2];
101 
102  //@@@until we have a separate parameterization for Endcap
103 
104  if (showerType > 3) {
105  showerType -= 4;
106  }
107  // no separate parameterization before crystal
108  if (showerType == 0)
109  showerType = 1;
110 
111  // Hcal parameters are always needed regardless of showerType
112  for (int i = 0; i < 2 * Gflash::NPar; i++) {
113  rhoHcal[i] = fTanh(einc, Gflash::pro_rho[i + showerType * 2 * Gflash::NPar]);
114  }
115 
116  getFluctuationVector(rhoHcal, correlationVectorHcal);
117 
118  double normalZ[Gflash::NPar];
119  for (int i = 0; i < Gflash::NPar; i++)
120  normalZ[i] = CLHEP::RandGaussQ::shoot();
121 
122  for (int i = 0; i < Gflash::NPar; i++) {
123  double correlationSum = 0.0;
124 
125  for (int j = 0; j < i + 1; j++) {
126  correlationSum += correlationVectorHcal[i * (i + 1) / 2 + j] * normalZ[j];
127  }
128  longHcal[i] = fTanh(einc, Gflash::pro_par[i + showerType * Gflash::NPar]) +
129  fTanh(einc, Gflash::pro_par[i + (4 + showerType) * Gflash::NPar]) * correlationSum;
130  }
131  delete[] rhoHcal;
132  delete[] correlationVectorHcal;
133 
134  // lateral parameters for Hcal
135 
136  for (int i = 0; i < Gflash::Nrpar; i++) {
137  lateralPar[Gflash::kHB][i] = fTanh(einc, Gflash::pro_rpar[i + showerType * Gflash::Nrpar]);
139  }
140 
141  // Ecal parameters are needed if and only if the shower starts inside the
142  // crystal
143 
144  if (showerType == 1) {
145  double *rhoEcal = new double[2 * Gflash::NPar];
146  double *correlationVectorEcal = new double[Gflash::NPar * (Gflash::NPar + 1) / 2];
147  for (int i = 0; i < 2 * Gflash::NPar; i++)
148  rhoEcal[i] = fTanh(einc, Gflash::pro_rho[i]);
149 
150  getFluctuationVector(rhoEcal, correlationVectorEcal);
151 
152  for (int i = 0; i < Gflash::NPar; i++)
153  normalZ[i] = CLHEP::RandGaussQ::shoot();
154  for (int i = 0; i < Gflash::NPar; i++) {
155  double correlationSum = 0.0;
156 
157  for (int j = 0; j < i + 1; j++) {
158  correlationSum += correlationVectorEcal[i * (i + 1) / 2 + j] * normalZ[j];
159  }
160  longEcal[i] =
161  fTanh(einc, Gflash::pro_par[i]) + 0.5 * fTanh(einc, Gflash::pro_par[i + 4 * Gflash::NPar]) * correlationSum;
162  }
163 
164  delete[] rhoEcal;
165  delete[] correlationVectorEcal;
166 
167  // lateral parameters for Ecal
168 
169  for (int i = 0; i < Gflash::Nrpar; i++) {
172  }
173  }
174 }

References GflashHadronShowerProfile::depthScale(), GflashHadronShowerProfile::energyScale, JetChargeProducer_cfi::exp, GflashHadronShowerProfile::fTanh(), GflashShowino::getEnergy(), GflashHadronShowerProfile::getFluctuationVector(), GflashShowino::getPositionAtShower(), GflashShowino::getShowerType(), mps_fire::i, dqmiolumiharvest::j, Gflash::kENCA, Gflash::kESPM, Gflash::kHB, Gflash::kHE, GflashHadronShowerProfile::lateralPar, Gflash::LengthCrystalEB, Gflash::LengthCrystalEE, dqm-mbProfile::log, GflashHadronShowerProfile::longEcal, GflashHadronShowerProfile::longHcal, SiStripPI::max, Gflash::NPar, Gflash::Nrpar, position, Gflash::pro_correl_hadem, Gflash::pro_emscale, Gflash::pro_hadscale, Gflash::pro_par, Gflash::pro_rho, Gflash::pro_rpar, diffTwoXMLs::r1, diffTwoXMLs::r2, Gflash::RFrontCrystalEB, Gflash::Rmin, mathSSE::sqrt(), GflashHadronShowerProfile::theShowino, Gflash::ZFrontCrystalEE, and Gflash::Zmin.

mps_fire.i
i
Definition: mps_fire.py:355
Gflash::pro_rpar
const double pro_rpar[4 *Nrpar][5]
Definition: GflashNameSpace.h:347
Gflash::LengthCrystalEE
const double LengthCrystalEE
Definition: GflashNameSpace.h:41
Gflash::ZFrontCrystalEE
const double ZFrontCrystalEE
Definition: GflashNameSpace.h:37
Gflash::pro_par
const double pro_par[8 *NPar][5]
Definition: GflashNameSpace.h:251
GflashHadronShowerProfile::theShowino
GflashShowino * theShowino
Definition: GflashHadronShowerProfile.h:59
GflashHadronShowerProfile::GflashHadronShowerProfile
GflashHadronShowerProfile(const edm::ParameterSet &parSet)
Definition: GflashHadronShowerProfile.cc:17
GflashHadronShowerProfile::fTanh
double fTanh(double einc, const double *par)
Definition: GflashHadronShowerProfile.cc:473
GflashHadronShowerProfile::depthScale
double depthScale(double ssp, double ssp0, double length)
Definition: GflashHadronShowerProfile.cc:487
Gflash::NPar
const int NPar
Definition: GflashNameSpace.h:87
Gflash::kHB
Definition: GflashNameSpace.h:13
Gflash::kHE
Definition: GflashNameSpace.h:15
Gflash::kENCA
Definition: GflashNameSpace.h:14
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
Gflash::pro_rho
const double pro_rho[8 *NPar][5]
Definition: GflashNameSpace.h:300
GflashHadronShowerProfile::energyScale
double energyScale[Gflash::kNumberCalorimeter]
Definition: GflashHadronShowerProfile.h:62
Gflash::pro_correl_hadem
const double pro_correl_hadem[5]
Definition: GflashNameSpace.h:247
Gflash::Nrpar
const int Nrpar
Definition: GflashNameSpace.h:88
Gflash::pro_emscale
const double pro_emscale[2][5]
Definition: GflashNameSpace.h:231
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
Gflash::LengthCrystalEB
const double LengthCrystalEB
Definition: GflashNameSpace.h:40
diffTwoXMLs.r2
r2
Definition: diffTwoXMLs.py:73
GflashHadronShowerProfile::lateralPar
double lateralPar[Gflash::kNumberCalorimeter][Gflash::Nrpar]
Definition: GflashHadronShowerProfile.h:66
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
GflashShowino::getShowerType
int getShowerType()
Definition: GflashShowino.h:26
Gflash::Zmin
const double Zmin[kNumberCalorimeter]
Definition: GflashNameSpace.h:28
Gflash3Vector
CLHEP::Hep3Vector Gflash3Vector
Definition: Gflash3Vector.h:6
GflashShowino::getEnergy
double getEnergy()
Definition: GflashShowino.h:27
Gflash::RFrontCrystalEB
const double RFrontCrystalEB
Definition: GflashNameSpace.h:36
GflashHadronShowerProfile::getFluctuationVector
void getFluctuationVector(double *lowTriangle, double *correlationVector)
Definition: GflashHadronShowerProfile.cc:358
GflashHadronShowerProfile::longEcal
double longEcal[Gflash::NPar]
Definition: GflashHadronShowerProfile.h:64
Gflash::pro_hadscale
const double pro_hadscale[8][5]
Definition: GflashNameSpace.h:234
diffTwoXMLs.r1
r1
Definition: diffTwoXMLs.py:53
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
GflashShowino::getPositionAtShower
Gflash3Vector & getPositionAtShower()
Definition: GflashShowino.h:30
Gflash::Rmin
const double Rmin[kNumberCalorimeter]
Definition: GflashNameSpace.h:30
GflashHadronShowerProfile::longHcal
double longHcal[Gflash::NPar]
Definition: GflashHadronShowerProfile.h:65
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
Gflash::kESPM
Definition: GflashNameSpace.h:12