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

 CaloTileRetriever (const std::string &type, const std::string &name, const IInterface *parent)
 Standard Constructor.
virtual StatusCode retrieve (ToolHandle< IFormatTool > &FormatTool)
 Retrieve all the data.
const DataMap getCaloTileData (const CaloCellContainer *cellContainer)
 Retrieve Tile cell location and details.
virtual std::string dataTypeName () const
 Return the name of the data type.
StatusCode initialize ()
 Default AthAlgTool methods.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static const InterfaceID & interfaceID ()
 Return the interface identifier.

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

void calcTILELayerSub (Identifier &)
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

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 {this, "TileDigitsContainerKey", "", "Name of the TileDigitsContainer"}
SG::ReadHandleKey< TileRawChannelContainerm_sgKeyTileRawChannel {this, "TileRawChannelContainerKey", "", "Name of the TileRawChannelContainer"}
double m_cellThreshold
int m_cellEnergyPrec
int m_cellTimePrec
bool m_tile
bool m_doTileDigit
bool m_doTileCellDetails
bool m_doBadTile
DataVect m_sub
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

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 48 of file CaloTileRetriever.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ CaloTileRetriever()

JiveXML::CaloTileRetriever::CaloTileRetriever ( const std::string & type,
const std::string & name,
const IInterface * parent )

Standard Constructor.

This is the standard AthAlgTool constructor.

Parameters
typeAlgTool type name
nameAlgTool instance name
parentAlgTools parent owning this tool

Definition at line 37 of file CaloTileRetriever.cxx.

37 :
38 AthAlgTool(type,name,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 }
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const CaloCell_ID * m_calocell_id
SG::ReadHandleKey< TileDigitsContainer > m_sgKeyTileDigits
SG::ReadHandleKey< TileRawChannelContainer > m_sgKeyTileRawChannel

Member Function Documentation

◆ calcTILELayerSub()

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

Definition at line 554 of file CaloTileRetriever.cxx.

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 }
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType

◆ dataTypeName()

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

Return the name of the data type.

Implements JiveXML::IDataRetriever.

Definition at line 61 of file CaloTileRetriever.h.

61{ return "TileDigit"; };

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

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

118 {
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
197 SG::ReadHandle<TileDigitsContainer> tileDigits;
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
205 SG::ReadHandle<TileRawChannelContainer> RawChannelCnt;
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
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
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
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
const ServiceHandle< StoreGateSvc > & detStore() const
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 &)
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.
virtual std::string dataTypeName() const
Return the name of the data type.
ToolHandle< TileCondToolTiming > m_tileToolTiming
ToolHandle< ITileBadChanTool > m_tileBadChanTool
ToolHandle< TileCondToolEmscale > m_tileToolEmscale
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 ( )

Default AthAlgTool methods.

Initialise the ToolSvc.

Definition at line 67 of file CaloTileRetriever.cxx.

67 {
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
81 ATH_CHECK( m_sgKey.initialize() );
82
84
86
87 return StatusCode::SUCCESS;
88 }
#define ATH_CHECK
Evaluate an expression and check for errors.
SG::ReadHandleKey< CaloCellContainer > m_sgKey

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & JiveXML::IDataRetriever::interfaceID ( )
inlinestaticinherited

Return the interface identifier.

Definition at line 40 of file IDataRetriever.h.

40{ return IID_IDataRetriever; }
static const InterfaceID IID_IDataRetriever("JiveXML::IDataRetriever", 3, 0)

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ retrieve()

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

Retrieve all the data.

Tile data retrieval from chosen collection.

Implements JiveXML::IDataRetriever.

Definition at line 93 of file CaloTileRetriever.cxx.

93 {
94
95 ATH_MSG_DEBUG( "in retrieve()" );
96
97 SG::ReadHandle<CaloCellContainer> cellContainer(m_sgKey);
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 }
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
const DataMap getCaloTileData(const CaloCellContainer *cellContainer)
Retrieve Tile cell location and details.

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_calocell_id

const CaloCell_ID* JiveXML::CaloTileRetriever::m_calocell_id
private

Definition at line 77 of file CaloTileRetriever.h.

◆ m_cellEnergyPrec

int JiveXML::CaloTileRetriever::m_cellEnergyPrec
private

Definition at line 83 of file CaloTileRetriever.h.

◆ m_cellThreshold

double JiveXML::CaloTileRetriever::m_cellThreshold
private

Definition at line 82 of file CaloTileRetriever.h.

◆ m_cellTimePrec

int JiveXML::CaloTileRetriever::m_cellTimePrec
private

Definition at line 84 of file CaloTileRetriever.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doBadTile

bool JiveXML::CaloTileRetriever::m_doBadTile
private

Definition at line 88 of file CaloTileRetriever.h.

◆ m_doTileCellDetails

bool JiveXML::CaloTileRetriever::m_doTileCellDetails
private

Definition at line 87 of file CaloTileRetriever.h.

◆ m_doTileDigit

bool JiveXML::CaloTileRetriever::m_doTileDigit
private

Definition at line 86 of file CaloTileRetriever.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_sgKey

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

Definition at line 79 of file CaloTileRetriever.h.

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

◆ m_sgKeyTileDigits

SG::ReadHandleKey<TileDigitsContainer> JiveXML::CaloTileRetriever::m_sgKeyTileDigits {this, "TileDigitsContainerKey", "", "Name of the TileDigitsContainer"}
private

Definition at line 80 of file CaloTileRetriever.h.

80{this, "TileDigitsContainerKey", "", "Name of the TileDigitsContainer"};

◆ m_sgKeyTileRawChannel

SG::ReadHandleKey<TileRawChannelContainer> JiveXML::CaloTileRetriever::m_sgKeyTileRawChannel {this, "TileRawChannelContainerKey", "", "Name of the TileRawChannelContainer"}
private

Definition at line 81 of file CaloTileRetriever.h.

81{this, "TileRawChannelContainerKey", "", "Name of the TileRawChannelContainer"};

◆ m_sub

DataVect JiveXML::CaloTileRetriever::m_sub
private

Definition at line 90 of file CaloTileRetriever.h.

◆ m_tile

bool JiveXML::CaloTileRetriever::m_tile
private

Definition at line 85 of file CaloTileRetriever.h.

◆ m_tileBadChanTool

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

Definition at line 73 of file CaloTileRetriever.h.

73 {this,
74 "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 70 of file CaloTileRetriever.h.

70 {this,
71 "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 67 of file CaloTileRetriever.h.

67 {this,
68 "TileCondToolTiming", "TileCondToolTiming", "Tile timing tool"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


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