48{
   52 
   54  
   58  JLimit_t&       numberOfEvents = inputFile.getLimit();
 
   59  string          detectorFile;
   60  double          Tmax_s;
   61  bool            use_weights;
   65 
   66  try {
   67 
   69 
   72 
   73    JParser<> zap(
"Example program to check for sparks.");
 
   74 
   84 
   85    zap(argc, argv);
   86  }
   87  catch(const exception& error) {
   88    FATAL(error.what() << endl);
 
   89  }
   90 
   91    
   93 
   94  try {
   96  }
   99  }
  100 
  102 
  103  unique_ptr<JDynamics> dynamics;
  104 
  105  try {
  106 
  108 
  109    dynamics->load(calibrationFile);
  110  }
  111  catch(const exception& error) {
  112    if (!calibrationFile.empty()) {
  114    }
  115  }
  116 
  117 
  120 
  121  TH1D h0("h0", NULL, 50, -1.0, 2.0);
  122 
  124 
  125  for (Int_t i = 1; i <= H2->GetXaxis()->GetNbins(); ++i) {
  126    H2->GetXaxis()->SetBinLabel(i, 
MAKE_CSTRING(router.at(i-1)));
 
  127  }
  128  for (Int_t i = 1; i <= H2->GetYaxis()->GetNbins(); ++i) {
  130  }
  131 
  132 
  135 
  136  double W = 1.0;
  137    
  138  for (
string file_name = 
""; inputFile.
hasNext(); ) {
 
  139 
  141 
  142    const Evt* evt = inputFile.
next();
 
  143 
  145 
  146      if (dynamics) {
  147        dynamics->update(evt->
t.GetSec());
 
  148      }
  149 
  150      if (use_weights) {
  151 
  152        if (!evt->
w.empty()) {
 
  154        }
  155      
  156      } else {
  157 
  159 
  161 
  162          try {
  163 
  165 
  166            if (
is_mupage(head))     { W = head.DAQ.livetime_s / head.livetime.numberOfSeconds; }
 
  167            if (
is_pure_noise(head)) { W = head.DAQ.livetime_s / head.K40.livetime_s; }
 
  168          }
  169          catch(const exception& error) {}
  170        }
  171      }
  172    
  173      double    Dmin      = numeric_limits<double>::max();
  175      
  177 
  180          
  182      
  183          for (
const auto& module : (dynamics ? dynamics->getDetector() : 
detector)) {
 
  184 
  185            if (module.getFloor() != 0) {
  186 
  188          
  189              if (D < Dmin) {
  190                Dmin     = D;
  191                location = module.getLocation();
  192              }
  193            }
  194          }
  195        }
  196 
  197        if (Dmin != numeric_limits<double>::max()) {
  198 
  199          h0.Fill(log10(Dmin), W);
  200 
  201          const int i = 
distance(Dmax_m.begin(), Dmax_m.lower_bound(Dmin));
 
  202        
  203          H2   ->Fill((double) router.getIndex(location.getString()), (double) location.getFloor(), W);
  204          H2[i]->Fill((double) router.getIndex(location.getString()), (double) location.getFloor(), W);
  205        }
  206      }
  207    }    
  208    
  209  }
  211 
  212 
  215 
  216  for (auto& h2 : H2) {
  218  }
  219  
  221}
#define DEBUG(A)
Message macros.
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
 
#define MAKE_CSTRING(A)
Make C-string.
 
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
 
Logical location of module.
 
const JLocation & getLocation() const
Get location.
 
Utility class to parse parameter values.
 
const JPosition3D & getPosition() const
Get position.
 
Utility class to parse command line options.
 
Auxiliary class to manage set of compatible ROOT objects (e.g. histograms) using unique keys.
 
General purpose class for object reading from a list of file names.
 
virtual bool hasNext() override
Check availability of next element.
 
counter_type getCounter() const
Get counter.
 
virtual const pointer_type & next() override
Get next element.
 
const std::string & getFilename() const
Get current file name.
 
Auxiliary class for trigger mask.
 
bool hasTriggerMask(const JDAQTriggerMask &mask) const
Has trigger bit pattern.
 
JTrack3E getTrack(const Trk &track)
Get track.
 
bool is_pure_noise(const JHead &header)
Check for generator.
 
bool is_mupage(const JHead &header)
Check for generator.
 
floor_range getRangeOfFloors(const JDetector &detector)
Get range of floors.
 
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
 
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
 
double getDistance(const JFirst_t &first, const JSecond_t &second)
Get distance between objects.
 
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
 
Head getHeader(const JMultipleFileScanner_t &file_list)
Get Monte Carlo header.
 
KM3NeT DAQ data structures and auxiliaries.
 
static const JDAQTriggerMask TRIGGER_MASK_ON
Trigger mask on;.
 
The Evt class respresent a Monte Carlo (MC) event as well as an offline event.
 
std::vector< double > w
MC: Weights w[0]=w1, w[1]=w2, w[2]=w3 (see e.g. Tag list or km3net-dataformat/definitions)
 
ULong64_t trigger_mask
trigger mask from raw data (i.e. the trigger bits)
 
TTimeStamp t
UTC time of the timeslice, or the event_time for MC. (default: 01 Jan 1970 00:00:00)
 
Router for mapping of string identifier to index.
 
Dynamic detector calibration.
 
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
 
Auxiliary class for defining the range of iterations of objects.
 
static counter_type max()
Get maximum counter value.
 
The Trk class represents a Monte Carlo (MC) particle as well as a reconstructed track/shower.
 
int status
MC status code, see km3net-dataformat/definitions/trkmembers.csv for values.
 
static const int TRK_ST_UNDEFINED
status was not defined for this MC track (all reco tracks have this value)
 
static const int WEIGHTLIST_RUN_BY_RUN_WEIGHT
w[1]*DAQ_livetime / MC_evts_summary::n_gen (gseagen; [GeV m2 sr s]) or DAQ_livetime/MC_evts_summary::...