9 #include <onlmon/OnlMon.h>
10 #include <onlmon/OnlMonDB.h>
11 #include <onlmon/OnlMonServer.h>
13 #include <Event/msg_profile.h>
15 #include <Event/Event.h>
16 #include <Event/EventTypes.h>
17 #include <Event/packet.h>
22 #include <bbc/BbcGeomV1.h>
29 #include <TGraphErrors.h>
64 printf(
"BbcMon::Init()\n");
86 title <<
"BBC Raw TDC Distribution";
87 bbc_tdc =
new TH2F(name.str().c_str(), title.str().c_str(),
94 name <<
"bbc_tdc_overflow";
95 title <<
"BBC/MBD TDC Overflow Deviation";
104 for (
int ipmt = 0; ipmt <
nPMT_BBC; ipmt++)
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;
119 bbc_tdc_armhittime =
new TH2F(
"bbc_tdc_armhittime",
"Arm-Hit-Time Correlation of North and South BBC/MBD",
129 bbc_zvertex->GetYaxis()->SetTitle(
"Number of Event");
135 bbc_zvertex_bbll1 =
new TH1F(
"bbc_zvertex_bbll1",
"BBC/MBD ZVertex (All triggers)",
145 bbc_zvertex_short =
new TH1F(
"bbc_zvertex_short",
"BBC/MBD ZVertex (All triggers), short time scale",
155 f_zvtx =
new TF1(
"f_zvtx",
"gaus", -30., 30.);
157 "The nEvent Counter bin1:Total Event bin2:Collision Event bin3:Laser Event",
162 bbc_tzero_zvtx =
new TH2F(
"bbc_tzero_zvtx",
"TimeZero vs ZVertex", 100, -200, 200, 110, -16, 16);
166 bbc_avr_hittime =
new TH1F(
"bbc_avr_hittime",
"BBC/MBD Average Hittime", 128, 0, 24);
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);
263 for (
int ipmt=0; ipmt<128; ipmt++)
268 std::cout << ipmt <<
"\t" << xcent <<
"\t" << ycent << std::endl;
340 std::cout <<
"BbcMon::BeginRun(), run " << runno << std::endl;
372 if ( !p[0] || !p[1] )
375 std::ostringstream
msg;
376 msg <<
"BBC/MBD packet not found" ;
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) )
392 std::ostringstream
msg;
393 msg <<
"BBC/MBD packets have bad checksum(s)" ;
408 bevt->setRawData(evt);
411 if ( bevt->calib_is_done() == 0 )
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);
426 static int counter = 0;
430 std::cout <<
"zt\t" << f_evt <<
"\t" << zvtx <<
"\t" << t0 << std::endl;
445 if ( n_goodevt%1000 == 0 )
447 f_zvtx->SetRange( -75., 75. );
448 f_zvtx->SetParameters( 250, 0., 10 );
456 std::ostringstream
msg;
457 msg <<
"BBC/MBD zvertex mean/width: " << mean <<
" " <<
rms;
459 std::cout <<
"BBC/MBD zvtx mean/width: " << mean <<
" " << rms << std::endl;
464 for (
int ipmt=0; ipmt<128; ipmt++)
466 float q = bevt->getQ(ipmt);
472 float tq = bevt->getTQ(ipmt);
488 for (
int ipmt=0; ipmt<128; ipmt++)
490 int tch = (ipmt/8)*16 + ipmt%8;
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++)
502 bbcsig = bevt->GetSig( qch );
507 for (
int isamp=0; isamp<
n; isamp++)
516 float q = bevt->getQ(ipmt);