ATLAS Offline Software
Loading...
Searching...
No Matches
Muon::PRDxAODConvertorAlg Class Reference

Algorithm which converts PrepRawData to xAOD::PrepRawData Not really Muon specific, but InDet already has separate convertors. More...

#include <PRDxAODConvertorAlg.h>

Inheritance diagram for Muon::PRDxAODConvertorAlg:

Public Member Functions

virtual ~PRDxAODConvertorAlg ()=default
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &ctx) const override
template<>
bool fillxPRD (const Muon::MdtPrepData &prd, xAOD::MdtDriftCircle &xprd) const
template<>
bool fillxPRD (const Muon::RpcPrepData &prd, xAOD::RpcStrip &xprd) const
template<>
bool fillxPRD (const Muon::TgcPrepData &prd, xAOD::TgcStrip &xprd) const
template<>
bool fillxPRD (const Muon::MMPrepData &prd, xAOD::MMCluster &xprd) const
template<>
bool fillxPRD (const Muon::sTgcPrepData &prd, xAOD::sTgcStripCluster &xprd) const
template<>
bool fillxPRD (const Muon::sTgcPrepData &prd, xAOD::sTgcWireHit &xprd) const
template<>
bool fillxPRD (const Muon::sTgcPrepData &prd, xAOD::sTgcPadHit &xprd) const
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.

Protected Attributes

SG::ReadHandleKey< Muon::MdtPrepDataContainerm_mdtPrepRawDataKey {this, "MdtPrepRawDataKey", "MDT_DriftCircles", "Key for MDT PRD Container"}
SG::ReadHandleKey< Muon::RpcPrepDataContainerm_rpcPrepRawDataKey {this, "RpcPrepRawDataKey", "RPC_Measurements", "Key for RPC PRD Container"}
SG::ReadHandleKey< Muon::TgcPrepDataContainerm_tgcPrepRawDataKey {this, "TgcPrepRawDataKey", "TGC_MeasurementsAllBCs", "Key for TGC PRD Container"}
SG::ReadHandleKey< Muon::MMPrepDataContainerm_mmPrepRawDataKey {this, "MMPrepRawDataKey", "MM_Measurements", "Key for MM PRD Container"}
SG::ReadHandleKey< Muon::sTgcPrepDataContainerm_stgcPrepRawDataKey {this, "sTgcPrepRawDataKey", "STGC_Measurements", "Key for sTGC PRD Container"}
SG::WriteHandleKey< xAOD::MdtDriftCircleContainerm_mdtxAODKey {this, "MdtxAODKey", "MDT_PrepData"}
SG::WriteHandleKey< xAOD::RpcStripContainerm_rpcxAODKey {this, "RpcxAODKey", "RPC_PrepData"}
SG::WriteHandleKey< xAOD::TgcStripContainerm_tgcxAODKey {this, "TgcxAODKey", "TGC_PrepData"}
SG::WriteHandleKey< xAOD::MMClusterContainerm_mmxAODKey {this, "MMxAODKey", "MM_PrepData"}
SG::WriteHandleKey< xAOD::sTgcStripContainerm_stgcStripxAODKey {this, "sTgcStripxAODKey", "sTGC_StripPrepData"}
SG::WriteHandleKey< xAOD::sTgcWireContainerm_stgcWirexAODKey {this, "sTgcWirexAODKey", "sTGC_WirePrepData"}
SG::WriteHandleKey< xAOD::sTgcPadContainerm_stgcPadxAODKey {this, "sTgcPadxAODKey", "sTGC_PadPrepData"}

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

template<class INTYPE, class OUTTYPE, class OUTTYPEAUX>
StatusCode getAndFillContainer (const SG::ReadHandleKey< INTYPE > &inKey, const SG::WriteHandleKey< OUTTYPE > &outKey, const EventContext &) const
template<class PRD, class xPRD>
bool fillxPRD (const PRD &prd, xPRD &xprd) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
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

Algorithm which converts PrepRawData to xAOD::PrepRawData Not really Muon specific, but InDet already has separate convertors.

Definition at line 32 of file PRDxAODConvertorAlg.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

◆ ~PRDxAODConvertorAlg()

