CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/PhysicsTools/UtilAlgos/bin/FWLiteWithBasicAnalyzer.cc

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