ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
MuonCalib::IdToFixedIdTool Class Reference

#include <IdToFixedIdTool.h>

Inheritance diagram for MuonCalib::IdToFixedIdTool:
Collaboration diagram for MuonCalib::IdToFixedIdTool:

Public Member Functions

 IdToFixedIdTool (const std::string &type, const std::string &name, const IInterface *parent)
 AlgTool constructor. More...
 
virtual ~IdToFixedIdTool ()=default
 
virtual StatusCode initialize () override
 IdToFixedIdTool initialization: retrieve all the IdHelpers needed to do strap the ATHENA Identifier. More...
 
void print (const Identifier &id) const override
 print method to output an ATHENA Identifier, warning the user when the conversion and reconversion yields different results. More...
 
void print (const MuonFixedId &fid) const override
 dump MuonFixedId More...
 
void print (const MuonFixedLongId &fid) const override
 dump MuonFixedLongId More...
 
Identifier fixedIdToId (const MuonFixedId &fid) const override
 Convert MuonFixedId to ATHENA Identifier. More...
 
MuonFixedId idToFixedId (const Identifier &id) const override
 Convert ATHENA Identifier to MuonFixedId. More...
 
Identifier fixedLongIdToId (const MuonFixedLongId &fid) const override
 Convert MuonFixedLongId to ATHENA Identifier. More...
 
MuonFixedLongId idToFixedLongId (const Identifier &id) const override
 Convert ATHENA Identifier to MuonFixedLongId. More...
 
Identifier regionKeyToId (std::string region) const override
 Returns an ATHENA Identifier for a given Region key. More...
 
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 ()
 retrieve Interface ID 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

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

ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 
int m_print_level
 Sets printlevel of output. More...
 
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

Tool responsible for wrapping the athena dependent Identifier class to a standalone Calib-EDM MuonFixedId identifier.

The athena-dependent Indentifier relies on idHelpers in order to decode the content. A MuonFixedId has methods itself to decode the content of the identifier.

Author
Zdenk.nosp@m.o.Va.nosp@m.n.Kes.nosp@m.tere.nosp@m.n@cer.nosp@m.n.ch

Definition at line 47 of file IdToFixedIdTool.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

◆ IdToFixedIdTool()

MuonCalib::IdToFixedIdTool::IdToFixedIdTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

AlgTool constructor.

Definition at line 16 of file IdToFixedIdTool.cxx.

16  :
17  AthAlgTool(t, n, p), m_print_level(0) {
18  declareInterface<IIdToFixedIdTool>(this);
19  declareProperty("print_level", m_print_level);
20  }

◆ ~IdToFixedIdTool()

virtual MuonCalib::IdToFixedIdTool::~IdToFixedIdTool ( )
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

◆ fixedIdToId()

Identifier MuonCalib::IdToFixedIdTool::fixedIdToId ( const MuonFixedId fid) const
overridevirtual

Convert MuonFixedId to ATHENA Identifier.

Implements MuonCalib::IIdToFixedIdTool.

Definition at line 88 of file IdToFixedIdTool.cxx.

88  {
90  if (fid.is_mdt()) {
91  tmp = m_idHelperSvc->mdtIdHelper().channelID(fid.stationNameString(), fid.eta(), fid.phi(), fid.mdtMultilayer(),
92  fid.mdtTubeLayer(), fid.mdtTube());
93  } else if (fid.is_rpc()) {
94  tmp =
95  m_idHelperSvc->rpcIdHelper().channelID(fid.stationNameString(), fid.eta(), fid.phi(), fid.rpcDoubletR(), fid.rpcDoubletZ(),
96  fid.rpcDoubletPhi(), fid.rpcGasGap(), fid.rpcMeasuresPhi(), fid.rpcStrip());
97  } else if (m_idHelperSvc->hasCSC() && fid.is_csc()) {
98  tmp = m_idHelperSvc->cscIdHelper().channelID(fid.stationNameString(), fid.eta(), fid.phi(), fid.cscChamberLayer(),
99  fid.cscWireLayer(), fid.cscMeasuresPhi(), fid.cscStrip());
100  } else if (fid.is_tgc()) {
101  tmp = m_idHelperSvc->tgcIdHelper().channelID(fid.stationNameString(), fid.eta(), fid.phi(), fid.tgcGasGap(), fid.tgcIsStrip(),
102  fid.tgcChannel());
103  }
104  return tmp;
105  }

◆ fixedLongIdToId()

