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