1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | #include <stdint.h> |
9 | #include <vector> |
10 | |
11 | #include <TMath.h> |
12 | |
13 | |
14 | #include "JEventProcessor_CDC_expert_2.h" |
15 | #include <JANA/JApplication.h> |
16 | |
17 | |
18 | using namespace std; |
19 | using namespace jana; |
20 | |
21 | |
22 | #include "CDC/DCDCHit.h" |
23 | #include "CDC/DCDCDigiHit.h" |
24 | #include "DAQ/Df125WindowRawData.h" |
25 | #include "DAQ/Df125CDCPulse.h" |
26 | #include "DAQ/Df125Config.h" |
27 | |
28 | #include <TDirectory.h> |
29 | #include <TH2.h> |
30 | #include <TH1.h> |
31 | |
32 | |
33 | |
34 | |
35 | |
36 | |
37 | static TH1D *cdc_e = NULL__null; |
38 | static TH2D *cdc_e_vs_n = NULL__null; |
39 | |
40 | static TH1D *cdc_t = NULL__null; |
41 | static TH2D *cdc_t_vs_n = NULL__null; |
42 | |
43 | static TH1D *cdc_rt = NULL__null; |
44 | static TH2D *cdc_rt_vs_n = NULL__null; |
45 | |
46 | static TH1D *cdc_amp = NULL__null; |
47 | static TH2D *cdc_amp_vs_n = NULL__null; |
48 | |
49 | static TH1D *cdc_rt_qf0 = NULL__null; |
50 | |
51 | static TH1D *cdc_qf = NULL__null; |
52 | static TH2D *cdc_qf_vs_n = NULL__null; |
53 | static TH2D *cdc_qf_vs_a = NULL__null; |
54 | static TH2D *cdc_qf_vs_rt = NULL__null; |
55 | |
56 | |
57 | |
58 | static TH2D *cdc_t_ring[29]; |
59 | |
60 | static TH2D *cdc_e_vs_t; |
61 | static TH2D *cdc_e_vs_t_ring[29]; |
62 | |
63 | static TH2I *cdc_int_vs_raw_t; |
64 | static TH2I *cdc_int_vs_raw_t_ring[29]; |
65 | |
66 | static TH2I *cdc_o_overflow; |
67 | static TH1I *cdc_ped_overflow; |
68 | static TH1I *cdc_raw_t_overflow; |
69 | |
70 | static TH2I *cdc_o_badt; |
71 | |
72 | static TH2I *cdc_ped_ring[29]; |
73 | static TH1I *cdc_ped_badt; |
74 | |
75 | static TH2I *cdc_raw_t_ring[29]; |
76 | static TH1I *cdc_raw_t_badt; |
77 | |
78 | static TH2I *cdc_amp_ring[29]; |
79 | static TH1I *cdc_amp_badt; |
80 | |
81 | |
82 | static TH2I *cdc_intpp_ring[29]; |
83 | |
84 | |
85 | static TH2I *cdc_initped_ring[29]; |
86 | |
87 | static TH2I *cdc_initped_roc25; |
88 | static TH2I *cdc_initped_roc26; |
89 | static TH2I *cdc_initped_roc27; |
90 | static TH2I *cdc_initped_roc28; |
91 | |
92 | static TH2I *cdc_ped_roc25; |
93 | static TH2I *cdc_ped_roc26; |
94 | static TH2I *cdc_ped_roc27; |
95 | static TH2I *cdc_ped_roc28; |
96 | |
97 | |
98 | |
99 | |
100 | |
101 | |
102 | |
103 | |
104 | extern "C"{ |
105 | void InitPlugin(JApplication *app){ |
106 | InitJANAPlugin(app); |
107 | app->AddProcessor(new JEventProcessor_CDC_expert_2()); |
108 | } |
109 | } |
110 | |
111 | |
112 | |
113 | |
114 | |
115 | JEventProcessor_CDC_expert_2::JEventProcessor_CDC_expert_2() { |
116 | } |
117 | |
118 | |
119 | |
120 | |
121 | |
122 | JEventProcessor_CDC_expert_2::~JEventProcessor_CDC_expert_2() { |
123 | } |
124 | |
125 | |
126 | |
127 | |
128 | jerror_t JEventProcessor_CDC_expert_2::init(void) { |
129 | |
130 | |
131 | japp->RootWriteLock(); |
132 | |
133 | |
134 | |
135 | |
136 | |
137 | |
138 | |
139 | |
140 | |
141 | |
142 | |
143 | |
144 | |
145 | const Int_t IMAX = 100000; |
146 | const Int_t IPPMAX = 150000; |
147 | const Int_t PMAX = 256; |
148 | const Int_t AMAX = 4096; |
149 | const Int_t RTMAX = 1800; |
150 | const Int_t RTMIN = 160; |
151 | const Int_t RTBINS = 164; |
152 | |
153 | const Int_t RTVSNMAX = 1024; |
154 | |
155 | const Int_t EMAX = 21000; |
156 | |
157 | |
158 | |
159 | const Int_t TMAX = 1250; |
160 | |
161 | const Int_t TMIN = -250; |
162 | const Int_t TBINS = 250; |
163 | |
164 | |
165 | const Int_t NSTRAWS = 3522; |
166 | const Float_t HALF = 0.5; |
167 | const Float_t NSTRAWSPH = 3522.5; |
168 | |
169 | |
170 | |
171 | Char_t deadstraws[32] = "(#709 and #2384 disconnected)"; |
172 | Char_t deadrow11[30] = "(#39 disconnected)"; |
173 | Char_t deadrow23[30] = "(#38 disconnected)"; |
174 | |
175 | |
176 | |
177 | TDirectory *main = gDirectory(TDirectory::CurrentDirectory()); |
178 | |
179 | gDirectory(TDirectory::CurrentDirectory())->mkdir("CDC_expert_2")->cd(); |
180 | TDirectory *xd = gDirectory(TDirectory::CurrentDirectory()); |
181 | |
182 | |
183 | |
184 | |
185 | |
186 | const Int_t straws[29] = {0,42,42,54,54,66,66,80,80,93,93,106,106,123,123,135,135,146,146,158,158,170,170,182,182,197,197,209,209}; |
187 | |
188 | |
189 | cdc_e = new TH1D("cdc_e","CDC charge (fC);charge (fC)",200,0,EMAX); |
190 | cdc_e_vs_n = new TH2D("cdc_e_vs_n",Form("CDC charge (fC) vs straw number;straw %s;charge (fC)",deadstraws),NSTRAWS,HALF,NSTRAWSPH,100,0,EMAX); |
191 | |
192 | cdc_e_vs_t = new TH2D("cdc_e_vs_t","CDC charge (fC) vs time (ns);time (ns);charge (fC)",TBINS,TMIN,TMAX,100,0,EMAX); |
193 | |
194 | |
195 | cdc_t = new TH1D("cdc_t","CDC time (ns);time (ns)",TBINS*2,TMIN,TMAX); |
196 | cdc_t_vs_n = new TH2D("cdc_t_vs_n",Form("CDC time (ns) vs straw number;straw %s;time (ns)",deadstraws),NSTRAWS,HALF,NSTRAWSPH,TBINS,TMIN,TMAX); |
197 | |
198 | |
199 | cdc_rt = new TH1D("cdc_rt","CDC raw time (0.8ns);raw time (0.8ns)",RTMAX-RTMIN,RTMIN,RTMAX); |
200 | cdc_rt_qf0 = new TH1D("cdc_rt_qf0","CDC raw time with qf=0 (0.8ns);raw time (0.8ns)",RTMAX-RTMIN,RTMIN,RTMAX); |
201 | cdc_rt_vs_n = new TH2D("cdc_rt_vs_n",Form("CDC raw time (0.8ns) vs straw number;straw %s;raw time (0.8ns)",deadstraws),NSTRAWS,HALF,NSTRAWSPH,RTBINS,RTMIN,RTMAX); |
202 | |
203 | |
204 | cdc_amp = new TH1D("cdc_amp","CDC amplitude;amplitude",256,0,AMAX); |
205 | cdc_amp_vs_n = new TH2D("cdc_amp_vs_n",Form("CDC time (ns) vs straw number;straw %s;time (ns)",deadstraws),NSTRAWS,HALF,NSTRAWSPH,256,0,AMAX); |
206 | |
207 | |
208 | |
209 | |
210 | |
211 | |
212 | cdc_int_vs_raw_t = new TH2I("cdc_int_vs_raw_t",Form("CDC integral (ADC units), pedestal subtracted, vs raw time (0.8ns);raw time (0.8ns);integral, pedestal subtracted (ADC units)"),(Int_t)RTBINS,RTMIN,RTMAX,100,0,IMAX); |
213 | |
214 | |
215 | gDirectory(TDirectory::CurrentDirectory())->mkdir("pedestals_by_roc","CDC Pedestals for each ROC")->cd(); |
216 | |
217 | cdc_initped_roc25 = new TH2I("cdc_initped_roc25","CDC pedestal (ADC units) from raw window data vs slot*100+channel, ROC 25;slot*100 + channel;pedestal",1600,200+HALF,1800+HALF,(Int_t)PMAX/4,0,PMAX); |
218 | cdc_initped_roc26 = new TH2I("cdc_initped_roc26","CDC pedestal (ADC units) from raw window data vs slot*100+channel, ROC 26;slot*100 + channel;pedestal",1600,200+HALF,1800+HALF,(Int_t)PMAX/4,0,PMAX); |
219 | cdc_initped_roc27 = new TH2I("cdc_initped_roc27","CDC pedestal (ADC units) from raw window data vs slot*100+channel, ROC 27;slot*100 + channel;pedestal",1600,200+HALF,1800+HALF,(Int_t)PMAX/4,0,PMAX); |
220 | cdc_initped_roc28 = new TH2I("cdc_initped_roc28","CDC pedestal (ADC units) from raw window data vs slot*100+channel, ROC 28;slot*100 + channel;pedestal",1600,200+HALF,1800+HALF,(Int_t)PMAX/4,0,PMAX); |
221 | |
222 | cdc_ped_roc25 = new TH2I("cdc_ped_roc25","CDC pedestal (ADC units) vs slot*100+channel, ROC 25;slot*100 + channel;pedestal",1600,200+HALF,1800+HALF,(Int_t)PMAX/4,0,PMAX); |
223 | cdc_ped_roc26 = new TH2I("cdc_ped_roc26","CDC pedestal (ADC units) vs slot*100+channel, ROC 26;slot*100 + channel;pedestal",1600,200+HALF,1800+HALF,(Int_t)PMAX/4,0,PMAX); |
224 | cdc_ped_roc27 = new TH2I("cdc_ped_roc27","CDC pedestal (ADC units) vs slot*100+channel, ROC 27;slot*100 + channel;pedestal",1600,200+HALF,1800+HALF,(Int_t)PMAX/4,0,PMAX); |
225 | cdc_ped_roc28 = new TH2I("cdc_ped_roc28","CDC pedestal (ADC units) vs slot*100+channel, ROC 28;slot*100 + channel;pedestal",1600,200+HALF,1800+HALF,(Int_t)PMAX/4,0,PMAX); |
226 | |
227 | xd->cd(); |
228 | |
229 | |
230 | gDirectory(TDirectory::CurrentDirectory())->mkdir("bad_t","CDC Bad time flagged")->cd(); |
231 | |
232 | cdc_o_badt = new TH2I("cdc_o_badt","CDC occupancy by straw,ring, events with bad time flagged;straw;ring",209,0.5,209.5,28,0.5,28.5); |
233 | cdc_ped_badt = new TH1I("cdc_ped_badt","CDC pedestal, events with bad time flagged;straw;pedestal",256,0,PMAX); |
234 | cdc_raw_t_badt = new TH1I("cdc_raw_t_badt",Form("CDC raw time (0.8ns), events with bad time flagged;straw;raw time (0.8ns)"),RTBINS,RTMIN,RTMAX); |
235 | cdc_amp_badt = new TH1I("cdc_amp_badt","CDC amplitude (ADC units), events with bad time flagged;ADC units",256,0,AMAX); |
236 | |
237 | |
238 | |
239 | cdc_qf = new TH1D("cdc_qf","CDC time quality factor;time quality factor (0:good, 1:zero, 2:hi ped, 3: below TH, 4:late TCL, 5: neg ups, 9:hi ups)",10,0,10); |
240 | cdc_qf_vs_n = new TH2D("cdc_qf_vs_n","CDC time quality factor vs straw number;straw;time quality factor",NSTRAWS,HALF,NSTRAWSPH,10,0,10); |
241 | cdc_qf_vs_a = new TH2D("cdc_qf_vs_a","CDC time quality factor vs amplitude;amplitude;time quality factor",128,0,AMAX,10,0,10); |
242 | cdc_qf_vs_rt = new TH2D("cdc_qf_vs_raw_t","CDC time quality factor vs raw time;time;time quality factor",RTBINS,RTMIN,RTMAX,10,0,10); |
243 | |
244 | xd->cd(); |
245 | |
246 | |
247 | gDirectory(TDirectory::CurrentDirectory())->mkdir("overflows","CDC overflow flagged")->cd(); |
248 | |
249 | cdc_o_overflow = new TH2I("cdc_o_overflow","CDC overflow occupancy by straw,ring;straw;ring",209,0.5,209.5,28,0.5,28.5); |
250 | cdc_ped_overflow = new TH1I("cdc_ped_overflow","CDC pedestal, events with ADC overflow;pedestal",256,0,PMAX); |
251 | cdc_raw_t_overflow = new TH1I("cdc_raw_t_overflow",Form("CDC raw time (0.8ns), events with ADC overflow;raw time (0.8ns)"),RTBINS,RTMIN,RTMAX); |
252 | |
253 | xd->cd(); |
254 | |
255 | |
256 | Int_t i; |
257 | |
258 | gDirectory(TDirectory::CurrentDirectory())->mkdir("rings_e_vs_t","CDC rings: charge vs time")->cd(); |
259 | for (i=1; i<29; i++) { |
260 | cdc_e_vs_t_ring[i] = new TH2D(Form("cdc_e_vs_t_ring[%i]",i),"CDC charge (fC) vs time (ns);time (ns);charge (fC)",TBINS,TMIN,TMAX,100,0,EMAX); |
261 | } |
262 | xd->cd(); |
263 | |
264 | |
265 | gDirectory(TDirectory::CurrentDirectory())->mkdir("rings_int_vs_raw_t","CDC rings: integral vs raw time (pedestal subtracted)")->cd(); |
266 | for (i=1; i<29; i++) { |
267 | cdc_int_vs_raw_t_ring[i] = new TH2I(Form("cdc_int_vs_raw_t_ring[%i]",i),Form("CDC integral (ADC units), pedestal subtracted, vs raw time (0.8ns);raw time (0.8ns);integral, pedestal subtracted (ADC units)"),RTBINS,RTMIN,RTMAX,100,0,IMAX); |
268 | } |
269 | xd->cd(); |
270 | |
271 | |
272 | |
273 | |
274 | |
275 | |
276 | |
277 | |
278 | |
279 | gDirectory(TDirectory::CurrentDirectory())->mkdir("rings_t","CDC rings: time vs straw")->cd(); |
280 | for (i=1; i<29; i++) { |
281 | cdc_t_ring[i] = new TH2D(Form("cdc_t_ring[%i]",i),Form("CDC time (ns), ring %i;straw;time (ns)",i),straws[i],HALF,straws[i]+HALF,TBINS,TMIN,TMAX); |
282 | } |
283 | cdc_t_ring[11]->GetXaxis()->SetTitle(Form("pedestal %s",deadrow11)); |
284 | cdc_t_ring[23]->GetXaxis()->SetTitle(Form("pedestal %s",deadrow23)); |
285 | xd->cd(); |
286 | |
287 | |
288 | gDirectory(TDirectory::CurrentDirectory())->mkdir("rings_pedestal","CDC rings: pedestal vs straw")->cd(); |
289 | for (i=1; i<29; i++) { |
290 | cdc_ped_ring[i] = new TH2I(Form("cdc_ped_ring[%i]",i),Form("CDC pedestal (ADC units), ring %i;straw;pedestal",i),straws[i],HALF,straws[i]+HALF,(Int_t)PMAX/2,0,PMAX); |
291 | } |
292 | cdc_ped_ring[11]->GetXaxis()->SetTitle(Form("Straw number, %s",deadrow11)); |
293 | cdc_ped_ring[23]->GetXaxis()->SetTitle(Form("Straw number, %s",deadrow23)); |
294 | xd->cd(); |
295 | |
296 | |
297 | gDirectory(TDirectory::CurrentDirectory())->mkdir("rings_initpedestal","CDC rings: initial pedestal from raw window data vs straw")->cd(); |
298 | for (i=1; i<29; i++) { |
299 | cdc_initped_ring[i] = new TH2I(Form("cdc_initped_ring[%i]",i),Form("CDC initial pedestal (ADC units) from raw window data, ring %i;straw;pedestal",i),straws[i],HALF,straws[i]+HALF,(Int_t)PMAX/2,0,PMAX); |
300 | } |
301 | cdc_initped_ring[11]->GetXaxis()->SetTitle(Form("Straw number, %s",deadrow11)); |
302 | cdc_initped_ring[23]->GetXaxis()->SetTitle(Form("Straw number, %s",deadrow23)); |
303 | xd->cd(); |
304 | |
305 | |
306 | |
307 | gDirectory(TDirectory::CurrentDirectory())->mkdir("rings_raw_t","CDC rings: raw time vs straw")->cd(); |
308 | for (i=1; i<29; i++) { |
309 | cdc_raw_t_ring[i] = new TH2I(Form("cdc_raw_t_ring[%i]",i),Form("CDC raw time (0.8ns), ring %i;straw;raw time (0.8ns)",i),straws[i],HALF,straws[i]+HALF,256,0,RTVSNMAX); |
310 | } |
311 | cdc_raw_t_ring[11]->GetXaxis()->SetTitle(Form("Straw number, %s",deadrow11)); |
312 | cdc_raw_t_ring[23]->GetXaxis()->SetTitle(Form("Straw number, %s",deadrow23)); |
313 | xd->cd(); |
314 | |
315 | |
316 | gDirectory(TDirectory::CurrentDirectory())->mkdir("rings_amp","CDC rings: amplitude")->cd(); |
317 | for (i=1; i<29; i++) { |
318 | cdc_amp_ring[i] = new TH2I(Form("cdc_amp_ring[%i]",i),Form("CDC amplitude (ADC units), ring %i",i),straws[i],HALF,straws[i]+HALF,256,0,AMAX); |
319 | } |
320 | cdc_amp_ring[11]->GetXaxis()->SetTitle(Form("Straw number, %s",deadrow11)); |
321 | cdc_amp_ring[23]->GetXaxis()->SetTitle(Form("Straw number, %s",deadrow23)); |
322 | xd->cd(); |
323 | |
324 | |
325 | |
326 | |
327 | |
328 | |
329 | |
330 | |
331 | |
332 | gDirectory(TDirectory::CurrentDirectory())->mkdir("rings_integral_incl_ped","CDC rings: integral vs straw (including pedestal)")->cd(); |
333 | for (i=1; i<29; i++) { |
334 | cdc_intpp_ring[i] = new TH2I(Form("cdc_intpp_ring[%i]",i),Form("CDC integral (ADC units), including pedestal, ring %i",i),straws[i],HALF,straws[i]+HALF,100,0,IPPMAX); |
335 | } |
336 | cdc_intpp_ring[11]->GetXaxis()->SetTitle(Form("Straw number, %s",deadrow11)); |
337 | cdc_intpp_ring[23]->GetXaxis()->SetTitle(Form("Straw number, %s",deadrow23)); |
338 | |
339 | |
340 | main->cd(); |
341 | |
342 | japp->RootUnLock(); |
343 | |
344 | return NOERROR; |
345 | |
346 | |
347 | } |
348 | |
349 | |
350 | |
351 | |
352 | |
353 | jerror_t JEventProcessor_CDC_expert_2::brun(JEventLoop *eventLoop, int32_t runnumber) { |
354 | |
355 | |
356 | return NOERROR; |
357 | |
358 | } |
359 | |
360 | |
361 | |
362 | |
363 | |
364 | jerror_t JEventProcessor_CDC_expert_2::evnt(JEventLoop *eventLoop, uint64_t eventnumber) { |
365 | |
366 | |
367 | |
368 | |
369 | |
370 | |
371 | float q,t; |
372 | |
373 | uint32_t rocid; |
374 | uint32_t slot; |
375 | uint32_t channel; |
376 | |
377 | uint16_t ring,straw; |
378 | uint16_t n; |
379 | |
380 | uint32_t qf,ocount; |
381 | uint32_t rt,p,a; |
382 | uint32_t integral; |
383 | uint32_t integ; |
384 | |
385 | uint16_t originalq; |
386 | |
387 | uint32_t total_ped; |
388 | uint32_t initped; |
389 | |
390 | |
391 | uint16_t ISCALE = 16; |
392 | uint16_t ASCALE = 8; |
393 | uint16_t PSCALE = 1; |
394 | uint16_t NW = 200; |
395 | uint16_t IE = 200; |
396 | |
397 | |
398 | const uint16_t NPEDSAMPLES=16; |
399 | |
400 | |
401 | int straw_offset[29] = {0,0,42,84,138,192,258,324,404,484,577,670,776,882,1005,1128,1263,1398,1544,1690,1848,2006,2176,2346,2528,2710,2907,3104,3313}; |
402 | |
403 | |
404 | |
405 | |
406 | |
407 | |
408 | vector<const DCDCHit*> hits; |
409 | eventLoop->Get(hits); |
410 | |
411 | |
412 | vector<const DCDCDigiHit*> digihits; |
413 | eventLoop->Get(digihits); |
414 | |
415 | |
416 | japp->RootWriteLock(); |
417 | |
418 | |
419 | |
420 | for (uint32_t i=0; i<hits.size(); i++) { |
421 | |
422 | const DCDCHit *hit = hits[i]; |
423 | |
424 | if (hit->q>0.0) { |
425 | |
426 | q = hit->q; |
427 | t = hit->t; |
428 | ring = hit->ring; |
429 | straw = hit->straw; |
430 | |
431 | n = straw_offset[ring] + straw; |
432 | |
433 | if (q > 0.0) { |
434 | cdc_e->Fill(q); |
435 | cdc_e_vs_n->Fill(n,q); |
436 | } |
437 | |
438 | cdc_t->Fill(t); |
439 | cdc_t_vs_n->Fill(n,t); |
440 | |
441 | cdc_e_vs_t->Fill(t,q); |
442 | cdc_e_vs_t_ring[ring]->Fill(t,q); |
443 | |
444 | |
445 | cdc_t_ring[ring]->Fill(straw,t); |
446 | } |
447 | } |
448 | |
449 | |
450 | |
451 | const DCDCDigiHit *digihit = NULL__null; |
452 | const Df125CDCPulse *cp = NULL__null; |
453 | const Df125WindowRawData *wrd = NULL__null; |
454 | const Df125Config *cf = NULL__null; |
455 | |
456 | for (uint32_t i=0; i<digihits.size(); i++) { |
457 | |
458 | digihit = digihits[i]; |
459 | |
460 | ring = digihit->ring; |
461 | straw = digihit->straw; |
462 | |
463 | n = straw_offset[ring] + straw; |
464 | |
465 | |
466 | total_ped = 0; |
467 | originalq = 0; |
| Value stored to 'originalq' is never read |
468 | |
469 | |
470 | |
471 | |
472 | cp = NULL__null; |
473 | digihit->GetSingle(cp); |
474 | |
475 | if (!cp) continue; |
476 | |
477 | cp->GetSingle(cf); |
478 | if (cf) { |
479 | ISCALE = 1<<cf->IBIT; |
480 | ASCALE = 1<<cf->ABIT; |
481 | PSCALE = 1<<cf->PBIT; |
482 | |
483 | NW = cf->NW; |
484 | IE = cf->IE; |
485 | |
486 | } |
487 | |
488 | rocid = cp->rocid; |
489 | slot = cp->slot; |
490 | channel = cp->channel; |
491 | |
492 | rt = cp->le_time; |
493 | qf = cp->time_quality_bit; |
494 | ocount = cp->overflow_count; |
495 | |
496 | a = ASCALE*cp->first_max_amp; |
497 | p = PSCALE*cp->pedestal; |
498 | integral = ISCALE*cp->integral; |
499 | |
500 | |
501 | int lastsample = NW-20-1; |
502 | int timesample = int(0.1*rt); |
503 | if (timesample+IE < lastsample) lastsample = timesample+IE; |
504 | |
505 | int pulselength = 1 + lastsample - timesample; |
506 | |
507 | integ = integral - p*pulselength; |
508 | |
509 | if (qf==0) { |
510 | |
511 | originalq = 0; |
512 | |
513 | cdc_rt_qf0->Fill(rt); |
514 | |
515 | } else { |
516 | |
517 | originalq = rt - 10*int(0.1*rt); |
518 | |
519 | cdc_qf_vs_n->Fill(n,originalq); |
520 | cdc_qf_vs_a->Fill(a,originalq); |
521 | cdc_qf_vs_rt->Fill(rt,originalq); |
522 | |
523 | cdc_o_badt->Fill(straw,ring); |
524 | cdc_ped_badt->Fill(p); |
525 | cdc_raw_t_badt->Fill(rt); |
526 | cdc_amp_badt->Fill(a); |
527 | |
528 | |
529 | |
530 | |
531 | } |
532 | |
533 | cdc_qf->Fill(originalq); |
534 | |
535 | cdc_rt->Fill(rt); |
536 | cdc_rt_vs_n->Fill(n,rt); |
537 | |
538 | cdc_amp->Fill(a); |
539 | cdc_amp_vs_n->Fill(n,a); |
540 | |
541 | cdc_int_vs_raw_t->Fill(rt,integ); |
542 | cdc_int_vs_raw_t_ring[ring]->Fill(rt,integ); |
543 | |
544 | cdc_ped_ring[ring]->Fill(straw,p); |
545 | cdc_raw_t_ring[ring]->Fill(straw,rt); |
546 | cdc_amp_ring[ring]->Fill(straw,a); |
547 | |
548 | cdc_intpp_ring[ring]->Fill(straw,integral); |
549 | |
550 | |
551 | |
552 | if (ocount>0) { |
553 | cdc_o_overflow->Fill(straw,ring); |
554 | cdc_ped_overflow->Fill(p); |
555 | cdc_raw_t_overflow->Fill(rt); |
556 | } |
557 | |
558 | |
559 | if (rocid == 25) cdc_ped_roc25->Fill(100*slot + channel,p); |
560 | if (rocid == 26) cdc_ped_roc26->Fill(100*slot + channel,p); |
561 | if (rocid == 27) cdc_ped_roc27->Fill(100*slot + channel,p); |
562 | if (rocid == 28) cdc_ped_roc28->Fill(100*slot + channel,p); |
563 | |
564 | |
565 | |
566 | |
567 | wrd = NULL__null; |
568 | cp->GetSingle(wrd); |
569 | if (!wrd) continue; |
570 | |
571 | |
572 | initped=0; |
573 | |
574 | if (wrd->samples.size()>=NPEDSAMPLES) { |
575 | |
576 | for (uint16_t j=0; j<NPEDSAMPLES; j++) initped += (uint32_t)wrd->samples[j]; |
577 | |
578 | initped = (uint32_t)initped/16.0; |
579 | |
580 | if (initped > 0) { |
581 | |
582 | if (rocid == 25) cdc_initped_roc25->Fill(100*slot + channel,initped); |
583 | if (rocid == 26) cdc_initped_roc26->Fill(100*slot + channel,initped); |
584 | if (rocid == 27) cdc_initped_roc27->Fill(100*slot + channel,initped); |
585 | if (rocid == 28) cdc_initped_roc28->Fill(100*slot + channel,initped); |
586 | |
587 | } |
588 | |
589 | } |
590 | |
591 | if (initped) cdc_initped_ring[ring]->Fill(straw,initped); |
592 | |
593 | } |
594 | |
595 | |
596 | japp->RootUnLock(); |
597 | |
598 | |
599 | return NOERROR; |
600 | } |
601 | |
602 | |
603 | |
604 | |
605 | |
606 | jerror_t JEventProcessor_CDC_expert_2::erun(void) { |
607 | |
608 | |
609 | |
610 | return NOERROR; |
611 | } |
612 | |
613 | |
614 | |
615 | |
616 | |
617 | jerror_t JEventProcessor_CDC_expert_2::fini(void) { |
618 | |
619 | return NOERROR; |
620 | } |
621 | |
622 | |
623 | |
624 | |