Identifier MuonCalib::IdToFixedIdTool::fixedLongIdToId ( const MuonFixedLongId fid) const
overridevirtual

Convert MuonFixedLongId to ATHENA Identifier.

Implements MuonCalib::IIdToFixedIdTool.

Definition at line 206 of file IdToFixedIdTool.cxx.

206  {
207  Identifier tmp;
208  if (fid.is_mdt()) {
209  tmp = m_idHelperSvc->mdtIdHelper().channelID(std::string(fid.stationNameString()), fid.eta(), fid.phi(), fid.mdtMultilayer(),
210  fid.mdtTubeLayer(), fid.mdtTube());
211  } else if (fid.is_rpc()) {
212  tmp =
213  m_idHelperSvc->rpcIdHelper().channelID(std::string(fid.stationNameString()), fid.eta(), fid.phi(), fid.rpcDoubletR(), fid.rpcDoubletZ(),
214  fid.rpcDoubletPhi(), fid.rpcGasGap(), fid.rpcMeasuresPhi(), fid.rpcStrip());
215  } else if (m_idHelperSvc->hasCSC() && fid.is_csc()) {
216  tmp = m_idHelperSvc->cscIdHelper().channelID(std::string(fid.stationNameString()), fid.eta(), fid.phi(), fid.cscChamberLayer(),
217  fid.cscWireLayer(), fid.cscMeasuresPhi(), fid.cscStrip());
218  } else if (fid.is_tgc()) {
219  tmp = m_idHelperSvc->tgcIdHelper().channelID(std::string(fid.stationNameString()), fid.eta(), fid.phi(), fid.tgcGasGap(), fid.tgcIsStrip(),
220  fid.tgcChannel());
221  } else if (fid.is_mmg()) {
222  tmp = m_idHelperSvc->mmIdHelper().channelID(std::string(fid.stationNameString()), fid.eta(), fid.phi(),
223  fid.mmgMultilayer(), fid.mmgGasGap(), fid.mmgStrip());
224  } else if (fid.is_stg()) {
225  // Convert the channel type enum
226  sTgcIdHelper::sTgcChannelTypes channelType = sTgcIdHelper::sTgcChannelTypes::Pad;
227  switch (fid.stgChannelType()) {
228  case MuonFixedLongId::StgChannelType::stgChannelPad:
229  channelType = sTgcIdHelper::sTgcChannelTypes::Pad;
230  break;
231  case MuonFixedLongId::StgChannelType::stgChannelStrip:
232  channelType = sTgcIdHelper::sTgcChannelTypes::Strip;
233  break;
234  case MuonFixedLongId::StgChannelType::stgChannelWire:
235  channelType = sTgcIdHelper::sTgcChannelTypes::Wire;
236  break;
237  default:
238  ATH_MSG_WARNING("Cannot convert StgChannelType");
239  break;
240  }
241  tmp = m_idHelperSvc->stgcIdHelper().channelID(std::string(fid.stationNameString()), fid.eta(), fid.phi(),
242  fid.stgMultilayer(), fid.stgGasGap(), channelType, fid.stgChannel());
243  }
244  return tmp;
245  }

◆ idToFixedId()

MuonFixedId MuonCalib::IdToFixedIdTool::idToFixedId ( const Identifier id) const
overridevirtual

Convert ATHENA Identifier to MuonFixedId.

Implements MuonCalib::IIdToFixedIdTool.

Definition at line 28 of file IdToFixedIdTool.cxx.

