Bug Summary

File:plugins/monitoring/CDC_expert/JEventProcessor_CDC_expert.cc
Location:line 464, column 5
Description:Value stored to 'total_ped' is never read

Annotated Source Code

1// $Id$
2//
3// File: JEventProcessor_CDC_expert.cc
4// Created: Wed Oct 22
5// Creator: Naomi Jarvis
6
7
8#include <stdint.h>
9#include <vector>
10
11#include <TMath.h>
12
13
14#include "JEventProcessor_CDC_expert.h"
15#include <JANA/JApplication.h>
16
17
18using namespace std;
19using namespace jana;
20
21
22#include "CDC/DCDCHit.h"
23#include "CDC/DCDCDigiHit.h"
24#include "DAQ/Df125PulseIntegral.h"
25#include "DAQ/Df125PulsePedestal.h"
26#include "DAQ/Df125WindowRawData.h"
27#include "DAQ/Df125CDCPulse.h"
28
29#include <TDirectory.h>
30#include <TH2.h>
31#include <TH1.h>
32
33
34// root hist pointers
35
36
37
38static TH1D *cdc_e = NULL__null;
39static TH2D *cdc_e_vs_n = NULL__null;
40
41static TH1D *cdc_t = NULL__null;
42static TH2D *cdc_t_vs_n = NULL__null;
43
44
45static TH2D *cdc_e_ring[29];
46static TH2D *cdc_t_ring[29];
47
48
49static TH2D *cdc_e_vs_t;
50static TH2D *cdc_e_vs_t_ring[29];
51
52static TH2I *cdc_raw_int_vs_t;
53static TH2I *cdc_raw_int_vs_t_ring[29];
54
55
56static TH2I *cdc_o_badt;
57static TH2I *cdc_o_overflow;
58
59static TH2I *cdc_ped_ring[29];
60static TH1I *cdc_ped_badt;
61static TH1I *cdc_ped_overflow;
62
63static TH2I *cdc_windata_ped_ring[29];
64
65static TH2I *cdc_windata_ped_roc25;
66static TH2I *cdc_windata_ped_roc26;
67static TH2I *cdc_windata_ped_roc27;
68static TH2I *cdc_windata_ped_roc28;
69
70static TH2I *cdc_raw_t_ring[29];
71static TH1I *cdc_raw_t_badt;
72static TH1I *cdc_raw_t_overflow;
73
74static TH2I *cdc_raw_amp_ring[29];
75static TH1I *cdc_raw_amp_badt;
76static TH1I *cdc_raw_amp_overflow;
77
78
79
80static TH2I *cdc_raw_intpp_ring[29];
81static TH1I *cdc_raw_intpp_badt;
82static TH1I *cdc_raw_intpp_overflow;
83
84
85
86static TH2I *cdc_raw_int_ring[29];
87static TH1I *cdc_raw_int_badt;
88static TH1I *cdc_raw_int_overflow;
89
90// Some hists are only made if run number is
91// is > 3675. We need a flag to prevent any
92// attempt to fill them which results in a
93// seg. fault.
94bool hists3675 = false;
95
96
97//----------------------------------------------------------------------------------
98
99
100// Routine used to create our JEventProcessor
101extern "C"{
102 void InitPlugin(JApplication *app){
103 InitJANAPlugin(app);
104 app->AddProcessor(new JEventProcessor_CDC_expert());
105 }
106}
107
108
109//----------------------------------------------------------------------------------
110
111
112JEventProcessor_CDC_expert::JEventProcessor_CDC_expert() {
113
114 initialized_histograms = false;
115}
116
117
118//----------------------------------------------------------------------------------
119
120
121JEventProcessor_CDC_expert::~JEventProcessor_CDC_expert() {
122}
123
124
125//----------------------------------------------------------------------------------
126
127jerror_t JEventProcessor_CDC_expert::init(void) {
128
129 // I moved all the histogram setup into the brun so that I can use different
130 // scales for the later runs using the new firmware. NSJ.
131
132 return NOERROR;
133}
134
135
136//----------------------------------------------------------------------------------
137
138
139jerror_t JEventProcessor_CDC_expert::brun(JEventLoop *eventLoop, int32_t runnumber) {
140 // This is called whenever the run number changes
141
142 japp->RootWriteLock(); //ACQUIRE ROOT LOCK!!
143
144 // Do not initialize ROOT objects twice!
145 if(initialized_histograms){
146 japp->RootUnLock();
147 return NOERROR;
148 }
149
150 // max values for histogram scales, modified fa250-format readout
151
152 // Int_t IMAX = 524288; //max for raw integral, fa250-format, 19 bits
153 Int_t IMAX = 400000; //max for raw integral
154 Int_t PMAX = 512; //max for pedestal, fa250-format max is 512
155 Int_t AMAX = 4096; //max for amplitude, fa250-format, 12 bits
156 Int_t RTMAX = 12000;
157 Int_t RTVSNMAX = 8192; //raw time vs straw histogram range ends at this value
158
159 Char_t rtunits[8] = "0.125ns"; //raw time is in units of sample/64 = ns/8
160
161 if (runnumber > 3675) { //new fa125 format firmware, from 11 Sept 2015
162
163 // raw quantities for read out (125 format) are
164 // time field max 2047 scaled x 1, units 0.8ns
165 // time qf field max 1
166 // overflow count field max 7
167 // pedestal field max 255 scaled x 1/4 initially
168 // max amplitude 9 bits, field max 511 scaled x 1/8
169 // integral field max 16383 scaled x 1/14
170
171
172 // max values for histogram scales, fa125-format readout
173
174 IMAX = 16384; //max for raw integral, fa125-format, 14 bits
175 PMAX = 256; //max for pedestal, fa125-format, 8 bits
176 AMAX = 512; //max for amplitude, fa125-format, 9 bits
177 RTMAX = 2048; //max for raw time, fa125-format, 11 bits
178 RTVSNMAX = 1024; //raw time vs straw histogram range ends at this value
179
180 sprintf(rtunits,"0.8ns"); //raw time is in units of sample/10 = 0.8ns
181
182 }
183
184
185 const Int_t EMAX = 21000; //max for E histograms, fC
186 // const Int_t EMAX = 21000000; //max for E histograms, fC
187 // E histograms filled with a_scale*gains*(integration-pedestal)
188
189 const Int_t TMAX = 2000; //max for t histograms, ns
190 // t histograms filled with t_scale*(raw-t - offset) + tmin
191
192
193 const Int_t NSTRAWS = 3522;
194 const Float_t HALF = 0.5;
195 const Float_t NSTRAWSPH = 3522.5;
196
197
198 // create root folder for cdc and cd to it, store main dir
199 TDirectory *main = gDirectory(TDirectory::CurrentDirectory());
200 gDirectory(TDirectory::CurrentDirectory())->mkdir("CDC_expert")->cd();
201
202
203
204 // book histograms
205
206 //number of straws in each ring, starts with 0 so that straws[1] is the number of straws in ring 1
207 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};
208
209
210 cdc_e = new TH1D("cdc_e","CDC charge (fC);charge (fC)",200,0,EMAX);
211 cdc_e_vs_n = new TH2D("cdc_e_vs_n","CDC charge (fC) vs straw number;straw;charge (fC)",NSTRAWS,HALF,NSTRAWSPH,100,0,EMAX);
212
213 cdc_e_vs_t = new TH2D("cdc_e_vs_t","CDC charge (fC) vs time (ns);time (ns);charge (fC)",150,-250,TMAX,100,0,EMAX);
214
215
216 cdc_t = new TH1D("cdc_t","CDC time (ns);time (ns)",300,-250,TMAX);
217 cdc_t_vs_n = new TH2D("cdc_t_vs_n","CDC time (ns) vs straw number;straw;time (ns)",NSTRAWS,HALF,NSTRAWSPH,150,-250,TMAX);
218
219
220
221
222 cdc_raw_int_vs_t = new TH2I("cdc_raw_int_vs_t",Form("CDC integral (ADC units), pedestal subtracted, vs raw time (units of %s);time (%s);integral, pedestal subtracted (ADC units)",rtunits,rtunits),(Int_t)256,0,RTVSNMAX,100,0,IMAX);
223
224
225
226 cdc_windata_ped_roc25 = new TH2I("cdc_windata_ped_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);
227 cdc_windata_ped_roc26 = new TH2I("cdc_windata_ped_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);
228 cdc_windata_ped_roc27 = new TH2I("cdc_windata_ped_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);
229 cdc_windata_ped_roc28 = new TH2I("cdc_windata_ped_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);
230
231
232
233 if (runnumber > 3675) { //new fa125 format firmware, from 11 Sept 2015
234
235 gDirectory(TDirectory::CurrentDirectory())->mkdir("bad_t","CDC Bad time flagged")->cd();
236
237 hists3675 = true;
238
239 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);
240 cdc_ped_badt = new TH1I("cdc_ped_badt","CDC pedestal, events with bad time flagged;straw;pedestal",256,0,PMAX);
241 cdc_raw_t_badt = new TH1I("cdc_raw_t_badt",Form("CDC raw time (units of %s), events with bad time flagged;straw;raw time (%s)",rtunits,rtunits),256,0,RTMAX);
242 cdc_raw_amp_badt = new TH1I("cdc_raw_amp_badt","CDC amplitude (ADC units), events with bad time flagged;ADC units",256,0,AMAX);
243 cdc_raw_int_badt = new TH1I("cdc_raw_intpp_badt","CDC integral (ADC units), pedestal subtracted, events with bad time flagged;ADC units",100,0,IMAX);
244 cdc_raw_intpp_badt = new TH1I("cdc_raw_intpp_badt","CDC integral (ADC units), including pedestal, events with bad time flagged;ADC units",100,0,IMAX);
245
246 gDirectory(TDirectory::CurrentDirectory())->cd("../");
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 (units of %s), events with ADC overflow;raw time (%s)",rtunits,rtunits),256,0,RTMAX);
252 cdc_raw_amp_overflow = new TH1I("cdc_raw_amp_overflow","CDC amplitude (ADC units), events with ADC overflow;ADC units",256,0,AMAX);
253 cdc_raw_int_overflow = new TH1I("cdc_raw_intpp_overflow","CDC integral (ADC units), pedestal subtracted, events with ADC overflow;ADC units",100,0,IMAX);
254 cdc_raw_intpp_overflow = new TH1I("cdc_raw_intpp_overflow","CDC integral (ADC units), including pedestal, events with ADC overflow;ADC units",100,0,IMAX);
255
256 gDirectory(TDirectory::CurrentDirectory())->cd("../");
257
258 }
259
260 Int_t i;
261
262
263 gDirectory(TDirectory::CurrentDirectory())->mkdir("rings_e_vs_t","CDC rings: charge vs time")->cd();
264
265 for (i=1; i<29; i++) {
266 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)",150,0,TMAX,100,0,EMAX);
267 }
268
269 gDirectory(TDirectory::CurrentDirectory())->cd("../");
270
271
272 gDirectory(TDirectory::CurrentDirectory())->mkdir("rings_int_vs_raw_t","CDC rings: integral vs raw time (pedestal subtracted)")->cd();
273
274 for (i=1; i<29; i++) {
275 cdc_raw_int_vs_t_ring[i] = new TH2I(Form("cdc_raw_int_vs_t_ring[%i]",i),Form("CDC integral (ADC units), pedestal subtracted, vs raw time (%s);raw time (%s);integral, pedestal subtracted (ADC units)",rtunits,rtunits),256,0,RTVSNMAX,100,0,IMAX);
276
277 }
278
279 gDirectory(TDirectory::CurrentDirectory())->cd("../");
280
281
282
283 gDirectory(TDirectory::CurrentDirectory())->mkdir("rings_e","CDC rings: charge vs straw")->cd();
284
285 for (i=1; i<29; i++) {
286 cdc_e_ring[i] = new TH2D(Form("cdc_e_ring[%i]",i),Form("CDC charge (fC), ring %i;straw;charge (fC)",i),straws[i],HALF,straws[i]+HALF,100,0,EMAX);
287 }
288
289 gDirectory(TDirectory::CurrentDirectory())->cd("../");
290 gDirectory(TDirectory::CurrentDirectory())->mkdir("rings__t","CDC rings: time vs straw")->cd();
291
292 for (i=1; i<29; i++) {
293 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,150,0,TMAX);
294 }
295
296
297 gDirectory(TDirectory::CurrentDirectory())->cd("../");
298 gDirectory(TDirectory::CurrentDirectory())->mkdir("rings_pedestal","CDC rings: pedestal vs straw")->cd();
299
300 for (i=1; i<29; i++) {
301 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);
302 }
303
304 gDirectory(TDirectory::CurrentDirectory())->cd("../");
305 gDirectory(TDirectory::CurrentDirectory())->mkdir("rings_windata_pedestal","CDC rings: pedestal from raw window data vs straw")->cd();
306
307 for (i=1; i<29; i++) {
308 cdc_windata_ped_ring[i] = new TH2I(Form("cdc_windata_ped_ring[%i]",i),Form("CDC pedestal (ADC units) from raw window data, ring %i;straw;pedestal",i),straws[i],HALF,straws[i]+HALF,(Int_t)PMAX/2,0,PMAX);
309 }
310
311
312
313
314
315 gDirectory(TDirectory::CurrentDirectory())->cd("../");
316 gDirectory(TDirectory::CurrentDirectory())->mkdir("rings_raw_t","CDC rings: raw time vs straw")->cd();
317
318 for (i=1; i<29; i++) {
319 cdc_raw_t_ring[i] = new TH2I(Form("cdc_raw_t_ring[%i]",i),Form("CDC raw time (units of %s), ring %i;straw;raw time (%s)",rtunits,i,rtunits),straws[i],HALF,straws[i]+HALF,256,0,RTVSNMAX);
320 }
321
322
323 gDirectory(TDirectory::CurrentDirectory())->cd("../");
324 gDirectory(TDirectory::CurrentDirectory())->mkdir("rings_raw_amp","CDC rings: amplitude")->cd();
325
326 for (i=1; i<29; i++) {
327 cdc_raw_amp_ring[i] = new TH2I(Form("cdc_raw_amp_ring[%i]",i),Form("CDC amplitude (ADC units), ring %i",i),straws[i],HALF,straws[i]+HALF,256,0,AMAX);
328 }
329
330
331
332 gDirectory(TDirectory::CurrentDirectory())->cd("../");
333 gDirectory(TDirectory::CurrentDirectory())->mkdir("rings_raw_integral","CDC rings: integral vs straw (pedestal subtracted)")->cd();
334
335 for (i=1; i<29; i++) {
336 cdc_raw_int_ring[i] = new TH2I(Form("cdc_raw_int_ring[%i]",i),Form("CDC integral (ADC units), pedestal subtracted, ring %i",i),straws[i],HALF,straws[i]+HALF,100,0,IMAX);
337 }
338
339
340 gDirectory(TDirectory::CurrentDirectory())->cd("../");
341 gDirectory(TDirectory::CurrentDirectory())->mkdir("rings_raw_integral_incl_ped","CDC rings: integral vs straw (including pedestal)")->cd();
342
343 for (i=1; i<29; i++) {
344 cdc_raw_intpp_ring[i] = new TH2I(Form("cdc_raw_intpp_ring[%i]",i),Form("CDC integral (ADC units), including pedestal, ring %i",i),straws[i],HALF,straws[i]+HALF,100,0,IMAX);
345 }
346
347
348
349 // back to main dir
350 main->cd();
351
352 initialized_histograms = true;
353
354 japp->RootUnLock(); //RELEASE ROOT LOCK!!
355
356
357 return NOERROR;
358}
359
360
361//----------------------------------------------------------------------------------
362
363
364jerror_t JEventProcessor_CDC_expert::evnt(JEventLoop *eventLoop, uint64_t eventnumber) {
365 // This is called for every event. Use of common resources like writing
366 // to a file or filling a histogram should be mutex protected. Using
367 // loop-Get(...) to get reconstructed objects (and thereby activating the
368 // reconstruction algorithm) should be done outside of any mutex lock
369 // since multiple threads may call this method at the same time.
370
371 float q,t; // dcdchits quantities charge, time
372
373 uint32_t qf,ocount; // time quality factor and overflow count from new firmware
374 uint32_t tr,p,a; // dcdcdigihits raw quantities: time, pedestal, amplitude, quality factor, overflow count
375 uint32_t integral; // dcdcdigihits integral, includes pedestal
376 uint32_t integ; // dcdcdigihits integral minus pedestal
377
378 uint16_t ring,straw; // ring and straw numbers from either dcdchits or dcdcdigihits
379 uint16_t n; // straw number, 1 to 3522
380
381 Bool_t PED_SUB; // if this is false, integration window info is missing, so don't plot integrals
382
383 uint32_t total_ped; //total pedestal during integration period
384 uint32_t nsamples_integral; ///< number of samples used in integral
385 uint32_t nsamples_pedestal; ///< number of samples used in pedestal
386
387 uint32_t rocid;
388 uint32_t slot;
389 uint32_t channel;
390
391
392 const uint16_t NPEDSAMPLES=16;
393
394 //add extra 0 at front to use offset[1] for ring 1
395 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};
396
397
398 //first set of histograms is for dcdchits, these are t and q after calibration
399 //second set is for dcdcdigihits, these are the raw quantities
400
401 // get hit data for cdc
402 vector<const DCDCHit*> hits;
403 eventLoop->Get(hits);
404
405 // get raw data for cdc
406 vector<const DCDCDigiHit*> digihits;
407 eventLoop->Get(digihits);
408
409 //get WRD data for new format (until it is linked to CDCPulse)
410 vector<const Df125WindowRawData*> wrdvector;
411 eventLoop->Get(wrdvector);
412
413 // FILL HISTOGRAMS
414 // Since we are filling histograms local to this plugin, it will not interfere with other ROOT operations: can use plugin-wide ROOT fill lock
415 japp->RootFillLock(this); //ACQUIRE ROOT FILL LOCK
416
417 for(uint32_t i=0; i<hits.size(); i++) {
418
419 const DCDCHit *hit = hits[i]; // avoids having to use the uglier “cdcdigihits[0]->” syntax
420
421 if(hit->q>0.0) {
422
423 q = hit->q; // in fC
424 t = hit->t; // in nanoseconds
425 ring = hit->ring;
426 straw = hit->straw;
427
428 n = straw_offset[ring] + straw;
429
430 if (q > 0.0) {
431 cdc_e->Fill(q);
432 cdc_e_vs_n->Fill(n,q);
433 }
434
435 //if (t > 0.0) {
436 cdc_t->Fill(t);
437 cdc_t_vs_n->Fill(n,t);
438 //}
439
440 cdc_e_vs_t->Fill(t,q);
441 cdc_e_vs_t_ring[ring]->Fill(t,q);
442
443 cdc_e_ring[ring]->Fill(straw,q);
444 cdc_t_ring[ring]->Fill(straw,t);
445 }
446 }
447
448
449 for(uint32_t i=0; i<digihits.size(); i++) {
450
451 const DCDCDigiHit *digihit = digihits[i]; // avoids having to use the uglier “cdcdigihits[0]->” syntax
452
453 // Get pointers to the underlying objects of interest
454 const Df125PulseIntegral *pi = NULL__null;
455 const Df125PulsePedestal *pp = NULL__null;
456 const Df125WindowRawData *windat = NULL__null;
457 const Df125CDCPulse *cp = NULL__null;
458
459
460 vector<uint16_t> samples;
461 uint32_t winped=0;
462
463 PED_SUB = kFALSE; //set this to true when we find the config params
464 total_ped = 0;
Value stored to 'total_ped' is never read
465
466 rocid = 0;
467 slot = 0;
468 channel = 0;
469 qf = 0;
470 ocount = 0;
471 a = 0;
472
473 //old firmware uses Df125PulseIntegral and Df125PulsePedestal
474 digihit->GetSingle(pi);
475 if (pi) {
476 rocid = pi->rocid;
477 slot = pi->slot;
478 channel = pi->channel;
479 pi->GetSingle(windat);
480 } else if (i < (uint32_t)wrdvector.size()) {
481 windat = wrdvector[i];
482 }
483
484 nsamples_integral = pi ? pi->nsamples_integral : 0;
485 nsamples_pedestal = pi ? pi->nsamples_pedestal : 0;
486
487 if ((nsamples_integral > 0) && (nsamples_pedestal > 0)) PED_SUB = kTRUE;
488
489 digihit->GetSingle(pp);
490 if(pp) a = pp->pulse_peak;
491
492 //new firmware uses Df125CDCPulseData
493 digihit->GetSingle(cp);
494 if (cp) {
495 rocid = cp->rocid;
496 slot = cp->slot;
497 channel = cp->channel;
498 a = cp->first_max_amp;
499 qf = cp->time_quality_bit;
500 ocount = cp->overflow_count;
501 }
502
503
504
505 if (windat) {
506
507 if (windat->samples.size()>=NPEDSAMPLES) {
508
509 winped = 0;
510
511 for (uint16_t j=0; j<NPEDSAMPLES; j++) winped += (uint32_t)windat->samples[j];
512
513 winped = (uint32_t)winped/16.0;
514
515 if (winped > 0) {
516
517 if (rocid == 25) cdc_windata_ped_roc25->Fill(100*slot + channel,winped);
518 if (rocid == 26) cdc_windata_ped_roc26->Fill(100*slot + channel,winped);
519 if (rocid == 27) cdc_windata_ped_roc27->Fill(100*slot + channel,winped);
520 if (rocid == 28) cdc_windata_ped_roc28->Fill(100*slot + channel,winped);
521
522 }
523
524 }//sample size
525 } //windat
526
527
528
529
530 if((digihit->pulse_integral>0)||(digihit->pulse_time>0)) {
531
532 ring = digihit->ring;
533 straw = digihit->straw;
534
535 p = digihit->pedestal;
536 tr = digihit->pulse_time; // raw time in 0.8 ns units
537 integral = digihit->pulse_integral; // pulse integral in fadc units, pedestal not subtracted
538
539 integ = 0;
540
541 //ok to use p for pedestal subtraction here because if fa250 algo fails with p=0, integral=0 and amplitude=0 also
542
543 if (PED_SUB) {
544 total_ped = p*nsamples_integral/nsamples_pedestal;
545 integ = integral - total_ped;
546 }
547
548 // straw_offset[ring] + straw;
549
550 if (PED_SUB) cdc_raw_int_vs_t->Fill(tr,integ);
551 if (PED_SUB) cdc_raw_int_vs_t_ring[ring]->Fill(tr,integ);
552
553 cdc_ped_ring[ring]->Fill(straw,p);
554 cdc_raw_t_ring[ring]->Fill(straw,tr);
555 cdc_raw_amp_ring[ring]->Fill(straw,a); //no ped subtraction in case scaling factors differ
556 if (PED_SUB) cdc_raw_int_ring[ring]->Fill(straw,integ);
557 cdc_raw_intpp_ring[ring]->Fill(straw,integral);
558 if (winped) cdc_windata_ped_ring[ring]->Fill(straw,winped);
559
560
561 if (cp && hists3675) {
562 if (qf==1) { // rough time flag is set
563 cdc_o_badt->Fill(straw,ring);
564 cdc_ped_badt->Fill(p);
565 cdc_raw_t_badt->Fill(tr);
566 cdc_raw_amp_badt->Fill(a);
567 if (PED_SUB) cdc_raw_int_badt->Fill(integ);
568 cdc_raw_intpp_badt->Fill(integral);
569 }
570
571
572 if (ocount>0) { // overflow samples present
573 cdc_o_overflow->Fill(straw,ring);
574 cdc_ped_overflow->Fill(p);
575 cdc_raw_t_overflow->Fill(tr);
576 cdc_raw_amp_overflow->Fill(a);
577 if (PED_SUB) cdc_raw_int_overflow->Fill(integ);
578 cdc_raw_intpp_overflow->Fill(integral);
579 }
580 }
581
582
583 }
584
585 }
586
587
588 japp->RootFillUnLock(this); //RELEASE ROOT FILL LOCK
589
590 return NOERROR;
591}
592
593
594//----------------------------------------------------------------------------------
595
596
597jerror_t JEventProcessor_CDC_expert::erun(void) {
598 // This is called whenever the run number changes, before it is
599 // changed to give you a chance to clean up before processing
600 // events from the next run number.
601 return NOERROR;
602}
603
604
605//----------------------------------------------------------------------------------
606
607
608jerror_t JEventProcessor_CDC_expert::fini(void) {
609 // Called before program exit after event processing is finished.
610 return NOERROR;
611}
612
613
614//----------------------------------------------------------------------------------
615//----------------------------------------------------------------------------------