PPM-DU analysis  2.3
conversion and analysis of the PPM-DU data
 All Classes Files Functions Variables Pages
/home/alex/Work/Research/Km3NeT/PPM-DU/ppm-du-v2.3/histo.h
Go to the documentation of this file.
1 #ifndef _histo_h_
2 #define _histo_h_
3 
30 #include <vector>
31 
32 #include <TCanvas.h>
33 #include <TH1I.h>
34 #include <TH2I.h>
35 #include <TAxis.h>
36 #include <TCanvas.h>
37 #include <TGraph.h>
38 
39 #include "signal.h"
40 #include "pmt.h"
41 #include "dom.h"
42 #include "event.h"
43 #include "triggeredSignals.h"
44 #include "constants.h"
45 
46 class histo {
47  public:
48 
49  histo(const int domId, const int index, const int pmtId)
50  : fDomId(domId), fIndex(index), fPmtId(pmtId) { fAfterpulse = false; }
51 
53  const int GetDomId() const { return fDomId; }
55  void SetDomId(const int id) { fDomId = id; }
57  const int GetIndex() const { return fIndex; }
59  void SetIndex(const int id) { fIndex = id; }
61  const int GetPmtId() const { return fPmtId; }
63  void SetPmtId(const int id) { fPmtId = id; }
65  const int GetRunId() const { return fRunId; }
67  void SetRunId(const int id) { fRunId = id; }
68 
70  void InitSignal();
72  void FillSignal(const signal& sig);
74  void FillSignal(const std::vector<signal>& sigSample, long long int time);
76  void DrawSignal();
77 
79  void InitDuration();
81  void FillDuration(const std::vector<signal>& sig);
83  void DrawDuration();
84 
86  void InitDurations(const std::vector<int>& vDomId);
88  void FillDurations(const int domId, const std::vector<pmt>& pmtSample, double cutValues[domNb][pmtNb]);
90  void FillDurations(const std::vector<dom>& domSample, double cutValues[domNb][pmtNb], const std::vector<int>& vDomId);
92  void FillDurations(const std::vector<event>& eventSample, double cutValues[domNb][pmtNb], const std::vector<int>& vDomId);
94  void DrawDurations();
95 
97  void InitFrequency(const std::vector<int>& vDomId);
99  void FillFrequency(const int domId, const std::vector<pmt>& pmtSample, double cutValues[domNb][pmtNb]);
101  void FillFrequency(const std::vector<dom>& domSample, double cutValues[domNb][pmtNb], const std::vector<int>& vDomId);
103  void FillFrequency(const std::vector<event>& eventSample, double cutValues[domNb][pmtNb], const std::vector<int>& vDomId);
105  void DrawFrequency();
106 
108  void DrawPmtStat(const std::vector<pmt>& pmtSample);
110  void DrawPmtStats(const std::vector<dom>& domSample, const std::vector<int>& vDomId);
112  void DrawPmtStats(const std::vector<event>& eventSample, const std::vector<int>& vDomId);
113 
115  void InitDeltaT(const int refID);
116  void InitDeltaT(const std::vector<int>& vDomId);
118  void FillDeltaT(const std::vector<triggeredSignals>& vTrigger, const int domId, const int refID);
120  void FillDeltaT(const std::vector<triggeredSignals>& vTrigger);
122  void DrawDeltaT(const int refID);
123  void DrawDeltaT();
124 
126  void InitDomDeltaT(const std::vector<int>& vDomId);
128  void FillDomDeltaT(const std::vector<triggeredSignals>& vTrigger, const std::vector<int>& vDomId);
130  void DrawDomDeltaT();
131 
133  void InitCoincidenceRate(const std::vector<int>& vDomId);
135  void FillCoincidenceRate(const std::vector<triggeredSignals>& vTrigger);
137  void DrawCoincidenceRate();
138 
140  void InitEventPerSlice(const bool individualPmt, const std::vector<int>& vDomId);
142  void FillEventPerSlice(const std::vector<dom>& domSample, const bool individualPmt, const std::vector<int>& vDomId);
144  void DrawEventPerSlice(const bool individualPmt, double cutValues[domNb][pmtNb], const std::vector<int>& vDomId);
145 
147  int FindDomIndex(const int id, const std::vector<int>& vDomId);
148 
150  void InitSliceTimeSeries(const std::vector<int>& vDomId);
152  void FillSliceTimeSeries(const std::vector<dom>& domSample, const std::vector<int>& vDomId);
154  void DrawSliceTimeSeries();
155 
156  private:
157  int fDomId;
158  int fIndex;
159  int fPmtId;
160  int fRunId;
161  TH1I* fhSignal;
162  TH1I* fhDuration;
163  TH1I* fhDurations[domNb][pmtNb];
164  TH1D* fhDuration1peMean[domNb];
165  TH1D* fhDuration1peFit[domNb];
166  TCanvas* fcDurations[domNb][pmtNb];
167  TCanvas* fcDuration1peMean[domNb];
168  TCanvas* fcDuration1peFit[domNb];
169  TH2I* fhDurationVsTime[domNb][pmtNb];
170  TCanvas* fcDurationVsTime[domNb][pmtNb];
171  TH1I* fhFrequency[domNb][pmtNb];
172  TCanvas* fcFrequency[domNb][pmtNb];
173  TH2I* fhFrequencyVsTime[domNb][pmtNb];
174  TCanvas* fcFrequencyVsTime[domNb][pmtNb];
175  TH1I* fhSignalSpe[domNb];
176  TCanvas* fcSignalSpe[domNb];
177  //TH1I* fhDeltaT[domNb][pmtCouples];
178  //TCanvas* fcDeltaT[domNb][pmtCouples];
179  TH1I* fhDeltaT[domNb][pmtNb][pmtNb];
180  TCanvas* fcDeltaT[domNb][pmtNb][pmtNb];
181  TH1I* fhDomDeltaT[domNb*(domNb - 1)/2];
182  TCanvas* fcDomDeltaT[domNb*(domNb - 1)/2];
183  TH1I* fhCoincRate[domNb];
184  TCanvas* fcCoincRate[domNb];
185  TH1D* fhEventPerSlice[domNb];
186  TCanvas* fcEventPerSlice[domNb];
187  TH1D* fhEventPerSlice2[domNb][pmtNb];
188  TCanvas* fcEventPerSlice2[domNb][pmtNb];
189  TH1D* fhSliceTimeSeries[domNb];
190  TCanvas* fcSliceTimeSeries[domNb];
191  double fMinEvSlice;
192  double fMaxEvSlice;
193  bool fAfterpulse;
194 };
195 
196 #endif
void DrawDuration()
draw the histo
Definition: histo.cc:79
void DrawDeltaT()
Definition: histo.cc:632
void DrawSliceTimeSeries()
draw the slice time series histo.
Definition: histo.cc:969
void DrawPmtStat(const std::vector< pmt > &pmtSample)
draw the number of signal as a function of the pmt number (for one dom)
Definition: histo.cc:383
histo(const int domId, const int index, const int pmtId)
Definition: histo.h:49
void InitDeltaT(const int refID)
initialize the delta T histo (time difference between pmts).
Definition: histo.cc:482
void FillDeltaT(const std::vector< triggeredSignals > &vTrigger, const int domId, const int refID)
fill the time difference between all pmts and the reference pmt (given by the integer) ...
Definition: histo.cc:522
const int pmtNb
Definition: constants.h:9
void FillFrequency(const int domId, const std::vector< pmt > &pmtSample, double cutValues[domNb][pmtNb])
fill the histo with the time difference between 2 signals for a list of signals (one histo per Pmt nu...
Definition: histo.cc:268
void InitDuration()
initialize the duration histo
Definition: histo.cc:62
void DrawDurations()
draw the histo, one per pmt
Definition: histo.cc:188
void InitSignal()
initialize the signal histo.
Definition: histo.cc:20
void FillEventPerSlice(const std::vector< dom > &domSample, const bool individualPmt, const std::vector< int > &vDomId)
fill the event per slice histo.
Definition: histo.cc:833
const int GetPmtId() const
get the ID of the Pmt use for specific plots (signal, duration)
Definition: histo.h:61
void FillDomDeltaT(const std::vector< triggeredSignals > &vTrigger, const std::vector< int > &vDomId)
fill the time difference between all Dom neighbors
Definition: histo.cc:716
void SetRunId(const int id)
set the ID of the run
Definition: histo.h:67
const int domId
Definition: constants.h:10
void FillCoincidenceRate(const std::vector< triggeredSignals > &vTrigger)
Fill the coincidence rate histo.
Definition: histo.cc:775
const int domNb
Definition: constants.h:6
void InitFrequency(const std::vector< int > &vDomId)
initialize the frequency histo (depends on the pmt id).
Definition: histo.cc:246
void SetPmtId(const int id)
set the ID of the Pmt
Definition: histo.h:63
void DrawDomDeltaT()
draw the histo
Definition: histo.cc:745
replace drawing.h: do online histos
Definition: histo.h:46
void SetIndex(const int id)
set the ID of the event
Definition: histo.h:59
define the pmt signal
Definition: signal.h:30
void DrawCoincidenceRate()
draw the coincidence rate histo.
Definition: histo.cc:805
void DrawEventPerSlice(const bool individualPmt, double cutValues[domNb][pmtNb], const std::vector< int > &vDomId)
draw the event per slice histo.
Definition: histo.cc:859
void DrawSignal()
draw the histo
Definition: histo.cc:47
void SetDomId(const int id)
set the Id of the DOM
Definition: histo.h:55
void FillSliceTimeSeries(const std::vector< dom > &domSample, const std::vector< int > &vDomId)
fill the slice time series histo.
Definition: histo.cc:956
void DrawFrequency()
draw the histo, one per pmt
Definition: histo.cc:339
void FillSignal(const signal &sig)
fill the histo with one signal (it can be for instance one signal of one Pmt of one DOM) ...
Definition: histo.cc:29
void InitCoincidenceRate(const std::vector< int > &vDomId)
initialize the coincidence rate histo.
Definition: histo.cc:763
void DrawPmtStats(const std::vector< dom > &domSample, const std::vector< int > &vDomId)
draw the number of signal as a function of the pmt number (for one event)
Definition: histo.cc:405
void FillDurations(const int domId, const std::vector< pmt > &pmtSample, double cutValues[domNb][pmtNb])
fill the histo with all the signal durations of a list of signal (one histo per Pmt number) ...
Definition: histo.cc:121
const int GetRunId() const
get the ID of the run
Definition: histo.h:65
const int GetDomId() const
get the Id of the DOM use for specific plots (signal, signals, duration, PmtStat) ...
Definition: histo.h:53
int FindDomIndex(const int id, const std::vector< int > &vDomId)
find the index associates to a Dom Id
Definition: histo.cc:10
void InitDomDeltaT(const std::vector< int > &vDomId)
initialize the delta T histo (time difference between doms).
Definition: histo.cc:697
void FillDuration(const std::vector< signal > &sig)
fill the histo with the duration of a list of signals (it can be for instance all signals of one Pmt ...
Definition: histo.cc:70
const int pmtId
Definition: constants.h:11
void InitEventPerSlice(const bool individualPmt, const std::vector< int > &vDomId)
initialize the event per slice histo.
Definition: histo.cc:818
void InitSliceTimeSeries(const std::vector< int > &vDomId)
initialize the slice time series histo.
Definition: histo.cc:941
const int GetIndex() const
get the ID of the event use for specific plots (signal, signals, duration, PmtStat) ...
Definition: histo.h:57
void InitDurations(const std::vector< int > &vDomId)
initialize the duration histo (depends on the pmt id).
Definition: histo.cc:95