CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Typedefs | Functions
PatAnalysisTasksExercise.cc File Reference
#include "PhysicsTools/PatExamples/interface/AnalysisTasksAnalyzerBTag.h"
#include "PhysicsTools/PatExamples/interface/AnalysisTasksAnalyzerJEC.h"
#include "FWCore/PythonParameterSet/interface/MakeParameterSets.h"
#include "PhysicsTools/UtilAlgos/interface/FWLiteAnalyzerWrapper.h"

Go to the source code of this file.

Typedefs

typedef
fwlite::AnalyzerWrapper
< AnalysisTasksAnalyzerBTag
WrappedFWLiteAnalysisTasksAnalyzerBTag
 
typedef
fwlite::AnalyzerWrapper
< AnalysisTasksAnalyzerJEC
WrappedFWLiteAnalysisTasksAnalyzerJEC
 

Functions

int main (int argc, char *argv[])
 

Typedef Documentation

Definition at line 6 of file PatAnalysisTasksExercise.cc.

Definition at line 7 of file PatAnalysisTasksExercise.cc.

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 9 of file PatAnalysisTasksExercise.cc.

References fwlite::AnalyzerWrapper< T >::analyze(), fwlite::AnalyzerWrapper< T >::beginJob(), gather_cfg::cout, AutoLibraryLoader::enable(), fwlite::AnalyzerWrapper< T >::endJob(), cmsRelvalreport::exit, edm::readPSetsFrom(), and AlCaHLTBitMon_QueryRunRegistry::string.

10 {
11  // load framework libraries
12  gSystem->Load( "libFWCoreFWLite" );
14 
15  // only allow one argument for this simple example which should be the
16  // the python cfg file
17  if ( argc < 2 ) {
18  std::cout << "Usage : " << argv[0] << " [parameters.py]" << std::endl;
19  return 0;
20  }
21  if( !edm::readPSetsFrom(argv[1])->existsAs<edm::ParameterSet>("process") ){
22  std::cout << " ERROR: ParametersSet 'plot' is missing in your configuration file" << std::endl; exit(0);
23  }
24 
25  WrappedFWLiteAnalysisTasksAnalyzerBTag anaBTag(edm::readPSetsFrom(argv[1])->getParameter<edm::ParameterSet>("process"), std::string("btagAnalyzer"), std::string("analyzeBTag"));
26  WrappedFWLiteAnalysisTasksAnalyzerJEC anaJEC(edm::readPSetsFrom(argv[1])->getParameter<edm::ParameterSet>("process"), std::string("jecAnalyzer"), std::string("analyzeJEC"));
27  anaBTag.beginJob();
28  anaBTag.analyze();
29  anaBTag.endJob();
30  anaJEC.beginJob();
31  anaJEC.analyze();
32  anaJEC.endJob();
33  return 0;
34 }
std::shared_ptr< ParameterSet > readPSetsFrom(std::string const &fileOrString)
tuple argc
Definition: dir2webdir.py:38
static void enable()
enable automatic library loading
tuple cout
Definition: gather_cfg.py:121