 |
ATLAS Offline Software
|
The MuonPatternCnvAlg converts the SegmentSeeds produced by the R4 pattern recognition chain into the segment seeds that can be consumed by the legacy muon segment maker.
More...
#include <PatternCnvAlg.h>
|
StatusCode | initialize () override final |
|
StatusCode | execute (const EventContext &ctx) const override final |
|
virtual StatusCode | sysInitialize () override |
| Override sysInitialize. More...
|
|
virtual bool | isClonable () const override |
| Specify if the algorithm is clonable. More...
|
|
virtual unsigned int | cardinality () const override |
| Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
|
|
virtual StatusCode | sysExecute (const EventContext &ctx) override |
| Execute an algorithm. More...
|
|
virtual const DataObjIDColl & | extraOutputDeps () const override |
| Return the list of extra output dependencies. More...
|
|
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 . 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 | 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 |
|
|
ServiceHandle< Muon::IMuonIdHelperSvc > | m_idHelperSvc |
|
SG::ReadHandleKey< Muon::TgcPrepDataContainer > | m_keyTgc {this, "TgcKey", "TGC_MeasurementsAllBCs"} |
| Prep data container keys. More...
|
|
SG::ReadHandleKey< Muon::RpcPrepDataContainer > | m_keyRpc {this, "RpcKey", "RPC_Measurements"} |
|
SG::ReadHandleKey< Muon::MdtPrepDataContainer > | m_keyMdt {this, "MdtKey", "MDT_DriftCircles"} |
|
SG::ReadHandleKey< Muon::sTgcPrepDataContainer > | m_keysTgc {this, "sTgcKey", "STGC_Measurements"} |
|
SG::ReadHandleKey< Muon::MMPrepDataContainer > | m_keyMM {this, "MmKey", "MM_Measurements"} |
|
SG::ReadHandleKeyArray< SegmentSeedContainer > | m_readKeys {this, "Patterns", {"MuonHoughStationSegmentSeeds"}} |
|
SG::ReadHandleKey< ActsGeometryContext > | m_geoCtxKey {this, "AlignmentKey", "ActsAlignment", "cond handle key"} |
|
SG::WriteHandleKey<::MuonPatternCombinationCollection > | m_combiKey {this, "PatternCombiKey", "MuonLayerHoughCombis"} |
|
SG::WriteHandleKey< Muon::HoughDataPerSectorVec > | m_dataPerSecKey |
|
DataObjIDColl | m_extendedExtraObjects |
| Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. 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 |
|
The MuonPatternCnvAlg converts the SegmentSeeds produced by the R4 pattern recognition chain into the segment seeds that can be consumed by the legacy muon segment maker.
Definition at line 22 of file PatternCnvAlg.h.
◆ StoreGateSvc_t
◆ cardinality()
Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
Override this to return 0 for reentrant algorithms.
Override this to return 0 for reentrant algorithms.
Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.
◆ convertMaximum()
: Converts the maximum back into the HoughDataPersector
Definition at line 132 of file PatternCnvAlg.cxx.
135 if (houghDataSec.
vec.empty()) {
136 constexpr
unsigned int nSectors = 16;
137 houghDataSec.
vec.resize(nSectors);
138 for (
unsigned int i = 0;
i < nSectors; ++
i) {
139 houghDataSec.
vec[
i].sector =
i + 1;
144 const DetIdx_t regionIndex =
m_idHelperSvc->regionIndex(chId);
150 auto convertedMax = std::make_unique<LegacyMax>();
152 convertedMax->theta =
intersect.intersectDirection().theta();
154 std::unique_ptr<MuonHough::Hit> hit{};
163 hit = std::make_unique<MuonHough::Hit>(0, barrel ? gp.perp() : gp.z(),
164 barrel ? gp.z() : gp.perp(),
165 barrel ? gp.z() : gp.perp(),
167 convertedMax->hits.emplace_back(std::move(hit));
169 houghDataSec.
vec[sector-1].maxVec[sectorLayerHash].push_back(std::move(convertedMax));
◆ convertSeed()
Converts each segment seed first into a PatternCombination - serving as input for the legacy segment builder chain - and then to an entry of the hough data per sector.
- Parameters
-
ctx | The event context of the current event |
seedContainer | Segment seed container to convert |
patternContainer | Output patternCombination collection container |
houghDataSec | Hough input data per sector. |
Definition at line 55 of file PatternCnvAlg.cxx.
76 for (
const SegmentSeed* seed: seedContainer) {
79 std::unordered_set<Identifier> channelsInMax{};
81 channelsInMax.insert(hit->identify());
82 if (hit->secondaryMeasurement()) {
86 std::vector<const Trk::PrepRawData*> trkHits{};
87 trkHits.reserve(channelsInMax.size());
92 trkHits.push_back(
fetchPrd(chId, mdtPrds));
95 trkHits.push_back(
fetchPrd(chId, rpcPrds));
98 trkHits.push_back(
fetchPrd(chId, tgcPrds));
101 trkHits.push_back(
fetchPrd(chId, mmPrds));
104 trkHits.push_back(
fetchPrd(chId, stgcPrds));
107 ATH_MSG_WARNING(
"Cscs are not part of the new paradigms. Where are they now coming from? "
111 if (
std::find(trkHits.begin(), trkHits.end(),
nullptr) != trkHits.end()){
113 return StatusCode::FAILURE;
124 std::vector<Muon::MuonPatternChamberIntersect> chamberData{std::move(chamberIsect)};
126 auto patternCombi = std::make_unique<Muon::MuonPatternCombination>(
nullptr, std::move(chamberData));
127 patternContainer.
push_back(std::move(patternCombi));
130 return StatusCode::SUCCESS;
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode MuonR4::PatternCnvAlg::execute |
( |
const EventContext & |
ctx | ) |
const |
|
finaloverride |
Definition at line 33 of file PatternCnvAlg.cxx.
36 auto translatedPatterns = std::make_unique<MuonPatternCombinationCollection>();
37 auto translatedHough = std::make_unique<Muon::HoughDataPerSectorVec>();
47 ATH_CHECK(patternHandle.record(std::move(translatedPatterns)));
50 ATH_CHECK(houghDataHandle.record(std::move(translatedHough)));
53 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
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()
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.
◆ fetchPrd()
Definition at line 174 of file PatternCnvAlg.cxx.
177 ATH_MSG_ERROR(
"Cannot fetch a prep data object as the container given for "<<
186 for (
const PrdType* prd : *coll) {
187 if (prd->identify() == prdId){
◆ filterPassed()
◆ initialize()
StatusCode MuonR4::PatternCnvAlg::initialize |
( |
| ) |
|
|
finaloverride |
◆ inputHandles()
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() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
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()
◆ renounceArray()
◆ setFilterPassed()
◆ sysExecute()
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.
◆ sysInitialize()
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 InputMakerBase, and HypoBase.
Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.
110 if (
sc.isFailure()) {
118 if ( cs.retrieve().isFailure() ) {
120 return StatusCode::SUCCESS;
122 if (cs->regHandle(
this,*
h).isFailure()) {
123 sc = StatusCode::FAILURE;
124 ATH_MSG_ERROR(
"unable to register WriteCondHandle " <<
h->fullKey()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_combiKey
◆ m_dataPerSecKey
Initial value:{this, "HoughDataPerSecKey",
"HoughDataPerSectorVec", "HoughDataPerSectorVec key"}
Definition at line 73 of file PatternCnvAlg.h.
◆ m_detStore
◆ m_evtStore
◆ m_extendedExtraObjects
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_geoCtxKey
◆ m_idHelperSvc
Initial value:{this, "MuonIdHelperSvc",
"Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
Definition at line 60 of file PatternCnvAlg.h.
◆ m_keyMdt
◆ m_keyMM
◆ m_keyRpc
◆ m_keysTgc
◆ m_keyTgc
◆ m_readKeys
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
StatusCode convertSeed(const EventContext &ctx, const SegmentSeedContainer &seedContainer, ::MuonPatternCombinationCollection &patternContainer, Muon::HoughDataPerSectorVec &houghDataSec) const
Converts each segment seed first into a PatternCombination - serving as input for the legacy segment ...
MuonLayerHough & hough(int sector, DetRegIdx region, LayIdx layer)
access precision transform
Template for Muon PRD containers (which are basically collections of MuonPrepDataCollections).
const Identifier & identify(const UncalibratedMeasurement *meas)
Returns the associated identifier from the muon measurement.
SG::ReadHandleKey< ActsGeometryContext > m_geoCtxKey
std::string find(const std::string &s)
return a remapped string
double angle(const Amg::Vector3D &v1, const Amg::Vector3D &v2)
calculates the opening angle between two vectors
SG::ReadHandleKey< Muon::TgcPrepDataContainer > m_keyTgc
Prep data container keys.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
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)
static unsigned int sectorLayerHash(DetectorRegionIndex detectorRegionIndex, LayerIndex layerIndex)
create a hash out of region and layer
SG::WriteHandleKey< Muon::HoughDataPerSectorVec > m_dataPerSecKey
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
SG::ReadHandleKeyArray< SegmentSeedContainer > m_readKeys
#define ATH_MSG_VERBOSE(x)
Property holding a SG store/key/clid from which a ReadHandle is made.
HoughMaximum::HitType HoughHitType
virtual void setOwner(IDataHandleHolder *o)=0
virtual const DataObjIDColl & extraOutputDeps() const override
Return the list of extra output dependencies.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
const PrdType * fetchPrd(const Identifier &prdId, const Muon::MuonPrepDataContainerT< PrdType > *prdContainer) const
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
This class holds information needed for the Moore and MoMu pattern recognition for a muon chamber.
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
Eigen::Affine3d Transform3D
std::vector< HoughDataPerSec > vec
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Template to hold collections of MuonPrepRawData objects.
SG::WriteHandleKey<::MuonPatternCombinationCollection > m_combiKey
Include the GeoPrimitives which need to be put first.
virtual void renounce()=0
MuonHough::MuonDetectorHough detectorHoughTransforms
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
SG::ReadHandleKey< Muon::RpcPrepDataContainer > m_keyRpc
DataVector< SegmentSeed > SegmentSeedContainer
value_type push_back(value_type pElem)
Add an element to the end of the collection.
Class to represent measurements from the Monitored Drift Tubes.
Eigen::Matrix< double, 3, 1 > Vector3D
virtual const T * indexFindPtr(IdentifierHash hashId) const override final
return pointer on the found entry or null if out of range using hashed index - fast version,...
void convertMaximum(const Muon::MuonPatternChamberIntersect &intersect, Muon::HoughDataPerSectorVec &houghDataSec) const
: Converts the maximum back into the HoughDataPersector
SG::ReadHandleKey< Muon::MMPrepDataContainer > m_keyMM
std::optional< double > intersect(const AmgVector(N)&posA, const AmgVector(N)&dirA, const AmgVector(N)&posB, const AmgVector(N)&dirB)
Calculates the point B' along the line B that's closest to a second line A.
#define ATH_MSG_WARNING(x)
SG::ReadHandleKey< Muon::MdtPrepDataContainer > m_keyMdt
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
virtual StatusCode sysInitialize() override
Override sysInitialize.
Class representing clusters in the muon system.
SG::ReadHandleKey< Muon::sTgcPrepDataContainer > m_keysTgc
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
TechnologyIndex
enum to classify the different layers in the muon spectrometer
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc