|
ATLAS Offline Software
|
#include <MuonLayerSegmentFinderTool.h>
|
| MuonLayerSegmentFinderTool (const std::string &type, const std::string &name, const IInterface *parent) |
| Default AlgTool functions. More...
|
|
virtual | ~MuonLayerSegmentFinderTool ()=default |
|
StatusCode | initialize () override |
|
void | find (const EventContext &ctx, const MuonSystemExtension::Intersection &intersection, const MuonLayerPrepRawData &layerPrepRawData, std::vector< std::shared_ptr< const Muon::MuonSegment > > &segments) const override |
| IMuonLayerSegmentFinderTool interface: find. More...
|
|
void | findMdtSegmentsFromHough (const EventContext &ctx, const MuonSystemExtension::Intersection &intersection, std::vector< std::shared_ptr< const Muon::MuonSegment > > &segments) const override |
|
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 |
|
|
void | findClusterSegments (const EventContext &ctx, const MuonSystemExtension::Intersection &intersection, const MuonLayerPrepRawData &layerPrepRawData, std::vector< std::shared_ptr< const Muon::MuonSegment > > &segments) const |
| find segments from PRD clusters More...
|
|
void | findCscSegments (const EventContext &ctx, const MuonLayerPrepRawData &layerPrepRawData, std::vector< std::shared_ptr< const Muon::MuonSegment > > &segments) const |
| find csc segments More...
|
|
void | findMdtSegments (const MuonSystemExtension::Intersection &intersection, const MuonLayerPrepRawData &layerPrepRawData, std::vector< std::shared_ptr< const Muon::MuonSegment > > &segments) const |
| find mdt segments from hits in the layer More...
|
|
void | findMdtSegments (const MuonSystemExtension::Intersection &intersection, const std::vector< const MdtDriftCircleOnTrack * > &mdts, const std::vector< const MuonClusterOnTrack * > &clusters, std::vector< std::shared_ptr< const Muon::MuonSegment > > &segments) const |
| find mdt segments main routine More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
◆ StoreGateSvc_t
◆ MuonLayerSegmentFinderTool()
Muon::MuonLayerSegmentFinderTool::MuonLayerSegmentFinderTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~MuonLayerSegmentFinderTool()
virtual Muon::MuonLayerSegmentFinderTool::~MuonLayerSegmentFinderTool |
( |
| ) |
|
|
virtualdefault |
◆ 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);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ 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]
◆ 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
◆ find()
◆ findClusterSegments()
find segments from PRD clusters
Find whether the segment has some hits that are needed
Nope
Segment is compatible
If no NSW was reconstructed thus far there's no hope that we'll do it later as well. Give up Lasst, die Ihr eintretet, alle Hoffnung fahren!
Definition at line 97 of file MuonLayerSegmentFinderTool.cxx.
101 if (!layerPrepRawData.cscs.empty())
findCscSegments(ctx, layerPrepRawData, segments);
104 if (layerPrepRawData.mms.empty() && layerPrepRawData.stgcs.empty())
return;
107 MuonLayerROTs layerROTs;
113 ATH_MSG_DEBUG(
" MM prds " << layerPrepRawData.mms.size() <<
" STGC prds " << layerPrepRawData.stgcs.size());
116 const std::vector<const MuonClusterOnTrack*>& clustersSTGC = layerROTs.getClusters(
MuonStationIndex::STGC);
117 const std::vector<const MuonClusterOnTrack*>& clustersMM = layerROTs.getClusters(
MuonStationIndex::MM);
120 NSWSegmentCache cache{};
123 if (!clustersSTGC.empty()) {
125 std::transform(clustersSTGC.begin(), clustersSTGC.end(), std::back_inserter(cache.inputClust),
129 if (!clustersMM.empty()) {
131 std::transform(clustersMM.begin(), clustersMM.end(), std::back_inserter(cache.inputClust),
134 if (cache.inputClust.empty())
return;
138 std::set<Identifier> needed_rios{};
139 for (std::unique_ptr<const MuonClusterOnTrack>& clus : cache.inputClust) {
140 needed_rios.insert(clus->identify());
146 if (
intersection.trackParameters->associatedSurface().center().z() * seg->globalPosition().z() < 0)
continue;
150 for (
size_t n = 0; !hasNSW &&
n < seg->numberOfContainedROTs(); ++
n) {
151 const MuonClusterOnTrack *clus =
dynamic_cast<const MuonClusterOnTrack *
>(seg->rioOnTrack(
n));
152 hasNSW |= (clus && needed_rios.count(clus->identify()));
155 if (!hasNSW)
continue;
166 for (std::unique_ptr<MuonSegment>& seg : cache.constructedSegs) {
168 segments.emplace_back(std::move(seg));
◆ findCscSegments()
find csc segments
Definition at line 172 of file MuonLayerSegmentFinderTool.cxx.
175 std::unique_ptr<MuonSegmentCombinationCollection> combi2D =
m_csc2dSegmentFinder->find(layerPrepRawData.cscs, ctx);
176 if (!combi2D)
return;
179 std::unique_ptr<MuonSegmentCombinationCollection> combi4D =
m_csc4dSegmentFinder->find(*combi2D, ctx);
180 if (!combi4D)
return;
183 for (
auto com : *combi4D) {
188 for (
unsigned int i = 0;
i < nstations; ++
i) {
193 if (!segs || segs->empty())
continue;
195 for (std::unique_ptr<MuonSegment>& seg_it : *segs) {
197 segments.emplace_back(std::move(seg_it));
◆ findMdtSegments() [1/2]
find mdt segments from hits in the layer
◆ findMdtSegments() [2/2]
find mdt segments main routine
◆ findMdtSegmentsFromHough()
Implements Muon::IMuonLayerSegmentFinderTool.
Definition at line 202 of file MuonLayerSegmentFinderTool.cxx.
207 unsigned int nprevSegments = segments.size();
214 if (!houghDataPerSectorVec.isValid()) {
220 if (
static_cast<int>(houghDataPerSectorVec->vec.size()) <= sector - 1) {
221 ATH_MSG_WARNING(
" MuonLayerHoughTool::HoughDataPerSectorVec smaller than sector "
222 << houghDataPerSectorVec->vec.size() <<
" sector " << sector);
232 << houghDataPerSectorVec->vec.size() <<
" " << houghDataPerSector.maxVec.size());
235 if (houghDataPerSector.maxVec.size() <= sectorLayerHash) {
236 ATH_MSG_WARNING(
" houghDataPerSector.maxVec.size() smaller than hash " << houghDataPerSector.maxVec.size()
237 <<
" hash " << sectorLayerHash);
254 float x = barrelLike ?
r :
z;
255 float y = barrelLike ?
z :
r;
256 float theta = std::atan2(
x,
y);
258 ATH_MSG_DEBUG(
" Got Hough maxima " << maxVec.size() <<
" extrapolated position in Hough space (" <<
x <<
"," <<
y
259 <<
") error " << errx <<
" "
260 <<
" angle " << theta);
263 std::vector<std::unique_ptr<const Trk::MeasurementBase>> garbage;
264 auto handleMdt = [
this,
intersection, &garbage](
const MdtPrepData& prd, std::vector<const MdtDriftCircleOnTrack*>& mdts) {
268 garbage.emplace_back(mdt);
274 std::vector<const MuonClusterOnTrack*>&
clusters) {
276 if (!cluster)
return;
278 garbage.emplace_back(cluster);
283 MuonLayerHoughTool::MaximumVec::const_iterator mit = maxVec.begin();
284 MuonLayerHoughTool::MaximumVec::const_iterator mit_end = maxVec.end();
285 for (; mit != mit_end; ++mit) {
292 float pull =
residual / std::hypot(errx , maxwidth * OneOverSqrt12);
295 ATH_MSG_DEBUG(
" Hough maximum " << maximum.
max <<
" position (" << refPos <<
"," << maximum.
pos
297 <<
" residual " << residualTheta);
300 if (std::abs(
pull) > 5)
continue;
303 std::vector<const MdtDriftCircleOnTrack*> mdts;
304 std::vector<const MuonClusterOnTrack*>
clusters;
305 for (
const auto& hit : maximum.
hits) {
309 for (
const auto& prd : hit->tgc->etaCluster) {
312 }
else if (hit->prd) {
315 handleMdt(
static_cast<const MdtPrepData&
>(*hit->prd), mdts);
323 houghDataPerSector.phiMaxVec[
intersection.layerSurface.regionIndex];
324 ATH_MSG_DEBUG(
" Got Phi Hough maxima " << phiMaxVec.size() <<
" phi " << phi);
327 MuonLayerHoughTool::PhiMaximumVec::const_iterator pit = phiMaxVec.begin();
328 MuonLayerHoughTool::PhiMaximumVec::const_iterator pit_end = phiMaxVec.end();
329 for (; pit != pit_end; ++pit) {
336 for (
const auto& phi_hit : maximum.
hits) {
339 Identifier id = phi_hit->tgc->phiCluster.front()->identify();
341 for (
const auto& prd : phi_hit->tgc->phiCluster) handleCluster(*prd,
clusters);
342 }
else if (phi_hit->prd) {
356 ATH_MSG_DEBUG(
" Done maximum: new segments " << segments.size() - nprevSegments);
358 ATH_MSG_DEBUG(
" Done with layer: new segments " << segments.size() - nprevSegments);
◆ initialize()
StatusCode Muon::MuonLayerSegmentFinderTool::initialize |
( |
| ) |
|
|
override |
◆ 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.
◆ interfaceID()
static const InterfaceID& Muon::IMuonLayerSegmentFinderTool::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
IAlgTool interface.
Definition at line 22 of file IMuonLayerSegmentFinderTool.h.
23 static const InterfaceID IID_IMuonLayerSegmentFinderTool(
"Muon::IMuonLayerSegmentFinderTool", 1, 0);
24 return IID_IMuonLayerSegmentFinderTool;
◆ 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()
◆ sysInitialize()
◆ 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_clusterSegMakerNSW
◆ m_csc2dSegmentFinder
◆ m_csc4dSegmentFinder
◆ m_detStore
◆ m_evtStore
◆ m_houghDataPerSectorVecKey
Initial value:{this, "HoughKey",
"", "HoughDataPerSectorVec key"}
Use the hough data to find sectors in the speectrometer traversed by a muon.
Definition at line 110 of file MuonLayerSegmentFinderTool.h.
◆ m_idHelperSvc
◆ m_muonPRDSelectionTool
Initial value:{
this,
"MuonPRDSelectionTool",
"Muon::MuonPRDSelectionTool/MuonPRDSelectionTool",
}
Definition at line 80 of file MuonLayerSegmentFinderTool.h.
◆ m_muonSectorMapping
◆ m_patternSegs
◆ m_printer
Initial value:{
this,
"MuonEDMPrinterTool",
"Muon::MuonEDMPrinterTool/MuonEDMPrinterTool",
}
Definition at line 75 of file MuonLayerSegmentFinderTool.h.
◆ m_segmentMaker
◆ m_segmentMatchingTool
Initial value:{
this, "MuonLayerSegmentMatchingTool", "Muon::MuonLayerSegmentMatchingTool/MuonLayerSegmentMatchingTool"}
Definition at line 106 of file MuonLayerSegmentFinderTool.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
double transformRToSector(double r, double phi, int sector, bool toSector=true) const
expresses a radial position from and to the sector coordinate frame, the phi position should always b...
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
RegionDescriptor m_descriptor
LayerIndex
enum to classify the different layers in the muon spectrometer
static unsigned int sectorLayerHash(DetectorRegionIndex detectorRegionIndex, LayerIndex layerIndex)
create a hash out of region and layer
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
SegmentVec * stationSegments(unsigned int index) const
Access to segments in a given station.
#define ATH_MSG_VERBOSE(x)
bool empty() const
Test if the key is blank.
std::vector< std::string > intersection(std::vector< std::string > &v1, std::vector< std::string > &v2)
MuonSegment_v1 MuonSegment
Reference the current persistent version:
virtual void setOwner(IDataHandleHolder *o)=0
struct representing the maximum in the hough space
static const std::string & regionName(DetectorRegionIndex index)
convert DetectorRegionIndex into a string
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
static const std::string & layerName(LayerIndex index)
convert LayerIndex into a string
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.
const MuonLayerHough * hough
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
DetectorRegionIndex
enum to classify the different layers in the muon spectrometer
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
#define ATH_MSG_WARNING(x)
std::vector< std::unique_ptr< MuonSegment > > SegmentVec
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
unsigned int numberOfStations() const
Number of stations with segment.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Base class for Muon cluster RIO_OnTracks.