Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-07 04:37:23

0001 #include <map>
0002 #include <string>
0003 
0004 #include "TH2.h"
0005 #include "PhysicsTools/UtilAlgos/interface/BasicAnalyzer.h"
0006 #include "PhysicsTools/Heppy/interface/JetUtils.h"
0007 /**
0008    \class AnalysisTasksAnalyzerJEC AnalysisTasksAnalyzerJEC.h "PhysicsTools/UtilAlgos/interface/AnalysisTasksAnalyzerJEC.h"
0009    \brief Example class that can be used both within FWLite and within the full framework
0010 
0011    This is an example for keeping classes that can be used both within FWLite and within the full
0012    framework. The class is derived from the BasicAnalyzer base class, which is an interface for
0013    the two wrapper classes EDAnalyzerWrapper and FWLiteAnalyzerWrapper. The latter provides basic
0014    configuration file reading and event looping equivalent to the FWLiteHistograms executable of
0015    this package. You can see the FWLiteAnalyzerWrapper class at work in the FWLiteWithBasicAnalyzer
0016    executable of this package.
0017 */
0018 
0019 class AnalysisTasksAnalyzerJEC : public edm::BasicAnalyzer {
0020 public:
0021   /// default constructor
0022   AnalysisTasksAnalyzerJEC(const edm::ParameterSet& cfg, TFileDirectory& fs);
0023   AnalysisTasksAnalyzerJEC(const edm::ParameterSet& cfg, TFileDirectory& fs, edm::ConsumesCollector&& iC);
0024   /// default destructor
0025   ~AnalysisTasksAnalyzerJEC() override;
0026   /// everything that needs to be done before the event loop
0027   void beginJob() override {}
0028   /// everything that needs to be done after the event loop
0029   void endJob() override {}
0030   /// everything that needs to be done during the event loop
0031   void analyze(const edm::EventBase& event) override;
0032 
0033 private:
0034   /// input tag for mouns
0035   edm::InputTag Jets_;
0036   edm::EDGetTokenT<std::vector<pat::Jet> > JetsToken_;
0037   std::string jecLevel_;
0038   std::string patJetCorrFactors_;
0039   bool help_;
0040   unsigned int jetInEvents_;
0041   /// histograms
0042   std::map<std::string, TH2*> hists_;
0043 };