Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:33:05

0001 #include "PhysicsTools/PatExamples/interface/AnalysisTasksAnalyzerBTag.h"
0002 #include "PhysicsTools/PatExamples/interface/AnalysisTasksAnalyzerJEC.h"
0003 #include "FWCore/ParameterSetReader/interface/ParameterSetReader.h"
0004 #include "PhysicsTools/FWLite/interface/FWLiteAnalyzerWrapper.h"
0005 
0006 typedef fwlite::AnalyzerWrapper<AnalysisTasksAnalyzerBTag> WrappedFWLiteAnalysisTasksAnalyzerBTag;
0007 typedef fwlite::AnalyzerWrapper<AnalysisTasksAnalyzerJEC> WrappedFWLiteAnalysisTasksAnalyzerJEC;
0008 
0009 int main(int argc, char* argv[]) {
0010   // load framework libraries
0011   gSystem->Load("libFWCoreFWLite");
0012   FWLiteEnabler::enable();
0013 
0014   // only allow one argument for this simple example which should be the
0015   // the python cfg file
0016   if (argc < 2) {
0017     std::cout << "Usage : " << argv[0] << " [parameters.py]" << std::endl;
0018     return 0;
0019   }
0020   if (!edm::readPSetsFrom(argv[1])->existsAs<edm::ParameterSet>("process")) {
0021     std::cout << " ERROR: ParametersSet 'plot' is missing in your configuration file" << std::endl;
0022     exit(0);
0023   }
0024 
0025   WrappedFWLiteAnalysisTasksAnalyzerBTag anaBTag(
0026       edm::readPSetsFrom(argv[1])->getParameter<edm::ParameterSet>("process"),
0027       std::string("btagAnalyzer"),
0028       std::string("analyzeBTag"));
0029   WrappedFWLiteAnalysisTasksAnalyzerJEC anaJEC(edm::readPSetsFrom(argv[1])->getParameter<edm::ParameterSet>("process"),
0030                                                std::string("jecAnalyzer"),
0031                                                std::string("analyzeJEC"));
0032   anaBTag.beginJob();
0033   anaBTag.analyze();
0034   anaBTag.endJob();
0035   anaJEC.beginJob();
0036   anaJEC.analyze();
0037   anaJEC.endJob();
0038   return 0;
0039 }