9 #include "EEmcDbCrate.h"
13 EEmcDbCrate::EEmcDbCrate() {
19 int EEmcDbCrate::isEmpty()
const{
26 void EEmcDbCrate::print()
const{
27 LOG_INFO<<
"EEmcDbCrate::print():"<<endm;
30 LOG_WARN<<
" item not defined ???"<<endm;
38 EEmcDbCrate::print( ostream &out )
const
42 out <<
"crate not defined";
49 ostream &operator<<(ostream &out,
const EEmcDbCrate &crate )
51 return crate.print(out);
55 void EEmcDbCrate::clear() {
69 void EEmcDbCrate::setName(
char *text) {
70 strncpy(
name,text,CrateNameLen-1);
75 void EEmcDbCrate::setAll(
char *buf ) {
84 void EEmcDbCrate::exportAscii(FILE *fd)
const{
86 if(
name[0]==0)
return;
93 int EEmcDbCrate::importAscii(FILE *fd){
105 char * ret=fgets(buf,mx,fd);
109 if(buf[0]==
'#')
return 1;
111 int ret1=sscanf(buf,
"%s",name0);
112 if(ret1==0)
return -1;
116 if(name0[2]==
'U' || name0[2]==
'V') {
117 n=sscanf(buf,
"%s %d %d %d %c %d %f %f %f %x %x %s %d",
name,&crate,&chan,&sec,&plane,&strip,&gain,&ped,&thr,&stat,&fail,tube,&key);
119 else if (name0[2]==
'T' || name0[2]==
'P' || name0[2]==
'Q' || name0[2]==
'R' ) {
120 n=sscanf(buf,
"%s %d %d %d %c %d %f %f %f %x %x %s %d",
name,&crate,&chan,&sec,&sub,&eta,&gain,&ped,&thr,&stat,&fail,tube,&key);
127 if(n!=13)
return -1000-n;
int nCh
no. of valid channels for the crate
int nHead
no. of header words
int useIt
flag to ignore data from misconfig/broken crate/box
char name[CrateNameLen]
crT1,... for towers, 06S1,... for mapmt
int fiber
position of the crate in the .daq data stream, couting from 0
char type
is 'T' for towers & 'S' for MAPMT
int crIDswitch
crate ID set by hardware switch