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