]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/PHOS/tru/AliHLTPHOSTRUMapper.cxx
- Bug fix: in the creation/reading of the trigger DCS values, the HV and currents...
[u/mrichter/AliRoot.git] / HLT / PHOS / tru / AliHLTPHOSTRUMapper.cxx
CommitLineData
1b41ab20 1// $Id$
2
48b962f0 3 /**************************************************************************
4 * This file is property of and copyright by the ALICE HLT Project *
5 * All rights reserved. *
6 * *
7 * Primary Authors: Oystein Djuvsland *
8 * *
9 * Permission to use, copy, modify and distribute this software and its *
10 * documentation strictly for non-commercial purposes is hereby granted *
11 * without fee, provided that the above copyright notice appears in all *
12 * copies and that both the copyright notice and this permission notice *
13 * appear in the supporting documentation. The authors make no claims *
14 * about the suitability of this software for any purpose. It is *
15 * provided "as is" without express or implied warranty. *
16 **************************************************************************/
17
18#include "AliHLTPHOSTRUMapper.h"
19
20#define N_CHANNELS_ADC 8
21#define N_ADCS_TRU 14
22#define N_ADCS_MASK 2
23#define N_XCRYSTALS_TRU 16
24#define N_ZCRYSTALS_TRU 28
25#define N_ZCRYSTALS 56
26#define N_XCRYSTALS 64
27#define N_XCRYSTALS_ADC 16
28#define N_ZCRYSTALS_ADC 2
29#define CHANNEL_MASK 1
30
31AliHLTPHOSTRUMapper::AliHLTPHOSTRUMapper()
32{
33}
34
35
36AliHLTPHOSTRUMapper::~AliHLTPHOSTRUMapper()
37{
38}
39
40void
41AliHLTPHOSTRUMapper::GetChannelMask(x, z, Short_t *maskArray)
42{
43 Int_t chNb = -1;
44 Int_t ADCNb = -1;
45
46 for(Int_t i = 0; i < N_ADCS_TRU/N_ADCS_MASK; i++)
47 {
48 maskArray[i] = 0;
49 }
50
51 chNb = fChannelLookupArrayPtr[x];
52
53 ADCNb = N_ADCS_TRU - z/N_ZCRYSTALS_ADC;
54
55 maskArray[(ADCNb-1)/N_ADCS_MASK] = (CHANNEL_MASK << chNb) << ((1 - ADCNb % N_ADCS_MASK) * N_CHANNELS_ADC );
56
57}
58
59Int_t
60AliHLTPHOSTRUMapper::GetTRUMask(x, z, Short_t *maskArray)
61{
62 Int_t TRUNb = x/N_XCRYSTALS_TRU + z/N_ZCRYSTALS_TRU;
63
64 GetChannelMask(x, z, maskArray);
65
66 return TRUNb;
67}
68
69void
70AliHLTPHOSTRUMapper::GetLookUpTable()
71{
72 ifstream infile;
73
74 inFile.open("channelLookup.txt");
75
76 for(Int_t i = 0; i < 8; i++)
77 {
78 inFile >> fChannelLookupArrayPtr[i];
79 }
80
81 inFile.close();
82}
83
84
85
86
87
88
89
90