00001 #ifndef L2hienAlgo08_H 00002 #define L2hienAlgo08_H 00003 /***************************************************** 00004 * $Id: L2hienAlgo08.h,v 1.3 2008/02/01 00:16:44 balewski Exp $ 00005 * \author Jan Balewski, MIT, 2008 00006 ***************************************************** 00007 Descripion: 00008 this algo selects high-energy towers from BTOW & ETOW data 00009 and take advantage of common calibration to be deployed 00010 at L2 in February of 2008. 00011 The common (for B & E) ADC threshold is defined 00012 in units of adc above ped i.e. in ET. 00013 The output of this algo _one_ lists of pairs {adc,softID}. 00014 You need 2 instances of this ago to cover E & B-EMC. 00015 Saving of those lists to disk is beyond the scope of this algo. 00016 SoftID is defined as follows: 00017 *BTOW : traditional softID [1-4800] used since 20th centry. 00018 *ETOW: range [0..719], eta index changes slower 00019 int ieta= (x->eta-1); 00020 int iphi= (x->sec-1)*EtowGeom::mxSubs + x->sub-'A' ; 00021 int softId= iphi+EtowGeom::mxPhiBin*ieta; 00022 00023 There is a hardcoded limit on the max list length at 256 towers. 00024 In case of an overflow a random (not realy) selection of towers will be added to the list until the software limit is reached. 00025 ****************************************************** 00026 */ 00027 00028 00029 #include "StTriggerUtilities/L2Emulator/L2algoUtil/L2VirtualAlgo2008.h" 00030 00031 class L2hienAlgo08 ; 00032 class L2Histo; 00033 class L2EmcGeom; 00034 00035 // remember to clear in initRun() to avoid stale data 00036 class L2hienList08 {// WARN : all sits in RAM x 4096 tokens! 00037 public: 00038 enum {mxListSize=150}; // keep this size small 00039 enum {kDataFresh=0}; // if used 1 or more times data are stale 00040 private: 00041 friend class L2hienAlgo08 ; 00042 int isFresh; // for QA 00043 int size;// # of elements on the list below 00044 unsigned int value[mxListSize]; //list, not cleared 00045 }; 00046 00047 //------------------------------- 00048 class L2hienAlgo08 : public L2VirtualAlgo2008 { 00049 /* this class fills the folowing bins 00050 of counter histo (mhN), see also L2VirtualAlgo2008.h 00051 5 - # of eve w/ overflow # of towers, in decision() input 00052 6 - # of eve w/ STALE data - very bad, in decision() input 00053 00054 */ 00055 public: 00056 // shortcuts 00057 enum {mxBtow=(BtowGeom::mxEtaBin) * (BtowGeom::mxPhiBin)}; 00058 enum {mxEtow=(EtowGeom::mxEtaBin) * (EtowGeom::mxPhiBin)}; 00059 private: 00060 //..................... params set in initRun 00061 int par_dbg; 00062 int par_maxList; 00063 int par_adcThres; // in ADC counts above peds 00064 00065 //................... BTOW lookup tables 00066 int mRdo2towerID_B[mxBtow]; 00067 int mTowerID2etaBin_B[mxBtow]; // for QA only 00068 int mTowerID2phiBin_B[mxBtow]; // for QA only 00069 00070 //................... ETOW lookup tables 00071 int mRdo2towerID_E[mxEtow]; 00072 int mTowerID2etaBin_E[mxEtow]; // for QA only 00073 int mTowerID2phiBin_E[mxEtow]; // for QA only 00074 00075 //---- event-long variables changed by COMPUTE() ----- 00076 //............... preserved for Decision(), 00077 L2hienList08 mHiEnTw[L2eventStream2008::mxToken]; //it is a lot of RAM! 00078 // add similar for the endcap 00079 00080 // utility methods 00081 void createHisto(); 00082 00083 public: 00084 L2hienAlgo08(const char* name, L2EmcDb* db, L2EmcGeom *geo, char* outDir, L2VirtualAlgo2008::EmcSwitch beSwitch); 00085 int initRunUser( int runNo, int *rc_ints, float *rc_floats); 00086 void finishRunUser();// at the end of each run 00087 void computeUser(int token); 00088 bool decisionUser(int token, void **myL2Result);//only QA 00089 // expert only, to export high towers 00090 int getListSize(int token) { return mHiEnTw[token].size;} 00091 const unsigned int *getListData(int token) { return mHiEnTw[token].value;} 00092 00093 void print2(int token); 00094 00095 }; 00096 00097 #endif 00098 00099 /**************************************************** 00100 $Log: L2hienAlgo08.h,v $ 00101 Revision 1.3 2008/02/01 00:16:44 balewski 00102 add mxListSize to BTOW/ETOW calibration 00103 00104 Revision 1.2 2008/01/30 21:56:43 balewski 00105 E+B high-enery-filter L2-algo fuly functional 00106 00107 Revision 1.1 2008/01/29 00:17:21 balewski 00108 new algo filtering high-energy towers 00109 00110 00111 00112 00113 */ 00114
1.5.9