virtual Muon::PRDxAODConvertorAlg::~PRDxAODConvertorAlg ( )
virtualdefault

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.

64{
65 return 0;
66}

◆ 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 Muon::PRDxAODConvertorAlg::execute ( const EventContext & ctx) const
overridevirtual

Definition at line 35 of file PRDxAODConvertorAlg.cxx.

35 {
36
37 ATH_MSG_VERBOSE("About to create trackContainer");
38
46
47 return StatusCode::SUCCESS;
48}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
SG::ReadHandleKey< Muon::RpcPrepDataContainer > m_rpcPrepRawDataKey
SG::WriteHandleKey< xAOD::sTgcPadContainer > m_stgcPadxAODKey
SG::ReadHandleKey< Muon::TgcPrepDataContainer > m_tgcPrepRawDataKey
SG::WriteHandleKey< xAOD::sTgcWireContainer > m_stgcWirexAODKey
SG::ReadHandleKey< Muon::MdtPrepDataContainer > m_mdtPrepRawDataKey
SG::ReadHandleKey< Muon::sTgcPrepDataContainer > m_stgcPrepRawDataKey
SG::WriteHandleKey< xAOD::MdtDriftCircleContainer > m_mdtxAODKey
SG::ReadHandleKey< Muon::MMPrepDataContainer > m_mmPrepRawDataKey
SG::WriteHandleKey< xAOD::TgcStripContainer > m_tgcxAODKey
StatusCode getAndFillContainer(const SG::ReadHandleKey< INTYPE > &inKey, const SG::WriteHandleKey< OUTTYPE > &outKey, const EventContext &) const
SG::WriteHandleKey< xAOD::sTgcStripContainer > m_stgcStripxAODKey
SG::WriteHandleKey< xAOD::MMClusterContainer > m_mmxAODKey
SG::WriteHandleKey< xAOD::RpcStripContainer > m_rpcxAODKey

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

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

◆ fillxPRD() [1/8]

template<>
bool Muon::PRDxAODConvertorAlg::fillxPRD ( const Muon::MdtPrepData & prd,
xAOD::MdtDriftCircle & xprd ) const

Definition at line 91 of file PRDxAODConvertorAlg.cxx.

92 {
93 const MdtIdHelper& id_helper{m_idHelperSvc->mdtIdHelper()};
94
95 const Identifier prdId{prd.identify()};
97
98 xAOD::MeasVector<1> localPosition(prd.localPosition().x());
99 xAOD::MeasMatrix<1> localCovariance{};
100 localCovariance(0, 0) = prd.localCovariance()(0, 0);
101 xprd.setMeasurement(m_idHelperSvc->detElementHash(prdId), localPosition, localCovariance);
102
103 xprd.setTdc(prd.tdc());
104 xprd.setAdc(prd.adc());
105 xprd.setTube(id_helper.tube(prd.identify()));
106 xprd.setLayer(id_helper.tubeLayer(prd.identify()));
107 xprd.setStatus(prd.status());
108 // TODO tubePosInStation - but this needs ReadoutElement?
109 return true;
110}
value_type get_compact() const
Get the compact id.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
int tube(const Identifier &id) const
int tubeLayer(const Identifier &id) const
int adc() const
Returns the ADC (typically range is 0 to 250)
MdtDriftCircleStatus status() const
Returns the status of the measurement.
int tdc() const
Returns the TDC (typically range is 0 to 2500).
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
const Amg::Vector2D & localPosition() const
return the local position reference
Identifier identify() const
return the identifier
const Amg::MatrixX & localCovariance() const
return const ref to the error matrix
void setAdc(int16_t adc)
Sets the ADC counts.
void setLayer(uint8_t layer_n)
Sets the layer number.
void setStatus(MdtDriftCircleStatus st)
Sets the status of the drift circle.
void setTdc(int16_t tdc)
Setter methods.
void setTube(uint16_t tube_n)
Sets the tube number.
void setMeasurement(const DetectorIDHashType idHash, MeasVector< N > locPos, MeasMatrix< N > locCov)
Sets IdentifierHash, local position and local covariance of the measurement.
void setIdentifier(const DetectorIdentType measId)
Sets the full Identifier of the measurement.
Eigen::Matrix< float, N, N > MeasMatrix
Eigen::Matrix< float, N, 1 > MeasVector
Abrivation of the Matrix & Covariance definitions.

