201{
204
207
208 for (; cellItr != lastCell; ++cellItr) {
209 const CaloCell*
cell = (*cellcoll)[cellItr];
210 const TileCell* tilecell =
dynamic_cast<const TileCell*
>(
cell);
211 if (tilecell == 0) continue;
212 if (tilecell->
badcell())
continue;
213
214 float noise_sigma = 1.5, significance = 0.0;
215
216 if (caloNoise) {
219
220 } else {
222 }
223
224 significance = (noise_sigma != 0.0) ? fabs(
cell->energy() / noise_sigma) : 999.999;
225
227 <<
" ene " <<
cell->energy()
228 << " noise " << noise_sigma
229 << " significance " << significance );
230 }
231
232
233 bool good1 = !tilecell->
badch1();
234 bool good2 = !tilecell->
badch2();
237 const CaloDetDescrElement * caloDDE = tilecell->
caloDDE();
238 IdentifierHash hash1 = caloDDE->
onl1();
239 IdentifierHash hash2 = caloDDE->
onl2();
240
242 HWIdentifier adc_id =
m_tileHWID->adc_id(hash1, gain1);
247
249
251
255
256 float amp = tilecell->
ene1() / chanCalMeV;
257 if (amp != 0.0) {
260
261 amp = tilecell->
ene1() / chanCalMeV;
262 }
263
264 if (!caloNoise) {
266
267 } else {
268 noise_sigma = sampleNoise->
getHfn(drawerIdx, chan, gain1);
269 }
270
271 significance = 999.999;
272 if ((noise_sigma != 0.0)
274 ) {
275
276 significance = fabs(amp / noise_sigma);
277 }
278
280 << " calib " << chanCalMeV
281 << " amp " << amp
282 << " noise " << noise_sigma
283 << " significance " << significance );
284 }
285
286
290 }
291 }
292 }
293
295 HWIdentifier adc_id =
m_tileHWID->adc_id(hash2, gain2);
300
302
304
308
309 float amp = tilecell->
ene2() / chanCalMeV;
310 if (amp != 0.0) {
313
314 amp = tilecell->
ene2() / chanCalMeV;
315 }
316
317 if (!caloNoise) {
319
320 } else {
321 noise_sigma = sampleNoise->
getHfn(drawerIdx, chan, gain2);
322 }
323
324
325 significance = 999.999;
326 if ((noise_sigma != 0.0)
328 ) {
329
330 significance = fabs(amp / noise_sigma);
331 }
332
333
335 << " calib " << chanCalMeV
336 << " amp " << amp
337 << " noise " << noise_sigma
338 << " significance " << significance );
339 }
340
341
345 }
346 }
347 }
348 }
349
350 int ncorr = 0;
352
355 for (
int mob = 0; mob <
s_maxMOB; mob++) {
356
359 * nGoodChan[partition][drawer][mob]);
360 if (nchmin < 2) nchmin = 2;
361 }
362
363 if (nEmptyChan[partition][drawer][mob] >= nchmin) {
365 ++ncorr;
367 << " drawer " << std::setw(2) << drawer
368 << " mb " << mob
369 << " mean " << commonMode[partition][drawer][mob]
370 << " taken from " << nEmptyChan[partition][drawer][mob] << " channels"
371 << " nchgood " << nGoodChan[partition][drawer][mob]
372 << " nchmin " << nchmin );
373
374 } else {
375 if (msgLvl(MSG::VERBOSE)) {
376 if (commonMode[partition][drawer][mob] != 0.0) {
377 msg(MSG::VERBOSE) <<
"ros " <<
partition + 1 << std::setw(2)
378 <<
" drawer " << std::setw(2) <<
drawer
379 << " mb " << mob
383 << " nchmin " << nchmin
385 } else {
387 <<
" drawer " << std::setw(2) <<
drawer
388 << " mb " << mob
389 << " mean is zero - nothing to correct"
391 << " nchmin " << nchmin
393 }
394 }
396 }
397 }
398 }
399 }
400
401 return ncorr;
402}
#define ATH_MSG_VERBOSE(x)
int indexFirstCellCalo(const CaloCell_ID::SUBCALO caloNum) const
index of first cell of given calorimeter (-1 if none).
int indexLastCellCalo(const CaloCell_ID::SUBCALO caloNum) const
index of last cell of given calorimeter (-2 if none) Note that it is normally more efficient to use i...
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
IdentifierHash onl2() const
cell online identifier 2
IdentifierHash onl1() const
cell online identifier 1
float getNoise(const IdentifierHash h, const int gain) const
Accessor by IdentifierHash and gain.
float getEffectiveSigma(const Identifier id, const int gain, const float energy) const
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
static const int s_maxChannel
static const int s_maxDrawer
static const CaloCell_ID::SUBCALO s_caloIndex
static const int s_maxPartition
static const int s_maxMOB
const TileHWID * m_tileHWID
Pointer to TileHWID.
const TileID * m_tileID
Pointer to TileID.
virtual bool badcell(void) const override final
check if whole cell is bad (i.e.
int gain2(void) const
get gain of second PMT
bool badch1(void) const
check if first PMT is in bad channel list and masked
int gain1(void) const
get gain of first PMT
float ene1(void) const
get energy of first PMT
bool badch2(void) const
check if second PMT is in bad channel list and masked
float ene2(void) const
get energy of second PMT
float calibrateChannel(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float amplitude, TileRawChannelUnit::UNIT rawDataUnitIn, TileRawChannelUnit::UNIT rawDataUnitOut) const
Calibrate a Tile channel.
float getHfn(unsigned int drawerIdx, unsigned int channel, unsigned int adc) const