39 crate(-1), slot(-1), fModule(nullptr), numhitperchan(0), numraw(0), numchanhit(0),
40 firstfreedataidx(0), numholesdataidx(0), fDebugFile(nullptr),
41 didini(false), fNchan(0) {}
45 crate(cra), slot(slo), fModule(nullptr), numhitperchan(0), numraw(0), numchanhit(0),
46 firstfreedataidx(0), numholesdataidx(0), fDebugFile(nullptr),
47 didini(false), fNchan(0)
87 const auto& loctype = *found;
88 assert(modelnum == loctype.fMapNum);
91 *
fDebugFile <<
"THaSlotData:: loctype.fClassName "<< loctype.fClassName<<endl;
92 *
fDebugFile <<
"THaSlotData:: loctype.fMapNum "<< loctype.fMapNum<<endl;
93 *
fDebugFile <<
"THaSlotData:: fTClass ptr = "<<loctype.fTClass<<endl;
97 if( !loctype.fTClass ) {
98 loctype.fTClass = TClass::GetClass( loctype.fClassName );
100 *
fDebugFile <<
"defining fTClass ptr = "<<loctype.fTClass<<endl;
102 if (!loctype.fTClass) {
104 *
fDebugFile <<
"THaSlotData:: SERIOUS problem : fTClass still zero " << endl;
114 fModule.reset(
static_cast<Module*
>( loctype.fTClass->New() ));
116 *
fDebugFile <<
"THaSlotData:: Reusing existing fModule" << endl;
120 cerr <<
"ERROR: Failure to make module on crate "<<dec<<
crate<<
" slot "<<
slot<<endl;
121 cerr <<
"usually because the module class is abstract; make sure base class methods are defined"<<endl;
128 *
fDebugFile <<
"THaSlotData: fModule successfully created" << endl;
129 *
fDebugFile <<
"THaSlotData:: about to init module "
141 catch(
const exception&
e ) {
143 ostr <<
"ERROR initializing module for crate " << dec <<
crate
144 <<
" slot " <<
slot <<
": " <<
e.what() << endl;
169 cerr <<
"THaSlotData::ERROR: No module defined for slot. "<<
crate<<
" "<<
slot<<endl;
175 <<
" p " << hex << evbuffer <<
" " << *evbuffer
176 <<
" " << dec << ((
UInt_t(*evbuffer)) >> 27)
177 << hex <<
" " << pstop <<
" " <<
fModule.get()
179 if ( !
fModule->IsSlot( *evbuffer ) ) {
187 *
fDebugFile <<
"THaSlotData:: after LoadIfSlot: wordseen = "
188 << dec <<
" " << wordseen << endl;
198 cerr <<
"THaSlotData::ERROR: No module defined for slot. "<<
crate<<
" "<<
slot<<endl;
203 <<
" pos " << pos <<
" len " <<
len <<
" start word "
204 << hex << *
p <<
" module ptr " <<
fModule.get() << dec << endl;
208 if (
fDebugFile) *
fDebugFile <<
"THaSlotData:: after LoadBank: wordseen = "<<dec<<
" "<<wordseen<<endl;
216 cerr <<
"THaSlotData::ERROR: No module defined for slot. "<<
crate<<
" "<<
slot<<endl;
219 return fModule->LoadNextEvBuffer(
this);
225 const int very_verb=1;
229 cout <<
"THaSlotData: ERROR: Did not init slot."<<endl;
230 cout <<
" Fix your cratemap."<<endl;
236 cout <<
"THaSlotData: Warning in loadData: channel ";
237 cout <<
chan<<
" out of bounds, ignored,"
238 <<
" on crate " <<
crate <<
" slot "<<
slot << endl;
244 cout <<
"THaSlotData: Warning in loadData: too many "
245 <<
"channels for crate/slot = " <<
crate <<
" " <<
slot;
286 size_t allocd = 2*
data.size();
293 cout <<
"THaSlotData: numchanhit, numraw = "<<
numchanhit<<
" "<<
numraw<<endl;
295 cout <<
"THaSlotData: Warning in loadData: too many hits "
296 <<
"for module " <<
device <<
" in crate/slot = "
298 <<
" chan = " <<
chan << endl;
318 cout <<
"\n THaSlotData contents : " << endl;
319 cout <<
"This is crate "<<dec<<
crate<<
" and slot "<<
slot<<endl;
320 cout <<
"Total Amount of Data : " << dec <<
getNumRaw() << endl;
322 cout <<
"Raw Data Dump: " << hex << endl;
334 ios_base::fmtflags fmt = cout.flags();
338 cout <<
"\nThis is "<<
devType()<<
" Data : "<<endl;
341 cout << dec <<
"Channel " <<
chan <<
" ";
344 cout <<
"Hit # "<<dec<<hit;
347 cout <<
" or (decimal) = "<<dec<<
getData(
chan,hit)<<endl;
357 *
fDebugFile <<
"\n THaSlotData contents : " << endl;
361 *
fDebugFile <<
"Raw Data Dump: " << hex << endl;
403 if( nidx <= alloci ) {
winID h TVirtualViewer3D TVirtualGLPainter p
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
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 type
static TypeSet_t & fgModuleTypes()
UInt_t getHeader(UInt_t crate, UInt_t slot) const
const char * getConfigStr(UInt_t crate, UInt_t slot) const
Int_t getModel(UInt_t crate, UInt_t slot) const
UInt_t getMask(UInt_t crate, UInt_t slot) const
Int_t getBank(UInt_t crate, UInt_t slot) const
UInt_t LoadBank(const UInt_t *p, UInt_t pos, UInt_t len)
std::unique_ptr< Module > fModule
Int_t loadData(const char *type, UInt_t chan, UInt_t dat, UInt_t raw)
UInt_t getNumHits(UInt_t chan) const
void print_to_file() const
static const UInt_t DEFNHITCHAN
UInt_t getRawData(UInt_t ihit) const
void compressdataindex(UInt_t numidx)
void define(UInt_t crate, UInt_t slot, UInt_t nchan=DEFNCHAN, UInt_t ndata=DEFNDATA, UInt_t nhitperchan=DEFNHITCHAN)
std::ofstream * fDebugFile
static const UInt_t DEFNDATA
UInt_t LoadNextEvBuffer()
UInt_t getData(UInt_t chan, UInt_t hit) const
Int_t loadModule(const THaCrateMap *map)
void compressdataindexImpl(UInt_t numidx)
const char * devType() const
UInt_t LoadIfSlot(const UInt_t *evbuffer, const UInt_t *pstop)
static const UInt_t DEFNCHAN
virtual void Clear(Option_t *="")
static const bool VERBOSE
std::vector< UInt_t, default_init_allocator< UInt_t > > VectorUIntNI