◆ fillxPRD() [2/8]

template<>
bool Muon::PRDxAODConvertorAlg::fillxPRD ( const Muon::MMPrepData & prd,
xAOD::MMCluster & xprd ) const

Definition at line 154 of file PRDxAODConvertorAlg.cxx.

155 {
156
157 const MmIdHelper& idHelper{m_idHelperSvc->mmIdHelper()};
158 const Identifier prdId{prd.identify()};
160 xprd.setGasGap(idHelper.gasGap(prdId));
161 xprd.setChannelNumber(idHelper.channel(prdId));
162 xAOD::MeasVector<1> localPosition(prd.localPosition().x());
163 xAOD::MeasMatrix<1> localCovariance{xAOD::MeasMatrix<1>::Identity()};
164 localCovariance(0, 0) = prd.localCovariance()(0, 0);
165 xprd.setMeasurement(m_idHelperSvc->detElementHash(prdId), localPosition, localCovariance);
166
167 xprd.setTime(prd.time());
168 xprd.setCharge(prd.charge());
169 xprd.setDriftDist(prd.driftDist());
170 xprd.setAngle(prd.angle());
171 xprd.setChiSqProb(prd.chisqProb());
172
176 xprd.setStripCharges(prd.stripCharges());
177 xprd.setStripTimes(prd.stripTimes());
178 xprd.setStripNumbers(prd.stripNumbers());
179 return true;
180}
int channel(const Identifier &id) const override
int gasGap(const Identifier &id) const override
get the hashes
const std::vector< AmgVector(2)> & stripDriftErrors() const
returns the list of drift distances
Definition MMPrepData.h:267
const std::vector< uint16_t > & stripNumbers() const
returns the list of strip numbers
Definition MMPrepData.h:247
const std::vector< short int > & stripTimes() const
returns the list of times
Definition MMPrepData.h:252
float angle() const
Returns the microTPC angle.
Definition MMPrepData.h:237
float driftDist() const
Returns the Drift Distance.
Definition MMPrepData.h:232
short int time() const
Returns the time (in ns)
Definition MMPrepData.h:222
const std::vector< float > & stripDriftDist() const
returns the list of drift distances
Definition MMPrepData.h:262
const std::vector< int > & stripCharges() const
returns the list of charges
Definition MMPrepData.h:257
int charge() const
Returns the AD.
Definition MMPrepData.h:227
float chisqProb() const
Returns the microTPC chisq Prob.
Definition MMPrepData.h:242
void setDriftDist(float value)
Sets the drift distance.
void setStripDriftDist(const std::vector< float > &stripDriftDist)
void setStripDriftErrors(const std::vector< DriftCov_t > &stripDriftErrors)
void setStripNumbers(const std::vector< uint16_t > &stripNumbers)
void setStripCharges(const std::vector< int > &stripCharges)
void setChiSqProb(float value)
Sets the microTPC chisq probability.
void setTime(uint16_t value)
Sets the TDC counts.
void setAngle(float value)
Sets the microTPC angle.
void setStripTimes(const std::vector< int16_t > &stripTimes)
void setChannelNumber(uint16_t strip)
void setGasGap(uint8_t gap)
void setCharge(uint32_t value)
Sets the calibrated charge.

◆ fillxPRD() [3/8]

template<>
bool Muon::PRDxAODConvertorAlg::fillxPRD ( const Muon::RpcPrepData & prd,
xAOD::RpcStrip & xprd ) const

Definition at line 112 of file PRDxAODConvertorAlg.cxx.

