BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
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
7 : fVerbose(0)
9 , fDetName(det)
10 , fPeriod(period)
11 , fRun(run)
12{}
13
15
16void BmnAdcQA::SetAveragePedestal(UInt_t ser, Int_t ch, Int_t smpl, Int_t spill_id, Double_t content)
17{
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(
23 make_pair(AdcKey(ser, ch, smpl), std::make_unique<TH1D>(name, name, n_spills, 0, n_spills)));
24 it = p.first;
25 it->second->SetDirectory(0);
26 }
27 auto& h = it->second;
28 h->SetBinContent(spill_id, content);
29 printf("Pedestal serial %08X ch %2d smpl %3d spill %d %4.2f\n", ser, ch, smpl, spill_id, content);
30}
31
33{
34 TString file_name(Form("adc-per%02d-run%06d-%s.pdf", fPeriod, fRun, fDetName.Data()));
35 TCanvas* c = new TCanvas("can_pedestals", "can", PAD_WIDTH, PAD_HEIGHT);
36 c->Print(file_name + "[");
37 for (auto& it : fAdcHists) {
38 TH1* h = it.second.get();
39 // const char* name = h->GetName();
40 c->Clear("D");
41 c->cd();
42 h->Draw();
43 c->Print(file_name);
44 }
45 c->Print(file_name + "]");
46}
47
49{
50 // for (Int_t iCr = 0; iCr < fNSerials; ++iCr) {
51 // hPedSi[iCr]->Reset();
52 // hSModeSi[iCr]->Reset();
53 // hCModeSi[iCr]->Reset();
54 // for (Int_t iCh = 0; iCh < fNChannels; ++iCh) {
55 // hPedLine[iCr][iCh]->Reset();
56 // hSMode[iCr][iCh]->Reset();
57 // hCMode[iCr][iCh]->Reset();
58 // }
59 // }
60}
#define PAD_WIDTH
Definition BmnAdcQA.cxx:3
#define PAD_HEIGHT
Definition BmnAdcQA.cxx:4
int Int_t
unsigned int UInt_t
double Double_t
char * Form(const char *fmt,...)
@ kBMNSETUP
Definition BmnEnums.h:166
map< AdcKey, unique_ptr< TH1 > > fAdcHists
Definition BmnAdcQA.h:59
Int_t fPeriod
Definition BmnAdcQA.h:62
tuple< UInt_t, UInt_t, UInt_t > AdcKey
Definition BmnAdcQA.h:58
void SetAveragePedestal(UInt_t ser, Int_t ch, Int_t smpl, Int_t spill_id, Double_t content)
Definition BmnAdcQA.cxx:16
BmnAdcQA(Int_t period, Int_t run, TString det)
Definition BmnAdcQA.cxx:6
TString fDetName
Definition BmnAdcQA.h:61
void ClearDebugHists()
Definition BmnAdcQA.cxx:48
Int_t fRun
Definition BmnAdcQA.h:63
BmnSetup fSetup
Definition BmnAdcQA.h:46
virtual ~BmnAdcQA()
Definition BmnAdcQA.cxx:14
Int_t fVerbose
Definition BmnAdcQA.h:45
void SaveHists()
Definition BmnAdcQA.cxx:32
void Clear(Option_t *option="") override
TVirtualPad * cd(Int_t subpadnumber=0) override
void Draw(Option_t *option="") override
void Print(const char *filename, Option_t *option) override