28  {
29  bool done{false};
30  MuonFixedId fixedId;
31 
32  if (!(m_idHelperSvc->isMuon(id))) {
33  ATH_MSG_DEBUG(" MuonIdentifier doesn't correspond to a muon ");
34  } else {
35  // setting the Muon specific fields
36  done = fixedId.setStationName(fixedId.stationStringToFixedStationNumber(
37  m_idHelperSvc->mdtIdHelper().stationNameString(m_idHelperSvc->mdtIdHelper().stationName(id))));
38  if (!done) ATH_MSG_INFO("Something went wrong in the conversion id->fid (general) ");
39  if (m_idHelperSvc->isMdt(id)) {
40  done = fixedId.setTechnology(0); // MDT = 0;
41  // setting the Mdt specific fields
42  if (done) done = fixedId.setStationEta(m_idHelperSvc->mdtIdHelper().stationEta(id));
43  if (done) done = fixedId.setStationPhi(m_idHelperSvc->mdtIdHelper().stationPhi(id));
44 
45  if (done) done = fixedId.setMdtTube(m_idHelperSvc->mdtIdHelper().tube(id));
46  if (done) done = fixedId.setMdtTubeLayer(m_idHelperSvc->mdtIdHelper().tubeLayer(id));
47  if (done) done = fixedId.setMdtMultilayer(m_idHelperSvc->mdtIdHelper().multilayer(id));
48  if (!done) ATH_MSG_INFO("Something went wrong in the conversion id->fid (MDT) ");
49  } else if (m_idHelperSvc->isRpc(id)) {
50  done = fixedId.setTechnology(3); // RPC = 3;
51  // setting the Rpc specific fields
52  if (done) done = fixedId.setStationEta(m_idHelperSvc->rpcIdHelper().stationEta(id));
53  if (done) done = fixedId.setStationPhi(m_idHelperSvc->rpcIdHelper().stationPhi(id));
54 
55  if (done) done = fixedId.setRpcDoubletR(m_idHelperSvc->rpcIdHelper().doubletR(id));
56  if (done) done = fixedId.setRpcDoubletZ(m_idHelperSvc->rpcIdHelper().doubletZ(id));
57  if (done) done = fixedId.setRpcDoubletPhi(m_idHelperSvc->rpcIdHelper().doubletPhi(id));
58  if (done) done = fixedId.setRpcGasGap(m_idHelperSvc->rpcIdHelper().gasGap(id));
59  if (done) done = fixedId.setRpcMeasuresPhi(m_idHelperSvc->rpcIdHelper().measuresPhi(id));
60  if (done) done = fixedId.setRpcStrip(m_idHelperSvc->rpcIdHelper().strip(id));
61  if (!done) ATH_MSG_INFO("Something went wrong in the conversion id->fid (RPC) ");
62  } else if (m_idHelperSvc->isCsc(id)) {
63  done = fixedId.setTechnology(1); // CSC = 1;
64  // setting the Csc specific fields
65  if (done) done = fixedId.setStationEta(m_idHelperSvc->cscIdHelper().stationEta(id));
66  if (done) done = fixedId.setStationPhi(m_idHelperSvc->cscIdHelper().stationPhi(id));
67 
68  if (done) done = fixedId.setCscChamberLayer(m_idHelperSvc->cscIdHelper().chamberLayer(id));
69  if (done) done = fixedId.setCscWireLayer(m_idHelperSvc->cscIdHelper().wireLayer(id));
70  if (done) done = fixedId.setCscMeasuresPhi(m_idHelperSvc->cscIdHelper().measuresPhi(id));
71  if (done) done = fixedId.setCscStrip(m_idHelperSvc->cscIdHelper().strip(id));
72  if (!done) ATH_MSG_INFO("Something went wrong in the conversion id->fid (CSC) ");
73  } else if (m_idHelperSvc->isTgc(id)) {
74  done = fixedId.setTechnology(2); // TGC = 2;
75  // setting the Tgc specific fields
76  if (done) done = fixedId.setStationEta(m_idHelperSvc->tgcIdHelper().stationEta(id));
77  if (done) done = fixedId.setStationPhi(m_idHelperSvc->tgcIdHelper().stationPhi(id));
78 
79  if (done) done = fixedId.setTgcGasGap(m_idHelperSvc->tgcIdHelper().gasGap(id));
80  if (done) done = fixedId.setTgcIsStrip(m_idHelperSvc->tgcIdHelper().isStrip(id));
81  if (done) done = fixedId.setTgcChannel(m_idHelperSvc->tgcIdHelper().channel(id));
82  if (!done) ATH_MSG_INFO("Something went wrong in the conversion id->fid (TGC) ");
83  }
84  }
85  return fixedId;
86  }

◆ idToFixedLongId()

MuonFixedLongId MuonCalib::IdToFixedIdTool::idToFixedLongId ( const Identifier id) const
overridevirtual

Convert ATHENA Identifier to MuonFixedLongId.

Implements MuonCalib::IIdToFixedIdTool.

Definition at line 107 of file IdToFixedIdTool.cxx.

