ATLAS Offline Software
Loading...
Searching...
No Matches
JiveXML::CaloTileRetriever Class Reference

Retrieves all Tile Calo Cell objects. More...

#include <CaloTileRetriever.h>

Inheritance diagram for JiveXML::CaloTileRetriever:
Collaboration diagram for JiveXML::CaloTileRetriever:

Public Member Functions

virtual StatusCode retrieve (ToolHandle< IFormatTool > &FormatTool) override
 Retrieve all the data.
const DataMap getCaloTileData (const CaloCellContainer *cellContainer)
 Retrieve Tile cell location and details.
virtual std::string dataTypeName () const override
 Return the name of the data type.
virtual StatusCode initialize () override
 Default AthAlgTool methods.

Private Member Functions

void calcTILELayerSub (Identifier &)

Private Attributes

ToolHandle< TileCondToolTimingm_tileToolTiming
ToolHandle< TileCondToolEmscalem_tileToolEmscale
ToolHandle< ITileBadChanToolm_tileBadChanTool
const CaloCell_IDm_calocell_id {}
SG::ReadHandleKey< CaloCellContainerm_sgKey {this, "StoreGateKey", "AllCalo", "Name of the CaloCellContainer"}
SG::ReadHandleKey< TileDigitsContainerm_sgKeyTileDigits
SG::ReadHandleKey< TileRawChannelContainerm_sgKeyTileRawChannel
Gaudi::Property< double > m_cellThreshold {this, "CellThreshold", 50.}
Gaudi::Property< int > m_cellEnergyPrec {this, "CellEnergyPrec", 3}
Gaudi::Property< int > m_cellTimePrec {this, "CellTimePrec", 3}
Gaudi::Property< bool > m_tile {this, "RetrieveTILE", true}
Gaudi::Property< bool > m_doTileDigit {this, "DoTileDigit", false}
Gaudi::Property< bool > m_doTileCellDetails {this, "DoTileCellDetails", false}
Gaudi::Property< bool > m_doBadTile {this, "DoBadTile", false}
DataVect m_sub

Detailed Description

Retrieves all Tile Calo Cell objects.

  • Properties
    • StoreGateKeyTile: default is 'AllCalo'. Don't change.
    • CallThreshold: default is 50 MeV
    • RetrieveTile: activate retriever, default is true
    • DoTileDigits: write Tile digits (ADC), default is false
    • DoTileCellDigits: more verbose on cell details
    • CellEnergyPrec: output precision, default is 3 digits
    • CellTimePrec: output precision, default is 3 digits
  • Retrieved Data
    • location in phi and eta
    • identifier and adc counts of each cell
    • various pmt details

Definition at line 45 of file CaloTileRetriever.h.

Member Function Documentation

◆ calcTILELayerSub()

void JiveXML::CaloTileRetriever::calcTILELayerSub ( Identifier & cellid)
private

Definition at line 522 of file CaloTileRetriever.cxx.

523 {
524 if (m_calocell_id->is_tile_barrel(cellid))
525 {
526 if (m_calocell_id->is_tile_negative(cellid))
527 m_sub.push_back(DataType(2));
528 else
529 m_sub.push_back(DataType(3));
530 }
531 else if (m_calocell_id->is_tile_extbarrel(cellid))
532 {
533 if (m_calocell_id->is_tile_negative(cellid))
534 m_sub.push_back(DataType(0));
535 else
536 m_sub.push_back(DataType(5));
537 }
538 //else in ITC or scint
539 else
540 {
541 if (m_calocell_id->is_tile_negative(cellid))
542 m_sub.push_back(DataType(1));
543 else
544 m_sub.push_back(DataType(4));
545 }
546 }
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType
const CaloCell_ID * m_calocell_id

◆ dataTypeName()

virtual std::string JiveXML::CaloTileRetriever::dataTypeName ( ) const
inlineoverridevirtual

Return the name of the data type.

Definition at line 55 of file CaloTileRetriever.h.

55{ return "TileDigit"; };

◆ getCaloTileData()

const DataMap JiveXML::CaloTileRetriever::getCaloTileData ( const CaloCellContainer * cellContainer)

Retrieve Tile cell location and details.

Parameters
FormatToolthe tool that will create formated output from the DataMap

< Unit for TileRawChannels (ADC, pCb, etc.)

Definition at line 86 of file CaloTileRetriever.cxx.

