StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
L2pedAlgo.h
1 #ifndef L2PEDALGO_H
2 #define L2PEDALGO_H
3 
4 /*********************************************************************
5  * $Id: L2pedAlgo.h,v 1.5 2007/11/18 21:58:59 balewski Exp $
6  * \author Jan Balewski, IUCF, 2006
7  *********************************************************************
8  * Descripion:
9  * pedestal algo in L2 , for BTOW & ETOW
10  *********************************************************************
11  */
12 
13 
14 class L2Histo;
15 #ifdef IS_REAL_L2 //in l2-ana environmen
16  #include "L2VirtualAlgo.h"
17 #else
18  #include "StTriggerUtilities/L2Emulator/L2algoUtil/L2VirtualAlgo.h"
19 #endif
20 
21 class L2pedAlgo : public L2VirtualAlgo {
22  enum{minAdc=-20, maxAdc=4096};
23  /* usefull dimensions */
24 #define MaxBtowRdo (L2EmcDb::BTOW_MAXFEE*L2EmcDb::BTOW_DATSIZE)
25 #define MaxEtowRdo (L2EmcDb::ETOW_MAXFEE*L2EmcDb::ETOW_DATSIZE)
26 
27  bool par_pedSubtr;
28  bool par_saveBinary;
29  int par_speedFact;
30  int par_dbg;
31  int par_prescAccept;
32 
33 
34  // speed-variables
35  short s_stepE, s_stepB, s_lastE, s_lastB;
36 
37  //.............run-long variables
38  enum { mxHA=64};
39  L2Histo *hA[mxHA]; // my private HBOOK@L2
40 
41  L2Histo *btowAdc[MaxBtowRdo]; // my private HBOOK@L2
42  L2Histo *etowAdc[MaxEtowRdo]; // my private HBOOK@L2
43  int nInp; // input event counter
44  int run_number;
45 
46  /* fast DB lookup tables */
47  unsigned short db_btowPed[MaxBtowRdo];
48  unsigned short db_etowPed[MaxEtowRdo];
49 
50  // event-like variables
51  TrgDataType* myTrigData;
52 
53  public:
54  L2pedAlgo(const char* name, L2EmcDb* db, char* outDir, int resOff);
55  // ~L2pedAlgo(){}; // memory leak
56  int initRun(int runNo, int *rc_ints, float *rc_floats);
57 
58  bool doEvent(int L0trg, int inpEveId, TrgDataType* trgData, // for every event
59  int bemcIn, unsigned short *bemcData,
60  int eemcIn, unsigned short *eemcData);
61 
62  void finishRun();// at the end of each run
63 };
64 
65 #endif
66 
67 
68 /**********************************************************************
69  $Log: L2pedAlgo.h,v $
70  Revision 1.5 2007/11/18 21:58:59 balewski
71  L2algos triggerId list fixed
72 
73  Revision 1.4 2007/11/08 04:02:33 balewski
74  run on l2ana as well
75 
76  Revision 1.3 2007/11/02 03:03:50 balewski
77  modified L2VirtualAlgo
78 
79  Revision 1.2 2007/10/25 02:07:07 balewski
80  added L2upsilon & binary event dump
81 
82  Revision 1.1 2007/10/11 00:33:25 balewski
83  L2algo added
84 
85  Revision 1.5 2006/03/28 19:46:51 balewski
86  ver16b, in l2new
87 
88  Revision 1.4 2006/03/11 17:08:35 balewski
89  now CVS comments should work
90 
91 */
92