| 1 |
/** @file |
/** @file |
| 2 |
* $Source: /repository/PamOffLineSW/physics/TofReader.cpp,v $ |
* $Source: /afs/ba.infn.it/user/pamela/src/CVS/chewbacca/PamOffLineSW/physics/TofReader.cpp,v $ |
| 3 |
* $Id: TofReader.cpp,v 1.3 2008-03-05 11:37:36 messineo Exp $ |
* $Id: TofReader.cpp,v 1.3 2009/08/05 18:48:40 pam-fi Exp $ |
| 4 |
* $Author: messineo $ |
* $Author: pam-fi $ |
| 5 |
* |
* |
| 6 |
* Implementation of the CalorimeterReader class. |
* Implementation of the CalorimeterReader class. |
| 7 |
*/ |
*/ |
| 47 |
*/ |
*/ |
| 48 |
std::string TofReader::GetVersionInfo(void) const { |
std::string TofReader::GetVersionInfo(void) const { |
| 49 |
return |
return |
| 50 |
"$Header: /repository/PamOffLineSW/physics/TofReader.cpp,v 1.3 2008-03-05 11:37:36 messineo Exp $"; |
"$Header: /afs/ba.infn.it/user/pamela/src/CVS/chewbacca/PamOffLineSW/physics/TofReader.cpp,v 1.3 2009/08/05 18:48:40 pam-fi Exp $"; |
| 51 |
} |
} |
| 52 |
|
|
| 53 |
/** |
/** |
| 85 |
//Call to the routine that unpack tof events |
//Call to the routine that unpack tof events |
| 86 |
if ( length < 500000 && length >= 0 ){ |
if ( length < 500000 && length >= 0 ){ |
| 87 |
tofunpack_((unsigned char*)data, &length, &ERROR); |
tofunpack_((unsigned char*)data, &length, &ERROR); |
| 88 |
|
// printf("qui ERROR %i \n",ERROR); |
| 89 |
} else { |
} else { |
| 90 |
ERROR = 1; |
ERROR = 1; |
| 91 |
}; |
}; |
| 92 |
|
// printf("qua ERROR %i \n",ERROR); |
| 93 |
|
|
| 94 |
if (ERROR != 0) { |
if (ERROR != 0) { |
| 95 |
char *errmsg; |
const char *errmsg; |
| 96 |
switch (ERROR){ |
switch (ERROR){ |
| 97 |
case 1: errmsg = "CRC TOF ERROR"; |
case 1: errmsg = "CRC TOF ERROR"; |
| 98 |
break; |
break; |
| 99 |
default: errmsg = "TOF ERROR CODE UNIDENTIFIED"; |
default: errmsg = "TOF ERROR CODE UNIDENTIFIED"; |
| 100 |
} |
} |
| 101 |
oss.str(""); |
oss.str(""); |
| 102 |
oss << "Tof: Fortran77 function calunpack: " << errmsg; |
oss << "Tof: Fortran77 function tofunpack: " << errmsg; |
| 103 |
msg=oss.str(); |
msg=oss.str(); |
| 104 |
PamOffLineSW::mainLogUtil->logAll(msg); |
PamOffLineSW::mainLogUtil->logAll(msg); |
| 105 |
//ORIGINAL: logger->debug(oss.str().c_str()); |
//ORIGINAL: logger->debug(oss.str().c_str()); |
| 112 |
// only for a variable tof->tof1int = evento_.IEV2; |
// only for a variable tof->tof1int = evento_.IEV2; |
| 113 |
// memcpy(tof->tof1int, tofvar_.tof1int, sizeof(tofvar_.tof1int)); |
// memcpy(tof->tof1int, tofvar_.tof1int, sizeof(tofvar_.tof1int)); |
| 114 |
// printf("tof->tof1int[1] %i \n",tof->tof1int[0]); |
// printf("tof->tof1int[1] %i \n",tof->tof1int[0]); |
| 115 |
|
// printf("quo ERROR %i \n",ERROR); |
| 116 |
tof->unpackError = (unsigned short)ERROR; |
tof->unpackError = (unsigned short)ERROR; |
| 117 |
|
// printf("qui unpackError %i \n",tof->unpackError); |
| 118 |
|
|
| 119 |
// for (int i = 0; i < 6; i++){ |
// for (int i = 0; i < 6; i++){ |
| 120 |
// tof->tof1int[i] = tofvar_.tof1int[i]; |
// tof->tof1int[i] = tofvar_.tof1int[i]; |
| 152 |
tof->tdc[j][i] = tmptdc[i][j]; |
tof->tdc[j][i] = tmptdc[i][j]; |
| 153 |
} |
} |
| 154 |
} |
} |
| 155 |
|
// printf("quisx unpackError %i \n",tof->unpackError); |
| 156 |
|
|
| 157 |
delete [] data; |
delete [] data; |
| 158 |
} |
} |