86 {
87
88 ATH_MSG_DEBUG( "getTileData()" );
89 char rndStr[30];
91
92 DataVect phi; phi.reserve(cellContainer->size());
93 DataVect eta; eta.reserve(cellContainer->size());
94 DataVect idVec; idVec.reserve(cellContainer->size());
95 DataVect energyVec; energyVec.reserve(cellContainer->size());
96 DataVect adcCounts1Vec; adcCounts1Vec.reserve(cellContainer->size() * 10);
97 DataVect adcCounts2Vec; adcCounts2Vec.reserve(cellContainer->size() * 10);
98 DataVect BadCell; BadCell.reserve(cellContainer->size());
99
100 DataVect pmt1Energy; pmt1Energy.reserve(cellContainer->size());
101 DataVect pmt1Time; pmt1Time.reserve(cellContainer->size());
102 DataVect pmt1Chi2; pmt1Chi2.reserve(cellContainer->size());
103 DataVect pmt1Gain; pmt1Gain.reserve(cellContainer->size());
104 DataVect pmt2Energy; pmt2Energy.reserve(cellContainer->size());
105 DataVect pmt2Time; pmt2Time.reserve(cellContainer->size());
106 DataVect pmt2Chi2; pmt2Chi2.reserve(cellContainer->size());
107 DataVect pmt2Gain; pmt2Gain.reserve(cellContainer->size());
108
109 DataVect pmt1RawAmplitude; pmt1RawAmplitude.reserve(cellContainer->size());
110 DataVect pmt1RawTime; pmt1RawTime.reserve(cellContainer->size());
111 DataVect pmt1Pedestal; pmt1Pedestal.reserve(cellContainer->size());
112 DataVect pmt1Number; pmt1Number.reserve(cellContainer->size());
113 DataVect pmt1ADCStatus; pmt1ADCStatus.reserve(cellContainer->size());
114 DataVect pmt2RawAmplitude; pmt2RawAmplitude.reserve(cellContainer->size());
115 DataVect pmt2RawTime; pmt2RawTime.reserve(cellContainer->size());
116 DataVect pmt2Pedestal; pmt2Pedestal.reserve(cellContainer->size());
117 DataVect pmt2Number; pmt2Number.reserve(cellContainer->size());
118 DataVect pmt2ADCStatus; pmt2ADCStatus.reserve(cellContainer->size());
119
120// m_sub; m_sub.reserve(cellContainer->size());
121 m_sub.clear();
122
123 std::string adcCounts1Str = "adcCounts1 multiple=\"0\"";
124 std::string adcCounts2Str = "adcCounts2 multiple=\"0\"";
125
126 const TileID* tileID = nullptr;
127 const TileHWID* tileHWID = nullptr;
128 const TileInfo* tileInfo = nullptr;
129 const TileCablingService* cabling=nullptr;
132 double energyGeV;
133 double amplitude = 0.;
134 const int vsize = cellContainer->size(); //5184;
135 int Index,pmtInd, cellInd, nTileSamples=0;
136 std::vector<double> pmt1ped(vsize,0.0);
137 std::vector<double> pmt2ped(vsize,0.0);
138 std::vector<double> pmt1rawamp(vsize,0.0);
139 std::vector<double> pmt2rawamp(vsize,0.0);
140 std::vector<double> pmt1rawtime(vsize,0.0);
141 std::vector<double> pmt2rawtime(vsize,0.0);
142 std::vector<int> pmt1number(vsize,0);
143 std::vector<int> pmt2number(vsize,0);
144 std::vector<unsigned long int> pmt1status(vsize,0);
145 std::vector<unsigned long int> pmt2status(vsize,0);
146 std::map<int,std::vector<float> > pmt1digit;
147 std::map<int,std::vector<float> > pmt2digit;
148 bool offlineRch = false;
149
150 //===== retrieving everything which is needed for Tile
151
152 if (detStore()->retrieve(tileID).isFailure()) {
153 ATH_MSG_ERROR( "in getCaloTileData(), Could not retrieve TileID" );
154
155 }
156
157 if (detStore()->retrieve(tileHWID).isFailure()) {
158 ATH_MSG_ERROR( "in getCaloTileData(), Could not retrieve TileHWID" );
159 }
160
161 if (detStore()->retrieve(tileInfo, "TileInfo").isFailure()) {
162 ATH_MSG_ERROR( "in getCaloTileData(), Could not retrieve TileInfo" );
163 }
164
165 SG::ReadHandle<TileDigitsContainer> tileDigits;
166 if (m_doTileDigit) {
167 tileDigits = SG::makeHandle(m_sgKeyTileDigits);
168 if (!tileDigits.isValid()){
169 ATH_MSG_WARNING( "Could not retrieve TileDigits " );
170 }
171 }
172
173 SG::ReadHandle<TileRawChannelContainer> RawChannelCnt;
175 RawChannelCnt = SG::makeHandle(m_sgKeyTileRawChannel);
176 if (!RawChannelCnt.isValid()){
177 ATH_MSG_WARNING( "Could not retrieve TileRawChannel " );
178 }
179 else {
180 RChUnit = RawChannelCnt->get_unit();
181 offlineRch = (RChUnit<TileRawChannelUnit::OnlineADCcounts &&
182 RawChannelCnt->get_type() != TileFragHash::OptFilterDsp);
183 }
184 }
185
186
187 // Loop Over TileRawChannelContainer to retrieve raw information. Keep the values in vectors
188
189 if (m_doTileCellDetails && RawChannelCnt.isValid()) {
190 if (offlineRch) {
191
192 for (const auto rawChannel : *RawChannelCnt) {
193
194 for (const auto cell : *rawChannel) {
195
196 /*Identifier cell_id =*/ cell->cell_ID_index(Index,pmtInd);
197 if (Index <= -1 ) continue; //disconnect channel index is -1 and MBTS is -2. They do not have an idhash
198 IdentifierHash cell_hash = m_calocell_id->calo_cell_hash( cell->cell_ID() );
199 cellInd = cellContainer->findIndex(cell_hash); //find Cell Index
200 if (cellInd < 0) continue;
201
202 HWIdentifier hwid=cell->adc_HWID();
203 int adc = tileHWID->adc(hwid);
204 int channel = tileHWID->channel(hwid);
205 int drawer = tileHWID->drawer(hwid);
206 int ros = tileHWID->ros(hwid);
207 int PMT = abs( cabling->channel2hole(ros,channel) );
208 int drawerIdx = TileCalibUtils::getDrawerIdx(ros,drawer);
209 uint32_t tileAdcStatus = m_tileBadChanTool->encodeStatus(m_tileBadChanTool->getAdcStatus(drawerIdx,channel,adc));
210
211 amplitude = cell->amplitude();
212 //Change amplitude units to ADC counts
214 amplitude /= m_tileToolEmscale->channelCalib(drawerIdx, channel, adc, 1.0, TileRawChannelUnit::ADCcounts, RChUnit);
215 } else if (RChUnit > TileRawChannelUnit::OnlineADCcounts) {
216 // Should never get here due to offlineRch test above.
217 //amplitude = m_tileToolEmscale->undoOnlCalib(drawerIdx, channel, adc, amplitude, RChUnit);
218 std::abort();
219 }
220
221 if ( pmtInd == 0 ) { // first PMT
222
223 pmt1ped[cellInd] = cell->pedestal();
224 pmt1rawamp[cellInd] = amplitude;
225 pmt1rawtime[cellInd] = cell->uncorrTime();
226 pmt1number[cellInd] = PMT;
227 pmt1status[cellInd] = tileAdcStatus;
228 }
229 else { // second PMT
230
231 pmt2ped[cellInd] = cell->pedestal();
232 pmt2rawamp[cellInd] = amplitude;
233 pmt2rawtime[cellInd] = cell->uncorrTime();
234 pmt2number[cellInd] = PMT;
235 pmt2status[cellInd] = tileAdcStatus;
236
237 }
238 }
239 }//for TileRawChannelContainer loop
240 }
241 } // end of doTileCellDetails
242
243
244 //Loop over TileDigitsContainer to retrieve digits. Keep the digits values in a map
245
246 if (m_doTileDigit && tileDigits.isValid()) {
247
248 //----- get tile digits--------------------------
249
250 // tile digits loop
251 for (const auto digitChannel : *tileDigits) {
252
253 for (const auto cell : *digitChannel) {
254
255 /*Identifier cell_id =*/ cell->cell_ID_index(Index,pmtInd);
256 if (Index <= -1 ) continue; //disconnect channel index is -1 and MBTS is -2. They do not have an idhash
257 IdentifierHash cell_hash = m_calocell_id->calo_cell_hash( cell->cell_ID() );
258 cellInd = cellContainer->findIndex(cell_hash); //find Cell Index
259 if (cellInd < 0) continue;
260 if ( (*cellContainer)[cellInd]->energy() < m_cellThreshold) continue;
261
262 nTileSamples = cell->NtimeSamples();
263 std::vector<float> tileSamples = cell->samples();
264
265 if (pmtInd == 0 ) { // first PMT
266 pmt1digit.insert(std::make_pair( cellInd, tileSamples ) );
267 }
268 else { // second PMT
269 pmt2digit.insert(std::make_pair( cellInd, tileSamples ) );
270 }
271
272 }
273 }//for TileDigitContainer loop
274 } // end if doTileDigit
275
276
277 //Loop Over CaloCellContainer to retrieve TileCell information
278
281
282 double energyAllTile = 0.;
283
284 for (;it1!=it2;++it1) {
285
286 if ((*it1)->badcell()) BadCell.push_back(1);
287 else if ((*it1)->energy()>= m_cellThreshold) BadCell.push_back(0);
288 else BadCell.push_back(-1);
289
290 Identifier cellid = (*it1)->ID();
291 IdentifierHash cell_hash = m_calocell_id->calo_cell_hash( cellid );
292 cellInd = cellContainer->findIndex(cell_hash);
293 if (cellInd < 0) continue;
294 calcTILELayerSub(cellid);
295
296 energyGeV = (*it1)->energy()*(1./GeV);
297 energyVec.push_back(DataType( gcvt( energyGeV, m_cellEnergyPrec, rndStr) ));
298 energyAllTile += energyGeV;
299
300 idVec.push_back(DataType( (Identifier::value_type)(*it1)->ID().get_compact() ));
301 phi.push_back(DataType((*it1)->phi()));
302 eta.push_back(DataType((*it1)->eta()));
303
304 if (m_doTileDigit && tileDigits.isValid()) {
305
306 if ( !pmt1digit[cellInd].empty()) {
307 for (int i=0; i<nTileSamples; i++) {
308 adcCounts1Str="adcCounts1 multiple=\""+DataType(nTileSamples).toString()+"\"";
309 adcCounts1Vec.push_back(DataType( int(pmt1digit[cellInd][i])));
310 }
311 }
312 else {
313 for (int i=0; i<nTileSamples; i++) {
314 adcCounts1Str="adcCounts1 multiple=\""+DataType(nTileSamples).toString()+"\"";
315 adcCounts1Vec.push_back(DataType(0));
316 }
317 }
318
319
320 if ( !pmt2digit[cellInd].empty()) {
321 for (int i=0; i<nTileSamples; i++) {
322 adcCounts2Str="adcCounts2 multiple=\""+DataType(nTileSamples).toString()+"\"";
323 adcCounts2Vec.push_back(DataType( int(pmt2digit[cellInd][i])));
324 }
325 }
326 else {
327 for (int i=0; i<nTileSamples; i++) {
328 adcCounts2Str= "adcCounts2 multiple=\""+DataType(nTileSamples).toString()+"\"";
329 adcCounts2Vec.push_back(DataType(0));
330 }
331 }
332 }
333
335
336 const TileCell* theTileCell = dynamic_cast<const TileCell *>(*it1);
337 if (not theTileCell) {
338 //should never happen
339 throw std::runtime_error("Could not cast pointer to TileCell in CaloTileRetriever::getCaloTileData");
340 }
341 int gain1 = theTileCell->gain1();
342 int qual1 = theTileCell->qual1();
343 bool badch1 = theTileCell->badch1();
344 bool noch1 = (gain1<0 || gain1>1);
345
346 int qual2 = theTileCell->qual2();
347 int gain2 = theTileCell->gain2();
348 bool badch2 = theTileCell->badch2();
349 bool noch2 = (gain2<0 || gain2>1);
350
351 if (badch1 != badch2 && qual1 != qual2 && qual1 < 255 && qual2 < 255) {
352 if (badch1 && !noch1) gain1 = 1 - gain1;
353 if (badch2 && !noch1) gain2 = 1 - gain2;
354 }
355 if (badch1) qual1 = -qual1;
356 if (badch2) qual2 = -qual2;
357
358 pmt1Energy.push_back(DataType(theTileCell->ene1()*(1./GeV)));
359 pmt1Time.push_back(DataType(theTileCell->time1()));
360 pmt1Chi2.push_back(DataType(qual1));
361 pmt1Gain.push_back(DataType(gain1));
362
363 pmt2Energy.push_back(DataType(theTileCell->ene2()*(1./GeV)));
364 pmt2Time.push_back(DataType(theTileCell->time2()));
365 pmt2Chi2.push_back(DataType(qual2));
366 pmt2Gain.push_back(DataType(gain2));
367
368 if (offlineRch && RawChannelCnt.isValid()
369 && (noch1 || pmt1number[cellInd]!=0) && (noch2 || pmt2number[cellInd]!=0)) {
370
371 uint32_t tileAdcStatus = pmt1status[cellInd];
372 if (badch1) tileAdcStatus += 10;
373
374 pmt1RawAmplitude.push_back(DataType(pmt1rawamp[cellInd]));
375 pmt1RawTime.push_back(DataType(pmt1rawtime[cellInd]));
376 pmt1Pedestal.push_back(DataType(pmt1ped[cellInd]));
377 pmt1Number.push_back(DataType(pmt1number[cellInd]));
378 pmt1ADCStatus.push_back(DataType(tileAdcStatus));
379
380 tileAdcStatus = pmt2status[cellInd];
381 if (badch2) tileAdcStatus += 10;
382
383 pmt2RawAmplitude.push_back(DataType(pmt2rawamp[cellInd]));
384 pmt2RawTime.push_back(DataType(pmt2rawtime[cellInd]));
385 pmt2Pedestal.push_back(DataType(pmt2ped[cellInd]));
386 pmt2Number.push_back(DataType(pmt2number[cellInd]));
387 pmt2ADCStatus.push_back(DataType(tileAdcStatus));
388 }
389 else {
390
391 float maxTime = (tileInfo->NdigitSamples()/2) * 25;
392
393 if (noch1 /* || pmt1digit[cellInd].empty() */ ) { //invalid gain - channel missing or digits not include in DPD
394 pmt1RawAmplitude.push_back(DataType(0));
395 pmt1RawTime.push_back(DataType(0));
396 pmt1ADCStatus.push_back(DataType(0));
397 pmt1Number.push_back(DataType(0));
398 pmt1Pedestal.push_back(DataType(0)); //The is no pedestal in DPD.
399 } else {
400 HWIdentifier hwid = cabling->s2h_adc_id(tileID->adc_id(cellid,0,gain1));
401
402 int adc = tileHWID->adc(hwid);
403 int channel = tileHWID->channel(hwid);
404 int drawer = tileHWID->drawer(hwid);
405 int ros = tileHWID->ros(hwid);
406 int PMT = abs( cabling->channel2hole(ros,channel) );
407 int drawerIdx = TileCalibUtils::getDrawerIdx(ros,drawer);
408 float scale = m_tileToolEmscale->channelCalib(drawerIdx, channel, adc, 1.0,
410 float amp = theTileCell->ene1() / scale;
411 float time = theTileCell->time1();
412
413 int qbit = (theTileCell->qbit1() & TileCell::MASK_TIME);
414 if ((qual1 != 0 || qbit != 0 || amp != 0.0) && (fabs(time) < maxTime && time != 0.0)) {
415 time += m_tileToolTiming->getSignalPhase(drawerIdx, channel, adc);
416 }
417
418 uint32_t tileAdcStatus = m_tileBadChanTool->encodeStatus(m_tileBadChanTool->getAdcStatus(drawerIdx,channel,adc));
419 if (badch1) tileAdcStatus += 10;
420
421 pmt1RawAmplitude.push_back(DataType(amp));
422 pmt1RawTime.push_back(DataType(time));
423 pmt1Number.push_back(DataType(PMT));
424 pmt1ADCStatus.push_back(DataType( tileAdcStatus ));
425 pmt1Pedestal.push_back(DataType(0)); //The is no pedestal in DPD . This line is temporary.
426 }
427
428 if (noch2 /* || pmt2digit[cellInd].empty() */ ) { //invalid gain - channel missing
429 pmt2RawAmplitude.push_back(DataType(0));
430 pmt2RawTime.push_back(DataType(0));
431 pmt2ADCStatus.push_back(DataType(0));
432 pmt2Number.push_back(DataType(0));
433 pmt2Pedestal.push_back(DataType(0)); //The is no pedestal in DPD
434 } else {
435 HWIdentifier hwid = cabling->s2h_adc_id(tileID->adc_id(cellid,1,gain2));
436
437 int adc = tileHWID->adc(hwid);
438 int channel = tileHWID->channel(hwid);
439 int drawer = tileHWID->drawer(hwid);
440 int ros = tileHWID->ros(hwid);
441 int PMT = abs( cabling->channel2hole(ros,channel) );
442 int drawerIdx = TileCalibUtils::getDrawerIdx(ros,drawer);
443 float scale = m_tileToolEmscale->channelCalib(drawerIdx, channel, adc, 1.0,
445 float amp = theTileCell->ene2() / scale;
446 float time = theTileCell->time2();
447
448 int qbit = (theTileCell->qbit2() & TileCell::MASK_TIME);
449 if ((qual2 != 0 || qbit != 0 || amp != 0.0) && (fabs(time) < maxTime && time != 0.0)) {
450 time += m_tileToolTiming->getSignalPhase(drawerIdx, channel, adc);
451 }
452
453 uint32_t tileAdcStatus = m_tileBadChanTool->encodeStatus(m_tileBadChanTool->getAdcStatus(drawerIdx,channel,adc));
454 if (badch2) tileAdcStatus += 10;
455
456 pmt2RawAmplitude.push_back(DataType(amp));
457 pmt2RawTime.push_back(DataType(time));
458 pmt2ADCStatus.push_back(DataType( tileAdcStatus ));
459 pmt2Number.push_back(DataType(PMT));
460 pmt2Pedestal.push_back(DataType(0)); //The is no pedestal in DPD .
461 }
462 } //don't have TileRawChannel
463 } //if (m_doTileCellDetails)
464 } // end cell iterator
465
466 ATH_MSG_DEBUG( " Total energy in Tile in GeV : " << energyAllTile );
467
468 if ( !pmt1digit.empty() ) pmt1digit.clear();
469 if ( !pmt2digit.empty() ) pmt2digit.clear();
470
471 // write values into DataMap
472 auto n = phi.size();
473 DataMap["phi"] = std::move(phi);
474 DataMap["eta"] = std::move(eta);
475 DataMap["sub"] = m_sub;
476 DataMap["id"] = std::move(idVec);
477 DataMap["energy"] = std::move(energyVec);
478
479
480 //BadCells
481 if (m_doBadTile==true) {
482 DataMap["BadCell"]= std::move(BadCell);
483 }
484
486 DataMap["pmt1Energy"] = std::move(pmt1Energy);
487 DataMap["pmt1Time"] = std::move(pmt1Time);
488 DataMap["pmt1Chi2"] = std::move(pmt1Chi2);
489 DataMap["pmt1Gain"] = std::move(pmt1Gain);
490
491 DataMap["pmt2Energy"] = std::move(pmt2Energy);
492 DataMap["pmt2Time"] = std::move(pmt2Time);
493 DataMap["pmt2Chi2"] = std::move(pmt2Chi2);
494 DataMap["pmt2Gain"] = std::move(pmt2Gain);
495
496 DataMap["pmt1RawAmplitude"] = std::move(pmt1RawAmplitude);
497 DataMap["pmt1RawTime"] = std::move(pmt1RawTime);
498 DataMap["pmt1ADCStatus"] = std::move(pmt1ADCStatus);
499 DataMap["pmt1Number"] = std::move(pmt1Number);
500 DataMap["pmt1Pedestal"] = std::move(pmt1Pedestal);
501
502 DataMap["pmt2RawAmplitude"] = std::move(pmt2RawAmplitude);
503 DataMap["pmt2RawTime"] = std::move(pmt2RawTime);
504 DataMap["pmt2ADCStatus"] = std::move(pmt2ADCStatus);
505 DataMap["pmt2Number"] = std::move(pmt2Number);
506 DataMap["pmt2Pedestal"] = std::move(pmt2Pedestal);
507 }
508
509 DataMap[adcCounts1Str] = std::move( adcCounts1Vec);
510 DataMap[adcCounts2Str] = std::move(adcCounts2Vec);
511
512 //Be verbose
513 ATH_MSG_DEBUG( dataTypeName() << " retrieved with " << n << " entries" );
514
515 //All collections retrieved okay
516 return DataMap;
517
518 } // getTileData
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
IndexedConstituentUserInfo::Index Index
static const Attributes_t empty
CaloCellContainer::const_iterator beginConstCalo(CaloCell_ID::SUBCALO caloNum) const
get const iterators on cell of just one calo
CaloCellContainer::const_iterator endConstCalo(CaloCell_ID::SUBCALO caloNum) const
int findIndex(const IdentifierHash theHash) const
Return index of the cell with a given hash.
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
size_type size() const noexcept
Returns the number of elements in the collection.
void calcTILELayerSub(Identifier &)
SG::ReadHandleKey< TileDigitsContainer > m_sgKeyTileDigits
Gaudi::Property< bool > m_doTileCellDetails
ToolHandle< TileCondToolTiming > m_tileToolTiming
Gaudi::Property< double > m_cellThreshold
ToolHandle< ITileBadChanTool > m_tileBadChanTool
SG::ReadHandleKey< TileRawChannelContainer > m_sgKeyTileRawChannel
ToolHandle< TileCondToolEmscale > m_tileToolEmscale
virtual std::string dataTypeName() const override
Return the name of the data type.
Gaudi::Property< bool > m_doBadTile
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool) override
Retrieve all the data.
Gaudi::Property< int > m_cellEnergyPrec
Gaudi::Property< bool > m_doTileDigit
virtual bool isValid() override final
Can the handle be successfully dereferenced?
static const TileCablingService * getInstance()
get pointer to service instance
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
@ MASK_TIME
Definition TileCell.h:67
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
Definition TileHWID.h:189
int adc(const HWIdentifier &id) const
extract adc field from HW identifier
Definition TileHWID.h:193
int drawer(const HWIdentifier &id) const
extract drawer field from HW identifier
Definition TileHWID.h:171
int ros(const HWIdentifier &id) const
extract ros field from HW identifier
Definition TileHWID.h:167
int NdigitSamples() const
Returns the number of sammples (digits) per event.
Definition TileInfo.h:75
Identifier adc_id(const Identifier &cell_id, int pmt, int adc) const
time(flags, cells_name, *args, **kw)
std::map< std::string, DataVect > DataMap
Definition DataType.h:59
std::vector< DataType > DataVect
Defines a map with a key and a vector of DataType objects e.g.
Definition DataType.h:58
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
setEventNumber uint32_t

