]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EMCAL/AliEMCALGeoParams.h
Update From Debojit
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALGeoParams.h
1 #ifndef ALIEMCALGEOPARAMS_H
2 #define ALIEMCALGEOPARAMS_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 //////////////////////////////////////////////////////////
7 // class for holding various parameters; 
8 //
9 // Author: David Silvermyr (ORNL)
10 //
11 //////////////////////////////////////////////////////////
12
13 class AliEMCALGeoParams
14 {
15 public:
16
17   // general geometry info
18   static const int fgkEMCALModules     = 22;   // number of modules, 12 for EMCal + 8 for DCAL
19   static const int fgkEMCALRows        = 24;   // number of rows per module for EMCAL
20   static const int fgkEMCALCols        = 48;   // number of columns per module for EMCAL
21
22   static const int fgkEMCALLEDRefs     = 24;   // number of LEDs (reference/monitors) per module for EMCAL; one per StripModule
23   static const int fgkEMCALTempSensors = 8;    // number Temperature sensors per module for EMCAL
24
25   Int_t GetStripModule(Int_t iSM, Int_t iCol) const
26     // Strip 0 is the one closest to the FEE crates; different for A (iColumn/2) and C sides
27     { return ( (iSM%2==0) ? iCol/2 : AliEMCALGeoParams::fgkEMCALLEDRefs - 1 - iCol/2 ); }
28
29   // also a few readout related variables:
30   static const int fgkLastAltroDDL     = 43;   // 0..23 (i.e. 24) for EMCAL; 24..39 (i.e. 16) allocated for DCAL
31   static const int fgkSampleMax        = 1023; // highest possible sample value (10-bit = 0x3ff)
32   static const int fgkOverflowCut      = 950;  // saturation starts around here; also exist as private constant in AliEMCALRawUtils, should probably be replaced
33   static const int fgkSampleMin        = 0;    // lowest possible sample value 
34
35   // TRU numbers
36   static const int fgkEMCALTRUsPerSM   = 3;    // number of TRU's in a SuperModule
37   static const int fgkEMCAL2x2PerTRU   = 96;   // number of 2x2's in a TRU
38   static const int fgkEMCALTRURows     = 4;    // number of TRU rows
39   static const int fgkEMCALTRUCols     = 24;   // number of TRY cols
40
41   //STU numbers
42   static const int fgkEMCALSTUCols     = 48;   // STU columns
43   static const int fgkEMCALSTURows     = 64;   // STU rows
44   
45   // RAW/AliCaloAltroMapping provides the correspondence information between
46   // an electronics HWAddress (Branch<<1 | FEC<<7 | ALTRO<<4 | Channel) 
47   // for the RCUs and which tower (Column and Row) that corresponds to. 
48   // For the cases when one doesn't have a Raw stream to decode the HW address
49   // into the other FEE indices, we provide the needed simple methods here 
50   // with arguments (within an RCU)
51   Int_t GetHWAddress(Int_t iBranch, Int_t iFEC, Int_t iALTRO, Int_t iChannel) const
52   { return ( (iBranch<<11) | (iFEC<<7) | (iALTRO<<4) | iChannel ); } // 
53   // and for converting back to the individual indices
54   Int_t GetBranch(Int_t iHW)  const { return ( (iHW>>11) & 0x1 ) ; } // 
55   Int_t GetFEC(Int_t iHW)     const { return ( (iHW>>7) & 0xf )  ; } // 
56   Int_t GetAltro(Int_t iHW)   const { return ( (iHW>>4) & 0x7 )  ; } // 
57   Int_t GetChannel(Int_t iHW) const { return ( iHW & 0xf )       ; } // 
58
59   // We can also encode a very similar CSP address
60   Int_t GetCSPAddress(Int_t iBranch, Int_t iFEC, Int_t iCSP) const
61   { return ( (iBranch<<11) | (iFEC<<7) | iCSP ); }; // 
62   // and for converting back to the individual indices
63   // Branch and FEC methods would just be the same as above
64   Int_t GetCSPFromAddress(Int_t i) const { return ( i & 0x1f )   ; } // 
65
66   /* // Below is some placeholder info that can later be added
67      // in AliEMCALGeometry, together with the Get methods just above 
68
69   // But which CSP (0..31) corresponds to which ALTRO and Channel is not 
70   // given anywhere (CSPs are used for APD biases etc).
71   // So, we add a conversion method for that here also.
72   // The order that the CSPs appear in the data is a bit funky so I include
73   // a mapping array instead of some complicated function
74   static const int fgkNCSP = 32;
75   static const int fgkCspOrder[32] =
76     { // just from ALTRO mapping of chips/channels to CSP
77       11,  27,  10,  26,  24,   8,  25,   9, // ALTRO 0
78       3,  19,   2,  18,  16,   0,  17,   1, // ALTRO 2
79       4,  20,   5,  21,  23,   7,  22,   6, // ALTRO 3
80       12,  28,  13,  29,  31,  15,  30,  14 // ALTRO 4
81     };
82   // This method is not used for reconstruction or so, but just for cross-
83   // checks with the DCS for the APD biases. 
84   int GetCSP(int iALTRO, int iChannel) const 
85   { 
86     int id = iChannel/2; // 2 channels per tower (low and high gain)
87     int ichip = iALTRO;
88     if (ichip>=2) { ichip--; } // there is no ALTRO 1; (0,2,3,4 -> 0,1,2,3)
89     id += ichip*8; // 8 CSPs per ALTRO
90     //return fgkCspOrder[id];
91     return id;
92   }
93
94   */
95
96   ClassDef(AliEMCALGeoParams,2)
97   
98 };
99
100 #endif