ATLAS Offline Software
MdtSegmentT0Fitter.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // Fitting for in situ calibration of segments
6 #ifndef MUON_MDTSEGMENTT0FITTER_H
7 #define MUON_MDTSEGMENTT0FITTER_H
8 
10 #include "GaudiKernel/ToolHandle.h"
11 #include "GaudiKernel/ServiceHandle.h"
12 
15 
18 
19 #include <atomic>
20 #include <vector>
21 #include <memory>
22 
23 namespace TrkDriftCircleMath {
24 
25  class MdtSegmentT0Fitter : public AthAlgTool, public DCSLFitter, virtual public Muon::IDCSLFitProvider {
26  public:
27 
28  MdtSegmentT0Fitter(const std::string&,const std::string&,const IInterface*);
29  virtual ~MdtSegmentT0Fitter()=default;
30  virtual StatusCode initialize() override;
31  virtual StatusCode finalize() override;
32 
33  virtual bool fit( Segment& result, const Line& line, const DCOnTrackVec& dcs, double t0Seed ) const override;
34  virtual bool fit( Segment& result, const Line& line, const DCOnTrackVec& dcs, const HitSelection& selection, double t0Seed ) const override;
35 
36  virtual const DCSLFitter* getFitter() const override { return this; }
37 
38  private:
39 
40  SG::ReadCondHandleKey<MuonCalib::MdtCalibDataContainer> m_calibDbKey{this, "CalibDataKey", "MdtCalibConstants",
41  "Conditions object containing the calibrations"};
42 
43  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
44 
45  Gaudi::Property<bool> m_rejectWeakTopologies{this,"RejectWeakTopologies",true,"reject topolgies that do not have at least one +- combination in one multilayer"};
46  Gaudi::Property<bool> m_scaleErrors{this,"RescaleErrors",true,"rescale errors in fit"};
47  Gaudi::Property<bool> m_propagateErrors{this,"PropagateErrors",true,"propagate errors"};
48  Gaudi::Property<int> m_minHits{this,"MinimumHits",4,"minimum number of selected hits for t0 fit. Otherwise use default"};
49  Gaudi::Property<float> m_dRTol{this,"dRTolerance",0.1};
50 
51  Gaudi::Property<bool> m_floatDir{this, "FloatSegDirection", false,
52  "If set to true, the line of the segment is simultaenously fitted with t0"};
53  // counters
54  mutable std::atomic_uint m_ntotalCalls{0};
55  mutable std::atomic_uint m_npassedNHits{0};
56  mutable std::atomic_uint m_npassedSelectionConsistency{0};
57  mutable std::atomic_uint m_npassedNSelectedHits{0};
58  mutable std::atomic_uint m_npassedMinHits{0};
59  mutable std::atomic_uint m_npassedMinuitFit{0};
60 
61  };
62 
63  inline bool MdtSegmentT0Fitter::fit( Segment& result, const Line& line, const DCOnTrackVec& dcs, double t0Seed ) const {
64  HitSelection selection(dcs.size(),0);
65  return fit( result, line, dcs, selection, t0Seed );
66  }
67 }
68 
69 #endif
TrkDriftCircleMath::MdtSegmentT0Fitter::m_ntotalCalls
std::atomic_uint m_ntotalCalls
Definition: MdtSegmentT0Fitter.h:54
checkFileSG.line
line
Definition: checkFileSG.py:75
get_generator_info.result
result
Definition: get_generator_info.py:21
TrkDriftCircleMath::DCOnTrackVec
std::vector< DCOnTrack > DCOnTrackVec
Definition: DCOnTrack.h:59
TrkDriftCircleMath::MdtSegmentT0Fitter::m_npassedNSelectedHits
std::atomic_uint m_npassedNSelectedHits
Definition: MdtSegmentT0Fitter.h:57
TrkDriftCircleMath::MdtSegmentT0Fitter::~MdtSegmentT0Fitter
virtual ~MdtSegmentT0Fitter()=default
TrkDriftCircleMath::MdtSegmentT0Fitter::m_npassedMinuitFit
std::atomic_uint m_npassedMinuitFit
Definition: MdtSegmentT0Fitter.h:59
MdtCalibDataContainer.h
TrkDriftCircleMath::MdtSegmentT0Fitter::m_dRTol
Gaudi::Property< float > m_dRTol
Definition: MdtSegmentT0Fitter.h:49
TrkDriftCircleMath::HitSelection
std::vector< bool > HitSelection
Definition: HitSelection.h:9
TrkDriftCircleMath::MdtSegmentT0Fitter::finalize
virtual StatusCode finalize() override
Definition: MdtSegmentT0Fitter.cxx:179
TrkDriftCircleMath::MdtSegmentT0Fitter::m_scaleErrors
Gaudi::Property< bool > m_scaleErrors
Definition: MdtSegmentT0Fitter.h:46
TrkDriftCircleMath::DCSLFitter
Definition: Tracking/TrkUtilityPackages/TrkDriftCircleMath/TrkDriftCircleMath/DCSLFitter.h:17
TrkDriftCircleMath
Function object to check whether two Segments are sub/super sets or different.
Definition: IMdtSegmentFinder.h:13
TrkDriftCircleMath::MdtSegmentT0Fitter::m_rejectWeakTopologies
Gaudi::Property< bool > m_rejectWeakTopologies
Definition: MdtSegmentT0Fitter.h:45
DCSLFitter.h
TrkDriftCircleMath::MdtSegmentT0Fitter::MdtSegmentT0Fitter
MdtSegmentT0Fitter(const std::string &, const std::string &, const IInterface *)
Definition: MdtSegmentT0Fitter.cxx:168
TrkDriftCircleMath::MdtSegmentT0Fitter::initialize
virtual StatusCode initialize() override
Definition: MdtSegmentT0Fitter.cxx:174
TrkDriftCircleMath::Segment
Definition: Tracking/TrkUtilityPackages/TrkDriftCircleMath/TrkDriftCircleMath/Segment.h:18
TrkDriftCircleMath::Line
Definition: Line.h:17
TrkDriftCircleMath::MdtSegmentT0Fitter::m_npassedNHits
std::atomic_uint m_npassedNHits
Definition: MdtSegmentT0Fitter.h:55
TrkDriftCircleMath::MdtSegmentT0Fitter
Definition: MdtSegmentT0Fitter.h:25
TrkDriftCircleMath::MdtSegmentT0Fitter::m_minHits
Gaudi::Property< int > m_minHits
Definition: MdtSegmentT0Fitter.h:48
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrkDriftCircleMath::MdtSegmentT0Fitter::m_npassedMinHits
std::atomic_uint m_npassedMinHits
Definition: MdtSegmentT0Fitter.h:58
AthAlgTool.h
ReadCondHandleKey.h
TrkDriftCircleMath::MdtSegmentT0Fitter::getFitter
virtual const DCSLFitter * getFitter() const override
fitter factory
Definition: MdtSegmentT0Fitter.h:36
selection
const std::string selection
Definition: fbtTestBasics.cxx:74
TrkDriftCircleMath::MdtSegmentT0Fitter::m_propagateErrors
Gaudi::Property< bool > m_propagateErrors
Definition: MdtSegmentT0Fitter.h:47
Muon::IDCSLFitProvider
Interface for tools resolving ambigueties and remove outliers in Muon::MuonSegment objects.
Definition: IDCSLFitProvider.h:18
SG::ReadCondHandleKey< MuonCalib::MdtCalibDataContainer >
TrkDriftCircleMath::MdtSegmentT0Fitter::m_floatDir
Gaudi::Property< bool > m_floatDir
Definition: MdtSegmentT0Fitter.h:51
TrkDriftCircleMath::MdtSegmentT0Fitter::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MdtSegmentT0Fitter.h:43
IDCSLFitProvider.h
TrkDriftCircleMath::MdtSegmentT0Fitter::m_npassedSelectionConsistency
std::atomic_uint m_npassedSelectionConsistency
Definition: MdtSegmentT0Fitter.h:56
AthAlgTool
Definition: AthAlgTool.h:26
TrkDriftCircleMath::MdtSegmentT0Fitter::m_calibDbKey
SG::ReadCondHandleKey< MuonCalib::MdtCalibDataContainer > m_calibDbKey
Definition: MdtSegmentT0Fitter.h:40
TrkDriftCircleMath::MdtSegmentT0Fitter::fit
virtual bool fit(Segment &result, const Line &line, const DCOnTrackVec &dcs, double t0Seed) const override
Definition: MdtSegmentT0Fitter.h:63
ServiceHandle< Muon::IMuonIdHelperSvc >