1 |
/** @file |
/** @file |
2 |
* $Source: /home/cvspamela/yoda/techmodel/physics/tracker/TrackerPhysicsReader.cpp,v $ |
* $Source: /home/cvsmanager/yoda/techmodel/physics/TrackerReader.cpp,v $ |
3 |
* $Id: TrackerPhysicsReader.cpp,v 1.6 2004/03/16 10:18:28 nagni Exp $ |
* $Id: TrackerReader.cpp,v 1.2 2004/07/17 20:03:48 kusanagi Exp $ |
4 |
* $Author: nagni $ |
* $Author: kusanagi $ |
5 |
* |
* |
6 |
* Implementation of the TrackerPhysicsReader class. |
* Implementation of the TrackerPhysicsReader class. |
7 |
*/ |
*/ |
39 |
int bid[12]; |
int bid[12]; |
40 |
int alarm[12]; |
int alarm[12]; |
41 |
int aswr[12]; |
int aswr[12]; |
42 |
|
int TOTDATAlength; |
43 |
|
int datatracker[49152]; |
44 |
} level0_; |
} level0_; |
45 |
|
|
46 |
#include <dirent.h> |
#include <dirent.h> |
65 |
*/ |
*/ |
66 |
std::string TrackerReader::GetVersionInfo(void) const { |
std::string TrackerReader::GetVersionInfo(void) const { |
67 |
return |
return |
68 |
"$Header: /home/cvspamela/yoda/techmodel/physics/tracker/TrackerPhysicsReader.cpp,v 1.6 2004/03/16 10:18:28 nagni Exp $"; |
"$Header: /home/cvsmanager/yoda/techmodel/physics/TrackerReader.cpp,v 1.2 2004/07/17 20:03:48 kusanagi Exp $"; |
69 |
} |
} |
70 |
|
|
71 |
/** |
/** |
88 |
* Unpack the Tracker data event from the physical packet. |
* Unpack the Tracker data event from the physical packet. |
89 |
*/ |
*/ |
90 |
void TrackerReader::RunEvent(int EventNumber, const char subData[], long int length) { |
void TrackerReader::RunEvent(int EventNumber, const char subData[], long int length) { |
|
char data[length]; |
|
|
memcpy(data, subData, length); |
|
91 |
int ERROR; |
int ERROR; |
92 |
|
|
93 |
//Scrivo un file temporaneo per passarlo alla routine |
//Scrivo un file temporaneo per passarlo alla routine |
94 |
//Speriamo di cambiare la routine per passargli un buffer..... |
//Speriamo di cambiare la routine per passargli un buffer..... |
95 |
DIR *dirp; |
DIR *dirp; |
96 |
std::string pathDir((char*)getenv("YODA_DATA")); |
std::string pathDir((char*)getenv("YODA_DATA")); |
97 |
pathDir = pathDir + "/"; |
pathDir = pathDir + "/todatemp.dat"; |
|
pathDir = pathDir + PamelaRun::GetRunName(EventNumber) + "/todatemp.dat"; |
|
98 |
FILE *pfile; |
FILE *pfile; |
99 |
pfile = fopen((char*)pathDir.c_str(), "wb"); |
pfile = fopen((char*)pathDir.c_str(), "wb"); |
100 |
fwrite(subData, 1, length, pfile); |
fwrite(subData, 1, length, pfile); |
129 |
memcpy(tracker->bid, level0_.bid, sizeof(tracker->bid)); |
memcpy(tracker->bid, level0_.bid, sizeof(tracker->bid)); |
130 |
memcpy(tracker->alarm, level0_.alarm, sizeof(tracker->alarm)); |
memcpy(tracker->alarm, level0_.alarm, sizeof(tracker->alarm)); |
131 |
memcpy(tracker->aswr, level0_.aswr, sizeof(tracker->aswr)); |
memcpy(tracker->aswr, level0_.aswr, sizeof(tracker->aswr)); |
132 |
|
tracker->TOTDATAlength = level0_.TOTDATAlength; |
133 |
|
memcpy(tracker->datatracker, level0_.datatracker, sizeof(tracker->datatracker)); |
134 |
|
|
135 |
cat << log4cpp::Priority::ERROR |
cat << log4cpp::Priority::ERROR |
136 |
<< "Fortran77 function trkcalibpkt error code = " << ERROR |
<< "Fortran77 function trkcalibpkt error code = " << ERROR |
137 |
<< "\n " << log4cpp::CategoryStream::ENDLINE; |
<< "\n " << log4cpp::CategoryStream::ENDLINE; |