ATLAS Offline Software
Loading...
Searching...
No Matches
HLTCaloGlobalCellMaker Class Reference

#include <HLTCaloGlobalCellMaker.h>

Inheritance diagram for HLTCaloGlobalCellMaker:
Collaboration diagram for HLTCaloGlobalCellMaker:

Public Member Functions

 HLTCaloGlobalCellMaker (std::string const &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize () override
virtual StatusCode execute (EventContext const &context) const override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
virtual void setFilterPassed (bool state, const EventContext &ctx) const
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 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

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

SG::ReadHandleKey< CaloConstCellContainerm_inputCellContainerKey
SG::WriteHandleKey< CaloConstCellContainerm_outputCellContainerKey
Gaudi::Property< float > m_NumberOfSigma { this, "NumberOfSigma", 2.0, "Number of Sigma Above Noise" }
Gaudi::Property< uint32_t > m_MaxNCellsPerFEB { this, "MaxNCellsPerFEB", 30, "Maximum Number Cells Per FEB" }
const CaloCell_IDm_caloCell_ID {nullptr}
const LArOnlineIDm_onlineId {nullptr}
SG::ReadCondHandleKey< LArOnOffIdMappingm_onOffIdMappingKey {this, "CablingKey", "LArOnOffIdMap", "SG Key for LArOnOffIdMapping"}
SG::ReadCondHandleKey< CaloNoisem_noiseCDOKey {this,"CaloNoiseKey","totalNoise","SG Key of CaloNoise data object"}
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
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

Definition at line 18 of file HLTCaloGlobalCellMaker.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ HLTCaloGlobalCellMaker()

HLTCaloGlobalCellMaker::HLTCaloGlobalCellMaker ( std::string const & name,
ISvcLocator * pSvcLocator )

Definition at line 15 of file HLTCaloGlobalCellMaker.cxx.

16 : AthReentrantAlgorithm(name, pSvcLocator) {
17}

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

62{
63 return 0;
64}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

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

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode HLTCaloGlobalCellMaker::execute ( EventContext const & context) const
overridevirtual

Definition at line 31 of file HLTCaloGlobalCellMaker.cxx.

31 {
32 ATH_MSG_DEBUG("HLTCaloGlobalCellMaker::execute()");
33
34 SG::ReadHandle<CaloConstCellContainer> inputCellHandle(m_inputCellContainerKey, context);
35
36 SG::WriteHandle<CaloConstCellContainer> outputCellHandle(m_outputCellContainerKey, context);
37
38 SG::ReadCondHandle<CaloNoise> noiseHdl{m_noiseCDOKey,context};
39 const CaloNoise* noiseCDO=*noiseHdl;
40 SG::ReadCondHandle<LArOnOffIdMapping> onoff (m_onOffIdMappingKey, context);
41
42 auto outputCells = std::make_unique<CaloConstCellContainer>();
43 uint32_t n_febs = m_onlineId->febHashMax();
44 std::map<HWIdentifier,std::vector<uint16_t> > cells_idx_per_feb;
45 std::map<HWIdentifier,uint16_t > maxcell_idx_per_feb;
46 constexpr uint16_t maxidx = 129;
47 for(uint32_t i=0;i<n_febs;i++){
48 HWIdentifier feb_id = m_onlineId->feb_Id(IdentifierHash(i));
49 maxcell_idx_per_feb[feb_id]=maxidx;
50 }
51
52 // Get all channels which are above a given sigma cut (usually 2) and
53 // organize them in vectors.
54 for (auto const* cell : *inputCellHandle) {
55 if (!cell->caloDDE()->is_tile() ){
56 Identifier cellID = cell->ID();
57 float noiseSigma = noiseCDO->getNoise(cellID,cell->gain());
58 IdentifierHash offhashid = m_caloCell_ID->calo_cell_hash(cellID);
59 HWIdentifier hwid = (*onoff)->createSignalChannelIDFromHash(offhashid);
60 HWIdentifier hwid_feb = m_onlineId->feb_Id(hwid);
61 uint16_t channel = m_onlineId->channel(hwid);
62 if ( cell->energy() > m_NumberOfSigma*noiseSigma ) {
63 cells_idx_per_feb[hwid_feb].push_back(channel);
64 }
65 }
66 }
67
68 // impose the channel order. One might want to have other organizations.
69 // Here, I assume channel order. Only worth to manipulate if above
70 // a given number
71 for(uint32_t i=0;i<n_febs;i++){
72 HWIdentifier hwid_feb = m_onlineId->feb_Id(IdentifierHash(i));
73 std::vector<uint16_t>& indexes = cells_idx_per_feb[hwid_feb];
74 if ( indexes.size() < m_MaxNCellsPerFEB ) continue;
75 std::sort(indexes.begin(),indexes.end());
76 // This is the maximal channel number that will be accepted in
77 // a given FEB
78 maxcell_idx_per_feb[hwid_feb]=indexes[m_MaxNCellsPerFEB-1];
79 }
80
81 for (auto const* cell : *inputCellHandle) {
82 if (cell->caloDDE()->is_tile() ){
83 std::unique_ptr<CaloCell> copy = cell->clone();
84 outputCells->push_back(std::move(copy));
85 } else {
86 Identifier cellID = cell->ID();
87 float noiseSigma = noiseCDO->getNoise(cellID,cell->gain());
88 IdentifierHash offhashid = m_caloCell_ID->calo_cell_hash(cellID);
89 HWIdentifier hwid = (*onoff)->createSignalChannelIDFromHash(offhashid);
90 HWIdentifier hwid_feb = m_onlineId->feb_Id(hwid);
91 uint16_t channel = m_onlineId->channel(hwid);
92 // remember, by default, no channel number is above 128
93 if ( (cell->energy() > m_NumberOfSigma*noiseSigma) && (channel <= maxcell_idx_per_feb[hwid_feb]) ) {
94 std::unique_ptr<CaloCell> copy = cell->clone();
95 outputCells->push_back(std::move(copy));
96 }
97 }
98 }
99
101 if (inputCellHandle->hasCalo(id))
102 outputCells->setHasCalo(id);
103
104 outputCells->updateCaloIterators();
105
106 ATH_CHECK(outputCellHandle.record(std::move(outputCells)));
107
108 return StatusCode::SUCCESS;
109}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
float getNoise(const IdentifierHash h, const int gain) const
Accessor by IdentifierHash and gain.
Definition CaloNoise.h:35
Gaudi::Property< uint32_t > m_MaxNCellsPerFEB
SG::ReadCondHandleKey< LArOnOffIdMapping > m_onOffIdMappingKey
SG::WriteHandleKey< CaloConstCellContainer > m_outputCellContainerKey
SG::ReadHandleKey< CaloConstCellContainer > m_inputCellContainerKey
Gaudi::Property< float > m_NumberOfSigma
const CaloCell_ID * m_caloCell_ID
const LArOnlineID * m_onlineId
SG::ReadCondHandleKey< CaloNoise > m_noiseCDOKey
bool copy
Definition calibdata.py:26
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
setWord1 uint16_t
setEventNumber uint32_t

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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

◆ extraOutputDeps()

const DataObjIDColl & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

88{
89 // If we didn't find any symlinks to add, just return the collection
90 // from the base class. Otherwise, return the extended collection.
91 if (!m_extendedExtraObjects.empty()) {
93 }
95}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ initialize()

StatusCode HLTCaloGlobalCellMaker::initialize ( )
overridevirtual

Definition at line 19 of file HLTCaloGlobalCellMaker.cxx.

19 {
20
21 ATH_CHECK( detStore()->retrieve(m_onlineId,"LArOnlineID") );
22 ATH_CHECK( detStore()->retrieve(m_caloCell_ID) );
23 ATH_CHECK( m_onOffIdMappingKey.initialize() );
24 ATH_CHECK(m_noiseCDOKey.initialize());
27
28 return StatusCode::SUCCESS;
29}
const ServiceHandle< StoreGateSvc > & detStore() const

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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.

◆ isClonable()

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

75{
76 return BaseAlg::sysExecute (ctx);
77}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

105 {
107
108 if (sc.isFailure()) {
109 return sc;
110 }
111
112 ServiceHandle<ICondSvc> cs("CondSvc",name());
113 for (auto h : outputHandles()) {
114 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
115 // do this inside the loop so we don't create the CondSvc until needed
116 if ( cs.retrieve().isFailure() ) {
117 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
118 return StatusCode::SUCCESS;
119 }
120 if (cs->regHandle(this,*h).isFailure()) {
122 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
123 << " with CondSvc");
124 }
125 }
126 }
127 return sc;
128}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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 }

