26#define NUMRAWEVENTS 10
60 auto *debugfile =
new ofstream;
66 cerr <<
"ERROR: Cannot open CODA data" << endl;
67 cerr <<
"Perhaps you mistyped it" << endl;
68 cerr <<
"... exiting." << endl;
76 evdata->SetDebugFile(debugfile);
79 TROOT fadcana(
"tst1190root",
"Hall C analysis");
80 hfile =
new TFile(
"tst1190.root",
"RECREATE",
"1190 module data");
83 cout <<
"***************************************" << endl;
84 cout <<
NUMEVENTS <<
" events will be processed" << endl;
85 cout <<
"***************************************" << endl;
89 for(uint32_t ievent = 0; ievent < iievent; ievent++) {
94 if( status != CodaDecoder::HED_OK && status != CodaDecoder::HED_WARN ) {
95 cerr <<
"ERROR " << status <<
" while decoding event " << ievent
96 <<
". Exiting." << endl;
100 if (debugfile) *debugfile <<
"****************" << endl;
101 if (debugfile) *debugfile <<
"Event Number = " << evdata->GetEvNum() << endl;
102 if (debugfile) *debugfile <<
"****************\n" << endl;
106 if (evdata->GetNumRaw(
CRATE3, islot) != 0) {
109 if (tdc !=
nullptr) {
110 if (debugfile) *debugfile <<
"\n///////////////////////////////\n"
111 <<
"Results for crate "
113 << tdc->GetSlot() << endl;
115 if (debugfile) *debugfile << hex <<
"tdc pointer = " << tdc <<
"\n" << dec
116 <<
"///////////////////////////////\n" << endl;
122 for (
Int_t hitno = 0; hitno < 16; hitno++) {
123 if (tdc->GetData(
chan, hitno) != 0)
129 if (debugfile) *debugfile <<
"TDC MODULE NOT FOUND!!!" << endl;
132 }
else if( status != EOF ) {
133 cerr <<
"ERROR " << status <<
" while reading CODA event " << ievent
134 <<
". Twonk." << endl;
137 if (iievent % 1000 == 0)
139 cout << iievent <<
" events have been processed" << endl;
141 if (status == EOF)
break;
144 cout <<
"***************************************" << endl;
145 cout << iievent - 1 <<
" events were processed" << endl;
146 cout <<
"***************************************" << endl;
155 printf (
"The analysis took %.1f seconds \n", ((
float) t) / CLOCKS_PER_SEC);
156 printf (
"The analysis event rate is %.1f Hz \n", (iievent - 1) / (((
float) t) / CLOCKS_PER_SEC));
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
char * Form(const char *fmt,...)
virtual UInt_t GetCrate() const
virtual Int_t getCodaVersion()
virtual Int_t codaOpen(const char *filename, Int_t mode=1)
virtual Int_t codaClose()
T * Get(const char *namecycle)
TDirectory * mkdir(const char *name, const char *title="", Bool_t returnExistingDirectory=kFALSE) override
virtual TObject * Get(const char *namecycle)
virtual TDirectory * mkdir(const char *name, const char *title="", Bool_t returnExistingDirectory=kFALSE)
Int_t Write(const char *name=nullptr, Int_t opt=0, Int_t bufsiz=0) const override
void Close(Option_t *option="") override
virtual Int_t Fill(const char *name, Double_t w)
void GeneratePlots(uint32_t islot, uint32_t chan)
TH1I * h_occupancy[NUMSLOTS]
TH1I * h_rawtdc[NUMSLOTS][NTDCCHAN]
TDirectory * chan_dir[NTDCCHAN]
TDirectory * slot_dir[NUMSLOTS]