14 #include "TTimeStamp.h" 
   40   double normalisation = 1;
 
   41   if(norm) normalisation = h1->Integral();
 
   43   for(
int i = 1; i <= h1->GetNbinsX(); ++i){
 
   45     h2->Fill(run, h1->GetXaxis()->GetBinCenter(i), h1->GetBinContent(i)/normalisation);       
 
   49 int main(
int argc, 
char **argv)
 
   53   using namespace KM3NETDAQ;
 
   61     JParser<> zap(
"Auxiliary program to merge JRunAnalyzer histograms.");
 
   63     zap[
'f'] = 
make_field(inputFile,         
"input file (output from JRunAnalyzer).");
 
   69   catch(
const exception &error) {
 
   70     FATAL(error.what() << endl);
 
   73   int min_run = numeric_limits<int>::max(), max_run = 0;
 
   75   size_t min_date = numeric_limits<int>::max(), max_date = 0;
 
   79     TFile 
in(i->c_str(), 
"read");
 
   95   time_t tmin = min_date, tmax = max_date;
 
   97   TTimeStamp date_min(tmin, 0);
 
   98   TTimeStamp date_max(tmax, 0);
 
  100   cout << 
"Minimum RUN: " << min_run << 
", "; date_min.Print(
"s");
 
  101   cout << 
"Maximum RUN: " << max_run << 
", "; date_max.Print(
"s");
 
  105   int xbins = (max_run - min_run) + 1;
 
  106   string title = string(
"Data taken from: ") + date_min.AsString(
"s") + 
" - " + date_max.AsString(
"s");
 
  108   TH2D* h_pmt_rate_distribution = 
new TH2D(
"h_pmt_rate_distribution", 
string(title + 
"; RUN; PMT Rate Distribution [kHz]").c_str(), xbins, (
double) min_run-0.5, (
double) max_run+0.5, 20, 0, log10(100));  
 
  110   h_pmt_rate_distribution -> SetMinimum(1);
 
  112   TH2D* h_Trigger_bit_hit = 
new TH2D(
"h_Trigger_bit_hit", 
string(title + 
"; RUN; Hits trigger bit").c_str(), xbins, (
double) min_run-0.5, (
double) max_run+0.5, 
NUMBER_OF_TRIGGER_BITS, -0.5, 
NUMBER_OF_TRIGGER_BITS - 0.5); 
 
  114   TH2D* h_Triggered_hits = 
new TH2D(
"h_Triggered_hits", 
string(title + 
"; RUN; Number of triggered hits").c_str(), xbins, (
double) min_run-0.5, (
double) max_run+0.5,  50, 0, 4);
 
  117   TH2D* h_Triggered_hits_3dmuon = 
new TH2D(
"h_Triggered_hits_3dmuon", 
string(title + 
"; RUN; Number of triggered hits - JTRIGGER3DMUON").c_str(), xbins, (
double) min_run-0.5, (
double) max_run+0.5, 50, 0, 3);
 
  120   TH2D* h_Snapshot_hits = 
new TH2D(
"h_Snapshot_hits", 
string(title + 
"; RUN; Number of snapshot hits").c_str(), xbins, (
double) min_run-0.5, (
double) max_run+0.5,  50, 0, 4);
 
  123   TH2D* h_Triggered_over_Snapshot_hits = 
new TH2D(
"h_Triggered_over_Snapshot_hits", 
string(title + 
"; RUN; Triggered/Snapshot hits").c_str(), xbins, (
double) min_run-0.5, (
double) max_run+0.5, 100, 0, 0.5);
 
  125   TH2D* h_Number_of_overlays = 
new TH2D(
"h_Number_of_overlays", 
string(title + 
"; RUN; Number of Overlays").c_str(), xbins, (
double) min_run-0.5, (
double) max_run+0.5, 1000, -0.5, 1000 - 0.5);
 
  127   TH2D* h_pmt_distribution_triggered_hits = 
new TH2D(
"h_pmt_distribution_triggered_hits", 
string(title + 
"; RUN;Normalised PMT Distrib triggered hits (upper PMTs=[0-11])").c_str(), xbins, (
double) min_run-0.5, (
double) max_run+0.5, 
NUMBER_OF_PMTS, -0.5 , 
NUMBER_OF_PMTS - 0.5);
 
  131     DEBUG(
"Processing " << *i << endl) ;
 
  133     TFile 
in(i->c_str(), 
"read");
 
  145     TH1D* h1d_prd  = 
new TH1D();
 
  146     TH1D* h1d_thb  = 
new TH1D();
 
  147     TH1D* h1d_th   = 
new TH1D();
 
  148     TH1D* h1d_th3D = 
new TH1D();
 
  149     TH1D* h1d_sh   = 
new TH1D();
 
  150     TH1D* h1d_tosh = 
new TH1D();
 
  151     TH1D* h1d_noo  = 
new TH1D();
 
  152     TH1D* h1d_pdth = 
new TH1D();
 
  154     in.GetDirectory(
"Detector")->GetObject(
"h_pmt_rate_distribution", h1d_prd);
 
  157     TDirectory* dir = 
in.GetDirectory(
"JDAQEvent");
 
  159     dir->GetObject(
"h_Trigger_bit_hit", h1d_thb);
 
  162     dir->GetObject(
"h_Triggered_hits", h1d_th);
 
  165     dir->GetObject(
"h_Triggered_hits_3dmuon", h1d_th3D);
 
  168     dir->GetObject(
"h_Snapshot_hits", h1d_sh);
 
  171     dir->GetObject(
"h_Triggered_over_Snapshot_hits", h1d_tosh);
 
  174     dir->GetObject(
"h_Number_of_overlays", h1d_noo);
 
  177     dir->GetObject(
"h_pmt_distribution_triggered_hits", h1d_pdth);
 
  178     fill2DHistogram(run, h1d_pdth, h_pmt_distribution_triggered_hits, 
true);
 
Utility class to parse command line options. 
int main(int argc, char *argv[])
JDAQUTCExtended getTimesliceStart() const 
Get start of timeslice. 
static const unsigned int NUMBER_OF_TRIGGER_BITS
Number of trigger bits. 
then for HISTOGRAM in h0 h1
int getRunNumber() const 
Get run number. 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object 
JUINT32_t getUTCseconds() const 
Get time. 
General purpose messaging. 
void fill2DHistogram(int run, TH1D *h1, TH2D *h2, bool norm=false)
Utility class to parse command line options. 
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
void setLogarithmicY(TF2 *f2)
Make parameter y of function logarithmic (e.g. after filling with log10()). 
static const int NUMBER_OF_PMTS
Total number of PMTs in module. 
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in