CMS 3D CMS Logo

ShowerDepth.cc
Go to the documentation of this file.
2 #include <cmath>
3 
4 using namespace hgcal;
5 
6 float ShowerDepth::getClusterDepthCompatibility(float measuredDepth,
7  float emEnergy,
8  float& expectedDepth,
9  float& expectedSigma) const {
10  float lny = (emEnergy > criticalEnergy_) ? std::log(emEnergy / criticalEnergy_) : 0.;
11 
12  // inject here parametrization results
13  float meantmax = meant0_ + meant1_ * lny;
14  float meanalpha = meanalpha0_ + meanalpha1_ * lny;
15  if (meanalpha < 1.)
16  meanalpha = 1.1; // no poles
17  float sigmalntmax = 1. / (sigmalnt0_ + sigmalnt1_ * lny);
18  float sigmalnalpha = 1. / (sigmalnalpha0_ + sigmalnalpha1_ * lny);
19  float corrlnalphalntmax = corrlnalphalnt0_ + corrlnalphalnt1_ * lny;
20 
21  float invbeta = meantmax / (meanalpha - 1.);
22  float predictedDepth = meanalpha * invbeta;
23  predictedDepth *= radiationLength_;
24 
25  float predictedSigma = sigmalnalpha * sigmalnalpha / ((meanalpha - 1.) * (meanalpha - 1.));
26  predictedSigma += sigmalntmax * sigmalntmax;
27  predictedSigma -= 2 * sigmalnalpha * sigmalntmax * corrlnalphalntmax / (meanalpha - 1.);
28  if (predictedSigma < 0.)
29  predictedSigma = 1.e10; // say we can't predict anything
30  predictedSigma = predictedDepth * std::sqrt(predictedSigma);
31 
32  expectedDepth = predictedDepth;
33  expectedSigma = predictedSigma;
34  return (measuredDepth - predictedDepth) / predictedSigma;
35 }
static constexpr float meant0_
Definition: ShowerDepth.h:44
static constexpr float corrlnalphalnt0_
Definition: ShowerDepth.h:58
static constexpr float sigmalnalpha1_
Definition: ShowerDepth.h:55
float getClusterDepthCompatibility(float measuredDepth, float emEnergy, float &expectedDepth, float &expectedSigma) const
Definition: ShowerDepth.cc:6
static constexpr float meanalpha0_
Definition: ShowerDepth.h:47
static constexpr float meanalpha1_
Definition: ShowerDepth.h:48
T sqrt(T t)
Definition: SSEVec.h:19
static constexpr float radiationLength_
Definition: ShowerDepth.h:40
static constexpr float meant1_
Definition: ShowerDepth.h:45
static constexpr float sigmalnalpha0_
Definition: ShowerDepth.h:54
static constexpr float sigmalnt1_
Definition: ShowerDepth.h:52
static constexpr float corrlnalphalnt1_
Definition: ShowerDepth.h:59
static constexpr float criticalEnergy_
Definition: ShowerDepth.h:39
static constexpr float sigmalnt0_
Definition: ShowerDepth.h:51