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, float emEnergy, float& expectedDepth, float& expectedSigma) const {
7  float lny = (emEnergy > criticalEnergy_) ? std::log(emEnergy/criticalEnergy_) : 0.;
8 
9  // inject here parametrization results
10  float meantmax = meant0_ + meant1_*lny;
11  float meanalpha = meanalpha0_ + meanalpha1_*lny;
12  if ( meanalpha < 1. ) meanalpha = 1.1; // no poles
13  float sigmalntmax = 1. / (sigmalnt0_+sigmalnt1_*lny);
14  float sigmalnalpha = 1. / (sigmalnalpha0_+sigmalnalpha1_*lny);
15  float corrlnalphalntmax = corrlnalphalnt0_+corrlnalphalnt1_*lny;
16 
17  float invbeta = meantmax/(meanalpha-1.);
18  float predictedDepth = meanalpha*invbeta;
19  predictedDepth *= radiationLength_;
20 
21  float predictedSigma = sigmalnalpha*sigmalnalpha/((meanalpha-1.)*(meanalpha-1.));
22  predictedSigma += sigmalntmax*sigmalntmax;
23  predictedSigma -= 2*sigmalnalpha*sigmalntmax*corrlnalphalntmax/(meanalpha-1.);
24  if ( predictedSigma < 0. ) predictedSigma = 1.e10; // say we can't predict anything
25  predictedSigma = predictedDepth*std::sqrt(predictedSigma);
26 
27  expectedDepth = predictedDepth;
28  expectedSigma = predictedSigma;
29  return (measuredDepth-predictedDepth)/predictedSigma;
30 }
static constexpr float meant0_
Definition: ShowerDepth.h:41
static constexpr float corrlnalphalnt0_
Definition: ShowerDepth.h:55
static constexpr float sigmalnalpha1_
Definition: ShowerDepth.h:52
float getClusterDepthCompatibility(float measuredDepth, float emEnergy, float &expectedDepth, float &expectedSigma) const
Definition: ShowerDepth.cc:6
static constexpr float meanalpha0_
Definition: ShowerDepth.h:44
static constexpr float meanalpha1_
Definition: ShowerDepth.h:45
T sqrt(T t)
Definition: SSEVec.h:18
static constexpr float radiationLength_
Definition: ShowerDepth.h:37
static constexpr float meant1_
Definition: ShowerDepth.h:42
static constexpr float sigmalnalpha0_
Definition: ShowerDepth.h:51
static constexpr float sigmalnt1_
Definition: ShowerDepth.h:49
static constexpr float corrlnalphalnt1_
Definition: ShowerDepth.h:56
static constexpr float criticalEnergy_
Definition: ShowerDepth.h:36
static constexpr float sigmalnt0_
Definition: ShowerDepth.h:48