◆ initialize()

StatusCode JiveXML::CaloTileRetriever::initialize ( )
overridevirtual

Default AthAlgTool methods.

Initialise the Tool.

Definition at line 35 of file CaloTileRetriever.cxx.

35 {
36
37 ATH_MSG_DEBUG( "Initialising Tool" );
38 ATH_CHECK( detStore()->retrieve (m_calocell_id, "CaloCell_ID") );
39
40 //=== get TileCondToolTiming
41 ATH_CHECK( m_tileToolTiming.retrieve() );
42
43 //=== get TileCondToolEmscale
44 ATH_CHECK( m_tileToolEmscale.retrieve() );
45
46 //=== get TileBadChanTool
47 ATH_CHECK( m_tileBadChanTool.retrieve() );
48
49 ATH_CHECK( m_sgKey.initialize() );
50
52
54
55 return StatusCode::SUCCESS;
56 }
#define ATH_CHECK
Evaluate an expression and check for errors.
SG::ReadHandleKey< CaloCellContainer > m_sgKey

◆ retrieve()

StatusCode JiveXML::CaloTileRetriever::retrieve ( ToolHandle< IFormatTool > & FormatTool)
overridevirtual

Retrieve all the data.

Tile data retrieval from chosen collection.

Definition at line 61 of file CaloTileRetriever.cxx.