107  {
108  bool done{false};
109  MuonFixedLongId fixedId;
110 
111  if (!(m_idHelperSvc->isMuon(id))) {
112  ATH_MSG_DEBUG(" MuonIdentifier doesn't correspond to a muon ");
113  } else {
114  // setting the Muon specific fields
115  done = fixedId.setStationName(fixedId.stationStringToFixedStationNumber(
116  m_idHelperSvc->mdtIdHelper().stationNameString(m_idHelperSvc->mdtIdHelper().stationName(id))));
117  if (!done) ATH_MSG_INFO("Something went wrong in the conversion id->fid (general) ");
118  if (m_idHelperSvc->isMdt(id)) {
119  done = fixedId.setTechnology(MuonFixedLongId::technologyMDT); // MDT = 0;
120  // setting the Mdt specific fields
121  if (done) done = fixedId.setStationEta(m_idHelperSvc->mdtIdHelper().stationEta(id));
122  if (done) done = fixedId.setStationPhi(m_idHelperSvc->mdtIdHelper().stationPhi(id));
123 
124  if (done) done = fixedId.setMdtTube(m_idHelperSvc->mdtIdHelper().tube(id));
125  if (done) done = fixedId.setMdtTubeLayer(m_idHelperSvc->mdtIdHelper().tubeLayer(id));
126  if (done) done = fixedId.setMdtMultilayer(m_idHelperSvc->mdtIdHelper().multilayer(id));
127  if (!done) ATH_MSG_INFO("Something went wrong in the conversion id->fid (MDT) ");
128  } else if (m_idHelperSvc->isRpc(id)) {
129  done = fixedId.setTechnology(MuonFixedLongId::technologyRPC); // RPC = 3;
130  // setting the Rpc specific fields
131  if (done) done = fixedId.setStationEta(m_idHelperSvc->rpcIdHelper().stationEta(id));
132  if (done) done = fixedId.setStationPhi(m_idHelperSvc->rpcIdHelper().stationPhi(id));
133 
134  if (done) done = fixedId.setRpcDoubletR(m_idHelperSvc->rpcIdHelper().doubletR(id));
135  if (done) done = fixedId.setRpcDoubletZ(m_idHelperSvc->rpcIdHelper().doubletZ(id));
136  if (done) done = fixedId.setRpcDoubletPhi(m_idHelperSvc->rpcIdHelper().doubletPhi(id));
137  if (done) done = fixedId.setRpcGasGap(m_idHelperSvc->rpcIdHelper().gasGap(id));
138  if (done) done = fixedId.setRpcMeasuresPhi(m_idHelperSvc->rpcIdHelper().measuresPhi(id));
139  if (done) done = fixedId.setRpcStrip(m_idHelperSvc->rpcIdHelper().strip(id));
140  if (!done) ATH_MSG_INFO("Something went wrong in the conversion id->fid (RPC) ");
141  } else if (m_idHelperSvc->isCsc(id)) {
142  done = fixedId.setTechnology(MuonFixedLongId::technologyCSC); // CSC = 1;
143  // setting the Csc specific fields
144  if (done) done = fixedId.setStationEta(m_idHelperSvc->cscIdHelper().stationEta(id));
145  if (done) done = fixedId.setStationPhi(m_idHelperSvc->cscIdHelper().stationPhi(id));
146 
147  if (done) done = fixedId.setCscChamberLayer(m_idHelperSvc->cscIdHelper().chamberLayer(id));
148  if (done) done = fixedId.setCscWireLayer(m_idHelperSvc->cscIdHelper().wireLayer(id));
149  if (done) done = fixedId.setCscMeasuresPhi(m_idHelperSvc->cscIdHelper().measuresPhi(id));
150  if (done) done = fixedId.setCscStrip(m_idHelperSvc->cscIdHelper().strip(id));
151  if (!done) ATH_MSG_INFO("Something went wrong in the conversion id->fid (CSC) ");
152  } else if (m_idHelperSvc->isTgc(id)) {
153  done = fixedId.setTechnology(MuonFixedLongId::technologyTGC); // TGC = 2;
154  // setting the Tgc specific fields
155  if (done) done = fixedId.setStationEta(m_idHelperSvc->tgcIdHelper().stationEta(id));
156  if (done) done = fixedId.setStationPhi(m_idHelperSvc->tgcIdHelper().stationPhi(id));
157 
158  if (done) done = fixedId.setTgcGasGap(m_idHelperSvc->tgcIdHelper().gasGap(id));
159  if (done) done = fixedId.setTgcIsStrip(m_idHelperSvc->tgcIdHelper().isStrip(id));
160  if (done) done = fixedId.setTgcChannel(m_idHelperSvc->tgcIdHelper().channel(id));
161  if (!done) ATH_MSG_INFO("Something went wrong in the conversion id->fid (TGC) ");
162  } else if (m_idHelperSvc->isMM(id)) {
163  done = fixedId.setTechnology(MuonFixedLongId::technologyMMG);
164  // setting the MMG specific fields
165  if (done) done = fixedId.setStationEta(m_idHelperSvc->mmIdHelper().stationEta(id));
166  if (done) done = fixedId.setStationPhi(m_idHelperSvc->mmIdHelper().stationPhi(id));
167 
168  if (done) done = fixedId.setMmgMultilayer(m_idHelperSvc->mmIdHelper().multilayer(id));
169  if (done) done = fixedId.setMmgGasGap(m_idHelperSvc->mmIdHelper().gasGap(id));
170  if (done) done = fixedId.setMmgStrip(m_idHelperSvc->mmIdHelper().channel(id));
171  if (!done) ATH_MSG_INFO("Something went wrong in the conversion id->fid (MMG) ");
172  } else if (m_idHelperSvc->issTgc(id)) {
173  done = fixedId.setTechnology(MuonFixedLongId::technologySTG);
174  // setting the sTGC specific fields
175  if (done) done = fixedId.setStationEta(m_idHelperSvc->stgcIdHelper().stationEta(id));
176  if (done) done = fixedId.setStationPhi(m_idHelperSvc->stgcIdHelper().stationPhi(id));
177 
178  // Convert the channel type enum
180  switch (m_idHelperSvc->stgcIdHelper().channelType(id)) {
181  case sTgcIdHelper::sTgcChannelTypes::Pad:
182  channelType = MuonFixedLongId::StgChannelType::stgChannelPad;
183  break;
184  case sTgcIdHelper::sTgcChannelTypes::Strip:
185  channelType = MuonFixedLongId::StgChannelType::stgChannelStrip;
186  break;
187  case sTgcIdHelper::sTgcChannelTypes::Wire:
188  channelType = MuonFixedLongId::StgChannelType::stgChannelWire;
189  break;
190  default:
191  ATH_MSG_WARNING("Cannot convert StgChannelType");
192  done = false;
193  break;
194  }
195 
196  if (done) done = fixedId.setStgMultilayer(m_idHelperSvc->stgcIdHelper().multilayer(id));
197  if (done) done = fixedId.setStgGasGap(m_idHelperSvc->stgcIdHelper().gasGap(id));
198  if (done) done = fixedId.setStgChannelType(channelType);
199  if (done) done = fixedId.setStgChannel(m_idHelperSvc->stgcIdHelper().channel(id));
200  if (!done) ATH_MSG_INFO("Something went wrong in the conversion id->fid (STG) ");
201  }
202  }
203  return fixedId;
204  }

