-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTV1720Histograms.cxx
140 lines (88 loc) · 2.99 KB
/
TV1720Histograms.cxx
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#include "TV1720Histograms.h"
#include "TDirectory.h"
/// Reset the histograms for this canvas
TV1720QSQLHistograms::TV1720QSQLHistograms(){
SetNumberChannelsInGroup(PSD_MAXNCHAN);
SetGroupName("Module");
SetChannelName("Channel");
CreateHistograms();
}
void TV1720QSQLHistograms::CreateHistograms(){
// check if we already have histograms.
char tname[100];
sprintf(tname,"V1720QSQL_%i_%i",0,0);
TH2F *tmp = (TH2F*)gDirectory->Get(tname);
if (tmp) return;
// Otherwise make histograms
clear();
for(int iBoard=0; iBoard<NDPPBOARDS; iBoard++){// Loop over V1720 boards
for(int i = 0; i < PSD_MAXNCHAN; i++){ // loop over 8 channels
char name[100];
char title[100];
sprintf(name,"V1720QSQL_%i_%i",iBoard,i);
sprintf(title,"V1720 qshort vs qlong (mod, ch = %i,%i)",iBoard,i);
TH2F *tmp = new TH2F(name,title,320,-20,40000,320,-20,30000);
tmp->SetDrawOption("colz");
tmp->SetXTitle("Q Long");
tmp->SetYTitle("Q Short");
push_back(tmp);
}
}
}
/// Update the histograms for this canvas
void TV1720QSQLHistograms::UpdateHistogram(int board, int chan, Float_t QS, Float_t QL){
int index = board*PSD_MAXNCHAN + chan;
GetHistogram(index)->Fill(QL,QS);
}
/// Take actions at begin run
void TV1720QSQLHistograms::BeginRun(int transition,int run,int time){
CreateHistograms();
}
/// Take actions at end run
void TV1720QSQLHistograms::EndRun(int transition,int run,int time){
}
/// Reset the histograms for this canvas
TV1720PSDQLHistograms::TV1720PSDQLHistograms(){
SetNumberChannelsInGroup(PSD_MAXNCHAN);
SetGroupName("Module");
SetChannelName("Channel");
CreateHistograms();
}
void TV1720PSDQLHistograms::CreateHistograms(){
// check if we already have histograms.
char tname[100];
sprintf(tname,"V1720PSDQL_%i_%i",0,0);
TH2F *tmp = (TH2F*)gDirectory->Get(tname);
if (tmp) return;
// Otherwise make histograms
clear();
for(int iBoard=0; iBoard<NDPPBOARDS; iBoard++){// Loop over V1720 boards
for(int i = 0; i < PSD_MAXNCHAN; i++){ // loop over 8 channels
char name[100];
char title[100];
sprintf(name,"V1720PSDQL_%i_%i",iBoard,i);
sprintf(title,"V1720 PSD vs qlong (mod, ch = %i,%i)",iBoard,i);
TH2F *tmp;
if(iBoard == 1 && i == 4)
tmp= new TH2F(name,title,200,-20,80000,200,-1,1);
else
tmp= new TH2F(name,title,200,-20,14000,200,-1,1);
tmp->SetDrawOption("colz");
tmp->SetXTitle("Q Long");
tmp->SetYTitle("PSD");
push_back(tmp);
}
}
}
/// Update the histograms for this canvas
void TV1720PSDQLHistograms::UpdateHistogram(int board, int chan, Float_t PSD, Float_t QL){
int index = board*PSD_MAXNCHAN + chan;
GetHistogram(index)->Fill(QL,PSD);
}
/// Take actions at begin run
void TV1720PSDQLHistograms::BeginRun(int transition,int run,int time){
CreateHistograms();
}
/// Take actions at end run
void TV1720PSDQLHistograms::EndRun(int transition,int run,int time){
}