CMS 3D CMS Logo

ShiftedParticleProducer.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_PatUtils_ShiftedParticleProducer_h
2 #define PhysicsTools_PatUtils_ShiftedParticleProducer_h
3 
22 
26 
27 #include <string>
28 #include <vector>
29 
30 #include <TF2.h>
31 
34 
35 public:
37  ~ShiftedParticleProducer() override;
38 
39 private:
40  void produce(edm::Event& evt, const edm::EventSetup& es) override;
41 
42  double getUncShift(const CandidateView::const_iterator& originalParticle);
43 
45 
47 
52  std::make_unique<TF2>(std::string(moduleLabel).append("_uncFormula").c_str(), binUncertainty_.c_str());
53  }
55  : binSelection_(new StringCutObjectSelector<reco::Candidate>(cfg.getParameter<std::string>("binSelection"))),
56  binUncertainty_(cfg.getParameter<std::string>("binUncertainty")),
57  energyDep_(false) {
59  std::make_unique<TF2>(std::string(moduleLabel).append("_uncFormula").c_str(), binUncertainty_.c_str());
60  if (cfg.exists("energyDependency")) {
61  energyDep_ = cfg.getParameter<bool>("energyDependency");
62  }
63  }
65  std::unique_ptr<StringCutObjectSelector<reco::Candidate> > binSelection_;
66  //double binUncertainty_;
68  std::unique_ptr<TF2> binUncFormula_;
69  bool energyDep_;
70  };
71  std::vector<binningEntryType*> binning_;
72 
73  double shiftBy_; // set to +1.0/-1.0 for up/down variation of energy scale
74 };
75 
76 #endif
T getParameter(std::string const &) const
edm::View< reco::Candidate > CandidateView
edm::EDGetTokenT< CandidateView > srcToken_
#define nullptr
bool exists(std::string const &parameterName) const
checks if a parameter exists
binningEntryType(std::string uncertainty, std::string moduleLabel)
void produce(edm::Event &evt, const edm::EventSetup &es) override
ShiftedParticleProducer(const edm::ParameterSet &cfg)
binningEntryType(const edm::ParameterSet &cfg, std::string moduleLabel)
std::unique_ptr< StringCutObjectSelector< reco::Candidate > > binSelection_
double getUncShift(const CandidateView::const_iterator &originalParticle)
fixed size matrix
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
std::vector< binningEntryType * > binning_