-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckHex.C
61 lines (49 loc) · 1.76 KB
/
checkHex.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include "../lib.h"
// ----------------------- Modification Zone - begin -----------------------
// choose wafer
int wafer = 1;// 1: LD | 2: LD3 | 3: LD4 | 4: HD
// default wafer (LD)
TString WAFER = "LD";
TString TAG = "LD_0";
// general hex plot names without tags
TString HEX_adc_avg = "hex_adc_avg_zside0_plane1_u1_v1_";
TString HEX_channelId = "hex_channelId_zside0_plane1_u1_v1_";
// folder
TString folderName = "DQMData/Run 14140848/HGCAL/Run summary/Summary";
// ----------------------- Modification Zone - end -----------------------
void checkHex() {
// choose wafer
switch (wafer) {
case 1:
WAFER = "LD";
TAG = "LD_0";
break;
case 2:
WAFER = "LD3";
TAG = "LD_3";
break;
case 3:
WAFER = "LD4";
TAG = "LD_4";
break;
case 4:
WAFER = "HD";
TAG = "HD_0";
break;
}
TString inputfile = "../DQMplots/" + WAFER + "/DQM_V0001_HGCAL_R014140848.root";
TFile *input = new TFile( inputfile );
TDirectory *folder = (TDirectory*) input->Get( folderName );
// hex 1: adc_avg with wafer tag
TH2Poly *hexADC = (TH2Poly*) folder->Get( HEX_adc_avg + TAG );
hexADC->SetDirectory(0);
// hex 2: channelId with wafer tag
TH2Poly *hexChannelId = (TH2Poly*) folder->Get( HEX_channelId + TAG );
hexChannelId->SetDirectory(0);
for (int i = 0; i < 200; i++) {
float xADC = hexADC->GetBinContent(i);
float xChannelId = hexChannelId->GetBinContent(i);
float diff = xADC - xChannelId;
std::cout << "bin=" << i << ",\t adc_avg=" << xADC << ",\t channelId=" << xChannelId << ",\t adc_avg-channelId=" << diff << std::endl;
}
}