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.2 2004/12/03 22:08:00 kusanagi Exp $ |
* $Id: CalibTrk2Reader.cpp,v 2.3 2004/12/16 17:32:57 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.2 2004/12/03 22:08:00 kusanagi Exp $\n"; |
"$Header: /home/cvsmanager/yoda/techmodel/CalibTrk2Reader.cpp,v 2.3 2004/12/16 17:32:57 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 |
if (ERROR != 0) { |
if (ERROR != 0) { |
104 |
oss.str(""); |
oss.str(""); |
105 |
oss << "Fortran77 function trkcalibpkt error code = " << ERROR; |
oss << "Fortran77 function trkcalibpkt error code = " << ERROR; |
106 |
logger->warn(oss.str().c_str()); |
logger->warn(oss.str().c_str()); |
107 |
} |
} |
108 |
//delete the temporary file |
//delete the temporary file |
109 |
remove((char*)pathDir.c_str()); |
remove((char*)oss.str().c_str()); |
110 |
|
|
111 |
//Store the unpacked data |
//Store the unpacked data |
112 |
memcpy(calibTrk2->DAQmode, trkcalib_.DAQmode, sizeof(calibTrk2->DAQmode)); |
memcpy(calibTrk2->DAQmode, trkcalib_.DAQmode, sizeof(calibTrk2->DAQmode)); |