CMS 3D CMS Logo

CSCSegment.h
Go to the documentation of this file.
1 #ifndef CSCRecHit_CSCSegment_h
2 #define CSCRecHit_CSCSegment_h
3 
16 
17 #include <iosfwd>
18 
19 class CSCDetId;
20 
21 class CSCSegment final : public RecSegment {
22 public:
25 
27  CSCSegment(const std::vector<const CSCRecHit2D*>& proto_segment,
28  LocalPoint origin,
29  LocalVector direction,
31  double chi2);
32 
34  ~CSCSegment() override;
35 
36  //--- Base class interface
37  CSCSegment* clone() const override { return new CSCSegment(*this); }
38 
39  LocalPoint localPosition() const override { return theOrigin; }
40  LocalError localPositionError() const override;
41 
42  LocalVector localDirection() const override { return theLocalDirection; }
43  LocalError localDirectionError() const override;
44 
46  AlgebraicVector parameters() const override;
47 
49  AlgebraicSymMatrix parametersError() const override { return theCovMatrix; }
50 
52  AlgebraicMatrix projectionMatrix() const override;
53 
54  std::vector<const TrackingRecHit*> recHits() const override;
55 
56  std::vector<TrackingRecHit*> recHits() override;
57 
58  double chi2() const override { return theChi2; };
59 
60  int dimension() const override { return 4; }
61 
62  int degreesOfFreedom() const override { return 2 * nRecHits() - 4; }
63 
64  //--- Extension of the interface
65 
66  const std::vector<CSCRecHit2D>& specificRecHits() const { return theCSCRecHits; }
67 
68  int nRecHits() const { return theCSCRecHits.size(); }
69 
70  CSCDetId cscDetId() const { return geographicalId(); }
71 
72  void setDuplicateSegments(std::vector<CSCSegment*>& duplicates);
73 
74  bool isME11a_duplicate() const { return (!theDuplicateSegments.empty() ? true : false); }
75  // a copy of the duplicated segments (ME1/1a only)
76  const std::vector<CSCSegment>& duplicateSegments() const { return theDuplicateSegments; }
77 
78  bool testSharesAllInSpecificRecHits(const std::vector<CSCRecHit2D>& specificRecHits_1,
79  const std::vector<CSCRecHit2D>& specificRecHits_2,
81 
82  //bool sharesRecHits(CSCSegment & anotherSegment, CSCRecHit2D::SharedInputType);
83  // checks if ALL the rechits share the specific input (allWires, allStrips or all)
84  bool sharesRecHits(const CSCSegment& anotherSegment, CSCRecHit2D::SharedInputType sharesInput) const;
85  // checks if ALL the rechits share SOME wire AND SOME strip input
86  bool sharesRecHits(const CSCSegment& anotherSegment) const;
87 
88  float time() const;
89 
90  void print() const;
91 
92 private:
93  std::vector<CSCRecHit2D> theCSCRecHits;
94  LocalPoint theOrigin; // in chamber frame - the GeomDet local coordinate system
95  LocalVector theLocalDirection; // in chamber frame - the GeomDet local coordinate system
96  AlgebraicSymMatrix theCovMatrix; // the covariance matrix
97  double theChi2;
99  std::vector<CSCSegment> theDuplicateSegments; // ME1/1a only
100 };
101 
102 std::ostream& operator<<(std::ostream& os, const CSCSegment& seg);
103 
104 #endif // CSCRecHit_CSCSegment_h
CSCSegment::specificRecHits
const std::vector< CSCRecHit2D > & specificRecHits() const
Definition: CSCSegment.h:66
Vector3DBase< float, LocalTag >
CSCRecHit2DCollection.h
CSCSegment::setDuplicateSegments
void setDuplicateSegments(std::vector< CSCSegment * > &duplicates)
Definition: CSCSegment.cc:83
funct::false
false
Definition: Factorize.h:29
operator<<
std::ostream & operator<<(std::ostream &os, const CSCSegment &seg)
Definition: CSCSegment.cc:181
CSCSegment::aME11a_duplicate
bool aME11a_duplicate
Definition: CSCSegment.h:98
CSCSegment::time
float time() const
Definition: CSCSegment.cc:144
RecSegment
Definition: RecSegment.h:27
CSCSegment::theChi2
double theChi2
Definition: CSCSegment.h:97
CSCSegment::theDuplicateSegments
std::vector< CSCSegment > theDuplicateSegments
Definition: CSCSegment.h:99
TrackingRecHit::geographicalId
DetId geographicalId() const
Definition: TrackingRecHit.h:120
CSCSegment::~CSCSegment
~CSCSegment() override
Destructor.
Definition: CSCSegment.cc:30
CSCSegment::nRecHits
int nRecHits() const
Definition: CSCSegment.h:68
errors
Definition: errors.py:1
AlgebraicVector
CLHEP::HepVector AlgebraicVector
Definition: AlgebraicObjects.h:13
CSCSegment::duplicateSegments
const std::vector< CSCSegment > & duplicateSegments() const
Definition: CSCSegment.h:76
CSCSegment::degreesOfFreedom
int degreesOfFreedom() const override
Degrees of freedom of the segment fit.
Definition: CSCSegment.h:62
CSCSegment::isME11a_duplicate
bool isME11a_duplicate() const
Definition: CSCSegment.h:74
Point3DBase< float, LocalTag >
CSCSegment
Definition: CSCSegment.h:21
CSCSegment::theCSCRecHits
std::vector< CSCRecHit2D > theCSCRecHits
Definition: CSCSegment.h:93
funct::true
true
Definition: Factorize.h:173
CSCSegment::print
void print() const
Definition: CSCSegment.cc:179
CSCSegment::projectionMatrix
AlgebraicMatrix projectionMatrix() const override
The projection matrix relates the trajectory state parameters to the segment parameters().
Definition: CSCSegment.cc:81
LocalError
Definition: LocalError.h:12
CSCDetId
Definition: CSCDetId.h:26
CSCSegment::localDirection
LocalVector localDirection() const override
Local direction.
Definition: CSCSegment.h:42
CSCSegment::localDirectionError
LocalError localDirectionError() const override
Error on the local direction.
Definition: CSCSegment.cc:52
CSCSegment::testSharesAllInSpecificRecHits
bool testSharesAllInSpecificRecHits(const std::vector< CSCRecHit2D > &specificRecHits_1, const std::vector< CSCRecHit2D > &specificRecHits_2, CSCRecHit2D::SharedInputType) const
Definition: CSCSegment.cc:92
AlgebraicSymMatrix
CLHEP::HepSymMatrix AlgebraicSymMatrix
Definition: AlgebraicObjects.h:15
CSCSegment::CSCSegment
CSCSegment()
Default constructor.
Definition: CSCSegment.h:24
CSCSegment::theCovMatrix
AlgebraicSymMatrix theCovMatrix
Definition: CSCSegment.h:96
CSCSegment::sharesRecHits
bool sharesRecHits(const CSCSegment &anotherSegment, CSCRecHit2D::SharedInputType sharesInput) const
Definition: CSCSegment.cc:129
CSCSegment::theOrigin
LocalPoint theOrigin
Definition: CSCSegment.h:94
AlgebraicMatrix
CLHEP::HepMatrix AlgebraicMatrix
Definition: AlgebraicObjects.h:14
CSCSegment::parametersError
AlgebraicSymMatrix parametersError() const override
Covariance matrix of parameters()
Definition: CSCSegment.h:49
TrackingRecHit::sharesInput
virtual bool sharesInput(const TrackingRecHit *other, SharedInputType what) const
Definition: TrackingRecHit.cc:12
CSCSegment::dimension
int dimension() const override
Dimension (in parameter space)
Definition: CSCSegment.h:60
CSCSegment::cscDetId
CSCDetId cscDetId() const
Definition: CSCSegment.h:70
CSCSegment::theLocalDirection
LocalVector theLocalDirection
Definition: CSCSegment.h:95
CSCSegment::parameters
AlgebraicVector parameters() const override
Parameters of the segment, for the track fit in the order (dx/dz, dy/dz, x, y )
Definition: CSCSegment.cc:56
CSCSegment::chi2
double chi2() const override
Chi2 of the segment fit.
Definition: CSCSegment.h:58
CSCRecHit2D::SharedInputType
SharedInputType
Definition: CSCRecHit2D.h:23
CSCSegment::localPosition
LocalPoint localPosition() const override
Definition: CSCSegment.h:39
RecSegment.h
CSCSegment::localPositionError
LocalError localPositionError() const override
Definition: CSCSegment.cc:48
CSCSegment::recHits
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
Definition: CSCSegment.cc:32
CSCSegment::clone
CSCSegment * clone() const override
Definition: CSCSegment.h:37