113 {
114
115 const RpcIdHelper& idHelper{m_idHelperSvc->rpcIdHelper()};
116 const Identifier prdId{prd.identify()};
118
119 xprd.setStripNumber(idHelper.strip(prdId));
120 xprd.setGasGap(idHelper.gasGap(prdId));
121 xprd.setMeasuresPhi(idHelper.measuresPhi(prdId));
122 xprd.setDoubletPhi(idHelper.doubletPhi(prdId));
123
124 xAOD::MeasVector<1> localPosition(prd.localPosition().x());
125 xAOD::MeasMatrix<1> localCovariance{xAOD::MeasMatrix<1>::Identity()};
126 localCovariance(0, 0) = prd.localCovariance()(0, 0);
127 xprd.setMeasurement(m_idHelperSvc->detElementHash(prdId), localPosition, localCovariance);
128
129 xprd.setTime(prd.time());
130 xprd.setTriggerInfo(prd.triggerInfo());
133 return true;
134}
float timeOverThreshold() const
Returns the time over threshold.
int triggerInfo() const
Returns the trigger coincidence - usually false, unless ijk>5 or highpt&&ijk==0.
int ambiguityFlag() const
Returns the number of ambiguities associated with this RpcPrepData.
float time() const
Returns the time.
int gasGap(const Identifier &id) const override
get the hashes
int doubletPhi(const Identifier &id) const
int strip(const Identifier &id) const
bool measuresPhi(const Identifier &id) const override
void setAmbiguityFlag(uint8_t ambi)
Sets the ADC counts.
void setDoubletPhi(uint8_t doubPhi)
Sets the doubletPhi identifier field.
void setTriggerInfo(uint32_t triggerinfo)
Set the trigger info of the hit.
void setGasGap(uint8_t gap)
Sets the associated gasGap identifier field.
void setTimeOverThreshold(float timeoverthreshold)
Sets the TDC counts.
void setTime(float time)
Sets the the triger time of the hit.
void setStripNumber(uint16_t strip)
Sets the associated strip number identifier field.
void setMeasuresPhi(uint8_t measPhi)
sets the measuresPhi value

◆ fillxPRD() [4/8]

template<>
bool Muon::PRDxAODConvertorAlg::fillxPRD ( const Muon::sTgcPrepData & prd,
xAOD::sTgcPadHit & xprd ) const

Definition at line 222 of file PRDxAODConvertorAlg.cxx.

223 {
224 const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
225 const Identifier prdId = prd.identify();
226 if (idHelper.channelType(prdId) != sTgcIdHelper::Pad) return false;
229 xAOD::MeasMatrix<2> localCovariance{xAOD::MeasMatrix<2>::Identity()};
230 localCovariance(0, 0) = prd.localCovariance()(0, 0);
231 // localCovariance(1, 1) = prd.localCovariance()(1, 1);
232 xprd.setChannelNumber(idHelper.channel(prdId));
233 xprd.setGasGap(idHelper.gasGap(prdId));
234 xprd.setMeasurement(prd.collectionHash(), localPosition, localCovariance);
235 xprd.setTime(prd.time());
236 xprd.setCharge(prd.charge());
237 xprd.setAuthor(prd.author());
238 return true;
239}
virtual IdentifierHash collectionHash() const
Returns the IdentifierHash corresponding to the PRD collection in the PRD container.
int charge() const
Returns the bcBitMap of this PRD bit2 for Previous BC, bit1 for Current BC, bit0 for Next BC.
Author author() const
short int time() const
int channelType(const Identifier &id) const
int channel(const Identifier &id) const override
int gasGap(const Identifier &id) const override
get the hashes
void setTime(short int t)
: Set the calibrated time of the wire measurement
void setAuthor(Author a)
Set the author of the producing algorithm.
void setCharge(int q)
: Set the collected charge on the wire
void setChannelNumber(uint16_t channel)
Set the channel number of the measurement.
void setGasGap(uint8_t gap)
Set the associated gas gap of the measurement.
MeasVector< N > toStorage(const AmgVector(N)&amgVec)
Converts the double precision of the AmgVector into the floating point storage precision of the MeasV...

◆ fillxPRD() [5/8]

template<>
bool Muon::PRDxAODConvertorAlg::fillxPRD ( const Muon::sTgcPrepData & prd,
xAOD::sTgcStripCluster & xprd ) const

Definition at line 182 of file PRDxAODConvertorAlg.cxx.

