ATLAS Offline Software
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Muon::MuonLayerHashProviderTool Class Reference

#include <MuonLayerHashProviderTool.h>

Inheritance diagram for Muon::MuonLayerHashProviderTool:
Collaboration diagram for Muon::MuonLayerHashProviderTool:

Classes

struct  RegionHashesPerSector
 

Public Types

typedef std::vector< IdentifierHashHashVec
 define data structure More...
 
typedef std::vector< HashVecRegionHashVec
 
typedef std::vector< RegionHashVecTechnologyRegionHashVec
 
typedef RegionHashVec::const_iterator RegionHashVecCit
 
typedef std::vector< RegionHashesPerSectorRegionHashesPerSectorVec
 
typedef RegionHashesPerSectorVec::const_iterator RegionHashesPerSectorCit
 

Public Member Functions

const HashVecgetHashes (int sector, MuonStationIndex::TechnologyIndex technologyIndex, unsigned int sectorLayerHash) const
 access hashes for a given sector, technology and layer hash More...
 
const HashVecgetHashes (const Identifier &id) const
 access hashes in a given sector and layer using an identifier More...
 
bool hashInSector (IdentifierHash hash, int sector, MuonStationIndex::TechnologyIndex technologyIndex, unsigned int sectorLayerHash) const
 check whether a collection hash is part of given sector, technology and sector layer hash More...
 
 MuonLayerHashProviderTool (const std::string &type, const std::string &name, const IInterface *parent)
 Default AlgTool functions. More...
 
virtual ~MuonLayerHashProviderTool ()=default
 
StatusCode initialize ()
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 access to tool interface More...
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
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. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

void insertTechnology (const MuonIdHelper &idHelper)
 insert hashes of a given technology More...
 
bool insertTgcs ()
 insert hashes for the tgcs More...
 
void insertHash (const IdentifierHash &hash, const Identifier &id)
 insert a single hash for a given identifier More...
 
void insertHash (int sector, const IdentifierHash &hash, const Identifier &id)
 insert a single hash for a given identifier and sector More...
 
bool initializeSectorMapping ()
 initialize the mapping structure More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

unsigned int m_ntechnologies
 number of technologies More...
 
RegionHashesPerSectorVec m_regionHashesPerSector
 cachaed hash data structure More...
 
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 20 of file MuonLayerHashProviderTool.h.

Member Typedef Documentation

◆ HashVec

define data structure

  • sector
    • technology
      • hashes

Definition at line 27 of file MuonLayerHashProviderTool.h.

◆ RegionHashesPerSectorCit

typedef RegionHashesPerSectorVec::const_iterator Muon::MuonLayerHashProviderTool::RegionHashesPerSectorCit

Definition at line 37 of file MuonLayerHashProviderTool.h.

◆ RegionHashesPerSectorVec

Definition at line 36 of file MuonLayerHashProviderTool.h.

◆ RegionHashVec

Definition at line 28 of file MuonLayerHashProviderTool.h.

◆ RegionHashVecCit

typedef RegionHashVec::const_iterator Muon::MuonLayerHashProviderTool::RegionHashVecCit

Definition at line 30 of file MuonLayerHashProviderTool.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

◆ TechnologyRegionHashVec

Definition at line 29 of file MuonLayerHashProviderTool.h.

Constructor & Destructor Documentation

◆ MuonLayerHashProviderTool()

Muon::MuonLayerHashProviderTool::MuonLayerHashProviderTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Default AlgTool functions.

Definition at line 15 of file MuonLayerHashProviderTool.cxx.

15  :
18  {
19  declareInterface<MuonLayerHashProviderTool>(this);
20 
21  }

◆ ~MuonLayerHashProviderTool()

virtual Muon::MuonLayerHashProviderTool::~MuonLayerHashProviderTool ( )
virtualdefault

Member Function Documentation

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

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

95 { return m_detStore; }

◆ evtStore() [1/2]

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.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ 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

◆ getHashes() [1/2]

const std::vector< IdentifierHash > & Muon::MuonLayerHashProviderTool::getHashes ( const Identifier id) const
inline

access hashes in a given sector and layer using an identifier