Member Data Documentation

◆ m_caloCell_ID

const CaloCell_ID* HLTCaloGlobalCellMaker::m_caloCell_ID {nullptr}
private

Definition at line 39 of file HLTCaloGlobalCellMaker.h.

39{nullptr};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_inputCellContainerKey

SG::ReadHandleKey<CaloConstCellContainer> HLTCaloGlobalCellMaker::m_inputCellContainerKey
private
Initial value:
{
this, "InputCellKey", "HLTCaloCellInput", "" }

Definition at line 26 of file HLTCaloGlobalCellMaker.h.

26 {
27 this, "InputCellKey", "HLTCaloCellInput", "" };

◆ m_MaxNCellsPerFEB

Gaudi::Property<uint32_t> HLTCaloGlobalCellMaker::m_MaxNCellsPerFEB { this, "MaxNCellsPerFEB", 30, "Maximum Number Cells Per FEB" }
private

Definition at line 33 of file HLTCaloGlobalCellMaker.h.

33{ this, "MaxNCellsPerFEB", 30, "Maximum Number Cells Per FEB" };

◆ m_noiseCDOKey

SG::ReadCondHandleKey<CaloNoise> HLTCaloGlobalCellMaker::m_noiseCDOKey {this,"CaloNoiseKey","totalNoise","SG Key of CaloNoise data object"}
private