183 {
184
185 const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
186 const Identifier prdId = prd.identify();
187 if (idHelper.channelType(prdId) != sTgcIdHelper::Strip) return false;
189 xAOD::MeasVector<1> localPosition(prd.localPosition().x());
190 xAOD::MeasMatrix<1> localCovariance{xAOD::MeasMatrix<1>::Identity()};
191 localCovariance(0, 0) = prd.localCovariance()(0, 0);
192 xprd.setChannelNumber(idHelper.channel(prdId));
193 xprd.setGasGap(idHelper.gasGap(prdId));
194 xprd.setMeasurement(prd.collectionHash(), localPosition, localCovariance);
195 xprd.setTime(prd.time());
196 xprd.setCharge(prd.charge());
197 xprd.setAuthor(prd.author());
198 xprd.setQuality(prd.quality());
199 xprd.setStripCharges(prd.stripCharges());
200 xprd.setStripNumbers(prd.stripNumbers());
201 xprd.setStripTimes(prd.stripTimes());
202 return true;
203}
Quality quality() const
const std::vector< uint16_t > & stripNumbers() const
returns the list of strip numbers
const std::vector< int > & stripCharges() const
returns the list of charges
const std::vector< short int > & stripTimes() const
returns the list of times
void setStripNumbers(const std::vector< uint16_t > &strips)
Set the list of individual strip clusters.
void setStripCharges(const std::vector< int > &charges)
Set the individual list of contributing charges.
void setQuality(Quality q)
Set the quality flag.
void setStripTimes(const std::vector< short int > &times)
Set the list of indivual strip times.

◆ fillxPRD() [6/8]

template<>
bool Muon::PRDxAODConvertorAlg::fillxPRD ( const Muon::sTgcPrepData & prd,
xAOD::sTgcWireHit & xprd ) const

Definition at line 205 of file PRDxAODConvertorAlg.cxx.

206 {
207 const sTgcIdHelper& idHelper{m_idHelperSvc->stgcIdHelper()};
208 const Identifier prdId = prd.identify();
209 if (idHelper.channelType(prdId) != sTgcIdHelper::Wire) return false;
211 xAOD::MeasVector<1> localPosition(prd.localPosition().x());
212 xAOD::MeasMatrix<1> localCovariance{xAOD::MeasMatrix<1>::Identity()};
213 localCovariance(0, 0) = prd.localCovariance()(0, 0);
214 xprd.setChannelNumber(idHelper.channel(prdId));
215 xprd.setGasGap(idHelper.gasGap(prdId));
216 xprd.setMeasurement(prd.collectionHash(), localPosition, localCovariance);
217 xprd.setTime(prd.time());
218 xprd.setCharge(prd.charge());
219 xprd.setAuthor(prd.author());
220 return true;
221}

◆ fillxPRD() [7/8]

template<>
bool Muon::PRDxAODConvertorAlg::fillxPRD ( const Muon::TgcPrepData & prd,
xAOD::TgcStrip & xprd ) const

Definition at line 136 of file PRDxAODConvertorAlg.cxx.

137 {
138
139 const TgcIdHelper& idHelper{m_idHelperSvc->tgcIdHelper()};
140 const Identifier prdId{prd.identify()};
142 xprd.setMeasuresPhi(idHelper.measuresPhi(prdId));
143 xprd.setGasGap(idHelper.gasGap(prdId));
144 xprd.setChannelNumber(idHelper.channel(prdId));
145 xAOD::MeasVector<1> localPosition(prd.localPosition().x());
146 xAOD::MeasMatrix<1> localCovariance{xAOD::MeasMatrix<1>::Identity()};
147 localCovariance(0, 0) = prd.localCovariance()(0, 0);
148 xprd.setMeasurement(m_idHelperSvc->detElementHash(prdId), localPosition, localCovariance);
149
150 xprd.setBcBitMap(prd.getBcBitMap());
151 return true;
152}
uint16_t getBcBitMap() const
Returns the bcBitMap of this PRD bit2 for Previous BC, bit1 for Current BC, bit0 for Next BC.
int channel(const Identifier &id) const override
int gasGap(const Identifier &id) const override
get the hashes
bool measuresPhi(const Identifier &id) const override
void setMeasuresPhi(uint8_t measPhi)
Set the measures phi flag of the measurement to true /false.
void setGasGap(uint8_t gapNum)
Set the gas gap number of the measurement [1-N].
void setChannelNumber(uint16_t chan)
Set the strip or wire group number of the measurement.
void setBcBitMap(uint16_t)
Set the bunch crossing-id map.

