125 {
127
128 uint32_t nRELayerPos, nRECellPos, nREEaWePos;
129 uint32_t nRELayerMask, nRECellMask, nREEaWeMask;
130
131
132
133 f.open( initFile.c_str() );
134
136 {
137 cerr << "Error: could not open file " << initFile << endl;
138 return StatusCode::FAILURE;
139 }
140
142 {
143 cerr << "Error: could not find '##TofDigiConf' in file " << initFile << endl;
144 return StatusCode::FAILURE;
145 }
146
155 return StatusCode::FAILURE;
156
158
159
160
163 {
164 uint32_t TELayerMax, TEphiMax, TEBaEaWe;
165 uint32_t eawe = 0, layer = 0, cell = 0;
166
167 if ( barrel_ec_eawe == 1 )
168 {
169
172 }
173 else
174 {
175
177
178 TEphiMax = 48;
179 }
180
181 for ( TEBaEaWe = 0; TEBaEaWe < 2; TEBaEaWe++ )
182 {
183 if ( barrel_ec_eawe != 1 && TEBaEaWe > 0 ) break;
184 eawe = TEBaEaWe + ( barrel_ec_eawe / 2 );
185 for ( uint32_t TELayer = 0; TELayer <= TELayerMax; TELayer++ )
186 {
187 if ( barrel_ec_eawe == 1 ) { layer = TELayer + 1; }
188 else
189 {
190
191
192 layer = 3;
193 }
194 if ( layer <= 3 )
195 {
196 for ( uint32_t TEphi = 0; TEphi <= TEphiMax; TEphi++ )
197 {
198 cell = TEphi + 1;
199 uint32_t reid = ( ( ( eawe << nREEaWePos ) & nREEaWeMask ) |
200 ( ( layer << nRELayerPos ) & nRELayerMask ) |
201 ( ( cell << nRECellPos ) & nRECellMask ) );
202 uint32_t teid =
TofID::getIntID( barrel_ec_eawe, TELayer, TEphi, TEBaEaWe );
203
204
205
206
207
208
209 m_re2te[reid] = teid;
210 m_te2reMap.insert( TE2REMAP::value_type( teid, reid ) );
211 }
212 }
213 }
214 }
215 }
216
217
218
219 for ( uint32_t module = 0; module < 36; ++module )
220 {
221 for ( uint32_t strip = 0; strip < 12; ++strip )
222 {
223
224
225
226
228 m_te2reMap.insert( TE2REMAP::value_type( teid, ( teid & 0xFFF ) ) );
230 m_te2reMap.insert( TE2REMAP::value_type( teid, ( teid & 0xFFF ) ) );
232 m_te2reMap.insert( TE2REMAP::value_type( teid, ( teid & 0xFFF ) ) );
234 m_te2reMap.insert( TE2REMAP::value_type( teid, ( teid & 0xFFF ) ) );
235 }
236 }
237
238
239 return StatusCode::SUCCESS;
240}
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
static bool find(ifstream &f, string msg, string fname)
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 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()