13int main(
int argc,
char* argv[])
16 cout <<
"You made a mistake... \n" << endl;
17 cout <<
"Usage: prfact filename" << endl;
18 cout <<
" where 'filename' is the CODA file"<<endl;
19 cout <<
"\n... exiting." << endl;
25 cout <<
"ERROR: Cannot open CODA data" << endl;
26 cout <<
"Perhaps you mistyped it" << endl;
27 cout <<
"... exiting." << endl;
36 evdata->SetOrigPS(133);
37 cout <<
"Origin of PS data "<<evdata->GetOrigPS()<<endl;
42 for (
UInt_t i=0; i<NUMEVT; i++) {
48 cout <<
"This is end of file !" << endl;
49 cout <<
"... exiting " << endl;
52 cout << hex <<
"ERROR: codaRead status = "
53 << status << dec << endl;
58 status = evdata->LoadEvent( datafile.
getEvBuffer() );
60 if( status != CodaDecoder::HED_OK && status != CodaDecoder::HED_WARN ) {
61 cerr <<
"ERROR: LoadEvent status " << status << endl;
65 if(evdata->IsPrescaleEvent()) {
66 cout << endl <<
" Prescale factors from CODA file = "
68 cout << endl <<
" Trigger Prescale Factor" << endl;
69 for (
UInt_t trig=1; trig<=8; trig++) {
70 cout <<
" "<<dec<<trig<<
" ";
71 UInt_t ps = evdata->GetPrescaleFactor(trig);
72 UInt_t psmax = (trig <= 4) ? 16777216
75 if (ps == 0) ps = psmax;
79 cout <<
"Reminder: A 'zero' was interpreted as maximum." << endl;
80 cout <<
"Max for trig 1-4 = 2^24, for trig 5-8 = 2^16 \n"<< endl;
87 cout <<
"ERROR: prescale factors not found in the first ";
88 cout << dec << NUMEVT <<
" events " << endl;