1 |
/** @file |
/** @file |
2 |
* $Source: /home/cvsmanager/yoda/techmodel/CalibTrk2Reader.cpp,v $ |
* $Source: /home/cvsmanager/yoda/techmodel/CalibTrk2Reader.cpp,v $ |
3 |
* $Id: CalibTrk2Reader.cpp,v 2.1 2004/10/17 12:28:38 kusanagi Exp $ |
* $Id: CalibTrk2Reader.cpp,v 3.0 2005/03/04 15:54:11 kusanagi Exp $ |
4 |
* $Author: kusanagi $ |
* $Author: kusanagi $ |
5 |
* |
* |
6 |
* Implementation of the LogReader class. |
* Implementation of the LogReader class. |
66 |
*/ |
*/ |
67 |
std::string CalibTrk2Reader::GetVersionInfo(void) const { |
std::string CalibTrk2Reader::GetVersionInfo(void) const { |
68 |
return |
return |
69 |
"$Header: /home/cvsmanager/yoda/techmodel/CalibTrk2Reader.cpp,v 2.1 2004/10/17 12:28:38 kusanagi Exp $\n"; |
"$Header: /home/cvsmanager/yoda/techmodel/CalibTrk2Reader.cpp,v 3.0 2005/03/04 15:54:11 kusanagi Exp $\n"; |
70 |
} |
} |
71 |
|
|
72 |
/** |
/** |
91 |
|
|
92 |
//Scrivo un file temporaneo per passarlo alla routine |
//Scrivo un file temporaneo per passarlo alla routine |
93 |
//Speriamo di cambiare la routine per passargli un buffer..... |
//Speriamo di cambiare la routine per passargli un buffer..... |
94 |
DIR *dirp; |
oss.str(""); |
95 |
std::string pathDir((char*)getenv("YODA_DATA")); |
oss << getenv("YODA_DATA") << "/" << time(NULL) << "trc2.dat"; |
|
pathDir = pathDir + "/todatemp.dat"; |
|
96 |
FILE *pfile; |
FILE *pfile; |
97 |
pfile = fopen((char*)pathDir.c_str(), "wb"); |
pfile = fopen(oss.str().c_str(), "wb"); |
98 |
fwrite(subData, 1, dataLength, pfile); |
fwrite(subData, 1, dataLength, pfile); |
99 |
fclose(pfile); |
fclose(pfile); |
100 |
|
|
101 |
//Call to the FORTRAN routin that unpack tracker events |
//Call to the FORTRAN routin that unpack tracker events |
102 |
trkcalibpkt_(&ERROR, (char*)pathDir.c_str()); |
trkcalibpkt_(&ERROR, (char*)oss.str().c_str()); |
103 |
|
|
104 |
|
calibTrk2->unpackError = ERROR; |
105 |
|
remove(oss.str().c_str()); |
106 |
if (ERROR != 0) { |
if (ERROR != 0) { |
107 |
oss.str(""); |
oss.str(""); |
108 |
oss << "Fortran77 function trkcalibpkt error code = " << ERROR; |
oss << "Fortran77 function trkcalibpkt error code = " << ERROR; |
109 |
logger->warn(oss.str().c_str()); |
logger->warn(oss.str().c_str()); |
110 |
} |
} |
111 |
//delete the temporary file |
//delete the temporary file |
112 |
remove((char*)pathDir.c_str()); |
remove((char*)oss.str().c_str()); |
113 |
|
|
114 |
//Store the unpacked data |
//Store the unpacked data |
115 |
memcpy(calibTrk2->DAQmode, trkcalib_.DAQmode, sizeof(calibTrk2->DAQmode)); |
memcpy(calibTrk2->DAQmode, trkcalib_.DAQmode, sizeof(calibTrk2->DAQmode)); |
149 |
oss << "Fortran77 function trkcalibpkt error code = " << ERROR; |
oss << "Fortran77 function trkcalibpkt error code = " << ERROR; |
150 |
logger->warn(oss.str().c_str()); |
logger->warn(oss.str().c_str()); |
151 |
|
|
152 |
delete [] subData; |
//delete [] subData; |
153 |
} |
} |
154 |
|
|