61 {
62
63 ATH_MSG_DEBUG( "in retrieve()" );
64
65 SG::ReadHandle<CaloCellContainer> cellContainer(m_sgKey);
66 if (!cellContainer.isValid()){
67 ATH_MSG_WARNING( "Could not retrieve Calorimeter Cells " );
68 }
69 else{
70 if (m_tile) {
71 DataMap data = getCaloTileData(&(*cellContainer));
72 ATH_CHECK( FormatTool->AddToEvent("TILE", m_sgKey.key(), &data) );
73 ATH_MSG_DEBUG( "Tile retrieved" );
74 }
75 }
76
77 //Tile cells retrieved okay
78 return StatusCode::SUCCESS;
79 }
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
const DataMap getCaloTileData(const CaloCellContainer *cellContainer)
Retrieve Tile cell location and details.
Gaudi::Property< bool > m_tile

Member Data Documentation

◆ m_calocell_id

const CaloCell_ID* JiveXML::CaloTileRetriever::m_calocell_id {}
private

Definition at line 71 of file CaloTileRetriever.h.

71{};

◆ m_cellEnergyPrec

Gaudi::Property<int> JiveXML::CaloTileRetriever::m_cellEnergyPrec {this, "CellEnergyPrec", 3}
private

Definition at line 79 of file CaloTileRetriever.h.

79{this, "CellEnergyPrec", 3};

◆ m_cellThreshold

Gaudi::Property<double> JiveXML::CaloTileRetriever::m_cellThreshold {this, "CellThreshold", 50.}
private

Definition at line 78 of file CaloTileRetriever.h.

78{this, "CellThreshold", 50.};

◆ m_cellTimePrec

Gaudi::Property<int> JiveXML::CaloTileRetriever::m_cellTimePrec {this, "CellTimePrec", 3}
private

Definition at line 80 of file CaloTileRetriever.h.

80{this, "CellTimePrec", 3};

◆ m_doBadTile

Gaudi::Property<bool> JiveXML::CaloTileRetriever::m_doBadTile {this, "DoBadTile", false}
private

Definition at line 84 of file CaloTileRetriever.h.

84{this, "DoBadTile", false};

◆ m_doTileCellDetails

Gaudi::Property<bool> JiveXML::CaloTileRetriever::m_doTileCellDetails {this, "DoTileCellDetails", false}
private

Definition at line 83 of file CaloTileRetriever.h.

83{this, "DoTileCellDetails", false};

◆ m_doTileDigit

Gaudi::Property<bool> JiveXML::CaloTileRetriever::m_doTileDigit {this, "DoTileDigit", false}
private

Definition at line 82 of file CaloTileRetriever.h.

