CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
JetCorrFactorsProducer.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_PatAlgos_JetCorrFactorsProducer_h
2 #define PhysicsTools_PatAlgos_JetCorrFactorsProducer_h
3 
39 #include <map>
40 #include <string>
41 #include <memory>
42 
45 
50 
55 
56 
57 namespace pat {
58 
60  public:
64  typedef std::map<JetCorrFactors::Flavor, std::vector<std::string> > FlavorCorrLevelMap;
65 
66  public:
72  virtual void produce(edm::Event& event, const edm::EventSetup& setup) override;
74  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
75 
76  private:
78  bool flavorDependent() const { return (levels_.size()>1); };
80  std::vector<JetCorrectorParameters> params(const JetCorrectorParametersCollection& parameters, const std::vector<std::string>& levels) const;
84  std::vector<std::string> expand(const std::vector<std::string>& levels, const JetCorrFactors::Flavor& flavor);
88  int numberOf(const edm::Handle<std::vector<reco::Vertex> >& primaryVertices);
91 
92  private:
94  bool emf_;
105  std::vector<std::string> extraJPTOffset_;
113  bool useNPV_;
114  bool useRho_;
127  unsigned long long cacheId_;
129  std::map<JetCorrFactors::Flavor, std::unique_ptr<FactorizedJetCorrector> > correctors_;
131  std::unique_ptr<FactorizedJetCorrector> extraJPTOffsetCorrector_;
132  };
133 
134  inline int
136  {
137  int npv=0;
138  for(std::vector<reco::Vertex>::const_iterator pv=primaryVertices->begin(); pv!=primaryVertices->end(); ++pv){
139  if(pv->ndof()>=4) ++npv;
140  }
141  return npv;
142  }
143 }
144 
145 #endif
edm::EDGetTokenT< double > rhoToken_
dictionary parameters
Definition: Parameters.py:2
tuple cfg
Definition: looper.py:293
std::string payload()
map jet algorithm to payload in DB
std::string label_
label of jec factors
edm::EDGetTokenT< std::vector< reco::Vertex > > primaryVerticesToken_
std::vector< std::string > extraJPTOffset_
bool emf_
use electromagnetic fraction for jet energy corrections or not (will only have an effect for jets Cal...
std::string payload_
label of payload
JetCorrFactorsProducer(const edm::ParameterSet &cfg)
default constructor
bool flavorDependent() const
return true if the jec levels contain at least one flavor dependent correction level ...
virtual void produce(edm::Event &event, const edm::EventSetup &setup) override
everything that needs to be done per event
int numberOf(const edm::Handle< std::vector< reco::Vertex > > &primaryVertices)
determines the number of valid primary vertices for the standard L1Offset correction of JetMET ...
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
Produces a ValueMap between JetCorrFactors and the to the originating reco jets.
edm::ValueMap< pat::JetCorrFactors > JetCorrFactorsMap
value map for JetCorrFactors (to be written into the event)
std::vector< std::string > expand(const std::vector< std::string > &levels, const JetCorrFactors::Flavor &flavor)
edm::EDGetTokenT< edm::View< reco::Jet > > srcToken_
input jet collection
std::vector< JetCorrectorParameters > params(const JetCorrectorParametersCollection &parameters, const std::vector< std::string > &levels) const
return the jec parameters as input to the FactorizedJetCorrector for different flavors ...
~JetCorrFactorsProducer()
default destructor
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:85
std::unique_ptr< FactorizedJetCorrector > extraJPTOffsetCorrector_
cache container for JPTOffset jet corrections
std::map< JetCorrFactors::Flavor, std::unique_ptr< FactorizedJetCorrector > > correctors_
cache container for jet corrections
tuple level
Definition: testEve_cfg.py:34
edm::InputTag primaryVertices_
label for L1Offset primaryVertex collection
edm::InputTag rho_
label for L1FastJet energy density parameter rho
bool useNPV_
use the NPV and rho with the JEC? (used for L1Offset/L1FastJet and L1FastJet, resp.)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
description of configuration file parameters
std::string type_
type of flavor dependent JEC factors (only &#39;J&#39; and &#39;T&#39; are allowed)
float evaluate(edm::View< reco::Jet >::const_iterator &jet, const JetCorrFactors::Flavor &flavor, int level)
evaluate jet correction factor up to a given level
std::map< JetCorrFactors::Flavor, std::vector< std::string > > FlavorCorrLevelMap
map of correction levels to different flavors
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
unsigned long long cacheId_
cache identifier for JetCorrectionsRecord