Definition at line 90 of file MuonLayerHashProviderTool.h.

90  {
91  MuonStationIndex::DetectorRegionIndex regionIndex = m_idHelperSvc->regionIndex(id);
92  MuonStationIndex::LayerIndex layerIndex = m_idHelperSvc->layerIndex(id);
93  unsigned int sectorLayerHash = MuonStationIndex::sectorLayerHash(regionIndex,layerIndex);
94  return getHashes(m_idHelperSvc->sector(id),m_idHelperSvc->technologyIndex(id),sectorLayerHash);
95  }

◆ getHashes() [2/2]

const std::vector< IdentifierHash > & Muon::MuonLayerHashProviderTool::getHashes ( int  sector,
MuonStationIndex::TechnologyIndex  technologyIndex,
unsigned int  sectorLayerHash 
) const
inline

access hashes for a given sector, technology and layer hash

Definition at line 98 of file MuonLayerHashProviderTool.h.

99  {
100  return m_regionHashesPerSector[sector-1].technologyRegionHashVecs[technologyIndex][sectorLayerHash];
101  }

◆ hashInSector()

bool Muon::MuonLayerHashProviderTool::hashInSector ( IdentifierHash  hash,
int  sector,
MuonStationIndex::TechnologyIndex  technologyIndex,
unsigned int  sectorLayerHash 
) const
inline

check whether a collection hash is part of given sector, technology and sector layer hash

Definition at line 84 of file MuonLayerHashProviderTool.h.

85  {
86  const std::vector<IdentifierHash>& hashes = getHashes(sector,technologyIndex,sectorLayerHash);
87  return std::binary_search(hashes.begin(),hashes.end(),hash);
88  }

◆ initialize()

StatusCode Muon::MuonLayerHashProviderTool::initialize ( )

Definition at line 23 of file MuonLayerHashProviderTool.cxx.

23  {
24 
25  ATH_CHECK(m_idHelperSvc.retrieve());
26 
27  if( !initializeSectorMapping() ){
28  ATH_MSG_ERROR("Failed to initialize sector mapping");
29  return StatusCode::FAILURE;
30  }
31 
32  return StatusCode::SUCCESS;
33  }

◆ initializeSectorMapping()

bool Muon::MuonLayerHashProviderTool::initializeSectorMapping ( )
private

initialize the mapping structure

Definition at line 108 of file MuonLayerHashProviderTool.cxx.

