StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
L2Upsilon2009.h
1 #ifndef L2Upsilon2009_H
2 #define L2Upsilon2009_H
3 
4 #ifdef IS_REAL_L2 //in l2-ana environment
5  #include "L2VirtualAlgo2009.h"
6 #else
7  #include "StTriggerUtilities/L2Emulator/L2algoUtil/L2VirtualAlgo2009.h"
8 #endif
9 #include "L2UpsilonResult2009.h"
10 
11 class L2Upsilon2009 ;
12 class L2Histo;
13 class L2EmcGeom;
14 // remember to clear in initRun() to avoid stale data
15 class L2UpsilonEvent2009 {// WARN : all is in RAM x 4096 tokens!
16  public:
17  enum {kDataFresh=0}; // if used 1 or more times data are stale
18  private:
19  friend class L2Upsilon2009 ;
20  int isFresh; // for QA
21  L2UpsilonResult2009 resultBlob;
22 };
23 
25  public:
26  enum {mxBtow=(BtowGeom::mxEtaBin) * (BtowGeom::mxPhiBin)}; // shortcut
27  private:
28 
29  //..................... params set in initRun
30  int par_prescale;
31  int fMaxDynamicMaskTowers;
32  int fHowManyEventPerUpdateDynamicMask;
33  int fHotTowerSeenTimesThreshold;
34  float fMinL0ClusterEnergy,fMinL2ClusterEnergy;
35  float fMinInvMass,fMaxInvMass,fMaxCosTheta;
36  float fL0SeedThreshold,fL2SeedThreshold;
37  float fHotTowerThreshold;
38  float fThresholdRatioOfHotTower;
39 
40  int prescale;
41  //.............run-long, token independent variables
42  L2EmcGeom *mGeom;// avaliable but not used in this example
43  int mRdo2tower[mxBtow];
44  int mTower2rdo[mxBtow];
45  int rdo2softID[mxBtow+1];
46  int event_accept;
47  int EventSeen;
48 
49  //---- event-long variables changed by COMPUTE() -----
50  float wrkBtow_ene[mxBtow+1];
51  int wrkBtow_tower[mxBtow+1];
52  int wrkL2_seed_tower[mxBtow+1]; //store tower ID [0~wrkNumberOfL0]
53  float wrkL2_seed_ClusterE[mxBtow+1];
54  int wrkL0_seed_tower[mxBtow+1]; //store tower ID [0~wrkNumberOfL2]
55  float wrkL0_seed_ClusterE[mxBtow+1];
56  int wrkNumberOfL2;
57  int wrkNumberOfL0;
58 
59  int wrkDynamicMask_tower_stat[mxBtow+1]; //status of tower ID (use to judge hot towers)
60  int wrkDynamicMasked_tower[101]; //tower ID
61  int wrkNumberOfMasked; // howmany tower have been masked
62 
63  //............... preserved for Decision(),
64  L2UpsilonEvent2009 mBtow[L2eventStream2009::mxToken]; //it is a lot of RAM!
65 
66  // utility methods
67  void createHisto();
68  void clearEvent(int token);
69  void clearEvent();
70  void update_DynamicMask();
71 
72  public:
73  L2Upsilon2009(const char* name, L2EmcDb* db, L2EmcGeom *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 
80 #endif
81 
82 /**********************************************************************
83  $Log: L2Upsilon2009.h,v $
84  Revision 1.1 2011/09/22 20:46:52 pibero
85  *** empty log message ***
86 
87  Revision 1.5 2008/01/30 00:47:17 balewski
88  Added L2-Etow-calib
89 
90  Revision 1.4 2008/01/18 23:29:13 balewski
91  now L2result is exported
92 
93  Revision 1.3 2008/01/17 23:15:52 balewski
94  bug in token-addressed memory fixed
95 
96  Revision 1.2 2008/01/16 23:32:36 balewski
97  toward token dependent compute()
98 
99  Revision 1.1 2007/12/19 02:30:19 balewski
100  new L2-btow-calib-2008
101 
102 */
103