StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
L2EmcGeom.h
1 #ifndef L2EMCGEOM_H
2 #define L2EMCGEOM_H
3 #include <stdio.h>
4 
5 /*******************************************************
6  * $Id: L2EmcGeom.h,v 1.6 2011/10/19 16:12:10 jml Exp $
7  * \author Jan Balewski, IUCF, 2006
8  *******************************************************
9  * Descripion:
10  * StRoot-free Geometry container , common for BTOW + ETOW + ESMD
11  *******************************************************
12  */
13 #include <string.h> // for memset
14 
15 #include "L2EmcDb.h"
16 
17 //-------------------------------------------
18 class BtowGeom{
19  public:
20  enum { mxRdo=(L2EmcDb::BTOW_MAXFEE*L2EmcDb::BTOW_DATSIZE) ,mxEtaBin=40, mxPhiBin=120, mxSubs=10 };
21  // tmp, should be better protected
22  float idealGain2Ene[mxEtaBin]; // (chan/GeV)
23  float cosh[mxEtaBin];
24  float gain2ET_rdo[mxRdo]; // (chan/GeV)coverts ADC to ET in GEV
25  float gain2Ene_rdo[mxRdo]; // (chan/GeV)coverts ADC to Energy in GEV
26  unsigned short ped_shifted_rdo[mxRdo];
27  unsigned short thr_rdo[mxRdo];
28  unsigned short ped_rdo[mxRdo];
29  void clear() { /* clear content, set threshold @ max as default */
30  memset(gain2ET_rdo, 0 ,sizeof(gain2ET_rdo));
31  memset(gain2Ene_rdo, 0 ,sizeof(gain2Ene_rdo));
32  memset(ped_shifted_rdo, 0,sizeof(ped_shifted_rdo));
33  memset(thr_rdo, 0xFFFF,sizeof(thr_rdo));
34  memset(ped_rdo, 0,sizeof(ped_rdo));
35  }
36 };
37 
38 //-------------------------------------------
39 class EtowGeom{
40  public:
41  enum { mxRdo=(L2EmcDb::ETOW_MAXFEE*L2EmcDb::ETOW_DATUSED) ,mxEtaBin=12, mxPhiBin=60, mxSubs=5 };
42  // tmp, should be better protected
43  float idealGain2Ene[mxEtaBin]; // (chan/GeV)
44  float cosh[mxEtaBin];
45  float gain2ET_rdo[mxRdo]; // (chan/GeV)coverts ADC to ET in GEV
46  float gain2Ene_rdo[mxRdo]; // (chan/GeV)coverts ADC to Energy in GEV
47  unsigned short ped_shifted_rdo[mxRdo];
48  unsigned short thr_rdo[mxRdo];
49  unsigned short ped_rdo[mxRdo];
50  void clear() { /* clear content, set threshold @ max as default */
51  memset(gain2ET_rdo, 0 ,sizeof(gain2ET_rdo));
52  memset(gain2Ene_rdo, 0 ,sizeof(gain2Ene_rdo));
53  memset(ped_shifted_rdo, 0,sizeof(ped_shifted_rdo));
54  memset(thr_rdo, 0xFFFF,sizeof(thr_rdo));
55  memset(ped_rdo, 0,sizeof(ped_rdo));
56  }
57 };
58 
59 //--------------------------------------
60 class L2EmcGeom { // instanton class, created only once per week
61  int par_maxADC;
62  float par_maxET; // for maxADC scale, for ideal gains
63 
64  public:
65  BtowGeom btow; // protect it better later
66  EtowGeom etow; // protect it better later
67  float getMaxET(){ return par_maxET;}
68  float getIdealAdc2ET(){ return par_maxADC/par_maxET;}
69  L2EmcGeom();
70  ~L2EmcGeom(){};
71 
72 
73 };
74 
75 
76 /***********************************************************
77 
78  Descripion:
79 
80 ****************************************************/
81 
82 
83 #endif
84 
85 
86 /*
87 *********************************************************************
88  $ $
89 
90 */
91