ATLAS Offline Software
MuonTSOSHelper.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 #include <memory>
9 
10 namespace Muon {
11 
13  public:
15  static std::unique_ptr<Trk::TrackStateOnSurface> cloneTSOS(const Trk::TrackStateOnSurface& tsos,
17  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern = tsos.types();
21  typePattern.set(Trk::TrackStateOnSurface::Outlier, false);
22  typePattern.set(type);
23 
24  return std::make_unique<Trk::TrackStateOnSurface>(
25  tsos.fitQualityOnSurface(),
26  tsos.measurementOnTrack() ? tsos.measurementOnTrack()->uniqueClone() : nullptr,
27  tsos.trackParameters() ? tsos.trackParameters()->uniqueClone() : nullptr,
28  tsos.materialEffectsOnTrack() ? tsos.materialEffectsOnTrack()->uniqueClone() : nullptr,
29  typePattern);
30  }
31 
33  static std::unique_ptr<Trk::TrackStateOnSurface>
37  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern = tsos.types();
41  typePattern.set(Trk::TrackStateOnSurface::Outlier, false);
42  typePattern.set(type);
43 
44  return std::make_unique<Trk::TrackStateOnSurface>(
45  tsos.fitQualityOnSurface(),
46  meas.uniqueClone(),
47  pars.uniqueClone(),
49  typePattern);
50  }
51 
53  static std::unique_ptr<Trk::TrackStateOnSurface>
54  createPerigeeTSOS(std::unique_ptr<Trk::TrackParameters> perigee) {
55  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern;
56  typePattern.set(Trk::TrackStateOnSurface::Perigee);
57  return std::make_unique<Trk::TrackStateOnSurface>(nullptr, std::move(perigee), nullptr, typePattern);
58  }
59 
61  static std::unique_ptr<Trk::TrackStateOnSurface>
62  createMeasTSOS(std::unique_ptr<Trk::MeasurementBase> meas,
63  std::unique_ptr<Trk::TrackParameters> pars,
65  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern;
67  typePattern.set(type);
68  return std::make_unique<Trk::TrackStateOnSurface>(std::move(meas), std::move(pars), nullptr, typePattern);
69  }
70 
71 
73  static std::unique_ptr<Trk::TrackStateOnSurface>
74  createMeasTSOSWithUpdate(const Trk::TrackStateOnSurface& tsos, std::unique_ptr<Trk::MeasurementBase> meas,
75  std::unique_ptr<Trk::TrackParameters> pars,
77  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern = tsos.types();
81  typePattern.set(Trk::TrackStateOnSurface::Outlier, false);
82  typePattern.set(type);
83  return std::make_unique<Trk::TrackStateOnSurface>(
84  tsos.fitQualityOnSurface(),
85  std::move(meas),
86  std::move(pars),
88  typePattern);
89  }
90 
92  static std::unique_ptr<Trk::TrackStateOnSurface> createHoleTSOS(std::unique_ptr<Trk::TrackParameters> pars) {
93  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern;
94  typePattern.set(Trk::TrackStateOnSurface::Hole);
95  return std::make_unique<Trk::TrackStateOnSurface>(nullptr, std::move(pars), nullptr, typePattern);
96  }
97  };
98 } // namespace Muon
Muon::MuonTSOSHelper::cloneTSOS
static std::unique_ptr< Trk::TrackStateOnSurface > cloneTSOS(const Trk::TrackStateOnSurface &tsos, Trk::TrackStateOnSurface::TrackStateOnSurfaceType type)
clone input, update the type
Definition: MuonTSOSHelper.h:15
Muon::MuonTSOSHelper::createPerigeeTSOS
static std::unique_ptr< Trk::TrackStateOnSurface > createPerigeeTSOS(std::unique_ptr< Trk::TrackParameters > perigee)
create a perigee TSOS, takes ownership of the Perigee
Definition: MuonTSOSHelper.h:54
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
Trk::TrackStateOnSurface::trackParameters
const TrackParameters * trackParameters() const
return ptr to trackparameters const overload
Trk::TrackStateOnSurface::Perigee
@ Perigee
This represents a perigee, and so will contain a Perigee object only.
Definition: TrackStateOnSurface.h:117
Trk::TrackStateOnSurface::TrackStateOnSurfaceType
TrackStateOnSurfaceType
Definition: TrackStateOnSurface.h:98
TrackParameters.h
MeasurementBase.h
Trk::ParametersBase::uniqueClone
std::unique_ptr< ParametersBase< DIM, T > > uniqueClone() const
clone method for polymorphic deep copy returning unique_ptr; it is not overriden, but uses the existi...
Definition: ParametersBase.h:97
Muon::MuonTSOSHelper::createHoleTSOS
static std::unique_ptr< Trk::TrackStateOnSurface > createHoleTSOS(std::unique_ptr< Trk::TrackParameters > pars)
create a hole TSOS, takes ownership of the pointers
Definition: MuonTSOSHelper.h:92
Trk::TrackStateOnSurface::measurementOnTrack
const MeasurementBase * measurementOnTrack() const
returns MeasurementBase const overload
Trk::TrackStateOnSurface::types
const std::bitset< NumberOfTrackStateOnSurfaceTypes > types() const
returns a bitset with the types of this bitset.
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:49
Trk::MaterialEffectsBase::uniqueClone
std::unique_ptr< MaterialEffectsBase > uniqueClone() const
NVI uniqueClone.
Definition: MaterialEffectsBase.h:87
Trk::TrackStateOnSurface::fitQualityOnSurface
const FitQualityOnSurface & fitQualityOnSurface() const
return FitQuality On Surface const overload
Trk::TrackStateOnSurface::Outlier
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
Definition: TrackStateOnSurface.h:122
Muon::MuonTSOSHelper
Definition: MuonTSOSHelper.h:12
Trk::TrackStateOnSurface::Hole
@ Hole
A hole on the track - this is defined in the following way.
Definition: TrackStateOnSurface.h:128
Trk::TrackStateOnSurface::materialEffectsOnTrack
const MaterialEffectsBase * materialEffectsOnTrack() const
return material effects const overload
Trk::MeasurementBase::uniqueClone
std::unique_ptr< MeasurementBase > uniqueClone() const
NVI Clone giving up unique pointer.
Definition: MeasurementBase.h:77
Muon::MuonTSOSHelper::createMeasTSOS
static std::unique_ptr< Trk::TrackStateOnSurface > createMeasTSOS(std::unique_ptr< Trk::MeasurementBase > meas, std::unique_ptr< Trk::TrackParameters > pars, Trk::TrackStateOnSurface::TrackStateOnSurfaceType type)
create a TSOS with a measurement, takes ownership of the pointers
Definition: MuonTSOSHelper.h:62
Trk::ParametersBase
Definition: ParametersBase.h:55
Muon::MuonTSOSHelper::cloneTSOSWithUpdate
static std::unique_ptr< Trk::TrackStateOnSurface > cloneTSOSWithUpdate(const Trk::TrackStateOnSurface &tsos, const Trk::MeasurementBase &meas, const Trk::TrackParameters &pars, Trk::TrackStateOnSurface::TrackStateOnSurfaceType type)
clone input, replacing the track parameteres and the measurement base and updating the type
Definition: MuonTSOSHelper.h:34
Trk::MeasurementBase
Definition: MeasurementBase.h:58
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Muon::MuonTSOSHelper::createMeasTSOSWithUpdate
static std::unique_ptr< Trk::TrackStateOnSurface > createMeasTSOSWithUpdate(const Trk::TrackStateOnSurface &tsos, std::unique_ptr< Trk::MeasurementBase > meas, std::unique_ptr< Trk::TrackParameters > pars, Trk::TrackStateOnSurface::TrackStateOnSurfaceType type)
create a TSOS with a measurement, takes ownership of the pointers
Definition: MuonTSOSHelper.h:74
Trk::TrackStateOnSurface::Measurement
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
Definition: TrackStateOnSurface.h:101
TrackStateOnSurface.h