00001 #ifndef L2exampleAlgo08_H 00002 #define L2exampleAlgo08_H 00003 /********************************************************************* 00004 * $Id: L2exampleAlgo08.h,v 1.5 2008/01/30 00:47:17 balewski Exp $ 00005 * \author Jan Balewski, MIT, 2008 00006 ********************************************************************* 00007 * Descripion: 00008 * example algo finding list of 2x2 BTOW clusters based on ET-seed list produced by L2-btow-calib algo 00009 * features: uses 2D array (ieta vs. iphi ) 00010 * Limitations: 00011 * - ignores seeds at the edges 00012 * - double counts for neighbours seeds 00013 * - no provision for wrap up in phi 00014 ********************************************************************* 00015 */ 00016 00017 00018 #include "StTriggerUtilities/L2Emulator/L2algoUtil/L2VirtualAlgo2008.h" 00019 #include "L2exampleResult08.h" 00020 00021 class L2exampleAlgo08 ; 00022 class L2Histo; 00023 class L2EmcGeom; 00024 00025 // remember to clear in initRun() to avoid stale data 00026 class L2exampleEvent08 {// WARN : all is in RAM x 4096 tokens! 00027 public: 00028 enum {mxClust=50}; // keep the size down 00029 enum {kDataFresh=0}; // if used 1 or more times data are stale 00030 private: 00031 friend class L2exampleAlgo08 ; 00032 int isFresh; // for QA 00033 int size;// size of used data in the array below 00034 float clusterET[mxClust]; //above seed thresholds, not cleared 00035 L2exampleResult08 resultBlob; 00036 }; 00037 00038 class L2exampleAlgo08 : public L2VirtualAlgo2008 { 00039 /* this class fills the folowing bins 00040 of counter histo (mhN), see also L2VirtualAlgo2008.h 00041 5 - # of eve w/ overflow # of clusters, on input 00042 6 - # of eve w/ STALE data - very bad, on input 00043 00044 15 - # of eve w/ overflow # of clusters, accepted 00045 */ 00046 public: 00047 enum {mxBtow=(BtowGeom::mxEtaBin) * (BtowGeom::mxPhiBin)}; // shortcut 00048 private: 00049 00050 //..................... params set in initRun 00051 int par_dbg; 00052 float par_seedEtThres; 00053 float par_clusterEtThres; 00054 float par_eventEtThres; 00055 00056 //.............run-long, token independent variables 00057 L2EmcGeom *mGeom;// avaliable but not used in this example 00058 int mRdo2tower[mxBtow]; 00059 int mTower2rdo[mxBtow]; 00060 00061 //---- event-long variables changed by COMPUTE() ----- 00062 //............... working, token independent 00063 float wrkBtow_et[mxBtow]; // full event 00064 int wrkBtow_tower_seed[mxBtow]; // above seed thresholds, not cleared 00065 int wrkBtow_tower_seed_size; 00066 //............... preserved for Decision(), 00067 L2exampleEvent08 mBtow[L2eventStream2008::mxToken]; //it is a lot of RAM! 00068 00069 // utility methods 00070 void createHisto(); 00071 void clearEvent(int token); 00072 float sumET(int phi, int eta); 00073 00074 public: 00075 L2exampleAlgo08(const char* name, L2EmcDb* db, L2EmcGeom *geo, char* outDir); 00076 int initRunUser( int runNo, int *rc_ints, float *rc_floats); 00077 void finishRunUser();// at the end of each run 00078 void computeUser(int token); 00079 bool decisionUser(int token, void **myL2Result); 00080 00081 void print1(int token); 00082 void print2(); 00083 void print3(); 00084 00085 }; 00086 00087 #endif 00088 00089 /********************************************************************** 00090 $Log: L2exampleAlgo08.h,v $ 00091 Revision 1.5 2008/01/30 00:47:17 balewski 00092 Added L2-Etow-calib 00093 00094 Revision 1.4 2008/01/18 23:29:13 balewski 00095 now L2result is exported 00096 00097 Revision 1.3 2008/01/17 23:15:52 balewski 00098 bug in token-addressed memory fixed 00099 00100 Revision 1.2 2008/01/16 23:32:36 balewski 00101 toward token dependent compute() 00102 00103 Revision 1.1 2007/12/19 02:30:19 balewski 00104 new L2-btow-calib-2008 00105 00106 00107 00108 */ 00109
1.5.9