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

Retrieves all Calo Cluster objects. More...

#include <BadLArRetriever.h>

Inheritance diagram for JiveXML::BadLArRetriever:
Collaboration diagram for JiveXML::BadLArRetriever:

Public Member Functions

 BadLArRetriever (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 getBadLArData (const CaloCellContainer *cellContainer)
 Retrieve LAr 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

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::ReadCondHandleKey< LArOnOffIdMappingm_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
SG::ReadHandleKey< CaloCellContainerm_sgKey {this, "StoreGateKey", "AllCalo", "Name of the CaloCellContainer"}
 for properties
double m_cellThreshold
int m_cellEnergyPrec
bool m_lar
bool m_doBadLAr
bool m_cellConditionCut
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 Calo Cluster objects.

  • Properties
    • StoreGateKey: default is 'AllCalo'. Don't change.
    • LArlCellThreshold: default is 50 (MeV)
    • RetrieveLAr: general flag, default is true
    • CellConditionCut: default is false
      • CellEnergyPrec: precision in int, default is 3 digits
    • DoBadLAr: write LAr bad cell, default is false
  • Retrieved Data
    • location in phi and eta
    • identifier and energy of each cell

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

◆ BadLArRetriever()

JiveXML::BadLArRetriever::BadLArRetriever ( 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 30 of file BadLArRetriever.cxx.

30 :
31 AthAlgTool(type,name,parent),
32 m_calocell_id(nullptr)
33 {
34 //Only declare the interface
35 declareInterface<IDataRetriever>(this);
36
37 declareInterface<IDataRetriever>(this);
38 declareProperty("LArlCellThreshold", m_cellThreshold = 50.);
39 declareProperty("RetrieveLAr" , m_lar = true);
40 declareProperty("DoBadLAr", m_doBadLAr = false);
41 declareProperty("CellConditionCut", m_cellConditionCut = false);
42
43 declareProperty("CellEnergyPrec", m_cellEnergyPrec = 3);
44 }
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const CaloCell_ID * m_calocell_id

Member Function Documentation

◆ dataTypeName()

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

Return the name of the data type.

Implements JiveXML::IDataRetriever.

Definition at line 52 of file BadLArRetriever.h.

52{ return "BadLAr"; };

◆ 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

◆ getBadLArData()

const DataMap JiveXML::BadLArRetriever::getBadLArData ( const CaloCellContainer * cellContainer)

Retrieve LAr bad cell location and details.

Parameters
FormatToolthe tool that will create formated output from the DataMap

Definition at line 89 of file BadLArRetriever.cxx.

89 {
90
91 ATH_MSG_DEBUG( "getBadLArData()" );
92
94 const auto nCells = cellContainer->size();
95 DataVect phi; phi.reserve(nCells);
96 DataVect eta; eta.reserve(nCells);
97 DataVect energy; energy.reserve(nCells);
98 DataVect idVec; idVec.reserve(nCells);
99 DataVect channel; channel.reserve(nCells);
100 DataVect feedThrough; feedThrough.reserve(nCells);
101 DataVect slot; slot.reserve(nCells);
102
103
104 char rndStr[30]; // for rounding (3 digit precision)
107 SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey};
108 const LArOnOffIdMapping* cabling{*cablingHdl};
109 const LArOnlineID* onlineId = nullptr;
110 if ( detStore()->retrieve(onlineId, "LArOnlineID").isFailure()) {
111 ATH_MSG_ERROR( "in getBadLArData(),Could not get LArOnlineID!" );
112 }
113
114 if (m_doBadLAr && cabling) {
115 double energyGeV;
116 ATH_MSG_DEBUG( "Start iterator loop over cells" );
117 for(;it1!=it2;++it1){
118 if( !(*it1)->badcell() ) continue;
119 if ((((*it1)->provenance()&0xFF)!=0xA5)&&m_cellConditionCut) continue; // check full conditions for LAr
120 HWIdentifier LArhwid = cabling->createSignalChannelIDFromHash((*it1)->caloDDE()->calo_hash());
121 energyGeV = (*it1)->energy()*(1./GeV);
122 if (energyGeV == 0) energyGeV = 0.001; // 1 MeV due to LegoCut > 0.0 (couldn't be >= 0.0)
123
124 energy.emplace_back( gcvt( energyGeV, m_cellEnergyPrec, rndStr) );
125 idVec.emplace_back((Identifier::value_type)(*it1)->ID().get_compact() );
126 phi.emplace_back((*it1)->phi());
127 eta.emplace_back((*it1)->eta());
128 channel.emplace_back(onlineId->channel(LArhwid));
129 feedThrough.emplace_back(onlineId->feedthrough(LArhwid));
130 slot.emplace_back(onlineId->slot(LArhwid));
131 } // end cell iterator
132 } // doBadLAr
133 // write values into DataMap
134 const auto nEntries = phi.size();
135 DataMap["phi"] = std::move(phi);
136 DataMap["eta"] = std::move(eta);
137 DataMap["energy"] = std::move(energy);
138 DataMap["id"] = std::move(idVec);
139 DataMap["channel"] = std::move(channel);
140 DataMap["feedThrough"] = std::move(feedThrough);
141 DataMap["slot"] = std::move(slot);
142 //Be verbose
143 ATH_MSG_DEBUG( dataTypeName() << " , collection: " << dataTypeName()
144 << " retrieved with " << nEntries << " entries" );
145
146 //All collections retrieved okay
147 return DataMap;
148
149 } // getBadLArData
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
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
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.
virtual StatusCode retrieve(ToolHandle< IFormatTool > &FormatTool)
Retrieve all the data.
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
int feedthrough(const HWIdentifier id) const
Return the feedthrough of a hardware cell identifier : feedthrough = [0,31] Barrel - A/C side or H/...
int slot(const HWIdentifier id) const
Return the slot number of a hardware cell identifier: slot = [1,15] Slot-ID in top part of the crat...
int channel(const HWIdentifier id) const
Return the channel number of a hardware cell identifier channel = [0,127] in all FEB.
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
setRawEt setRawPhi nCells

◆ initialize()

StatusCode JiveXML::BadLArRetriever::initialize ( )

Default AthAlgTool methods.

Initialise the ToolSvc.

Definition at line 50 of file BadLArRetriever.cxx.

50 {
51
52 ATH_MSG_DEBUG( "Initialising Tool" );
53 ATH_CHECK( detStore()->retrieve (m_calocell_id, "CaloCell_ID") );
54
55 ATH_CHECK(m_sgKey.initialize());
56 ATH_CHECK( m_cablingKey.initialize() );
57
58 return StatusCode::SUCCESS;
59 }
#define ATH_CHECK
Evaluate an expression and check for errors.
SG::ReadHandleKey< CaloCellContainer > m_sgKey
for properties

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

Retrieve all the data.

LAr data retrieval from default collection.

Implements JiveXML::IDataRetriever.

Definition at line 64 of file BadLArRetriever.cxx.

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

SG::ReadCondHandleKey<LArOnOffIdMapping> JiveXML::BadLArRetriever::m_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
private

Definition at line 59 of file BadLArRetriever.h.

59{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};

◆ m_calocell_id

const CaloCell_ID* JiveXML::BadLArRetriever::m_calocell_id
private

Definition at line 58 of file BadLArRetriever.h.

◆ m_cellConditionCut

bool JiveXML::BadLArRetriever::m_cellConditionCut
private

Definition at line 67 of file BadLArRetriever.h.

◆ m_cellEnergyPrec

int JiveXML::BadLArRetriever::m_cellEnergyPrec
private

Definition at line 64 of file BadLArRetriever.h.

◆ m_cellThreshold

double JiveXML::BadLArRetriever::m_cellThreshold
private

Definition at line 63 of file BadLArRetriever.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_doBadLAr

bool JiveXML::BadLArRetriever::m_doBadLAr
private

Definition at line 66 of file BadLArRetriever.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_lar

bool JiveXML::BadLArRetriever::m_lar
private

Definition at line 65 of file BadLArRetriever.h.

◆ m_sgKey

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

for properties

Definition at line 62 of file BadLArRetriever.h.

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

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