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, const EventContext &ctx)
 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 524 of file CaloTileRetriever.cxx.

525 {
526 if (m_calocell_id->is_tile_barrel(cellid))
527 {
528 if (m_calocell_id->is_tile_negative(cellid))
529 m_sub.push_back(DataType(2));
530 else
531 m_sub.push_back(DataType(3));
532 }
533 else if (m_calocell_id->is_tile_extbarrel(cellid))
534 {
535 if (m_calocell_id->is_tile_negative(cellid))
536 m_sub.push_back(DataType(0));
537 else
538 m_sub.push_back(DataType(5));
539 }
540 //else in ITC or scint
541 else
542 {
543 if (m_calocell_id->is_tile_negative(cellid))
544 m_sub.push_back(DataType(1));
545 else
546 m_sub.push_back(DataType(4));
547 }
548 }
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,
const EventContext & ctx )

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 88 of file CaloTileRetriever.cxx.

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