]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/AliHLTPHOSConstants.h
Added new files to build system
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSConstants.h
1 /**************************************************************************
2  * This file is property of and copyright by the Experimental Nuclear     *
3  * Physics Group, Dep. of Physics                                         *
4  * University of Oslo, Norway, 2006                                       *
5  *                                                                        * 
6  * Author: Per Thomas Hille perthi@fys.uio.no for the ALICE DCS Project.  *
7  * Contributors are mentioned in the code where appropriate.              *
8  * Please report bugs to perthi@fys.uio.no                                * 
9  *                                                                        *
10  * Permission to use, copy, modify and distribute this software and its   *
11  * documentation strictly for non-commercial purposes is hereby granted   *
12  * without fee, provided that the above copyright notice appears in all   *
13  * copies and that both the copyright notice and this permission notice   *
14  * appear in the supporting documentation. The authors make no claims     *
15  * about the suitability of this software for any purpose. It is          *
16  * provided "as is" without express or implied warranty.                  *
17  **************************************************************************/
18
19 //#ifndef COMMONDEFSX_H
20 //#define COMMONDEFSX_H
21
22
23 #ifndef ALIHLTPHOSCONSTANTS_H
24 #define ALIHLTPHOSCONSTANTS_H
25
26
27 //#define APDVAL_BASE_PATH       "../data/APD_settings/"
28 //#define CONFIG_BASE_PATH       "../data/ConfigurationFiles/"
29 //#define APDSCRIPT_BASE_PATH   "../data/APD_scripts/"
30
31
32 namespace PhosHLTConst
33 {
34   const int MAX_HOSTS = 20;
35   const int DEFAULT_EVENT_PORT = 42001;
36   const int MAX_BIN_VALUE = 1023;
37
38   const int DEFAULT_APD_DAC_VALUE = 512;
39   const int EXIST = 0;
40   const int NO_EXIST = -1;
41
42   const char APDVAL_BASE_PATH[]   =    "../data/APD_settings/";
43   const char  CONFIG_BASE_PATH[]    =   "../data/ConfigurationFiles/";
44   const char APDSCRIPT_BASE_PATH[]  =  "../data/APD_scripts/";
45
46   //  const char *APDVAL_BASE_PATH   =    "../data/APD_settings/";
47
48   const unsigned long int  AFL =  0x8000;
49   const unsigned long int  RDOL = 0x8001;
50   //register typs
51   const unsigned int REGTYPE_ALTRO = 1;
52   const unsigned int REGTYPE_BC    = 2;
53   const unsigned int REGTYPE_RCU   = 3;
54   const unsigned int REGTYPE_RCU_ACL = 4;
55   const unsigned int REGTYPE_TRU     = 5;
56   const unsigned int REGTYPE_TOR     = 6;
57   const unsigned int REGTYPE_BUSY    = 7;
58
59
60   const unsigned int TRU_SLOT  = 0;
61   const unsigned int TRU_A  = 0;
62   const unsigned int TRU_B = 16;
63
64   const unsigned int TRUS_PER_RCU = 2;
65   const unsigned int MAX_MESSAGE_SIZE = 512;
66   const unsigned int ACL_SIZE  = 256; 
67
68   const unsigned long int ACL_BASE_ADDRESS  = 0x6400;
69   const unsigned long int RCU_BASEADRESS = 0x7000;
70   const unsigned long int RCU_RESULT_BASE = 0x6000;
71   const unsigned long int TRU_REGS_BASE_ADDRESS = 0x72;
72
73   const unsigned int N_TRU_REGS = 7;
74   const unsigned int MAX_RESULT_BUFFER_SIZE = 8192;
75   const unsigned int MAX_WORD_SIZE =  32; //maximum size in character  of one word in the RCU result buffer
76
77   //  char *APDVAL_BASE_PATH     =  "../data/APD_settings/";
78   //  char *CONFIG_BASE_PATH     =  "../data/ConfigurationFiles/";
79   //  char *APDSCRIPT_BASE_PATH  = "../data/APD_scripts/";
80   const unsigned int DEBUG      =  0;  //0/1/2/3 - Level for debugging details
81   const unsigned int PHOS_ROWS  = 64;  // Number of rows per one PHOS module
82   const unsigned int PHOS_COLS  = 56;   // Number of columns per one PHOS module
83
84   const unsigned int PHOS_GAINS = 2;  // Number of gains per one PHOS crystal
85   const unsigned int HIGH_GAIN    =   1;
86   const unsigned int LOW_GAIN     =   0;
87   const unsigned long int MAX_TRIGGER_DELAY  = 0x3fff;
88   const unsigned int PHOS_MODS  = 5; // Number of PHOS modules
89
90
91 const unsigned int ALTRO_MAX_SAMPLES = 1008;                           /**<The maximum number of samples of the ALTRO*/
92  const unsigned int ALTRO_MAX_TRALER_SIZE = 7;  
93  const unsigned int  DDL_BLOCK_SIZE = 5;
94
95  // const unsigned int NULL = 0;
96
97 const unsigned int N_MODULES    =      5;                             /**<Number of modules of the PHOS detector*/
98 const unsigned int N_RCUS       =      4;                             /**<Number of RCUs per Module*/
99 const unsigned int N_RCUS_PER_MODULE =  4 ;                            /**<Number of RCUs per Module*/
100 const unsigned int N_RCUS_PER_TOTAL =  N_MODULES*N_RCUS_PER_MODULE;   /**<Total number of RCUs for PHOS*/
101 const unsigned int N_BRANCHES      =   2;                             /**<Number of branches per RCU*/
102 const unsigned int N_FEECS         =  14;                             /**<Number of Frontend cards per branch*/
103 const unsigned int N_ALTROS        =   4;                             /**<Number of ALTROs per frontend card*/
104  const unsigned int N_ALTROCHANNELS =  16;    
105 const unsigned int N_ROWS_MOD       =  56;                            /**<Number of rows per module*/       
106 const unsigned int N_COLUMNS_MOD    =  64;                            /**<Number of columns per module*/ 
107 const unsigned int N_ROWS_RCU       =  28;                            /**<Number of rows per module*/       
108  const unsigned int N_COLUMNS_RCU   =   32;   
109 const unsigned int N_ZROWS_RCU     =   N_ROWS_RCU;                    /**<Number of rows per module*/       
110  const unsigned int N_XCOLUMNS_RCU  =   N_COLUMNS_RCU; 
111 const unsigned int N_ZROWS_MOD      =  N_ROWS_MOD;                    /**<Number of rows per module*/       
112 const unsigned int N_XCOLUMNS_MOD   =  N_COLUMNS_MOD;                 /**<Number of columns per module*/ 
113 const unsigned int N_GAINS         =   2;                             /**<Number of gains per ALTRO channel*/
114  const unsigned int N_DATATYPES     =   10;    
115
116  const unsigned int  PF_MAX_PATH_LENGTH = 256;
117  const unsigned char PF_VECTOR_DIR[] = "/HLT/PHOS/PFVectors";
118  const unsigned int PF_DEFAULT_N_SAMPLES = 70;
119   const unsigned int PF_DEFAULT_STARTINDEX = 0;
120
121 const unsigned int DEFAULT_TAU = 2;    /**<Assume that the signal rise time of the altrp pulses is 2 us (nominal value of the electronics)*/
122 const unsigned int  DEFAULT_FS = 10;   /**<Assume that the signal is samples with 10 MHZ samle rate*/
123
124   const unsigned int MODULE_0     = 0;
125   const unsigned int MODULE_1     = 1;
126   const unsigned int MODULE_2     = 2;
127   const unsigned int MODULE_3     = 3;
128   const unsigned int MODULE_4     = 4;
129   const unsigned int RCUS_PER_MODULE = 4;   ///// Number of RCUs per Module///
130   const unsigned int CSPS_PER_FEE    = 32;
131   const unsigned int RCU_0       = 0;
132   const unsigned int RCU_1       = 1;
133   const unsigned int RCU_2       = 2;
134   const unsigned int RCU_3       = 3;
135   const unsigned int CARDS_PER_RCU  = 28;
136   const unsigned int MAX_CARDS_PER_RCU = 32;
137   const unsigned int CARDS_PER_BRANCH  = 14;
138   const unsigned int BRANCHES_PER_RCU = 2;
139   const unsigned int BRANCH_A     = 0;
140   const unsigned int BRANCH_B    = 1;
141   const unsigned int Z_0         = 0;
142   const unsigned int Z_1         = 1;
143   const unsigned int X_0         = 0;
144   const unsigned int X_1         = 1;
145   const unsigned int FEE_CHANS  = 16;   // Number of ALTRO channels per one ALTRO chip
146   const unsigned int FEE_ALTROS = 4;    // Number of ALTRO chips per one FEC (Front End Card)
147   const unsigned int FEE_FECS   = 14;   // Number of FECs per one RCU branch
148   const unsigned int FEE_BRANCHS         = 2;   // Number of RCU branchs per one RCU
149   const unsigned int FEE_RCUS   = 4;    // Number of RCUs per one PHOS module !!redundant
150   
151   const unsigned int MAX_TRIALS  = 5;
152   const unsigned int MAX_MESSAGE_LENGTH  = 150;
153   const unsigned int MAX_LOGVIEWER_LINECOUNT = 300;
154   
155   const unsigned int TURN_ON = 0;
156   const unsigned int TURN_OFF = 1;
157
158   const signed  int APD_OK = 1;
159   const signed  int APD_DEAD  = -1;
160   const signed  int APD_ZERO  = -2;
161   const signed  int APD_CRAZY = -3;
162   const signed  int APD_UNKNOWN = 2;
163   
164   const signed int REG_OK = 1;
165   const signed int REG_DEAD  = -1;
166   const signed int REG_ZERO  = -2;
167   const signed int REG_CRAZY = -3;
168   const signed int REG_UNKNOWN = 2;
169
170   const unsigned int FEE_STATE_OFF = 1;
171   const unsigned int FEE_STATE_ON  = 2;
172   const unsigned int DCS_NOT_MASTER = 3;
173   const unsigned int FEE_STATE_UNKNOWN  = 4;
174   const unsigned int FEE_STATE_ERROR    = 5;
175   const unsigned int UNKNOWN_PCMVERSION = 6;
176   const unsigned int UNKNOWN_ERROR  = 7;
177   const unsigned int FEE_STATE_WARNING = 8; 
178   const unsigned long int OLD_PCMVERSION = 0x12;
179   const unsigned long int PCMVERSION = 0x20;
180   const unsigned long int SELECTED_COLOR  =  0x0000ff; //Blue
181   const unsigned long int ON_COLOR        =  0x00ff00; //Green
182   const unsigned long int OFF_COLOR       =  0xffffff; //White
183   const unsigned long int ERROR_COLOR     =  0xff0000; //Red
184   const unsigned long int UNKNOWN_COLOR   =  0xaaaaaa; //Gray
185   const unsigned long int WARNING_COLOR   =  0xffff00; //Yellow
186   
187 };
188
189
190 #endif
191
192