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  {
24  double res2 = 10000.;
25 
26  if (energy <= 0.)
27  return res2;
28  else if (energy < threshLowE_)
29  {
30  if (corrTermLowE_ > 0.) {// different parametrisation
31  const double res = noiseTermLowE_/energy + corrTermLowE_/(energy*energy);
32  res2 = res*res;
33  }
34  else {
35  const double noiseDivE = noiseTermLowE_/energy;
36  res2 = noiseDivE*noiseDivE + constantTermLowE2_;
37  }
38  }
39  else if (energy < threshHighE_) {
40  const double noiseDivE = noiseTerm_/energy;
41  res2 = noiseDivE*noiseDivE + constantTerm2_;
42  }
43  else // if (energy >=threshHighE_)
44  res2 = resHighE2_;
45 
46  if (res2 > 10000.)
47  return 10000.;
48  return res2;
49 
50  }
51 private:
52 
53  double noiseTerm_; // Noise term
54  double constantTerm2_; // Constant term
55 
56  double noiseTermLowE_; // Noise term for low E
57  double constantTermLowE2_; // Constant term for low E
58  double corrTermLowE_; // 2nd term for low E, different parametrisation
59 
60  double threshLowE_; // different parametrisation below
61  double threshHighE_; // resolution constant above
62 
63  double resHighE2_; // precompute res at high E
64 
65 };
66 
67 #endif
68 
69 
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:40