15 #include "../L2algoUtil/L2Histo.h"
16 #include "../L2algoUtil/L2EmcDb2012.h"
18 #include "L2wEemc2012.h"
22 L2wEemc2012::L2wEemc2012(
const char* name,
const char *uid,
L2EmcDb2012* db,
L2EmcGeom2012 *geoX,
char* outDir,
int resOff) :
L2VirtualAlgo2012( name, uid, db, outDir, false,true, resOff ) {
37 L2wEemc2012::initRunUser(
int runNo,
int *rc_ints,
float *rc_floats) {
41 par_RndAcceptPrescale = rc_ints[1];
42 par_EtThresh = rc_floats[0];
46 kBad+=2*(par_EtThresh<0);
50 fprintf(mLogFile,
"L2%s algorithm initRun(R=%d), compiled: %s , %s\n",getName(),mRunNumber,__DATE__,__TIME__);
51 fprintf(mLogFile,
" - use ET Thresh =%f, RndAcceptPrescale=%d debug=%d\n", par_EtThresh , par_RndAcceptPrescale, par_dbg);
52 fprintf(mLogFile,
"initRun() params checked for consistency, Error flag=0x%04x\n",kBad);
54 if(kBad)
return -kBad;
58 for (i=0; i<mxHA;i++)
if(hA[i])hA[i]->reset();
63 sprintf(txt,
"highest endcap tower ET; x: tower ET; y: counts");
74 L2wEemc2012::computeUser(
int token){
83 hit =mEveStream_etow[token].get_hits();
84 hitSize=mEveStream_etow[token].get_hitSize();
87 unsigned short highestRDO=8888;
88 for(i=0;i< hitSize;i++,hit++) {
89 if (hit->et>highestEt) {
95 resultBlob[token].trigger=0;
96 resultBlob[token].highestEt=(
unsigned char)(highestEt*256.0/60.0);
97 resultBlob[token].highestRDO=highestRDO;
98 hA[1]->fill((
int)highestEt);
99 if (highestEt>par_EtThresh) {
100 hA[2]->fill((
int)highestRDO);
101 resultBlob[token].trigger+=2;
110 L2wEemc2012::decisionUser(
int token,
int *myL2Result){
113 if (mRandomAccept) resultBlob[token].trigger+=1;
116 return resultBlob[token].trigger&2;
123 L2wEemc2012::finishRunUser() {
136 L2wEemc2012::createHisto() {
139 hA[1]=
new L2Histo(1,(
char*)
"Highest endcap tower ET; x: tower ET; y: counts", 100);
140 hA[2]=
new L2Histo(2,(
char*)
"ETOW: Seed Tower RDO", 720);