Definition at line 42 of file HLTCaloGlobalCellMaker.h.

42{this,"CaloNoiseKey","totalNoise","SG Key of CaloNoise data object"};

◆ m_NumberOfSigma

Gaudi::Property<float> HLTCaloGlobalCellMaker::m_NumberOfSigma { this, "NumberOfSigma", 2.0, "Number of Sigma Above Noise" }
private

Definition at line 32 of file HLTCaloGlobalCellMaker.h.

32{ this, "NumberOfSigma", 2.0, "Number of Sigma Above Noise" };

◆ m_onlineId

const LArOnlineID* HLTCaloGlobalCellMaker::m_onlineId {nullptr}
private

Definition at line 40 of file HLTCaloGlobalCellMaker.h.

40{nullptr};

◆ m_onOffIdMappingKey

SG::ReadCondHandleKey<LArOnOffIdMapping> HLTCaloGlobalCellMaker::m_onOffIdMappingKey {this, "CablingKey", "LArOnOffIdMap", "SG Key for LArOnOffIdMapping"}
private

Definition at line 41 of file HLTCaloGlobalCellMaker.h.

41{this, "CablingKey", "LArOnOffIdMap", "SG Key for LArOnOffIdMapping"} ;

◆ m_outputCellContainerKey

SG::WriteHandleKey<CaloConstCellContainer> HLTCaloGlobalCellMaker::m_outputCellContainerKey
private
Initial value:
{
this, "OutputCellKey", "HLTCaloCellOutput", "" }

Definition at line 29 of file HLTCaloGlobalCellMaker.h.

29 {
30 this, "OutputCellKey", "HLTCaloCellOutput", "" };

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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