◆ initialize()

StatusCode MuonCalib::IdToFixedIdTool::initialize ( )
overridevirtual

IdToFixedIdTool initialization: retrieve all the IdHelpers needed to do strap the ATHENA Identifier.

Definition at line 22 of file IdToFixedIdTool.cxx.

22  {
23  ATH_MSG_VERBOSE("Initialisation started");
24  ATH_CHECK(m_idHelperSvc.retrieve());
25  return StatusCode::SUCCESS;
26  }

◆ 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()

static const InterfaceID& MuonCalib::IIdToFixedIdTool::interfaceID ( )
inlinestaticinherited

retrieve Interface ID

Definition at line 42 of file IIdToFixedIdTool.h.

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

◆ print() [1/3]

void MuonCalib::IdToFixedIdTool::print ( const Identifier id) const
overridevirtual

print method to output an ATHENA Identifier, warning the user when the conversion and reconversion yields different results.

Implements MuonCalib::IIdToFixedIdTool.

Definition at line 288 of file IdToFixedIdTool.cxx.

288  {
289  MuonFixedId tmp = idToFixedId(id);
291  if (id != test) ATH_MSG_WARNING("SOMETHING WENT WRONG PROCESSING FIXEDID<->ID");
292 
293  m_idHelperSvc->mdtIdHelper().print(id);
294  }

◆ print() [2/3]

void MuonCalib::IdToFixedIdTool::print ( const MuonFixedId fid) const
overridevirtual

dump MuonFixedId

Implements MuonCalib::IIdToFixedIdTool.

Definition at line 296 of file IdToFixedIdTool.cxx.

296 { ATH_MSG_INFO("MuonFixedId conversion yields: " << fid); }

◆ print() [3/3]

void MuonCalib::IdToFixedIdTool::print ( const MuonFixedLongId fid) const
overridevirtual

dump MuonFixedLongId

Implements MuonCalib::IIdToFixedIdTool.

