BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
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
6
BmnAdcQA::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
14
BmnAdcQA::~BmnAdcQA
() {}
15
16
void
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
32
void
BmnAdcQA::SaveHists
()
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
48
void
BmnAdcQA::ClearDebugHists
()
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
}
PAD_WIDTH
#define PAD_WIDTH
Definition
BmnAdcQA.cxx:3
PAD_HEIGHT
#define PAD_HEIGHT
Definition
BmnAdcQA.cxx:4
Int_t
int Int_t
UInt_t
unsigned int UInt_t
Double_t
double Double_t
Form
char * Form(const char *fmt,...)
kBMNSETUP
@ kBMNSETUP
Definition
BmnEnums.h:166
BmnAdcQA::fAdcHists
map< AdcKey, unique_ptr< TH1 > > fAdcHists
Definition
BmnAdcQA.h:59
BmnAdcQA::fPeriod
Int_t fPeriod
Definition
BmnAdcQA.h:62
BmnAdcQA::AdcKey
tuple< UInt_t, UInt_t, UInt_t > AdcKey
Definition
BmnAdcQA.h:58
BmnAdcQA::SetAveragePedestal
void SetAveragePedestal(UInt_t ser, Int_t ch, Int_t smpl, Int_t spill_id, Double_t content)
Definition
BmnAdcQA.cxx:16
BmnAdcQA::BmnAdcQA
BmnAdcQA(Int_t period, Int_t run, TString det)
Definition
BmnAdcQA.cxx:6
BmnAdcQA::fDetName
TString fDetName
Definition
BmnAdcQA.h:61
BmnAdcQA::ClearDebugHists
void ClearDebugHists()
Definition
BmnAdcQA.cxx:48
BmnAdcQA::fRun
Int_t fRun
Definition
BmnAdcQA.h:63
BmnAdcQA::fSetup
BmnSetup fSetup
Definition
BmnAdcQA.h:46
BmnAdcQA::~BmnAdcQA
virtual ~BmnAdcQA()
Definition
BmnAdcQA.cxx:14
BmnAdcQA::fVerbose
Int_t fVerbose
Definition
BmnAdcQA.h:45
BmnAdcQA::SaveHists
void SaveHists()
Definition
BmnAdcQA.cxx:32
TCanvas
TCanvas::Clear
void Clear(Option_t *option="") override
TCanvas::cd
TVirtualPad * cd(Int_t subpadnumber=0) override
TH1
TH1::Draw
void Draw(Option_t *option="") override
TPad::Print
void Print(const char *filename, Option_t *option) override
TString
BmnAdcQA.h
decoder
BmnAdcQA.cxx
Generated on
for BmnRoot by
1.17.0