3 #include "StRccCounterMonitor.h"
5 #include "StEventTypes.h"
6 #include "StEvent/StTriggerData.h"
13 static const int NCRATE=14;
14 static const char* CRATE[NCRATE]={
"L1",
"BC1",
"MXQ",
"MIX",
"BCW",
"BCE",
"FEQ",
15 "BBC",
"BBQ",
"FMS",
"QT1",
"QT2",
"QT3",
"QT4"};
16 static const int MAX=pow(2.0,16)*2.0;
17 static const int NBIN=pow(2.0,12);
21 unsigned int DIFF[NCRATE];
26 LOG_INFO <<
"Constructing StRccCounterMonitor with name=" << name << endm;
32 Int_t StRccCounterMonitor::Init(){
33 int yearday=mRun/1000;
34 sprintf(mFilename,
"%d/rccqa.%d.root",yearday,mRun);
35 mFile =
new TFile(mFilename,
"RECREATE");
37 cout <<
"Creating " << mFilename << endl;
39 cout <<
"Could not create " << mFilename << endl;
42 for(
int i=0; i<NCRATE; i++){
43 mHist[i] =
new TH1F(CRATE[i],CRATE[i],NBIN,0.0,MAX);
45 mTree =
new TTree(
"RCC",
"RCC");
46 mTree->Branch(
"evt",&EVT,
"evt/i");
47 mTree->Branch(
"tcu",&
TCU,
"tcu/i");
48 mTree->Branch(
"diff",&DIFF,
"d[14]/i");
55 printf(
"StRccCounterMonitor::Finish - Closing %s\n",mFilename);
61 cout <<
"StRccCounterMonitor Make() starting..."<<endl;
71 cout <<
"StRccCounterMonitor could not get StTriggerData from DataSet."<<endl;
75 cout <<
"StRccCounterMonitor could not get StTriggerData DataSet."<<endl;
79 EVT=trg->eventNumber();
80 unsigned int tcu =
TCU = trg->tcuCounter();
84 cout <<
"RCCMon TCU ";
85 for(
int i=0; i<NCRATE; i++){
86 cout << Form(
"%8s ",CRATE[i]);
91 cout << Form(
"RCCMon %10d ",tcu);
93 for(
int i=0; i<NCRATE; i++){
94 unsigned int rcc = trg->rccCounter(i+1);
95 unsigned int diff = rcc-tcu;
100 const long long one=1;
101 const long long m=one<<32;
104 diff=(
unsigned int)(r+m-t);
108 if(mDebug>1) cout << Form(
"%3s=%10u tcu=%10u diff=%10u\n",CRATE[i],rcc,tcu,diff);
109 if(mDebug==1) cout << Form(
"%8u ",diff);
111 mHist[i]->Fill(
float(diff));
114 if(mDebug==1) cout << endl;
virtual TObject * GetObject() const
The depricated method (left here for the sake of the backward compatibility)