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