1 |
/** @file |
/** @file |
2 |
* $Source: /home/cvsmanager/yoda/techmodel/physics/CalorimeterReader.cpp,v $ |
* $Source: /home/cvsmanager/yoda/techmodel/physics/CalorimeterReader.cpp,v $ |
3 |
* $Id: CalorimeterReader.cpp,v 2.0 2004/09/21 20:51:22 kusanagi Exp $ |
* $Id: CalorimeterReader.cpp,v 2.4 2004/12/03 22:08:12 kusanagi Exp $ |
4 |
* $Author: kusanagi $ |
* $Author: kusanagi $ |
5 |
* |
* |
6 |
* Implementation of the CalorimeterReader class. |
* Implementation of the CalorimeterReader class. |
24 |
float base[2][22][6]; |
float base[2][22][6]; |
25 |
float calselftrig[4][7]; |
float calselftrig[4][7]; |
26 |
float calIItrig[4]; |
float calIItrig[4]; |
27 |
float calstripshit[4]; |
float calstriphit[4]; |
28 |
float calDSPtaberr[4]; |
float calDSPtaberr[4]; |
29 |
float calevnum[4]; |
float calevnum[4]; |
30 |
} evento_; |
} evento_; |
31 |
|
|
32 |
void calunpack_(unsigned char[], long int*, int*); |
void calunpack_(unsigned char[], long int*, int*); |
33 |
|
//void calunpack_(char[], long int*, int*); |
34 |
//Struct per il passaggio di dati da e verso la chiamata fortran |
//Struct per il passaggio di dati da e verso la chiamata fortran |
35 |
} |
} |
36 |
|
|
53 |
*/ |
*/ |
54 |
std::string CalorimeterReader::GetVersionInfo(void) const { |
std::string CalorimeterReader::GetVersionInfo(void) const { |
55 |
return |
return |
56 |
"$Header: /home/cvsmanager/yoda/techmodel/physics/CalorimeterReader.cpp,v 2.0 2004/09/21 20:51:22 kusanagi Exp $"; |
"$Header: /home/cvsmanager/yoda/techmodel/physics/CalorimeterReader.cpp,v 2.4 2004/12/03 22:08:12 kusanagi Exp $"; |
57 |
} |
} |
58 |
|
|
59 |
/** |
/** |
86 |
for (int i = 0; i<length; i++){ |
for (int i = 0; i<length; i++){ |
87 |
convdata[i] = (unsigned short)((unsigned char)subData[i]&0xFF); |
convdata[i] = (unsigned short)((unsigned char)subData[i]&0xFF); |
88 |
}*/ |
}*/ |
89 |
|
|
90 |
//Call to the routine that unpack calorimeter events |
//Call to the routine that unpack calorimeter events |
91 |
calunpack_((unsigned char*)data, &length, &ERROR); |
calunpack_((unsigned char*)data, &length, &ERROR); |
92 |
|
//calunpack_((char*)data, &length, &ERROR); |
93 |
|
|
94 |
if (ERROR != 0) { |
if (ERROR != 0) { |
95 |
char *errmsg; |
char *errmsg; |
96 |
switch (ERROR){ |
switch (ERROR){ |
97 |
case 1: errmsg = "CALORIMETER NOT FOUND"; |
case 1: errmsg = "CALORIMETER NOT FOUND"; |
98 |
} |
} |
99 |
oss.flush(); |
oss.str(""); |
100 |
oss << "Fortran77 function calunpack: " << errmsg; |
oss << "Fortran77 function calunpack: " << errmsg; |
101 |
logger->warn(oss.str().c_str()); |
logger->warn(oss.str().c_str()); |
102 |
} else { |
} |
103 |
|
// In case of "ERROR != 0" the calunpack will take care to set all |
104 |
|
// parameters to zero |
105 |
|
//} else { |
106 |
calorimeter->IEV = evento_.IEV; |
calorimeter->IEV = evento_.IEV; |
107 |
memcpy(calorimeter->stwerr, evento_.stwerr, sizeof(calorimeter->stwerr)); |
memcpy(calorimeter->stwerr, evento_.stwerr, sizeof(calorimeter->stwerr)); |
108 |
memcpy(calorimeter->perror, evento_.perror, sizeof(calorimeter->perror)); |
memcpy(calorimeter->perror, evento_.perror, sizeof(calorimeter->perror)); |
135 |
} |
} |
136 |
//----------------------------------------------------------------------------------------- |
//----------------------------------------------------------------------------------------- |
137 |
memcpy(calorimeter->calIItrig, evento_.calIItrig, sizeof(calorimeter->calIItrig)); |
memcpy(calorimeter->calIItrig, evento_.calIItrig, sizeof(calorimeter->calIItrig)); |
138 |
memcpy(calorimeter->calstripshit, evento_.calstripshit, sizeof(calorimeter->calstripshit)); |
memcpy(calorimeter->calstriphit, evento_.calstriphit, sizeof(calorimeter->calstriphit)); |
139 |
memcpy(calorimeter->calDSPtaberr, evento_.calDSPtaberr, sizeof(calorimeter->calDSPtaberr)); |
memcpy(calorimeter->calDSPtaberr, evento_.calDSPtaberr, sizeof(calorimeter->calDSPtaberr)); |
140 |
memcpy(calorimeter->calevnum, evento_.calevnum, sizeof(calorimeter->calevnum)); |
memcpy(calorimeter->calevnum, evento_.calevnum, sizeof(calorimeter->calevnum)); |
141 |
} |
//} |
142 |
delete[] data; |
delete[] data; |
143 |
} |
} |