100{
102
103 uint32_t NRELAYERPOS, NREWIREPOS, NREEAWEPOS;
104 uint32_t NRELAYERMASK, NREWIREMASK, NREEAWEMASK;
105
106
107
108
109 f.open( initFile.c_str());
110
111 if( f.bad() ) {
112 cerr << "Error: could not open file " << initFile << endl;
113 return false;
114 }
115
117 cerr << "Error: could not find '##MdcDigiConf' in file " << initFile << endl;
118 return StatusCode::FAILURE;
119 }
120
128 return false;
129
130 f.close();
131
132
133 uint32_t nRELayerPos, nREWirePos, nREEaWePos;
134 uint32_t nRELayerMask, nREWireMask, nREEaWeMask;
135
136
139
140 int i = 0;
141
142 uint32_t layer, wire;
143
144 nRELayerPos = NRELAYERPOS;
145 nREWirePos = NREWIREPOS;
146 nRELayerMask = NRELAYERMASK;
147 nREWireMask = NREWIREMASK;
148
149 for(uint32_t TELayer = 0; TELayer <= TELayerMax; TELayer++ )
150 {
151 layer = TELayer + 1;
152
153 if(layer >= 0x20) {
154 layer = layer + i ;
155 i++;
156 nRELayerMask = nRELayerMask&0xFFFFFBFF;
157 nREWireMask = nREWireMask|0x00000400;
159 }
160 else {
161
162 TEWireMax = 240;
163 }
164
165 for(uint32_t TEWire = 0; TEWire <= TEWireMax; TEWire++ )
166 {
167 wire = TEWire + 1;
168 uint32_t reid = (((layer<<nRELayerPos)&nRELayerMask)|
169 ((wire<<nREWirePos)&nREWireMask))>>2;
170
171
172
173
174
176
177 if( reid >= 16384 )
178 {
179 cerr << "Error: REID overflow !" << reid << endl;
180 exit(8);
181 }
182
183
184 m_re2te[reid] = teid;
185 m_te2reMap.insert(TE2REMAP::value_type(teid, reid)) ;
186 }
187 }
188
189
190 return StatusCode::SUCCESS;
191}
static bool expect(ifstream &f, string msg, string fname)
static bool expectInt(ifstream &f, string msg, string fname, uint32_t &val1, uint32_t &val2)
static bool find(ifstream &f, string msg, string fname)
static value_type getAXIAL_LAYER_MAX()
static value_type getAXIAL_WIRE_MAX()
static value_type getIntID(unsigned int wireType, unsigned int layer, unsigned int wire)
static value_type getSTEREO_LAYER_MAX()