StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
L2wBemc2012.h
1 #ifndef L2wBemc2012b_H
2 #define L2wBemc2012b_H
3 /*********************************************************************
4  * $Id: L2wBemc2012.h,v 1.3 2011/10/19 16:12:12 jml Exp $
5  * \author Jan Balewski, MIT, 2008
6  *********************************************************************
7  * Descripion:
8  * example algo finding list of 2x2 BTOW clusters based on ET-seed list produced by L2-btow-calib algo
9  * features: uses 2D array (ieta vs. iphi )
10  * Limitations:
11  * - ignores seeds at the edges
12  * - double processing for neighbours seeds
13  *********************************************************************
14  */
15 
16 #ifdef IS_REAL_L2 //in l2-ana environment
17  #include "L2VirtualAlgo2012.h"
18 #else
19  #include "StTriggerUtilities/L2Emulator/L2algoUtil/L2VirtualAlgo2012.h"
20 #endif
21 #include "L2wResult2012.h"
22 
23 class L2wBemc2012 ;
24 class L2Histo;
25 class L2EmcGeom2012;
26 // remember to clear in initRun() to avoid stale data
27 class L2wBemcEvent2012 {// WARN : all is in RAM x 4096 tokens!
28  public:
29  enum {kDataFresh=0}; // if used 1 or more times data are stale
30  private:
31  friend class L2wBemc2012 ;
32  int isFresh; // for QA
33  float clusterET;
34  float seedET;
35  unsigned long long tkCompute;
36  L2wResult2012 resultBlob;
37 };
38 
40  /* this class fills the folowing bins
41  of counter histo (mhN), see also L2VirtualAlgo2012.h
42  6 - # of eve w/ STALE data - very bad, on input
43  */
44  public:
45  enum {mxBtow=(BtowGeom::mxEtaBin) * (BtowGeom::mxPhiBin)}; // shortcut
46  private:
47 
48  //..................... params set in initRun
49  int par_dbg;
50  float par_seedEtThres;
51  float par_clustEtThres;
52 
53  //.............run-long, token independent variables
54  L2EmcGeom2012 *mGeom;// avaliable but not used in this example
55  int mRdo2tower[mxBtow];
56  int mTower2rdo[mxBtow];
57 
58  //---- event-long variables changed by COMPUTE() -----
59  //............... working, token independent
60  float wrkBtow_et[mxBtow]; // full event
61  int wrkBtow_tower_seed[mxBtow]; // above seed thresholds, not cleared
62  int wrkBtow_tower_seed_size;
63  //............... preserved for Decision(),
64  L2wBemcEvent2012 mBtow[L2eventStream2012::mxToken]; //it is a lot of RAM!
65 
66  // utility methods
67  void createHisto();
68  void clearEvent(int token);
69  void clearEvent();
70  float sumET(int phi, int eta);
71 
72  public:
73  L2wBemc2012(const char* name, const char *uid, L2EmcDb2012* db, L2EmcGeom2012 *geo, char* outDir, int resOff);
74  int initRunUser( int runNo, int *rc_ints, float *rc_floats);
75  void finishRunUser();// at the end of each run
76  void computeUser(int token);
77  bool decisionUser(int token, int *myL2Result);
78 
79  void print1(int token);
80  void print2();
81  void print3();
82  void print4(int token, int hitSize);
83 
84 };
85 
86 #endif
87 
88 /**********************************************************************
89  $Log: L2wBemc2012.h,v $
90  Revision 1.3 2011/10/19 16:12:12 jml
91  more 2012 stuff
92 
93  Revision 1.2 2011/10/19 15:39:45 jml
94  2012
95 
96  Revision 1.1 2011/10/18 15:11:45 jml
97  adding 2012 algorithms
98 
99  Revision 1.1 2009/03/28 19:43:53 balewski
100  2009 code
101 
102 
103 
104 */
105