◆ fillxPRD() [8/8]

template<class PRD, class xPRD>
bool Muon::PRDxAODConvertorAlg::fillxPRD ( const PRD & prd,
xPRD & xprd ) const
private

◆ 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

◆ getAndFillContainer()

template<class INTYPE, class OUTTYPE, class OUTTYPEAUX>
StatusCode Muon::PRDxAODConvertorAlg::getAndFillContainer ( const SG::ReadHandleKey< INTYPE > & inKey,
const SG::WriteHandleKey< OUTTYPE > & outKey,
const EventContext & ctx ) const
private

Definition at line 52 of file PRDxAODConvertorAlg.cxx.

54 {
55 if(inKey.empty()) {
56 ATH_MSG_VERBOSE("No key configured to convert "<<typeid(INTYPE).name()<<" into xAOD objects. Skipping.");
57 return StatusCode::SUCCESS;
58 }
59
60 SG::ReadHandle<INTYPE> handle(inKey, ctx);
61
62 ATH_MSG_VERBOSE("Trying to load " << handle.key());
63 ATH_CHECK(handle.isValid());
64 ATH_MSG_VERBOSE("Which has " << handle->numberOfCollections()
65 << " collections: ");
66
67 SG::WriteHandle<OUTTYPE> outputContainer(outKey, ctx);
68 ATH_CHECK( outputContainer.record (std::make_unique<OUTTYPE>(),
69 std::make_unique<OUTTYPEAUX>()) );
70 ATH_MSG_DEBUG( "Recorded xAOD container with key: " << outputContainer.key() );
71
72 for (const auto *coll : *handle) {
73 for (const auto * prd : *coll) {
74 auto * xprd = new typename OUTTYPE::base_value_type();
75 outputContainer->push_back(xprd);
76 if (!fillxPRD(*prd, *xprd)) {
77 outputContainer->pop_back();
78 }
79 }
80 }
81
82 return StatusCode::SUCCESS;
83}
#define ATH_MSG_DEBUG(x)
bool fillxPRD(const PRD &prd, xPRD &xprd) const
bool empty() const
Test if the key is blank.

◆ initialize()

StatusCode Muon::PRDxAODConvertorAlg::initialize ( )
overridevirtual

Definition at line 15 of file PRDxAODConvertorAlg.cxx.

15 {
21
22 ATH_CHECK(m_mdtxAODKey.initialize(!m_mdtPrepRawDataKey.empty()));
23 ATH_CHECK(m_rpcxAODKey.initialize(!m_rpcPrepRawDataKey.empty()));
24 ATH_CHECK(m_tgcxAODKey.initialize(!m_tgcPrepRawDataKey.empty()));
25 ATH_CHECK(m_mmxAODKey.initialize(!m_mmPrepRawDataKey.empty()));
28 ATH_CHECK(m_stgcPadxAODKey.initialize(!m_stgcPrepRawDataKey.empty()));
29
30 ATH_CHECK(m_idHelperSvc.retrieve());
31
32 return StatusCode::SUCCESS;
33}

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

77{
78 return BaseAlg::sysExecute (ctx);
79}

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

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

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

Definition at line 61 of file PRDxAODConvertorAlg.h.

61{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};

◆ m_mdtPrepRawDataKey

SG::ReadHandleKey<Muon::MdtPrepDataContainer> Muon::PRDxAODConvertorAlg::m_mdtPrepRawDataKey {this, "MdtPrepRawDataKey", "MDT_DriftCircles", "Key for MDT PRD Container"}
protected

Definition at line 45 of file PRDxAODConvertorAlg.h.

45{this, "MdtPrepRawDataKey", "MDT_DriftCircles", "Key for MDT PRD Container"};

◆ m_mdtxAODKey

SG::WriteHandleKey<xAOD::MdtDriftCircleContainer> Muon::PRDxAODConvertorAlg::m_mdtxAODKey {this, "MdtxAODKey", "MDT_PrepData"}
protected

Definition at line 51 of file PRDxAODConvertorAlg.h.

51{this, "MdtxAODKey", "MDT_PrepData"};

◆ m_mmPrepRawDataKey

