34 auto *debugfile =
new ofstream;
35 debugfile->open (
"oodecoder2.txt");
36 *debugfile <<
"Debug of OO decoder\n\n";
40 cerr <<
"ERROR: Cannot open CODA data" << endl;
41 cerr <<
"Perhaps you mistyped it" << endl;
42 cerr <<
"... exiting." << endl;
49 evdata->SetDebugFile(debugfile);
52 TROOT fadcana(
"fadcroot",
"Hall A FADC analysis, 1st version");
53 TFile hfile(
"fadc.root",
"RECREATE",
"FADC data");
55 h1 =
new TH1F(
"h1",
"snapshot 1",1020,-5,505);
56 h2 =
new TH1F(
"h2",
"snapshot 2",1020,-5,505);
57 h3 =
new TH1F(
"h3",
"snapshot 3",1020,-5,505);
58 h4 =
new TH1F(
"h4",
"snapshot 4",1020,-5,505);
59 h5 =
new TH1F(
"h5",
"snapshot 5",1020,-5,505);
60 hinteg =
new TH1F(
"hinteg",
"Integral of ADC",1000,50000,120000);
65 for (
int iev=0; iev<NUMEVT; iev++) {
69 *debugfile <<
"Normal end of file. Bye bye." << endl;
72 *debugfile << hex <<
"ERROR: codaRread status = " << status << endl;
80 *debugfile <<
"\nAbout to Load Event "<<endl;
81 evdata->LoadEvent(
data );
82 *debugfile <<
"\nFinished with Load Event "<<endl;
84 if (evdata->GetEvType() ==
MYTYPE) {
85 process (jnum, evdata, debugfile);
100 unsigned evnum =
data[4];
102 unsigned evtype =
data[1]>>16;
103 *debugfile <<
"\n\n Event number " << dec << evnum << endl;
104 *debugfile <<
" length " <<
len <<
" type " << evtype << endl;
106 for (
unsigned j=0; j<(
len/5); j++) {
107 *debugfile << dec <<
"\n evbuffer[" << ipt <<
"] = ";
108 for (
unsigned k=j; k<j+5; k++) {
109 *debugfile << hex <<
data[ipt++] <<
" ";
114 *debugfile << dec <<
"\n evbuffer[" << ipt <<
"] = ";
115 for (
unsigned k=ipt; k<
len; k++) {
116 *debugfile << hex <<
data[ipt++] <<
" ";
124 *debugfile <<
"\n\nHello. Now we process evdata : "<<endl;
126 *debugfile <<
"\nEvent type " << dec << evdata->
GetEvType() << endl;
127 *debugfile <<
"Event number " << evdata->
GetEvNum() << endl;
128 *debugfile <<
"Event length " << evdata->
GetEvLength() << endl;
131 *debugfile <<
"Physics trigger " << endl;
135 *debugfile <<
"main: fadc ptr = "<<fadc<<endl;
138 *debugfile <<
"main: num events "<<fadc->
GetNumEvents()<<endl;
139 *debugfile <<
"main: fadc mode "<<fadc->
GetMode()<<endl;
140 for (
unsigned i=0; i < 500; i++) {
141 *debugfile <<
"main: fadc data on ch. 11 "<<dec<<i<<
" "<<fadc->
GetData(1, 11,i)<<endl;
163 *debugfile <<
"Raw Data Dump for crate "<<dec<<crate<<
" slot "<<slot<<endl;
164 *debugfile <<
"Num raw "<<evdata->
GetNumRaw(crate,slot)<<endl;
165 for(
unsigned hit=0; hit<evdata->
GetNumRaw(crate,slot); hit++) {
166 *debugfile<<dec<<
"raw["<<hit<<
"] = ";
167 *debugfile<<hex<<evdata->
GetRawData(crate,slot,hit)<<endl;
170 *debugfile <<
"To print slotdata "<<crate<<
" "<<slot<<endl;
172 *debugfile <<
"finished with print slot data"<<endl;
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
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
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 Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
virtual UInt_t GetNumEvents(Decoder::EModuleType, UInt_t) const
virtual Int_t GetMode() const
virtual UInt_t GetData(UInt_t) const
virtual Int_t getCodaVersion()
virtual Int_t codaOpen(const char *filename, Int_t mode=1)
virtual Int_t codaClose()
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)
UInt_t GetRawData(UInt_t crate, UInt_t slot, UInt_t hit) const
Bool_t IsPhysicsTrigger() const
UInt_t GetNumRaw(UInt_t crate, UInt_t slot) const
virtual Decoder::Module * GetModule(UInt_t roc, UInt_t slot) const
UInt_t GetEvLength() const
void dump(UInt_t *data, ofstream *file)
void process(Int_t i, THaEvData *evdata, ofstream *file)