CMS 3D CMS Logo

CaloRecHitResolutionProvider.h
Go to the documentation of this file.
1 #ifndef RecoParticleFlow_PFClusterProducer_CaloRecHitResolutionProvider_h
2 #define RecoParticleFlow_PFClusterProducer_CaloRecHitResolutionProvider_h
3 
5 
6 #include <cmath>
7 
9 public:
11  noiseTerm_ = iConfig.getParameter<double>("noiseTerm");
12  constantTerm2_ = std::pow(iConfig.getParameter<double>("constantTerm"), 2);
13  noiseTermLowE_ = iConfig.getParameter<double>("noiseTermLowE");
14  corrTermLowE_ = iConfig.getParameter<double>("corrTermLowE");
15  constantTermLowE2_ = std::pow(iConfig.getParameter<double>("constantTermLowE"), 2);
16  threshLowE_ = iConfig.getParameter<double>("threshLowE");
17  threshHighE_ = iConfig.getParameter<double>("threshHighE");
18 
19  resHighE2_ = std::pow((noiseTerm_ / threshHighE_), 2) + constantTerm2_;
20  }
21 
22  double timeResolution2(double energy) {
23  double res2 = 10000.;
24 
25  if (energy <= 0.)
26  return res2;
27  else if (energy < threshLowE_) {
28  if (corrTermLowE_ > 0.) { // different parametrisation
29  const double res = noiseTermLowE_ / energy + corrTermLowE_ / (energy * energy);
30  res2 = res * res;
31  } else {
32  const double noiseDivE = noiseTermLowE_ / energy;
33  res2 = noiseDivE * noiseDivE + constantTermLowE2_;
34  }
35  } else if (energy < threshHighE_) {
36  const double noiseDivE = noiseTerm_ / energy;
37  res2 = noiseDivE * noiseDivE + constantTerm2_;
38  } else // if (energy >=threshHighE_)
39  res2 = resHighE2_;
40 
41  if (res2 > 10000.)
42  return 10000.;
43  return res2;
44  }
45 
46 private:
47  double noiseTerm_; // Noise term
48  double constantTerm2_; // Constant term
49 
50  double noiseTermLowE_; // Noise term for low E
51  double constantTermLowE2_; // Constant term for low E
52  double corrTermLowE_; // 2nd term for low E, different parametrisation
53 
54  double threshLowE_; // different parametrisation below
55  double threshHighE_; // resolution constant above
56 
57  double resHighE2_; // precompute res at high E
58 };
59 
60 #endif
T getParameter(std::string const &) const
CaloRecHitResolutionProvider(const edm::ParameterSet &iConfig)
Definition: Electron.h:6
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30