Definition at line 298 of file IdToFixedIdTool.cxx.

298 { ATH_MSG_INFO("MuonFixedLongId conversion yields: " << fid); }

◆ regionKeyToId()

Identifier MuonCalib::IdToFixedIdTool::regionKeyToId ( std::string  region) const
overridevirtual

Returns an ATHENA Identifier for a given Region key.

Implements MuonCalib::IIdToFixedIdTool.

Definition at line 247 of file IdToFixedIdTool.cxx.

247  {
248  // unpack the region key string used by the calibration framework and return
249  // an Athena Identifier
250  int eta, phi, ml;
251  std::string stnName(region, 0, 3);
252  std::string::size_type separator1 = region.find_first_of('_');
253  std::string::size_type separator2 = region.find_last_of('_');
254  if ((separator1 == std::string::npos) || (separator2 == std::string::npos) || (separator1 == separator2)) {
255  ATH_MSG_WARNING("IdToFixedIdTool::regionKeyToId : invalid region key " << region);
256  return Identifier();
257  }
258  std::string::size_type separator3 = region.find('_', separator1 + 1);
259  if (separator3 != separator2) {
260  // format STN_ETA_PHI_ML
261  std::string stnPhi(region, separator1 + 1, separator2 - separator1 - 1);
262  std::string stnEta(region, separator2 + 1, separator3 - separator2 - 1);
263  std::istringstream is1, is2;
264  is1.str(stnEta);
265  is1 >> eta;
266  is2.str(stnPhi);
267  is2 >> phi;
268  std::string Ml(region, separator3 + 1, region.size() - separator3 - 1);
269  std::istringstream is3;
270  is3.str(Ml);
271  is3 >> ml;
272  } else {
273  // format STN_ETA_PHI
274  std::string stnPhi(region, separator1 + 1, separator2 - separator1 - 1);
275  std::string stnEta(region, separator2 + 1, region.size() - separator2 - 1);
276  std::istringstream is1, is2;
277  is1.str(stnEta);
278  is1 >> eta;
279  is2.str(stnPhi);
280  is2 >> phi;
281  ml = 0;
282  }
283  // figure out what to do here when ml!=0 ...
284  Identifier athenaId = m_idHelperSvc->mdtIdHelper().elementID(stnName, eta, phi);
285  return athenaId;
286  }

◆ 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> MuonCalib::IdToFixedIdTool::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 67 of file IdToFixedIdTool.h.

◆ m_print_level

int MuonCalib::IdToFixedIdTool::m_print_level
private

Sets printlevel of output.

Definition at line 69 of file IdToFixedIdTool.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:
MuonCalib::MuonFixedLongId::technologyCSC
@ technologyCSC
Definition: MuonFixedLongId.h:56
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
MuonCalib::MuonFixedLongId::technologyRPC
@ technologyRPC
Definition: MuonFixedLongId.h:58
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
MuonCalib::MuonFixedLongId::technologyMMG
@ technologyMMG
Definition: MuonFixedLongId.h:59
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
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
TrigInDetValidation_Base.test
test
Definition: TrigInDetValidation_Base.py:144
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
sTgcIdHelper::sTgcChannelTypes
sTgcChannelTypes
Definition: sTgcIdHelper.h:190
MuonCalib::MuonFixedLongId::StgChannelType
StgChannelType
an enum with the STGC channel types
Definition: MuonFixedLongId.h:108
MuonCalib::IdToFixedIdTool::idToFixedId
MuonFixedId idToFixedId(const Identifier &id) const override
Convert ATHENA Identifier to MuonFixedId.
Definition: IdToFixedIdTool.cxx:28
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
MuonCalib::MuonFixedLongId::technologyTGC
@ technologyTGC
Definition: MuonFixedLongId.h:57
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
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
MuonCalib::MuonFixedLongId::technologyMDT
@ technologyMDT
Definition: MuonFixedLongId.h:55
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
MuonCalib::IdToFixedIdTool::m_print_level
int m_print_level
Sets printlevel of output.
Definition: IdToFixedIdTool.h:69
MuonCalib::IdToFixedIdTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: IdToFixedIdTool.h:67
MuonCalib::MuonFixedLongId::technologySTG
@ technologySTG
Definition: MuonFixedLongId.h:60
MuonCalib::IdToFixedIdTool::fixedIdToId
Identifier fixedIdToId(const MuonFixedId &fid) const override
Convert MuonFixedId to ATHENA Identifier.
Definition: IdToFixedIdTool.cxx:88
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