 |
ATLAS Offline Software
|
#include <MuonLayerSegmentFinderTool.h>
|
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...
|
|
◆ ~MuonLayerSegmentFinderTool()
virtual Muon::MuonLayerSegmentFinderTool::~MuonLayerSegmentFinderTool |
( |
| ) |
|
|
virtualdefault |
◆ 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 94 of file MuonLayerSegmentFinderTool.cxx.
98 if (!layerPrepRawData.cscs.empty())
findCscSegments(ctx, layerPrepRawData, segments);
101 if (layerPrepRawData.mms.empty() && layerPrepRawData.stgcs.empty())
return;
104 MuonLayerROTs layerROTs;
110 ATH_MSG_DEBUG(
" MM prds " << layerPrepRawData.mms.size() <<
" STGC prds " << layerPrepRawData.stgcs.size());
113 const std::vector<const MuonClusterOnTrack*>& clustersSTGC = layerROTs.getClusters(
TechnologyIndex::STGC);
114 const std::vector<const MuonClusterOnTrack*>& clustersMM = layerROTs.getClusters(
TechnologyIndex::MM);
117 NSWSegmentCache cache{};
120 if (!clustersSTGC.empty()) {
122 std::transform(clustersSTGC.begin(), clustersSTGC.end(), std::back_inserter(cache.inputClust),
126 if (!clustersMM.empty()) {
128 std::transform(clustersMM.begin(), clustersMM.end(), std::back_inserter(cache.inputClust),
131 if (cache.inputClust.empty())
return;
135 std::set<Identifier> needed_rios{};
136 for (std::unique_ptr<const MuonClusterOnTrack>& clus : cache.inputClust) {
137 needed_rios.insert(clus->identify());
143 if (
intersection.trackParameters->associatedSurface().center().z() * seg->globalPosition().z() < 0)
continue;
147 for (
size_t n = 0; !hasNSW &&
n < seg->numberOfContainedROTs(); ++
n) {
148 const MuonClusterOnTrack *clus =
dynamic_cast<const MuonClusterOnTrack *
>(seg->rioOnTrack(
n));
149 hasNSW |= (clus && needed_rios.count(clus->identify()));
152 if (!hasNSW)
continue;
163 for (std::unique_ptr<MuonSegment>& seg : cache.constructedSegs) {
165 segments.emplace_back(std::move(seg));
◆ findCscSegments()
find csc segments
Definition at line 169 of file MuonLayerSegmentFinderTool.cxx.
172 std::unique_ptr<MuonSegmentCombinationCollection> combi2D =
m_csc2dSegmentFinder->find(layerPrepRawData.cscs, ctx);
173 if (!combi2D)
return;
176 std::unique_ptr<MuonSegmentCombinationCollection> combi4D =
m_csc4dSegmentFinder->find(*combi2D, ctx);
177 if (!combi4D)
return;
180 for (
auto com : *combi4D) {
185 for (
unsigned int i = 0;
i < nstations; ++
i) {
190 if (!segs || segs->empty())
continue;
192 for (std::unique_ptr<MuonSegment>& seg_it : *segs) {
194 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()
Definition at line 199 of file MuonLayerSegmentFinderTool.cxx.
204 unsigned int nprevSegments = segments.size();
211 if (!houghDataPerSectorVec.isValid()) {
217 if (
static_cast<int>(houghDataPerSectorVec->vec.size()) <= sector - 1) {
218 ATH_MSG_WARNING(
" MuonLayerHoughTool::HoughDataPerSectorVec smaller than sector "
219 << houghDataPerSectorVec->vec.size() <<
" sector " << sector);
229 << houghDataPerSectorVec->vec.size() <<
" " << houghDataPerSector.maxVec.size());
233 ATH_MSG_WARNING(
" houghDataPerSector.maxVec.size() smaller than hash " << houghDataPerSector.maxVec.size()
251 float x = barrelLike ?
r :
z;
252 float y = barrelLike ?
z :
r;
253 float theta = std::atan2(
x,
y);
255 ATH_MSG_DEBUG(
" Got Hough maxima " << maxVec.size() <<
" extrapolated position in Hough space (" <<
x <<
"," <<
y
256 <<
") error " << errx <<
" "
257 <<
" angle " << theta);
260 std::vector<std::unique_ptr<const Trk::MeasurementBase>> garbage;
261 auto handleMdt = [
this,
intersection, &garbage](
const MdtPrepData& prd, std::vector<const MdtDriftCircleOnTrack*>& mdts) {
265 garbage.emplace_back(mdt);
271 std::vector<const MuonClusterOnTrack*>&
clusters) {
273 if (!cluster)
return;
275 garbage.emplace_back(cluster);
280 MuonLayerHoughTool::MaximumVec::const_iterator mit = maxVec.begin();
281 MuonLayerHoughTool::MaximumVec::const_iterator mit_end = maxVec.end();
282 for (; mit != mit_end; ++mit) {
289 float pull =
residual / std::hypot(errx , maxwidth * OneOverSqrt12);
292 ATH_MSG_DEBUG(
" Hough maximum " << maximum.
max <<
" position (" << refPos <<
"," << maximum.
pos
294 <<
" residual " << residualTheta);
297 if (std::abs(
pull) > 5)
continue;
300 std::vector<const MdtDriftCircleOnTrack*> mdts;
301 std::vector<const MuonClusterOnTrack*>
clusters;
302 for (
const auto& hit : maximum.
hits) {
306 for (
const auto& prd : hit->tgc->etaCluster) {
309 }
else if (hit->prd) {
312 handleMdt(
static_cast<const MdtPrepData&
>(*hit->prd), mdts);
321 ATH_MSG_DEBUG(
" Got Phi Hough maxima " << phiMaxVec.size() <<
" phi " << phi);
324 MuonLayerHoughTool::PhiMaximumVec::const_iterator pit = phiMaxVec.begin();
325 MuonLayerHoughTool::PhiMaximumVec::const_iterator pit_end = phiMaxVec.end();
326 for (; pit != pit_end; ++pit) {
333 for (
const auto& phi_hit : maximum.
hits) {
336 Identifier id = phi_hit->tgc->phiCluster.front()->identify();
338 for (
const auto& prd : phi_hit->tgc->phiCluster) handleCluster(*prd,
clusters);
339 }
else if (phi_hit->prd) {
353 ATH_MSG_DEBUG(
" Done maximum: new segments " << segments.size() - nprevSegments);
355 ATH_MSG_DEBUG(
" Done with layer: new segments " << segments.size() - nprevSegments);
◆ initialize()
StatusCode Muon::MuonLayerSegmentFinderTool::initialize |
( |
| ) |
|
|
override |
◆ m_clusterSegMakerNSW
◆ m_csc2dSegmentFinder
◆ m_csc4dSegmentFinder
◆ 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.
The documentation for this class was generated from the following files:
LayerIndex
enum to classify the different layers in the muon spectrometer
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...
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
RegionDescriptor m_descriptor
unsigned int sectorLayerHash(DetectorRegionIndex detectorRegionIndex, LayerIndex layerIndex)
create a hash out of region and layer
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:
struct representing the maximum in the hough space
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
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
const std::string & layerName(LayerIndex index)
convert LayerIndex into a string
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 ...
constexpr int toInt(const ParamDefs p)
const std::string & regionName(DetectorRegionIndex index)
convert DetectorRegionIndex into a string
DetectorRegionIndex
enum to classify the different layers in the muon spectrometer
#define ATH_MSG_WARNING(x)
std::vector< std::unique_ptr< MuonSegment > > SegmentVec
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
unsigned int numberOfStations() const
Number of stations with segment.
Base class for Muon cluster RIO_OnTracks.