CMS 3D CMS Logo

GEMCSCSegment.h
Go to the documentation of this file.
1 #ifndef GEMRecHit_GEMCSCSegment_h
2 #define GEMRecHit_GEMCSCSegment_h
3 
15 
19 
21 
22 #include <iosfwd>
23 
24 class CSCDetId;
25 
26 class GEMCSCSegment final : public RecSegment {
27 public:
30 
32  GEMCSCSegment(const CSCSegment* csc_segment,
33  const std::vector<const GEMRecHit*> gem_rhs,
34  LocalPoint origin,
35  LocalVector direction,
37  double chi2);
38 
40  ~GEMCSCSegment() override;
41 
42  //--- Base class interface
43  GEMCSCSegment* clone() const override { return new GEMCSCSegment(*this); }
44 
45  LocalPoint localPosition() const override { return theOrigin; }
46  LocalError localPositionError() const override;
47 
48  LocalVector localDirection() const override { return theLocalDirection; }
49  LocalError localDirectionError() const override;
50 
52  AlgebraicVector parameters() const override;
53 
55  AlgebraicSymMatrix parametersError() const override { return theCovMatrix; }
56 
58  AlgebraicMatrix projectionMatrix() const override;
59 
60  double chi2() const override { return theChi2; };
61 
62  int dimension() const override { return 4; }
63 
64  int degreesOfFreedom() const override { return 2 * nRecHits() - 4; }
65 
66  int nRecHits() const {
67  return (theGEMRecHits.size() + theCSCSegment.specificRecHits().size());
68  edm::LogVerbatim("GEMCSCSegment") << "[GEMCSCSegment :: nRecHits] CSC RecHits: "
69  << theCSCSegment.specificRecHits().size()
70  << " + GEM RecHits: " << theGEMRecHits.size() << " = "
71  << (theGEMRecHits.size() + theCSCSegment.specificRecHits().size());
72  }
73 
74  //--- Return the constituents in different ways
75  const CSCSegment cscSegment() const { return theCSCSegment; }
76  const std::vector<GEMRecHit>& gemRecHits() const { return theGEMRecHits; }
77  const std::vector<CSCRecHit2D>& cscRecHits() const { return theCSCSegment.specificRecHits(); }
78  std::vector<const TrackingRecHit*> recHits() const override;
79  std::vector<TrackingRecHit*> recHits() override;
80 
81  CSCDetId cscDetId() const { return geographicalId(); }
82 
83  void print() const;
84 
85 private:
86  std::vector<GEMRecHit> theGEMRecHits; // store GEM Rechits
87  CSCSegment theCSCSegment; // store CSC RecHits and store CSC Segment
88  // eventually we have to disentangle if later on we decide
89  // not to have a one-to-one relationship anymore
90  // i.e. if we allow the GEMCSC segment to modify the
91  // (selection of the rechits of the) CSC segment
92  LocalPoint theOrigin; // in chamber frame - the GeomDet local coordinate system
93  LocalVector theLocalDirection; // in chamber frame - the GeomDet local coordinate system
94  AlgebraicSymMatrix theCovMatrix; // the covariance matrix
95  double theChi2;
96 };
97 
98 std::ostream& operator<<(std::ostream& os, const GEMCSCSegment& seg);
99 
100 #endif
LocalError localDirectionError() const override
Error on the local direction.
LocalPoint theOrigin
Definition: GEMCSCSegment.h:92
LocalPoint localPosition() const override
Definition: GEMCSCSegment.h:45
CSCDetId cscDetId() const
Definition: GEMCSCSegment.h:81
GEMCSCSegment()
Default constructor.
Definition: GEMCSCSegment.h:29
std::vector< GEMRecHit > theGEMRecHits
Definition: GEMCSCSegment.h:86
CSCSegment theCSCSegment
Definition: GEMCSCSegment.h:87
int nRecHits() const
Definition: GEMCSCSegment.h:66
AlgebraicSymMatrix parametersError() const override
Covariance matrix of parameters()
Definition: GEMCSCSegment.h:55
const std::vector< GEMRecHit > & gemRecHits() const
Definition: GEMCSCSegment.h:76
std::ostream & operator<<(std::ostream &os, const GEMCSCSegment &seg)
GEMCSCSegment * clone() const override
Definition: GEMCSCSegment.h:43
LocalError localPositionError() const override
CLHEP::HepMatrix AlgebraicMatrix
AlgebraicSymMatrix theCovMatrix
Definition: GEMCSCSegment.h:94
AlgebraicVector parameters() const override
Parameters of the segment, for the track fit in the order (dx/dz, dy/dz, x, y )
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
const std::vector< CSCRecHit2D > & specificRecHits() const
Definition: CSCSegment.h:66
~GEMCSCSegment() override
Destructor.
const std::vector< CSCRecHit2D > & cscRecHits() const
Definition: GEMCSCSegment.h:77
CLHEP::HepVector AlgebraicVector
AlgebraicMatrix projectionMatrix() const override
The projection matrix relates the trajectory state parameters to the segment parameters().
void print() const
LocalVector theLocalDirection
Definition: GEMCSCSegment.h:93
int degreesOfFreedom() const override
Degrees of freedom of the segment fit.
Definition: GEMCSCSegment.h:64
CLHEP::HepSymMatrix AlgebraicSymMatrix
Definition: errors.py:1
DetId geographicalId() const
double chi2() const override
Chi2 of the segment fit.
Definition: GEMCSCSegment.h:60
LocalVector localDirection() const override
Local direction.
Definition: GEMCSCSegment.h:48
const CSCSegment cscSegment() const
Definition: GEMCSCSegment.h:75
int dimension() const override
Dimension (in parameter space)
Definition: GEMCSCSegment.h:62