1 #ifndef __L2gammaAlgo_h__
2 #define __L2gammaAlgo_h__
4 #ifdef IS_REAL_L2 //in l2-ana environment
5 #include "L2VirtualAlgo.h"
10 #include "StTriggerUtilities/L2Emulator/L2algoUtil/L2VirtualAlgo.h"
11 #include "StTriggerUtilities/L2Emulator/L2algoUtil/L2EmcDb.h"
12 #include "StTriggerUtilities/L2Emulator/L2algoUtil/L2Histo.h"
19 #define LEVEL2_GAMMA_ALGORITHM_VERSION 0x1
21 #define MAX_TOWERS 4800
61 enum { kBEmcAlgo=0, kEEmcAlgo };
62 enum { kThresh1=0, kThresh2 };
72 unsigned short mThresholdLevel;
73 unsigned short mNumEtas;
74 unsigned short mNumPhis;
75 unsigned short mNumSubs;
76 unsigned short mNumSecs;
77 unsigned short mNumTower;
78 unsigned short mNumClust;
79 unsigned short mNumRdo;
80 const float *mEtaBins;
81 unsigned short mMaxADC;
85 unsigned short mHistogramPres;
86 unsigned short mIdThreshold;
96 unsigned short getNumberOfHighTowers(){
return nRdosHT; }
97 unsigned short getRdoOfHighTower(
unsigned short i){
return mListOfRdosHT[i]; }
98 unsigned short rdo2tower(
unsigned short rdo){
return mRdo2tower[rdo]; }
99 unsigned short tower2rdo(
unsigned short tow){
return mTower2rdo[tow]; }
101 unsigned short mListOfRdosHT[ MAX_TOWERS ];
102 unsigned short mListOfRdosTP[ MAX_TOWERS ];
103 unsigned short nRdosHT;
104 unsigned short nRdosTP;
105 float mETofTP[ MAX_TOWERS ];
106 unsigned short mADCofHT[ MAX_TOWERS ];
131 void init(
int run,
int I_par[5],
float F_par[5]);
136 int initRun(
int run,
int I_par[5],
float F_par[5] );
138 int initRun(
char *myname,
int run,
int I_par[5],
float F_par[5] );
148 bool doEvent(
int inpEveId,
TrgDataType* trgData,
int emcIn,
unsigned short *emcData );
154 int bemcIn,
unsigned short *bemcData,
155 int eemcIn,
unsigned short *eemcData );
184 void setLogFile(
const char *fname =
"./bsqueal.log" );
187 void setHistFile(
const char *fname =
"./bsqueal.dat" );
189 #ifdef OPT_PREPROCESS
217 int mDefaultI_par[5];
218 float mDefaultF_par[5];
226 int mTowerFrequency[MAX_TOWERS];
227 int mPatchFrequency[MAX_TOWERS];
254 unsigned short mPatchFail[MAX_TOWERS];
256 unsigned short mTowerStat[MAX_TOWERS];
257 unsigned short mTowerFail[MAX_TOWERS];
261 unsigned short mTower2rdo[ MAX_TOWERS ];
265 unsigned short mRdoPatch[ MAX_TOWERS ][ 9 ];
267 float mTowerPed[ MAX_TOWERS ];
268 float mPatchPed[ MAX_TOWERS ];
270 float mTowerGain[ MAX_TOWERS ];
271 float mTowerGainIdeal[ MAX_TOWERS ];
272 float mTowerAdcCorrection[ MAX_TOWERS ];
295 unsigned short phibin(
unsigned short sec,
unsigned short sub ) {
return mNumSubs * sec + sub; }
296 unsigned short tower(
unsigned short phi,
unsigned short eta ) {
return mNumEtas * phi + eta; }
bool doEvent(int inpEveId, TrgDataType *trgData, int emcIn, unsigned short *emcData)
L2gammaAlgo(const char *name, L2EmcDb *db, char *outDir, int resOff)
class constructor
float mPatchAdcThreshold[MAX_TOWERS]
int mNumberInput
event counters
void finishRun()
cleanup for runs. output of warnings (eg hot channels) etc...
void printPatchConfig(int rdo)
float mPatchThreshold
Patch threshold.
unsigned short mTowerAdcThreshold[MAX_TOWERS]
unsigned short mRdo2tower[MAX_TOWERS]
Map to go from Rdo to Tower and Tower to Rdo.
void setLogFile(const char *fname="./bsqueal.log")
Set logfile for summary output (overrides constructor option)
void setPatchThreshold(float pt)
set the L2 trigger patch threshold. F_par[1]
L2Histo mHistos[19]
L2 histograms.
unsigned short mPatchStat[MAX_TOWERS]
int mNumberLive
Counters for error monitoring.
int initRun(int run)
initialize the data structures for the next run
~L2gammaAlgo()
class destructor
void init(int run, int I_par[5], float F_par[5])
One time initialization.
void clear()
clear data structures for ...
void setHistFile(const char *fname="./bsqueal.dat")
Set filename for histogram output (overrides constructor option)
unsigned short mNumPatch[MAX_TOWERS]
Number and list of up to 9 neighboring towers.
void setUseOfflineGains()
if set, instructs the algo to correct for offline gains
A level-2 "cluster" based trigger.
void finish()
final output of statistics, histograms, etc...
unsigned short phibin(unsigned short sec, unsigned short sub)
Log file.
float mTowerThreshold
High tower threshold.
void setTowerThreshold(float pt)
set the L2 high tower threshold. F_par[0]
int mUseBbc
Option to correct for vertex effects (not in use yet)
int mRunNumber
Run number for the current run.
int mUseOfflineGains
Option to use offline gains.