CMS 3D CMS Logo

DTSegmentCand.h
Go to the documentation of this file.
1 #ifndef DTSegment_DTSegmentCand_h
2 #define DTSegment_DTSegmentCand_h
3 
15 /* Base Class Headers */
16 
17 /* Collaborating Class Declarations */
19 
20 /* C++ Headers */
21 #include <vector>
22 #include <set>
23 #include <iostream>
24 
25 /* ====================================================================== */
26 
27 /* Class DTSegmentCand Interface */
28 
29 class DTSLRecSegment2D;
31 class DTChamber;
32 class DTSuperLayer;
33 
35 public:
36  struct AssPointLessZ;
37  typedef std::pair<std::shared_ptr<DTHitPairForFit>, DTEnums::DTCellSide> AssPoint;
38  typedef std::set<AssPoint, AssPointLessZ> AssPointCont;
39 
42 
46  double chi2,
47  const AlgebraicSymMatrix& covMat,
48  const DTSuperLayer* sl);
49 
51  virtual ~DTSegmentCand();
52 
53  /* Operations */
54  virtual bool good() const;
55 
56  virtual bool hitsShareLayer() const;
57 
58  virtual unsigned int nHits() const { return theHits.size(); }
59 
61  virtual double chi2() const { return theChi2; }
62 
64  virtual double chi2ndof() const { return theChi2 / (nHits() - 2.); }
65 
67  virtual double t0() const { return thet0; }
68 
70  virtual bool operator==(const DTSegmentCand& seg);
71 
73  virtual bool operator<(const DTSegmentCand& seg);
74 
76  const DTSuperLayer* superLayer() const { return theSL; }
77 
78  // in SL frame
79  virtual LocalPoint position() const { return thePosition; }
80 
81  // in SL frame
82  virtual LocalVector direction() const { return theDirection; }
83 
85  virtual AlgebraicSymMatrix covMatrix() const { return theCovMatrix; }
86 
87  virtual unsigned int NDOF() const { return nHits() - 2; }
88 
90  virtual void setPosition(LocalPoint& pos) { thePosition = pos; }
91 
94 
96  virtual void add(AssPoint newHit);
97  virtual void add(std::shared_ptr<DTHitPairForFit> hit, DTEnums::DTCellSide code);
98 
100  virtual void removeHit(AssPoint hit);
101 
103  virtual void setChi2(double& chi2) { theChi2 = chi2; }
104 
106  virtual void sett0(double& t0) { thet0 = t0; }
107 
109  virtual int nSharedHitPairs(const DTSegmentCand& seg) const;
110 
113  virtual AssPointCont conflictingHitPairs(const DTSegmentCand& seg) const;
114 
116  virtual void setCovMatrix(AlgebraicSymMatrix& cov) { theCovMatrix = cov; }
117 
119  virtual int nLayers() const;
120 
122  virtual const AssPointCont& hits() const { return theHits; }
123 
125  // DTSLRecSegment2D* convert() const;
126  operator DTSLRecSegment2D*() const;
127 
129  operator DTChamberRecSegment2D*() const;
130 
131  struct AssPointLessZ {
132  public:
133  bool operator()(const AssPoint& pt1, const AssPoint& pt2) const;
134  };
135 
136 private:
137  const DTSuperLayer* theSL; // the SL
138  LocalPoint thePosition; // in SL frame
139  LocalVector theDirection; // in SL frame
140  double theChi2; // chi2 of the fit
141  double thet0; // the t0 offset
142 
146  AlgebraicSymMatrix theCovMatrix; // the covariance matrix
147 
148  AssPointCont theHits; // the used hits
149 
150 protected:
151  static const double chi2max; // to be tuned!!
152  static const unsigned int nHitsMin; // to be tuned!!
153 };
154 
155 std::ostream& operator<<(std::ostream& out, const DTSegmentCand& seg);
156 std::ostream& operator<<(std::ostream& out, const DTSegmentCand::AssPoint& hit);
157 #endif // DTSegment_DTSegmentCand_h
Vector3DBase< float, LocalTag >
DTSegmentCand::t0
virtual double t0() const
the t0 of the segment
Definition: DTSegmentCand.h:67
DTSLRecSegment2D
Definition: DTSLRecSegment2D.h:15
DTSegmentCand::operator<
virtual bool operator<(const DTSegmentCand &seg)
less operator based on nHits and chi2
Definition: DTSegmentCand.cc:52
HLT_2018_cff.pt2
pt2
Definition: HLT_2018_cff.py:8552
DTSegmentCand::sett0
virtual void sett0(double &t0)
set t0
Definition: DTSegmentCand.h:106
DTSegmentCand::hitsShareLayer
virtual bool hitsShareLayer() const
Definition: DTSegmentCand.cc:113
DTSegmentCand::setPosition
virtual void setPosition(LocalPoint &pos)
set position
Definition: DTSegmentCand.h:90
pos
Definition: PixelAliasList.h:18
DTChamber
Definition: DTChamber.h:24
DTSegmentCand::direction
virtual LocalVector direction() const
Definition: DTSegmentCand.h:82
HLT_2018_cff.pt1
pt1
Definition: HLT_2018_cff.py:8550
DTSegmentCand::nHits
virtual unsigned int nHits() const
Definition: DTSegmentCand.h:58
DTSuperLayer
Definition: DTSuperLayer.h:24
DTSegmentCand::theCovMatrix
AlgebraicSymMatrix theCovMatrix
Definition: DTSegmentCand.h:146
DTSegmentCand::conflictingHitPairs
virtual AssPointCont conflictingHitPairs(const DTSegmentCand &seg) const
Definition: DTSegmentCand.cc:82
DTSegmentCand::nLayers
virtual int nLayers() const
number of different layers with hits
Definition: DTSegmentCand.cc:133
DTSegmentCand::setDirection
virtual void setDirection(LocalVector &dir)
set direction
Definition: DTSegmentCand.h:93
DTSegmentCand::NDOF
virtual unsigned int NDOF() const
Definition: DTSegmentCand.h:87
DTSegmentCand::AssPointLessZ
Definition: DTSegmentCand.h:131
DTSegmentCand::chi2max
static const double chi2max
Definition: DTSegmentCand.h:151
DTSegmentCand::superLayer
const DTSuperLayer * superLayer() const
the super layer on which relies
Definition: DTSegmentCand.h:76
DTSegmentCand::setChi2
virtual void setChi2(double &chi2)
set chi2
Definition: DTSegmentCand.h:103
DTSegmentCand::position
virtual LocalPoint position() const
Definition: DTSegmentCand.h:79
DTSegmentCand::AssPoint
std::pair< std::shared_ptr< DTHitPairForFit >, DTEnums::DTCellSide > AssPoint
Definition: DTSegmentCand.h:36
DTSegmentCand::hits
virtual const AssPointCont & hits() const
the used hits
Definition: DTSegmentCand.h:122
DTSegmentCand::thePosition
LocalPoint thePosition
Definition: DTSegmentCand.h:138
DTSegmentCand
Definition: DTSegmentCand.h:34
DTSegmentCand::theDirection
LocalVector theDirection
Definition: DTSegmentCand.h:139
DTSegmentCand::chi2
virtual double chi2() const
the chi2 (NOT chi2/NDOF) of the fit
Definition: DTSegmentCand.h:61
DTSegmentCand::add
virtual void add(AssPoint newHit)
add hits to the hit list.
Definition: DTSegmentCand.cc:58
Point3DBase< float, LocalTag >
DTSegmentCand::chi2ndof
virtual double chi2ndof() const
the chi2/NDOF of the fit
Definition: DTSegmentCand.h:64
DTSegmentCand::operator==
virtual bool operator==(const DTSegmentCand &seg)
equality operator based on position, direction, chi2 and nHits
Definition: DTSegmentCand.cc:37
DTSegmentCand::covMatrix
virtual AlgebraicSymMatrix covMatrix() const
the covariance matrix
Definition: DTSegmentCand.h:85
DTChamberRecSegment2D
Definition: DTChamberRecSegment2D.h:31
DTSegmentCand::thet0
double thet0
Definition: DTSegmentCand.h:141
DTSegmentCand::AssPointCont
std::set< AssPoint, AssPointLessZ > AssPointCont
Definition: DTSegmentCand.h:38
DTHitPairForFit.h
AlgebraicSymMatrix
CLHEP::HepSymMatrix AlgebraicSymMatrix
Definition: AlgebraicObjects.h:15
DTSegmentCand::nHitsMin
static const unsigned int nHitsMin
Definition: DTSegmentCand.h:152
DTSegmentCand::theSL
const DTSuperLayer * theSL
Definition: DTSegmentCand.h:137
DTSegmentCand::good
virtual bool good() const
Definition: DTSegmentCand.cc:100
DTSegmentCand::DTSegmentCand
DTSegmentCand(AssPointCont &hits, const DTSuperLayer *sl)
Constructor.
Definition: DTSegmentCand.cc:23
DTEnums::DTCellSide
DTCellSide
Which side of the DT cell.
Definition: DTEnums.h:15
DTSegmentCand::removeHit
virtual void removeHit(AssPoint hit)
remove hit from the candidate
Definition: DTSegmentCand.cc:65
DTSegmentCand::AssPointLessZ::operator()
bool operator()(const AssPoint &pt1, const AssPoint &pt2) const
Definition: DTSegmentCand.cc:197
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
operator<<
std::ostream & operator<<(std::ostream &out, const DTSegmentCand &seg)
Definition: DTSegmentCand.cc:201
DTSegmentCand::nSharedHitPairs
virtual int nSharedHitPairs(const DTSegmentCand &seg) const
number of shared hit pair with other segment candidate
Definition: DTSegmentCand.cc:67
DTSegmentCand::setCovMatrix
virtual void setCovMatrix(AlgebraicSymMatrix &cov)
set the cov matrix
Definition: DTSegmentCand.h:116
DTSegmentCand::theHits
AssPointCont theHits
Definition: DTSegmentCand.h:148
hit
Definition: SiStripHitEffFromCalibTree.cc:88
DTSegmentCand::~DTSegmentCand
virtual ~DTSegmentCand()
Destructor.
Definition: DTSegmentCand.cc:34
DTSegmentCand::theChi2
double theChi2
Definition: DTSegmentCand.h:140
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23