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