Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JWeightFileScanner.cc
Go to the documentation of this file.
1 
2 #include "JWeightFileScanner.hh"
3 #include "JWeightMupage.hh"
4 
5 #include "Jeep/JParser.hh"
6 #include "Jeep/JMessage.hh"
7 
8 
9 int main(int argc, char **argv)
10 {
11  using namespace std;
12  using namespace JPP;
13 
14  JMultipleFileScanner<Evt> inputFile;
15  int debug;
16 
17  try {
18 
19  JParser<> zap;
20 
21  zap['f'] = make_field(inputFile);
22  zap['d'] = make_field(debug) = 1;
23 
24  zap(argc, argv);
25  }
26  catch(const exception& error) {
27  FATAL(error.what() << endl);
28  }
29 
30 
31  JHead header; // selection
32 
33  header.physics.resize(1);
34  header.physics[0].program = "MUPAGE";
35  header.livetime.numberOfSeconds = 1.0;
36 
37  JWeightFileScanner<> in(getAAnetFiles(inputFile, header), JWeightMupage());
38 
39  // following syntax should be universal
40 
41  while (in.hasNext()) {
42 
43  const Evt* evt = in.next();
44 
45  const double W = in.getWeight(*evt);
46 
47  DEBUG("Weight: " << W << endl);
48 
49  //TH1D::Fill(.., W);
50  }
51 }
Utility class to parse command line options.
Definition: JParser.hh:1493
Implementation of event weighing for MUPAGE data.
Definition: JWeightDAQ.hh:12
JMultipleFileScanner_t getAAnetFiles(const JMultipleFileScanner_t &input, const JHead &header, const bool option=false)
Get list of files compatible with geven header.
double getWeight(const Evt &evt) const
Get weight of given event.
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition: JSirene.sh:45
std::vector< JAANET::physics > physics
Definition: JHead.hh:1089
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1954
int debug
debug level
Definition: JSirene.cc:61
Template file scanner with event weight.
General purpose messaging.
Monte Carlo run header.
Definition: JHead.hh:836
#define FATAL(A)
Definition: JMessage.hh:67
General purpose class for object reading from a list of file names.
Utility class to parse command line options.
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
Definition: Evt.hh:19
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62
int main(int argc, char *argv[])
Definition: Main.cpp:15