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

Retrieves all Tile Calo Cell objects. More...

#include <BadTileRetriever.h>

Inheritance diagram for JiveXML::BadTileRetriever:
Collaboration diagram for JiveXML::BadTileRetriever:

Public Member Functions

 BadTileRetriever (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 getBadTileData (const CaloCellContainer *cellContainer)
 Retrieve Tile bad 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

const CaloCell_IDm_calocell_id
SG::ReadHandleKey< CaloCellContainerm_sgKey {this, "StoreGateKey", "AllCalo", "Name of the CaloCellContainer"}
double m_cellThreshold
int m_cellEnergyPrec
bool m_tile
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
    • CellEnergyPrec: output precision, default is 3 digits
    • DoBadTile: write Tile bad cell, default is false
  • Retrieved Data
    • location in phi and eta
    • identifier and energy of each cell

Definition at line 39 of file BadTileRetriever.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

◆ BadTileRetriever()

JiveXML::BadTileRetriever::BadTileRetriever ( 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 BadTileRetriever.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("DoBadTile", m_doBadTile = false);
47
48 declareProperty("CellEnergyPrec", m_cellEnergyPrec = 3);
49 }
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const CaloCell_ID * m_calocell_id

Member Function Documentation

◆ calcTILELayerSub()

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

Definition at line 129 of file BadTileRetriever.cxx.

130 {
131 if(m_calocell_id->is_tile_barrel(cellid))
132 {
133 if(m_calocell_id->is_tile_negative(cellid))
134 m_sub.emplace_back(2);
135 else
136 m_sub.emplace_back(3);
137 }
138 else if(m_calocell_id->is_tile_extbarrel(cellid))
139 {
140 if(m_calocell_id->is_tile_negative(cellid))
141 m_sub.emplace_back(0);
142 else
143 m_sub.emplace_back(5);
144 }
145 //else in ITC or scint
146 else
147 {
148 if(m_calocell_id->is_tile_negative(cellid))
149 m_sub.emplace_back(1);
150 else
151 m_sub.emplace_back(4);
152 }
153 }

◆ dataTypeName()

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

Return the name of the data type.

Implements JiveXML::IDataRetriever.

Definition at line 52 of file BadTileRetriever.h.

52{ return "BadTILE"; };

◆ 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

◆ getBadTileData()

const DataMap JiveXML::BadTileRetriever::getBadTileData ( const CaloCellContainer * cellContainer)

Retrieve Tile bad cell location and details.

Parameters
FormatToolthe tool that will create formated output from the DataMap

Definition at line 86 of file BadTileRetriever.cxx.

86 {
87 ATH_MSG_DEBUG( "getBadTileData()" );
88 char rndStr[30];
90 DataVect phi; phi.reserve(cellContainer->size());
91 DataVect eta; eta.reserve(cellContainer->size());
92 DataVect idVec; idVec.reserve(cellContainer->size());
93 DataVect energyVec; energyVec.reserve(cellContainer->size());
94 m_sub.clear();
95 //Loop Over CaloCellContainer to retrieve TileCell information
98 if (m_doBadTile==true) {
99 double energyGeV;
100 //int cellInd;
101 ATH_MSG_DEBUG( "Start iterator loop over cells" );
102 for(;it1!=it2;++it1){
103 if( !(*it1)->badcell() ) continue;
104 Identifier cellid = (*it1)->ID();
105 calcTILELayerSub(cellid);
106 energyGeV = (*it1)->energy()*(1./GeV);
107 energyVec.emplace_back( gcvt( energyGeV, m_cellEnergyPrec, rndStr) );
108 idVec.emplace_back( (Identifier::value_type)(*it1)->ID().get_compact() );
109 phi.emplace_back((*it1)->phi());
110 eta.emplace_back((*it1)->eta());
111 } // end cell iterator
112 } // doBadTile
113
114 // write values into DataMap
115 const auto nEntries = phi.size();
116 DataMap["phi"] = std::move(phi);
117 DataMap["eta"] = std::move(eta);
118 DataMap["sub"] = std::move(m_sub);
119 DataMap["id"] = std::move(idVec);
120 DataMap["energy"] = std::move(energyVec);
121 //Be verbose
122 ATH_MSG_DEBUG( dataTypeName() << " retrieved with " << nEntries << " entries" );
123 //All collections retrieved okay
124 return DataMap;
125 } // getTileData
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_DEBUG(x)
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
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
size_type size() const noexcept
Returns the number of elements in the collection.
virtual std::string dataTypeName() const
Return the name of the data type.
void calcTILELayerSub(Identifier &)
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

◆ initialize()

StatusCode JiveXML::BadTileRetriever::initialize ( )

Default AthAlgTool methods.

Initialise the ToolSvc.

Definition at line 55 of file BadTileRetriever.cxx.

55 {
56 ATH_MSG_DEBUG( "Initialising Tool" );
57 ATH_CHECK( detStore()->retrieve (m_calocell_id, "CaloCell_ID") );
58 ATH_CHECK(m_sgKey.initialize());
59 return StatusCode::SUCCESS;
60 }
#define ATH_CHECK
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
SG::ReadHandleKey< CaloCellContainer > m_sgKey
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.

◆ 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::BadTileRetriever::retrieve ( ToolHandle< IFormatTool > & FormatTool)
virtual

Retrieve all the data.

Tile data retrieval from chosen collection.

Implements JiveXML::IDataRetriever.

Definition at line 65 of file BadTileRetriever.cxx.

65 {
66 ATH_MSG_DEBUG( "in retrieve()" );
67 SG::ReadHandle<CaloCellContainer> cellContainer(m_sgKey);
68 if (!cellContainer.isValid()){
69 ATH_MSG_WARNING( "Could not retrieve Calorimeter Cells " );
70 } else {
71 if(m_tile){
72 DataMap data = getBadTileData(&(*cellContainer));
73 ATH_CHECK( FormatTool->AddToEvent(dataTypeName(), m_sgKey.key(), &data) );
74 ATH_MSG_DEBUG( "Bad Tile retrieved" );
75 }
76 }
77 //Tile cells retrieved okay
78 return StatusCode::SUCCESS;
79 }
#define ATH_MSG_WARNING(x)
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
const DataMap getBadTileData(const CaloCellContainer *cellContainer)
Retrieve Tile bad 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::BadTileRetriever::m_calocell_id
private

Definition at line 59 of file BadTileRetriever.h.

◆ m_cellEnergyPrec

int JiveXML::BadTileRetriever::m_cellEnergyPrec
private

Definition at line 63 of file BadTileRetriever.h.

◆ m_cellThreshold

double JiveXML::BadTileRetriever::m_cellThreshold
private

Definition at line 62 of file BadTileRetriever.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::BadTileRetriever::m_doBadTile
private

Definition at line 65 of file BadTileRetriever.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::BadTileRetriever::m_sgKey {this, "StoreGateKey", "AllCalo", "Name of the CaloCellContainer"}
private

Definition at line 61 of file BadTileRetriever.h.

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

◆ m_sub

DataVect JiveXML::BadTileRetriever::m_sub
private

Definition at line 67 of file BadTileRetriever.h.

◆ m_tile

bool JiveXML::BadTileRetriever::m_tile
private

Definition at line 64 of file BadTileRetriever.h.

◆ 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: