ATLAS Offline Software
CaloTileRetriever.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "CaloTileRetriever.h"
6 
7 #include "AthenaKernel/Units.h"
8 
10 
12 #include "CaloDetDescr/CaloDetDescrElement.h"
13 #include "TileEvent/TileCell.h"
16 #include "CaloIdentifier/TileID.h"
22 #include <vector>
23 #include <cstddef>
24 #include <map>
25 #include <stdexcept>
26 
27 using Athena::Units::GeV;
28 
29 namespace JiveXML {
30 
37  CaloTileRetriever::CaloTileRetriever(const std::string& type,const std::string& name,const IInterface* parent):
39  m_calocell_id(nullptr)
40  {
41  //Only declare the interface
42  declareInterface<IDataRetriever>(this);
43 
44  declareProperty("CellThreshold", m_cellThreshold = 50.);
45  declareProperty("RetrieveTILE" , m_tile = true);
46  declareProperty("DoTileDigit", m_doTileDigit = false);
47  declareProperty("DoBadTile", m_doBadTile = false);
48  declareProperty("DoTileCellDetails", m_doTileCellDetails = false);
49  declareProperty("CellEnergyPrec", m_cellEnergyPrec = 3);
50  declareProperty("CellTimePrec", m_cellTimePrec = 3);
51 
52  // TileDigitsContainer names: {"TileDigitsCnt","TileDigitsFlt"};
53  declareProperty("TileDigitsContainer" ,m_sgKeyTileDigits = "",
54  "Input collection to retrieve Tile digits, used when doTileDigit is True");
55 
56  // TileRawChannelContainer names: {"TileRawChannelOpt2","TileRawChannelOpt","TileRawChannelFixed",
57  // "TileRawChannelFitCool","TileRawChannelFit",
58  // "TileRawChannelCnt","TileRawChannelFlt"};
59  declareProperty("TileRawChannelContainer" ,m_sgKeyTileRawChannel = "",
60  "Input collection to retrieve Tile raw channels, used when doTileCellDetails is True.");
61  }
62 
68 
69  ATH_MSG_DEBUG( "Initialising Tool" );
70  ATH_CHECK( detStore()->retrieve (m_calocell_id, "CaloCell_ID") );
71 
72  //=== get TileCondToolTiming
73  ATH_CHECK( m_tileToolTiming.retrieve() );
74 
75  //=== get TileCondToolEmscale
76  ATH_CHECK( m_tileToolEmscale.retrieve() );
77 
78  //=== get TileBadChanTool
79  ATH_CHECK( m_tileBadChanTool.retrieve() );
80 
82 
84 
86 
87  return StatusCode::SUCCESS;
88  }
89 
93  StatusCode CaloTileRetriever::retrieve(ToolHandle<IFormatTool> &FormatTool) {
94 
95  ATH_MSG_DEBUG( "in retrieve()" );
96 
98  if (!cellContainer.isValid()){
99  ATH_MSG_WARNING( "Could not retrieve Calorimeter Cells " );
100  }
101  else{
102  if (m_tile) {
103  DataMap data = getCaloTileData(&(*cellContainer));
104  ATH_CHECK( FormatTool->AddToEvent("TILE", m_sgKey.key(), &data) );
105  ATH_MSG_DEBUG( "Tile retrieved" );
106  }
107  }
108 
109  //Tile cells retrieved okay
110  return StatusCode::SUCCESS;
111  }
112 
113 
119 
120  ATH_MSG_DEBUG( "getTileData()" );
121  char rndStr[30];
123 
124  DataVect phi; phi.reserve(cellContainer->size());
125  DataVect eta; eta.reserve(cellContainer->size());
126  DataVect idVec; idVec.reserve(cellContainer->size());
127  DataVect energyVec; energyVec.reserve(cellContainer->size());
128  DataVect adcCounts1Vec; adcCounts1Vec.reserve(cellContainer->size() * 10);
129  DataVect adcCounts2Vec; adcCounts2Vec.reserve(cellContainer->size() * 10);
130  DataVect BadCell; BadCell.reserve(cellContainer->size());
131 
132  DataVect pmt1Energy; pmt1Energy.reserve(cellContainer->size());
133  DataVect pmt1Time; pmt1Time.reserve(cellContainer->size());
134  DataVect pmt1Chi2; pmt1Chi2.reserve(cellContainer->size());
135  DataVect pmt1Gain; pmt1Gain.reserve(cellContainer->size());
136  DataVect pmt2Energy; pmt2Energy.reserve(cellContainer->size());
137  DataVect pmt2Time; pmt2Time.reserve(cellContainer->size());
138  DataVect pmt2Chi2; pmt2Chi2.reserve(cellContainer->size());
139  DataVect pmt2Gain; pmt2Gain.reserve(cellContainer->size());
140 
141  DataVect pmt1RawAmplitude; pmt1RawAmplitude.reserve(cellContainer->size());
142  DataVect pmt1RawTime; pmt1RawTime.reserve(cellContainer->size());
143  DataVect pmt1Pedestal; pmt1Pedestal.reserve(cellContainer->size());
144  DataVect pmt1Number; pmt1Number.reserve(cellContainer->size());
145  DataVect pmt1ADCStatus; pmt1ADCStatus.reserve(cellContainer->size());
146  DataVect pmt2RawAmplitude; pmt2RawAmplitude.reserve(cellContainer->size());
147  DataVect pmt2RawTime; pmt2RawTime.reserve(cellContainer->size());
148  DataVect pmt2Pedestal; pmt2Pedestal.reserve(cellContainer->size());
149  DataVect pmt2Number; pmt2Number.reserve(cellContainer->size());
150  DataVect pmt2ADCStatus; pmt2ADCStatus.reserve(cellContainer->size());
151 
152 // m_sub; m_sub.reserve(cellContainer->size());
153  m_sub.clear();
154 
155  std::string adcCounts1Str = "adcCounts1 multiple=\"0\"";
156  std::string adcCounts2Str = "adcCounts2 multiple=\"0\"";
157 
158  const TileID* tileID = nullptr;
159  const TileHWID* tileHWID = nullptr;
160  const TileInfo* tileInfo = nullptr;
161  const TileCablingService* cabling=nullptr;
164  double energyGeV;
165  double amplitude = 0.;
166  const int vsize = cellContainer->size(); //5184;
167  int Index,pmtInd, cellInd, nTileSamples=0;
168  std::vector<double> pmt1ped(vsize,0.0);
169  std::vector<double> pmt2ped(vsize,0.0);
170  std::vector<double> pmt1rawamp(vsize,0.0);
171  std::vector<double> pmt2rawamp(vsize,0.0);
172  std::vector<double> pmt1rawtime(vsize,0.0);
173  std::vector<double> pmt2rawtime(vsize,0.0);
174  std::vector<int> pmt1number(vsize,0);
175  std::vector<int> pmt2number(vsize,0);
176  std::vector<unsigned long int> pmt1status(vsize,0);
177  std::vector<unsigned long int> pmt2status(vsize,0);
178  std::map<int,std::vector<float> > pmt1digit;
179  std::map<int,std::vector<float> > pmt2digit;
180  bool offlineRch = false;
181 
182  //===== retrieving everything which is needed for Tile
183 
184  if (detStore()->retrieve(tileID).isFailure()) {
185  ATH_MSG_ERROR( "in getCaloTileData(), Could not retrieve TileID" );
186 
187  }
188 
189  if (detStore()->retrieve(tileHWID).isFailure()) {
190  ATH_MSG_ERROR( "in getCaloTileData(), Could not retrieve TileHWID" );
191  }
192 
193  if (detStore()->retrieve(tileInfo, "TileInfo").isFailure()) {
194  ATH_MSG_ERROR( "in getCaloTileData(), Could not retrieve TileInfo" );
195  }
196 
198  if (m_doTileDigit) {
199  tileDigits = SG::makeHandle(m_sgKeyTileDigits);
200  if (!tileDigits.isValid()){
201  ATH_MSG_WARNING( "Could not retrieve TileDigits " );
202  }
203  }
204 
206  if (m_doTileCellDetails) {
207  RawChannelCnt = SG::makeHandle(m_sgKeyTileRawChannel);
208  if (!RawChannelCnt.isValid()){
209  ATH_MSG_WARNING( "Could not retrieve TileRawChannel " );
210  }
211  else {
212  RChUnit = RawChannelCnt->get_unit();
213  offlineRch = (RChUnit<TileRawChannelUnit::OnlineADCcounts &&
214  RawChannelCnt->get_type() != TileFragHash::OptFilterDsp);
215  }
216  }
217 
218 
219  // Loop Over TileRawChannelContainer to retrieve raw information. Keep the values in vectors
220 
221  if (m_doTileCellDetails && RawChannelCnt.isValid()) {
222  if (offlineRch) {
223 
224  for (const auto rawChannel : *RawChannelCnt) {
225 
226  for (const auto cell : *rawChannel) {
227 
228  /*Identifier cell_id =*/ cell->cell_ID_index(Index,pmtInd);
229  if (Index <= -1 ) continue; //disconnect channel index is -1 and MBTS is -2. They do not have an idhash
230  IdentifierHash cell_hash = m_calocell_id->calo_cell_hash( cell->cell_ID() );
231  cellInd = cellContainer->findIndex(cell_hash); //find Cell Index
232  if (cellInd < 0) continue;
233 
234  HWIdentifier hwid=cell->adc_HWID();
235  int adc = tileHWID->adc(hwid);
236  int channel = tileHWID->channel(hwid);
237  int drawer = tileHWID->drawer(hwid);
238  int ros = tileHWID->ros(hwid);
239  int PMT = abs( cabling->channel2hole(ros,channel) );
240  int drawerIdx = TileCalibUtils::getDrawerIdx(ros,drawer);
241  uint32_t tileAdcStatus = m_tileBadChanTool->encodeStatus(m_tileBadChanTool->getAdcStatus(drawerIdx,channel,adc));
242 
243  amplitude = cell->amplitude();
244  //Change amplitude units to ADC counts
246  amplitude /= m_tileToolEmscale->channelCalib(drawerIdx, channel, adc, 1.0, TileRawChannelUnit::ADCcounts, RChUnit);
247  } else if (RChUnit > TileRawChannelUnit::OnlineADCcounts) {
248  // Should never get here due to offlineRch test above.
249  //amplitude = m_tileToolEmscale->undoOnlCalib(drawerIdx, channel, adc, amplitude, RChUnit);
250  std::abort();
251  }
252 
253  if ( pmtInd == 0 ) { // first PMT
254 
255  pmt1ped[cellInd] = cell->pedestal();
256  pmt1rawamp[cellInd] = amplitude;
257  pmt1rawtime[cellInd] = cell->uncorrTime();
258  pmt1number[cellInd] = PMT;
259  pmt1status[cellInd] = tileAdcStatus;
260  }
261  else { // second PMT
262 
263  pmt2ped[cellInd] = cell->pedestal();
264  pmt2rawamp[cellInd] = amplitude;
265  pmt2rawtime[cellInd] = cell->uncorrTime();
266  pmt2number[cellInd] = PMT;
267  pmt2status[cellInd] = tileAdcStatus;
268 
269  }
270  }
271  }//for TileRawChannelContainer loop
272  }
273  } // end of doTileCellDetails
274 
275 
276  //Loop over TileDigitsContainer to retrieve digits. Keep the digits values in a map
277 
278  if (m_doTileDigit && tileDigits.isValid()) {
279 
280  //----- get tile digits--------------------------
281 
282  // tile digits loop
283  for (const auto digitChannel : *tileDigits) {
284 
285  for (const auto cell : *digitChannel) {
286 
287  /*Identifier cell_id =*/ cell->cell_ID_index(Index,pmtInd);
288  if (Index <= -1 ) continue; //disconnect channel index is -1 and MBTS is -2. They do not have an idhash
289  IdentifierHash cell_hash = m_calocell_id->calo_cell_hash( cell->cell_ID() );
290  cellInd = cellContainer->findIndex(cell_hash); //find Cell Index
291  if (cellInd < 0) continue;
292  if ( (*cellContainer)[cellInd]->energy() < m_cellThreshold) continue;
293 
294  nTileSamples = cell->NtimeSamples();
295  std::vector<float> tileSamples = cell->samples();
296 
297  if (pmtInd == 0 ) { // first PMT
298  pmt1digit.insert(std::make_pair( cellInd, tileSamples ) );
299  }
300  else { // second PMT
301  pmt2digit.insert(std::make_pair( cellInd, tileSamples ) );
302  }
303 
304  }
305  }//for TileDigitContainer loop
306  } // end if doTileDigit
307 
308 
309  //Loop Over CaloCellContainer to retrieve TileCell information
310 
313 
314  double energyAllTile = 0.;
315 
316  for (;it1!=it2;++it1) {
317 
318  if ((*it1)->badcell()) BadCell.push_back(1);
319  else if ((*it1)->energy()>= m_cellThreshold) BadCell.push_back(0);
320  else BadCell.push_back(-1);
321 
322  Identifier cellid = (*it1)->ID();
323  IdentifierHash cell_hash = m_calocell_id->calo_cell_hash( cellid );
324  cellInd = cellContainer->findIndex(cell_hash);
325  if (cellInd < 0) continue;
326  calcTILELayerSub(cellid);
327 
328  energyGeV = (*it1)->energy()*(1./GeV);
329  energyVec.push_back(DataType( gcvt( energyGeV, m_cellEnergyPrec, rndStr) ));
330  energyAllTile += energyGeV;
331 
332  idVec.push_back(DataType( (Identifier::value_type)(*it1)->ID().get_compact() ));
333  phi.push_back(DataType((*it1)->phi()));
334  eta.push_back(DataType((*it1)->eta()));
335 
336  if (m_doTileDigit && tileDigits.isValid()) {
337 
338  if ( !pmt1digit[cellInd].empty()) {
339  for (int i=0; i<nTileSamples; i++) {
340  adcCounts1Str="adcCounts1 multiple=\""+DataType(nTileSamples).toString()+"\"";
341  adcCounts1Vec.push_back(DataType( int(pmt1digit[cellInd][i])));
342  }
343  }
344  else {
345  for (int i=0; i<nTileSamples; i++) {
346  adcCounts1Str="adcCounts1 multiple=\""+DataType(nTileSamples).toString()+"\"";
347  adcCounts1Vec.push_back(DataType(0));
348  }
349  }
350 
351 
352  if ( !pmt2digit[cellInd].empty()) {
353  for (int i=0; i<nTileSamples; i++) {
354  adcCounts2Str="adcCounts2 multiple=\""+DataType(nTileSamples).toString()+"\"";
355  adcCounts2Vec.push_back(DataType( int(pmt2digit[cellInd][i])));
356  }
357  }
358  else {
359  for (int i=0; i<nTileSamples; i++) {
360  adcCounts2Str= "adcCounts2 multiple=\""+DataType(nTileSamples).toString()+"\"";
361  adcCounts2Vec.push_back(DataType(0));
362  }
363  }
364  }
365 
366  if (m_doTileCellDetails) {
367 
368  const TileCell* theTileCell = dynamic_cast<const TileCell *>(*it1);
369  if (not theTileCell) {
370  //should never happen
371  throw std::runtime_error("Could not cast pointer to TileCell in CaloTileRetriever::getCaloTileData");
372  }
373  int gain1 = theTileCell->gain1();
374  int qual1 = theTileCell->qual1();
375  bool badch1 = theTileCell->badch1();
376  bool noch1 = (gain1<0 || gain1>1);
377 
378  int qual2 = theTileCell->qual2();
379  int gain2 = theTileCell->gain2();
380  bool badch2 = theTileCell->badch2();
381  bool noch2 = (gain2<0 || gain2>1);
382 
383  if (badch1 != badch2 && qual1 != qual2 && qual1 < 255 && qual2 < 255) {
384  if (badch1 && !noch1) gain1 = 1 - gain1;
385  if (badch2 && !noch1) gain2 = 1 - gain2;
386  }
387  if (badch1) qual1 = -qual1;
388  if (badch2) qual2 = -qual2;
389 
390  pmt1Energy.push_back(DataType(theTileCell->ene1()*(1./GeV)));
391  pmt1Time.push_back(DataType(theTileCell->time1()));
392  pmt1Chi2.push_back(DataType(qual1));
393  pmt1Gain.push_back(DataType(gain1));
394 
395  pmt2Energy.push_back(DataType(theTileCell->ene2()*(1./GeV)));
396  pmt2Time.push_back(DataType(theTileCell->time2()));
397  pmt2Chi2.push_back(DataType(qual2));
398  pmt2Gain.push_back(DataType(gain2));
399 
400  if (offlineRch && RawChannelCnt.isValid()
401  && (noch1 || pmt1number[cellInd]!=0) && (noch2 || pmt2number[cellInd]!=0)) {
402 
403  uint32_t tileAdcStatus = pmt1status[cellInd];
404  if (badch1) tileAdcStatus += 10;
405 
406  pmt1RawAmplitude.push_back(DataType(pmt1rawamp[cellInd]));
407  pmt1RawTime.push_back(DataType(pmt1rawtime[cellInd]));
408  pmt1Pedestal.push_back(DataType(pmt1ped[cellInd]));
409  pmt1Number.push_back(DataType(pmt1number[cellInd]));
410  pmt1ADCStatus.push_back(DataType(tileAdcStatus));
411 
412  tileAdcStatus = pmt2status[cellInd];
413  if (badch2) tileAdcStatus += 10;
414 
415  pmt2RawAmplitude.push_back(DataType(pmt2rawamp[cellInd]));
416  pmt2RawTime.push_back(DataType(pmt2rawtime[cellInd]));
417  pmt2Pedestal.push_back(DataType(pmt2ped[cellInd]));
418  pmt2Number.push_back(DataType(pmt2number[cellInd]));
419  pmt2ADCStatus.push_back(DataType(tileAdcStatus));
420  }
421  else {
422 
423  float maxTime = (tileInfo->NdigitSamples()/2) * 25;
424 
425  if (noch1 /* || pmt1digit[cellInd].empty() */ ) { //invalid gain - channel missing or digits not include in DPD
426  pmt1RawAmplitude.push_back(DataType(0));
427  pmt1RawTime.push_back(DataType(0));
428  pmt1ADCStatus.push_back(DataType(0));
429  pmt1Number.push_back(DataType(0));
430  pmt1Pedestal.push_back(DataType(0)); //The is no pedestal in DPD.
431  } else {
432  HWIdentifier hwid = cabling->s2h_adc_id(tileID->adc_id(cellid,0,gain1));
433 
434  int adc = tileHWID->adc(hwid);
435  int channel = tileHWID->channel(hwid);
436  int drawer = tileHWID->drawer(hwid);
437  int ros = tileHWID->ros(hwid);
438  int PMT = abs( cabling->channel2hole(ros,channel) );
439  int drawerIdx = TileCalibUtils::getDrawerIdx(ros,drawer);
440  float scale = m_tileToolEmscale->channelCalib(drawerIdx, channel, adc, 1.0,
442  float amp = theTileCell->ene1() / scale;
443  float time = theTileCell->time1();
444 
445  int qbit = (theTileCell->qbit1() & TileCell::MASK_TIME);
446  if ((qual1 != 0 || qbit != 0 || amp != 0.0) && (fabs(time) < maxTime && time != 0.0)) {
447  time += m_tileToolTiming->getSignalPhase(drawerIdx, channel, adc);
448  }
449 
450  uint32_t tileAdcStatus = m_tileBadChanTool->encodeStatus(m_tileBadChanTool->getAdcStatus(drawerIdx,channel,adc));
451  if (badch1) tileAdcStatus += 10;
452 
453  pmt1RawAmplitude.push_back(DataType(amp));
454  pmt1RawTime.push_back(DataType(time));
455  pmt1Number.push_back(DataType(PMT));
456  pmt1ADCStatus.push_back(DataType( tileAdcStatus ));
457  pmt1Pedestal.push_back(DataType(0)); //The is no pedestal in DPD . This line is temporary.
458  }
459 
460  if (noch2 /* || pmt2digit[cellInd].empty() */ ) { //invalid gain - channel missing
461  pmt2RawAmplitude.push_back(DataType(0));
462  pmt2RawTime.push_back(DataType(0));
463  pmt2ADCStatus.push_back(DataType(0));
464  pmt2Number.push_back(DataType(0));
465  pmt2Pedestal.push_back(DataType(0)); //The is no pedestal in DPD
466  } else {
467  HWIdentifier hwid = cabling->s2h_adc_id(tileID->adc_id(cellid,1,gain2));
468 
469  int adc = tileHWID->adc(hwid);
470  int channel = tileHWID->channel(hwid);
471  int drawer = tileHWID->drawer(hwid);
472  int ros = tileHWID->ros(hwid);
473  int PMT = abs( cabling->channel2hole(ros,channel) );
474  int drawerIdx = TileCalibUtils::getDrawerIdx(ros,drawer);
475  float scale = m_tileToolEmscale->channelCalib(drawerIdx, channel, adc, 1.0,
477  float amp = theTileCell->ene2() / scale;
478  float time = theTileCell->time2();
479 
480  int qbit = (theTileCell->qbit2() & TileCell::MASK_TIME);
481  if ((qual2 != 0 || qbit != 0 || amp != 0.0) && (fabs(time) < maxTime && time != 0.0)) {
482  time += m_tileToolTiming->getSignalPhase(drawerIdx, channel, adc);
483  }
484 
485  uint32_t tileAdcStatus = m_tileBadChanTool->encodeStatus(m_tileBadChanTool->getAdcStatus(drawerIdx,channel,adc));
486  if (badch2) tileAdcStatus += 10;
487 
488  pmt2RawAmplitude.push_back(DataType(amp));
489  pmt2RawTime.push_back(DataType(time));
490  pmt2ADCStatus.push_back(DataType( tileAdcStatus ));
491  pmt2Number.push_back(DataType(PMT));
492  pmt2Pedestal.push_back(DataType(0)); //The is no pedestal in DPD .
493  }
494  } //don't have TileRawChannel
495  } //if (m_doTileCellDetails)
496  } // end cell iterator
497 
498  ATH_MSG_DEBUG( " Total energy in Tile in GeV : " << energyAllTile );
499 
500  if ( !pmt1digit.empty() ) pmt1digit.clear();
501  if ( !pmt2digit.empty() ) pmt2digit.clear();
502 
503  // write values into DataMap
504  auto n = phi.size();
505  DataMap["phi"] = std::move(phi);
506  DataMap["eta"] = std::move(eta);
507  DataMap["sub"] = m_sub;
508  DataMap["id"] = std::move(idVec);
509  DataMap["energy"] = std::move(energyVec);
510 
511 
512  //BadCells
513  if (m_doBadTile==true) {
514  DataMap["BadCell"]= std::move(BadCell);
515  }
516 
517  if (m_doTileCellDetails) {
518  DataMap["pmt1Energy"] = std::move(pmt1Energy);
519  DataMap["pmt1Time"] = std::move(pmt1Time);
520  DataMap["pmt1Chi2"] = std::move(pmt1Chi2);
521  DataMap["pmt1Gain"] = std::move(pmt1Gain);
522 
523  DataMap["pmt2Energy"] = std::move(pmt2Energy);
524  DataMap["pmt2Time"] = std::move(pmt2Time);
525  DataMap["pmt2Chi2"] = std::move(pmt2Chi2);
526  DataMap["pmt2Gain"] = std::move(pmt2Gain);
527 
528  DataMap["pmt1RawAmplitude"] = std::move(pmt1RawAmplitude);
529  DataMap["pmt1RawTime"] = std::move(pmt1RawTime);
530  DataMap["pmt1ADCStatus"] = std::move(pmt1ADCStatus);
531  DataMap["pmt1Number"] = std::move(pmt1Number);
532  DataMap["pmt1Pedestal"] = std::move(pmt1Pedestal);
533 
534  DataMap["pmt2RawAmplitude"] = std::move(pmt2RawAmplitude);
535  DataMap["pmt2RawTime"] = std::move(pmt2RawTime);
536  DataMap["pmt2ADCStatus"] = std::move(pmt2ADCStatus);
537  DataMap["pmt2Number"] = std::move(pmt2Number);
538  DataMap["pmt2Pedestal"] = std::move(pmt2Pedestal);
539  }
540 
541  DataMap[adcCounts1Str] = std::move( adcCounts1Vec);
542  DataMap[adcCounts2Str] = std::move(adcCounts2Vec);
543 
544  //Be verbose
545  ATH_MSG_DEBUG( dataTypeName() << " retrieved with " << n << " entries" );
546 
547  //All collections retrieved okay
548  return DataMap;
549 
550  } // getTileData
551 
552  //-----------------------------------------------------------------------------------------------------
553 
555  {
556  if (m_calocell_id->is_tile_barrel(cellid))
557  {
558  if (m_calocell_id->is_tile_negative(cellid))
559  m_sub.push_back(DataType(2));
560  else
561  m_sub.push_back(DataType(3));
562  }
563  else if (m_calocell_id->is_tile_extbarrel(cellid))
564  {
565  if (m_calocell_id->is_tile_negative(cellid))
566  m_sub.push_back(DataType(0));
567  else
568  m_sub.push_back(DataType(5));
569  }
570  //else in ITC or scint
571  else
572  {
573  if (m_calocell_id->is_tile_negative(cellid))
574  m_sub.push_back(DataType(1));
575  else
576  m_sub.push_back(DataType(4));
577  }
578  }
579 
580  //--------------------------------------------------------------------------
581 
582 } // JiveXML namespace
TileCell
Definition: TileCell.h:57
JiveXML::CaloTileRetriever::m_tileBadChanTool
ToolHandle< ITileBadChanTool > m_tileBadChanTool
Definition: CaloTileRetriever.h:73
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
JiveXML::CaloTileRetriever::getCaloTileData
const DataMap getCaloTileData(const CaloCellContainer *cellContainer)
Retrieve Tile cell location and details.
Definition: CaloTileRetriever.cxx:118
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:18
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
JiveXML::CaloTileRetriever::m_calocell_id
const CaloCell_ID * m_calocell_id
Definition: CaloTileRetriever.h:77
JiveXML::CaloTileRetriever::dataTypeName
virtual std::string dataTypeName() const
Return the name of the data type.
Definition: CaloTileRetriever.h:61
CaloCell_Base_ID::calo_cell_hash
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
JiveXML::CaloTileRetriever::m_doTileCellDetails
bool m_doTileCellDetails
Definition: CaloTileRetriever.h:87
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
TileCablingService::getInstance
static const TileCablingService * getInstance()
get pointer to service instance
Definition: TileCablingService.cxx:24
TileInfo::NdigitSamples
int NdigitSamples() const
Returns the number of sammples (digits) per event.
Definition: TileInfo.h:75
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
JiveXML::DataVect
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
Definition: DataType.h:58
DataType
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType
Definition: RoIBResultByteStreamTool.cxx:25
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
CaloTime_fillDB.gain2
gain2
Definition: CaloTime_fillDB.py:355
CaloCellContainer::beginConstCalo
CaloCellContainer::const_iterator beginConstCalo(CaloCell_ID::SUBCALO caloNum) const
get const iterators on cell of just one calo
Definition: CaloCellContainer.cxx:119
JiveXML::CaloTileRetriever::m_sgKeyTileDigits
SG::ReadHandleKey< TileDigitsContainer > m_sgKeyTileDigits
Definition: CaloTileRetriever.h:80
JiveXML::CaloTileRetriever::m_sub
DataVect m_sub
Definition: CaloTileRetriever.h:90
TileInfo.h
TileCalibUtils.h
TileRawChannelUnit::OnlineADCcounts
@ OnlineADCcounts
Definition: TileRawChannelUnit.h:21
TileInfo
Definition: TileInfo.h:49
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
JiveXML::CaloTileRetriever::m_cellThreshold
double m_cellThreshold
Definition: CaloTileRetriever.h:82
JiveXML::DataMap
std::map< std::string, DataVect > DataMap
Definition: DataType.h:59
HWIdentifier
Definition: HWIdentifier.h:13
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
CaloCell_Base_ID::is_tile_barrel
bool is_tile_barrel(const Identifier id) const
test if the id belongs to the Tiles barrel
TileFragHash::OptFilterDsp
@ OptFilterDsp
Definition: TileFragHash.h:34
Example_ReadSampleNoise.drawer
drawer
Definition: Example_ReadSampleNoise.py:39
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
TileHWID::channel
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
Definition: TileHWID.h:189
TileID.h
CaloCell_ID.h
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
TileHWID::ros
int ros(const HWIdentifier &id) const
extract ros field from HW identifier
Definition: TileHWID.h:167
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:274
TileHWID
Helper class for TileCal online (hardware) identifiers.
Definition: TileHWID.h:49
JiveXML::CaloTileRetriever::m_tileToolEmscale
ToolHandle< TileCondToolEmscale > m_tileToolEmscale
Definition: CaloTileRetriever.h:70
TileHWID::adc
int adc(const HWIdentifier &id) const
extract adc field from HW identifier
Definition: TileHWID.h:193
Index
IndexedConstituentUserInfo::Index Index
Definition: IndexedConstituentUserInfo.cxx:12
JiveXML::CaloTileRetriever::m_doBadTile
bool m_doBadTile
Definition: CaloTileRetriever.h:88
TileHWID.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
JiveXML::CaloTileRetriever::initialize
StatusCode initialize()
Default AthAlgTool methods.
Definition: CaloTileRetriever.cxx:67
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
TileCablingService.h
JiveXML::CaloTileRetriever::CaloTileRetriever
CaloTileRetriever(const std::string &type, const std::string &name, const IInterface *parent)
Standard Constructor.
Definition: CaloTileRetriever.cxx:37
lumiFormat.i
int i
Definition: lumiFormat.py:85
TileID
Helper class for TileCal offline identifiers.
Definition: TileID.h:68
beamspotman.n
n
Definition: beamspotman.py:729
DetDescrDictionaryDict::it1
std::vector< HWIdentifier >::iterator it1
Definition: DetDescrDictionaryDict.h:17
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
CaloCell_Base_ID::is_tile_extbarrel
bool is_tile_extbarrel(const Identifier id) const
test if the id belongs to the Tiles extended barrel
TileCell.h
TileRawChannelUnit::MegaElectronVolts
@ MegaElectronVolts
Definition: TileRawChannelUnit.h:20
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CaloTileRetriever.h
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CaloCell_Base_ID::TILE
@ TILE
Definition: CaloCell_Base_ID.h:43
JiveXML::CaloTileRetriever::calcTILELayerSub
void calcTILELayerSub(Identifier &)
Definition: CaloTileRetriever.cxx:554
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
maskDeadModules.ros
ros
Definition: maskDeadModules.py:35
TileCablingService
Definition: TileCablingService.h:23
TileRawChannelUnit::UNIT
UNIT
Definition: TileRawChannelUnit.h:16
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
JiveXML
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.
Definition: BadLArRetriever.cxx:22
Tile_Base_ID::adc_id
Identifier adc_id(const Identifier &cell_id, int pmt, int adc) const
Definition: Tile_Base_ID.cxx:802
CaloTime_fillDB.gain1
gain1
Definition: CaloTime_fillDB.py:354
HWIdentifier.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
JiveXML::CaloTileRetriever::m_tile
bool m_tile
Definition: CaloTileRetriever.h:85
JiveXML::CaloTileRetriever::m_cellTimePrec
int m_cellTimePrec
Definition: CaloTileRetriever.h:84
TileRawDataContainer::get_type
TYPE get_type() const
Definition: TileRawDataContainer.h:62
Units.h
Wrapper to avoid constant divisions when using units.
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
JiveXML::CaloTileRetriever::m_tileToolTiming
ToolHandle< TileCondToolTiming > m_tileToolTiming
Definition: CaloTileRetriever.h:67
TileCell::MASK_TIME
@ MASK_TIME
Definition: TileCell.h:67
JiveXML::CaloTileRetriever::m_sgKey
SG::ReadHandleKey< CaloCellContainer > m_sgKey
Definition: CaloTileRetriever.h:79
TileHWID::drawer
int drawer(const HWIdentifier &id) const
extract drawer field from HW identifier
Definition: TileHWID.h:171
ReadFloatFromCool.adc
adc
Definition: ReadFloatFromCool.py:48
TileRawDataContainer::get_unit
UNIT get_unit() const
Definition: TileRawDataContainer.h:60
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
JiveXML::CaloTileRetriever::retrieve
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.
Definition: CaloTileRetriever.cxx:93
CaloCell_Base_ID::is_tile_negative
bool is_tile_negative(const Identifier id) const
test if the id belongs to the Tiles negative side
CaloCellContainer::endConstCalo
CaloCellContainer::const_iterator endConstCalo(CaloCell_ID::SUBCALO caloNum) const
Definition: CaloCellContainer.cxx:133
CaloCellContainer::findIndex
int findIndex(const IdentifierHash theHash) const
Return index of the cell with a given hash.
Definition: CaloCellContainer.cxx:363
Identifier::value_type
unsigned long long value_type
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:27
JiveXML::CaloTileRetriever::m_doTileDigit
bool m_doTileDigit
Definition: CaloTileRetriever.h:86
TileTBID.h
TileCalibUtils::getDrawerIdx
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
Definition: TileCalibUtils.cxx:60
SelectAllObject.h
AthAlgTool
Definition: AthAlgTool.h:26
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
JiveXML::CaloTileRetriever::m_cellEnergyPrec
int m_cellEnergyPrec
Definition: CaloTileRetriever.h:83
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
JiveXML::CaloTileRetriever::m_sgKeyTileRawChannel
SG::ReadHandleKey< TileRawChannelContainer > m_sgKeyTileRawChannel
Definition: CaloTileRetriever.h:81
TileRawChannelUnit::ADCcounts
@ ADCcounts
Definition: TileRawChannelUnit.h:17
TileCellContainer.h
Identifier
Definition: IdentifierFieldParser.cxx:14