7 #include "trgStructuresVer0x22.h"
10 #include "StTriggerDataReader.h"
15 unsigned short TrgDataBytes;
16 unsigned short TrgFiller;
22 unsigned int BunchCrossingId(
unsigned short b3,
unsigned short b10,
unsigned short b11){
23 unsigned long long bxinghi,bxing1,bxinglo,bxing,bx0,bx1,bx2;
27 bxinglo = (bxing1 << 16) + b11;
28 bxing = (bxinghi << 32) + bxinglo;
33 return (
unsigned int)(b120);
36 unsigned int BunchCrossingId7bit(
unsigned short b2){
43 StTriggerDataReader::StTriggerDataReader(
const char *name):
StMaker(name)
46 cout <<
"Constructing StTriggerDataReader with name=" << name << endl;
49 Int_t StTriggerDataReader::OpenFile(
char* file){
50 if ( (mFile= fopen (file,
"r") )==NULL ) {
51 printf(
"Error opening data file %s\n",file);
54 printf(
"Opening data file %s\n",file);
58 Int_t StTriggerDataReader::CloseFile(){
60 printf(
"Closing trigger data file\n");
64 printf(
"No file to close\n");
71 volatile unsigned int *x;
74 if((err=fread((
char *)&trgHead.TrgDataBytes,
sizeof(
char),
sizeof(
TrgEvtHeader) , mFile)) <=0) {
76 printf(
"End of file\n");
79 printf(
"Error in reading TrgHead\n");
85 x = (
volatile unsigned int*)&trgHead;
89 if((err=fread((
char *)&(TrgData.EvtDesc.TCUdataBytes),
sizeof(
char),trgHead.TrgDataBytes,mFile))<=0){
90 printf(
"Error in reading TrgData\n");
97 swapTrg(&TrgData, TrgData.EvtDesc.npre, TrgData.EvtDesc.npost);
107 mTrg=(
void *)(& TrgData);