108  {
109 
110  m_ntechnologies = m_idHelperSvc->mdtIdHelper().technologyNameIndexMax()+1;
112  // set sector numbers
113  unsigned int nsectorHashMax = MuonStationIndex::sectorLayerHashMax();
114  for( unsigned int i=0;i<m_regionHashesPerSector.size();++i ) {
115  m_regionHashesPerSector[i].sector=i+1;
116  m_regionHashesPerSector[i].technologyRegionHashVecs.resize(MuonStationIndex::TechnologyIndexMax);
117  for( auto it = m_regionHashesPerSector[i].technologyRegionHashVecs.begin();it!=m_regionHashesPerSector[i].technologyRegionHashVecs.end(); ++it ) {
118  it->resize(nsectorHashMax);
119  }
120  }
121  ATH_MSG_DEBUG("Initializing hashes: number of sectors " << MuonStationIndex::numberOfSectors()
122  << " technologies " << m_ntechnologies << " sectorLayers " << MuonStationIndex::sectorLayerHashMax() );
123 
124  // add technologies
125  if (m_idHelperSvc->hasMDT()) insertTechnology(m_idHelperSvc->mdtIdHelper());
126  if (m_idHelperSvc->hasRPC()) insertTechnology(m_idHelperSvc->rpcIdHelper());
127  if (m_idHelperSvc->hasCSC()) insertTechnology(m_idHelperSvc->cscIdHelper());
128  if (m_idHelperSvc->hasMM()) insertTechnology(m_idHelperSvc->mmIdHelper());
129  if (m_idHelperSvc->hasSTGC()) insertTechnology(m_idHelperSvc->stgcIdHelper());
130 
131  if( !insertTgcs() ) return false;
132 
133  if( msgLvl(MSG::DEBUG) ) msg(MSG::DEBUG) << " Printing collections per sector, number of technologies " << m_ntechnologies;
134  for( int sector = 1; sector<=16; ++sector ){
136  if( msgLvl(MSG::DEBUG) ) msg(MSG::DEBUG) << " sector " << sector;
137  TechnologyRegionHashVec& vec = m_regionHashesPerSector[sector-1].technologyRegionHashVecs;
138  for( unsigned int hash = 0; hash < nsectorHashMax; ++hash ){
139  std::pair<MuonStationIndex::DetectorRegionIndex,MuonStationIndex::LayerIndex> regionLayer = MuonStationIndex::decomposeSectorLayerHash(hash);
140  if( msgLvl(MSG::DEBUG) ) if( regionLayer.first != currentRegion ) msg(MSG::DEBUG) << std::endl << " " << MuonStationIndex::regionName(regionLayer.first);
141  bool first = true;
142  currentRegion = regionLayer.first;
143  for( unsigned int tech=0; tech<m_ntechnologies;++tech ){
144  std::stable_sort(vec[tech][hash].begin(),vec[tech][hash].end());
145  if( !vec[tech][hash].empty() ) {
146  if( msgLvl(MSG::DEBUG) ) {
147  if( first ) {
148  msg(MSG::DEBUG) << " " << std::setw(7) << MuonStationIndex::layerName(regionLayer.second);
149  first = false;
150  }
151  msg(MSG::DEBUG) << " " << std::setw(4) << MuonStationIndex::technologyName(static_cast<MuonStationIndex::TechnologyIndex>(tech))
152  << " " << std::setw(4) << vec[tech][hash].size();
153  }
154  }
155  }
156  }
157  if( msgLvl(MSG::DEBUG) ) msg(MSG::DEBUG) << std::endl;
158  }
160 
161  return true;
162  }

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

◆ insertHash() [1/2]

void Muon::MuonLayerHashProviderTool::insertHash ( const IdentifierHash hash,
const Identifier id 
)
private

insert a single hash for a given identifier

Definition at line 36 of file MuonLayerHashProviderTool.cxx.

36  {
37  insertHash(m_idHelperSvc->sector(id),hash,id);
38  }

◆ insertHash() [2/2]

void Muon::MuonLayerHashProviderTool::insertHash ( int  sector,
const IdentifierHash hash,
const Identifier id 
)
private

insert a single hash for a given identifier and sector

Definition at line 40 of file MuonLayerHashProviderTool.cxx.

40  {
41  MuonStationIndex::TechnologyIndex techIndex = m_idHelperSvc->technologyIndex(id);
42  int sectorLayerHash = MuonStationIndex::sectorLayerHash(m_idHelperSvc->regionIndex(id),m_idHelperSvc->layerIndex(id));
43  m_regionHashesPerSector[sector-1].technologyRegionHashVecs[techIndex][sectorLayerHash].push_back(hash);
44  }

◆ insertTechnology()

void Muon::MuonLayerHashProviderTool::insertTechnology ( const MuonIdHelper idHelper)
private

insert hashes of a given technology

Definition at line 46 of file MuonLayerHashProviderTool.cxx.

46  {
47 
48  // loop over all available STGC collection identifiers and order them per sector
50  MuonIdHelper::const_id_iterator it_end = idHelper.module_end();
51  for( ;it!=it_end; ++it ){
53  idHelper.get_module_hash(*it,hash);
54  insertHash(hash,*it);
55  }
56 
57  }

◆ insertTgcs()

bool Muon::MuonLayerHashProviderTool::insertTgcs ( )
private

insert hashes for the tgcs

Definition at line 59 of file MuonLayerHashProviderTool.cxx.

