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