75     JParser<> zap(
"Example program to plot the muon depth-dependence relationship from JMonitorMultiplicity output");
 
   77     zap[
'f'] = 
make_field(inputFile[0], 
"JMM data input file");
 
   78     zap[
'g'] = 
make_field(inputFile[1], 
"JMM MC input file") = 
"";
 
   79     zap[
'o'] = 
make_field(
outputFile, 
"Name for the .pdf and .root output files")          = 
"depthdependence";
 
   83     zap[
'M'] = 
make_field(muonThreshold, 
"Minimum multiplicity")        = 8;
 
   84     zap[
'T'] = 
make_field(minLiveTime_s, 
"Minimum DOM livetime [s] to be eligible for plotting")        = 3600;
 
   85     zap[
'I'] = 
make_field(interactive, 
"Launch TApplication for interactive display.");
 
   91   catch(
const exception &error) {
 
   92     FATAL(error.what() << endl);
 
  112     FATAL(
"Empty detector." << endl);
 
  118   NOTICE(
"Detector base UTM z [m]: " << utm_z << endl);
 
  127   for (
unsigned i = 0; i < inputFile.size() && inputFile[i] != 
""; i++) {
 
  129     DEBUG(
"Loading input file " << inputFile[i] << endl);
 
  131     fptr  = TFile::Open(inputFile[i].c_str(), 
"exist");
 
  133     if (fptr == NULL || !fptr->IsOpen()) {
 
  134       FATAL(
"File: " << inputFile[i] << 
" not opened." << endl);
 
  146   for (
unsigned i = 0; i < in.size(); i++) {
 
  147     DEBUG(
"Loading livetime histogram from " << inputFile[i] << endl);
 
  148     TH1D* hptr = (TH1D*)in[i]->Get(
"LiveTime");
 
  151       FATAL(
"Missing live time histogram.");
 
  154     LiveTime.push_back(hptr);
 
  163   for (JDetector::const_iterator module = 
detector.begin(); module != 
detector.end(); ++module) {
 
  165     if (module->getString() != line) { 
continue; }
 
  167     STATUS(
"Loading data histogram for from input file: " << 
getModuleLabel(*module) << 
"\t ID = " << module->getID()  << endl);
 
  169     TH1D* data_histogram = (TH1D*)in[0]->Get(TString(
getModuleLabel(*module)) + 
"_P");
 
  171     if (data_histogram != NULL) {
 
  173       double data_count = 
getCount(data_histogram, muonThreshold);
 
  174       double data_livetime = 
getLiveTime(LiveTime[0], *module);
 
  176       if (data_livetime > minLiveTime_s) {
 
  178         double rate = data_count / data_livetime;
 
  179         double err = sqrt(data_count) / data_livetime;
 
  181         NOTICE(
getModuleLabel(*module) << 
": z_rel [m] = " << module->getZ() << 
", count [#] = " << data_count << 
", livetime [s] = " << data_livetime << 
", rate [Hz] = "  << rate << endl);
 
  183         data_rate.push_back(rate);
 
  184         data_err.push_back(err);
 
  185         depth.push_back((-utm_z) - module->getZ());
 
  189             LiveTime[1]  = (TH1D*)in[1]->Get(
"LiveTime");
 
  190             TH1D*  mc_histogram = (TH1D*)in[1]->Get(TString(
getModuleLabel(*module)) + 
"_P");
 
  191             double mc_count     = 
getCount(mc_histogram, muonThreshold);
 
  192             double mc_livetime  = (dataLiveTime ? data_livetime : 
getLiveTime(LiveTime[1], *module));
 
  194             double rate = mc_count / mc_livetime;
 
  195             double err  = sqrt(mc_count) / mc_livetime;
 
  197             NOTICE(
"\t MC livetime [s] = " << mc_livetime << 
", MC rate [Hz] = " << rate << endl);
 
  199             mc_rate.push_back(rate);
 
  200             mc_err.push_back(err);
 
  211   TApplication* theApp = NULL;
 
  214     theApp = 
new TApplication(
"Plotter", &argc, argv);
 
  217   TCanvas *
c1 = 
new TCanvas(
"c1",
"KM3NeT preliminary");
 
  219   TGraph* gr_data = 
new TGraphErrors(data_rate.size(), &depth[0], &data_rate[0], 0, &data_err[0]);
 
  220   gr_data->SetMarkerColor(kRed);
 
  221   gr_data->SetLineColor(kRed);
 
  223   TMultiGraph* mgr = 
new TMultiGraph();
 
  226   TLegend* leg = 
new TLegend(0.7, 0.7, 0.9, 0.9);
 
  227   leg->AddEntry(gr_data, 
"Data", 
"lp");
 
  231     DEBUG(
"Loading MC plots" << endl);
 
  232     gr_mc = 
new TGraphErrors(mc_rate.size(), &depth[0], &mc_rate[0], 0, &mc_err[0]); 
 
  234     DEBUG(
"MC plot loaded" << endl);
 
  235     leg->AddEntry(gr_mc, 
"MC", 
"lp");
 
  239   mgr->SetTitle(TString(
"KM3NeT Preliminary; Depth [m]; Inclusive ") + Form(
"%d", muonThreshold) + TString(
"-fold coincidence rate [Hz]"));
 
  242   mgr->GetYaxis()->SetTitleOffset(1.5);
 
  244   leg->SetFillStyle(0);
 
Utility class to parse command line options. 
 
double getCount(TH1D *hptr, int muon_threshold)
 
Router for direct addressing of module data in detector data structure. 
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object 
 
void load(const JString &file_name, JDetector &detector)
Load detector from input file. 
 
std::string getModuleLabel(const JModuleLocation &location)
Get module label (DU-floor) for JMonitor applications. 
 
TCanvas * c1
Global variables to handle mouse events. 
 
double getLiveTime(TH1D *hptr, const JModule &module)
 
#define DEBUG(A)
Message macros.