StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
L2hienAlgo08.h
1 #ifndef L2hienAlgo08_H
2 #define L2hienAlgo08_H
3 /*****************************************************
4  * $Id: L2hienAlgo08.h,v 1.3 2008/02/01 00:16:44 balewski Exp $
5  * \author Jan Balewski, MIT, 2008
6  *****************************************************
7 Descripion:
8 this algo selects high-energy towers from BTOW & ETOW data
9  and take advantage of common calibration to be deployed
10  at L2 in February of 2008.
11 The common (for B & E) ADC threshold is defined
12  in units of adc above ped i.e. in ET.
13 The output of this algo _one_ lists of pairs {adc,softID}.
14 You need 2 instances of this ago to cover E & B-EMC.
15 Saving of those lists to disk is beyond the scope of this algo.
16 SoftID is defined as follows:
17 *BTOW : traditional softID [1-4800] used since 20th centry.
18 *ETOW: range [0..719], eta index changes slower
19  int ieta= (x->eta-1);
20  int iphi= (x->sec-1)*EtowGeom::mxSubs + x->sub-'A' ;
21  int softId= iphi+EtowGeom::mxPhiBin*ieta;
22 
23 There is a hardcoded limit on the max list length at 256 towers.
24 In case of an overflow a random (not realy) selection of towers will be added to the list until the software limit is reached.
25 ******************************************************
26 */
27 
28 
29 #include "StTriggerUtilities/L2Emulator/L2algoUtil/L2VirtualAlgo2008.h"
30 
31 class L2hienAlgo08 ;
32 class L2Histo;
33 class L2EmcGeom;
34 
35 // remember to clear in initRun() to avoid stale data
36 class L2hienList08 {// WARN : all sits in RAM x 4096 tokens!
37  public:
38  enum {mxListSize=150}; // keep this size small
39  enum {kDataFresh=0}; // if used 1 or more times data are stale
40  private:
41  friend class L2hienAlgo08 ;
42  int isFresh; // for QA
43  int size;// # of elements on the list below
44  unsigned int value[mxListSize]; //list, not cleared
45 };
46 
47 //-------------------------------
49  /* this class fills the folowing bins
50  of counter histo (mhN), see also L2VirtualAlgo2008.h
51  5 - # of eve w/ overflow # of towers, in decision() input
52  6 - # of eve w/ STALE data - very bad, in decision() input
53 
54  */
55  public:
56  // shortcuts
57  enum {mxBtow=(BtowGeom::mxEtaBin) * (BtowGeom::mxPhiBin)};
58  enum {mxEtow=(EtowGeom::mxEtaBin) * (EtowGeom::mxPhiBin)};
59  private:
60  //..................... params set in initRun
61  int par_dbg;
62  int par_maxList;
63  int par_adcThres; // in ADC counts above peds
64 
65  //................... BTOW lookup tables
66  int mRdo2towerID_B[mxBtow];
67  int mTowerID2etaBin_B[mxBtow]; // for QA only
68  int mTowerID2phiBin_B[mxBtow]; // for QA only
69 
70  //................... ETOW lookup tables
71  int mRdo2towerID_E[mxEtow];
72  int mTowerID2etaBin_E[mxEtow]; // for QA only
73  int mTowerID2phiBin_E[mxEtow]; // for QA only
74 
75  //---- event-long variables changed by COMPUTE() -----
76  //............... preserved for Decision(),
77  L2hienList08 mHiEnTw[L2eventStream2008::mxToken]; //it is a lot of RAM!
78  // add similar for the endcap
79 
80  // utility methods
81  void createHisto();
82 
83  public:
84  L2hienAlgo08(const char* name, L2EmcDb* db, L2EmcGeom *geo, char* outDir, L2VirtualAlgo2008::EmcSwitch beSwitch);
85  int initRunUser( int runNo, int *rc_ints, float *rc_floats);
86  void finishRunUser();// at the end of each run
87  void computeUser(int token);
88  bool decisionUser(int token, void **myL2Result);//only QA
89  // expert only, to export high towers
90  int getListSize(int token) { return mHiEnTw[token].size;}
91  const unsigned int *getListData(int token) { return mHiEnTw[token].value;}
92 
93  void print2(int token);
94 
95 };
96 
97 #endif
98 
99 /****************************************************
100  $Log: L2hienAlgo08.h,v $
101  Revision 1.3 2008/02/01 00:16:44 balewski
102  add mxListSize to BTOW/ETOW calibration
103 
104  Revision 1.2 2008/01/30 21:56:43 balewski
105  E+B high-enery-filter L2-algo fuly functional
106 
107  Revision 1.1 2008/01/29 00:17:21 balewski
108  new algo filtering high-energy towers
109 
110 
111 
112 
113 */
114