ATLAS Offline Software
MuonCalibSegment.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // MuonCalibSegment.h
6 // Header file for class MuonCalibSegment
7 
8 #ifndef MUONCALIB_MUONCALIBSEGMENT_H
9 #define MUONCALIB_MUONCALIBSEGMENT_H
10 
11 // stl includes
12 #include <iostream>
13 #include <memory>
14 #include <vector>
15 
21 
22 namespace MuonCalib {
40  public:
41  /* typedefs */
42 
43  using MdtHitPtr = std::shared_ptr<MdtCalibHitBase>;
45  using MdtHitVec = std::vector<MdtHitPtr>;
46 
47  using CscHitPtr = std::shared_ptr<const CscCalibHitBase>;
49  using CscHitVec = std::vector<CscHitPtr>;
50 
51  using RpcHitPtr = std::shared_ptr<const RpcCalibHitBase>;
53  using RpcHitVec = std::vector<RpcHitPtr>;
54 
55  using TgcHitPtr = std::shared_ptr<const TgcCalibHitBase>;
57  using TgcHitVec = std::vector<TgcHitPtr>;
58 
59  public:
61  double chi2, const Amg::Vector3D& pos, const Amg::Vector3D& dir, const Amg::Transform3D& locToGlo,
62  unsigned int qualityFlag = 0);
65  virtual ~MuonCalibSegment();
66 
67  /* set routines */
68  void set(double chi2, const Amg::Vector3D& pos, const Amg::Vector3D& dir);
69  void setSegment(const Amg::Vector3D& pos, const Amg::Vector3D& dir);
70  void setErrors(double error_dy0, double error_dtheta);
71 
72  void setAuthor(int author);
73  void setFittedT0(double t0);
74 
75  /* member access */
76 
77  /* number of hits in segment */
78  unsigned int hitsOnTrack() const;
79  unsigned int closeHits() const;
80 
81  unsigned int mdtHitsOnTrack() const;
82  unsigned int mdtCloseHits() const;
83 
84  unsigned int cscHitsOnTrack() const;
85  unsigned int cscCloseHits() const;
86 
87  unsigned int rpcHitsOnTrack() const;
88  unsigned int rpcCloseHits() const;
89 
90  unsigned int tgcHitsOnTrack() const;
91  unsigned int tgcCloseHits() const;
92 
93  unsigned int hitsPerML(int ML) const;
94  unsigned int missedHits() const;
95  unsigned int deltaHits() const;
96  unsigned int emptyTubes() const;
97  unsigned int outOfTimeHits() const;
98 
99  /* hit vectors */
100  const MdtHitVec& mdtHOT() const;
101  const MdtHitVec& mdtClose() const;
102 
103  const CscHitVec& cscHOT() const;
104  const CscHitVec& cscClose() const;
105 
106  const RpcHitVec& rpcHOT() const;
107  const RpcHitVec& rpcClose() const;
108 
109  const TgcHitVec& tgcHOT() const;
110  const TgcHitVec& tgcClose() const;
111 
112  MdtHitVec& mdtHOT();
113  MdtHitVec& mdtClose();
114 
115  CscHitVec& cscHOT();
116  CscHitVec& cscClose();
117 
118  RpcHitVec& rpcHOT();
119  RpcHitVec& rpcClose();
120 
121  TgcHitVec& tgcHOT();
122  TgcHitVec& tgcClose();
123 
124  /* member access */
125  double chi2() const;
126  double error_dy0() const;
127  double error_dtheta() const;
128  bool hasFittedT0() const;
129  double fittedT0() const;
130  const Amg::Vector3D& position() const;
131  const Amg::Vector3D& direction() const;
132 
134  const Amg::Transform3D& localToGlobal() const;
135  Amg::Vector3D globalPosition() const;
137 
138  int author() const;
139  unsigned int qualityFlag() const;
140 
141  /* methodes to add XxxCalibHitBase's */
142  void addHitOnTrack(MdtCalibHitBase* hit);
143  void addCloseHit(MdtCalibHitBase* hit);
144 
145  void addHitOnTrack(CscCalibHitBase* hit);
146  void addCloseHit(CscCalibHitBase* hit);
147 
148  void addHitOnTrack(RpcCalibHitBase* hit);
149  void addCloseHit(RpcCalibHitBase* hit);
150 
151  void addHitOnTrack(TgcCalibHitBase* hit);
152  void addCloseHit(TgcCalibHitBase* hit);
153 
155  void addHitOnTrack(const MdtHitPtr& hit);
156  void addCloseHit(const MdtHitPtr& hit);
157 
158  void addHitOnTrack(const CscHitPtr& hit);
159  void addCloseHit(const CscHitPtr& hit);
160 
161  void addHitOnTrack(const RpcHitPtr& hit);
162  void addCloseHit(const RpcHitPtr& hit);
163 
164  void addHitOnTrack(const TgcHitPtr& hit);
165  void addCloseHit(const TgcHitPtr& hit);
166 
167  void refineMdtSelection(const std::vector<unsigned int>& new_selection);
168  std::ostream& dump(std::ostream& stream) const;
169 
170  private:
171  static constexpr double s_dummy_ctor_dbl{-99999.};
172  void copy(const MuonCalibSegment& other);
176 
179 
182 
185 
186  /* local track parameters in chamber coordinates */
187  double m_chi2{FLT_MAX};
188  double m_dy0{FLT_MAX};
189  double m_dtheta{FLT_MAX};
194  unsigned int m_qualityFlag{0};
195  int m_author{-1};
196  };
197 
198 } // namespace MuonCalib
199 
200 std::ostream& operator<<(std::ostream& stream, const MuonCalib::MuonCalibSegment& seg);
201 
202 #endif
MuonCalib::MuonCalibSegment::addCloseHit
void addCloseHit(MdtCalibHitBase *hit)
add the mdt hit to the set nearby the segment
Definition: MuonCalibSegment.cxx:195
MuonCalib::MuonCalibSegment::hitsOnTrack
unsigned int hitsOnTrack() const
retrieve the sum of all XxxCalibHits assigned to the MuonCalibSegment
Definition: MuonCalibSegment.cxx:136
MuonCalib::MuonCalibSegment::m_cscHitsOnTrack
CscHitVec m_cscHitsOnTrack
set of CscCalibHitBase s assigned to the segment
Definition: MuonCalibSegment.h:177
MuonCalib::MuonCalibSegment::m_mdtHitsOnTrack
MdtHitVec m_mdtHitsOnTrack
hits
Definition: MuonCalibSegment.h:174
MuonCalib::MuonCalibSegment::m_dtheta
double m_dtheta
error on local direction
Definition: MuonCalibSegment.h:189
MuonCalib::TgcCalibHitBase
Definition: TgcCalibHitBase.h:43
MuonCalib::MuonCalibSegment::cscHOT
const CscHitVec & cscHOT() const
retrieve the full set of CscCalibHitBase s assigned to this segment
Definition: MuonCalibSegment.cxx:157
MuonCalib::MuonCalibSegment::emptyTubes
unsigned int emptyTubes() const
number of empty tubes of this segment
Definition: MuonCalibSegment.cxx:143
operator<<
std::ostream & operator<<(std::ostream &stream, const MuonCalib::MuonCalibSegment &seg)
Definition: MuonCalibSegment.cxx:220
MuonCalib::MuonCalibSegment::s_dummy_ctor_dbl
static constexpr double s_dummy_ctor_dbl
Definition: MuonCalibSegment.h:171
MuonCalib::MuonCalibSegment::setSegment
void setSegment(const Amg::Vector3D &pos, const Amg::Vector3D &dir)
Definition: MuonCalibSegment.cxx:115
MuonCalib::MuonCalibSegment::MdtHitVec
std::vector< MdtHitPtr > MdtHitVec
Definition: MuonCalibSegment.h:45
ALFA_EventTPCnv_Dict::t0
std::vector< ALFA_RawData_p1 > t0
Definition: ALFA_EventTPCnvDict.h:42
MuonCalib::CscCalibHitBase
Definition: CscCalibHitBase.h:38
MuonCalib::MuonCalibSegment::outOfTimeHits
unsigned int outOfTimeHits() const
number of hits out of time of this segment
Definition: MuonCalibSegment.cxx:144
MuonCalib::MuonCalibSegment::m_tgcCloseHits
TgcHitVec m_tgcCloseHits
set of tgc hits nearby the segment
Definition: MuonCalibSegment.h:184
MuonCalib::MuonCalibSegment
Definition: MuonCalibSegment.h:39
MuonCalib::MuonCalibSegment::hasFittedT0
bool hasFittedT0() const
check whether t0 was fitted
Definition: MuonCalibSegment.cxx:112
MuonCalib::MuonCalibSegment::position
const Amg::Vector3D & position() const
retrieve local position of segment (on station level)
Definition: MuonCalibSegment.cxx:186
MuonCalib::MuonCalibSegment::RpcHitPtr
std::shared_ptr< const RpcCalibHitBase > RpcHitPtr
typedef for a collection of RpcCalibHitBase s
Definition: MuonCalibSegment.h:52
MuonCalib::MuonCalibSegment::~MuonCalibSegment
virtual ~MuonCalibSegment()
destructor
MuonCalib::MuonCalibSegment::globalPosition
Amg::Vector3D globalPosition() const
retrieve global position
Definition: MuonCalibSegment.cxx:190
MuonCalib::MuonCalibSegment::m_mdtCloseHits
MdtHitVec m_mdtCloseHits
set of mdt hits nearby the segment
Definition: MuonCalibSegment.h:175
MuonCalib::MuonCalibSegment::qualityFlag
unsigned int qualityFlag() const
retrieve the Fit quality flag
Definition: MuonCalibSegment.cxx:127
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
MuonCalib::MuonCalibSegment::rpcHOT
const RpcHitVec & rpcHOT() const
retrieve the full set of RpcCalibHitBase s assigned to this segment
Definition: MuonCalibSegment.cxx:166
MuonCalib::MuonCalibSegment::RpcHitVec
std::vector< RpcHitPtr > RpcHitVec
Definition: MuonCalibSegment.h:53
MuonCalib::MuonCalibSegment::direction
const Amg::Vector3D & direction() const
retrieve local direction of segment (on station level) retrieve the transformation from local chamber...
Definition: MuonCalibSegment.cxx:187
MuonCalib::MuonCalibSegment::CscHitVec
std::vector< CscHitPtr > CscHitVec
Definition: MuonCalibSegment.h:49
MuonCalib::MuonCalibSegment::MuonCalibSegment
MuonCalibSegment(double chi2, const Amg::Vector3D &pos, const Amg::Vector3D &dir, const Amg::Transform3D &locToGlo, unsigned int qualityFlag=0)
constructor fully initializing the segment-parameters, do we need default constructor?
Definition: MuonCalibSegment.cxx:16
MuonCalib::MuonCalibSegment::mdtCloseHits
unsigned int mdtCloseHits() const
retrieve the number of nearby mdt hits.
Definition: MuonCalibSegment.cxx:151
GeoPrimitives.h
MuonCalib::MuonCalibSegment::cscHitsOnTrack
unsigned int cscHitsOnTrack() const
retrieve the number of CscCalibHitBase s assigned to this segment
Definition: MuonCalibSegment.cxx:156
MuonCalib::MuonCalibSegment::tgcHOT
const TgcHitVec & tgcHOT() const
retrieve the full set of TgcCalibHitBase s assigned to this segment
Definition: MuonCalibSegment.cxx:175
MuonCalib::MuonCalibSegment::cscCloseHits
unsigned int cscCloseHits() const
retrieve the number of nearby csc hits.
Definition: MuonCalibSegment.cxx:160
MuonCalib::MuonCalibSegment::m_rpcHitsOnTrack
RpcHitVec m_rpcHitsOnTrack
set of RpcCalibHitBase s assigned to the segment
Definition: MuonCalibSegment.h:180
MuonCalib::MuonCalibSegment::tgcCloseHits
unsigned int tgcCloseHits() const
retrieve the number of nearby tgc hits.
Definition: MuonCalibSegment.cxx:178
MuonCalib::MuonCalibSegment::cscClose
const CscHitVec & cscClose() const
retrieve the full set of nearby mdt hits of this segment.
Definition: MuonCalibSegment.cxx:161
MuonCalib::MuonCalibSegment::m_dy0
double m_dy0
error on local position
Definition: MuonCalibSegment.h:188
MuonCalib::MuonCalibSegment::operator=
MuonCalibSegment & operator=(const MuonCalibSegment &seg)
assignment operator
Definition: MuonCalibSegment.cxx:56
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
MuonCalib::MuonCalibSegment::refineMdtSelection
void refineMdtSelection(const std::vector< unsigned int > &new_selection)
move trck hits to close hits
Definition: MuonCalibSegment.cxx:94
MuonCalib::MuonCalibSegment::tgcHitsOnTrack
unsigned int tgcHitsOnTrack() const
retrieve the number of TgcCalibHitBase s assigned to this segment
Definition: MuonCalibSegment.cxx:174
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition: CscCalcPed.cxx:22
MuonCalib::MuonCalibSegment::m_fittedT0
double m_fittedT0
fitted t0
Definition: MuonCalibSegment.h:193
MuonCalib::MuonCalibSegment::rpcCloseHits
unsigned int rpcCloseHits() const
retrieve the number of nearby rpc hits.
Definition: MuonCalibSegment.cxx:169
MuonCalib::MuonCalibSegment::rpcHitsOnTrack
unsigned int rpcHitsOnTrack() const
retrieve the number of RpcCalibHitBase s assigned to this segment
Definition: MuonCalibSegment.cxx:165
MuonCalib::MuonCalibSegment::fittedT0
double fittedT0() const
retrieve fitted T0, return -99999 if no fit was performed
Definition: MuonCalibSegment.cxx:113
RpcCalibHitBase.h
MuonCalib::MuonCalibSegment::CscHitPtr
std::shared_ptr< const CscCalibHitBase > CscHitPtr
typedef for a collection of CscCalibHitBase s
Definition: MuonCalibSegment.h:48
MuonCalib::MuonCalibSegment::deltaHits
unsigned int deltaHits() const
number of delta hits of this segment
Definition: MuonCalibSegment.cxx:142
beamspotman.dir
string dir
Definition: beamspotman.py:623
MuonCalib::MuonCalibSegment::author
int author() const
retrieve the segment author
Definition: MuonCalibSegment.cxx:126
MuonCalib::MuonCalibSegment::closeHits
unsigned int closeHits() const
retrieve the sum of all hits close to the MuonCalibSegment.
Definition: MuonCalibSegment.cxx:138
MuonCalib::MuonCalibSegment::m_rpcCloseHits
RpcHitVec m_rpcCloseHits
set of rpc hits nearby the segment
Definition: MuonCalibSegment.h:181
MuonCalib::MuonCalibSegment::mdtHitsOnTrack
unsigned int mdtHitsOnTrack() const
retrieve the number of MdtCalibHitBase s assigned to this segment
Definition: MuonCalibSegment.cxx:147
MuonCalib::MuonCalibSegment::copy
void copy(const MuonCalibSegment &other)
Definition: MuonCalibSegment.cxx:21
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
MuonCalib::MuonCalibSegment::m_tgcHitsOnTrack
TgcHitVec m_tgcHitsOnTrack
set of TgcCalibHitBase s assigned to the segment
Definition: MuonCalibSegment.h:183
MuonCalib::MuonCalibSegment::tgcClose
const TgcHitVec & tgcClose() const
retrieve the full set of nearby mdt hits of this segment.
Definition: MuonCalibSegment.cxx:179
MuonCalib::MuonCalibSegment::setFittedT0
void setFittedT0(double t0)
sets t0 field
Definition: MuonCalibSegment.cxx:124
MuonCalib::MuonCalibSegment::set
void set(double chi2, const Amg::Vector3D &pos, const Amg::Vector3D &dir)
Definition: MuonCalibSegment.cxx:129
MuonCalib::MuonCalibSegment::error_dtheta
double error_dtheta() const
retrieve error angle
Definition: MuonCalibSegment.cxx:185
MuonCalib::MuonCalibSegment::addHitOnTrack
void addHitOnTrack(MdtCalibHitBase *hit)
add the MdtCalibHitBase to the set assigned to the segment
Definition: MuonCalibSegment.cxx:194
MuonCalib::MuonCalibSegment::m_localPosition
Amg::Vector3D m_localPosition
position in station (local) coordinates
Definition: MuonCalibSegment.h:190
MuonCalib::MuonCalibSegment::globalDirection
Amg::Vector3D globalDirection() const
retrieve global direction
Definition: MuonCalibSegment.cxx:191
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
MuonCalib::MdtCalibHitBase
Definition: MdtCalibHitBase.h:38
TgcCalibHitBase.h
MuonCalib::MuonCalibSegment::TgcHitVec
std::vector< TgcHitPtr > TgcHitVec
Definition: MuonCalibSegment.h:57
MuonCalib::MuonCalibSegment::missedHits
unsigned int missedHits() const
number of missed hits of this segment (out of time + empty tubes)
Definition: MuonCalibSegment.cxx:141
MuonCalib::MuonCalibSegment::rpcClose
const RpcHitVec & rpcClose() const
retrieve the full set of nearby mdt hits of this segment.
Definition: MuonCalibSegment.cxx:170
MuonCalib::MuonCalibSegment::m_cscCloseHits
CscHitVec m_cscCloseHits
set of csc hits nearby the segment
Definition: MuonCalibSegment.h:178
MuonCalib::MuonCalibSegment::error_dy0
double error_dy0() const
retrieve error position
Definition: MuonCalibSegment.cxx:184
MuonCalib::MuonCalibSegment::setErrors
void setErrors(double error_dy0, double error_dtheta)
sets Local errors on MuonCalibSegment parameters
Definition: MuonCalibSegment.cxx:119
MuonCalib::MuonCalibSegment::chi2
double chi2() const
retrieve chi2
Definition: MuonCalibSegment.cxx:183
MuonCalib::MuonCalibSegment::TgcHitPtr
std::shared_ptr< const TgcCalibHitBase > TgcHitPtr
typedef for a collection of TgcCalibHitBase s
Definition: MuonCalibSegment.h:56
MuonCalib::MuonCalibSegment::mdtHOT
const MdtHitVec & mdtHOT() const
retrieve the full set of MdtCalibHitBase s assigned to this segment
Definition: MuonCalibSegment.cxx:148
MuonCalib::MuonCalibSegment::m_localToGlobal
Amg::Transform3D m_localToGlobal
transformation local->global
Definition: MuonCalibSegment.h:192
MuonCalib::MuonCalibSegment::m_qualityFlag
unsigned int m_qualityFlag
flag describing the fit quality
Definition: MuonCalibSegment.h:194
MuonCalib::MuonCalibSegment::dump
std::ostream & dump(std::ostream &stream) const
Definition: MuonCalibSegment.cxx:66
MuonCalib::RpcCalibHitBase
Definition: RpcCalibHitBase.h:47
MuonCalib::MuonCalibSegment::m_localDirection
Amg::Vector3D m_localDirection
direction in station (local) coordinates
Definition: MuonCalibSegment.h:191
CscCalibHitBase.h
MuonCalib::MuonCalibSegment::localToGlobal
const Amg::Transform3D & localToGlobal() const
Definition: MuonCalibSegment.cxx:188
MuonCalib::MuonCalibSegment::hitsPerML
unsigned int hitsPerML(int ML) const
number of hits per multilayer of this segment
Definition: MuonCalibSegment.cxx:60
MdtCalibHitBase.h
MuonCalib::MuonCalibSegment::setAuthor
void setAuthor(int author)
sets author field
Definition: MuonCalibSegment.cxx:123
MuonCalib::MuonCalibSegment::mdtClose
const MdtHitVec & mdtClose() const
retrieve the full set of nearby mdt hits of this segment.
Definition: MuonCalibSegment.cxx:152
MuonCalib::MuonCalibSegment::MdtHitPtr
std::shared_ptr< MdtCalibHitBase > MdtHitPtr
typedef for a collection of MdtCalibHitBase s
Definition: MuonCalibSegment.h:44
MuonCalib::MuonCalibSegment::m_author
int m_author
author flag
Definition: MuonCalibSegment.h:195
MuonCalib::MuonCalibSegment::m_chi2
double m_chi2
goodness of (DC)fit
Definition: MuonCalibSegment.h:187