Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BbcMon.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file BbcMon.cc
1 // use #include "" only for your local include and put
2 // those in the first line(s) before any #include <>
3 // otherwise you are asking for weird behavior
4 // (more info - check the difference in include path search when using "" versus <>)
5 
6 #include "BbcMon.h"
7 #include "BbcMonDefs.h"
8 
9 #include <onlmon/OnlMon.h>
10 #include <onlmon/OnlMonDB.h>
11 #include <onlmon/OnlMonServer.h>
12 
13 #include <Event/msg_profile.h>
14 
15 #include <Event/Event.h>
16 #include <Event/EventTypes.h>
17 #include <Event/packet.h>
18 
19 #include "OnlBbcEvent.h"
20 #include "OnlBbcSig.h"
21 
22 #include <bbc/BbcGeomV1.h>
23 
24 #include <TH1.h>
25 #include <TH2.h>
26 #include <TF1.h>
27 #include <TH2Poly.h>
28 #include <TString.h>
29 #include <TGraphErrors.h>
30 
31 #include <cmath>
32 #include <cstdio> // for printf
33 #include <fstream>
34 #include <iomanip>
35 #include <iostream>
36 #include <sstream>
37 #include <string> // for allocator, string, char_traits
38 
39 enum
40 {
43 };
44 
46  : OnlMon(name)
47 {
48  // leave ctor fairly empty, its hard to debug if code crashes already
49  // during a new BbcMon()
50  return;
51 }
52 
54 {
55  delete bevt;
56  delete bbcgeom;
57  return;
58 }
59 
61 {
62  // use printf for stuff which should go the screen but not into the message
63  // system (all couts are redirected)
64  printf("BbcMon::Init()\n");
65 
66  bevt = new OnlBbcEvent();
67 
68  /*
69  // read our calibrations from BbcMonData.dat
70  const char *bbccalib = getenv("BBCCALIB");
71  if (!bbccalib)
72  {
73  std::cout << "BBCCALIB environment variable not set" << std::endl;
74  exit(1);
75  }
76  std::string gainfile = std::string(bbccalib) + "/" + "bbc_mip.calib";
77  Read_Charge_Calib( gainfile );
78  */
79 
80  // Book Histograms
81  std::ostringstream name, title;
82 
83  // TDC Distribution ----------------------------------------------------
84 
85  name << "bbc_tdc";
86  title << "BBC Raw TDC Distribution";
87  bbc_tdc = new TH2F(name.str().c_str(), title.str().c_str(),
88  nPMT_BBC, -.5, nPMT_BBC - .5,
90  name.str("");
91  title.str("");
92 
93  // TDC Overflow Deviation ----------------------------------------------
94  name << "bbc_tdc_overflow";
95  title << "BBC/MBD TDC Overflow Deviation";
96  bbc_tdc_overflow = new TH2F(name.str().c_str(), title.str().c_str(),
97  nPMT_BBC, -.5, nPMT_BBC - .5,
100  name.str("");
101  title.str("");
102 
103  // TDC Overflow Distribution for each PMT ------------------------------
104  for (int ipmt = 0; ipmt < nPMT_BBC; ipmt++)
105  {
106  name << "bbc_tdc_overflow_" << std::setw(3) << std::setfill('0') << ipmt;
107  title << "BBC/MBD TDC Overflow Deviation of #" << std::setw(3) << std::setfill('0') << ipmt;
108  bbc_tdc_overflow_each[ipmt] = new TH1F(name.str().c_str(), title.str().c_str(),
111  name.str("");
112  title.str("");
113  }
114 
115  // ADC Distribution --------------------------------------------------------
116 
117  bbc_adc = new TH2F("bbc_adc", "BBC/MBD ADC(Charge) Distribution", nPMT_BBC, -.5, nPMT_BBC - .5, bbc_onlmon::nBIN_ADC, 0, bbc_onlmon::MAX_ADC_MIP);
118 
119  bbc_tdc_armhittime = new TH2F("bbc_tdc_armhittime", "Arm-Hit-Time Correlation of North and South BBC/MBD",
122  bbc_tdc_armhittime->GetXaxis()->SetTitle("South [ns]");
123  bbc_tdc_armhittime->GetYaxis()->SetTitle("North [ns]");
124 
125  // Vertex Distributions --------------------------------------------------------
126 
127  bbc_zvertex = new TH1F("bbc_zvertex", "BBC/MBD ZVertex (all trigs, wide)", 128, bbc_onlmon::min_zvertex, bbc_onlmon::max_zvertex);
128  bbc_zvertex->GetXaxis()->SetTitle("ZVertex [cm]");
129  bbc_zvertex->GetYaxis()->SetTitle("Number of Event");
130  bbc_zvertex->GetXaxis()->SetTitleSize(0.05);
131  bbc_zvertex->GetYaxis()->SetTitleSize(0.05);
132  bbc_zvertex->GetXaxis()->SetTitleOffset(0.70);
133  bbc_zvertex->GetYaxis()->SetTitleOffset(1.75);
134 
135  bbc_zvertex_bbll1 = new TH1F("bbc_zvertex_bbll1", "BBC/MBD ZVertex (All triggers)",
137  bbc_zvertex_bbll1->Sumw2();
138  bbc_zvertex_bbll1->GetXaxis()->SetTitle("ZVertex [cm]");
139  bbc_zvertex_bbll1->GetYaxis()->SetTitle("Number of Event");
140  bbc_zvertex_bbll1->GetXaxis()->SetTitleSize(0.05);
141  bbc_zvertex_bbll1->GetYaxis()->SetTitleSize(0.05);
142  bbc_zvertex_bbll1->GetXaxis()->SetTitleOffset(0.70);
143  bbc_zvertex_bbll1->GetYaxis()->SetTitleOffset(1.75);
144 
145  bbc_zvertex_short = new TH1F("bbc_zvertex_short", "BBC/MBD ZVertex (All triggers), short time scale",
147  bbc_zvertex_short->Sumw2();
148  bbc_zvertex_short->GetXaxis()->SetTitle("ZVertex [cm]");
149  bbc_zvertex_short->GetYaxis()->SetTitle("Number of Event");
150  bbc_zvertex_short->GetXaxis()->SetTitleSize(0.05);
151  bbc_zvertex_short->GetYaxis()->SetTitleSize(0.05);
152  bbc_zvertex_short->GetXaxis()->SetTitleOffset(0.70);
153  bbc_zvertex_short->GetYaxis()->SetTitleOffset(1.75);
154 
155  f_zvtx = new TF1("f_zvtx", "gaus", -30., 30.);
156  bbc_nevent_counter = new TH1F("bbc_nevent_counter",
157  "The nEvent Counter bin1:Total Event bin2:Collision Event bin3:Laser Event",
158  16, 0, 16);
159 
160  // bbc_tzero_zvtx = new TH2F("bbc_tzero_zvtx",
161  // "TimeZero vs ZVertex", 100, -200, 200, 110, -11, 11 );
162  bbc_tzero_zvtx = new TH2F("bbc_tzero_zvtx", "TimeZero vs ZVertex", 100, -200, 200, 110, -16, 16);
163  bbc_tzero_zvtx->SetXTitle("ZVertex [cm]");
164  bbc_tzero_zvtx->SetYTitle("TimeZero[ns]");
165 
166  bbc_avr_hittime = new TH1F("bbc_avr_hittime", "BBC/MBD Average Hittime", 128, 0, 24);
167  bbc_avr_hittime->Sumw2();
168  bbc_avr_hittime->GetXaxis()->SetTitle("Avr HitTime [ns]");
169  bbc_avr_hittime->GetYaxis()->SetTitle("Number of Event");
170  bbc_avr_hittime->GetXaxis()->SetTitleSize(0.05);
171  bbc_avr_hittime->GetYaxis()->SetTitleSize(0.05);
172  bbc_avr_hittime->GetXaxis()->SetTitleOffset(0.70);
173  bbc_avr_hittime->GetYaxis()->SetTitleOffset(1.75);
174 
175  // should make plots of the raw tdc for time channels
176  //bbc_south_hittime = new TH1F("bbc_south_hittime", "BBC South Hittime", 164, -100, 16300);
177  //bbc_north_hittime = new TH1F("bbc_north_hittime", "BBC North Hittime", 164, -100, 16300);
178  bbc_south_hittime = new TH1F("bbc_south_hittime", "BBC/MBD South Hittime", 150, -15, 15);
179  bbc_north_hittime = new TH1F("bbc_north_hittime", "BBC/MBD North Hittime", 150, -15, 15);
180 
181  bbc_south_hittime->GetXaxis()->SetTitle("South HitTime [ns]");
182  bbc_south_hittime->GetYaxis()->SetTitle("Number of Event");
183  bbc_south_hittime->GetXaxis()->SetTitleSize(0.05);
184  bbc_south_hittime->GetYaxis()->SetTitleSize(0.05);
185  bbc_south_hittime->GetXaxis()->SetTitleOffset(0.70);
186  bbc_south_hittime->GetYaxis()->SetTitleOffset(1.75);
187 
188  bbc_north_hittime->GetXaxis()->SetTitle("North HitTime [ns]");
189  bbc_north_hittime->GetYaxis()->SetTitle("Number of Event");
190  bbc_north_hittime->GetXaxis()->SetTitleSize(0.05);
191  bbc_north_hittime->GetYaxis()->SetTitleSize(0.05);
192  bbc_north_hittime->GetXaxis()->SetTitleOffset(0.70);
193  bbc_north_hittime->GetYaxis()->SetTitleOffset(1.75);
194 
195  //bbc_south_chargesum = new TH1F("bbc_south_chargesum", "BBC South ChargeSum [MIP]", 128, 0, bbc_onlmon::MAX_CHARGE_SUM);
196  //bbc_north_chargesum = new TH1F("bbc_north_chargesum", "BBC North ChargeSum [MIP]", 128, 0, bbc_onlmon::MAX_CHARGE_SUM);
197  bbc_south_chargesum = new TH1F("bbc_south_chargesum", "BBC South ChargeSum [AU]", 128, 0, bbc_onlmon::MAX_CHARGE_SUM);
198  bbc_north_chargesum = new TH1F("bbc_north_chargesum", "BBC North ChargeSum [AU]", 128, 0, bbc_onlmon::MAX_CHARGE_SUM);
199 
200  bbc_north_chargesum->SetTitle("BBC/MBD ChargeSum [MIP]");
201  bbc_north_chargesum->GetXaxis()->SetTitle("ChargeSum [MIP]");
202  // bbc_north_chargesum->GetXaxis()->SetTitle("North ChargeSum [MIP]");
203  bbc_north_chargesum->GetYaxis()->SetTitle("Number of Event");
204  bbc_north_chargesum->GetXaxis()->SetTitleSize(0.05);
205  bbc_north_chargesum->GetYaxis()->SetTitleSize(0.05);
206  bbc_north_chargesum->GetXaxis()->SetTitleOffset(0.70);
207  bbc_north_chargesum->GetYaxis()->SetTitleOffset(1.75);
208 
209  // bbc_south_chargesum->GetXaxis()->SetTitle("South ChargeSum [MIP]");
210  bbc_south_chargesum->GetYaxis()->SetTitle("Number of Event");
211  bbc_south_chargesum->GetXaxis()->SetTitleSize(0.05);
212  bbc_south_chargesum->GetYaxis()->SetTitleSize(0.05);
213  bbc_south_chargesum->GetXaxis()->SetTitleOffset(0.70);
214  bbc_south_chargesum->GetYaxis()->SetTitleOffset(1.75);
215 
216  // scale down factor for each trigger
217  bbc_prescale_hist = new TH1F("bbc_prescale_hist", "", 100, 0, 100);
218 
219  // waveforms
220  bbc_time_wave = new TH2F("bbc_time_wave","time waveforms by ch",bbc_onlmon::BBC_NSAMPLES,-0.5,bbc_onlmon::BBC_NSAMPLES-0.5,128,0,128);
221  bbc_charge_wave = new TH2F("bbc_charge_wave","charge waveforms by ch",bbc_onlmon::BBC_NSAMPLES,-0.5,bbc_onlmon::BBC_NSAMPLES-0.5,128,0,128);
222 
223  bbc_time_wave->GetXaxis()->SetTitle("Sample");
224  bbc_time_wave->GetYaxis()->SetTitle("Ch");
225  bbc_time_wave->GetXaxis()->SetTitleSize(0.05);
226  bbc_time_wave->GetYaxis()->SetTitleSize(0.05);
227  bbc_time_wave->GetXaxis()->SetTitleOffset(0.70);
228  bbc_time_wave->GetYaxis()->SetTitleOffset(1.75);
229  bbc_charge_wave->GetXaxis()->SetTitle("Sample");
230  bbc_charge_wave->GetYaxis()->SetTitle("Ch");
231  bbc_charge_wave->GetXaxis()->SetTitleSize(0.05);
232  bbc_charge_wave->GetYaxis()->SetTitleSize(0.05);
233  bbc_charge_wave->GetXaxis()->SetTitleOffset(0.70);
234  bbc_charge_wave->GetYaxis()->SetTitleOffset(1.75);
235 
236  // hitmaps
237  bbc_south_hitmap = new TH2Poly();
238  bbc_south_hitmap->SetName( "bbc_south_hitmap" );
239  bbc_south_hitmap->SetTitle( "BBC/MBD South Hitmap" );
240  bbc_south_hitmap->GetXaxis()->SetTitle("x (cm)");
241  bbc_south_hitmap->GetYaxis()->SetTitle("y (cm)");
242  bbc_south_hitmap->GetXaxis()->SetTitleSize(0.05);
243  bbc_south_hitmap->GetYaxis()->SetTitleSize(0.05);
244  bbc_south_hitmap->GetXaxis()->SetTitleOffset(0.70);
245  bbc_south_hitmap->GetYaxis()->SetTitleOffset(0.70);
246  bbc_south_hitmap->SetMinimum(0.1);
247 
248  bbc_north_hitmap = new TH2Poly();
249  bbc_north_hitmap->SetName( "bbc_north_hitmap" );
250  bbc_north_hitmap->SetTitle( "BBC/MBD North Hitmap" );
251  bbc_north_hitmap->GetXaxis()->SetTitle("x (cm)");
252  bbc_north_hitmap->GetYaxis()->SetTitle("y (cm)");
253  bbc_north_hitmap->GetXaxis()->SetTitleSize(0.05);
254  bbc_north_hitmap->GetYaxis()->SetTitleSize(0.05);
255  bbc_north_hitmap->GetXaxis()->SetTitleOffset(0.70);
256  bbc_north_hitmap->GetYaxis()->SetTitleOffset(0.70);
257  bbc_north_hitmap->SetMinimum(0.1);
258 
259  // Get the detector geometry
260  bbcgeom = new BbcGeomV1{};
261  Double_t x[6]; // x,y location of the 6 points of the BBC hexagonal PMT's, in cm
262  Double_t y[6];
263  for (int ipmt=0; ipmt<128; ipmt++)
264  {
265  float xcent = bbcgeom->get_x(ipmt);
266  float ycent = bbcgeom->get_y(ipmt);
267  int arm = bbcgeom->get_arm(ipmt);
268  std::cout << ipmt << "\t" << xcent << "\t" << ycent << std::endl;
269 
270  // create hexagon
271  x[0] = xcent - 0.8; // in cm
272  y[0] = ycent + 1.4;
273  x[1] = xcent + 0.8;
274  y[1] = ycent + 1.4;
275  x[2] = xcent + 1.6;
276  y[2] = ycent;
277  x[3] = xcent + 0.8;
278  y[3] = ycent - 1.4;
279  x[4] = xcent - 0.8;
280  y[4] = ycent - 1.4;
281  x[5] = xcent - 1.6;
282  y[5] = ycent;
283 
284  if ( arm==0 )
285  {
286  bbc_south_hitmap->AddBin(6,x,y);
287  }
288  else if ( arm==1 )
289  {
290  bbc_north_hitmap->AddBin(6,x,y);
291  }
292 
293  }
294 
295 
296  // register histograms with server otherwise client won't get them
298 
299  se->registerHisto(this, bbc_adc);
300  se->registerHisto(this, bbc_tdc);
301  se->registerHisto(this, bbc_tdc_overflow);
302  for (auto &ipmt : bbc_tdc_overflow_each)
303  {
304  se->registerHisto(this, ipmt);
305  }
306 
308  se->registerHisto(this, bbc_zvertex);
309  se->registerHisto(this, bbc_zvertex_bbll1);
311  se->registerHisto(this, bbc_tzero_zvtx);
312  se->registerHisto(this, bbc_prescale_hist);
313  se->registerHisto(this, bbc_avr_hittime);
314  se->registerHisto(this, bbc_north_hittime);
315  se->registerHisto(this, bbc_south_hittime);
318  se->registerHisto(this, bbc_north_hitmap);
319  se->registerHisto(this, bbc_south_hitmap);
320  /*
321  se->registerHisto(this, bbc_tmax[0]);
322  se->registerHisto(this, bbc_tmax[1]);
323  */
324  se->registerHisto(this, bbc_time_wave);
325  se->registerHisto(this, bbc_charge_wave);
326 
327  /*
328  dbvars = new OnlMonDB(ThisName); // use monitor name for db table name
329  DBVarInit();
330  */
331  Reset();
332 
333  return 0;
334 }
335 
336 int BbcMon::BeginRun(const int runno)
337 {
338  // if you need to read calibrations on a run by run basis
339  // this is the place to do it
340  std::cout << "BbcMon::BeginRun(), run " << runno << std::endl;
341  Reset();
342  bevt->InitRun();
343 
344  return 0;
345 }
346 
347 int BbcMon::EndRun(const int /* runno */)
348 {
349  // This does nothing for now, but can put summary info here for debugging
350 
351  return 0;
352 }
353 
354 
356 {
357  if (evt->getEvtType() != DATAEVENT)
358  {
359  return 0;
360  }
361 
362  evtcnt++;
363  bbc_nevent_counter->Fill(0);
364 
365  [[maybe_unused]] OnlMonServer *se = OnlMonServer::instance();
366 
367  Packet *p[2];
368  p[0] = evt->getPacket(1001);
369  p[1] = evt->getPacket(1002);
370 
371  // Check that we have both MBD/BBC packets
372  if ( !p[0] || !p[1] )
373  {
374  se = OnlMonServer::instance();
375  std::ostringstream msg;
376  msg << "BBC/MBD packet not found" ;
377  se->send_message(this,MSG_SOURCE_BBC,MSG_SEV_WARNING, msg.str(),1);
378  msg.str("");
379  bbc_nevent_counter->Fill(3); // bad event, missing packets
380 
381  delete p[0];
382  delete p[1];
383 
384  return 0;
385  }
386 
387  // Check that both MBD/BBC packets have good checksums
388  if ( (p[0]->iValue(0,"EVENCHECKSUMOK") == 0) || (p[0]->iValue(0,"ODDCHECKSUMOK") == 0) ||
389  (p[1]->iValue(0,"EVENCHECKSUMOK") == 0) || (p[1]->iValue(0,"ODDCHECKSUMOK") == 0) )
390  {
391  se = OnlMonServer::instance();
392  std::ostringstream msg;
393  msg << "BBC/MBD packets have bad checksum(s)" ;
394  se->send_message(this,MSG_SOURCE_BBC,MSG_SEV_WARNING, msg.str(),1);
395  msg.str("");
396  bbc_nevent_counter->Fill(4); // bad event, missing packets
397 
398  delete p[0];
399  delete p[1];
400 
401  return 0;
402  }
403 
404  int f_evt = evt->getEvtSequence();
405 
406  // calculate BBC
407  bevt->Clear();
408  bevt->setRawData(evt);
409  bevt->calculate();
410 
411  if ( bevt->calib_is_done() == 0 )
412  {
413  delete p[0];
414  delete p[1];
415  return 0;
416  }
417 
418  bbc_nevent_counter->Fill(1);
419 
420  double zvtx = bevt->get_bbcz();
421  double t0 = bevt->get_t0();
422  double qsum[2] = {0,0};
423  qsum[0] = bevt->getChargeSum(0);
424  qsum[1] = bevt->getChargeSum(1);
425 
426  static int counter = 0;
427  evtcnt++;
428  if ( counter < 10 )
429  {
430  std::cout << "zt\t" << f_evt << "\t" << zvtx << "\t" << t0 << std::endl;
431  counter++;
432  }
433 
434  // vertex and t0
435  bbc_zvertex->Fill(zvtx);
436  bbc_zvertex_bbll1->Fill(zvtx);
437  bbc_tzero_zvtx->Fill(zvtx, t0);
438  //should this be the mean hit time, not per ipmt?
439  //bbc_south_hittime->Fill( tq );
440  //bbc_north_hittime->Fill( tq );
441 
442  bbc_zvertex_short->Fill(zvtx);
443 
444  int n_goodevt = bbc_nevent_counter->GetBinContent(2);
445  if ( n_goodevt%1000 == 0 )
446  {
447  f_zvtx->SetRange( -75., 75. );
448  f_zvtx->SetParameters( 250, 0., 10 );
449  bbc_zvertex_short->Fit( f_zvtx, "RNQ");
450 
451  // Report z-vertex mean and width
452  Double_t mean = f_zvtx->GetParameter(1);
453  Double_t rms = f_zvtx->GetParameter(2);
454  // we should do a check of a good fit here (skip for now)
455 
456  std::ostringstream msg;
457  msg << "BBC/MBD zvertex mean/width: " << mean << " " << rms;
458  se->send_message(this,MSG_SOURCE_BBC,MSG_SEV_INFORMATIONAL, msg.str(),1);
459  std::cout << "BBC/MBD zvtx mean/width: " << mean << " " << rms << std::endl;
460 
461  bbc_zvertex_short->Reset();
462  }
463 
464  for (int ipmt=0; ipmt<128; ipmt++)
465  {
466  float q = bevt->getQ(ipmt);
467  bbc_adc->Fill(ipmt, q);
468 
469  //std::cout << f_evt << "\tipmt " << ipmt << "\t" << q << "\t";
470  if ( q>0.5 )
471  {
472  float tq = bevt->getTQ(ipmt);
473  if (ipmt<64 )
474  bbc_south_hittime->Fill( tq );
475  else
476  bbc_north_hittime->Fill( tq );
477 
478  //std::cout << tq;
479  }
480  //std::cout << std::endl;
481  }
482 
483  // charge
484  bbc_south_chargesum->Fill(qsum[0]);
485  bbc_north_chargesum->Fill(qsum[1]);
486 
487  // raw waveforms
488  for (int ipmt=0; ipmt<128; ipmt++)
489  {
490  int tch = (ipmt/8)*16 + ipmt%8;
491  OnlBbcSig *bbcsig = bevt->GetSig( tch );
492  TGraphErrors *gwave = bbcsig->GetGraph();
493  Int_t n = gwave->GetN();
494  Double_t *x = gwave->GetX();
495  Double_t *y = gwave->GetY();
496  for (int isamp=0; isamp<n; isamp++)
497  {
498  bbc_time_wave->Fill( x[isamp], ipmt, y[isamp] );
499  }
500 
501  int qch = tch + 8;
502  bbcsig = bevt->GetSig( qch );
503  gwave = bbcsig->GetGraph();
504  n = gwave->GetN();
505  x = gwave->GetX();
506  y = gwave->GetY();
507  for (int isamp=0; isamp<n; isamp++)
508  {
509  bbc_charge_wave->Fill( x[isamp], ipmt, y[isamp] );
510  }
511 
512  // hit map
513  float xcent = bbcgeom->get_x(ipmt);
514  float ycent = bbcgeom->get_y(ipmt);
515  int arm = bbcgeom->get_arm(ipmt);
516  float q = bevt->getQ(ipmt);
517 
518  if ( arm==0 )
519  {
520  bbc_south_hitmap->Fill( xcent, ycent, q );
521  }
522  else if ( arm==1 )
523  {
524  bbc_north_hitmap->Fill( xcent, ycent, q );
525  }
526 
527  }
528 
529  delete p[0];
530  delete p[1];
531 
532  return 0;
533 }
534 
536 {
537  // reset our internal counters
538  evtcnt = 0;
539  //idummy = 0;
540 
541  bbc_adc->Reset();
542  bbc_tdc->Reset();
543  bbc_tdc_overflow->Reset();
544  bbc_tdc_armhittime->Reset();
545  bbc_nevent_counter->Reset();
546  bbc_zvertex->Reset();
547  bbc_zvertex_bbll1->Reset();
548  bbc_zvertex_short->Reset();
549  bbc_tzero_zvtx->Reset();
550  bbc_avr_hittime->Reset();
551  bbc_south_hittime->Reset();
552  bbc_north_hittime->Reset();
553  bbc_south_chargesum->Reset();
554  bbc_north_chargesum->Reset();
555  bbc_prescale_hist->Reset();
556  bbc_time_wave->Reset();
557  bbc_charge_wave->Reset();
558 
559  return 0;
560 }
561 
563 {
564  // variable names are not case sensitive
565  /*
566  std::string varname;
567  varname = "bbcmoncount";
568  dbvars->registerVar(varname);
569  varname = "bbcmondummy";
570  dbvars->registerVar(varname);
571  varname = "bbcmonnew";
572  dbvars->registerVar(varname);
573  if (verbosity > 0)
574  {
575  dbvars->Print();
576  }
577  dbvars->DBInit();
578  */
579  return 0;
580 }
581