ATLAS Offline Software
CaloTileRetriever.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 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  calcTILELayerSub(cellid);
326 
327  energyGeV = (*it1)->energy()*(1./GeV);
328  energyVec.push_back(DataType( gcvt( energyGeV, m_cellEnergyPrec, rndStr) ));
329  energyAllTile += energyGeV;
330 
331  idVec.push_back(DataType( (Identifier::value_type)(*it1)->ID().get_compact() ));
332  phi.push_back(DataType((*it1)->phi()));
333  eta.push_back(DataType((*it1)->eta()));
334 
335  if (m_doTileDigit && tileDigits.isValid()) {
336 
337  if ( !pmt1digit[cellInd].empty()) {
338  for (int i=0; i<nTileSamples; i++) {
339  adcCounts1Str="adcCounts1 multiple=\""+DataType(nTileSamples).toString()+"\"";
340  adcCounts1Vec.push_back(DataType( int(pmt1digit[cellInd][i])));
341  }
342  }
343  else {
344  for (int i=0; i<nTileSamples; i++) {
345  adcCounts1Str="adcCounts1 multiple=\""+DataType(nTileSamples).toString()+"\"";
346  adcCounts1Vec.push_back(DataType(0));
347  }
348  }
349 
350 
351  if ( !pmt2digit[cellInd].empty()) {
352  for (int i=0; i<nTileSamples; i++) {
353  adcCounts2Str="adcCounts2 multiple=\""+DataType(nTileSamples).toString()+"\"";
354  adcCounts2Vec.push_back(DataType( int(pmt2digit[cellInd][i])));
355  }
356  }
357  else {
358  for (int i=0; i<nTileSamples; i++) {
359  adcCounts2Str= "adcCounts2 multiple=\""+DataType(nTileSamples).toString()+"\"";
360  adcCounts2Vec.push_back(DataType(0));
361  }
362  }
363  }
364 
365  if (m_doTileCellDetails) {
366 
367  const TileCell* theTileCell = dynamic_cast<const TileCell *>(*it1);
368  if (not theTileCell) {
369  //should never happen
370  throw std::runtime_error("Could not cast pointer to TileCell in CaloTileRetriever::getCaloTileData");
371  }
372  int gain1 = theTileCell->gain1();
373  int qual1 = theTileCell->qual1();
374  bool badch1 = theTileCell->badch1();
375  bool noch1 = (gain1<0 || gain1>1);
376 
377  int qual2 = theTileCell->qual2();
378  int gain2 = theTileCell->gain2();
379  bool badch2 = theTileCell->badch2();
380  bool noch2 = (gain2<0 || gain2>1);
381 
382  if (badch1 != badch2 && qual1 != qual2 && qual1 < 255 && qual2 < 255) {
383  if (badch1 && !noch1) gain1 = 1 - gain1;
384  if (badch2 && !noch1) gain2 = 1 - gain2;
385  }
386  if (badch1) qual1 = -qual1;
387  if (badch2) qual2 = -qual2;
388 
389  pmt1Energy.push_back(DataType(theTileCell->ene1()*(1./GeV)));
390  pmt1Time.push_back(DataType(theTileCell->time1()));
391  pmt1Chi2.push_back(DataType(qual1));
392  pmt1Gain.push_back(DataType(gain1));
393 
394  pmt2Energy.push_back(DataType(theTileCell->ene2()*(1./GeV)));
395  pmt2Time.push_back(DataType(theTileCell->time2()));
396  pmt2Chi2.push_back(DataType(qual2));
397  pmt2Gain.push_back(DataType(gain2));
398 
399  if (offlineRch && RawChannelCnt.isValid()
400  && (noch1 || pmt1number[cellInd]!=0) && (noch2 || pmt2number[cellInd]!=0)) {
401 
402  uint32_t tileAdcStatus = pmt1status[cellInd];
403  if (badch1) tileAdcStatus += 10;
404 
405  pmt1RawAmplitude.push_back(DataType(pmt1rawamp[cellInd]));
406  pmt1RawTime.push_back(DataType(pmt1rawtime[cellInd]));
407  pmt1Pedestal.push_back(DataType(pmt1ped[cellInd]));
408  pmt1Number.push_back(DataType(pmt1number[cellInd]));
409  pmt1ADCStatus.push_back(DataType(tileAdcStatus));
410 
411  tileAdcStatus = pmt2status[cellInd];
412  if (badch2) tileAdcStatus += 10;
413 
414  pmt2RawAmplitude.push_back(DataType(pmt2rawamp[cellInd]));
415  pmt2RawTime.push_back(DataType(pmt2rawtime[cellInd]));
416  pmt2Pedestal.push_back(DataType(pmt2ped[cellInd]));
417  pmt2Number.push_back(DataType(pmt2number[cellInd]));
418  pmt2ADCStatus.push_back(DataType(tileAdcStatus));
419  }
420  else {
421 
422  float maxTime = (tileInfo->NdigitSamples()/2) * 25;
423 
424  if (noch1 /* || pmt1digit[cellInd].empty() */ ) { //invalid gain - channel missing or digits not include in DPD
425  pmt1RawAmplitude.push_back(DataType(0));
426  pmt1RawTime.push_back(DataType(0));
427  pmt1ADCStatus.push_back(DataType(0));
428  pmt1Number.push_back(DataType(0));
429  pmt1Pedestal.push_back(DataType(0)); //The is no pedestal in DPD.
430  } else {
431  HWIdentifier hwid = cabling->s2h_adc_id(tileID->adc_id(cellid,0,gain1));
432 
433  int adc = tileHWID->adc(hwid);
434  int channel = tileHWID->channel(hwid);
435  int drawer = tileHWID->drawer(hwid);
436  int ros = tileHWID->ros(hwid);
437  int PMT = abs( cabling->channel2hole(ros,channel) );
438  int drawerIdx = TileCalibUtils::getDrawerIdx(ros,drawer);
439  float scale = m_tileToolEmscale->channelCalib(drawerIdx, channel, adc, 1.0,
441  float amp = theTileCell->ene1() / scale;
442  float time = theTileCell->time1();
443 
444  int qbit = (theTileCell->qbit1() & TileCell::MASK_TIME);
445  if ((qual1 != 0 || qbit != 0 || amp != 0.0) && (fabs(time) < maxTime && time != 0.0)) {
446  time += m_tileToolTiming->getSignalPhase(drawerIdx, channel, adc);
447  }
448 
449  uint32_t tileAdcStatus = m_tileBadChanTool->encodeStatus(m_tileBadChanTool->getAdcStatus(drawerIdx,channel,adc));
450  if (badch1) tileAdcStatus += 10;
451 
452  pmt1RawAmplitude.push_back(DataType(amp));
453  pmt1RawTime.push_back(DataType(time));
454  pmt1Number.push_back(DataType(PMT));
455  pmt1ADCStatus.push_back(DataType( tileAdcStatus ));
456  pmt1Pedestal.push_back(DataType(0)); //The is no pedestal in DPD . This line is temporary.
457  }
458 
459  if (noch2 /* || pmt2digit[cellInd].empty() */ ) { //invalid gain - channel missing
460  pmt2RawAmplitude.push_back(DataType(0));
461  pmt2RawTime.push_back(DataType(0));
462  pmt2ADCStatus.push_back(DataType(0));
463  pmt2Number.push_back(DataType(0));
464  pmt2Pedestal.push_back(DataType(0)); //The is no pedestal in DPD
465  } else {
466  HWIdentifier hwid = cabling->s2h_adc_id(tileID->adc_id(cellid,1,gain2));
467 
468  int adc = tileHWID->adc(hwid);
469  int channel = tileHWID->channel(hwid);
470  int drawer = tileHWID->drawer(hwid);
471  int ros = tileHWID->ros(hwid);
472  int PMT = abs( cabling->channel2hole(ros,channel) );
473  int drawerIdx = TileCalibUtils::getDrawerIdx(ros,drawer);
474  float scale = m_tileToolEmscale->channelCalib(drawerIdx, channel, adc, 1.0,
476  float amp = theTileCell->ene2() / scale;
477  float time = theTileCell->time2();
478 
479  int qbit = (theTileCell->qbit2() & TileCell::MASK_TIME);
480  if ((qual2 != 0 || qbit != 0 || amp != 0.0) && (fabs(time) < maxTime && time != 0.0)) {
481  time += m_tileToolTiming->getSignalPhase(drawerIdx, channel, adc);
482  }
483 
484  uint32_t tileAdcStatus = m_tileBadChanTool->encodeStatus(m_tileBadChanTool->getAdcStatus(drawerIdx,channel,adc));
485  if (badch2) tileAdcStatus += 10;
486 
487  pmt2RawAmplitude.push_back(DataType(amp));
488  pmt2RawTime.push_back(DataType(time));
489  pmt2ADCStatus.push_back(DataType( tileAdcStatus ));
490  pmt2Number.push_back(DataType(PMT));
491  pmt2Pedestal.push_back(DataType(0)); //The is no pedestal in DPD .
492  }
493  } //don't have TileRawChannel
494  } //if (m_doTileCellDetails)
495  } // end cell iterator
496 
497  ATH_MSG_DEBUG( " Total energy in Tile in GeV : " << energyAllTile );
498 
499  if ( !pmt1digit.empty() ) pmt1digit.clear();
500  if ( !pmt2digit.empty() ) pmt2digit.clear();
501 
502  // write values into DataMap
503  auto n = phi.size();
504  DataMap["phi"] = std::move(phi);
505  DataMap["eta"] = std::move(eta);
506  DataMap["sub"] = m_sub;
507  DataMap["id"] = std::move(idVec);
508  DataMap["energy"] = std::move(energyVec);
509 
510 
511  //BadCells
512  if (m_doBadTile==true) {
513  DataMap["BadCell"]= std::move(BadCell);
514  }
515 
516  if (m_doTileCellDetails) {
517  DataMap["pmt1Energy"] = std::move(pmt1Energy);
518  DataMap["pmt1Time"] = std::move(pmt1Time);
519  DataMap["pmt1Chi2"] = std::move(pmt1Chi2);
520  DataMap["pmt1Gain"] = std::move(pmt1Gain);
521 
522  DataMap["pmt2Energy"] = std::move(pmt2Energy);
523  DataMap["pmt2Time"] = std::move(pmt2Time);
524  DataMap["pmt2Chi2"] = std::move(pmt2Chi2);
525  DataMap["pmt2Gain"] = std::move(pmt2Gain);
526 
527  DataMap["pmt1RawAmplitude"] = std::move(pmt1RawAmplitude);
528  DataMap["pmt1RawTime"] = std::move(pmt1RawTime);
529  DataMap["pmt1ADCStatus"] = std::move(pmt1ADCStatus);
530  DataMap["pmt1Number"] = std::move(pmt1Number);
531  DataMap["pmt1Pedestal"] = std::move(pmt1Pedestal);
532 
533  DataMap["pmt2RawAmplitude"] = std::move(pmt2RawAmplitude);
534  DataMap["pmt2RawTime"] = std::move(pmt2RawTime);
535  DataMap["pmt2ADCStatus"] = std::move(pmt2ADCStatus);
536  DataMap["pmt2Number"] = std::move(pmt2Number);
537  DataMap["pmt2Pedestal"] = std::move(pmt2Pedestal);
538  }
539 
540  DataMap[adcCounts1Str] = std::move( adcCounts1Vec);
541  DataMap[adcCounts2Str] = std::move(adcCounts2Vec);
542 
543  //Be verbose
544  ATH_MSG_DEBUG( dataTypeName() << " retrieved with " << n << " entries" );
545 
546  //All collections retrieved okay
547  return DataMap;
548 
549  } // getTileData
550 
551  //-----------------------------------------------------------------------------------------------------
552 
554  {
555  if (m_calocell_id->is_tile_barrel(cellid))
556  {
557  if (m_calocell_id->is_tile_negative(cellid))
558  m_sub.push_back(DataType(2));
559  else
560  m_sub.push_back(DataType(3));
561  }
562  else if (m_calocell_id->is_tile_extbarrel(cellid))
563  {
564  if (m_calocell_id->is_tile_negative(cellid))
565  m_sub.push_back(DataType(0));
566  else
567  m_sub.push_back(DataType(5));
568  }
569  //else in ITC or scint
570  else
571  {
572  if (m_calocell_id->is_tile_negative(cellid))
573  m_sub.push_back(DataType(1));
574  else
575  m_sub.push_back(DataType(4));
576  }
577  }
578 
579  //--------------------------------------------------------------------------
580 
581 } // JiveXML namespace
Identifier::value_type
IDENTIFIER_TYPE value_type
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:39
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
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:28
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
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
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
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:357
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
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
Example_ReadSampleNoise.drawer
drawer
Definition: Example_ReadSampleNoise.py:39
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:270
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:92
TileID
Helper class for TileCal offline identifiers.
Definition: TileID.h:68
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
beamspotman.n
n
Definition: beamspotman.py:731
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
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:46
JiveXML::CaloTileRetriever::calcTILELayerSub
void calcTILELayerSub(Identifier &)
Definition: CaloTileRetriever.cxx:553
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:21
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:356
HWIdentifier.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
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
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
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
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
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
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
Definition: IdentifierHash.h:38
JiveXML::CaloTileRetriever::m_cellEnergyPrec
int m_cellEnergyPrec
Definition: CaloTileRetriever.h:83
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
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