CbmRoot
CbmCheckDigisNbCorr.cxx
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 #include "CbmCheckDigisNbCorr.h"
9 
10 #include "CbmDigiManager.h"
11 #include "CbmMuchBeamTimeDigi.h"
12 #include "TimesliceMetaData.h"
13 
14 #include "FairLogger.h"
15 #include "FairRootManager.h"
16 #include "FairRunOnline.h"
17 
18 #include "TClonesArray.h"
19 #include "TH1.h"
20 #include "TH2.h"
21 #include "THttpServer.h"
22 #include "TProfile.h"
23 #include <TFile.h>
24 
25 #include "CbmMuchDigi.h"
26 #include "CbmRichDigi.h"
27 #include "CbmStsDigi.h"
28 #include "CbmTofDigi.h"
29 
30 #include <iomanip>
31 using std::fixed;
32 using std::setprecision;
33 
34 // ---- Default constructor -------------------------------------------
36  : FairTask("CbmCheckDigisNbCorr")
37  , fuMinTotPulserT0(90)
38  , fuMaxTotPulserT0(100)
39 
40 {}
41 
42 // ---- Destructor ----------------------------------------------------
44 
45 // ---- Initialisation ----------------------------------------------
47  // Load all necessary parameter containers from the runtime data base
48  /*
49  FairRunAna* ana = FairRunAna::Instance();
50  FairRuntimeDb* rtdb=ana->GetRuntimeDb();
51 
52  <CbmCheckDigisNbCorrDataMember> = (<ClassPointer>*)
53  (rtdb->getContainer("<ContainerName>"));
54  */
55 }
56 
57 // ---- Init ----------------------------------------------------------
59 
60  // Get a handle from the IO manager
61  FairRootManager* ioman = FairRootManager::Instance();
62 
63  // Get a pointer to the previous already existing data level
64  fTsMetaData =
65  static_cast<TClonesArray*>(ioman->GetObject("TimesliceMetaData"));
66  if (!fTsMetaData) { LOG(info) << "No TClonesArray with TS meta data found."; }
67  // DigiManager
69  fDigiMan->Init();
70 
71  // Get a pointer to the previous already existing data level
72  fT0DigiVec = ioman->InitObjectAs<std::vector<CbmTofDigi> const*>("T0Digi");
73  if (!fT0DigiVec) {
74  fT0DigiArr = dynamic_cast<TClonesArray*>(ioman->GetObject("T0Digi"));
75  if (!fT0DigiArr) { LOG(fatal) << "No TClonesArray with T0 digis found."; }
76  }
77 
79  LOG(info) << "No TClonesArray with STS digis found.";
80  }
81 
83  LOG(info) << "No TClonesArray with MUCH digis found.";
84  }
85 
87  LOG(info) << "No TClonesArray with TOF digis found.";
88  }
89 
91  LOG(info) << "No TClonesArray with RICH digis found.";
92  }
93 
94  CreateHistos();
95 
96  return kSUCCESS;
97 }
98 
101 }
102 
105  CalcNrBins();
106  fvuNbDigisPerBinT0.resize(fiBinNb, 0);
107  fvuNbDigisPerBinSts.resize(fiBinNb, 0);
108  fvuNbDigisPerBinMuch.resize(fiBinNb, 0);
109  fvuNbDigisPerBinTof.resize(fiBinNb, 0);
110  fvuNbDigisPerBinRich.resize(fiBinNb, 0);
111 
113  for (UInt_t uStsDpb = 0; uStsDpb < kuMaxNbStsDpbs; ++uStsDpb)
114  fvuNbDigisPerBinStsDpb[uStsDpb].resize(fiBinNb, 0);
115 
117  // T0 vs. TST
118  fT0StsCorr =
119  new TH2F("fT0StsCorr",
120  Form("T0 - STS digis Nb correlation per %.0f ns time interval; Nb "
121  "T0 Digis []; Nb STS Digis []; Counts",
122  fdBinWidthNs),
123  1000,
124  0,
125  1000,
126  1000,
127  0,
128  1000);
129  // T0 vs. MUCH
130  fT0MuchCorr =
131  new TH2F("fT0MuchCorr",
132  Form("T0 - MUCH digis Nb correlation per %.0f ns time interval; "
133  "Nb T0 Digis []; Nb MUCH Digis []; Counts",
134  fdBinWidthNs),
135  1000,
136  0,
137  1000,
138  1000,
139  0,
140  1000);
141  // T0 vs. TOF
142  fT0TofCorr =
143  new TH2F("fT0TofCorr",
144  Form("T0 - TOF digis Nb correlation per %.0f ns time interval; Nb "
145  "T0 Digis []; Nb TOF Digis []; Counts",
146  fdBinWidthNs),
147  1000,
148  0,
149  1000,
150  1000,
151  0,
152  1000);
153  // T0 vs. RICH
154  fT0RichCorr =
155  new TH2F("fT0RichCorr",
156  Form("T0 - RICH digis Nb correlation per %.0f ns time interval; "
157  "Nb T0 Digis []; Nb RICH Digis []; Counts",
158  fdBinWidthNs),
159  1000,
160  0,
161  1000,
162  1000,
163  0,
164  1000);
165 
166  // STS vs. MUCH
167  fStsMuchCorr =
168  new TH2F("fStsMuchCorr",
169  Form("STS - MUCH digis Nb correlation per %.0f ns time interval; "
170  "Nb STS Digis []; Nb STS Digis []; Counts",
171  fdBinWidthNs),
172  1000,
173  0,
174  1000,
175  1000,
176  0,
177  1000);
178  // STS vs. TOF
179  fStsTofCorr =
180  new TH2F("fStsTofCorr",
181  Form("STS - TOF digis Nb correlation per %.0f ns time interval; "
182  "Nb STS Digis []; Nb TOF Digis []; Counts",
183  fdBinWidthNs),
184  1000,
185  0,
186  1000,
187  1000,
188  0,
189  1000);
190  // STS vs. RICH
191  fStsRichCorr =
192  new TH2F("fStsRichCorr",
193  Form("STS - RICH digis Nb correlation per %.0f ns time interval; "
194  "Nb STS Digis []; Nb RICH Digis []; Counts",
195  fdBinWidthNs),
196  1000,
197  0,
198  1000,
199  1000,
200  0,
201  1000);
202 
203  // MUCH vs. TOF
204  fMuchTofCorr =
205  new TH2F("fMuchTofCorr",
206  Form("MUCH - TOF digis Nb correlation per %.0f ns time interval; "
207  "Nb MUCH Digis []; Nb TOF Digis []; Counts",
208  fdBinWidthNs),
209  1000,
210  0,
211  1000,
212  1000,
213  0,
214  1000);
215  // MUCH vs. RICH
216  fMuchRichCorr =
217  new TH2F("fMuchRichCorr",
218  Form("MUCH - RICH digis Nb correlation per %.0f ns time interval; "
219  "Nb MUCH Digis []; Nb RICH Digis []; Counts",
220  fdBinWidthNs),
221  1000,
222  0,
223  1000,
224  1000,
225  0,
226  1000);
227 
228  // TOF vs. RICH
229  fTofRichCorr =
230  new TH2F("fTofRichCorr",
231  Form("TOF - RICH digis Nb correlation per %.0f ns time interval; "
232  "Nb TOF Digis []; Nb RICH Digis []; Counts",
233  fdBinWidthNs),
234  1000,
235  0,
236  1000,
237  1000,
238  0,
239  1000);
240 
242  // T0 vs. TST
244  new TProfile("fT0StsCorrProf",
245  Form("T0 - STS digis Nb correlation per %.0f ns time "
246  "interval; Nb T0 Digis []; Nb STS Digis []",
247  fdBinWidthNs),
248  1000,
249  0,
250  1000);
251  // T0 vs. MUCH
253  new TProfile("fT0MuchCorrProf",
254  Form("T0 - MUCH digis Nb correlation per %.0f ns time "
255  "interval; Nb T0 Digis []; Nb MUCH Digis []",
256  fdBinWidthNs),
257  1000,
258  0,
259  1000);
260  // T0 vs. TOF
262  new TProfile("fT0TofCorrProf",
263  Form("T0 - TOF digis Nb correlation per %.0f ns time "
264  "interval; Nb T0 Digis []; Nb TOF Digis []",
265  fdBinWidthNs),
266  1000,
267  0,
268  1000);
269  // T0 vs. RICH
271  new TProfile("fT0RichCorrProf",
272  Form("T0 - RICH digis Nb correlation per %.0f ns time "
273  "interval; Nb T0 Digis []; Nb RICH Digis []",
274  fdBinWidthNs),
275  1000,
276  0,
277  1000);
278 
279  // STS vs. MUCH
281  new TProfile("fStsMuchCorrProf",
282  Form("STS - MUCH digis Nb correlation per %.0f ns time "
283  "interval; Nb STS Digis []; Nb STS Digis []",
284  fdBinWidthNs),
285  1000,
286  0,
287  1000);
288  // STS vs. TOF
290  new TProfile("fStsTofCorrProf",
291  Form("STS - TOF digis Nb correlation per %.0f ns time "
292  "interval; Nb STS Digis []; Nb TOF Digis []",
293  fdBinWidthNs),
294  1000,
295  0,
296  1000);
297  // STS vs. RICH
299  new TProfile("fStsRichCorrProf",
300  Form("STS - RICH digis Nb correlation per %.0f ns time "
301  "interval; Nb STS Digis []; Nb RICH Digis []",
302  fdBinWidthNs),
303  1000,
304  0,
305  1000);
306 
307  // MUCH vs. TOF
309  new TProfile("fMuchTofCorrProf",
310  Form("MUCH - TOF digis Nb correlation per %.0f ns time "
311  "interval; Nb MUCH Digis []; Nb TOF Digis []",
312  fdBinWidthNs),
313  1000,
314  0,
315  1000);
316  // MUCH vs. RICH
318  new TProfile("fMuchRichCorrProf",
319  Form("MUCH - RICH digis Nb correlation per %.0f ns time "
320  "interval; Nb MUCH Digis []; Nb RICH Digis []",
321  fdBinWidthNs),
322  1000,
323  0,
324  1000);
325 
326  // TOF vs. RICH
328  new TProfile("fTofRichCorrProf",
329  Form("TOF - RICH digis Nb correlation per %.0f ns time "
330  "interval; Nb TOF Digis []; Nb RICH Digis []",
331  fdBinWidthNs),
332  1000,
333  0,
334  1000);
335 
336  for (UInt_t uStsDpb = 0; uStsDpb < kuMaxNbStsDpbs; ++uStsDpb) {
337  fT0StsDpbCorr[uStsDpb] =
338  new TH2F(Form("fT0StsDpbCorr%02u", uStsDpb),
339  Form("T0 - STS digis Nb correlation per %.0f ns time interval, "
340  "DPB %02u; Nb T0 Digis []; Nb STS Digis []; Counts",
341  fdBinWidthNs,
342  uStsDpb),
343  1000,
344  0,
345  1000,
346  1000,
347  0,
348  1000);
349  fStsMuchDpbCorr[uStsDpb] = new TH2F(
350  Form("fStsMuchDpbCorr%02u", uStsDpb),
351  Form("STS - MUCH digis Nb correlation per %.0f ns time interval, DPB "
352  "%02u; Nb STS Digis []; Nb STS Digis []; Counts",
353  fdBinWidthNs,
354  uStsDpb),
355  1000,
356  0,
357  1000,
358  1000,
359  0,
360  1000);
361  fStsTofDpbCorr[uStsDpb] =
362  new TH2F(Form("fStsTofDpbCorr%02u", uStsDpb),
363  Form("STS - TOF digis Nb correlation per %.0f ns time interval, "
364  "DPB %02u; Nb STS Digis []; Nb TOF Digis []; Counts",
365  fdBinWidthNs,
366  uStsDpb),
367  1000,
368  0,
369  1000,
370  1000,
371  0,
372  1000);
373  fStsRichDpbCorr[uStsDpb] = new TH2F(
374  Form("fStsRichDpbCorr%02u", uStsDpb),
375  Form("STS - RICH digis Nb correlation per %.0f ns time interval, DPB "
376  "%02u; Nb STS Digis []; Nb RICH Digis []; Counts",
377  fdBinWidthNs,
378  uStsDpb),
379  1000,
380  0,
381  1000,
382  1000,
383  0,
384  1000);
385 
386  fT0StsDpbCorrProf[uStsDpb] =
387  new TProfile(Form("fT0StsDpbCorrProf%02u", uStsDpb),
388  Form("T0 - STS digis Nb correlation per %.0f ns time "
389  "interval, DPB %02u; Nb T0 Digis []; Nb STS Digis []",
390  fdBinWidthNs,
391  uStsDpb),
392  1000,
393  0,
394  1000);
395  fStsMuchDpbCorrProf[uStsDpb] =
396  new TProfile(Form("fStsMuchDpbCorrProf%02u", uStsDpb),
397  Form("STS - MUCH digis Nb correlation per %.0f ns time "
398  "interval, DPB %02u; Nb STS Digis []; Nb STS Digis []",
399  fdBinWidthNs,
400  uStsDpb),
401  1000,
402  0,
403  1000);
404  fStsTofDpbCorrProf[uStsDpb] =
405  new TProfile(Form("fStsTofDpbCorrProf%02u", uStsDpb),
406  Form("STS - TOF digis Nb correlation per %.0f ns time "
407  "interval, DPB %02u; Nb STS Digis []; Nb TOF Digis []",
408  fdBinWidthNs,
409  uStsDpb),
410  1000,
411  0,
412  1000);
413  fStsRichDpbCorrProf[uStsDpb] =
414  new TProfile(Form("fStsRichDpbCorrProf%02u", uStsDpb),
415  Form("STS - RICH digis Nb correlation per %.0f ns time "
416  "interval, DPB %02u; Nb STS Digis []; Nb RICH Digis []",
417  fdBinWidthNs,
418  uStsDpb),
419  1000,
420  0,
421  1000);
422  } // for( UInt_t uStsDpb = 0; uStsDpb < kuMaxNbStsDpbs; ++uStsDpb )
423 
425  FairRunOnline* run = FairRunOnline::Instance();
426  if (run) {
427  THttpServer* server = run->GetHttpServer();
428  if (nullptr != server) {
430  server->Register("CheckDigisNbCorr", fT0StsCorr);
431  server->Register("CheckDigisNbCorr", fT0MuchCorr);
432  server->Register("CheckDigisNbCorr", fT0TofCorr);
433  server->Register("CheckDigisNbCorr", fT0RichCorr);
434 
435  server->Register("CheckDigisNbCorr", fStsMuchCorr);
436  server->Register("CheckDigisNbCorr", fStsTofCorr);
437  server->Register("CheckDigisNbCorr", fStsRichCorr);
438 
439  server->Register("CheckDigisNbCorr", fMuchTofCorr);
440  server->Register("CheckDigisNbCorr", fMuchRichCorr);
441 
442  server->Register("CheckDigisNbCorr", fTofRichCorr);
443 
445  server->Register("CheckDigisNbCorr", fT0StsCorrProf);
446  server->Register("CheckDigisNbCorr", fT0MuchCorrProf);
447  server->Register("CheckDigisNbCorr", fT0TofCorrProf);
448  server->Register("CheckDigisNbCorr", fT0RichCorrProf);
449 
450  server->Register("CheckDigisNbCorr", fStsMuchCorrProf);
451  server->Register("CheckDigisNbCorr", fStsTofCorrProf);
452  server->Register("CheckDigisNbCorr", fStsRichCorrProf);
453 
454  server->Register("CheckDigisNbCorr", fMuchTofCorrProf);
455  server->Register("CheckDigisNbCorr", fMuchRichCorrProf);
456 
457  server->Register("CheckDigisNbCorr", fTofRichCorrProf);
458 
459  for (UInt_t uStsDpb = 0; uStsDpb < kuMaxNbStsDpbs; ++uStsDpb) {
460  server->Register("CheckDigisNbCorr", fT0StsDpbCorr[uStsDpb]);
461  server->Register("CheckDigisNbCorr", fStsMuchDpbCorr[uStsDpb]);
462  server->Register("CheckDigisNbCorr", fStsTofDpbCorr[uStsDpb]);
463  server->Register("CheckDigisNbCorr", fStsRichDpbCorr[uStsDpb]);
464 
465  server->Register("CheckDigisNbCorr", fT0StsDpbCorrProf[uStsDpb]);
466  server->Register("CheckDigisNbCorr", fStsMuchDpbCorrProf[uStsDpb]);
467  server->Register("CheckDigisNbCorr", fStsTofDpbCorrProf[uStsDpb]);
468  server->Register("CheckDigisNbCorr", fStsRichDpbCorrProf[uStsDpb]);
469  } // for( UInt_t uStsDpb = 0; uStsDpb < kuMaxNbStsDpbs; ++uStsDpb )
470  } // if( nullptr != server )
471  } // if (run)
472 }
473 // ---- ReInit -------------------------------------------------------
474 InitStatus CbmCheckDigisNbCorr::ReInit() { return kSUCCESS; }
475 
476 // ---- Exec ----------------------------------------------------------
477 void CbmCheckDigisNbCorr::Exec(Option_t* /*option*/) {
479  for (Int_t uBin = 0; uBin < fiBinNb; ++uBin) {
480  fvuNbDigisPerBinT0[uBin] = 0;
481  fvuNbDigisPerBinSts[uBin] = 0;
482  fvuNbDigisPerBinMuch[uBin] = 0;
483  fvuNbDigisPerBinTof[uBin] = 0;
484  fvuNbDigisPerBinRich[uBin] = 0;
485  for (UInt_t uStsDpb = 0; uStsDpb < kuMaxNbStsDpbs; ++uStsDpb)
486  fvuNbDigisPerBinStsDpb[uStsDpb][uBin] = 0;
487  } // for( UInt_t uBin = 0; uBin < fiBinNb; ++uBin )
488 
489  LOG(debug) << "executing TS " << fNrTs;
490  Double_t dTsStart = fNrTs * fdTsLengthNs + 20393267200. - fdTsLengthNs;
491  if (1 == fTsMetaData->GetEntriesFast())
492  dTsStart =
493  static_cast<TimesliceMetaData*>(fTsMetaData->At(0))->GetStartTime();
494 
495  LOG(debug) << "Begin";
496  Int_t nrT0Digis = -1;
497  if (fT0DigiVec)
498  nrT0Digis = fT0DigiVec->size();
499  else if (fT0DigiArr)
500  nrT0Digis = fT0DigiArr->GetEntriesFast();
501  Int_t nrStsDigis = fDigiMan->GetNofDigis(ECbmModuleId::kSts);
502  Int_t nrMuchDigis = fDigiMan->GetNofDigis(ECbmModuleId::kMuch);
503  Int_t nrTofDigis = fDigiMan->GetNofDigis(ECbmModuleId::kTof);
504  Int_t nrRichDigis = fDigiMan->GetNofDigis(ECbmModuleId::kRich);
505 
506  LOG(debug) << "T0Digis: " << nrT0Digis;
507  LOG(debug) << "StsDigis: " << nrStsDigis;
508  LOG(debug) << "MuchDigis: " << nrMuchDigis;
509  LOG(debug) << "TofDigis: " << nrTofDigis;
510  LOG(debug) << "RichDigis: " << nrRichDigis;
511 
514  for (Int_t iDigi = 0; iDigi < nrT0Digis; ++iDigi) {
515  const CbmTofDigi* pDigi = nullptr;
516  if (fT0DigiVec)
517  pDigi = &(fT0DigiVec->at(iDigi));
518  else if (fT0DigiArr)
519  pDigi = dynamic_cast<const CbmTofDigi*>(fT0DigiArr->At(iDigi));
520  assert(pDigi);
521 
523  if (fuMinTotPulserT0 < pDigi->GetCharge()
524  && pDigi->GetCharge() < fuMaxTotPulserT0)
525  continue;
526 
527  Double_t dTime = pDigi->GetTime() - dTsStart;
529  if (dTime < 0) continue;
531  if (fdTsLengthNs <= dTime) break;
532 
534  UInt_t uBin = dTime / fdBinWidthNs;
535  fvuNbDigisPerBinT0[uBin]++;
536  } // for( Int_t iDigi = 0; iDigi < nrT0Digis; ++iDigi )
537 
539  for (Int_t iDigi = 0; iDigi < nrStsDigis; ++iDigi) {
540  const CbmStsDigi* pDigi = fDigiMan->Get<CbmStsDigi>(iDigi);
541 
542  Double_t dTime = pDigi->GetTime() - dTsStart - fdStsOffset;
544  if (dTime < 0) continue;
546  if (fdTsLengthNs <= dTime) break;
547 
549  UInt_t uBin = dTime / fdBinWidthNs;
550  fvuNbDigisPerBinSts[uBin]++;
551 
552  UInt_t uDPB = (0 < (pDigi->GetAddress() & 0x00000400));
553  fvuNbDigisPerBinStsDpb[uDPB][uBin]++;
554  } // for( Int_t iDigi = 0; iDigi < nrStsDigis; ++iDigi )
555 
557  for (Int_t iDigi = 0; iDigi < nrMuchDigis; ++iDigi) {
558  const CbmMuchDigi* pDigi = fDigiMan->Get<CbmMuchDigi>(iDigi);
559 
560  Double_t dTime = pDigi->GetTime() - dTsStart - fdMuchOffset;
562  if (dTime < 0) continue;
564  if (fdTsLengthNs <= dTime) break;
565 
567  UInt_t uBin = dTime / fdBinWidthNs;
568  fvuNbDigisPerBinMuch[uBin]++;
569  } // for( Int_t iDigi = 0; iDigi < nrMuchDigis; ++iDigi )
570 
572  for (Int_t iDigi = 0; iDigi < nrTofDigis; ++iDigi) {
573  const CbmTofDigi* pDigi = fDigiMan->Get<CbmTofDigi>(iDigi);
574 
576  if (92 < pDigi->GetCharge() && pDigi->GetCharge() < 96) continue;
577 
578  Double_t dTime = pDigi->GetTime() - dTsStart - fdTofOffset;
580  if (dTime < 0) continue;
582  if (fdTsLengthNs <= dTime) break;
583 
585  UInt_t uBin = dTime / fdBinWidthNs;
586  fvuNbDigisPerBinTof[uBin]++;
587  } // for( Int_t iDigi = 0; iDigi < nrTofDigis; ++iDigi )
588 
590  for (Int_t iDigi = 0; iDigi < nrRichDigis; ++iDigi) {
591  const CbmRichDigi* pDigi = fDigiMan->Get<CbmRichDigi>(iDigi);
592 
593  Double_t dTime = pDigi->GetTime() - dTsStart - fdRichOffset;
595  if (dTime < 0) continue;
597  if (fdTsLengthNs <= dTime) break;
598 
600  UInt_t uBin = dTime / fdBinWidthNs;
601  fvuNbDigisPerBinRich[uBin]++;
602  } // for( Int_t iDigi = 0; iDigi < nrRichDigis; ++iDigi )
603 
605  for (Int_t uBin = 0; uBin < fiBinNb; ++uBin) {
607  if (0 < fvuNbDigisPerBinT0[uBin] || 0 < fvuNbDigisPerBinSts[uBin]) {
610  } // if( 0 < fvuNbDigisPerBinT0[ uBin ] || 0 < fvuNbDigisPerBinSts[ uBin ] )
611  if (0 < fvuNbDigisPerBinT0[uBin] || 0 < fvuNbDigisPerBinMuch[uBin]) {
614  fvuNbDigisPerBinMuch[uBin]);
615  } // if( 0 < fvuNbDigisPerBinT0[ uBin ] || 0 < fvuNbDigisPerBinMuch[ uBin ] )
616  if (0 < fvuNbDigisPerBinT0[uBin] || 0 < fvuNbDigisPerBinTof[uBin]) {
619  } // if( 0 < fvuNbDigisPerBinT0[ uBin ] || 0 < fvuNbDigisPerBinTof[ uBin ] )
620  if (0 < fvuNbDigisPerBinT0[uBin] || 0 < fvuNbDigisPerBinRich[uBin]) {
623  fvuNbDigisPerBinRich[uBin]);
624  } // if( 0 < fvuNbDigisPerBinT0[ uBin ] || 0 < fvuNbDigisPerBinRich[ uBin ] )
625 
626  if (0 < fvuNbDigisPerBinSts[uBin] || 0 < fvuNbDigisPerBinMuch[uBin]) {
629  fvuNbDigisPerBinMuch[uBin]);
630  } // if( 0 < fvuNbDigisPerBinSts[ uBin ] || 0 < fvuNbDigisPerBinMuch[ uBin ] )
631  if (0 < fvuNbDigisPerBinSts[uBin] || 0 < fvuNbDigisPerBinTof[uBin]) {
634  fvuNbDigisPerBinTof[uBin]);
635  } // if( 0 < fvuNbDigisPerBinSts[ uBin ] || 0 < fvuNbDigisPerBinTof[ uBin ] )
636  if (0 < fvuNbDigisPerBinSts[uBin] || 0 < fvuNbDigisPerBinRich[uBin]) {
639  fvuNbDigisPerBinRich[uBin]);
640  } // if( 0 < fvuNbDigisPerBinSts[ uBin ] || 0 < fvuNbDigisPerBinRich[ uBin ] )
641 
642  if (0 < fvuNbDigisPerBinMuch[uBin] || 0 < fvuNbDigisPerBinTof[uBin]) {
645  fvuNbDigisPerBinTof[uBin]);
646  } // if( 0 < fvuNbDigisPerBinMuch[ uBin ] || 0 < fvuNbDigisPerBinTof[ uBin ] )
647  if (0 < fvuNbDigisPerBinMuch[uBin] || 0 < fvuNbDigisPerBinRich[uBin]) {
649  fvuNbDigisPerBinRich[uBin]);
651  fvuNbDigisPerBinRich[uBin]);
652  } // if( 0 < fvuNbDigisPerBinMuch[ uBin ] || 0 < fvuNbDigisPerBinRich[ uBin ] )
653 
654  if (0 < fvuNbDigisPerBinTof[uBin] || 0 < fvuNbDigisPerBinRich[uBin]) {
657  fvuNbDigisPerBinRich[uBin]);
658  } // if( 0 < fvuNbDigisPerBinTof[ uBin ] || 0 < fvuNbDigisPerBinRich[ uBin ] )
659 
660  for (UInt_t uStsDpb = 0; uStsDpb < kuMaxNbStsDpbs; ++uStsDpb) {
661  if (0 < fvuNbDigisPerBinT0[uBin]
662  || 0 < fvuNbDigisPerBinStsDpb[uStsDpb][uBin]) {
663  fT0StsDpbCorr[uStsDpb]->Fill(fvuNbDigisPerBinT0[uBin],
664  fvuNbDigisPerBinStsDpb[uStsDpb][uBin]);
665  fT0StsDpbCorrProf[uStsDpb]->Fill(fvuNbDigisPerBinT0[uBin],
666  fvuNbDigisPerBinStsDpb[uStsDpb][uBin]);
667  } // if( 0 < fvuNbDigisPerBinT0[ uBin ] || 0 < fvuNbDigisPerBinStsDpb[uStsDpb][ uBin ] )
668 
669  if (0 < fvuNbDigisPerBinStsDpb[uStsDpb][uBin]
670  || 0 < fvuNbDigisPerBinMuch[uBin]) {
671  fStsMuchDpbCorr[uStsDpb]->Fill(fvuNbDigisPerBinStsDpb[uStsDpb][uBin],
672  fvuNbDigisPerBinMuch[uBin]);
673  fStsMuchDpbCorrProf[uStsDpb]->Fill(
674  fvuNbDigisPerBinStsDpb[uStsDpb][uBin], fvuNbDigisPerBinMuch[uBin]);
675  } // if( 0 < fvuNbDigisPerBinStsDpb[uStsDpb][ uBin ] || 0 < fvuNbDigisPerBinMuch[ uBin ] )
676  if (0 < fvuNbDigisPerBinStsDpb[uStsDpb][uBin]
677  || 0 < fvuNbDigisPerBinTof[uBin]) {
678  fStsTofDpbCorr[uStsDpb]->Fill(fvuNbDigisPerBinStsDpb[uStsDpb][uBin],
679  fvuNbDigisPerBinTof[uBin]);
680  fStsTofDpbCorrProf[uStsDpb]->Fill(fvuNbDigisPerBinStsDpb[uStsDpb][uBin],
681  fvuNbDigisPerBinTof[uBin]);
682  } // if( 0 < fvuNbDigisPerBinStsDpb[uStsDpb][ uBin ] || 0 < fvuNbDigisPerBinTof[ uBin ] )
683  if (0 < fvuNbDigisPerBinStsDpb[uStsDpb][uBin]
684  || 0 < fvuNbDigisPerBinRich[uBin]) {
685  fStsRichDpbCorr[uStsDpb]->Fill(fvuNbDigisPerBinStsDpb[uStsDpb][uBin],
686  fvuNbDigisPerBinRich[uBin]);
687  fStsRichDpbCorrProf[uStsDpb]->Fill(
688  fvuNbDigisPerBinStsDpb[uStsDpb][uBin], fvuNbDigisPerBinRich[uBin]);
689  } // if( 0 < fvuNbDigisPerBinStsDpb[uStsDpb][ uBin ] || 0 < fvuNbDigisPerBinRich[ uBin ] )
690  } // for( UInt_t uStsDpb = 0; uStsDpb < kuMaxNbStsDpbs; ++uStsDpb )
691  } // for( UInt_t uBin = 0; uBin < fiBinNb; ++uBin )
692 
693  fNrTs++;
694 }
695 
696 
697 // ---- Finish --------------------------------------------------------
699 
701  TFile* old = gFile;
702  TFile* outfile = TFile::Open(fOutFileName, "RECREATE");
703 
704 
706  fT0StsCorr->Write();
707  fT0MuchCorr->Write();
708  fT0TofCorr->Write();
709  fT0RichCorr->Write();
710  fStsMuchCorr->Write();
711  fStsTofCorr->Write();
712  fStsRichCorr->Write();
713  fMuchTofCorr->Write();
714  fMuchRichCorr->Write();
715  fTofRichCorr->Write();
716 
718  fT0StsCorrProf->Write();
719  fT0MuchCorrProf->Write();
720  fT0TofCorrProf->Write();
721  fT0RichCorrProf->Write();
722  fStsMuchCorrProf->Write();
723  fStsTofCorrProf->Write();
724  fStsRichCorrProf->Write();
725  fMuchTofCorrProf->Write();
726  fMuchRichCorrProf->Write();
727  fTofRichCorrProf->Write();
728 
729  for (UInt_t uStsDpb = 0; uStsDpb < kuMaxNbStsDpbs; ++uStsDpb) {
730  fT0StsDpbCorr[uStsDpb]->Write();
731  fStsMuchDpbCorr[uStsDpb]->Write();
732  fStsTofDpbCorr[uStsDpb]->Write();
733  fStsRichDpbCorr[uStsDpb]->Write();
734 
735  fT0StsDpbCorrProf[uStsDpb]->Write();
736  fStsMuchDpbCorrProf[uStsDpb]->Write();
737  fStsTofDpbCorrProf[uStsDpb]->Write();
738  fStsRichDpbCorrProf[uStsDpb]->Write();
739  } // for( UInt_t uStsDpb = 0; uStsDpb < kuMaxNbStsDpbs; ++uStsDpb )
740 
741  outfile->Close();
742  delete outfile;
743 
744  gFile = old;
745 }
746 
CbmCheckDigisNbCorr::CbmCheckDigisNbCorr
CbmCheckDigisNbCorr()
Definition: CbmCheckDigisNbCorr.cxx:35
CbmCheckDigisNbCorr::Exec
virtual void Exec(Option_t *)
Definition: CbmCheckDigisNbCorr.cxx:477
CbmCheckDigisNbCorr::fT0StsCorrProf
TProfile * fT0StsCorrProf
Definition: CbmCheckDigisNbCorr.h:136
CbmCheckDigisNbCorr::fdStsOffset
Double_t fdStsOffset
Definition: CbmCheckDigisNbCorr.h:106
CbmMuchDigi.h
CbmCheckDigisNbCorr::Init
virtual InitStatus Init()
Definition: CbmCheckDigisNbCorr.cxx:58
CbmMuchDigi::GetTime
virtual Double_t GetTime() const
Definition: CbmMuchDigi.h:78
CbmCheckDigisNbCorr::fT0DigiVec
const std::vector< CbmTofDigi > * fT0DigiVec
Interface to digi data.
Definition: CbmCheckDigisNbCorr.h:85
CbmCheckDigisNbCorr::fT0DigiArr
TClonesArray * fT0DigiArr
Definition: CbmCheckDigisNbCorr.h:86
CbmRichDigi
Definition: CbmRichDigi.h:25
CbmDigiManager::Init
InitStatus Init()
Initialisation.
Definition: CbmDigiManager.cxx:71
CbmCheckDigisNbCorr::fTofRichCorrProf
TProfile * fTofRichCorrProf
Definition: CbmCheckDigisNbCorr.h:148
CbmCheckDigisNbCorr::fStsRichCorrProf
TProfile * fStsRichCorrProf
Definition: CbmCheckDigisNbCorr.h:143
CbmCheckDigisNbCorr::fvuNbDigisPerBinT0
std::vector< UInt_t > fvuNbDigisPerBinT0
Definition: CbmCheckDigisNbCorr.h:116
TimesliceMetaData
Definition: TimesliceMetaData.h:11
CbmCheckDigisNbCorr::fT0RichCorr
TH2 * fT0RichCorr
Definition: CbmCheckDigisNbCorr.h:125
CbmCheckDigisNbCorr::CalcNrBins
void CalcNrBins()
Definition: CbmCheckDigisNbCorr.cxx:99
CbmDigiManager::GetNofDigis
static Int_t GetNofDigis(ECbmModuleId systemId)
Definition: CbmDigiManager.cxx:62
CbmCheckDigisNbCorr::fdTsLengthNs
Double_t fdTsLengthNs
Definition: CbmCheckDigisNbCorr.h:111
CbmCheckDigisNbCorr::fTsMetaData
TClonesArray * fTsMetaData
Definition: CbmCheckDigisNbCorr.h:82
CbmCheckDigisNbCorr::fvuNbDigisPerBinMuch
std::vector< UInt_t > fvuNbDigisPerBinMuch
Definition: CbmCheckDigisNbCorr.h:118
CbmTofDigi.h
ECbmModuleId::kTof
@ kTof
Time-of-flight Detector.
CbmCheckDigisNbCorr::fT0StsDpbCorrProf
TProfile * fT0StsDpbCorrProf[kuMaxNbStsDpbs]
Definition: CbmCheckDigisNbCorr.h:156
CbmCheckDigisNbCorr::fMuchTofCorr
TH2 * fMuchTofCorr
Definition: CbmCheckDigisNbCorr.h:131
CbmCheckDigisNbCorr::fMuchTofCorrProf
TProfile * fMuchTofCorrProf
Definition: CbmCheckDigisNbCorr.h:145
CbmDigiManager::IsPresent
static Bool_t IsPresent(ECbmModuleId systemId)
Presence of a digi branch.
Definition: CbmDigiManager.cxx:112
CbmDigiManager::Instance
static CbmDigiManager * Instance()
Static instance.
Definition: CbmDigiManager.h:93
CbmCheckDigisNbCorr
Definition: CbmCheckDigisNbCorr.h:23
CbmRichDigi.h
CbmCheckDigisNbCorr::~CbmCheckDigisNbCorr
~CbmCheckDigisNbCorr()
Definition: CbmCheckDigisNbCorr.cxx:43
CbmCheckDigisNbCorr::fStsTofCorr
TH2 * fStsTofCorr
Definition: CbmCheckDigisNbCorr.h:128
CbmStsDigi.h
CbmCheckDigisNbCorr::fT0MuchCorrProf
TProfile * fT0MuchCorrProf
Definition: CbmCheckDigisNbCorr.h:137
CbmCheckDigisNbCorr::fStsTofDpbCorrProf
TProfile * fStsTofDpbCorrProf[kuMaxNbStsDpbs]
Definition: CbmCheckDigisNbCorr.h:158
CbmRichDigi::GetTime
Double_t GetTime() const
Definition: CbmRichDigi.h:61
CbmCheckDigisNbCorr::fuMaxTotPulserT0
UInt_t fuMaxTotPulserT0
Definition: CbmCheckDigisNbCorr.h:90
CbmCheckDigisNbCorr::fdMuchOffset
Double_t fdMuchOffset
Definition: CbmCheckDigisNbCorr.h:107
CbmDigiManager::Get
const Digi * Get(Int_t index) const
Get a digi object.
Definition: CbmDigiManager.h:52
CbmCheckDigisNbCorr::fdBinWidthNs
Double_t fdBinWidthNs
Definition: CbmCheckDigisNbCorr.h:112
CbmStsDigi::GetTime
Double_t GetTime() const
Definition: CbmStsDigi.h:83
CbmCheckDigisNbCorr::fDigiMan
CbmDigiManager * fDigiMan
Definition: CbmCheckDigisNbCorr.h:83
CbmMuchBeamTimeDigi.h
CbmCheckDigisNbCorr::fStsRichDpbCorrProf
TProfile * fStsRichDpbCorrProf[kuMaxNbStsDpbs]
Definition: CbmCheckDigisNbCorr.h:159
CbmCheckDigisNbCorr::fStsRichDpbCorr
TH2 * fStsRichDpbCorr[kuMaxNbStsDpbs]
Definition: CbmCheckDigisNbCorr.h:155
CbmTofDigi::GetTime
Double_t GetTime() const
Inherited from CbmDigi.
Definition: CbmTofDigi.h:111
CbmCheckDigisNbCorr::fMuchRichCorr
TH2 * fMuchRichCorr
Definition: CbmCheckDigisNbCorr.h:132
ECbmModuleId::kRich
@ kRich
Ring-Imaging Cherenkov Detector.
CbmCheckDigisNbCorr::fStsRichCorr
TH2 * fStsRichCorr
Definition: CbmCheckDigisNbCorr.h:129
ClassImp
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Definition: CbmConverterManager.cxx:12
CbmCheckDigisNbCorr::Finish
virtual void Finish()
Definition: CbmCheckDigisNbCorr.cxx:698
CbmCheckDigisNbCorr::fNrTs
Int_t fNrTs
Definition: CbmCheckDigisNbCorr.h:93
CbmCheckDigisNbCorr::ReInit
virtual InitStatus ReInit()
Definition: CbmCheckDigisNbCorr.cxx:474
CbmStsDigi
Data class for a single-channel message in the STS.
Definition: CbmStsDigi.h:29
CbmCheckDigisNbCorr::fT0StsDpbCorr
TH2 * fT0StsDpbCorr[kuMaxNbStsDpbs]
Definition: CbmCheckDigisNbCorr.h:152
CbmCheckDigisNbCorr::fvuNbDigisPerBinTof
std::vector< UInt_t > fvuNbDigisPerBinTof
Definition: CbmCheckDigisNbCorr.h:119
CbmCheckDigisNbCorr::fdTofOffset
Double_t fdTofOffset
Definition: CbmCheckDigisNbCorr.h:108
CbmTofDigi
Data class for expanded digital TOF information.
Definition: CbmTofDigi.h:38
CbmCheckDigisNbCorr::fT0RichCorrProf
TProfile * fT0RichCorrProf
Definition: CbmCheckDigisNbCorr.h:139
CbmMuchDigi
Definition: CbmMuchDigi.h:31
CbmStsDigi::GetAddress
Int_t GetAddress() const
Definition: CbmStsDigi.h:53
CbmCheckDigisNbCorr::fStsMuchCorr
TH2 * fStsMuchCorr
Definition: CbmCheckDigisNbCorr.h:127
CbmCheckDigisNbCorr::SetParContainers
virtual void SetParContainers()
Definition: CbmCheckDigisNbCorr.cxx:46
CbmCheckDigisNbCorr::fvuNbDigisPerBinSts
std::vector< UInt_t > fvuNbDigisPerBinSts
Definition: CbmCheckDigisNbCorr.h:117
CbmCheckDigisNbCorr::fT0TofCorr
TH2 * fT0TofCorr
Definition: CbmCheckDigisNbCorr.h:124
CbmCheckDigisNbCorr::fdRichOffset
Double_t fdRichOffset
Definition: CbmCheckDigisNbCorr.h:109
CbmDigiManager.h
CbmCheckDigisNbCorr::fvuNbDigisPerBinRich
std::vector< UInt_t > fvuNbDigisPerBinRich
Definition: CbmCheckDigisNbCorr.h:120
CbmCheckDigisNbCorr::fStsMuchCorrProf
TProfile * fStsMuchCorrProf
Definition: CbmCheckDigisNbCorr.h:141
CbmCheckDigisNbCorr::fStsMuchDpbCorr
TH2 * fStsMuchDpbCorr[kuMaxNbStsDpbs]
Definition: CbmCheckDigisNbCorr.h:153
CbmCheckDigisNbCorr::CreateHistos
void CreateHistos()
Definition: CbmCheckDigisNbCorr.cxx:103
CbmCheckDigisNbCorr::fiBinNb
Int_t fiBinNb
Definition: CbmCheckDigisNbCorr.h:113
CbmCheckDigisNbCorr::kuMaxNbStsDpbs
static const UInt_t kuMaxNbStsDpbs
Definition: CbmCheckDigisNbCorr.h:150
CbmCheckDigisNbCorr::fT0StsCorr
TH2 * fT0StsCorr
Definition: CbmCheckDigisNbCorr.h:122
CbmCheckDigisNbCorr::fOutFileName
TString fOutFileName
Definition: CbmCheckDigisNbCorr.h:165
ECbmModuleId::kMuch
@ kMuch
Muon detection system.
CbmCheckDigisNbCorr::fvuNbDigisPerBinStsDpb
std::vector< std::vector< UInt_t > > fvuNbDigisPerBinStsDpb
Definition: CbmCheckDigisNbCorr.h:151
TimesliceMetaData.h
CbmCheckDigisNbCorr::fStsTofDpbCorr
TH2 * fStsTofDpbCorr[kuMaxNbStsDpbs]
Definition: CbmCheckDigisNbCorr.h:154
CbmCheckDigisNbCorr::fMuchRichCorrProf
TProfile * fMuchRichCorrProf
Definition: CbmCheckDigisNbCorr.h:146
CbmCheckDigisNbCorr.h
CbmCheckDigisNbCorr::fT0MuchCorr
TH2 * fT0MuchCorr
Definition: CbmCheckDigisNbCorr.h:123
CbmTofDigi::GetCharge
Double_t GetCharge() const
Inherited from CbmDigi.
Definition: CbmTofDigi.h:116
ECbmModuleId::kSts
@ kSts
Silicon Tracking System.
CbmCheckDigisNbCorr::fStsMuchDpbCorrProf
TProfile * fStsMuchDpbCorrProf[kuMaxNbStsDpbs]
Definition: CbmCheckDigisNbCorr.h:157
CbmCheckDigisNbCorr::WriteHistos
void WriteHistos()
Definition: CbmCheckDigisNbCorr.cxx:700
CbmCheckDigisNbCorr::fT0TofCorrProf
TProfile * fT0TofCorrProf
Definition: CbmCheckDigisNbCorr.h:138
CbmCheckDigisNbCorr::fStsTofCorrProf
TProfile * fStsTofCorrProf
Definition: CbmCheckDigisNbCorr.h:142
CbmCheckDigisNbCorr::fTofRichCorr
TH2 * fTofRichCorr
Definition: CbmCheckDigisNbCorr.h:134