SG::ReadHandleKey<Muon::MMPrepDataContainer> Muon::PRDxAODConvertorAlg::m_mmPrepRawDataKey {this, "MMPrepRawDataKey", "MM_Measurements", "Key for MM PRD Container"}
protected

Definition at line 48 of file PRDxAODConvertorAlg.h.

48{this, "MMPrepRawDataKey", "MM_Measurements", "Key for MM PRD Container"};

◆ m_mmxAODKey

SG::WriteHandleKey<xAOD::MMClusterContainer> Muon::PRDxAODConvertorAlg::m_mmxAODKey {this, "MMxAODKey", "MM_PrepData"}
protected

Definition at line 54 of file PRDxAODConvertorAlg.h.

54{this, "MMxAODKey", "MM_PrepData"};

◆ m_rpcPrepRawDataKey

SG::ReadHandleKey<Muon::RpcPrepDataContainer> Muon::PRDxAODConvertorAlg::m_rpcPrepRawDataKey {this, "RpcPrepRawDataKey", "RPC_Measurements", "Key for RPC PRD Container"}
protected

Definition at line 46 of file PRDxAODConvertorAlg.h.

46{this, "RpcPrepRawDataKey", "RPC_Measurements", "Key for RPC PRD Container"};

◆ m_rpcxAODKey

SG::WriteHandleKey<xAOD::RpcStripContainer> Muon::PRDxAODConvertorAlg::m_rpcxAODKey {this, "RpcxAODKey", "RPC_PrepData"}
protected

Definition at line 52 of file PRDxAODConvertorAlg.h.

52{this, "RpcxAODKey", "RPC_PrepData"};

◆ m_stgcPadxAODKey

SG::WriteHandleKey<xAOD::sTgcPadContainer> Muon::PRDxAODConvertorAlg::m_stgcPadxAODKey {this, "sTgcPadxAODKey", "sTGC_PadPrepData"}
protected

Definition at line 57 of file PRDxAODConvertorAlg.h.

57{this, "sTgcPadxAODKey", "sTGC_PadPrepData"};

◆ m_stgcPrepRawDataKey

SG::ReadHandleKey<Muon::sTgcPrepDataContainer> Muon::PRDxAODConvertorAlg::m_stgcPrepRawDataKey {this, "sTgcPrepRawDataKey", "STGC_Measurements", "Key for sTGC PRD Container"}
protected

Definition at line 49 of file PRDxAODConvertorAlg.h.

49{this, "sTgcPrepRawDataKey", "STGC_Measurements", "Key for sTGC PRD Container"};

◆ m_stgcStripxAODKey

SG::WriteHandleKey<xAOD::sTgcStripContainer> Muon::PRDxAODConvertorAlg::m_stgcStripxAODKey {this, "sTgcStripxAODKey", "sTGC_StripPrepData"}
protected

Definition at line 55 of file PRDxAODConvertorAlg.h.

55{this, "sTgcStripxAODKey", "sTGC_StripPrepData"};

◆ m_stgcWirexAODKey

SG::WriteHandleKey<xAOD::sTgcWireContainer> Muon::PRDxAODConvertorAlg::m_stgcWirexAODKey {this, "sTgcWirexAODKey", "sTGC_WirePrepData"}
protected

Definition at line 56 of file PRDxAODConvertorAlg.h.

56{this, "sTgcWirexAODKey", "sTGC_WirePrepData"};

◆ m_tgcPrepRawDataKey

SG::ReadHandleKey<Muon::TgcPrepDataContainer> Muon::PRDxAODConvertorAlg::m_tgcPrepRawDataKey {this, "TgcPrepRawDataKey", "TGC_MeasurementsAllBCs", "Key for TGC PRD Container"}
protected

Definition at line 47 of file PRDxAODConvertorAlg.h.

47{this, "TgcPrepRawDataKey", "TGC_MeasurementsAllBCs", "Key for TGC PRD Container"};

◆ m_tgcxAODKey

SG::WriteHandleKey<xAOD::TgcStripContainer> Muon::PRDxAODConvertorAlg::m_tgcxAODKey {this, "TgcxAODKey", "TGC_PrepData"}
protected

Definition at line 53 of file PRDxAODConvertorAlg.h.

53{this, "TgcxAODKey", "TGC_PrepData"};

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