82{this, "DoTileDigit", false};

◆ m_sgKey

SG::ReadHandleKey<CaloCellContainer> JiveXML::CaloTileRetriever::m_sgKey {this, "StoreGateKey", "AllCalo", "Name of the CaloCellContainer"}
private

Definition at line 73 of file CaloTileRetriever.h.

73{this, "StoreGateKey", "AllCalo", "Name of the CaloCellContainer"};

◆ m_sgKeyTileDigits

SG::ReadHandleKey<TileDigitsContainer> JiveXML::CaloTileRetriever::m_sgKeyTileDigits
private
Initial value:
{this, "TileDigitsContainer", "",
"Input collection to retrieve Tile digits, used when doTileDigit is True"}

Definition at line 74 of file CaloTileRetriever.h.

74 {this, "TileDigitsContainer", "",
75 "Input collection to retrieve Tile digits, used when doTileDigit is True"};

◆ m_sgKeyTileRawChannel

SG::ReadHandleKey<TileRawChannelContainer> JiveXML::CaloTileRetriever::m_sgKeyTileRawChannel
private
Initial value:
{this, "TileRawChannelContainer", "",
"Input collection to retrieve Tile raw channels, used when doTileCellDetails is True"}

Definition at line 76 of file CaloTileRetriever.h.

