StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
L2gammaAlgo Class Reference

A level-2 "cluster" based trigger. More...

#include <L2gammaAlgo.h>

Inheritance diagram for L2gammaAlgo:
L2VirtualAlgo

Public Types

enum  { kBEmcAlgo =0, kEEmcAlgo }
 
enum  { kThresh1 =0, kThresh2 }
 

Public Member Functions

unsigned short getNumberOfHighTowers ()
 
unsigned short getRdoOfHighTower (unsigned short i)
 
unsigned short rdo2tower (unsigned short rdo)
 
unsigned short tower2rdo (unsigned short tow)
 
void setTowerThreshold (float pt)
 set the L2 high tower threshold. F_par[0]
 
void setPatchThreshold (float pt)
 set the L2 trigger patch threshold. F_par[1]
 
float getTowerThreshold ()
 
float getPatchThreshold ()
 
void setUseOfflineGains ()
 if set, instructs the algo to correct for offline gains
 
 L2gammaAlgo (const char *name, L2EmcDb *db, char *outDir, int resOff)
 class constructor
 
 ~L2gammaAlgo ()
 class destructor
 
void init (int run, int I_par[5], float F_par[5])
 One time initialization.
 
int initRun (int run)
 initialize the data structures for the next run
 
int initRun (int run, int I_par[5], float F_par[5])
 initialize the data structures for the next run More...
 
int initRun (char *myname, int run, int I_par[5], float F_par[5])
 
bool doEvent (int inpEveId, TrgDataType *trgData, int emcIn, unsigned short *emcData)
 
bool doEvent (int L0trigger, int inuptEventID, TrgDataType *trgData, int bemcIn, unsigned short *bemcData, int eemcIn, unsigned short *eemcData)
 
void clear ()
 clear data structures for ...
 
void finishRun ()
 cleanup for runs. output of warnings (eg hot channels) etc...
 
void finish ()
 final output of statistics, histograms, etc...
 
void setLogFile (const char *fname="./bsqueal.log")
 Set logfile for summary output (overrides constructor option)
 
void setHistFile (const char *fname="./bsqueal.dat")
 Set filename for histogram output (overrides constructor option)
 
- Public Member Functions inherited from L2VirtualAlgo
void setOflTrigID (int x)
 
int getOflTrigID ()
 
bool isAccepted ()
 
bool accepted ()
 
const char * getName ()
 
 L2VirtualAlgo (const char *name, L2EmcDb *db, char *outDir, int resOff)
 
virtual int initRun (int runNo, int *rc_ints, float *rc_floats)=0
 
const char * name () const
 

Public Attributes

unsigned short mListOfRdosHT [MAX_TOWERS]
 
unsigned short mListOfRdosTP [MAX_TOWERS]
 
unsigned short nRdosHT
 
unsigned short nRdosTP
 
float mETofTP [MAX_TOWERS]
 
unsigned short mADCofHT [MAX_TOWERS]
 

Protected Member Functions

void printPatchConfig (int rdo)
 
void jbook ()
 
void jclear ()
 
unsigned short phibin (unsigned short sec, unsigned short sub)
 Log file.
 
unsigned short tower (unsigned short phi, unsigned short eta)
 
- Protected Member Functions inherited from L2VirtualAlgo
void finishCommonHistos ()
 

Protected Attributes

unsigned short mEEmc
 
unsigned short mBEmc
 
unsigned short mThresholdLevel
 
unsigned short mNumEtas
 
unsigned short mNumPhis
 
unsigned short mNumSubs
 
unsigned short mNumSecs
 
unsigned short mNumTower
 
unsigned short mNumClust
 
unsigned short mNumRdo
 
const float * mEtaBins
 
unsigned short mMaxADC
 
float mMaxET
 
float mIdealGainT
 
int mHistogramBase
 
unsigned short mHistogramPres
 
unsigned short mIdThreshold
 
L2gammaAlgomL2input
 
int mRunNumber
 Run number for the current run.
 
float mTowerThreshold
 High tower threshold.
 
float mPatchThreshold
 Patch threshold.
 
int mUseOfflineGains
 Option to use offline gains.
 
int mUseBbc
 Option to correct for vertex effects (not in use yet)
 
int mDefaultI_par [5]
 
float mDefaultF_par [5]
 
int mNumberInput
 event counters
 
int mNumberAcceptHT
 
int mNumberAcceptTP
 
int mPrescale
 
int mTowerFrequency [MAX_TOWERS]
 
int mPatchFrequency [MAX_TOWERS]
 
unsigned short mTowerAdcThreshold [MAX_TOWERS]
 
float mPatchAdcThreshold [MAX_TOWERS]
 
unsigned short mPatchStat [MAX_TOWERS]
 
unsigned short mPatchFail [MAX_TOWERS]
 
unsigned short mTowerStat [MAX_TOWERS]
 
unsigned short mTowerFail [MAX_TOWERS]
 
unsigned short mRdo2tower [MAX_TOWERS]
 Map to go from Rdo to Tower and Tower to Rdo.
 
unsigned short mTower2rdo [MAX_TOWERS]
 
unsigned short mNumPatch [MAX_TOWERS]
 Number and list of up to 9 neighboring towers.
 
unsigned short mRdoPatch [MAX_TOWERS][9]
 
float mTowerPed [MAX_TOWERS]
 
float mPatchPed [MAX_TOWERS]
 
float mTowerGain [MAX_TOWERS]
 
float mTowerGainIdeal [MAX_TOWERS]
 
float mTowerAdcCorrection [MAX_TOWERS]
 
int mNumberLive
 Counters for error monitoring.
 
int mEvalTime
 
L2Histo mHistos [19]
 L2 histograms.
 
