11#include "TGraphErrors.h" 
   29  double getCount (TH1D* hptr, 
int muon_threshold) {
 
   31    for (
int i = hptr->GetXaxis()->FindBin(muon_threshold); i <= hptr->GetNbinsX(); i++) {
 
   32      count += hptr->GetBinContent(i);
 
   37  double getLiveTime (TH1D* hptr, 
const JModule& module) {
 
   39    double livetime = hptr->GetBinContent(hptr->GetXaxis()->FindBin(label.c_str()));
 
   51int main(
int argc, 
char **argv)
 
   72    JParser<> zap(
"Auxiliary program to find depth dependence of multiplicity rates");
 
   74    zap[
'f'] = 
make_field(inputFile, 
"JMM input file");
 
   80    zap[
'M'] = 
make_field(minMultiplicity, 
"Minimum multiplicity") = 8;
 
   81    zap[
'T'] = 
make_field(minLiveTime_s, 
"Minimum DOM livetime [s] to be eligible for plotting") = 3600;
 
   86  catch(
const exception &error) {
 
   87    FATAL(error.what() << endl);
 
  105    FATAL(
"Empty detector." << endl);
 
  111  NOTICE(
"Detector base UTM z [m]: " << utm_z << endl);
 
  118  DEBUG(
"Loading input file " << inputFile << endl);
 
  120  TFile* in = TFile::Open(inputFile.c_str(), 
"exist");
 
  122  if (in == NULL || !in->IsOpen()) {
 
  123    FATAL(
"File: " << inputFile << 
" not opened." << endl);
 
  131  DEBUG(
"Loading livetime histogram from " << inputFile << endl);
 
  133  TH1D* liveTime = (TH1D*)in->Get(
"LiveTime");
 
  135  if (liveTime == NULL) {
 
  136    FATAL(
"Missing live time histogram.");
 
  143  for (JDetector::const_iterator module = 
detector.begin(); module != 
detector.end(); ++module) {
 
  145    if (module->getString() != line) { 
continue; }
 
  147    STATUS(
"Loading data histogram for from input file: " << 
getLabel(*module) << 
"\t ID = " << module->getID()  << endl);
 
  149    TH1D* data_histogram = (TH1D*)in->Get(TString(
getLabel(*module)) + 
"_P");
 
  151    if (data_histogram != NULL) {
 
  153      double data_count    = 
getCount(data_histogram, minMultiplicity);
 
  154      double data_livetime = getLiveTime(liveTime, *module);
 
  156      double module_depth = - utm_z - module->getZ();
 
  158      if (data_livetime > minLiveTime_s) {
 
  160        double val = data_count       / data_livetime;
 
  161        double err = sqrt(data_count) / data_livetime;
 
  163        NOTICE(module_depth << 
" " << val << endl);
 
  165        rate_val.push_back(val);
 
  166        rate_err.push_back(err);
 
  167        depth.push_back( module_depth);
 
  176  TGraph* gr_data = 
new TGraphErrors(
depth.size(), &
depth[0], &rate_val[0], 0, &rate_err[0]);
 
  178  gr_data->SetTitle(TString(
"KM3NeT Preliminary; Depth [m]; Inclusive ") + Form(
"%d", minMultiplicity) + TString(
"-fold coincidence rate [Hz]"));
 
 
KM3NeT DAQ constants, bit handling, etc.
 
int main(int argc, char **argv)
 
Data structure for detector geometry and calibration.
 
General purpose messaging.
 
#define DEBUG(A)
Message macros.
 
Direct access to module in detector data structure.
 
Scanning of objects from multiple files according a format that follows from the extension of each fi...
 
Utility class to parse command line options.
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
 
ROOT TTree parameter settings of various packages.
 
Router for direct addressing of module data in detector data structure.
 
Data structure for a composite optical module.
 
Utility class to parse command line options.
 
std::string getLabel(const JLocation &location)
Get module label for monitoring and other applications.
 
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
 
size_t getCount(const array_type< T > &buffer, const JCompare_t &compare)
Count number of unique values.
 
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
 
Normalisation of MUPAGE events.