1 #ifndef L2VirtualAlgo2008_h
2 #define L2VirtualAlgo2008_h
16 #define rdtscl_macro(low) \
17 __asm__ __volatile__("rdtsc" : "=a" (low) : : "edx")
19 #define rdtsc_macro(low,high) \
20 __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high))
22 #ifdef IS_REAL_L2 //in l2-ana environmen
23 #include "trgStructures.h"
25 #include "StDaqLib/TRG/trgStructures.h"
30 #include "L2eventStream2008.h"
36 enum EmcSwitch { kIsBad=0, kIsBtow, kIsEtow, kIsB_Etow };
42 std::string mOutDir1, mName1;
44 FILE *mLogFile, *mHistFile;
66 enum {par_cpuTicksPerSecond=1600000000};
67 unsigned long mComputeTimeStart, mComputeTimeStop, mComputeTimeDiff[L2eventStream2008::mxToken];
68 unsigned long mDecisionTimeStart, mDecisionTimeStop, mDecisionTimeDiff;
69 unsigned long long mRunStartTicks;
73 void setMaxHist(
int k) { assert(k>0);
76 int finishCommonHistos();
79 void computeStop(
int token);
84 void setOflTrigID(
int x) {oflTrigId=x;}
85 int getOflTrigID() {
return oflTrigId;}
86 bool isAccepted(){
return mAccept; }
87 static int readParams(
const char *fileN,
int mxPar,
int *iPar,
float *fPar);
88 const char *getName() {
return mName1.c_str();}
90 int initRun(
int runNo,
int *rc_ints,
float *rc_floats);
91 void compute (
int token);
92 bool decision(
int token,
void **myL2Result);
96 virtual int initRunUser(
int runNo,
int *rc_ints,
float *rc_floats){
return 0;}
97 virtual void computeUser(
int token){};
98 virtual bool decisionUser(
int token,
void **myL2Result){myL2Result=0;
return true;}
99 virtual void finishRunUser(){}
102 void printCalibratedData(
int token);