- Protected Attributes inherited from L2VirtualAlgo
char mName [mxTxt]
 
char mOutDir [mxTxt]
 
L2EmcDbmDb
 
FILE * mLogFile
 
FILE * mHistFile
 
int mResultOffset
 
int oflTrigId
 
bool mAccept
 
unsigned long mEveTimeStart
 
unsigned long mEveTimeStop
 
unsigned long mEveTimeDiff
 
L2HistomhT
 
L2HistomhN
 
int mEventsInRun
 

Additional Inherited Members

- Static Public Member Functions inherited from L2VirtualAlgo
static int readParams (const char *fileN, int mxPar, int *iPar, float *fPar)
 

Detailed Description

A level-2 "cluster" based trigger.

Author
Jason C. Webb, IUCF
Date
3/28/2006

This class implements an L2 gamma, pi0 and electron trigger for both the barrel and endcap calorimeters. The trigger is essentially a "cluster finder". It locates a high tower above a specified threshold, and forms a 3x3 cluster of towers centered on the high tower. If the cluster exceeds a second threshold, the trigger condition is satisfied. An optional "prescaled accept" will accept some prescaled rate of input events.

Id:
L2gammaAlgo.h,v 1.4 2007/11/14 03:58:11 balewski Exp

Definition at line 57 of file L2gammaAlgo.h.

Member Function Documentation

bool L2gammaAlgo::doEvent ( int  inpEveId,
TrgDataType trgData,
int  emcIn,
unsigned short *  emcData 
)

process one event through L2 and evaluate. returns true to accept an event, false to reject. fatal algorithm errors will always return true to tick off the shift crew and get them to take action (we hope).

Parameters
inpEveIdevent id
trgDatathe trigger data block
emcInspecifies whether the calorimeter is in the run or not
emcDatais the L2 data block (raw ADC values) to be processed

Get pointer to block of bytes where L2gammaResult will reside

And write to L2result

Test trig and prescale and fill QA histograms when they are satisfied

Definition at line 627 of file L2gammaAlgo.cxx.

References clear(), mEEmc, mHistos, mL2input, mNumberInput, mNumPatch, mPatchAdcThreshold, mPatchThreshold, mRdo2tower, and mTowerAdcThreshold.

Referenced by doEvent().

bool L2gammaAlgo::doEvent ( int  L0trigger,
int  inuptEventID,
TrgDataType trgData,
int  bemcIn,
unsigned short *  bemcData,
int  eemcIn,
unsigned short *  eemcData 
)
virtual

implementation of the "virtual" method in L2VirtualAlgo. this is a wrapper for doEvent( int, TrgDataType*, int, unsigned short ) above.

Implements L2VirtualAlgo.

Definition at line 604 of file L2gammaAlgo.cxx.

References doEvent(), and mEEmc.

int L2gammaAlgo::initRun ( int  run,
int  I_par[5],
float  F_par[5] 
)

initialize the data structures for the next run

Reset event counters

read in database for this run

determine ideal gains for each of the eta bins

clear high tower and patch thresholds

loop over all db entries and calculate ADC thresholds

I really need to think about this!

second loop over all db entries, this time we calculate ADC thresholds on the 3x3 tower patch

loop over neighboring towers, including the current tower, and add ped/gain to the patch threshold. the result should be sum_i ped_i/g_i for each rdo channel (plus the ET threshold already initialized).

assign this rdo to the physical tower patch

Definition at line 180 of file L2gammaAlgo.cxx.

References mEEmc, mL2input, mNumberInput, mNumberLive, mNumPatch, mPatchAdcThreshold, mPatchStat, mPatchThreshold, mRdo2tower, mRunNumber, mTowerAdcThreshold, mTowerThreshold, mUseBbc, mUseOfflineGains, phibin(), printPatchConfig(), setPatchThreshold(), and setTowerThreshold().

void L2gammaAlgo::printPatchConfig ( int  rdo)
protected

prints patch configuration (peds, stat, fail, gains, etc...) for easier(?) debugging of patch problems online

Definition at line 1110 of file L2gammaAlgo.cxx.

References mEEmc, mRdo2tower, and mTowerAdcThreshold.

Referenced by finishRun(), and initRun().

Member Data Documentation

unsigned short L2gammaAlgo::mEEmc
protected

The following block of variables are initialized in the constructor and select between the two calorimeter geometries

Definition at line 70 of file L2gammaAlgo.h.

Referenced by doEvent(), init(), initRun(), and printPatchConfig().

L2gammaAlgo* L2gammaAlgo::mL2input
protected

pointer to algorithm evaluating a lower threshold which we simply want to evaluate a higher threshold

Definition at line 203 of file L2gammaAlgo.h.

Referenced by doEvent(), init(), initRun(), and L2gammaAlgo().

float L2gammaAlgo::mPatchAdcThreshold[MAX_TOWERS]
protected

Thresholds on the 3x3 patch of towers centered on the rdo channel. The threshold is calculated as T= E_T + sum_i ( ped_i/g_i ) and will be applied to the sum ADC_i/g_i > T

Definition at line 237 of file L2gammaAlgo.h.

Referenced by doEvent(), and initRun().

unsigned short L2gammaAlgo::mPatchStat[MAX_TOWERS]
protected

bitwise "or" of all stat and fail bits of towers w/in the 3x3 tower patch

Definition at line 253 of file L2gammaAlgo.h.

Referenced by initRun().

unsigned short L2gammaAlgo::mTowerAdcThreshold[MAX_TOWERS]
protected

High tower threshold expressed in terms of ADC for each of the 720 rdo channels

Definition at line 231 of file L2gammaAlgo.h.

Referenced by doEvent(), initRun(), and printPatchConfig().


The documentation for this class was generated from the following files: