|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef MUON_MUONTRACKCLEANER_H
6 #define MUON_MUONTRACKCLEANER_H
9 #include "GaudiKernel/ServiceHandle.h"
10 #include "GaudiKernel/ToolHandle.h"
37 class TrackStateOnSurface;
38 class MeasurementBase;
59 std::optional<Trk::ResidualPull>
resPull{std::nullopt};
60 std::unique_ptr<MdtDriftCircleOnTrack>
flippedMdt{
nullptr};
93 typedef std::vector<MCTBCleaningInfo>
InfoVec;
96 typedef std::set<const Trk::MeasurementBase*>
MeasSet;
109 return sortTracks(r1.track.get(), r2.track.get());
131 typedef std::vector<std::pair<double, Identifier>>
PullChVec;
135 bool operator()(
const std::pair<double, Identifier>& entry1,
const std::pair<double, Identifier>& entry2)
const {
136 return entry1.first > entry2.first;
202 MuonTrackCleaner(
const std::string&,
const std::string&,
const IInterface*);
214 std::unique_ptr<Trk::Track>
clean(
const Trk::Track&
track,
const EventContext& ctx)
const override;
221 std::unique_ptr<Trk::Track>
clean(
const Trk::Track&
track,
const std::set<Identifier>& chamberRemovalExclusionList,
222 const EventContext& ctx)
const override;
232 double calcPull(
const double residual,
const double locMesCov,
const double locTrkCov,
const bool& trkStateIsUnbiased)
const;
284 "Trk::GlobalChi2Fitter/MCTBFitterMaterialFromTrack",
286 ToolHandle<Trk::ITrackFitter>
m_slTrackFitter{
this,
"SLFitter",
"Trk::GlobalChi2Fitter/MCTBSLFitterMaterialFromTrack"};
287 ToolHandle<Trk::IUpdator>
m_measurementUpdator{
this,
"MeasurementUpdator",
"Trk::KalmanUpdator/MuonMeasUpdator"};
288 ToolHandle<Muon::IMdtDriftCircleOnTrackCreator>
m_mdtRotCreator{
this,
"MdtRotCreator",
289 "Muon::MdtDriftCircleOnTrackCreator/MdtDriftCircleOnTrackCreator"};
291 this,
"CompRotCreator",
"Muon::TriggerChamberClusterOnTrackCreator/TriggerChamberClusterOnTrackCreator"};
293 "Trk::ResidualPullCalculator/ResidualPullCalculator"};
295 "Handle to the service providing the IMuonEDMHelperSvc interface"};
296 PublicToolHandle<Muon::MuonEDMPrinterTool>
m_printer{
this,
"Printer",
"Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"};
298 ToolHandle<Trk::IExtrapolator>
m_extrapolator{
this,
"Extrapolator",
"Trk::Extrapolator/AtlasExtrapolator"};
301 "Name of the Magnetic Field conditions object key"};
304 Gaudi::Property<double>
m_chi2Cut{
this,
"Chi2Cut", 100.};
309 Gaudi::Property<unsigned int>
m_ncycles{
this,
"CleaningCycles", 5};
315 Gaudi::Property<double>
m_adcCut{
this,
"AdcCut", 50.};
320 bool extractChambersToBeRemoved(CleaningState& state, std::set<Identifier>& chambersToBeRemovedSet,
bool usePhi =
false)
const;
322 static std::string
print(ChamberLayerStatistics& statistics) ;
JetConstituentVector::iterator iterator
unsigned int nrecoverableOutliers
~MuonTrackCleaner()=default
destructor
ToolHandle< Trk::IUpdator > m_measurementUpdator
MCTBCleaningInfo(const Identifier &i, const Identifier &chi, MuonStationIndex::ChIndex chIn, bool inB, double r, double p, const Trk::TrackStateOnSurface *orState, const Trk::MeasurementBase *me, const Trk::TrackParameters *par, std::optional< Trk::ResidualPull > &&resP, const Trk::FitQuality *fq)
struct to store return values of chamber removal, contains the new track plus a list the removed hits
ChamberLayerStatistics()=default
std::unique_ptr< MdtDriftCircleOnTrack > flippedMdt
unsigned int nPseudoMeasurements
PullChVec chambersToBeRemovedPhi
bool isOutsideOnTrackCut(const Identifier &id, double res, double pull, double cutScaleFactor) const
check whether hit is an outlier
Gaudi::Property< unsigned int > m_ncycles
Gaudi::Property< double > m_pullCutPhi
MeasSet largePullMeasurements
std::vector< std::unique_ptr< Trk::TrackParameters > > parsToBeDeleted
Gaudi::Property< double > m_pullCut
ChamberPullInfo pullSumTrigEta
ChamberRemovalOutput removeChamber(const EventContext &ctx, const std::unique_ptr< Trk::Track > &track, Identifier chId, bool removePhi, bool removeEta, CleaningState &state) const
remove chamber from track
MuonTrackCleaner(const std::string &, const std::string &, const IInterface *)
constructor
Gaudi::Property< bool > m_useMdtResiCut
bool operator()(const ChamberRemovalOutput &r1, const ChamberRemovalOutput &r2) const
ToolHandle< Muon::IMdtDriftCircleOnTrackCreator > m_mdtRotCreator
std::unique_ptr< const CompetingMuonClustersOnTrack > cleanedCompROT
ChamberPullInfo()=default
bool checkPhiConstraint(CleaningState &state) const
std::set< MuonStationIndex::StIndex > stations
MuonStationIndex::ChIndex chIndex
Gaudi::Property< bool > m_cleanCompROTs
ServiceHandle< Muon::IMuonEDMHelperSvc > m_edmHelperSvc
PullChVec::iterator PullChIt
std::set< MuonStationIndex::PhiIndex > phiLayers
bool checkStations(CleaningState &state) const
ChamberPullInfo pullSumPhi
const Trk::ResidualPull * calculateResPul(const Trk::MeasurementBase &meas, const Trk::TrackParameters &pars) const
calculate Residual/Pull for a given MeasurementBase + TrackParameters, ownership is transfered to use...
const Trk::TrackStateOnSurface * originalState
std::set< const Trk::MeasurementBase * > MeasSet
This class containes residual and pull information.
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Gaudi::Property< double > m_avePullSumPerChamberCut
std::unique_ptr< Trk::Track > cleanTrack(const EventContext &ctx, const Trk::Track *track, CleaningState &state) const
clean a track, actual implementation
ToolHandle< Trk::ITrackFitter > m_slTrackFitter
Gaudi::Property< bool > m_flipMdtDriftRadii
const Trk::MeasurementBase * meas
std::vector< std::pair< double, Identifier > > PullChVec
std::unique_ptr< Trk::Track > hitCleaning(const EventContext &ctx, std::unique_ptr< Trk::Track > track, CleaningState &state) const
remove bad hits from track.
MCTBCleaningInfo(const Trk::TrackStateOnSurface *orState)
ToolHandle< Trk::IExtrapolator > m_extrapolator
MeasSet largePullPseudoMeasurements
unsigned int numberOfCleanedCompROTs
static void unremoveHits(ChamberRemovalOutput &result)
void init(const EventContext &ctx, const Trk::Track &track, CleaningState &state) const
init cleaner
PullChVec chambersToBeRemoved
std::vector< MCTBCleaningInfo * > removedHits
std::map< Identifier, ChamberPullInfo > PullChamberMap
PublicToolHandle< Muon::MuonEDMPrinterTool > m_printer
MCTBCleaningInfo(const Identifier &i, const Identifier &chi, MuonStationIndex::ChIndex chIn, bool inB, double r, double p, const Trk::TrackStateOnSurface *orState)
std::optional< Trk::ResidualPull > resPull
std::map< MuonStationIndex::ChIndex, ChamberLayerStatistics > chamberLayerStatistics
std::vector< MCTBCleaningInfo > InfoVec
ToolHandle< Trk::ITrackFitter > m_trackFitter
::StatusCode StatusCode
StatusCode definition for legacy code.
const Trk::TrackParameters * pars
std::pair< std::vector< unsigned int >, bool > res
std::set< Identifier > chamberRemovalExclusionList
Gaudi::Property< bool > m_use_slFit
void printStates(Trk::Track *track) const
Gaudi::Property< double > m_adcCut
Class to represent and store fit qualities from track reconstruction in terms of and number of degre...
Gaudi::Property< bool > m_recoverOutliers
std::unique_ptr< Trk::Track > outlierRecovery(const EventContext &ctx, std::unique_ptr< Trk::Track > track, CleaningState &state, const MuonStationIndex::ChIndex *currentIndex=nullptr) const
recover outliers that are within the cuts.
MuonStationIndex::ChIndex chIndex
ToolHandle< Trk::IResidualPullCalculator > m_pullCalculator
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
ATLAS_CHECK_FILE_THREAD_SAFETY
Ensure that the ATLAS eigen extensions are properly loaded.
represents the track state (measurement, material, fit parameters and quality) at a surface.
PullChamberMap::iterator PullChamberIt
PullChamberMap::const_iterator PullChamberCit
ChamberRemovalOutput()=default
EtaPhiPerChamberMap::iterator EtaPhiPerChamberIt
double calcPull(const double residual, const double locMesCov, const double locTrkCov, const bool &trkStateIsUnbiased) const
calculate the pull given measurement error and track error
std::unique_ptr< Trk::Track > track
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheCondObjInputKey
PullChamberMap pullSumPerChamberPhi
std::unique_ptr< Trk::Track > clean(const Trk::Track &track, const EventContext &ctx) const override
clean a track, returns a pointer to a new track if successfull.
bool extractChambersToBeRemoved(CleaningState &state, std::set< Identifier > &chambersToBeRemovedSet, bool usePhi=false) const
helper function to extract chambers that are to be removed
unsigned int numberOfFlippedMdts
The IMuonSegmentMaker is a pure virtual interface for tools to find tracks starting from MuonSegmentC...
StatusCode initialize() override
AlgTool initialize.
EtaPhiPerChamberMap hitsPerChamber
bool checkInnerConstraint(CleaningState &state) const
std::unique_ptr< Trk::Track > fitTrack(const EventContext &ctx, Trk::Track &track, Trk::ParticleHypothesis pHyp, bool slFit) const
unsigned int nPhiConstraints
PullChamberMap pullSumPerChamberEta
PullChamberMap pullSumPerChamber
Gaudi::Property< bool > m_onlyUseHitErrorInRecovery
Gaudi::Property< bool > m_iterate
std::unique_ptr< Trk::Track > cleanCompROTs(const EventContext &ctx, std::unique_ptr< Trk::Track > track, CleaningState &state) const
clean up competing ROTs that consist out of two clusters
ChIndex
enum to classify the different chamber layers in the muon spectrometer
std::map< Identifier, EtaPhiHits > EtaPhiPerChamberMap
Gaudi::Property< double > m_associationScaleFactor
bool operator()(const std::pair< double, Identifier > &entry1, const std::pair< double, Identifier > &entry2) const
Gaudi::Property< double > m_mdtResiCut
Define macros for attributes used to control the static checker.
EtaPhiPerChamberMap outBoundsPerChamber
static std::string print(ChamberLayerStatistics &statistics)
ToolHandle< IMuonCompetingClustersOnTrackCreator > m_compRotCreator
std::unique_ptr< Trk::Track > recoverFlippedMdt(const EventContext &ctx, std::unique_ptr< Trk::Track > track, CleaningState &state) const
flip signs of MDT hits with large pull if pull if the oppositely signed radius is small
const Trk::FitQuality * fitQ
Gaudi::Property< double > m_chi2Cut
std::unique_ptr< Trk::Track > chamberCleaning(const EventContext &ctx, std::unique_ptr< Trk::Track > track, CleaningState &state) const
remove bad chamber from track.