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 
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
CaloRecHitResolutionProvider
Definition: CaloRecHitResolutionProvider.h:8
CaloRecHitResolutionProvider::CaloRecHitResolutionProvider
CaloRecHitResolutionProvider(const edm::ParameterSet &iConfig)
Definition: CaloRecHitResolutionProvider.h:10
CaloRecHitResolutionProvider::threshHighE_
double threshHighE_
Definition: CaloRecHitResolutionProvider.h:55
CaloRecHitResolutionProvider::noiseTermLowE_
double noiseTermLowE_
Definition: CaloRecHitResolutionProvider.h:50
CaloRecHitResolutionProvider::constantTerm2_
double constantTerm2_
Definition: CaloRecHitResolutionProvider.h:48
CaloRecHitResolutionProvider::noiseTerm_
double noiseTerm_
Definition: CaloRecHitResolutionProvider.h:47
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
edm::ParameterSet
Definition: ParameterSet.h:36
CaloRecHitResolutionProvider::timeResolution2
double timeResolution2(double energy)
Definition: CaloRecHitResolutionProvider.h:22
res
Definition: Electron.h:6
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
CaloRecHitResolutionProvider::resHighE2_
double resHighE2_
Definition: CaloRecHitResolutionProvider.h:57
CaloRecHitResolutionProvider::threshLowE_
double threshLowE_
Definition: CaloRecHitResolutionProvider.h:54
CaloRecHitResolutionProvider::constantTermLowE2_
double constantTermLowE2_
Definition: CaloRecHitResolutionProvider.h:51
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
ParameterSet.h
CaloRecHitResolutionProvider::corrTermLowE_
double corrTermLowE_
Definition: CaloRecHitResolutionProvider.h:52