CMS 3D CMS Logo

FFTJetAdjusters.h
Go to the documentation of this file.
1 #include <cassert>
2 
5 
6 template <class MyJet, class Adjustable>
7 struct FFTSimpleScalingAdjuster : public AbsFFTJetAdjuster<MyJet, Adjustable> {
8  inline ~FFTSimpleScalingAdjuster() override {}
9 
10  void adjust(const MyJet& /* jet */,
11  const Adjustable& in,
12  const double* factors,
13  const unsigned lenFactors,
14  Adjustable* out) const override {
15  if (lenFactors != 1U)
16  throw cms::Exception("FFTJetBadConfig") << "In FFTSimpleScalingAdjuster::adjust: wrong number of "
17  << "scales (expected 1, got " << lenFactors << ")\n";
18  assert(factors);
19  assert(out);
20  *out = in;
21  *out *= factors[0];
22  }
23 };
24 
25 template <class MyJet, class Adjustable>
26 struct FFTUncertaintyAdjuster : public AbsFFTJetAdjuster<MyJet, Adjustable> {
27  inline ~FFTUncertaintyAdjuster() override {}
28 
29  void adjust(const MyJet& /* jet */,
30  const Adjustable& in,
31  const double* factors,
32  const unsigned lenFactors,
33  Adjustable* out) const override {
34  if (lenFactors != 1U)
35  throw cms::Exception("FFTJetBadConfig") << "In FFTUncertaintyAdjuster::adjust: wrong number of "
36  << "scales (expected 1, got " << lenFactors << ")\n";
37  assert(factors);
38  assert(out);
39  *out = in;
40  const double s = factors[0];
41  out->setVariance(in.variance() + s * s);
42  }
43 };
44 
45 template <class MyJet, class Adjustable>
46 struct FFTScalingAdjusterWithUncertainty : public AbsFFTJetAdjuster<MyJet, Adjustable> {
48 
49  void adjust(const MyJet& /* jet */,
50  const Adjustable& in,
51  const double* factors,
52  const unsigned lenFactors,
53  Adjustable* out) const override {
54  if (lenFactors != 2U)
55  throw cms::Exception("FFTJetBadConfig") << "In FFTScalingAdjusterWithUncertainty::adjust: wrong "
56  << "number of scales (expected 2, got " << lenFactors << ")\n";
57  assert(factors);
58  assert(out);
59  *out = in;
60  *out *= factors[0];
61  const double s = factors[1];
62  out->setVariance(in.variance() + s * s);
63  }
64 };
FFTSimpleScalingAdjuster::~FFTSimpleScalingAdjuster
~FFTSimpleScalingAdjuster() override
Definition: FFTJetAdjusters.h:8
FFTUncertaintyAdjuster
Definition: FFTJetAdjusters.h:26
cms::cuda::assert
assert(be >=bs)
FFTUncertaintyAdjuster::~FFTUncertaintyAdjuster
~FFTUncertaintyAdjuster() override
Definition: FFTJetAdjusters.h:27
alignCSCRings.s
s
Definition: alignCSCRings.py:92
FFTScalingAdjusterWithUncertainty::~FFTScalingAdjusterWithUncertainty
~FFTScalingAdjusterWithUncertainty() override
Definition: FFTJetAdjusters.h:47
FFTScalingAdjusterWithUncertainty::adjust
void adjust(const MyJet &, const Adjustable &in, const double *factors, const unsigned lenFactors, Adjustable *out) const override
Definition: FFTJetAdjusters.h:49
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
recoMuon::in
Definition: RecoMuonEnumerators.h:6
AbsFFTJetAdjuster
Definition: AbsFFTJetAdjuster.h:5
FFTSimpleScalingAdjuster
Definition: FFTJetAdjusters.h:7
FFTScalingAdjusterWithUncertainty
Definition: FFTJetAdjusters.h:46
FFTUncertaintyAdjuster::adjust
void adjust(const MyJet &, const Adjustable &in, const double *factors, const unsigned lenFactors, Adjustable *out) const override
Definition: FFTJetAdjusters.h:29
AbsFFTJetAdjuster.h
Exception
Definition: hltDiff.cc:245
Exception.h
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
FFTSimpleScalingAdjuster::adjust
void adjust(const MyJet &, const Adjustable &in, const double *factors, const unsigned lenFactors, Adjustable *out) const override
Definition: FFTJetAdjusters.h:10