Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:26

0001 #ifndef JetMETCorrections_Type1MET_MultShiftMETcorrDBInputProducer_h
0002 #define JetMETCorrections_Type1MET_MultShiftMETcorrDBInputProducer_h
0003 
0004 /** \class MultShiftMETcorrDBInputProducer
0005  *
0006  * Compute MET correction to compensate systematic shift of MET in x/y-direction
0007  * (cf. https://indico.cern.ch/getFile.py/access?contribId=1&resId=0&materialId=slides&confId=174318 )
0008  *
0009  * \authors SangEun Lee,
0010  * \authors Robert Schoefbeck, Vienna
0011  *
0012  *
0013  *
0014  */
0015 
0016 #include "FWCore/Framework/interface/stream/EDProducer.h"
0017 #include "FWCore/Framework/interface/Event.h"
0018 #include "FWCore/Framework/interface/EventSetup.h"
0019 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0020 #include "FWCore/Utilities/interface/InputTag.h"
0021 #include "FWCore/Utilities/interface/ESGetToken.h"
0022 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
0023 #include "DataFormats/Common/interface/ValueMap.h"
0024 
0025 #include "DataFormats/METReco/interface/MET.h"
0026 #include "DataFormats/VertexReco/interface/VertexFwd.h"
0027 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h"
0028 #include "CondFormats/JetMETObjects/interface/MEtXYcorrectParameters.h"
0029 #include "JetMETCorrections/Objects/interface/MEtXYcorrectRecord.h"
0030 
0031 #include <TF1.h>
0032 
0033 #include <string>
0034 #include <vector>
0035 
0036 class MultShiftMETcorrDBInputProducer : public edm::stream::EDProducer<> {
0037 public:
0038   explicit MultShiftMETcorrDBInputProducer(const edm::ParameterSet&);
0039   ~MultShiftMETcorrDBInputProducer() override;
0040 
0041 private:
0042   void produce(edm::Event&, const edm::EventSetup&) override;
0043   static int translateTypeToAbsPdgId(reco::PFCandidate::ParticleType type);
0044 
0045   edm::EDGetTokenT<edm::View<reco::Candidate>> pflow_;
0046   edm::EDGetTokenT<edm::View<reco::Vertex>> vertices_;
0047   edm::ESGetToken<MEtXYcorrectParametersCollection, MEtXYcorrectRecord> mMEtXYcorParaColl_;
0048   std::string moduleLabel_;
0049   std::string mPayloadName;
0050   std::string mSampleType;
0051   bool mIsData;
0052   edm::EDGetTokenT<edm::ValueMap<float>> weightsToken_;
0053 
0054   std::vector<edm::ParameterSet> cfgCorrParameters_;
0055 
0056   std::vector<double> etaMin_, etaMax_;
0057   int counts_;
0058   double sumPt_;
0059   std::unique_ptr<TF1> formula_x_;
0060   std::unique_ptr<TF1> formula_y_;
0061 };
0062 
0063 #endif