59  {
60 
61  // the tgc's can be in multiple sectors so we need to do something special here
62  const MuonGM::MuonDetectorManager* detMgr = nullptr;
63  if( detStore()->retrieve( detMgr ).isFailure() || !detMgr ){
64  ATH_MSG_ERROR("Failed to initialize detector manager" );
65  return false;
66  }
67 
68  MuonSectorMapping sectorMapping;
69 
70  // loop over all available TGC collection identifiers and order them per sector
71  MuonIdHelper::const_id_iterator it = m_idHelperSvc->tgcIdHelper().module_begin();
72  MuonIdHelper::const_id_iterator it_end = m_idHelperSvc->tgcIdHelper().module_end();
73  for( ;it!=it_end; ++it ){
74  const MuonGM::TgcReadoutElement* detEl = detMgr->getTgcReadoutElement(*it);
75  if( !detEl ) {
76  ATH_MSG_DEBUG(" No detector element found for " << m_idHelperSvc->toString(*it) );
77  continue;
78  }
79  const IdentifierHash hash = m_idHelperSvc->moduleHash(*it);
80  int nstrips = detEl->nStrips(1);
81  Amg::Vector3D p1 = detEl->channelPos(1,1,1);
82  Amg::Vector3D p2 = detEl->channelPos(1,1,nstrips);
83  std::vector<int> sectors1;
84  sectorMapping.getSectors(p1.phi(),sectors1);
85  std::set<int> added;
86  std::vector<int>::iterator sit = sectors1.begin();
87  std::vector<int>::iterator sit_end = sectors1.end();
88  for( ;sit!=sit_end; ++sit ){
89  insertHash(*sit,hash,*it);
90  added.insert(*sit);
91  }
92 
93  std::vector<int> sectors2;
94  sectorMapping.getSectors(p2.phi(),sectors2);
95  sit = sectors2.begin();
96  sit_end = sectors2.end();
97  for( ;sit!=sit_end; ++sit ){
98  if( added.count(*sit) ) continue;
99  added.insert(*sit);
100  insertHash(*sit,hash,*it);
101  }
102  }
103 
104  return true;
105  }

◆ interfaceID()

static const InterfaceID& Muon::MuonLayerHashProviderTool::interfaceID ( )
inlinestatic

access to tool interface

Definition at line 54 of file MuonLayerHashProviderTool.h.

54 { return IID_MuonLayerHashProviderTool; }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ 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();
383  PBASE::renounce (h);
384  }

◆ 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  {
365  handlesArray.renounce();
366  }

◆ 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 DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ 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) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ 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_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_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> Muon::MuonLayerHashProviderTool::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 80 of file MuonLayerHashProviderTool.h.

◆ m_ntechnologies

unsigned int Muon::MuonLayerHashProviderTool::m_ntechnologies
private

number of technologies

Definition at line 75 of file MuonLayerHashProviderTool.h.

◆ m_regionHashesPerSector

RegionHashesPerSectorVec Muon::MuonLayerHashProviderTool::m_regionHashesPerSector
private

cachaed hash data structure

