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 
33 {
35 
36  public:
37 
39  ~ShiftedParticleProducer() override;
40 
41  private:
42 
43  void produce(edm::Event& evt, const edm::EventSetup& es) override;
44 
45  double getUncShift(const CandidateView::const_iterator& originalParticle);
46 
47 
49 
51 
53  {
54  binningEntryType(std::string uncertainty, std::string moduleLabel)
56  binUncertainty_(uncertainty),
58  {
59  binUncFormula_ = std::make_unique<TF2>(std::string(moduleLabel).append("_uncFormula").c_str(), binUncertainty_.c_str() );
60  }
62  : binSelection_(new StringCutObjectSelector<reco::Candidate>(cfg.getParameter<std::string>("binSelection"))),
63  binUncertainty_(cfg.getParameter<std::string>("binUncertainty")),
65  {
66  binUncFormula_ = std::make_unique<TF2>(std::string(moduleLabel).append("_uncFormula").c_str(), binUncertainty_.c_str() );
67  if(cfg.exists("energyDependency") ) {energyDep_=cfg.getParameter<bool>("energyDependency");
68  }
69  }
71  {
72  }
73  std::unique_ptr<StringCutObjectSelector<reco::Candidate> > binSelection_;
74  //double binUncertainty_;
76  std::unique_ptr<TF2> binUncFormula_;
77  bool energyDep_;
78  };
79  std::vector<binningEntryType*> binning_;
80 
81  double shiftBy_; // set to +1.0/-1.0 for up/down variation of energy scale
82 };
83 
84 #endif
T getParameter(std::string const &) const
edm::View< reco::Candidate > CandidateView
edm::EDGetTokenT< CandidateView > srcToken_
bool exists(std::string const &parameterName) const
checks if a parameter exists
binningEntryType(std::string uncertainty, std::string moduleLabel)
#define nullptr
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_