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 
23 
27 
28 #include <string>
29 #include <vector>
30 
31 #include <TF2.h>
32 
35 
36 public:
38  ~ShiftedParticleProducer() override;
39 
40 private:
41  void produce(edm::Event& evt, const edm::EventSetup& es) override;
42 
43  double getUncShift(const reco::Candidate& originalParticle);
44 
46 
49 
52  : binSelection_(nullptr), binUncertainty_(uncertainty), energyDep_(false) {
54  std::make_unique<TF2>(std::string(moduleLabel).append("_uncFormula").c_str(), binUncertainty_.c_str());
55  }
57  : binSelection_(new StringCutObjectSelector<reco::Candidate>(cfg.getParameter<std::string>("binSelection"))),
58  binUncertainty_(cfg.getParameter<std::string>("binUncertainty")),
59  energyDep_(false) {
61  std::make_unique<TF2>(std::string(moduleLabel).append("_uncFormula").c_str(), binUncertainty_.c_str());
62  if (cfg.exists("energyDependency")) {
63  energyDep_ = cfg.getParameter<bool>("energyDependency");
64  }
65  }
67  std::unique_ptr<StringCutObjectSelector<reco::Candidate>> binSelection_;
68  //double binUncertainty_;
70  std::unique_ptr<TF2> binUncFormula_;
71  bool energyDep_;
72  };
73  std::vector<binningEntryType*> binning_;
74 
75  double shiftBy_; // set to +1.0/-1.0 for up/down variation of energy scale
76 };
77 
78 #endif
ShiftedParticleProducer::binningEntryType::binningEntryType
binningEntryType(std::string uncertainty, std::string moduleLabel)
Definition: ShiftedParticleProducer.h:51
ShiftedParticleProducer::binning_
std::vector< binningEntryType * > binning_
Definition: ShiftedParticleProducer.h:73
funct::false
false
Definition: Factorize.h:29
configurableAnalysis::Candidate
char Candidate[]
Definition: modules.cc:20
edm::EDGetTokenT< CandidateView >
EDProducer.h
ShiftedParticleProducer::~ShiftedParticleProducer
~ShiftedParticleProducer() override
Definition: ShiftedParticleProducer.cc:27
ShiftedParticleProducer::ShiftedParticleProducer
ShiftedParticleProducer(const edm::ParameterSet &cfg)
Definition: ShiftedParticleProducer.cc:4
ShiftedParticleProducer::binningEntryType::energyDep_
bool energyDep_
Definition: ShiftedParticleProducer.h:71
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
ShiftedParticleProducer::binningEntryType
Definition: ShiftedParticleProducer.h:50
ShiftedParticleProducer::binningEntryType::binUncFormula_
std::unique_ptr< TF2 > binUncFormula_
Definition: ShiftedParticleProducer.h:70
ShiftedParticleProducer::srcToken_
edm::EDGetTokenT< CandidateView > srcToken_
Definition: ShiftedParticleProducer.h:47
ShiftedParticleProducer::binningEntryType::binUncertainty_
std::string binUncertainty_
Definition: ShiftedParticleProducer.h:69
LeafCandidate.h
ShiftedParticleProducer::getUncShift
double getUncShift(const reco::Candidate &originalParticle)
Definition: ShiftedParticleProducer.cc:71
ShiftedParticleProducer::moduleLabel_
std::string moduleLabel_
Definition: ShiftedParticleProducer.h:45
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::View
Definition: CaloClusterFwd.h:14
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
ShiftedParticleProducer::produce
void produce(edm::Event &evt, const edm::EventSetup &es) override
Definition: ShiftedParticleProducer.cc:33
mps_setup.append
append
Definition: mps_setup.py:85
ShiftedParticleProducer::weightsToken_
edm::EDGetTokenT< edm::ValueMap< float > > weightsToken_
Definition: ShiftedParticleProducer.h:48
edm::stream::EDProducer
Definition: EDProducer.h:38
edm::EventSetup
Definition: EventSetup.h:57
ShiftedParticleProducer::binningEntryType::binningEntryType
binningEntryType(const edm::ParameterSet &cfg, std::string moduleLabel)
Definition: ShiftedParticleProducer.h:56
InputTag.h
looper.cfg
cfg
Definition: looper.py:297
reco::Candidate
Definition: Candidate.h:27
ValueMap.h
std
Definition: JetResolutionObject.h:76
StringCutObjectSelector.h
ShiftedParticleProducer::shiftBy_
double shiftBy_
Definition: ShiftedParticleProducer.h:75
StringCutObjectSelector
Definition: StringCutObjectSelector.h:16
ShiftedParticleProducer
Definition: ShiftedParticleProducer.h:33
EventSetup.h
Candidate.h
ShiftedParticleProducer::binningEntryType::binSelection_
std::unique_ptr< StringCutObjectSelector< reco::Candidate > > binSelection_
Definition: ShiftedParticleProducer.h:67
ParameterSet.h
HerwigMaxPtPartonFilter_cfi.moduleLabel
moduleLabel
Definition: HerwigMaxPtPartonFilter_cfi.py:4
edm::Event
Definition: Event.h:73
ShiftedParticleProducer::binningEntryType::~binningEntryType
~binningEntryType()
Definition: ShiftedParticleProducer.h:66
ShiftedParticleProducer::CandidateView
edm::View< reco::Candidate > CandidateView
Definition: ShiftedParticleProducer.h:34