Definition at line 78 of file MuonLayerHashProviderTool.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:
python.root_lsr_rank.hashes
hashes
Definition: root_lsr_rank.py:34
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
Muon::MuonLayerHashProviderTool::m_ntechnologies
unsigned int m_ntechnologies
number of technologies
Definition: MuonLayerHashProviderTool.h:75
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Muon::MuonLayerHashProviderTool::m_regionHashesPerSector
RegionHashesPerSectorVec m_regionHashesPerSector
cachaed hash data structure
Definition: MuonLayerHashProviderTool.h:78
Muon::MuonLayerHashProviderTool::insertTgcs
bool insertTgcs()
insert hashes for the tgcs
Definition: MuonLayerHashProviderTool.cxx:59
Muon::MuonStationIndex::sectorLayerHashMax
static unsigned int sectorLayerHashMax()
maximum create a hash out of region and layer
Definition: MuonStationIndex.cxx:231
Muon::MuonStationIndex::LayerIndex
LayerIndex
enum to classify the different layers in the muon spectrometer
Definition: MuonStationIndex.h:38
Muon::MuonStationIndex::sectorLayerHash
static unsigned int sectorLayerHash(DetectorRegionIndex detectorRegionIndex, LayerIndex layerIndex)
create a hash out of region and layer
Definition: MuonStationIndex.cxx:226
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
skel.it
it
Definition: skel.GENtoEVGEN.py:423
Muon::MuonLayerHashProviderTool::getHashes
const HashVec & getHashes(int sector, MuonStationIndex::TechnologyIndex technologyIndex, unsigned int sectorLayerHash) const
access hashes for a given sector, technology and layer hash
Definition: MuonLayerHashProviderTool.h:98
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
MuonIdHelper::module_end
const_id_iterator module_end() const
Definition: MuonIdHelper.cxx:760
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
Muon::MuonLayerHashProviderTool::insertTechnology
void insertTechnology(const MuonIdHelper &idHelper)
insert hashes of a given technology
Definition: MuonLayerHashProviderTool.cxx:46
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
std::stable_sort
void stable_sort(std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, std::reverse_iterator< DataModel_detail::iterator< DVL > > end, Compare comp)
Specialization of stable_sort for DataVector/List.
Definition: DVL_algorithms.h:711
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
MuonGM::TgcReadoutElement::channelPos
Amg::Vector3D channelPos(const Identifier &id) const
Returns the position of the active channel (wireGang or strip)
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
Muon::MuonStationIndex::numberOfSectors
static unsigned int numberOfSectors()
return total number of sectors
Definition: MuonStationIndex.h:106
MuonGM::MuonDetectorManager::getTgcReadoutElement
const TgcReadoutElement * getTgcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:247
Muon::MuonStationIndex::decomposeSectorLayerHash
static std::pair< DetectorRegionIndex, LayerIndex > decomposeSectorLayerHash(unsigned int hash)
decompose the hash into Region and Layer
Definition: MuonStationIndex.cxx:237
Muon::MuonStationIndex::regionName
static const std::string & regionName(DetectorRegionIndex index)
convert DetectorRegionIndex into a string
Definition: MuonStationIndex.cxx:176
Muon::MuonLayerHashProviderTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonLayerHashProviderTool.h:80
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:92
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MuonIdHelper::get_module_hash
virtual int get_module_hash(const Identifier &id, IdentifierHash &hash_id) const
Definition: MuonIdHelper.cxx:98
Muon::MuonStationIndex::DetectorRegionUnknown
@ DetectorRegionUnknown
Definition: MuonStationIndex.h:48
MuonGM::TgcReadoutElement
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/TgcReadoutElement.h:42
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Muon::MuonLayerHashProviderTool::initializeSectorMapping
bool initializeSectorMapping()
initialize the mapping structure
Definition: MuonLayerHashProviderTool.cxx:108
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Muon::MuonStationIndex::layerName
static const std::string & layerName(LayerIndex index)
convert LayerIndex into a string
Definition: MuonStationIndex.cxx:192
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
MuonGM::TgcReadoutElement::nStrips
int nStrips(int gasGap) const
Returns the number of strips in a given gas gap.
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
Muon::MuonStationIndex::DetectorRegionIndex
DetectorRegionIndex
enum to classify the different layers in the muon spectrometer
Definition: MuonStationIndex.h:47
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
a
TList * a
Definition: liststreamerinfos.cxx:10
h
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:49
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DeMoScan.first
bool first
Definition: DeMoScan.py:534
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
Muon::MuonStationIndex::TechnologyIndexMax
@ TechnologyIndexMax
Definition: MuonStationIndex.h:57
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
MuonIdHelper::const_id_iterator
std::vector< Identifier >::const_iterator const_id_iterator
Definition: MuonIdHelper.h:143
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
Muon::MuonLayerHashProviderTool::TechnologyRegionHashVec
std::vector< RegionHashVec > TechnologyRegionHashVec
Definition: MuonLayerHashProviderTool.h:29
MuonIdHelper::module_begin
const_id_iterator module_begin() const
Iterators over full set of ids.
Definition: MuonIdHelper.cxx:758
IdentifierHash
Definition: IdentifierHash.h:38
Muon::MuonStationIndex::TechnologyIndex
TechnologyIndex
enum to classify the different layers in the muon spectrometer
Definition: MuonStationIndex.h:54
Muon::MuonLayerHashProviderTool::insertHash
void insertHash(const IdentifierHash &hash, const Identifier &id)
insert a single hash for a given identifier
Definition: MuonLayerHashProviderTool.cxx:36
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528
Muon::MuonStationIndex::technologyName
static const std::string & technologyName(TechnologyIndex index)
convert LayerIndex into a string
Definition: MuonStationIndex.cxx:209