File: | plugins/monitoring/CDC_roc_hits/JEventProcessor_CDC_roc_hits.cc |
Location: | line 184, column 5 |
Description: | Value stored to 'netamp' is never read |
1 | // $Id$ |
2 | // |
3 | // File: JEventProcessor_CDC_roc_hits.cc |
4 | // Created: 18 May 2015 |
5 | // Creator: Naomi Jarvis |
6 | // |
7 | // Plot channel number vs slot for any hit in each roc |
8 | // Useful to see which channels are very noisy, or dead |
9 | // Same purpose as occupancy, but organized by roc & slot for easier diagnostics |
10 | // Prints list of suspicious channels |
11 | // |
12 | // eg hd_root /raid12/gluex/rawdata2/Run003797/hd_rawdata_003797_000.evio -PPLUGINS=CDC_roc_hits -PEVIO:F125_FDC_WE=80 -PEVIO:F125_PI_EMULATION_MODE=0 -PEVIO:F125_CDC_WE=80 -o run3797.root |
13 | // |
14 | |
15 | |
16 | #include <stdint.h> |
17 | #include <vector> |
18 | #include <stdio.h> |
19 | |
20 | #include "JEventProcessor_CDC_roc_hits.h" |
21 | #include <JANA/JApplication.h> |
22 | |
23 | using namespace std; |
24 | using namespace jana; |
25 | |
26 | |
27 | |
28 | |
29 | //---------------------------------------------------------------------------------- |
30 | |
31 | |
32 | // Routine used to create our JEventProcessor |
33 | extern "C"{ |
34 | void InitPlugin(JApplication *app){ |
35 | InitJANAPlugin(app); |
36 | app->AddProcessor(new JEventProcessor_CDC_roc_hits()); |
37 | } |
38 | } |
39 | |
40 | |
41 | //---------------------------------------------------------------------------------- |
42 | |
43 | |
44 | JEventProcessor_CDC_roc_hits::JEventProcessor_CDC_roc_hits() { |
45 | } |
46 | |
47 | |
48 | //---------------------------------------------------------------------------------- |
49 | |
50 | |
51 | JEventProcessor_CDC_roc_hits::~JEventProcessor_CDC_roc_hits() { |
52 | } |
53 | |
54 | |
55 | //---------------------------------------------------------------------------------- |
56 | |
57 | jerror_t JEventProcessor_CDC_roc_hits::init(void) { |
58 | |
59 | japp->RootWriteLock(); //ACQUIRE ROOT LOCK!! |
60 | |
61 | |
62 | TSTART = 200; |
63 | TSTOP = 1200; |
64 | |
65 | if (gPARMS) { |
66 | gPARMS->SetDefaultParameter("CDC_ROC_HITS:TSTART",TSTART); |
67 | gPARMS->SetDefaultParameter("CDC_ROC_HITS:TSTOP",TSTOP); |
68 | } |
69 | |
70 | // create root folder for cdc and cd to it, store main dir |
71 | TDirectory *main = gDirectory(ROOT::Internal::TDirectoryAtomicAdapter(TDirectory::CurrentDirectory ())); |
72 | gDirectory(ROOT::Internal::TDirectoryAtomicAdapter(TDirectory::CurrentDirectory ()))->mkdir("CDC_roc_hits")->cd(); |
73 | |
74 | // book histograms |
75 | cdc_nevents = new TH1I("cdc_nevents","CDC number of events",1, 0.5, 1.5); |
76 | cdc_hits_roc25 = new TH2D("cdc_hits_roc25","CDC hits in ROC 25, channel vs slot;slot;channel",15,2.5,17.5,72,0.5,72.5); |
77 | cdc_hits_roc26 = new TH2D("cdc_hits_roc26","CDC hits in ROC 26, channel vs slot;slot;channel",14,2.5,16.5,72,0.5,72.5); |
78 | cdc_hits_roc27 = new TH2D("cdc_hits_roc27","CDC hits in ROC 27, channel vs slot;slot;channel",14,2.5,16.5,72,0.5,72.5); |
79 | cdc_hits_roc28 = new TH2D("cdc_hits_roc28","CDC hits in ROC 28, channel vs slot;slot;channel",15,2.5,17.5,72,0.5,72.5); |
80 | |
81 | cdc_sumamp_roc25 = new TH1D("cdc_sumamp_roc25","CDC pulse peak amplitude summed for ROC 25;pulse peak (ADC units)",4096,0,4096); |
82 | cdc_sumamp_roc26 = new TH1D("cdc_sumamp_roc26","CDC pulse peak amplitude summed for ROC 26;pulse peak (ADC units)",4096,0,4096); |
83 | cdc_sumamp_roc27 = new TH1D("cdc_sumamp_roc27","CDC pulse peak amplitude summed for ROC 27;pulse peak (ADC units)",4096,0,4096); |
84 | cdc_sumamp_roc28 = new TH1D("cdc_sumamp_roc28","CDC pulse peak amplitude summed for ROC 28;pulse peak (ADC units)",4096,0,4096); |
85 | |
86 | cdc_amp_roc25 = new TH2D("cdc_amp_roc25","CDC pulse peak amplitude in ROC 25;slot*100+channel;pulse peak (ADC units)",1600,200,1800,4096,0,4096); |
87 | cdc_amp_roc26 = new TH2D("cdc_amp_roc26","CDC pulse peak amplitude in ROC 26;slot*100+channel;pulse peak (ADC units)",1600,200,1800,4096,0,4096); |
88 | cdc_amp_roc27 = new TH2D("cdc_amp_roc27","CDC pulse peak amplitude in ROC 27;slot*100+channel;pulse peak (ADC units)",1600,200,1800,4096,0,4096); |
89 | cdc_amp_roc28 = new TH2D("cdc_amp_roc28","CDC pulse peak amplitude in ROC 28;slot*100+channel;pulse peak (ADC units)",1600,200,1800,4096,0,4096); |
90 | |
91 | cdc_netamp_roc25 = new TH2D("cdc_netamp_roc25","CDC pulse peak amplitude minus pedestal in ROC 25;slot*100+channel;pulse peak minus pedestal (ADC units)",1600,200,1800,4096,0,4096); |
92 | cdc_netamp_roc26 = new TH2D("cdc_netamp_roc26","CDC pulse peak amplitude minus pedestal in ROC 26;slot*100+channel;pulse peak minus pedestal (ADC units)",1600,200,1800,4096,0,4096); |
93 | cdc_netamp_roc27 = new TH2D("cdc_netamp_roc27","CDC pulse peak amplitude minus pedestal in ROC 27;slot*100+channel;pulse peak minus pedestal (ADC units)",1600,200,1800,4096,0,4096); |
94 | cdc_netamp_roc28 = new TH2D("cdc_netamp_roc28","CDC pulse peak amplitude minus pedestal in ROC 28;slot*100+channel;pulse peak minus pedestal (ADC units)",1600,200,1800,4096,0,4096); |
95 | |
96 | cdc_time_roc25 = new TH2D("cdc_time_roc25","CDC pulse time in ROC 25;slot*100+channel;time (0.8ns)",1600,200,1800,1000,0,2000); |
97 | cdc_time_roc26 = new TH2D("cdc_time_roc26","CDC pulse time in ROC 26;slot*100+channel;time (0.8ns)",1600,200,1800,1000,0,2000); |
98 | cdc_time_roc27 = new TH2D("cdc_time_roc27","CDC pulse time in ROC 27;slot*100+channel;time (0.8ns)",1600,200,1800,1000,0,2000); |
99 | cdc_time_roc28 = new TH2D("cdc_time_roc28","CDC pulse time in ROC 28;slot*100+channel;time (0.8ns)",1600,200,1800,1000,0,2000); |
100 | |
101 | cdc_ped_roc25 = new TH2D("cdc_ped_roc25","CDC pedestal in ROC 25;slot*100+channel;pedestal",1600,200,1800,255,0,255); |
102 | cdc_ped_roc26 = new TH2D("cdc_ped_roc26","CDC pedestal in ROC 26;slot*100+channel;pedestal",1600,200,1800,255,0,255); |
103 | cdc_ped_roc27 = new TH2D("cdc_ped_roc27","CDC pedestal in ROC 27;slot*100+channel;pedestal",1600,200,1800,255,0,255); |
104 | cdc_ped_roc28 = new TH2D("cdc_ped_roc28","CDC pedestal in ROC 28;slot*100+channel;pedestal",1600,200,1800,255,0,255); |
105 | |
106 | |
107 | cdc_time_selected = new TH1D("cdc_time_selected","CDC pulse time selected for amp_t histograms;time (0.8ns)",1000,0,2000); |
108 | |
109 | cdc_sumamp_t_roc25 = new TH1D("cdc_sumamp_t_roc25","CDC pulse peak amplitude summed for ROC 25 with time cut;pulse peak (ADC units)",4096,0,4096); |
110 | cdc_sumamp_t_roc26 = new TH1D("cdc_sumamp_t_roc26","CDC pulse peak amplitude summed for ROC 26 with time cut; pulse peak (ADC units)",4096,0,4096); |
111 | cdc_sumamp_t_roc27 = new TH1D("cdc_sumamp_t_roc27","CDC pulse peak amplitude summed for ROC 27 with time cut; pulse peak (ADC units)",4096,0,4096); |
112 | cdc_sumamp_t_roc28 = new TH1D("cdc_sumamp_t_roc28","CDC pulse peak amplitude summed for ROC 28 with time cut; pulse peak (ADC units)",4096,0,4096); |
113 | |
114 | cdc_amp_t_roc25 = new TH2D("cdc_amp_t_roc25","CDC pulse peak amplitude in ROC 25 with time cut;slot*100+channel; pulse peak (ADC units)",1600,200,1800,4096,0,4096); |
115 | cdc_amp_t_roc26 = new TH2D("cdc_amp_t_roc26","CDC pulse peak amplitude in ROC 26 with time cut;slot*100+channel; pulse peak (ADC units)",1600,200,1800,4096,0,4096); |
116 | cdc_amp_t_roc27 = new TH2D("cdc_amp_t_roc27","CDC pulse peak amplitude in ROC 27 with time cut;slot*100+channel; pulse peak (ADC units)",1600,200,1800,4096,0,4096); |
117 | cdc_amp_t_roc28 = new TH2D("cdc_amp_t_roc28","CDC pulse peak amplitude in ROC 28 with time cut;slot*100+channel; pulse peak (ADC units)",1600,200,1800,4096,0,4096); |
118 | |
119 | |
120 | main->cd(); |
121 | |
122 | japp->RootUnLock(); //RELEASE ROOT LOCK!! |
123 | |
124 | |
125 | return NOERROR; |
126 | } |
127 | |
128 | |
129 | //---------------------------------------------------------------------------------- |
130 | |
131 | |
132 | jerror_t JEventProcessor_CDC_roc_hits::brun(JEventLoop *eventLoop, int32_t runnumber) { |
133 | // This is called whenever the run number changes |
134 | return NOERROR; |
135 | } |
136 | |
137 | |
138 | //---------------------------------------------------------------------------------- |
139 | |
140 | |
141 | jerror_t JEventProcessor_CDC_roc_hits::evnt(JEventLoop *eventLoop, uint64_t eventnumber) { |
142 | // This is called for every event. Use of common resources like writing |
143 | // to a file or filling a histogram should be mutex protected. Using |
144 | // loop-Get(...) to get reconstructed objects (and thereby activating the |
145 | // reconstruction algorithm) should be done outside of any mutex lock |
146 | // since multiple threads may call this method at the same time. |
147 | |
148 | |
149 | uint32_t rocid; |
150 | uint32_t slot; |
151 | uint32_t channel; |
152 | uint32_t amp; |
153 | uint32_t ped; |
154 | uint32_t time; |
155 | uint32_t qf; |
156 | |
157 | int netamp; // amp - pedestal |
158 | |
159 | // default scaling factors will be overridden by Df125Config if present |
160 | uint16_t ASCALE = 8; //amplitude |
161 | uint16_t PSCALE = 1; //ped |
162 | |
163 | |
164 | // get raw data for cdc |
165 | vector<const DCDCDigiHit*> digihits; |
166 | eventLoop->Get(digihits); |
167 | |
168 | japp->RootWriteLock(); //ACQUIRE ROOT LOCK!! |
169 | |
170 | if(digihits.size() > 0) cdc_nevents->Fill(1); |
171 | |
172 | |
173 | for(uint32_t i=0; i<digihits.size(); i++) { |
174 | |
175 | const DCDCDigiHit *digihit = digihits[i]; |
176 | |
177 | rocid = 0; |
178 | slot = 0; |
179 | channel = 0; |
180 | amp = 0; |
181 | ped = 0; |
182 | time = 0; |
183 | qf = 0; |
184 | netamp = 0; |
Value stored to 'netamp' is never read | |
185 | |
186 | const Df125PulseIntegral *pi = NULL__null; |
187 | digihit->GetSingle(pi); |
188 | |
189 | if (pi) { |
190 | rocid = pi->rocid; |
191 | slot = pi->slot; |
192 | channel = pi->channel; |
193 | } |
194 | |
195 | const Df125PulsePedestal *pp = NULL__null; |
196 | digihit->GetSingle(pp); |
197 | |
198 | if (pp) amp = pp->pulse_peak; |
199 | |
200 | const Df125CDCPulse *cp = NULL__null; |
201 | digihit->GetSingle(cp); |
202 | |
203 | if (cp) { |
204 | rocid = cp->rocid; |
205 | slot = cp->slot; |
206 | channel = cp->channel; |
207 | amp = cp->first_max_amp; |
208 | ped = cp->pedestal; |
209 | time = cp->le_time; |
210 | qf = cp->time_quality_bit; |
211 | // printf("cp amp %i\n",amp); |
212 | |
213 | const Df125Config *cf = NULL__null; |
214 | |
215 | cp->GetSingle(cf); |
216 | if (cf) { |
217 | ASCALE = 1<<cf->ABIT; |
218 | PSCALE = 1<<cf->PBIT; |
219 | } |
220 | |
221 | |
222 | } |
223 | |
224 | |
225 | netamp = ASCALE*amp - PSCALE*ped; |
226 | |
227 | |
228 | |
229 | if (!rocid) continue; |
230 | |
231 | if (rocid == 25) cdc_hits_roc25->Fill(slot,channel); |
232 | if (rocid == 26) cdc_hits_roc26->Fill(slot,channel); |
233 | if (rocid == 27) cdc_hits_roc27->Fill(slot,channel); |
234 | if (rocid == 28) cdc_hits_roc28->Fill(slot,channel); |
235 | |
236 | if (rocid == 25) cdc_sumamp_roc25->Fill(amp); |
237 | if (rocid == 26) cdc_sumamp_roc26->Fill(amp); |
238 | if (rocid == 27) cdc_sumamp_roc27->Fill(amp); |
239 | if (rocid == 28) cdc_sumamp_roc28->Fill(amp); |
240 | |
241 | if (rocid == 25) cdc_amp_roc25->Fill(slot*100+channel,amp); |
242 | if (rocid == 26) cdc_amp_roc26->Fill(slot*100+channel,amp); |
243 | if (rocid == 27) cdc_amp_roc27->Fill(slot*100+channel,amp); |
244 | if (rocid == 28) cdc_amp_roc28->Fill(slot*100+channel,amp); |
245 | |
246 | if (rocid == 25) cdc_netamp_roc25->Fill(slot*100+channel,netamp); |
247 | if (rocid == 26) cdc_netamp_roc26->Fill(slot*100+channel,netamp); |
248 | if (rocid == 27) cdc_netamp_roc27->Fill(slot*100+channel,netamp); |
249 | if (rocid == 28) cdc_netamp_roc28->Fill(slot*100+channel,netamp); |
250 | |
251 | if (rocid == 25) cdc_ped_roc25->Fill(slot*100+channel,ped); |
252 | if (rocid == 26) cdc_ped_roc26->Fill(slot*100+channel,ped); |
253 | if (rocid == 27) cdc_ped_roc27->Fill(slot*100+channel,ped); |
254 | if (rocid == 28) cdc_ped_roc28->Fill(slot*100+channel,ped); |
255 | |
256 | if (!qf) { |
257 | if (rocid == 25) cdc_time_roc25->Fill(slot*100+channel,time); |
258 | if (rocid == 26) cdc_time_roc26->Fill(slot*100+channel,time); |
259 | if (rocid == 27) cdc_time_roc27->Fill(slot*100+channel,time); |
260 | if (rocid == 28) cdc_time_roc28->Fill(slot*100+channel,time); |
261 | } |
262 | |
263 | if ((int)time>=TSTART && (int)time<=TSTOP) { |
264 | |
265 | cdc_time_selected->Fill(time); |
266 | |
267 | if (rocid == 25) cdc_sumamp_t_roc25->Fill(amp); |
268 | if (rocid == 26) cdc_sumamp_t_roc26->Fill(amp); |
269 | if (rocid == 27) cdc_sumamp_t_roc27->Fill(amp); |
270 | if (rocid == 28) cdc_sumamp_t_roc28->Fill(amp); |
271 | |
272 | if (rocid == 25) cdc_amp_t_roc25->Fill(slot*100+channel,amp); |
273 | if (rocid == 26) cdc_amp_t_roc26->Fill(slot*100+channel,amp); |
274 | if (rocid == 27) cdc_amp_t_roc27->Fill(slot*100+channel,amp); |
275 | if (rocid == 28) cdc_amp_t_roc28->Fill(slot*100+channel,amp); |
276 | |
277 | } |
278 | |
279 | } |
280 | |
281 | |
282 | japp->RootUnLock(); //RELEASE ROOT LOCK!! |
283 | |
284 | |
285 | return NOERROR; |
286 | } |
287 | |
288 | |
289 | //---------------------------------------------------------------------------------- |
290 | |
291 | |
292 | jerror_t JEventProcessor_CDC_roc_hits::erun(void) { |
293 | // This is called whenever the run number changes, before it is |
294 | // changed to give you a chance to clean up before processing |
295 | // events from the next run number. |
296 | return NOERROR; |
297 | } |
298 | |
299 | |
300 | //---------------------------------------------------------------------------------- |
301 | |
302 | |
303 | jerror_t JEventProcessor_CDC_roc_hits::fini(void) { |
304 | // Called before program exit after event processing is finished. |
305 | |
306 | |
307 | const float HOT = 3; |
308 | const float COLD = 0.1; |
309 | |
310 | |
311 | int maxslot; // highest slot number used for roc in question |
312 | int totalhits; // total hits for roc |
313 | int usedchans; // number of channels used in roc |
314 | int unusedchans; // number of unused channels in roc |
315 | int meanhits = 1; // mean number of hits per channel-in-use |
316 | int chanhits; // number of hits for current channel |
317 | int nfound; // number found in current search |
318 | |
319 | bool emptychan[15][72]; |
320 | bool hotchan[15][72]; |
321 | bool coldchan[15][72]; |
322 | |
323 | bool unused; // true if channel is not connected to a straw |
324 | // nb there was one straw disconnected |
325 | |
326 | |
327 | FILE *outfile; |
328 | outfile = fopen("CDC_roc_hits.txt","w"); |
329 | |
330 | if (outfile == NULL__null) printf("1 Cannot open file CDC_roc_hits.txt\n"); |
331 | if (!outfile) printf("2 Cannot open file CDC_roc_hits.txt\n"); |
332 | |
333 | |
334 | int roc; |
335 | |
336 | for (roc=25; roc<29; roc++) { |
337 | |
338 | for (int islot=3; islot<18; islot++) { |
339 | for (int ichan=0; ichan<72; ichan++) { |
340 | emptychan[islot-3][ichan] = 0; |
341 | hotchan[islot-3][ichan] = 0; |
342 | coldchan[islot-3][ichan] = 0; |
343 | } |
344 | } |
345 | |
346 | |
347 | if (roc==25) { |
348 | |
349 | maxslot = 17; |
350 | unusedchans = 14; |
351 | totalhits = cdc_hits_roc25->GetEntries(); |
352 | |
353 | } else if (roc==26) { |
354 | |
355 | maxslot = 16; |
356 | unusedchans = 16; |
357 | totalhits = cdc_hits_roc26->GetEntries(); |
358 | |
359 | } else if (roc==27) { |
360 | |
361 | maxslot = 16; |
362 | unusedchans = 16; |
363 | totalhits = cdc_hits_roc27->GetEntries(); |
364 | |
365 | } else if (roc==28) { |
366 | |
367 | maxslot = 17; |
368 | unusedchans = 8; |
369 | totalhits = cdc_hits_roc28->GetEntries(); |
370 | |
371 | } |
372 | |
373 | usedchans = 72*(maxslot-4) - unusedchans; |
374 | if (totalhits) meanhits = totalhits/usedchans; |
375 | printf("\nROC %i: mean number of hits per channel is %i\n",roc,meanhits); |
376 | if (outfile) fprintf(outfile,"\nROC %i: mean hits per channel is %i\n",roc,meanhits); |
377 | |
378 | |
379 | |
380 | for (int islot=3; islot<maxslot+1; islot++) { |
381 | |
382 | if (islot==11) continue; // not used |
383 | if (islot==12) continue; // not used |
384 | |
385 | |
386 | for (int ichan=0; ichan<72; ichan++) { |
387 | |
388 | unused = 0; |
389 | |
390 | if (roc==25) { |
391 | if (islot==6 && ichan==17) unused = 1; |
392 | if (islot==7 && ichan==11) unused = 1; |
393 | if (islot==8 && ichan==35) unused = 1; |
394 | if (islot==8 && ichan==37) unused = 1; |
395 | if (islot==9 && ichan==37) unused = 1; |
396 | if (islot==9 && ichan==59) unused = 1; |
397 | if (islot==10 && ichan==61) unused = 1; |
398 | if (islot==13 && ichan==13) unused = 1; |
399 | if (islot==13 && ichan==37) unused = 1; |
400 | if (islot==14 && ichan==35) unused = 1; |
401 | if (islot==14 && ichan==59) unused = 1; |
402 | if (islot==14 && ichan==25) unused = 1; // straw W38 disconnected 17 Nov 2015 |
403 | if (islot==16 && ichan==11) unused = 1; |
404 | if (islot==16 && ichan==37) unused = 1; |
405 | if (islot==17 && ichan==59) unused = 1; |
406 | |
407 | chanhits = cdc_hits_roc25->GetBinContent(islot-2,ichan); |
408 | |
409 | } else if (roc==26) { |
410 | |
411 | if (islot==3 && ichan==59) unused = 1; |
412 | if (islot==4 && ichan==7) unused = 1; |
413 | if (islot==4 && ichan==11) unused = 1; |
414 | if (islot==4 && ichan>47) unused = 1; |
415 | if (islot==5 && ichan==13) unused = 1; |
416 | if (islot==6 && ichan==11) unused = 1; |
417 | if (islot==6 && ichan==61) unused = 1; |
418 | if (islot==7 && ichan==13) unused = 1; |
419 | if (islot==9 && ichan==33) unused = 1; |
420 | if (islot==9 && ichan==35) unused = 1; |
421 | if (islot==13 && ichan==37) unused = 1; |
422 | if (islot==13 && ichan==61) unused = 1; |
423 | if (islot==14 && ichan==61) unused = 1; |
424 | if (islot==15 && ichan==61) unused = 1; |
425 | if (islot==16 && ichan==13) unused = 1; |
426 | if (islot==16 && ichan==35) unused = 1; |
427 | |
428 | chanhits = cdc_hits_roc26->GetBinContent(islot-2,ichan); |
429 | |
430 | } else if (roc==27) { |
431 | |
432 | if (islot==3 && ichan==37) unused = 1; |
433 | if (islot==3 && ichan==61) unused = 1; |
434 | if (islot==4 && ichan==11) unused = 1; |
435 | if (islot==4 && ichan==35) unused = 1; |
436 | if (islot==5 && ichan==13) unused = 1; |
437 | if (islot==5 && ichan==35) unused = 1; |
438 | if (islot==7 && ichan==17) unused = 1; |
439 | if (islot==7 && ichan==41) unused = 1; |
440 | if (islot==8 && ichan==13) unused = 1; // straw K39 disconnected 6 Aug 2015 |
441 | if (islot==8 && ichan==61) unused = 1; |
442 | if (islot==9 && ichan==11) unused = 1; |
443 | if (islot==9 && ichan==35) unused = 1; |
444 | if (islot==9 && ichan==37) unused = 1; |
445 | if (islot==10 && ichan==37) unused = 1; |
446 | if (islot==13 && ichan==35) unused = 1; |
447 | if (islot==15 && ichan==59) unused = 1; |
448 | if (islot==16 && ichan==11) unused = 1; |
449 | |
450 | chanhits = cdc_hits_roc27->GetBinContent(islot-2,ichan); |
451 | |
452 | } else if (roc==28) { |
453 | |
454 | if (islot==5 && ichan==37) unused = 1; |
455 | if (islot==6 && ichan==65) unused = 1; |
456 | if (islot==7 && ichan==13) unused = 1; |
457 | if (islot==9 && ichan==35) unused = 1; |
458 | if (islot==10 && ichan==37) unused = 1; |
459 | if (islot==14 && ichan==31) unused = 1; |
460 | if (islot==14 && ichan==37) unused = 1; |
461 | if (islot==16 && ichan==59) unused = 1; |
462 | if (islot==17 && ichan==61) unused = 1; |
463 | |
464 | chanhits = cdc_hits_roc28->GetBinContent(islot-2,ichan); |
465 | |
466 | } |
467 | |
468 | if (unused) continue; |
469 | |
470 | if (chanhits == 0) emptychan[islot-3][ichan] = 1; |
471 | if (chanhits > HOT*meanhits) hotchan[islot-3][ichan] = 1; |
472 | if (chanhits < COLD*meanhits) coldchan[islot-3][ichan] = 1; |
473 | |
474 | } //ichan |
475 | } //islot |
476 | |
477 | |
478 | |
479 | |
480 | printf("Checking ROC %i for silent channels...\n",roc); |
481 | if (outfile) fprintf(outfile,"Checking ROC %i for silent channels...\n",roc); |
482 | |
483 | |
484 | nfound = 0; |
485 | for (int islot=3; islot<maxslot; islot++) { |
486 | for (int ichan=0; ichan<72; ichan++) { |
487 | if (emptychan[islot-3][ichan]) { |
488 | nfound++; |
489 | printf(" roc %i slot %i channel %i\n",roc,islot,ichan); |
490 | if (outfile) fprintf(outfile," roc %i slot %i channel %i\n",roc,islot,ichan); |
491 | } |
492 | } |
493 | } |
494 | |
495 | if (!nfound) { |
496 | printf(" none found \n"); |
497 | if (outfile) fprintf(outfile," none found \n"); |
498 | } |
499 | |
500 | |
501 | |
502 | printf("Checking ROC %i for cold channels (below %1.2f x mean hits/channel)...\n",roc,COLD); |
503 | if (outfile) fprintf(outfile,"Checking ROC %i for cold channels (below %1.2f x mean hits/channel)...\n",roc,COLD); |
504 | nfound = 0; |
505 | |
506 | for (int islot=3; islot<maxslot; islot++) { |
507 | for (int ichan=0; ichan<72; ichan++) { |
508 | if (coldchan[islot-3][ichan] && !emptychan[islot-3][ichan]) { |
509 | nfound++; |
510 | printf(" roc %i slot %i channel %i\n",roc,islot,ichan); |
511 | if (outfile) fprintf(outfile," roc %i slot %i channel %i\n",roc,islot,ichan); |
512 | } |
513 | } |
514 | } |
515 | if (!nfound) { |
516 | printf(" none found \n"); |
517 | if (outfile) fprintf(outfile," none found \n"); |
518 | } |
519 | |
520 | |
521 | printf("Checking ROC %i for hot channels (over %1.2f x mean hits/channel)...\n",roc,HOT); |
522 | if (outfile) fprintf(outfile,"Checking ROC %i for hot channels (over %1.2f x mean hits/channel)...\n",roc,HOT); |
523 | nfound = 0; |
524 | |
525 | for (int islot=3; islot<maxslot; islot++) { |
526 | for (int ichan=0; ichan<72; ichan++) { |
527 | if (hotchan[islot-3][ichan]) { |
528 | nfound++; |
529 | printf(" roc %i slot %i channel %i\n",roc,islot,ichan); |
530 | if (outfile) fprintf(outfile," roc %i slot %i channel %i\n",roc,islot,ichan); |
531 | } |
532 | } |
533 | } |
534 | if (!nfound) { |
535 | printf(" none found \n"); |
536 | if (outfile) fprintf(outfile," none found \n"); |
537 | } |
538 | |
539 | |
540 | |
541 | } //roc |
542 | |
543 | |
544 | if (outfile) fclose(outfile); |
545 | |
546 | |
547 | return NOERROR; |
548 | } |
549 | |
550 | |
551 | //---------------------------------------------------------------------------------- |
552 | //---------------------------------------------------------------------------------- |