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.cc
Go to the documentation of this file.
1 #include "histo.h"
2 #include "TF1.h"
3 #include "TLine.h"
4 #include "triggeringDOM.h"
5 
6 #include <fstream>
7 #include <math.h>
8 
9 int
10 histo::FindDomIndex(const int id, const std::vector<int>& vDomId)
11 {
12  for (unsigned int j = 0; j < vDomId.size(); ++j) {
13  if (id == vDomId[j])
14  return j;
15  }
16  return -1;
17 }
18 
19 void
21 {
22  char name[1024];
23  sprintf(name, "hSignal-dom%d-pmt%d", fDomId, fPmtId);
24  //fhSignal = new TH1I(name, name, 4000, 0, 2e11);
25  fhSignal = new TH1I(name, name, 100000, 10e9, 11e9);
26 }
27 
28 void
30 {
31  const long long int rescaled = sig.GetStart();
32  for (int k = 0; k < sig.GetDuration(); ++k) {
33  fhSignal->Fill(rescaled + k);
34  }
35 }
36 
37 void
38 histo::FillSignal(const std::vector<signal>& sig, long long int time)
39 {
40  for (unsigned int i = 0; i < sig.size(); ++i) {
41  const long long int rescaled = sig[i].GetStart() + time;
42  fhSignal->Fill(rescaled);
43  }
44 }
45 
46 void
48 {
49  char name[1024];
50  sprintf(name, "cSignal-dom%d-pmt%d", fDomId, fPmtId);
51  TCanvas cSignal(name, name, 800, 600);
52  //fhSignal->SetStats(0);
53  fhSignal->SetTitle("");
54  fhSignal->GetXaxis()->SetTitle("time [ns]");
55  fhSignal->GetXaxis()->SetTitleOffset(1.4);
56  fhSignal->GetXaxis()->CenterTitle();
57  fhSignal->Draw();
58  fhSignal->Write();
59 }
60 
61 void
63 {
64  char name[1024];
65  sprintf(name, "hDuration-dom%d-pmt%d", fDomId, fPmtId);
66  fhDuration = new TH1I(name, name, 200, 0, 200);
67 }
68 
69 void
70 histo::FillDuration(const std::vector<signal>& sig)
71 {
72  for (unsigned int i = 0; i < sig.size(); ++i) {
73  const long long int rescaled = sig[i].GetDuration();
74  fhDuration->Fill(rescaled);
75  }
76 }
77 
78 void
80 {
81  char name[1024];
82  sprintf(name, "cDuration-dom%d-pmt%d", fDomId, fPmtId);
83  TCanvas cDuration(name, name, 800, 600);
84  //hDuration.SetStats(0);
85  fhDuration->SetTitle("");
86  fhDuration->GetXaxis()->SetTitle("time [ns]");
87  fhDuration->GetXaxis()->SetTitleOffset(1.4);
88  fhDuration->GetXaxis()->CenterTitle();
89  cDuration.SetLogy();
90  fhDuration->Draw();
91  fhDuration->Write();
92 }
93 
94 void
95 histo::InitDurations(const std::vector<int>& vDomId)
96 {
97  char name[1024];
98  for (int dom = 0; dom < domNb; ++dom) {
99  for (int pmt = 0; pmt < pmtNb; ++pmt) {
100  sprintf(name, "hDurations-dom%d-pmt%d", vDomId[dom], pmt);
101  fhDurations[dom][pmt] = new TH1I(name, name, 1000, 0, 1000);
102  sprintf(name, "cDurations-dom%d-pmt%d", vDomId[dom], pmt);
103  fcDurations[dom][pmt] = new TCanvas(name, name, 800, 600);
104  sprintf(name, "hDurationVsTime-dom%d-pmt%d", vDomId[dom], pmt);
105  fhDurationVsTime[dom][pmt] = new TH2I(name, name, 1000, 0, 5e11, 1000, 0, 1000);
106  sprintf(name, "cDurationVsTime-dom%d-pmt%d", vDomId[dom], pmt);
107  fcDurationVsTime[dom][pmt] = new TCanvas(name, name, 800, 600);
108  }
109  sprintf(name, "hDuration1pe-Mean-dom%d", vDomId[dom]);
110  fhDuration1peMean[dom] = new TH1D(name, name, 31, -0.5, 30.5);
111  sprintf(name, "cDuration1pe-Mean-dom%d", vDomId[dom]);
112  fcDuration1peMean[dom] = new TCanvas(name, name, 800, 600);
113  sprintf(name, "hDuration1pe-Fit-dom%d", vDomId[dom]);
114  fhDuration1peFit[dom] = new TH1D(name, name, 31, -0.5, 30.5);
115  sprintf(name, "cDuration1pe-Fit-dom%d", vDomId[dom]);
116  fcDuration1peFit[dom] = new TCanvas(name, name, 800, 600);
117  }
118 }
119 
120 void
121 histo::FillDurations(const int domId, const std::vector<pmt>& pmtSample,
122  double cutValues[domNb][pmtNb])
123 {
124  for (unsigned int pmt = 0; pmt < pmtSample.size(); ++pmt) {
125  const std::vector<signal>& sig = pmtSample[pmt].GetSignal();
126  const int pmtId = pmtSample[pmt].GetPmtId();
127  double cutValue = cutValues[domId][pmtId];
128  if (sig.size() < cutValue) {
129  for (unsigned int k = 0; k < sig.size(); ++k) {
130  fhDurations[domId][pmtId]->Fill(sig[k].GetDuration());
131  }
132  }
133  }
134 }
135 
136 void
137 histo::FillDurations(const std::vector<dom>& domSample, double cutValues[domNb][pmtNb], const std::vector<int>& vDomId)
138 {
139  for (unsigned int i = 0; i < domSample.size(); ++i) {
140  const std::vector<pmt>& pmtSample = domSample[i].GetPmtsData();
141  const long long int sliceTime = domSample[i].GetDomHeader().GetDomTime();
142  const int domId = domSample[i].GetDomHeader().GetDomId();
143  int domIndex = FindDomIndex(domId, vDomId);
144  if ((domIndex >= 0) && (domIndex < 3)) {
145  for (unsigned int j = 0; j < pmtSample.size(); ++j) {
146  const std::vector<signal>& sig = pmtSample[j].GetSignal();
147  const int pmtId = pmtSample[j].GetPmtId();
148  const double cutValue = cutValues[domIndex][pmtId];
149  if (sig.size() < cutValue) {
150  for (unsigned int k = 0; k < sig.size(); ++k) {
151  const int sigDuration = sig[k].GetDuration();
152  fhDurations[domIndex][pmtId]->Fill(sigDuration);
153  const long long int sigTime = sig[k].GetStart() + sliceTime;
154  fhDurationVsTime[domIndex][pmtId]->Fill(sigTime, sigDuration);
155  }
156  }
157  }
158  }
159  }
160 }
161 
162 void
163 histo::FillDurations(const std::vector<event>& eventSample, double cutValues[domNb][pmtNb], const std::vector<int>& vDomId)
164 {
165  for (unsigned int e = 0; e < eventSample.size(); ++e) {
166  const std::vector<dom>& domSample = eventSample[e].GetDomList();
167  for (unsigned int i = 0; i < domSample.size(); ++i) {
168  const std::vector<pmt>& pmtSample = domSample[i].GetPmtsData();
169  const int domId = domSample[i].GetDomHeader().GetDomId();
170  int domIndex = FindDomIndex(domId, vDomId);
171  if ((domIndex >= 0) && (domIndex < 3)) {
172  for (unsigned int j = 0; j < pmtSample.size(); ++j) {
173  const std::vector<signal>& sig = pmtSample[j].GetSignal();
174  const int pmtId = pmtSample[j].GetPmtId();
175  const double cutValue = cutValues[domIndex][pmtId];
176  if (sig.size() < cutValue) {
177  for (unsigned int k = 0; k < sig.size(); ++k) {
178  fhDurations[domIndex][pmtId]->Fill(sig[k].GetDuration());
179  }
180  }
181  }
182  }
183  }
184  }
185 }
186 
187 void
189 {
190  char filename[1024];
191  sprintf(filename, "calib-run%d.dat", fRunId);
192  ofstream outfile(filename);
193  for (int dom = 0; dom < domNb; ++dom) {
194  for (int pmt = 0; pmt < pmtNb; ++pmt) {
195  if (fhDurations[dom][pmt]->GetEntries() != 0) {
196  //fhDurations->SetStats(0);
197  fhDurations[dom][pmt]->SetTitle("");
198  fhDurations[dom][pmt]->GetXaxis()->SetTitle("time [ns]");
199  fhDurations[dom][pmt]->GetXaxis()->SetTitleOffset(1.4);
200  fhDurations[dom][pmt]->GetXaxis()->CenterTitle();
201  fcDurations[dom][pmt]->SetLogy();
202  fhDurations[dom][pmt]->Draw();
203  const double maxHistoDur = fhDurations[dom][pmt]->GetMaximumBin();
204  TF1* gaussFit1 = new TF1("fit1", "gaus", maxHistoDur - 6, maxHistoDur + 7);
205  fhDurations[dom][pmt]->Fit(gaussFit1, "RQ");
206  const double fitMean = gaussFit1->GetParameter(1);
207  const double fitSigma = gaussFit1->GetParameter(2);
208  outfile << pmt << ' ' << maxHistoDur << ' ' << fitMean
209  << ' ' << fitSigma << ' ' << std::endl;
210  fhDuration1peFit[dom]->SetBinContent(pmt + 1, fitMean);
211  fhDurations[dom][pmt]->Write();
212  delete fhDurations[dom][pmt];
213  delete fcDurations[dom][pmt];
214  fhDurationVsTime[dom][pmt]->SetTitle("");
215  fhDurationVsTime[dom][pmt]->GetXaxis()->SetTitle("event time [ns]");
216  fhDurationVsTime[dom][pmt]->GetXaxis()->SetTitleOffset(1.4);
217  fhDurationVsTime[dom][pmt]->GetXaxis()->CenterTitle();
218  fhDurationVsTime[dom][pmt]->GetYaxis()->SetTitle("duration [ns]");
219  fhDurationVsTime[dom][pmt]->GetYaxis()->SetTitleOffset(1.4);
220  fhDurationVsTime[dom][pmt]->GetYaxis()->CenterTitle();
221  fcDurationVsTime[dom][pmt]->SetLogy();
222  fhDurationVsTime[dom][pmt]->Draw("COLZ");
223  fhDurationVsTime[dom][pmt]->Write();
224  delete fhDurationVsTime[dom][pmt];
225  delete fcDurationVsTime[dom][pmt];
226  }
227  }
228  outfile.close();
229  fhDuration1peFit[dom]->SetStats(0);
230  fhDuration1peFit[dom]->SetTitle("");
231  fhDuration1peFit[dom]->GetXaxis()->SetTitle("pmt id");
232  fhDuration1peFit[dom]->GetXaxis()->SetTitleOffset(1.2);
233  fhDuration1peFit[dom]->GetXaxis()->CenterTitle();
234  fhDuration1peFit[dom]->GetYaxis()->SetTitle("duration 1pe [ns]");
235  fhDuration1peFit[dom]->GetYaxis()->SetTitleOffset(1.2);
236  fhDuration1peFit[dom]->GetYaxis()->CenterTitle();
237  fhDuration1peFit[dom]->GetYaxis()->SetRangeUser(0, 40);
238  fhDuration1peFit[dom]->Draw("");
239  fhDuration1peFit[dom]->Write();
240  //delete fhDuration1peFit;
241  //delete fcDuration1peFit;
242  }
243 }
244 
245 void
246 histo::InitFrequency(const std::vector<int>& vDomId)
247 {
248  char name[1024];
249  for (int dom = 0; dom < domNb; ++dom) {
250  for (int pmt = 0; pmt < pmtNb; ++pmt) {
251  sprintf(name, "hFrequency-dom%d-pmt%d", vDomId[dom], pmt);
252  fhFrequency[dom][pmt] = new TH1I(name, name, 20000, 0, 200000);
253  sprintf(name, "cFrequency-dom%d-pmt%d", vDomId[dom], pmt);
254  fcFrequency[dom][pmt] = new TCanvas(name, name, 800, 600);
255  sprintf(name, "fhFrequencyVsTime-dom%d-pmt%d", vDomId[dom], pmt);
256  fhFrequencyVsTime[dom][pmt] = new TH2I(name, name, 350, 0, 5e11, 350, 0, 5e6);
257  sprintf(name, "fcFrequencyVsTime-dom%d-pmt%d", vDomId[dom], pmt);
258  fcFrequencyVsTime[dom][pmt] = new TCanvas(name, name, 800, 600);
259  }
260  sprintf(name, "hSignalSpe-dom%d", vDomId[dom]);
261  fhSignalSpe[dom] = new TH1I(name, name, 350, 0, 350);
262  sprintf(name, "cSignalSpe-dom%d", vDomId[dom]);
263  fcSignalSpe[dom] = new TCanvas(name, name, 800, 600);
264  }
265 }
266 
267 void
268 histo::FillFrequency(const int domId, const std::vector<pmt>& pmtSample, double cutValues[domNb][pmtNb])
269 {
270  for (unsigned int j = 0; j < pmtSample.size(); ++j) {
271  const std::vector<signal>& sigSample = pmtSample[j].GetSignal();
272  const int pmtId = pmtSample[j].GetPmtId();
273  const double cutValue = cutValues[domId][pmtId];
274  if ((sigSample.size() > 2) || (sigSample.size() < cutValue)) {
275  for (unsigned int k = 0; k < (sigSample.size() - 1); ++k) {
276  const long long int diff = sigSample[k + 1].GetStart() - sigSample[k].GetStart();
277  fhFrequency[domId][pmtId]->Fill(diff);
278  }
279  }
280  }
281 }
282 
283 void
284 histo::FillFrequency(const std::vector<dom>& domSample, double cutValues[domNb][pmtNb], const std::vector<int>& vDomId)
285 {
286  for (unsigned int i = 0; i < domSample.size(); ++i) {
287  const std::vector<pmt> pmtSample = domSample[i].GetPmtsData();
288  const long long int sliceTime = domSample[i].GetDomHeader().GetDomTime();
289  const int domId = domSample[i].GetDomHeader().GetDomId();
290  int domIndex = FindDomIndex(domId, vDomId);
291  if ((domIndex >= 0) && (domIndex < 3)) {
292  for (unsigned int j = 0; j < pmtSample.size(); ++j) {
293  const std::vector<signal>& sigSample = pmtSample[j].GetSignal();
294  const int pmtId = pmtSample[j].GetPmtId();
295  const double cutValue = cutValues[domIndex][pmtId];
296  if ((sigSample.size() > 2) || (sigSample.size() < cutValue)) {
297  for (unsigned int k = 0; k < (sigSample.size() - 1); ++k) {
298  const long long int diff = sigSample[k + 1].GetStart() - sigSample[k].GetStart();
299  fhFrequency[domIndex][pmtId]->Fill(diff);
300  const long long int sigTime = sigSample[k].GetStart() + sliceTime;
301  fhFrequencyVsTime[domIndex][pmtId]->Fill(sigTime, diff);
302  if ((pmtId == 0) && (diff > 1200) && (diff < 1500)) {
303  fhSignalSpe[domIndex]->Fill(sigSample[k].GetDuration());
304  }
305  }
306  }
307  }
308  }
309  }
310 }
311 
312 void
313 histo::FillFrequency(const std::vector<event>& eventSample, double cutValues[domNb][pmtNb], const std::vector<int>& vDomId)
314 {
315  for (unsigned int e = 0; e < eventSample.size(); ++e) {
316  const std::vector<dom>& domSample = eventSample[e].GetDomList();
317  for (unsigned int i = 0; i < domSample.size(); ++i) {
318  const std::vector<pmt>& pmtSample = domSample[i].GetPmtsData();
319  const int domId = domSample[i].GetDomHeader().GetDomId();
320  int domIndex = FindDomIndex(domId, vDomId);
321  if ((domIndex >= 0) && (domIndex < 3)) {
322  for (unsigned int j = 0; j < pmtSample.size(); ++j) {
323  const std::vector<signal>& sigSample = pmtSample[j].GetSignal();
324  const int pmtId = pmtSample[j].GetPmtId();
325  const double cutValue = cutValues[domIndex][pmtId];
326  if ((sigSample.size() > 2) || (sigSample.size() < cutValue)) {
327  for (unsigned int k = 0; k < (sigSample.size() - 1); ++k) {
328  const long long int diff = sigSample[k + 1].GetStart() - sigSample[k].GetStart();
329  fhFrequency[domIndex][pmtId]->Fill(diff);
330  }
331  }
332  }
333  }
334  }
335  }
336 }
337 
338 void
340 {
341  for (int dom = 0; dom < domNb; ++dom) {
342  for (int pmt = 0; pmt < pmtNb; ++pmt) {
343  //hFrequency.SetStats(0);
344  if (fhFrequency[dom][pmt]->GetEntries() != 0) {
345  fhFrequency[dom][pmt]->SetTitle("");
346  fhFrequency[dom][pmt]->GetXaxis()->SetTitle("time [ns]");
347  fhFrequency[dom][pmt]->GetXaxis()->SetTitleOffset(1.4);
348  fhFrequency[dom][pmt]->GetXaxis()->CenterTitle();
349  fcFrequency[dom][pmt]->SetLogy();
350  fhFrequency[dom][pmt]->Draw();
351  fhFrequency[dom][pmt]->Write();
352  delete fhFrequency[dom][pmt];
353  delete fcFrequency[dom][pmt];
354  fhFrequencyVsTime[dom][pmt]->SetTitle("");
355  fhFrequencyVsTime[dom][pmt]->GetXaxis()->SetTitle("time [ns]");
356  fhFrequencyVsTime[dom][pmt]->GetXaxis()->SetTitleOffset(1.4);
357  fhFrequencyVsTime[dom][pmt]->GetXaxis()->CenterTitle();
358  fhFrequencyVsTime[dom][pmt]->GetYaxis()->SetTitle("#Delta t [ns]");
359  fhFrequencyVsTime[dom][pmt]->GetYaxis()->SetTitleOffset(1.4);
360  fhFrequencyVsTime[dom][pmt]->GetYaxis()->CenterTitle();
361  fcFrequencyVsTime[dom][pmt]->SetLogy();
362  fhFrequencyVsTime[dom][pmt]->Draw();
363  fhFrequencyVsTime[dom][pmt]->Write();
364  delete fhFrequencyVsTime[dom][pmt];
365  delete fcFrequencyVsTime[dom][pmt];
366  }
367  }
368  if (fhSignalSpe[dom]->GetEntries() != 0) {
369  fhSignalSpe[dom]->SetTitle("");
370  fhSignalSpe[dom]->GetXaxis()->SetTitle("time [ns]");
371  fhSignalSpe[dom]->GetXaxis()->SetTitleOffset(1.4);
372  fhSignalSpe[dom]->GetXaxis()->CenterTitle();
373  fcSignalSpe[dom]->SetLogy();
374  fhSignalSpe[dom]->Draw();
375  fhSignalSpe[dom]->Write();
376  delete fhSignalSpe[dom];
377  delete fcSignalSpe[dom];
378  }
379  }
380 }
381 
382 void
383 histo::DrawPmtStat(const std::vector<pmt>& pmtSample)
384 {
385  std::vector<int> vCount;
386  std::vector<int> vPmt;
387  for (unsigned int i = 0; i < pmtSample.size(); ++i) {
388  vPmt.push_back(i);
389  vCount.push_back(pmtSample[i].GetHitNumber());
390  }
391  char name[1024];
392  sprintf(name, "cPmtStats-dom%d", fDomId);
393  TCanvas cPmtStats(name, name, 800, 600);
394  TGraph gPmtStats(vPmt.size(), &vPmt[0], &vCount[0]);
395  //gPmtStats.SetStats(0);
396  gPmtStats.SetTitle("");
397  gPmtStats.GetXaxis()->SetTitle("pmt id");
398  gPmtStats.GetXaxis()->SetTitleOffset(1.4);
399  gPmtStats.GetXaxis()->CenterTitle();
400  gPmtStats.Draw("A*");
401  cPmtStats.Write();
402 }
403 
404 void
405 histo::DrawPmtStats(const std::vector<dom>& domSample, const std::vector<int>& vDomId)
406 {
407  double vCount[domNb][pmtNb];
408  double vPmt[pmtNb];
409  for (int pmt = 0; pmt < pmtNb; ++pmt) {
410  vPmt[pmt] = pmt;
411  for (int dom = 0; dom < domNb; ++dom) {
412  vCount[dom][pmt] = 0;
413  }
414  }
415  long long int startRunTime = 0;
416  long long int endRunTime = 0;
417  for (unsigned int i = 0; i < domSample.size(); ++i) {
418  const domHeader& domHead = domSample[i].GetDomHeader();
419  const int domId = domHead.GetDomId();
420  const int domIndex = FindDomIndex(domId, vDomId);
421  const long long int domTime = domHead.GetDomTime();
422  if (i == 0) startRunTime = domTime;
423  if (i == domSample.size() - 1) endRunTime = domTime;
424  const std::vector<pmt>& pmtSample = domSample[i].GetPmtsData();
425  for (unsigned int j = 0; j < pmtSample.size(); ++j) {
426  const int tempId = pmtSample[j].GetPmtId();
427  vCount[domIndex][tempId] += pmtSample[j].GetHitNumber();
428  }
429  }
430  char name[1024];
431  for (int dom = 0; dom < domNb; ++dom) {
432  sprintf(name, "cPmtStats-OneEvent-dom%d", vDomId[dom]);
433  TCanvas cPmtStats(name, name, 800, 600);
434  for (int pmt = 0; pmt < pmtNb; ++pmt) {
435  vCount[dom][pmt] = 1e-3*vCount[dom][pmt]/(double(endRunTime - startRunTime)*1e-9 + 0.134217728);
436  }
437  TGraph* gPmtStats = new TGraph(pmtNb, &vPmt[0], &vCount[dom][0]);
438  gPmtStats->SetTitle("");
439  gPmtStats->GetXaxis()->SetTitle("pmt id");
440  gPmtStats->GetXaxis()->SetTitleOffset(1.2);
441  gPmtStats->GetXaxis()->CenterTitle();
442  gPmtStats->GetYaxis()->SetTitle("frequency for the last run [kHz]");
443  gPmtStats->GetYaxis()->SetTitleOffset(1.2);
444  gPmtStats->GetYaxis()->CenterTitle();
445  gPmtStats->Draw("A*");
446  cPmtStats.Write();
447  }
448 }
449 
450 void
451 histo::DrawPmtStats(const std::vector<event>& eventSample, const std::vector<int>& vDomId)
452 {
453  double vCount[domNb][pmtNb];
454  double vPmt[pmtNb];
455  for (int pmt = 0; pmt < pmtNb; ++pmt) vPmt[pmt] = pmt;
456  for (unsigned int e = 0; e < eventSample.size(); ++e) {
457  const std::vector<dom>& domSample = eventSample[e].GetDomList();
458  for (unsigned int dom = 0; dom < domSample.size(); ++dom) {
459  const std::vector<pmt>& pmtSample = domSample[dom].GetPmtsData();
460  const int domId = domSample[dom].GetDomHeader().GetDomId();
461  const int domIndex = FindDomIndex(domId, vDomId);
462  for (unsigned int pmt = 0; pmt < pmtSample.size(); ++pmt) {
463  vCount[domIndex][pmt] = vCount[domIndex][pmt] + pmtSample[pmt].GetHitNumber();
464  }
465  }
466  }
467  for (int dom = 0; dom < domNb; ++dom) {
468  char name[1024];
469  sprintf(name, "cPmtStats-allEvents-dom%d", vDomId[dom]);
470  TCanvas cPmtStats(name, name, 800, 600);
471  TGraph* gPmtStats = new TGraph(pmtNb, &vPmt[0], &vCount[dom][0]);
472  gPmtStats->SetTitle("");
473  gPmtStats->GetXaxis()->SetTitle("pmt id");
474  gPmtStats->GetXaxis()->SetTitleOffset(1.4);
475  gPmtStats->GetXaxis()->CenterTitle();
476  gPmtStats->Draw("A*");
477  cPmtStats.Write();
478  }
479 }
480 
481 void
482 histo::InitDeltaT(const int refId)
483 {
484  for (int pmt = 0; pmt < pmtNb; ++pmt) {
485  int first = pmt;
486  int second = refId;
487  if (first > second) {
488  first = refId;
489  second = pmt;
490  }
491  char name[1024];
492  sprintf(name, "hDeltaT-pmt%d-%d", first, second);
493  fMinEvSlice = -100.5;
494  fMaxEvSlice = 100.5;
495  fhDeltaT[0][pmt][refId] = new TH1I(name, name, 201, fMinEvSlice, fMaxEvSlice);
496  sprintf(name, "cDeltaT-pmt%d-%d", first, second);
497  fcDeltaT[0][pmt][refId] = new TCanvas(name, name, 800, 600);
498  }
499 }
500 
501 void
502 histo::InitDeltaT(const std::vector<int>& vDomId)
503 {
504  for (int dom = 0; dom < domNb; ++dom) {
505  for (int pmt = 0; pmt < pmtNb; ++pmt) {
506  for (int k = pmt + 1; k < pmtNb; ++k) {
507  //if (AreNeighbours(pmt, k) == true) {
508  char name[1024];
509  sprintf(name, "hDeltaT-dom%d-pmt%d-%d", vDomId[dom], pmt, k);
510  fMinEvSlice = -100.5;
511  fMaxEvSlice = 100.5;
512  fhDeltaT[dom][pmt][k] = new TH1I(name, name, 201, fMinEvSlice, fMaxEvSlice);
513  sprintf(name, "cDeltaT-dom%d-pmt%d-%d", vDomId[dom], pmt, k);
514  fcDeltaT[dom][pmt][k] = new TCanvas(name, name, 800, 600);
515  //}
516  }
517  }
518  }
519 }
520 
521 void
522 histo::FillDeltaT(const std::vector<triggeredSignals>& vTrigger, const int domId, const int refId)
523 {
524  for (unsigned int i = 0; i < vTrigger.size(); ++i){
525  const std::vector<signals>& vSignals = vTrigger[i].GetSignals();
526  long long int time[pmtNb];
527  for (int j = 0; j < pmtNb; ++j) time[j] = 0;
528  for (unsigned j = 0; j < vSignals.size(); ++j) { // pazi! Should be changed when using DoSlidingT
529  const int pmtId = vSignals[j].GetPmtId();
530  time[pmtId] = vSignals[j].GetStart();
531  }
532  for (int j = 0; j < pmtNb; ++j) {
533  int first = j;
534  int second = refId;
535  if (first > second) {
536  first = refId;
537  second = j;
538  }
539  if (time[j] && time[refId] && (j != refId)) {
540  double offset = 0;
541  fhDeltaT[domId][first][second]->Fill(time[j] - time[refId] - offset);
542  }
543  }
544  }
545 }
546 
547 void
548 histo::FillDeltaT(const std::vector<triggeredSignals>& vTrigger)
549 {
550  for (unsigned int i = 0; i < vTrigger.size(); ++i){
551  const std::vector<signals>& vSignals = vTrigger[i].GetSignals();
552  if (vSignals.size() != 2) continue;
553  const int domId0 = vSignals[0].GetDomId();
554  const int domId1 = vSignals[1].GetDomId();
555  if (domId0 != domId1) continue;
556  const int pmtId0 = vSignals[0].GetPmtId();
557  const int pmtId1 = vSignals[1].GetPmtId();
558  if (pmtId0 == pmtId1) continue;
559  const long long int time0 = vSignals[0].GetStart();
560  const long long int time1 = vSignals[1].GetStart();
561  if (pmtId0 > pmtId1) {
562  fhDeltaT[domId0][pmtId1][pmtId0]->Fill(time1 - time0);
563  } else {
564  fhDeltaT[domId0][pmtId0][pmtId1]->Fill(time0 - time1);
565  }
566  }
567 }
568 
569 void
570 histo::DrawDeltaT(const int refId)
571 {
572  char filename[1024];
573  sprintf(filename, "deltaT-FitResults-run%d.dat", fRunId);
574  ofstream out(filename);
575  for (int pmt1 = 0; pmt1 < pmtNb; ++pmt1) {
576  for (int pmt2 = 0; pmt2 < pmtNb; ++pmt2) {
577  if ((pmt1 != refId) && (pmt2 != refId)) continue;
578  fhDeltaT[0][pmt1][pmt2]->SetStats(1111);
579  //fhDeltaT[0][pmt1][pmt2]->SetOptFit(1111);
580  fhDeltaT[0][pmt1][pmt2]->SetTitle("");
581  fhDeltaT[0][pmt1][pmt2]->GetXaxis()->SetTitle("time [ns]");
582  fhDeltaT[0][pmt1][pmt2]->GetXaxis()->SetTitleOffset(1.4);
583  fhDeltaT[0][pmt1][pmt2]->GetXaxis()->CenterTitle();
584  //fcDeltaT[0][pmt1][pmt2]->SetLogy();
585  double maxHisto1 = fhDeltaT[0][pmt1][pmt2]->GetMaximumBin();
586  if (maxHisto1 < 10) maxHisto1 = fMaxEvSlice;
587  const double binNb = fhDeltaT[0][pmt1][pmt2]->GetNbinsX();
588  const double step = (fMaxEvSlice - fMinEvSlice)/binNb;
589  const double maxHisto2 = maxHisto1*step + fMinEvSlice;
590  double baseline = 0;
591  int baseCount1 = 0;
592  int baseCount2 = 0;
593  while (baseCount1 < (maxHisto1 - 10.0/step)) {
594  const double cont = fhDeltaT[0][pmt1][pmt2]->GetBinContent(baseCount1);
595  ++baseCount1;
596  if (cont) {
597  baseline += cont;
598  ++baseCount2;
599  }
600  }
601  if (baseCount2)
602  baseline = baseline/baseCount2;
603  for (int i = 1; i <= binNb; ++i) {
604  const double cont = fhDeltaT[0][pmt1][pmt2]->GetBinContent(i);
605  if (cont)
606  //fhDeltaT[0][pmt1][pmt2]->SetBinContent(i, cont - baseline);
607  fhDeltaT[0][pmt1][pmt2]->SetBinContent(i, cont);
608  }
609  TF1* gaussFit2 = new TF1("fit2", "gaus", maxHisto2 - 8, maxHisto2 + 8);
610  const double integral = fhDeltaT[0][pmt1][pmt2]->GetEntries();
611  const double average = fhDeltaT[0][pmt1][pmt2]->GetMean();
612  fhDeltaT[0][pmt1][pmt2]->Fit(gaussFit2, "RQ");
613  fhDeltaT[0][pmt1][pmt2]->Draw();
614  fhDeltaT[0][pmt1][pmt2]->Write();
615  const double fit1 = gaussFit2->GetParameter(0);
616  const double fit2 = gaussFit2->GetParameter(1);
617  const double fit3 = gaussFit2->GetParameter(2);
618  out << pmt1 << ' ' << fit1 << ' ' << fit2 << ' ' << fit3 << ' '
619  << integral << ' ' << average << std::endl;
620  }
621  }
622  out.close();
623  for (int pmt1 = 0; pmt1 < pmtNb - 1; ++pmt1) {
624  for (int pmt2 = pmt1 + 1; pmt2 < pmtNb; ++pmt2) {
625  delete fhDeltaT[0][pmt1][pmt2];
626  delete fcDeltaT[0][pmt1][pmt2];
627  }
628  }
629 }
630 
631 void
633 {
634  char filename[1024];
635  sprintf(filename, "deltaT-FitResults-run%d.dat", fRunId);
636  ofstream out(filename);
637  for (int dom = 0; dom < domNb; ++dom) {
638  for (int pmt1 = 0; pmt1 < pmtNb - 1; ++pmt1) {
639  for (int pmt2 = pmt1 + 1; pmt2 < pmtNb; ++pmt2) {
640  fhDeltaT[dom][pmt1][pmt2]->SetStats(1111);
641  //fhDeltaT[dom][pmt1][pmt2]->SetOptFit(1111);
642  fhDeltaT[dom][pmt1][pmt2]->SetTitle("");
643  fhDeltaT[dom][pmt1][pmt2]->GetXaxis()->SetTitle("time [ns]");
644  fhDeltaT[dom][pmt1][pmt2]->GetXaxis()->SetTitleOffset(1.4);
645  fhDeltaT[dom][pmt1][pmt2]->GetXaxis()->CenterTitle();
646  //fcDeltaT[dom][pmt1][pmt2]->SetLogy();
647  int maxHisto1 = fhDeltaT[dom][pmt1][pmt2]->GetMaximumBin();
648  if (maxHisto1 < 10) maxHisto1 = fMaxEvSlice;
649  const int binNb = fhDeltaT[dom][pmt1][pmt2]->GetNbinsX();
650  const double step = (fMaxEvSlice - fMinEvSlice)/double(binNb);
651  const double maxHisto2 = double(maxHisto1)*step + fMinEvSlice;
652  double baseline = 0;
653  int baseCount1 = 0;
654  int baseCount2 = 0;
655  while (baseCount1 < (maxHisto1 - 10.0/step)) {
656  const double cont = fhDeltaT[dom][pmt1][pmt2]->GetBinContent(baseCount1);
657  ++baseCount1;
658  if (cont) {
659  baseline += cont;
660  ++baseCount2;
661  }
662  }
663  if (baseCount2)
664  baseline = baseline/baseCount2;
665  for (int i = 1; i <= binNb; ++i) {
666  const double cont = fhDeltaT[dom][pmt1][pmt2]->GetBinContent(i);
667  if (cont)
668  //fhDeltaT[dom][pmt1][pmt2]->SetBinContent(i, cont - baseline);
669  fhDeltaT[dom][pmt1][pmt2]->SetBinContent(i, cont);
670  }
671  TF1* gaussFit2 = new TF1("fit2", "gaus", maxHisto2 - 8, maxHisto2 + 8);
672  const double integral = fhDeltaT[dom][pmt1][pmt2]->GetEntries();
673  const double average = fhDeltaT[dom][pmt1][pmt2]->GetMean();
674  fhDeltaT[dom][pmt1][pmt2]->Fit(gaussFit2, "RQ");
675  fhDeltaT[dom][pmt1][pmt2]->Draw();
676  fhDeltaT[dom][pmt1][pmt2]->Write();
677  const double fit1 = gaussFit2->GetParameter(0);
678  const double fit2 = gaussFit2->GetParameter(1);
679  const double fit3 = gaussFit2->GetParameter(2);
680  out << pmt1 << ' ' << pmt2 << ' ' << fit1 << ' ' << fit2 << ' ' << fit3 << ' '
681  << integral << ' ' << average << std::endl;
682  }
683  }
684  }
685  out.close();
686  for (int dom = 0; dom < domNb; ++dom) {
687  for (int pmt1 = 0; pmt1 < pmtNb - 1; ++pmt1) {
688  for (int pmt2 = pmt1 + 1; pmt2 < pmtNb; ++pmt2) {
689  delete fhDeltaT[dom][pmt1][pmt2];
690  delete fcDeltaT[dom][pmt1][pmt2];
691  }
692  }
693  }
694 }
695 
696 void
697 histo::InitDomDeltaT(const std::vector<int>& vDomId)
698 {
699  char name[1024];
700  for (int dom1 = 0; dom1 < domNb - 1; ++dom1) {
701  for (int dom2 = dom1 + 1; dom2 < domNb; ++dom2) {
702  const int domHist = dom1 + dom2 - 1;
703  sprintf(name, "hDomDeltaT-dom%d-%d", vDomId[dom1], vDomId[dom2]);
704  const double minHist = -10000.5;
705  const double maxHist = 10000.5;
706  const int bin = maxHist - minHist;
707  fhDomDeltaT[domHist] = new TH1I(name, name, bin, minHist, maxHist);
708  sprintf(name, "cDomDeltaT-dom%d-%d", vDomId[dom1], vDomId[dom2]);
709  fcDomDeltaT[domHist] = new TCanvas(name, name, 800, 600);
710  }
711  }
712 }
713 
714 
715 void
716 histo::FillDomDeltaT(const std::vector<triggeredSignals>& vTrigger, const std::vector<int>& vDomId)
717 {
718  char filename[1024];
719  sprintf(filename, "domCoincidence-5pmt2dom-run%d.dat", fRunId);
720  ofstream out(filename);
721  for (unsigned int i = 0; i < vTrigger.size(); ++i) {
722  out << "new Muon" << std::endl;
723  const std::vector<signals>& vSignals = vTrigger[i].GetSignals();
724  if (vSignals.size() < 2) continue;
725  const int domId1 = vSignals[0].GetDomId();
726  const long long int time1 = vSignals[0].GetStart();
727  out << domId1 << ' ' << time1 << std::endl;
728  bool secondDom = false;
729  for (unsigned sig = 1; sig < vSignals.size(); ++sig) {
730  const int domId2 = vSignals[sig].GetDomId();
731  const long long int time2 = vSignals[sig].GetStart();
732  out << domId2 << ' ' << time2 << std::endl;
733  if ((domId1 != domId2) && (secondDom == false)) {
734  int timeDiff = time2 - time1;
735  if (domId1 > domId2) timeDiff *= -1;
736  fhDomDeltaT[domId1 + domId2 - 1]->Fill(timeDiff);
737  secondDom = true;
738  }
739  }
740  }
741  out.close();
742 }
743 
744 void
746 {
747  for (int dom1 = 0; dom1 < domNb - 1; ++dom1) {
748  for (int dom2 = dom1 + 1; dom2 < domNb; ++dom2) {
749  const int domHist = dom1 + dom2 - 1;
750  fhDomDeltaT[domHist]->SetStats(1111);
751  fhDomDeltaT[domHist]->SetTitle("");
752  fhDomDeltaT[domHist]->GetXaxis()->SetTitle("time [ns]");
753  fhDomDeltaT[domHist]->GetXaxis()->SetTitleOffset(1.4);
754  fhDomDeltaT[domHist]->GetXaxis()->CenterTitle();
755  fhDomDeltaT[domHist]->Draw();
756  fhDomDeltaT[domHist]->Write();
757  }
758  }
759 }
760 
761 
762 void
763 histo::InitCoincidenceRate(const std::vector<int>& vDomId)
764 {
765  char name[1024];
766  for (int dom = 0; dom < domNb; ++dom) {
767  sprintf(name, "fhCoincRate-dom%d", vDomId[dom]);
768  fhCoincRate[dom] = new TH1I(name, name, 92, 1.5, 93.5);
769  sprintf(name, "fcCoincRate-dom%d", vDomId[dom]);
770  fcCoincRate[dom] = new TCanvas(name, name, 800, 600);
771  }
772 }
773 
774 void
775 histo::FillCoincidenceRate(const std::vector<triggeredSignals>& vTrigger)
776 {
777  for (unsigned int i = 0; i < vTrigger.size(); ++i) {
778  /*
779  const std::vector<signals>& vSignals = vTrigger[i].GetSignals();
780  int prevId = -1;
781  bool omDif = false;
782  for (unsigned int j = 0; j < vSignals.size(); ++j) {
783  int curId = vSignals[j].GetDomId();
784  if (prevId != curId) omDif = true;
785  prevId = curId;
786  }
787  if ((vSignals.size() > 4) && (omDif == true)) {
788  std::cout << vSignals.size() << ' ';
789  for (unsigned int j = 0; j < vSignals.size(); ++j) {
790  const int domId = vSignals[j].GetDomId();
791  //const int domIndex = FindDomIndex(domId, vDomId);
792  std::cout << domId << ' ';
793  }
794  std::cout << std::endl;
795  }
796 
797  //std::cout << vTrigger[i].GetTriggeredPmt() << std::endl;
798  */
799  const int domId = vTrigger[i].GetSignals()[0].GetDomId();
800  fhCoincRate[domId]->Fill(vTrigger[i].GetTriggeredPmt());
801  }
802 }
803 
804 void
806 {
807  for (int dom = 0; dom < domNb; ++dom) {
808  fhCoincRate[dom]->SetTitle("");
809  fhCoincRate[dom]->GetXaxis()->SetTitle("number of pmts");
810  fhCoincRate[dom]->GetXaxis()->SetTitleOffset(1.4);
811  fhCoincRate[dom]->GetXaxis()->CenterTitle();
812  fhCoincRate[dom]->Draw();
813  fhCoincRate[dom]->Write();
814  }
815 }
816 
817 void
818 histo::InitEventPerSlice(const bool individualPmt, const std::vector<int>& vDomId)
819 {
820  for (int dom = 0; dom < domNb; ++ dom) {
821  char name[1024];
822  sprintf(name, "hEventPerSlice-dom%d", vDomId[dom]);
823  fhEventPerSlice[dom] = new TH1D(name, name, 15000, 0, 15000);
824  if (individualPmt == true) {
825  for (int pmt = 0; pmt < pmtNb; ++pmt) { sprintf(name, "hEventPerSlice-dom%d-pmt%d", vDomId[dom], pmt);
826  fhEventPerSlice2[dom][pmt] = new TH1D(name, name, 15000, 0, 15000);
827  }
828  }
829  }
830 }
831 
832 void
833 histo::FillEventPerSlice(const std::vector<dom>& domSample, const bool individualPmt,
834  const std::vector<int>& vDomId)
835 {
836  for (unsigned int e = 0; e < domSample.size(); ++e) {
837  if (domSample[e].HasPmtsData() == true) {
838  const std::vector<pmt>& pmtSample = domSample[e].GetPmtsData();
839  const int curDom = domSample[e].GetDomHeader().GetDomId();
840  const int curRank = FindDomIndex(curDom, vDomId);
841  if ((curRank >= 0) && (curRank < 3)) {
842  const double conversion = pow(2,27)*1e-9;
843  //const double conversion = 1;
844  for (unsigned int j = 0; j < pmtSample.size(); ++j) {
845  if (pmtSample[j].HasSignal() == true) {
846  fhEventPerSlice[curRank]->Fill(pmtSample[j].GetSignal().size()/conversion);
847  if (individualPmt == true) {
848  const int pmtid = pmtSample[j].GetPmtId();
849  fhEventPerSlice2[curRank][pmtid]->Fill(pmtSample[j].GetSignal().size()/conversion);
850  }
851  }
852  }
853  }
854  }
855  }
856 }
857 
858 void
859 histo::DrawEventPerSlice(const bool individualPmt, double cutValues[domNb][pmtNb], const std::vector<int>& vDomId)
860 {
861  TCanvas* cEventPerSlice3[domNb];
862  for (int dom = 0; dom < domNb; ++dom) {
863  char name[1024];
864  sprintf(name, "cEventPerSlice3-dom%d", vDomId[dom]);
865  cEventPerSlice3[dom] = new TCanvas(name, name, 800, 600);
866  cEventPerSlice3[dom]->Divide(8, 4);
867  for (int pmt = 0; pmt < pmtNb; ++pmt) {
868  if (individualPmt == true) {
869  cEventPerSlice3[dom]->cd(pmt + 1);
870  fhEventPerSlice2[dom][pmt]->SetStats(0);
871  fhEventPerSlice2[dom][pmt]->SetTitle("");
872  //fhEventPerSlice2[dom][pmt]->GetXaxis()->SetTitle("events per slice");
873  fhEventPerSlice2[dom][pmt]->GetXaxis()->SetTitle("frequency [Hz]");
874  fhEventPerSlice2[dom][pmt]->GetXaxis()->SetTitleOffset(1.4);
875  fhEventPerSlice2[dom][pmt]->GetXaxis()->CenterTitle();
876  cEventPerSlice3[dom]->SetLogy();
877  fhEventPerSlice2[dom][pmt]->Draw();
878  }
879  }
880  cEventPerSlice3[dom]->Write();
881  }
882  //for (int dom = 0; dom < domNb; ++dom) {
883  // cEventPerSlice3[dom]->Delete();
884  //}
885 
886  ofstream outTemp("EventPerSlice-MeanSigma-allRuns.dat", std::ios_base::app);
887  for (int dom = 0; dom < domNb; ++dom) {
888  char name[1024];
889  sprintf(name, "dom%d", vDomId[dom]);
890  fhEventPerSlice[dom]->SetTitle(name);
891  //fhEventPerSlice[dom]->GetXaxis()->SetTitle("events per slice");
892  fhEventPerSlice[dom]->GetXaxis()->SetTitle("frequency [Hz]");
893  fhEventPerSlice[dom]->GetXaxis()->SetTitleOffset(1.4);
894  fhEventPerSlice[dom]->GetXaxis()->CenterTitle();
895  const double maxHistoEvG = fhEventPerSlice[dom]->GetMaximumBin();
896  TF1* gaussFitG = new TF1("fitG", "gaus", maxHistoEvG - 800, maxHistoEvG);
897  fhEventPerSlice[dom]->Fit(gaussFitG, "RQ");
898  fhEventPerSlice[dom]->Draw();
899  fhEventPerSlice[dom]->Write();
900  const double cutG = maxHistoEvG + 3*gaussFitG->GetParameter(2);
901  const double conversion = pow(2,27)*1e-9;
902  //const double conversion = 1;
903  for (int pmt = 0; pmt < pmtNb; ++pmt) {
904  if (individualPmt == true) {
905  //fcEventPerSlice2[dom][pmt]->Update();
906  fhEventPerSlice2[dom][pmt]->SetStats(0);
907  fhEventPerSlice2[dom][pmt]->SetTitle("");
908  fhEventPerSlice2[dom][pmt]->GetXaxis()->SetTitle("frequency [Hz]");
909  fhEventPerSlice2[dom][pmt]->GetXaxis()->SetTitleOffset(1.4);
910  fhEventPerSlice2[dom][pmt]->GetXaxis()->CenterTitle();
911  //fcEventPerSlice2[dom][pmt]->SetLogy();
912  const double maxHistoEv = fhEventPerSlice2[dom][pmt]->GetMaximumBin();
913  TF1* gaussFit = new TF1("fit", "gaus", maxHistoEv - 800, maxHistoEv);
914  fhEventPerSlice2[dom][pmt]->Fit(gaussFit, "RQ");
915  const double cut = maxHistoEv + 3*gaussFit->GetParameter(2);
916  fhEventPerSlice2[dom][pmt]->Draw();
917  fhEventPerSlice2[dom][pmt]->Write();
918  //cutValues[dom][pmt] = cut;
919  if (cut < 1.0) cutValues[dom][pmt] = 4000;
920  else cutValues[dom][pmt] = cut*conversion;
921  //delete fhEventPerSlice2[dom][pmt];
922  //delete fcEventPerSlice2[dom][pmt];
923  TF1* gaussFit2 = new TF1("fit2", "gaus", maxHistoEv - 400, maxHistoEv + 400);
924  fhEventPerSlice2[dom][pmt]->Fit(gaussFit2, "RQ");
925  const double meanValue = gaussFit->GetParameter(1);
926  const double sigmaValue = gaussFit->GetParameter(2);
927  outTemp << fRunId << ' ' << dom << ' ' << pmt << ' ' << meanValue << ' ' << sigmaValue << std::endl;
928  } else {
929  cutValues[dom][pmt] = cutG*conversion;
930  }
931  }
932  //delete fhEventPerSlice[dom];
933  //delete fcEventPerSlice[dom];
934  //cutValues[dom][pmt] = cutG*conversion;
935  //vCuts.push_back(4000);
936  }
937  outTemp.close();
938 }
939 
940 void
941 histo::InitSliceTimeSeries(const std::vector<int>& vDomId)
942 {
943  char name[1024];
944  const double sliceDuration = 8*pow(2, 24);
945  const int binNb = 10000;
946  const double maxHisto = sliceDuration*binNb;
947  for (int dom = 0; dom < domNb; ++dom) {
948  sprintf(name, "hSliceTimeSeries-dom%d", vDomId[dom]);
949  fhSliceTimeSeries[dom] = new TH1D(name, name, binNb, 0, maxHisto);
950  sprintf(name, "cSliceTimeSeries-dom%d", vDomId[dom]);
951  fcSliceTimeSeries[dom] = new TCanvas(name, name, 800, 600);
952  }
953 }
954 
955 void
956 histo::FillSliceTimeSeries(const std::vector<dom>& domSample, const std::vector<int>& vDomId)
957 {
958  for (unsigned int slice = 0; slice < domSample.size(); ++slice) {
959  const double time = domSample[slice].GetDomHeader().GetDomTime();
960  const int domId = domSample[slice].GetDomHeader().GetDomId();
961  const int domIndex = FindDomIndex(domId, vDomId);
962  if ((domIndex >= 0) && (domIndex < 3))
963  fhSliceTimeSeries[domIndex]->Fill(time);
964  }
965 }
966 
967 
968 void
970 {
971  for (int dom = 0; dom < domNb; ++dom) {
972  fhSliceTimeSeries[dom]->SetTitle("");
973  fhSliceTimeSeries[dom]->GetXaxis()->SetTitle("time [ns]");
974  fhSliceTimeSeries[dom]->GetXaxis()->SetTitleOffset(1.4);
975  fhSliceTimeSeries[dom]->GetXaxis()->CenterTitle();
976  fhSliceTimeSeries[dom]->Draw();
977  fhSliceTimeSeries[dom]->Write();
978  }
979 }
980 
void DrawDuration()
draw the histo
Definition: histo.cc:79
void DrawDeltaT()
Definition: histo.cc:632
const int GetDomId() const
get the id of the dom sample
Definition: domHeader.h:59
void DrawSliceTimeSeries()
draw the slice time series histo.
Definition: histo.cc:969
organisation of the data - dom level
Definition: dom.h:35
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
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
const long long int GetStart() const
get the start time of the signal
Definition: signal.h:44
void DrawDurations()
draw the histo, one per pmt
Definition: histo.cc:188
Identify and fill the pmts with data.
Definition: pmt.h:34
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
void FillDomDeltaT(const std::vector< triggeredSignals > &vTrigger, const std::vector< int > &vDomId)
fill the time difference between all Dom neighbors
Definition: histo.cc:716
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 DrawDomDeltaT()
draw the histo
Definition: histo.cc:745
make the DOM trigger (coincidence between pmts)
define the pmt signal
Definition: signal.h:30
void DrawCoincidenceRate()
draw the coincidence rate histo.
Definition: histo.cc:805
const int GetDuration() const
get the duration of the signal
Definition: signal.h:48
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 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
Fill a dom header from a binary file.
Definition: domHeader.h:30
void InitCoincidenceRate(const std::vector< int > &vDomId)
initialize the coincidence rate histo.
Definition: histo.cc:763
const double conversion
Definition: constants.h:12
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
const long long int GetDomTime() const
get the time stamp of each dom sample
Definition: domHeader.h:67
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
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
void InitDurations(const std::vector< int > &vDomId)
initialize the duration histo (depends on the pmt id).
Definition: histo.cc:95