131{
133
134 uint32_t nRELayerPos, nRECellPos, nREEaWePos;
135 uint32_t nRELayerMask, nRECellMask, nREEaWeMask;
136
137
138
139 f.open( initFile.c_str());
140
141 if( f.bad() ) {
142 cerr << "Error: could not open file " << initFile << endl;
143 return false;
144 }
145
147 cerr << "Error: could not find '##TofDigiConf' in file " << initFile << endl;
148 return StatusCode::FAILURE;
149 }
150
159 return false;
160
161
162 f.close();
163
164
165
168 {
169 uint32_t TELayerMax, TEphiMax, TEBaEaWe;
170 uint32_t eawe = 0, layer = 0, cell = 0;
171
172 if(barrel_ec_eawe == 1) {
173
176 } else {
177
179
180 TEphiMax = 48;
181 }
182
183 for(TEBaEaWe = 0; TEBaEaWe < 2; TEBaEaWe++) {
184 if (barrel_ec_eawe != 1 && TEBaEaWe > 0) break;
185 eawe = TEBaEaWe + (barrel_ec_eawe/2);
186 for(uint32_t TELayer = 0; TELayer <= TELayerMax; TELayer++) {
187 if (barrel_ec_eawe == 1) {
188 layer = TELayer + 1;
189 } else {
190
191
192 layer = 3;
193 }
194 if (layer <= 3) {
195 for (uint32_t TEphi = 0; TEphi <= TEphiMax; TEphi++) {
196 cell = TEphi + 1;
197 uint32_t reid = (((eawe<<nREEaWePos)&nREEaWeMask)|
198 ((layer<<nRELayerPos)&nRELayerMask)|
199 ((cell<<nRECellPos)&nRECellMask));
200 uint32_t teid =
TofID::getIntID(barrel_ec_eawe, TELayer, TEphi, TEBaEaWe);
201
202
203
204 m_re2te[reid] = teid;
205 m_te2reMap.insert(TE2REMAP::value_type(teid, reid)) ;
206 }
207 }
208 }
209 }
210 }
211
212
213
214 for ( uint32_t module = 0; module < 36; ++module )
215 {
216 for ( uint32_t strip = 0; strip < 12; ++strip )
217 {
218
219
220
221
223 m_te2reMap.insert(TE2REMAP::value_type(teid, (teid&0xFFF)));
225 m_te2reMap.insert(TE2REMAP::value_type(teid, (teid&0xFFF)));
227 m_te2reMap.insert(TE2REMAP::value_type(teid, (teid&0xFFF)));
229 m_te2reMap.insert(TE2REMAP::value_type(teid, (teid&0xFFF)));
230 }
231 }
232
233
234 return StatusCode::SUCCESS;
235}
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 getPHI_BARREL_MAX()
static value_type getBARREL_EC_MIN()
static value_type getBARREL_EC_MAX()
static value_type getLAYER_ENDCAP_MAX()
static value_type getIntID(int barrel_ec, int layer, int phi_module, int end)
static value_type getLAYER_BARREL_MAX()