Jpp
JRunHistograms.hh
Go to the documentation of this file.
1 #ifndef __JRUNHISTOGRAMS__
2 #define __JRUNHISTOGRAMS__
3 
4 
5 
6 #include "JSupport/JSupport.hh"
8 
10 #include "JTrigger/JTriggerBits.hh"
11 
14 
18 
19 #include "JGizmo/JManager.hh"
20 
21 #include "TH1D.h"
22 #include "TH2D.h"
23 #include "TProfile2D.h"
24 #include "TAxis.h"
25 #include "TCanvas.h"
26 #include "TPaveText.h"
27 #include "TStyle.h"
28 #include "TString.h"
29 #include "TMath.h"
30 #include "TColor.h"
31 #include "TDirectory.h"
32 #include "TPRegexp.h"
33 #include "TObjArray.h"
34 #include "TObjString.h"
35 
36 using namespace std ;
37 using namespace KM3NETDAQ ;
38 using namespace JLANG ;
39 using namespace JPP ;
40 using namespace JSUPPORT ;
41 
42 /*
43  * Rebins a histogram with constant bin width in a linear scale, so that the bins will have constant width in log10 scale.
44  *
45  * \param h The histogram.
46  */
47 template <class T>
48 void BinLogX (T* h){
49 
50  TAxis *axis = h->GetXaxis();
51  int bins = axis->GetNbins();
52  Axis_t from = axis->GetXmin();
53  Axis_t to = axis->GetXmax();
54  Axis_t width = (to - from) / bins;
55  Axis_t *new_bins = new Axis_t[bins + 1];
56 
57  for (int i = 0; i <= bins; i++) {
58  new_bins[i] = TMath::Power(10, from + i * width);
59  }
60 
61  axis->Set(bins, new_bins);
62 
63  delete new_bins;
64 }
65 
66 
67 /*
68  * Rebins a histogram with constant bin width in a linear scale, so that the bins will have constant width in log10 scale.
69  *
70  * \param h The histogram.
71  */
72 template <class T>
73 void BinLogY (T* h){
74 
75  TAxis *axis = h->GetYaxis();
76  int bins = axis->GetNbins();
77  Axis_t from = axis->GetXmin();
78  Axis_t to = axis->GetXmax();
79  Axis_t width = (to - from) / bins;
80  Axis_t *new_bins = new Axis_t[bins + 1];
81 
82  for (int i = 0; i <= bins; i++) {
83  new_bins[i] = TMath::Power(10, from + i * width);
84  }
85 
86  axis->Set(bins, new_bins);
87 
88  delete new_bins;
89 }
90 
91 
92 /*
93  * Normalizes a histogram to a given value.
94  *
95  * \param h The histogram.
96  * \param n The normalization constant
97  */
98 template <class T>
99 void normalize (T* h , double n = 1.0){
100 
101  h -> Scale(n / h -> Integral());
102 }
103 
104 
105 /*
106  * Structure to store histograms obtained from the JDAQSummary TTree.
107  */
109  TH1D* h_mean_fifo;
116 
117  /* One histogram for each DU */
120 
121  /* One histogram for each module */
123 
125  h_fifo_per_dom = NULL;
126  h_daq_status_per_dom = NULL;
127  h_hrv_per_dom = NULL;
128  h_rate_summary = NULL;
129  h_pmt_rate_distribution = NULL;
130  h_dom_rate_distribution = NULL;
131  m_mean_summary_rate = NULL;
132  m_mean_summary_rate_distribution = NULL;
133  m_summary_rate_distribution = NULL;
134  }
135 
136  /*
137  * Initializes the histograms for summary slices
138  */
139  void initialize(std::set<int> & du_ids , int modules_per_string){
140 
141  init_h_fifo_per_dom (du_ids , modules_per_string);
142  init_h_daq_status_per_dom (du_ids , modules_per_string);
143  init_h_hrv_per_dom (du_ids , modules_per_string);
144  init_h_rate_summary (du_ids , modules_per_string);
145  init_h_pmt_rate_distribution ();
146  init_h_dom_rate_distribution ();
147  init_m_mean_summary_rate (modules_per_string);
148  init_m_mean_summary_rate_distribution ();
149  init_m_summary_rate_distribution ();
150  }
151 
152  /*
153  * Initializes the histogram.
154  *
155  * \param du_ids The list of ids for the DUs in the detector.
156  * \param modules_per_string the number of modules in a string.
157  */
158  void init_h_fifo_per_dom (std::set<int> & du_ids , int modules_per_string){
159 
160  string name = MAKE_STRING ("h_fifo_per_dom");
161  string title = MAKE_STRING (" FIFO ; String ; Floor ; Number of slices with FIFO almost full ");
162 
163  h_fifo_per_dom = new TH2D (name.c_str() , title.c_str() , *du_ids.rbegin() , 0.5 , *du_ids.rbegin() + 0.5 , modules_per_string , 0.5 , modules_per_string + 0.5 );
164  }
165 
166  /*
167  * Initializes the histogram.
168  *
169  * \param du_ids The list of ids for the DUs in the detector.
170  * \param modules_per_string the number of modules in a string.
171  */
172  void init_h_daq_status_per_dom (std::set<int> & du_ids , int modules_per_string){
173 
174  string name = MAKE_STRING ("h_daq_status_per_dom");
175  string title = MAKE_STRING (" DAQ Status ; String ; Floor ; Number of slices with wrong DAQ status of packets ");
176 
177  h_daq_status_per_dom = new TH2D (name.c_str() , title.c_str() , *du_ids.rbegin() , 0.5 , *du_ids.rbegin() + 0.5 , modules_per_string , 0.5 , modules_per_string + 0.5 );
178  }
179 
180  /*
181  * Initializes the histogram.
182  *
183  * \param du_ids The list of ids for the DUs in the detector.
184  * \param modules_per_du the number of modules in a string.
185  */
186  void init_h_hrv_per_dom (set<int> & du_ids , int modules_per_string){
187 
188  string name = MAKE_STRING ("h_hrv_per_dom");
189  string title = MAKE_STRING ("HRV ; String ; Floor ; Number of slices with at least 1 PMT in HRV");
190 
191  h_hrv_per_dom = new TH2D (name.c_str() , title.c_str() , *du_ids.rbegin() , 0.5 , *du_ids.rbegin() + 0.5 , modules_per_string , 0.5 , modules_per_string + 0.5 );
192  }
193 
194  /*
195  * Initializes the histogram.
196  *
197  * \param du_ids The list of ids for the DUs in the detector.
198  * \param modules_per_du the number of modules in a string.
199  */
200  void init_h_rate_summary (set<int> & du_ids , int modules_per_string){
201 
202  string name = MAKE_STRING ("h_rate_summary");
203  string title = MAKE_STRING ("Summary slices ; String ; Floor ; Mean rate over all summary slices [kHz]");
204 
205  h_rate_summary = new TH2D (name.c_str() , title.c_str() , *du_ids.rbegin() , 0.5 , *du_ids.rbegin() + 0.5 , modules_per_string , 0.5 , modules_per_string + 0.5 );
206  }
207 
208  /*
209  * Initializes the histogram.
210  */
212 
213  string name = MAKE_STRING ("h_pmt_rate_distribution");
214  string title = MAKE_STRING ("PMT rate distribution from summary slices ; rate [kHz] ; Counts");
215 
216  h_pmt_rate_distribution = new TH1D (name.c_str() , title.c_str() , 40 , 0 , log10(1000));
217 
218  BinLogX (h_pmt_rate_distribution);
219 
220  h_pmt_rate_distribution -> SetMinimum(1);
221  }
222 
223  /*
224  * Initializes the histogram.
225  */
227 
228  string name = MAKE_STRING ("h_dom_rate_distribution");
229  string title = MAKE_STRING ("DOM rate distribution from summary slices ; rate [kHz] ; Counts");
230 
231  h_dom_rate_distribution = new TH1D (name.c_str() , title.c_str() , 50 , log10(50) , log10(50000));
232 
233  BinLogX (h_dom_rate_distribution);
234 
235  h_dom_rate_distribution -> SetMinimum(1);
236  }
237 
238  /*
239  * Initializes the histogram.
240  *
241  * \param modules_per_string the number of modules in a string.
242  */
244 
245  string name = MAKE_STRING ("%/h_mean_summary_rate_distribution");
246  string title = MAKE_STRING (" ; rate [kHz] ; # PMTs");
247 
248  TH1D* h = new TH1D(name.c_str() , title.c_str() , 40 , 0 , log10(1000));
249 
250  BinLogX (h);
251 
252  m_mean_summary_rate_distribution = new JManager < string , TH1D > (h);
253  }
254 
255  /*
256  * Initializes the histogram.
257  *
258  * \param modules_per_string the number of modules in a string.
259  */
260  void init_m_mean_summary_rate (int modules_per_string){
261 
262  string name = MAKE_STRING ("%/h_mean_summary_rate");
263  string title = MAKE_STRING (" ; PMT ; Floor ; rate [kHz]");
264 
265  m_mean_summary_rate = new JManager < string , TH2D > (new TH2D(name.c_str() , title.c_str() , NUMBER_OF_PMTS , -0.5 , NUMBER_OF_PMTS - 0.5 , modules_per_string , 0.5 , 0.5 + modules_per_string));
266  }
267 
268  /*
269  * Initializes the histograms. The frame index range information is needed.
270  *
271  */
273 
274  string name = MAKE_STRING ("%/h_pmt_rate_distributions_Summaryslice");
275  string title = MAKE_STRING ("Summaryslice ; TDC channel ; rate [kHz] ; counts");
276 
277  TH2D* h_summary_rate_distribution = new TH2D (name.c_str() , title.c_str(),
278  NUMBER_OF_PMTS , -0.5 , NUMBER_OF_PMTS - 0.5 ,
279  100 , -1 , log10(10000));
280 
281  BinLogY (h_summary_rate_distribution);
282 
283  m_summary_rate_distribution = new JManager < string , TH2D > (h_summary_rate_distribution);
284  }
285 };
286 
288 
289  int min_ToT;
290  int max_ToT;
295 
296  /* One histogram per timeslice type. I decided not to use a JManager here because the range of each histogram could be different for each timeslice type. */
297 
302 
303  /* One JManager per timeslice type. Each JManager hosts a histogram for each DU */
304 
308 
309  /* One JManager per timeslice type. Each manager hosts a histogram for an optical module. The key is expected to follow the pattern SXXFXX */
310 
314 
316  min_ToT (0),
317  max_ToT (255),
318  min_logdt (0),
319  max_logdt (9),
320  nbins_logdt (150),
321  nbins_time (200)
322  {
323  int number_of_timeslice_types = JLength<JDAQTimesliceTypes_t>::value ;
324 
325  h_dom_mean_rates .resize (number_of_timeslice_types , NULL);
326  h_ToT_255_vs_time .resize (number_of_timeslice_types , NULL);
327  h_ToT_255_Floor_vs_time .resize (number_of_timeslice_types , NULL);
328  h_ToT_255_Floor_vs_time_2.resize (number_of_timeslice_types , NULL);
329  m_mean_ToT .resize (number_of_timeslice_types , NULL);
330  m_mean_ToT_distribution .resize (number_of_timeslice_types , NULL);
331  m_ToT_255 .resize (number_of_timeslice_types , NULL);
332  m_pmt_tot_distributions .resize (number_of_timeslice_types , NULL);
333  m_pmt_rate_distributions .resize (number_of_timeslice_types , NULL);
334  m_pmt_dt_consecutive_hits.resize (number_of_timeslice_types , NULL);
335  }
336 
337  /*
338  * Initializes histograms for a given timeslice type.
339  *
340  * \param du_ids The list of ids for the DUs in the detector
341  * \param modules_per_string the number of modules in a string
342  * \param ts_type Index of the timeslice types on the JDAQTimesliceTypes_t typelist.
343  * \param ts_name The name of the timeslice type
344  */
345  void initialize(std::set<int> du_ids , int modules_per_string , int ts_type , std::string ts_name){
346 
347  init_h_dom_mean_rates (ts_type , du_ids , modules_per_string , ts_name);
348  init_h_ToT_255_vs_time (ts_type , ts_name);
349  init_h_ToT_255_Floor_vs_time (ts_type , modules_per_string , ts_name);
350  init_h_ToT_255_Floor_vs_time_2 (ts_type , modules_per_string , ts_name);
351  init_m_mean_ToT (ts_type , modules_per_string , ts_name);
352  init_m_mean_ToT_distribution (ts_type , ts_name);
353  init_m_ToT_255 (ts_type , modules_per_string , ts_name);
354  init_m_pmt_tot_distributions (ts_type , ts_name);
355  init_m_pmt_rate_distributions (ts_type , ts_name);
356  init_m_pmt_dt_consecutive_hits (ts_type , ts_name);
357  }
358 
359  /*
360  * Fills the mean ToT as a function of the PMT and floor number for a given DU
361  *
362  * \param table table with the ToT distributions for each PMT in a module, for every timeslice type
363  * \param string The string number
364  * \param floor The floor number
365  */
367 
368  int i = 0 ;
369 
370  for (typename vector < JManager < string , TH2D >* >::const_iterator it = m_pmt_tot_distributions.begin() ; it != m_pmt_tot_distributions.end() ; ++it , ++i){
371 
372  if ((*it)){
373 
374  for (typename JManager < string , TH2D >::const_iterator j = (*it) -> begin() ; j != (*it) -> end() ; ++j){
375 
376  TString s (MAKE_STRING(j -> first).c_str());
377  TPRegexp r ("(\\w+)/(\\DU)(\\d+)/(F)(\\d+)");
378 
379  TObjArray* o = r.MatchS(s);
380 
381  int String = ((TObjString *)o->At(3))->GetString().Atoi();
382  int Floor = ((TObjString *)o->At(5))->GetString().Atoi();
383 
384  for (int pmt = 1 ; pmt <= (j -> second) -> GetXaxis() -> GetNbins() ; pmt++){
385 
386  (*m_mean_ToT[i])[MAKE_STRING("Detector/DU" + to_string(String))] -> Fill(Floor , (j->second) -> GetXaxis() -> GetBinCenter(pmt) , (j -> second) -> ProjectionY ("" , pmt , pmt) -> GetMean () );
387  (*m_mean_ToT_distribution[i])[MAKE_STRING("Detector/DU" + to_string(String))] -> Fill((j -> second) -> ProjectionY ("" , pmt , pmt) -> GetMean () );
388  }
389  }
390  }
391  }
392  }
393 
394  /*
395  * Initializes the histogram.
396  *
397  * \param ts_type index of the timeslicetype indicating its position on the JDAQTimeslicetypes_t typelist
398  * \param modules_per_string The number of modules in a string.
399  * \param ts_name String containing the timeslice type.
400  */
401  void init_h_dom_mean_rates (int ts_type , std::set<int> du_ids , int modules_per_string , std::string ts_name){
402 
403  string name = MAKE_STRING ("h_mean_dom_rates_" + ts_name);
404  string title = MAKE_STRING (ts_name + " ; Floor number ; DU number ; time slice averaged rate [Hz]");
405 
406  h_dom_mean_rates[ts_type] = new TH2D (name.c_str() , title.c_str() , *du_ids.rbegin() , 0.5 , *du_ids.rbegin() + 0.5 , modules_per_string , 0.5 , 0.5 + modules_per_string);
407  }
408 
409  /*
410  * Initializes the histogram.
411  *
412  * \param ts_type index of the timeslicetype indicating its position on the JDAQTimeslicetypes_t typelist
413  * \param ts_name String containing the timeslice type.
414  */
415  void init_h_ToT_255_vs_time (int ts_type , string ts_name){
416 
417  string name = MAKE_STRING ("h_ToT_255_vs_time_" + ts_name);
418  string title = MAKE_STRING (" (" + ts_name + ") Hits with ToT = 255 ns. All PMTs, all timeslices ; Time since beginning of slice [ns] ; counts ");
419 
420  h_ToT_255_vs_time[ts_type] = new TH1D (name.c_str() , title.c_str() , 100 , 0 , log10(getFrameTime()));
421 
422  BinLogX (h_ToT_255_vs_time[ts_type]);
423  }
424 
425  /*
426  * Initializes the histogram.
427  *
428  * \param ts_type index of the timeslicetype indicating its position on the JDAQTimeslicetypes_t typelist
429  * \param modules_per_string the number of modules in a string.
430  * \param ts_name String containing the timeslice type.
431  */
432  void init_h_ToT_255_Floor_vs_time (int ts_type , int modules_per_string , string ts_name){
433 
434  string name = MAKE_STRING ("h_ToT_255_Floor_vs_time_" + ts_name);
435  string title = MAKE_STRING (" (" + ts_name + ") Hits with ToT = 255 ns. All DUs , all timeslices ; Time since beginning of slice [ns] ; Floor number ; counts ");
436 
437  h_ToT_255_Floor_vs_time[ts_type] = new TH2D (name.c_str() , title.c_str() , 100 , 0 , log10(getFrameTime()) , modules_per_string , 0.5 , 0.5 + modules_per_string);
438 
439  BinLogX(h_ToT_255_Floor_vs_time[ts_type]);
440  }
441 
442  /*
443  * Initializes the histogram.
444  *
445  * \param ts_type index of the timeslicetype indicating its position on the JDAQTimeslicetypes_t typelist
446  * \param modules_per_string the number of modules in a string.
447  * \param ts_name String containing the timeslice type.
448  */
449  void init_h_ToT_255_Floor_vs_time_2 (int ts_type , int modules_per_string , string ts_name){
450 
451  string name = MAKE_STRING ("h_ToT_255_Floor_vs_time_2_" + ts_name);
452  string title = MAKE_STRING (" (" + ts_name + ") Hits with ToT = 255 ns. All DUs , all timeslices ; Time since beginning of slice [ns] ; Floor number ; counts ");
453 
454  h_ToT_255_Floor_vs_time_2[ts_type] = new TH2D (name.c_str() , title.c_str() , 100 , 0 , getFrameTime() , modules_per_string , 0.5 , 0.5 + modules_per_string);
455  }
456 
457  /*
458  * Initializes the histogram.
459  *
460  * \param ts_type index of the timeslicetype indicating its position on the JDAQTimeslicetypes_t typelist
461  * \param modules_per_string the number of modules in a string.
462  * \param ts_name String containing the timeslice type.
463  */
464  void init_m_mean_ToT (int ts_type , int modules_per_string , string ts_name){
465 
466  string name = MAKE_STRING ("%/h_mean_ToT_" + ts_name);
467  string title = MAKE_STRING (ts_name + " ; Floor number ; TDC channel ; mean ToT over all timeslices [ns] ");
468 
469  m_mean_ToT[ts_type] = new JManager < string , TH2D > (new TH2D (name.c_str() , title.c_str() , modules_per_string , 0.5 , 0.5 + modules_per_string , NUMBER_OF_PMTS , -0.5 , NUMBER_OF_PMTS - 0.5));
470  }
471 
472  /*
473  * Initializes the histogram.
474  *
475  * \param ts_type index of the timeslicetype indicating its position on the JDAQTimeslicetypes_t typelist
476  * \param modules_per_string the number of modules in a string.
477  * \param ts_name String containing the timeslice type.
478  */
479  void init_m_mean_ToT_distribution (int ts_type , string ts_name){
480 
481  string name = MAKE_STRING ("%/h_mean_ToT_distribution" + ts_name);
482  string title = MAKE_STRING (ts_name + " ; ToT [ns] ; # PMTS ");
483 
484  m_mean_ToT_distribution[ts_type] = new JManager < string , TH1D > (new TH1D (name.c_str() , title.c_str() , 255 , 0.5 , 255.5));
485  }
486 
487  /*
488  * Initializes the histogram.
489  *
490  * \param detector A JDetector.
491  * \param ts_type index of the timeslicetype indicating its position on the JDAQTimeslicetypes_t typelist
492  * \param ts_name String containing the timeslice type.
493  */
494  void init_m_ToT_255 (int ts_type , int modules_per_string , string ts_name){
495 
496  string name = MAKE_STRING ("%/h_ToT_255_" + ts_name);
497  string title = MAKE_STRING (ts_name + " ; Floor number ; TDC channel ; number of hits with ToT = 255 ns ");
498 
499  m_ToT_255[ts_type] = new JManager < string , TH2D > (new TH2D (name.c_str() , title.c_str() , modules_per_string , 0.5 , 0.5 + modules_per_string , NUMBER_OF_PMTS , -0.5 , NUMBER_OF_PMTS - 0.5));
500  }
501 
502  /*
503  * Initializes the histograms. The frame index range information is needed.
504  *
505  * \param ts_type index for the timeslice type, according to the JDAQTimeslicetypes_t typelist
506  * \param ts_name suffix string
507  */
508  void init_m_pmt_tot_distributions (int ts_type , string ts_name){
509 
510  string name = MAKE_STRING ("%_" + ts_name + "_2SToT");
511  string title = MAKE_STRING (ts_name + " ; TDC channel ; ToT [ns] ; counts");
512 
513  double bins[] = {-0.5 , 0.5 , 1.5 , 2.5 , 3.5 , 4.5 , 5.5 , 6.5 , 7.5 , 8.5 , 9.5 , 10.5 , 11.5 , 12.5 , 13.5 , 14.5 , 15.5 , 16.5 , 17.5 , 18.5 , 19.5 ,
514  20.5 , 21.5 , 22.5 , 23.5 , 24.5 , 25.5 , 26.5 , 27.5 , 28.5 , 29.5 , 30.5 , 35.5 , 40.5 , 45.5 , 55.5 , 60.5 , 65.5 , 70.5 , 75.5 , 80.5 ,
515  85.5 , 90.5 , 95.5 , 100.5 , 120.5 , 140.5 , 160.5 , 180.5 , 200.5 , 254.5 , 255.5 , 256.5};
516 
517  TH2D* h = new TH2D (name.c_str() , title.c_str() , NUMBER_OF_PMTS , -0.5 , NUMBER_OF_PMTS - 0.5 , 52 , bins);
518 
519  h->Sumw2();
520 
521  m_pmt_tot_distributions[ts_type] = new JManager < string , TH2D > (h);
522 
523  }
524 
525  /*
526  * Initializes the histograms. The frame index range information is needed.
527  *
528  * \param ts_type index for the timeslice type, according to the JDAQTimeslicetypes_t typelist
529  * \param ts_name suffix string
530  */
531  void init_m_pmt_rate_distributions(int ts_type , string ts_name){
532 
533  string name = MAKE_STRING ("%/h_pmt_rate_distributions_" + ts_name);
534  string title = MAKE_STRING (ts_name + " ; TDC channel ; rate [kHz] ; counts ");
535 
536  TH2D* h_pmt_rate_distributions = new TH2D (name.c_str() , title.c_str(),
537  NUMBER_OF_PMTS , -0.5 , NUMBER_OF_PMTS - 0.5 ,
538  60 , -6 , log10(1000));
539 
540  BinLogY (h_pmt_rate_distributions);
541 
542  m_pmt_rate_distributions[ts_type] = new JManager < string , TH2D > (h_pmt_rate_distributions);
543  }
544 
545  /*
546  * Initializes the histograms. The frame index range information is needed.
547  *
548  * \param ts_type index for the timeslice type, according to the JDAQTimeslicetypes_t typelist
549  * \param ts_name suffix string
550  */
551  void init_m_pmt_dt_consecutive_hits(int ts_type , string ts_name){
552 
553  string name = MAKE_STRING ("%/h_dt_consecutive_hits_" + ts_name);
554  string title = MAKE_STRING (ts_name + " ; log(dt [ns]); TDC channel ; counts");
555 
556  m_pmt_dt_consecutive_hits[ts_type] = new JManager < string , TH2D > (new TH2D (name.c_str() , title.c_str() , nbins_logdt , min_logdt , max_logdt, NUMBER_OF_PMTS , -0.5 , NUMBER_OF_PMTS - 0.5));
557  }
558 };
559 
560 /*
561  * Structure to store histograms obtained from the JDAQEvent TTree
562  */
564 
571 
572  /* One histogram per DU*/
573 
575 
580 
581  /*
582  * Constructor
583  */
585  h_Trigger_bit_event = NULL;
586  h_Trigger_bit_hit = NULL;
587  h_Snapshot_hits = NULL;
588  h_Triggered_hits = NULL;
589  h_Snapshot_hits_per_module = NULL;
590  h_Triggered_hits_per_module = NULL;
591  m_Snapshot_hits_per_pmt = NULL;
592  h_pmt_distribution_triggered_hits = NULL;
593  h_tot_distribution_triggered_hits = NULL;
594  h_pmt_distribution_snapshot_hits = NULL;
595  h_tot_distribution_snapshot_hits = NULL;
596  }
597 
598  /*
599  * Initializes the histograms.
600  * \param du_ids The list of du ids in the detector
601  * \param frame_index_range The range of frame indices
602  * \param modules_per_string The number of modules in a string.
603  */
604  void initialize(std::set<int> & du_ids , int modules_per_string){
605 
606  init_h_Trigger_bit_event ();
607  init_h_Trigger_bit_hit ();
608  init_h_Snapshot_hits ();
609  init_h_Triggered_hits ();
610  init_h_Snapshot_hits_per_module (modules_per_string , du_ids);
611  init_h_Triggered_hits_per_module (modules_per_string , du_ids);
612  init_m_Snapshot_hits_per_pmt (modules_per_string);
613  init_h_pmt_distribution_triggered_hits();
614  init_h_tot_distribution_triggered_hits();
615  init_h_pmt_distribution_snapshot_hits ();
616  init_h_tot_distribution_snapshot_hits ();
617  }
618 
619  /*
620  * Initializes the histogram.
621  */
623 
624  string name = MAKE_STRING ("h_Trigger_bit_event");
625  string title = MAKE_STRING ("Number of events as a function of trigger bit in event ; Trigger Bit ; Counts ");
626 
627  h_Trigger_bit_event = new TH1D (name.c_str() , title.c_str() , NUMBER_OF_TRIGGER_BITS , -0.5, NUMBER_OF_TRIGGER_BITS - 0.5 );
628 
629  for (int i = 0 ; i < (int) NUMBER_OF_TRIGGER_BITS ; i++){
630 
631  if (getTriggerName(i)){
632 
633  h_Trigger_bit_event -> GetXaxis() -> SetBinLabel(i+1 , getTriggerName(i) );
634 
635  }else{
636 
637  h_Trigger_bit_event -> GetXaxis() -> SetBinLabel(i+1 , "" );
638  }
639  }
640 
641  h_Trigger_bit_event -> GetXaxis() -> LabelsOption("v");
642  }
643 
644 
645  /*
646  * Initializes the histogram.
647  */
649 
650  string name = MAKE_STRING ("h_Trigger_bit_hit");
651  string title = MAKE_STRING ("Number of hits per event as a function of trigger bit in hit ; Trigger Bit ; #Events ");
652 
653  h_Trigger_bit_hit = new TH1D (name.c_str() , title.c_str() , NUMBER_OF_TRIGGER_BITS, -0.5, NUMBER_OF_TRIGGER_BITS - 0.5 );
654 
655  for (int i = 0 ; i < (int) NUMBER_OF_TRIGGER_BITS ; i++){
656 
657  if (getTriggerName(i)){
658 
659  h_Trigger_bit_hit -> GetXaxis() -> SetBinLabel(i+1 , getTriggerName(i) );
660  }else{
661 
662  h_Trigger_bit_hit -> GetXaxis() -> SetBinLabel(i+1 , "" );
663  }
664  }
665 
666  h_Trigger_bit_hit -> GetXaxis() -> LabelsOption("v");
667  }
668 
669  /*
670  * Initializes the histogram.
671  */
673 
674  string name = MAKE_STRING ("h_Snapshot_hits");
675  string title = MAKE_STRING (" ; Number of snapshot hits; Events ");
676 
677  h_Snapshot_hits = new TH1D (name.c_str() , title.c_str() , 50, 0, 4 );
678 
679  BinLogX (h_Snapshot_hits);
680  }
681 
682  /*
683  * Initializes the histogram.
684  */
686 
687  string name = MAKE_STRING ("h_Triggered_hits");
688  string title = MAKE_STRING (" ; Number of triggered hits; Events ");
689 
690  h_Triggered_hits = new TH1D (name.c_str() , title.c_str() , 50 , 0, 4 );
691 
692  BinLogX (h_Triggered_hits);
693  }
694 
695  /*
696  * Initializes the histogram.
697  * \param du_ids The list of du ids in the detector
698  * \param modules_per_string.
699  */
700  void init_h_Snapshot_hits_per_module(int modules_per_string , std::set<int> & du_ids){
701 
702  string name = MAKE_STRING ("h_Snapshot_hits_per_module");
703  string title = MAKE_STRING (" ; String ; Floor ; Number of snapshot hits ");
704 
705  h_Snapshot_hits_per_module = new TH2D (name.c_str() , title.c_str() ,
706  *du_ids.rbegin() , 0.5 , *du_ids.rbegin() + 0.5 ,
707  modules_per_string , 0.5 , modules_per_string + 0.5 );
708  }
709 
710  /*
711  * Initializes the histogram.
712  * \param du_ids The list of du ids in the detector
713  * \param modules_per_string.
714  */
715  void init_h_Triggered_hits_per_module(int modules_per_string , std::set<int> & du_ids){
716 
717  string name = MAKE_STRING ("h_Triggered_hits_per_module");
718  string title = MAKE_STRING (" ; String ; Floor ; Number of triggered hits ");
719 
720  h_Triggered_hits_per_module = new TH2D (name.c_str() , title.c_str() ,
721  *du_ids.rbegin() , 0.5 , *du_ids.rbegin() + 0.5 ,
722  modules_per_string , 0.5 , modules_per_string + 0.5 );
723  }
724 
725  /*
726  * Initializes the histogram.
727  *
728  * \param modules_per_string The number of modules in a string.
729  */
730  void init_m_Snapshot_hits_per_pmt(int modules_per_string){
731 
732  string name = MAKE_STRING ("%/h_Snapshot_hits_per_pmt");
733  string title = MAKE_STRING (" ; PMT ; Floor ; Number of snapshot hits ");
734 
735  m_Snapshot_hits_per_pmt = new JManager < string , TH2D > ( new TH2D (name.c_str() , title.c_str() , NUMBER_OF_PMTS , -0.5 , NUMBER_OF_PMTS - 0.5 ,
736  modules_per_string , 0.5 , modules_per_string + 0.5 ) );
737  }
738 
739  /*
740  * Initializes the histogram.
741  *
742  * \param detector A JDetector.
743  */
745 
746  string name = MAKE_STRING ("h_pmt_distribution_triggered_hits");
747  string title = MAKE_STRING (" ; PMT number ; Counts [a.u.]");
748 
749  h_pmt_distribution_triggered_hits = new TH1D (name.c_str() , title.c_str() , NUMBER_OF_PMTS , -0.5 , NUMBER_OF_PMTS - 0.5);
750  }
751 
752  /*
753  * Initializes the histogram.
754  */
756 
757  string name = MAKE_STRING ("h_tot_distribution_triggered_hits");
758  string title = MAKE_STRING (" ; ToT [ns] ; Counts [a.u.]");
759 
760  h_tot_distribution_triggered_hits = new TH1D (name.c_str() , title.c_str() , 255 , 0.5 , 255.5 );
761 
762  }
763 
764  /*
765  * Initializes the histogram.
766  */
768 
769  string name = MAKE_STRING ("h_pmt_distribution_snapshot_hits");
770  string title = MAKE_STRING (" ; PMT number ; Counts [a.u.]");
771 
772  h_pmt_distribution_snapshot_hits = new TH1D (name.c_str() , title.c_str() , NUMBER_OF_PMTS , -0.5 , NUMBER_OF_PMTS - 0.5);
773 
774  }
775 
776  /*
777  * Initializes the histogram.
778  */
780 
781  string name = MAKE_STRING ("h_tot_distribution_snapshot_hits");
782  string title = MAKE_STRING (" ; ToT [ns] ; Counts [a.u.]");
783 
784  h_tot_distribution_snapshot_hits = new TH1D (name.c_str() , title.c_str() , 255 , 0.5 , 255.5 );
785 
786  }
787 };
788 
789 /*
790  * Class to manage the histograms produced by JRunAnalyzer.
791  */
793 
794 public:
795 
802 
804 
806 
807  detector = det;
808  du_ids = getStringIDs(detector);
810  h_summary = SummaryHistograms();
811  h_timeslice = TimesliceHistograms();
812  h_trigger = TriggerHistograms ();
813  }
814 
815  /*
816  * Initializes summary slice histograms.
817  *
818  * \param range The range of values for the summary slice indices in the run. The range of some histograms is based on the number of time slices, and their indices.
819  */
821 
822  h_summary.initialize(du_ids , modules_per_string);
823 
824  }
825 
826  /*
827  * Initializes summary slice histograms.
828  *
829  * \param range The range of values for the summary slice indices in the run. The range of some histograms is based on the number of time slices, and their indices.
830  */
831  template <class T>
833 
835  const string prefix = "KM3NETDAQ::JDAQ" ;
836  string ts_name = T::Class_Name();
837  string::size_type pos = ts_name.find(prefix);
838 
839  if (pos != string::npos) ts_name.replace(ts_name.find(prefix) , prefix.length() , "");
840 
841  h_timeslice.initialize(du_ids , modules_per_string , index , ts_name);
842  }
843 
844  /*
845  * Initializes JDAQEvent histograms.
846  */
848 
849  h_trigger.initialize (du_ids , modules_per_string);
850  }
851 
852  /*
853  * Checks if the histograms in a table have been initialized. If yes, it writes them on the indicated directory of a root file
854  *
855  * \param f The root file
856  * \param dirname The directory where the histograms will be written
857  * \param table A vector of histograms.
858  */
859  template <class T>
860  void Write_histogram_table_to_file(TFile & f , string dirname , vector < vector < T* > > table){
861 
862  if(f.GetDirectory(dirname.c_str()) == 0) f.mkdir (dirname.c_str());
863 
864  f.cd (dirname.c_str());
865 
866  for (int i=0 ; i < (int)table.size(); i++){
867 
868  for (int j=0 ; j< (int)table[i].size(); j++){
869 
870  if (table[i][j]) table [i][j] -> Write();
871  }
872  }
873  }
874 
875  /*
876  * Checks if the histograms in a table have been initialized. If yes, it writes them on the indicated directory of a root file
877  *
878  * \param f The root file
879  * \param dirname The directory where the histograms will be written
880  * \param table A vector of histograms.
881  */
882  template <class T>
883  void Write_histogram_table_to_file(TFile & f , string dirname , vector < T* > table){
884 
885  if(f.GetDirectory(dirname.c_str()) == 0) f.mkdir (dirname.c_str());
886 
887  f.cd (dirname.c_str());
888 
889  for (int i=0 ; i < (int)table.size(); i++){
890 
891  if (table[i]) table[i] -> Write();
892  }
893  }
894 
895  /*
896  * Checks if the histograms in a table have been initialized. If yes, it writes them on the indicated directory of a root file
897  *
898  * \param f The root file
899  * \param dirname The directory where the histograms will be written
900  * \param table A vector of histograms.
901  */
902  template <class T , class V>
903  void Write_manager_to_file(TFile & f , string dirname , JManager < T , V >* table){
904 
905  if(f.GetDirectory(dirname.c_str()) == 0) f.mkdir (dirname.c_str());
906 
907  f.cd (dirname.c_str());
908 
909  for (typename JManager < T , V >::const_iterator i = table -> begin() ; i != table -> end() ; ++i){
910 
911  i -> second -> Write();
912  }
913  }
914 
915  /*
916  * Replaces wildcard in manager objects titles by their keys.
917  * \param A manager.
918  * \param wc The wildcard
919  */
920  template <class T , class V>
921  void Replace_wildcard_in_name(JManager < T , V >* manager , char wc = '%'){
922 
923  for (typename JManager < T , V >::const_iterator i = manager -> begin() ; i != manager -> end() ; ++i){
924 
925  if (i -> second -> GetTitle()){
926 
927  std::string buffer = i -> second -> GetTitle();
928  string::size_type ipos = buffer.find(wc);
929 
930  if (ipos!=std::string::npos){
931 
932  ostringstream os;
933 
934  os << i -> first ;
935 
936  buffer.replace(ipos, 1, os.str());
937 
938  i -> second -> SetTitle(buffer.c_str());
939  }
940  }
941  }
942  }
943 
944  /*
945  * Writes the contents of a JManager into a file. Each object in each will be written in a directory specified by its key.
946  * \param f The root file
947  * \param A manager.
948  */
949  template < class T , class V >
950  void Write_manager_in_key_dir(TFile & f ,JManager <T , V>* manager){
951 
952  for (typename JManager < T , V >::const_iterator i = manager -> begin() ; i != manager -> end() ; ++i){
953 
954  std::string fullpath = MAKE_STRING(i->second->GetName());
955 
956  int pos = fullpath.rfind ('/');
957  std::string name = fullpath.substr (pos + 1);
958  std::string path = fullpath.substr (0 , pos);
959 
960  if (f.GetDirectory(path.c_str()) == 0) f.mkdir (path.c_str());
961 
962  f.cd(path.c_str());
963 
964  i -> second -> SetName(name.c_str());
965  i -> second -> Write();
966  }
967  }
968 
969  /*
970  * Writes the contents of a vector of JManager objects into a file. Each object in each will be written in a directory specified by its key.
971  * \param f The root file
972  * \param table the list of JManager objects.
973  */
974  template < class T , class V >
976 
977  for (typename vector < JManager < T , V >* >::const_iterator i = table.begin() ; i != table.end() ; ++i){
978 
979  if ((*i)){
980 
981  for (typename JManager < T , V >::const_iterator j = (*i) -> begin() ; j != (*i) -> end() ; ++j){
982 
983  std::string fullpath = MAKE_STRING(j-> second -> GetName());
984 
985  int pos = fullpath.rfind ('/');
986  std::string name = fullpath.substr (pos + 1);
987  std::string path = fullpath.substr (0 , pos);
988 
989  if (f.GetDirectory(path.c_str()) == 0) f.mkdir (path.c_str());
990 
991  f.cd(path.c_str());
992 
993  j -> second -> SetName(name.c_str());
994  j -> second -> Write();
995  }
996  }
997  }
998  }
999 
1000  /*
1001  * Writes the histograms to a root file.
1002  * \param f The root file.
1003  */
1004  void Write_to_file(TFile & f){
1005 
1006  f.mkdir("Detector");
1007  f .cd("Detector");
1008 
1009  if (h_summary.h_fifo_per_dom) h_summary.h_fifo_per_dom -> Write();
1010  if (h_summary.h_daq_status_per_dom) h_summary.h_daq_status_per_dom -> Write();
1011  if (h_summary.h_hrv_per_dom) h_summary.h_hrv_per_dom -> Write();
1012  if (h_summary.h_rate_summary) h_summary.h_rate_summary -> Write();
1013  if (h_summary.h_pmt_rate_distribution) h_summary.h_pmt_rate_distribution -> Write();
1014  if (h_summary.h_dom_rate_distribution) h_summary.h_dom_rate_distribution -> Write();
1015 
1016  Write_histogram_table_to_file(f , MAKE_STRING("Detector/ToT_255_vs_time") , h_timeslice.h_ToT_255_vs_time);
1017  Write_histogram_table_to_file(f , MAKE_STRING("Detector/ToT_255_Floor_vs_time") , h_timeslice.h_ToT_255_Floor_vs_time);
1018  Write_histogram_table_to_file(f , MAKE_STRING("Detector/ToT_255_Floor_vs_time") , h_timeslice.h_ToT_255_Floor_vs_time_2);
1019  Write_histogram_table_to_file(f , MAKE_STRING("Detector/DOM_mean_rates") , h_timeslice.h_dom_mean_rates);
1020 
1021  for (typename vector < JManager < string , TH2D >* >::const_iterator i = h_timeslice.m_pmt_tot_distributions.begin() ; i != h_timeslice.m_pmt_tot_distributions.end() ; ++i){
1022 
1023  if ((*i)){
1024 
1025  for (typename JManager < string , TH2D >::const_iterator j = (*i) -> begin() ; j != (*i) -> end() ; ++j){
1026 
1027  for(int k=1 ; k < j -> second -> GetNbinsX() ; ++k){
1028 
1029  for(int t=1 ; t < j -> second -> GetNbinsY() ; ++t){
1030 
1031  double width = j -> second -> GetYaxis() -> GetBinWidth(t);
1032 
1033  j -> second -> SetBinContent(k,t,j -> second -> GetBinContent(k,t) / width);
1034  j -> second -> SetBinError(k,t,j -> second -> GetBinError(k,t) / width);
1035  }
1036  }
1037  }
1038  }
1039  }
1040 
1041  Write_manager_table_in_key_dir (f , h_timeslice.m_pmt_tot_distributions);
1042  Write_manager_table_in_key_dir (f , h_timeslice.m_pmt_rate_distributions);
1043  if (h_summary.m_summary_rate_distribution) Write_manager_in_key_dir (f , h_summary.m_summary_rate_distribution);
1044  Write_manager_table_in_key_dir (f , h_timeslice.m_pmt_dt_consecutive_hits);
1045  Write_manager_table_in_key_dir (f , h_timeslice.m_ToT_255);
1046 
1047  if (h_summary.m_mean_summary_rate) Write_manager_in_key_dir( f , h_summary.m_mean_summary_rate);
1048  if (h_summary.m_mean_summary_rate_distribution) Write_manager_in_key_dir( f , h_summary.m_mean_summary_rate_distribution);
1049 
1050  h_timeslice.Fill_mean_ToT_histograms();
1051 
1052  Write_manager_table_in_key_dir (f , h_timeslice.m_mean_ToT);
1053  Write_manager_table_in_key_dir (f , h_timeslice.m_mean_ToT_distribution);
1054 
1055  f.mkdir ( MAKE_STRING ("JDAQEvent").c_str());
1056  f.cd ("JDAQEvent");
1057 
1058  if (h_trigger.h_Trigger_bit_event) h_trigger.h_Trigger_bit_event -> Write();
1059  if (h_trigger.h_Trigger_bit_hit) h_trigger.h_Trigger_bit_hit -> Write();
1060 
1061  f.mkdir (MAKE_STRING ("JDAQEvent/hits_per_event").c_str());
1062  f.cd ("JDAQEvent/hits_per_event");
1063 
1064  if (h_trigger.h_Triggered_hits) h_trigger.h_Triggered_hits -> Write();
1065  if (h_trigger.h_Snapshot_hits) h_trigger.h_Snapshot_hits -> Write();
1066 
1067  f.mkdir ( MAKE_STRING ("JDAQEvent/hits_pmt_distributions").c_str());
1068  f.cd ("JDAQEvent/hits_pmt_distributions");
1069 
1072 
1073  f.mkdir ( MAKE_STRING ("JDAQEvent/hits_tot_distributions").c_str());
1074  f.cd ("JDAQEvent/hits_tot_distributions");
1075 
1078 
1079  f.cd ("JDAQEvent");
1080 
1081  if (h_trigger.h_Triggered_hits_per_module) { h_trigger.h_Triggered_hits_per_module-> Write();}
1082  if (h_trigger.h_Snapshot_hits_per_module) { h_trigger.h_Snapshot_hits_per_module -> Write();}
1083 
1084  if (h_trigger.m_Snapshot_hits_per_pmt) Write_manager_in_key_dir(f , h_trigger.m_Snapshot_hits_per_pmt);
1085  }
1086 };
1087 
1088 #endif
TriggerHistograms::init_h_Snapshot_hits_per_module
void init_h_Snapshot_hits_per_module(int modules_per_string, std::set< int > &du_ids)
Definition: JRunHistograms.hh:700
TriggerHistograms::m_Snapshot_hits_per_pmt
JManager< string, TH2D > * m_Snapshot_hits_per_pmt
Definition: JRunHistograms.hh:574
JRA_Histograms::Write_histogram_table_to_file
void Write_histogram_table_to_file(TFile &f, string dirname, vector< vector< T * > > table)
Definition: JRunHistograms.hh:860
JDAQ.hh
TriggerHistograms::h_Snapshot_hits_per_module
TH2D * h_Snapshot_hits_per_module
Definition: JRunHistograms.hh:569
JManager< string, TH2D >
TriggerHistograms::init_h_Triggered_hits_per_module
void init_h_Triggered_hits_per_module(int modules_per_string, std::set< int > &du_ids)
Definition: JRunHistograms.hh:715
JRA_Histograms::initialize_trigger_histograms
void initialize_trigger_histograms()
Definition: JRunHistograms.hh:847
TimesliceHistograms::init_m_mean_ToT_distribution
void init_m_mean_ToT_distribution(int ts_type, string ts_name)
Definition: JRunHistograms.hh:479
TriggerHistograms::h_pmt_distribution_triggered_hits
TH1D * h_pmt_distribution_triggered_hits
Definition: JRunHistograms.hh:576
TimesliceHistograms::m_pmt_tot_distributions
vector< JManager< string, TH2D > * > m_pmt_tot_distributions
Definition: JRunHistograms.hh:311
TriggerHistograms::TriggerHistograms
TriggerHistograms()
Definition: JRunHistograms.hh:584
TriggerHistograms::init_h_pmt_distribution_triggered_hits
void init_h_pmt_distribution_triggered_hits()
Definition: JRunHistograms.hh:744
SummaryHistograms::init_h_daq_status_per_dom
void init_h_daq_status_per_dom(std::set< int > &du_ids, int modules_per_string)
Definition: JRunHistograms.hh:172
TimesliceHistograms::init_m_ToT_255
void init_m_ToT_255(int ts_type, int modules_per_string, string ts_name)
Definition: JRunHistograms.hh:494
TriggerHistograms::init_h_tot_distribution_triggered_hits
void init_h_tot_distribution_triggered_hits()
Definition: JRunHistograms.hh:755
TriggerHistograms::h_Trigger_bit_event
TH1D * h_Trigger_bit_event
Definition: JRunHistograms.hh:565
SummaryHistograms
Definition: JRunHistograms.hh:108
TimesliceHistograms::init_h_ToT_255_vs_time
void init_h_ToT_255_vs_time(int ts_type, string ts_name)
Definition: JRunHistograms.hh:415
JRA_Histograms::modules_per_string
int modules_per_string
Definition: JRunHistograms.hh:801
SummaryHistograms::init_m_mean_summary_rate_distribution
void init_m_mean_summary_rate_distribution()
Definition: JRunHistograms.hh:243
TriggerHistograms::init_h_tot_distribution_snapshot_hits
void init_h_tot_distribution_snapshot_hits()
Definition: JRunHistograms.hh:779
SummaryHistograms::h_rate_summary
TH2D * h_rate_summary
Definition: JRunHistograms.hh:113
TimesliceHistograms::init_h_dom_mean_rates
void init_h_dom_mean_rates(int ts_type, std::set< int > du_ids, int modules_per_string, std::string ts_name)
Definition: JRunHistograms.hh:401
TriggerHistograms
Definition: JRunHistograms.hh:563
JTOOLS::n
const int n
Definition: JPolint.hh:628
TriggerHistograms::h_Trigger_bit_hit
TH1D * h_Trigger_bit_hit
Definition: JRunHistograms.hh:566
std::vector< TH2D * >
TriggerHistograms::h_pmt_distribution_snapshot_hits
TH1D * h_pmt_distribution_snapshot_hits
Definition: JRunHistograms.hh:578
SummaryHistograms::SummaryHistograms
SummaryHistograms()
Definition: JRunHistograms.hh:124
TimesliceHistograms::initialize
void initialize(std::set< int > du_ids, int modules_per_string, int ts_type, std::string ts_name)
Definition: JRunHistograms.hh:345
JRA_Histograms::h_summary
SummaryHistograms h_summary
Definition: JRunHistograms.hh:797
JTOOLS::j
int j
Definition: JPolint.hh:634
KM3NETDAQ::NUMBER_OF_PMTS
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
Definition: JDAQ.hh:26
SummaryHistograms::h_pmt_rate_distribution
TH1D * h_pmt_rate_distribution
Definition: JRunHistograms.hh:114
JDAQClock.hh
MAKE_STRING
#define MAKE_STRING(A)
Make string.
Definition: JPrint.hh:699
JDETECTOR::getNumberOfStrings
int getNumberOfStrings(const JDetector &detector)
Get number of strings.
Definition: JDetectorToolkit.hh:398
TimesliceHistograms::init_h_ToT_255_Floor_vs_time_2
void init_h_ToT_255_Floor_vs_time_2(int ts_type, int modules_per_string, string ts_name)
Definition: JRunHistograms.hh:449
JGIZMO::JManager
Auxiliary class to manage set of compatible ROOT objects (e.g.
Definition: JManager.hh:40
KM3NETDAQ::NUMBER_OF_TRIGGER_BITS
static const unsigned int NUMBER_OF_TRIGGER_BITS
Number of trigger bits.
Definition: JDAQTriggerMask.hh:27
SummaryHistograms::init_h_hrv_per_dom
void init_h_hrv_per_dom(set< int > &du_ids, int modules_per_string)
Definition: JRunHistograms.hh:186
SummaryHistograms::h_daq_status_per_dom
TH2D * h_daq_status_per_dom
Definition: JRunHistograms.hh:111
TimesliceHistograms::init_h_ToT_255_Floor_vs_time
void init_h_ToT_255_Floor_vs_time(int ts_type, int modules_per_string, string ts_name)
Definition: JRunHistograms.hh:432
SummaryHistograms::init_h_fifo_per_dom
void init_h_fifo_per_dom(std::set< int > &du_ids, int modules_per_string)
Definition: JRunHistograms.hh:158
JDAQTimeslice.hh
TimesliceHistograms::h_ToT_255_Floor_vs_time
vector< TH2D * > h_ToT_255_Floor_vs_time
Definition: JRunHistograms.hh:300
JManager.hh
JTriggerBits.hh
BinLogX
void BinLogX(T *h)
Definition: JRunHistograms.hh:48
SummaryHistograms::h_hrv_per_dom
TH2D * h_hrv_per_dom
Definition: JRunHistograms.hh:112
std::set< int >
JRA_Histograms::initialize_timeslice_histograms
void initialize_timeslice_histograms()
Definition: JRunHistograms.hh:832
KM3NETDAQ::getFrameTime
double getFrameTime()
Get frame time duration.
Definition: JDAQClock.hh:162
TriggerHistograms::h_tot_distribution_triggered_hits
TH1D * h_tot_distribution_triggered_hits
Definition: JRunHistograms.hh:577
JSupport.hh
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
TriggerHistograms::init_h_Trigger_bit_event
void init_h_Trigger_bit_event()
Definition: JRunHistograms.hh:622
JRA_Histograms::Write_to_file
void Write_to_file(TFile &f)
Definition: JRunHistograms.hh:1004
JLANG::JLength
Length of type list.
Definition: JTypeList.hh:176
JTriggerInterface.hh
JRA_Histograms
Definition: JRunHistograms.hh:792
TriggerHistograms::h_tot_distribution_snapshot_hits
TH1D * h_tot_distribution_snapshot_hits
Definition: JRunHistograms.hh:579
TimesliceHistograms::m_mean_ToT
vector< JManager< string, TH2D > * > m_mean_ToT
Definition: JRunHistograms.hh:305
SummaryHistograms::m_mean_summary_rate
JManager< string, TH2D > * m_mean_summary_rate
Definition: JRunHistograms.hh:118
JDETECTOR::getNumberOfModules
int getNumberOfModules(const JDetector &detector)
Get number of modules.
Definition: JDetectorToolkit.hh:452
SummaryHistograms::initialize
void initialize(std::set< int > &du_ids, int modules_per_string)
Definition: JRunHistograms.hh:139
TriggerHistograms::h_Triggered_hits
TH1D * h_Triggered_hits
Definition: JRunHistograms.hh:568
JLANG::JIndexOf
Indexing of data type in type list.
Definition: JTypeList.hh:310
JRA_Histograms::Write_histogram_table_to_file
void Write_histogram_table_to_file(TFile &f, string dirname, vector< T * > table)
Definition: JRunHistograms.hh:883
JRA_Histograms::du_ids
std::set< int > du_ids
Definition: JRunHistograms.hh:800
TimesliceHistograms::Fill_mean_ToT_histograms
void Fill_mean_ToT_histograms()
Definition: JRunHistograms.hh:366
TriggerHistograms::init_h_Trigger_bit_hit
void init_h_Trigger_bit_hit()
Definition: JRunHistograms.hh:648
TimesliceHistograms::m_mean_ToT_distribution
vector< JManager< string, TH1D > * > m_mean_ToT_distribution
Definition: JRunHistograms.hh:306
TimesliceHistograms::min_ToT
int min_ToT
Definition: JRunHistograms.hh:289
normalize
void normalize(T *h, double n=1.0)
Definition: JRunHistograms.hh:99
JRA_Histograms::JRA_Histograms
JRA_Histograms()
Definition: JRunHistograms.hh:803
TimesliceHistograms
Definition: JRunHistograms.hh:287
SummaryHistograms::init_h_dom_rate_distribution
void init_h_dom_rate_distribution()
Definition: JRunHistograms.hh:226
JModuleRouter.hh
TimesliceHistograms::max_ToT
int max_ToT
Definition: JRunHistograms.hh:290
SummaryHistograms::init_m_mean_summary_rate
void init_m_mean_summary_rate(int modules_per_string)
Definition: JRunHistograms.hh:260
TimesliceHistograms::max_logdt
int max_logdt
Definition: JRunHistograms.hh:292
JDetectorToolkit.hh
JLANG::to_string
std::string to_string(const T &value)
Convert value to string.
Definition: JLangToolkit.hh:192
SummaryHistograms::init_m_summary_rate_distribution
void init_m_summary_rate_distribution()
Definition: JRunHistograms.hh:272
JRA_Histograms::JRA_Histograms
JRA_Histograms(JDetector &det)
Definition: JRunHistograms.hh:805
TimesliceHistograms::nbins_logdt
int nbins_logdt
Definition: JRunHistograms.hh:293
SummaryHistograms::h_mean_fifo
TH1D * h_mean_fifo
Definition: JRunHistograms.hh:109
SummaryHistograms::init_h_pmt_rate_distribution
void init_h_pmt_rate_distribution()
Definition: JRunHistograms.hh:211
TimesliceHistograms::nbins_time
int nbins_time
Definition: JRunHistograms.hh:294
TimesliceHistograms::h_ToT_255_vs_time
vector< TH1D * > h_ToT_255_vs_time
Definition: JRunHistograms.hh:299
JRA_Histograms::Write_manager_in_key_dir
void Write_manager_in_key_dir(TFile &f, JManager< T, V > *manager)
Definition: JRunHistograms.hh:950
TriggerHistograms::h_Triggered_hits_per_module
TH2D * h_Triggered_hits_per_module
Definition: JRunHistograms.hh:570
TimesliceHistograms::TimesliceHistograms
TimesliceHistograms()
Definition: JRunHistograms.hh:315
JRA_Histograms::h_trigger
TriggerHistograms h_trigger
Definition: JRunHistograms.hh:799
TimesliceHistograms::init_m_mean_ToT
void init_m_mean_ToT(int ts_type, int modules_per_string, string ts_name)
Definition: JRunHistograms.hh:464
JRA_Histograms::h_timeslice
TimesliceHistograms h_timeslice
Definition: JRunHistograms.hh:798
JRA_Histograms::initialize_summary_histograms
void initialize_summary_histograms()
Definition: JRunHistograms.hh:820
SummaryHistograms::h_fifo_per_dom
TH2D * h_fifo_per_dom
Definition: JRunHistograms.hh:110
JDETECTOR::JDetector
Detector data structure.
Definition: JDetector.hh:80
JAANET::detector
Detector file.
Definition: JHead.hh:130
std
Definition: jaanetDictionary.h:36
JSUPPORT
Support classes and methods for experiment specific I/O.
Definition: JDataWriter.cc:38
TimesliceHistograms::init_m_pmt_tot_distributions
void init_m_pmt_tot_distributions(int ts_type, string ts_name)
Definition: JRunHistograms.hh:508
KM3NETDAQ
KM3NeT DAQ data structures and auxiliaries.
Definition: DataQueue.cc:39
JDETECTOR::getStringIDs
std::set< int > getStringIDs(const JDetector &detector)
Get list of strings IDs.
Definition: JDetectorToolkit.hh:416
JRA_Histograms::Write_manager_table_in_key_dir
void Write_manager_table_in_key_dir(TFile &f, vector< JManager< T, V > * > table)
Definition: JRunHistograms.hh:975
JRA_Histograms::Replace_wildcard_in_name
void Replace_wildcard_in_name(JManager< T, V > *manager, char wc='%')
Definition: JRunHistograms.hh:921
BinLogY
void BinLogY(T *h)
Definition: JRunHistograms.hh:73
TriggerHistograms::init_h_Snapshot_hits
void init_h_Snapshot_hits()
Definition: JRunHistograms.hh:672
JTRIGGER::getTriggerName
const char * getTriggerName(JTriggerbit_t bit)
Get trigger name.
Definition: JTriggerInterface.hh:237
SummaryHistograms::m_summary_rate_distribution
JManager< string, TH2D > * m_summary_rate_distribution
Definition: JRunHistograms.hh:122
TriggerHistograms::init_h_Triggered_hits
void init_h_Triggered_hits()
Definition: JRunHistograms.hh:685
TriggerHistograms::initialize
void initialize(std::set< int > &du_ids, int modules_per_string)
Definition: JRunHistograms.hh:604
JTOOLS::r
data_type r[M+1]
Definition: JPolint.hh:709
TriggerHistograms::init_m_Snapshot_hits_per_pmt
void init_m_Snapshot_hits_per_pmt(int modules_per_string)
Definition: JRunHistograms.hh:730
TimesliceHistograms::init_m_pmt_dt_consecutive_hits
void init_m_pmt_dt_consecutive_hits(int ts_type, string ts_name)
Definition: JRunHistograms.hh:551
TimesliceHistograms::init_m_pmt_rate_distributions
void init_m_pmt_rate_distributions(int ts_type, string ts_name)
Definition: JRunHistograms.hh:531
SummaryHistograms::h_dom_rate_distribution
TH1D * h_dom_rate_distribution
Definition: JRunHistograms.hh:115
JLANG
Auxiliary classes and methods for language specific functionality.
Definition: JAbstractClass.hh:10
TimesliceHistograms::m_ToT_255
vector< JManager< string, TH2D > * > m_ToT_255
Definition: JRunHistograms.hh:307
TimesliceHistograms::m_pmt_rate_distributions
vector< JManager< string, TH2D > * > m_pmt_rate_distributions
Definition: JRunHistograms.hh:312
JSupportToolkit.hh
TriggerHistograms::init_h_pmt_distribution_snapshot_hits
void init_h_pmt_distribution_snapshot_hits()
Definition: JRunHistograms.hh:767
TimesliceHistograms::min_logdt
int min_logdt
Definition: JRunHistograms.hh:291
SummaryHistograms::m_mean_summary_rate_distribution
JManager< string, TH1D > * m_mean_summary_rate_distribution
Definition: JRunHistograms.hh:119
TimesliceHistograms::m_pmt_dt_consecutive_hits
vector< JManager< string, TH2D > * > m_pmt_dt_consecutive_hits
Definition: JRunHistograms.hh:313
TimesliceHistograms::h_dom_mean_rates
vector< TH2D * > h_dom_mean_rates
Definition: JRunHistograms.hh:298
SummaryHistograms::init_h_rate_summary
void init_h_rate_summary(set< int > &du_ids, int modules_per_string)
Definition: JRunHistograms.hh:200
JRA_Histograms::Write_manager_to_file
void Write_manager_to_file(TFile &f, string dirname, JManager< T, V > *table)
Definition: JRunHistograms.hh:903
TriggerHistograms::h_Snapshot_hits
TH1D * h_Snapshot_hits
Definition: JRunHistograms.hh:567
JAANET::String
General purpose string class.
Definition: JHead.hh:102
TimesliceHistograms::h_ToT_255_Floor_vs_time_2
vector< TH2D * > h_ToT_255_Floor_vs_time_2
Definition: JRunHistograms.hh:301
JRA_Histograms::detector
JDetector detector
Definition: JRunHistograms.hh:796