BmnRoot
Loading...
Searching...
No Matches
BmnAdcQA.cxx
Go to the documentation of this file.
1#include "BmnAdcQA.h"
2
3#define PAD_WIDTH 1920
4#define PAD_HEIGHT 1920
5
6BmnAdcQA::BmnAdcQA(Int_t period, Int_t run, TString det)
7: fVerbose(0),
8 fSetup(kBMNSETUP),
9 fDetName(det),
10 fPeriod(period),
11 fRun(run)
12{}
13
16
17void BmnAdcQA::SetAveragePedestal(UInt_t ser, Int_t ch, Int_t smpl, Int_t spill_id, Double_t content) {
18 auto it = fAdcHists.find(AdcKey(ser, ch, smpl));
19 if (it == fAdcHists.end()) {
20 TString name(Form("Pedestal_serial_%08X_ch_%02d_smpl_%d", ser, ch, smpl));
21 const Int_t n_spills = 40;
22 auto p = fAdcHists.insert(make_pair(AdcKey(ser, ch, smpl), std::make_unique<TH1D>(name, name, n_spills, 0, n_spills)));
23 it = p.first;
24 it->second->SetDirectory(0);
25 }
26 auto& h = it->second;
27 h->SetBinContent(spill_id, content);
28 printf("Pedestal serial %08X ch %2d smpl %3d spill %d %4.2f\n", ser, ch, smpl, spill_id, content);
29}
30
32 TString file_name(Form("adc-per%02d-run%06d-%s.pdf", fPeriod, fRun, fDetName.Data()));
33 TCanvas *c = new TCanvas("can_pedestals", "can", PAD_WIDTH, PAD_HEIGHT);
34 c->Print(file_name + "[");
35 for (auto &it : fAdcHists) {
36 TH1 * h = it.second.get();
37 //const char* name = h->GetName();
38 c->Clear("D");
39 c->cd();
40 h->Draw();
41 c->Print(file_name);
42 }
43 c->Print(file_name + "]");
44}
45
47// for (Int_t iCr = 0; iCr < fNSerials; ++iCr) {
48// hPedSi[iCr]->Reset();
49// hSModeSi[iCr]->Reset();
50// hCModeSi[iCr]->Reset();
51// for (Int_t iCh = 0; iCh < fNChannels; ++iCh) {
52// hPedLine[iCr][iCh]->Reset();
53// hSMode[iCr][iCh]->Reset();
54// hCMode[iCr][iCh]->Reset();
55// }
56// }
57}
#define PAD_WIDTH
Definition BmnAdcQA.cxx:3
#define PAD_HEIGHT
Definition BmnAdcQA.cxx:4
@ kBMNSETUP
Definition BmnEnums.h:90
map< AdcKey, unique_ptr< TH1 > > fAdcHists
Definition BmnAdcQA.h:68
Int_t fPeriod
Definition BmnAdcQA.h:71
tuple< UInt_t, UInt_t, UInt_t > AdcKey
Definition BmnAdcQA.h:67
void SetAveragePedestal(UInt_t ser, Int_t ch, Int_t smpl, Int_t spill_id, Double_t content)
Definition BmnAdcQA.cxx:17
BmnAdcQA(Int_t period, Int_t run, TString det)
Definition BmnAdcQA.cxx:6
TString fDetName
Definition BmnAdcQA.h:70
void ClearDebugHists()
Definition BmnAdcQA.cxx:46
Int_t fRun
Definition BmnAdcQA.h:72
virtual ~BmnAdcQA()
Definition BmnAdcQA.cxx:14
void SaveHists()
Definition BmnAdcQA.cxx:31
-clang-format