76 {this, "TileRawChannelContainer", "",
77 "Input collection to retrieve Tile raw channels, used when doTileCellDetails is True"};

◆ m_sub

DataVect JiveXML::CaloTileRetriever::m_sub
private

Definition at line 86 of file CaloTileRetriever.h.

◆ m_tile

Gaudi::Property<bool> JiveXML::CaloTileRetriever::m_tile {this, "RetrieveTILE", true}
private

Definition at line 81 of file CaloTileRetriever.h.

81{this, "RetrieveTILE", true};

◆ m_tileBadChanTool

ToolHandle<ITileBadChanTool> JiveXML::CaloTileRetriever::m_tileBadChanTool
private
Initial value:
{this,
"TileBadChanTool", "TileBadChanTool", "Tile bad channel tool"}

Definition at line 67 of file CaloTileRetriever.h.

67 {this,
68 "TileBadChanTool", "TileBadChanTool", "Tile bad channel tool"};

◆ m_tileToolEmscale

ToolHandle<TileCondToolEmscale> JiveXML::CaloTileRetriever::m_tileToolEmscale
private
Initial value:
{this,
"TileCondToolEmscale", "TileCondToolEmscale", "Tile EM scale calibration tool"}

Definition at line 64 of file CaloTileRetriever.h.

64 {this,
65 "TileCondToolEmscale", "TileCondToolEmscale", "Tile EM scale calibration tool"};

◆ m_tileToolTiming

ToolHandle<TileCondToolTiming> JiveXML::CaloTileRetriever::m_tileToolTiming
private
Initial value:
{this,
"TileCondToolTiming", "TileCondToolTiming", "Tile timing tool"}

Definition at line 61 of file CaloTileRetriever.h.

61 {this,
62 "TileCondToolTiming", "TileCondToolTiming", "Tile timing tool"};

The documentation for this class was generated from the following files: