CMS 3D CMS Logo

PatAnalysisTasksExercise.cc
Go to the documentation of this file.
5 
8 
9 int main(int argc, char* argv[]) {
10  // load framework libraries
11  gSystem->Load("libFWCoreFWLite");
13 
14  // only allow one argument for this simple example which should be the
15  // the python cfg file
16  if (argc < 2) {
17  std::cout << "Usage : " << argv[0] << " [parameters.py]" << std::endl;
18  return 0;
19  }
20  if (!edm::readPSetsFrom(argv[1])->existsAs<edm::ParameterSet>("process")) {
21  std::cout << " ERROR: ParametersSet 'plot' is missing in your configuration file" << std::endl;
22  exit(0);
23  }
24 
26  edm::readPSetsFrom(argv[1])->getParameter<edm::ParameterSet>("process"),
27  std::string("btagAnalyzer"),
28  std::string("analyzeBTag"));
29  WrappedFWLiteAnalysisTasksAnalyzerJEC anaJEC(edm::readPSetsFrom(argv[1])->getParameter<edm::ParameterSet>("process"),
30  std::string("jecAnalyzer"),
31  std::string("analyzeJEC"));
32  anaBTag.beginJob();
33  anaBTag.analyze();
34  anaBTag.endJob();
35  anaJEC.beginJob();
36  anaJEC.analyze();
37  anaJEC.endJob();
38  return 0;
39 }
fwlite::AnalyzerWrapper< AnalysisTasksAnalyzerJEC > WrappedFWLiteAnalysisTasksAnalyzerJEC
static void enable()
enable automatic library loading
virtual void beginJob()
everything which has to be done before the event loop
std::unique_ptr< edm::ParameterSet > readPSetsFrom(std::string const &fileOrString)
virtual void endJob()
everything which has to be done after the event loop
fwlite::AnalyzerWrapper< AnalysisTasksAnalyzerBTag > WrappedFWLiteAnalysisTasksAnalyzerBTag
virtual void analyze()
everything which has to be done during the event loop. NOTE: the event will be looped inside this fun...
int main(int argc, char *argv[])
def exit(msg="")