1 |
/** @file |
/** @file |
2 |
* $Source: /home/cvsmanager/yoda/techmodel/physics/TrackerReader.cpp,v $ |
* $Source: /home/cvsmanager/yoda/techmodel/physics/TrackerReader.cpp,v $ |
3 |
* $Id: TrackerReader.cpp,v 2.0 2004/09/21 20:51:22 kusanagi Exp $ |
* $Id: TrackerReader.cpp,v 2.2 2004/12/22 11:39:16 kusanagi Exp $ |
4 |
* $Author: kusanagi $ |
* $Author: kusanagi $ |
5 |
* |
* |
6 |
* Implementation of the TrackerPhysicsReader class. |
* Implementation of the TrackerPhysicsReader class. |
10 |
#include <log4cxx/logger.h> |
#include <log4cxx/logger.h> |
11 |
#include "TrackerReader.h" |
#include "TrackerReader.h" |
12 |
#include "event/physics/tracker/TrackerEvent.h" |
#include "event/physics/tracker/TrackerEvent.h" |
13 |
|
//#include <TArrayC.h> |
14 |
|
|
15 |
extern "C" { |
extern "C" { |
16 |
//Passo il path verso la il file temporaneo |
//Passo il path verso la il file temporaneo |
66 |
*/ |
*/ |
67 |
std::string TrackerReader::GetVersionInfo(void) const { |
std::string TrackerReader::GetVersionInfo(void) const { |
68 |
return |
return |
69 |
"$Header: /home/cvsmanager/yoda/techmodel/physics/TrackerReader.cpp,v 2.0 2004/09/21 20:51:22 kusanagi Exp $"; |
"$Header: /home/cvsmanager/yoda/techmodel/physics/TrackerReader.cpp,v 2.2 2004/12/22 11:39:16 kusanagi Exp $"; |
70 |
} |
} |
71 |
|
|
72 |
/** |
/** |
94 |
|
|
95 |
//Scrivo un file temporaneo per passarlo alla routine |
//Scrivo un file temporaneo per passarlo alla routine |
96 |
//Speriamo di cambiare la routine per passargli un buffer..... |
//Speriamo di cambiare la routine per passargli un buffer..... |
97 |
DIR *dirp; |
//DIR *dirp; |
98 |
std::string pathDir((char*)getenv("YODA_DATA")); |
|
99 |
pathDir = pathDir + "/todatemp.dat"; |
//std::string pathDir((char*)getenv("YODA_DATA")); |
100 |
|
|
101 |
|
//pathDir = pathDir + "/todatemp.dat"; |
102 |
|
stringstream oss; |
103 |
|
oss.str(""); |
104 |
|
oss << getenv("YODA_DATA") << "/" << time(NULL) << "trev.dat"; |
105 |
FILE *pfile; |
FILE *pfile; |
106 |
pfile = fopen((char*)pathDir.c_str(), "wb"); |
pfile = fopen(oss.str().c_str(), "wb"); |
107 |
fwrite(subData, 1, length, pfile); |
fwrite(subData, 1, length, pfile); |
108 |
fclose(pfile); |
fclose(pfile); |
109 |
|
|
110 |
//Call to the FORTRAN routin that unpack tracker events |
//Call to the FORTRAN routin that unpack tracker events |
111 |
trkeventpkt_(&ERROR, (char*)pathDir.c_str()); |
trkeventpkt_(&ERROR, (char*)oss.str().c_str()); |
112 |
|
|
113 |
remove((char*)pathDir.c_str()); |
remove(oss.str().c_str()); |
114 |
|
|
115 |
/*if (ERROR != 0) { |
/*if (ERROR != 0) { |
116 |
char *errmsg; |
char *errmsg; |
155 |
memcpy(tracker->alarm, level0_.alarm, sizeof(tracker->alarm)); |
memcpy(tracker->alarm, level0_.alarm, sizeof(tracker->alarm)); |
156 |
memcpy(tracker->aswr, level0_.aswr, sizeof(tracker->aswr)); |
memcpy(tracker->aswr, level0_.aswr, sizeof(tracker->aswr)); |
157 |
tracker->TOTDATAlength = level0_.TOTDATAlength; |
tracker->TOTDATAlength = level0_.TOTDATAlength; |
158 |
memcpy(tracker->datatracker, level0_.datatracker, sizeof(tracker->datatracker)); |
|
159 |
|
tracker->TrackerData = new TArrayI(level0_.TOTDATAlength, level0_.datatracker); |
160 |
|
//memcpy(tracker->datatracker, level0_.datatracker, sizeof(tracker->datatracker)); |
161 |
//} |
//} |
162 |
|
|
163 |
} |
} |