30 cout <<
"ERROR: Cannot open CODA data" << endl;
41 for (; ievent<NUMEVT; ievent++) {
47 cout <<
"This is normal end of file. Goodbye !" << endl;
49 cout << hex <<
"ERROR: codaRread status = " << status <<dec<<endl;
59 status = evdata->LoadEvent( datafile.
getEvBuffer() );
61 if( status != CodaDecoder::HED_OK && status != CodaDecoder::HED_WARN ) {
62 cerr <<
"ERROR " << status <<
" while decoding event " << ievent
63 <<
". Exiting." << endl;
66 cout << endl <<
"Event type " << evdata->GetEvType() << endl;
67 cout <<
"Event number " << evdata->GetEvNum() << endl;
68 cout <<
"Event length " << evdata->GetEvLength() << endl;
69 if (evdata->IsPhysicsTrigger() ) {
70 cout <<
"Physics trigger " << endl;
72 if(evdata->IsScalerEvent()) cout <<
"Scaler `event' " << endl;
82 cout <<
"Raw Data Dump for crate "<<crate<<
" slot "<<slot<<endl;
83 for(
unsigned hit=0; hit<evdata->GetNumRaw(crate,slot); hit++) {
84 cout<<
"raw["<<hit<<
"] = ";
85 cout<<hex<<evdata->GetRawData(crate,slot,hit)<<dec<<endl;
88 evdata->PrintSlotData(crate,slot);
90 if (evdata->IsPhysicsTrigger()) {
94 cout <<
"Device type = ";
95 cout << evdata->DevType(crate,slot) << endl;
96 for (
unsigned hit=0; hit<evdata->GetNumHits(crate,slot,channel); hit++) {
97 cout <<
"Channel " <<channel<<
" hit # "<<hit<<
" ";
98 cout <<
"data = " << evdata->GetData(crate,slot,channel,hit)<<endl;
101 cout <<
"Helicity on left spectrometer "<<evdata->GetHelicity(
"left")<<endl;
102 cout <<
"Helicity on right spectrometer "<<evdata->GetHelicity(
"right")<<endl;
103 cout <<
"Helicity "<<evdata->GetHelicity()<<endl;
111 for (
unsigned slot=0; slot<5; slot++) {
112 cout << endl <<
" scaler slot -> " << slot << endl;;
114 cout <<
"Scaler chan " <<
chan <<
" ";
115 cout << evdata->GetScaler(
"left",slot,
chan);
116 cout <<
" " << evdata->GetScaler(7,slot,
chan) << endl;
123 cout<<endl<<
"All done; processed "<<dec<<ievent<<
" events"<<endl;