00001 #ifndef L2hienAlgo12_H 00002 #define L2hienAlgo12_H 00003 /***************************************************** 00004 * $Id: L2hienAlgo12.h,v 1.3 2011/10/19 16:12:11 jml 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 "L2VirtualAlgo2012.h" 00030 #else 00031 #include "StTriggerUtilities/L2Emulator/L2algoUtil/L2VirtualAlgo2012.h" 00032 #endif 00033 00034 #include "L2hienResult2012.h" 00035 00036 class L2hienAlgo12 ; 00037 class L2Histo; 00038 class L2EmcGeom2012; 00039 00040 // remember to clear in initRun() to avoid stale data 00041 class L2hienList12 {// 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 L2hienAlgo12 ; 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 L2hienAlgo12 : public L2VirtualAlgo2012 { 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 L2hienList12 mHiEnTw[L2eventStream2012::mxToken]; //it is a lot of RAM! 00083 L2hienResult2012 mHienResult[L2eventStream2012::mxToken]; //so is this! 00084 // add similar for the endcap 00085 00086 // utility methods 00087 void createHisto(); 00088 00089 public: 00090 L2hienAlgo12(const char* name, const char *uid, L2EmcDb2012* db, L2EmcGeom2012 *geo, char* outDir, int resOff, L2VirtualAlgo2012::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: L2hienAlgo12.h,v $ 00107 Revision 1.3 2011/10/19 16:12:11 jml 00108 more 2012 stuff 00109 00110 Revision 1.2 2011/10/19 15:39:43 jml 00111 2012 00112 00113 Revision 1.1 2011/10/18 15:11:43 jml 00114 adding 2012 algorithms 00115 00116 Revision 1.1 2011/09/22 20:44:13 pibero 00117 *** empty log message *** 00118 00119 Revision 1.3 2008/02/01 00:16:44 balewski 00120 add mxListSize to BTOW/ETOW calibration 00121 00122 Revision 1.2 2008/01/30 21:56:43 balewski 00123 E+B high-enery-filter L2-algo fuly functional 00124 00125 Revision 1.1 2008/01/29 00:17:21 balewski 00126 new algo filtering high-energy towers 00127 00128 00129 00130 00131 */ 00132
1.5.9