00001 #ifndef L2hienAlgo09_H 00002 #define L2hienAlgo09_H 00003 /***************************************************** 00004 * $Id: L2hienAlgo09.h,v 1.1 2011/09/22 20:44:13 pibero 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 #ifdef IS_REAL_L2 //in l2-ana environmen 00029 #include "L2VirtualAlgo2009.h" 00030 #else 00031 #include "StTriggerUtilities/L2Emulator/L2algoUtil/L2VirtualAlgo2009.h" 00032 #endif 00033 00034 #include "L2hienResult2009.h" 00035 00036 class L2hienAlgo09 ; 00037 class L2Histo; 00038 class L2EmcGeom; 00039 00040 // remember to clear in initRun() to avoid stale data 00041 class L2hienList09 {// WARN : all sits in RAM x 4096 tokens! 00042 public: 00043 enum {mxListSize=150}; // keep this size small 00044 enum {kDataFresh=0}; // if used 1 or more times data are stale 00045 private: 00046 friend class L2hienAlgo09 ; 00047 int isFresh; // for QA 00048 int size;// # of elements on the list below 00049 unsigned int value[mxListSize]; //list, not cleared 00050 }; 00051 00052 //------------------------------- 00053 class L2hienAlgo09 : public L2VirtualAlgo2009 { 00054 /* this class fills the folowing bins 00055 of counter histo (mhN), see also L2VirtualAlgo2008.h 00056 5 - # of eve w/ overflow # of towers, in decision() input 00057 6 - # of eve w/ STALE data - very bad, in decision() input 00058 00059 */ 00060 public: 00061 // shortcuts 00062 enum {mxBtow=(BtowGeom::mxEtaBin) * (BtowGeom::mxPhiBin)}; 00063 enum {mxEtow=(EtowGeom::mxEtaBin) * (EtowGeom::mxPhiBin)}; 00064 private: 00065 //..................... params set in initRun 00066 int par_dbg; 00067 int par_maxList; 00068 int par_adcThres; // in ADC counts above peds 00069 00070 //................... BTOW lookup tables 00071 int mRdo2towerID_B[mxBtow]; 00072 int mTowerID2etaBin_B[mxBtow]; // for QA only 00073 int mTowerID2phiBin_B[mxBtow]; // for QA only 00074 00075 //................... ETOW lookup tables 00076 int mRdo2towerID_E[mxEtow]; 00077 int mTowerID2etaBin_E[mxEtow]; // for QA only 00078 int mTowerID2phiBin_E[mxEtow]; // for QA only 00079 00080 //---- event-long variables changed by COMPUTE() ----- 00081 //............... preserved for Decision(), 00082 L2hienList09 mHiEnTw[L2eventStream2009::mxToken]; //it is a lot of RAM! 00083 L2hienResult2009 mHienResult[L2eventStream2009::mxToken]; //so is this! 00084 // add similar for the endcap 00085 00086 // utility methods 00087 void createHisto(); 00088 00089 public: 00090 L2hienAlgo09(const char* name, L2EmcDb* db, L2EmcGeom *geo, char* outDir, int resOff, L2VirtualAlgo2009::EmcSwitch beSwitch); 00091 int initRunUser( int runNo, int *rc_ints, float *rc_floats); 00092 void finishRunUser();// at the end of each run 00093 void computeUser(int token); 00094 bool decisionUser(int token, int *myL2Result);//only QA 00095 // expert only, to export high towers 00096 int getListSize(int token) { return mHiEnTw[token].size;} 00097 const unsigned int *getListData(int token) { return mHiEnTw[token].value;} 00098 00099 void print2(int token); 00100 00101 }; 00102 00103 #endif 00104 00105 /**************************************************** 00106 $Log: L2hienAlgo09.h,v $ 00107 Revision 1.1 2011/09/22 20:44:13 pibero 00108 *** empty log message *** 00109 00110 Revision 1.3 2008/02/01 00:16:44 balewski 00111 add mxListSize to BTOW/ETOW calibration 00112 00113 Revision 1.2 2008/01/30 21:56:43 balewski 00114 E+B high-enery-filter L2-algo fuly functional 00115 00116 Revision 1.1 2008/01/29 00:17:21 balewski 00117 new algo filtering high-energy towers 00118 00119 00120 00121 00122 */ 00123
1.5.9