00001 #include "PhysicsTools/PatExamples/interface/AnalysisTasksAnalyzerBTag.h" 00002 #include "PhysicsTools/PatExamples/interface/AnalysisTasksAnalyzerJEC.h" 00003 #include "FWCore/PythonParameterSet/interface/MakeParameterSets.h" 00004 #include "PhysicsTools/UtilAlgos/interface/FWLiteAnalyzerWrapper.h" 00005 00006 typedef fwlite::AnalyzerWrapper<AnalysisTasksAnalyzerBTag> WrappedFWLiteAnalysisTasksAnalyzerBTag; 00007 typedef fwlite::AnalyzerWrapper<AnalysisTasksAnalyzerJEC> WrappedFWLiteAnalysisTasksAnalyzerJEC; 00008 00009 int main(int argc, char* argv[]) 00010 { 00011 // load framework libraries 00012 gSystem->Load( "libFWCoreFWLite" ); 00013 AutoLibraryLoader::enable(); 00014 00015 // only allow one argument for this simple example which should be the 00016 // the python cfg file 00017 if ( argc < 2 ) { 00018 std::cout << "Usage : " << argv[0] << " [parameters.py]" << std::endl; 00019 return 0; 00020 } 00021 if( !edm::readPSetsFrom(argv[1])->existsAs<edm::ParameterSet>("process") ){ 00022 std::cout << " ERROR: ParametersSet 'plot' is missing in your configuration file" << std::endl; exit(0); 00023 } 00024 00025 WrappedFWLiteAnalysisTasksAnalyzerBTag anaBTag(edm::readPSetsFrom(argv[1])->getParameter<edm::ParameterSet>("process"), std::string("btagAnalyzer"), std::string("analyzeBTag")); 00026 WrappedFWLiteAnalysisTasksAnalyzerJEC anaJEC(edm::readPSetsFrom(argv[1])->getParameter<edm::ParameterSet>("process"), std::string("jecAnalyzer"), std::string("analyzeJEC")); 00027 anaBTag.beginJob(); 00028 anaBTag.analyze(); 00029 anaBTag.endJob(); 00030 anaJEC.beginJob(); 00031 anaJEC.analyze(); 00032 anaJEC.endJob(); 00033 return 0; 00034 }