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
CSCSegment::specificRecHits
const std::vector< CSCRecHit2D > & specificRecHits() const
Definition: CSCSegment.h:66
Vector3DBase< float, LocalTag >
CSCRecHit2DCollection.h
GEMCSCSegment::cscSegment
const CSCSegment cscSegment() const
Definition: GEMCSCSegment.h:75
GEMCSCSegment::projectionMatrix
AlgebraicMatrix projectionMatrix() const override
The projection matrix relates the trajectory state parameters to the segment parameters().
Definition: GEMCSCSegment.cc:104
MessageLogger.h
RecSegment
Definition: RecSegment.h:27
operator<<
std::ostream & operator<<(std::ostream &os, const GEMCSCSegment &seg)
Definition: GEMCSCSegment.cc:109
GEMCSCSegment::print
void print() const
GEMCSCSegment::chi2
double chi2() const override
Chi2 of the segment fit.
Definition: GEMCSCSegment.h:60
TrackingRecHit::geographicalId
DetId geographicalId() const
Definition: TrackingRecHit.h:120
GEMCSCSegment::clone
GEMCSCSegment * clone() const override
Definition: GEMCSCSegment.h:43
GEMCSCSegment::recHits
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
Definition: GEMCSCSegment.cc:61
errors
Definition: errors.py:1
AlgebraicVector
CLHEP::HepVector AlgebraicVector
Definition: AlgebraicObjects.h:13
GEMCSCSegment::dimension
int dimension() const override
Dimension (in parameter space)
Definition: GEMCSCSegment.h:62
GEMCSCSegment::nRecHits
int nRecHits() const
Definition: GEMCSCSegment.h:66
GEMCSCSegment::parametersError
AlgebraicSymMatrix parametersError() const override
Covariance matrix of parameters()
Definition: GEMCSCSegment.h:55
GEMCSCSegment::theLocalDirection
LocalVector theLocalDirection
Definition: GEMCSCSegment.h:93
GEMCSCSegment::parameters
AlgebraicVector parameters() const override
Parameters of the segment, for the track fit in the order (dx/dz, dy/dz, x, y )
Definition: GEMCSCSegment.cc:90
GEMCSCSegment::gemRecHits
const std::vector< GEMRecHit > & gemRecHits() const
Definition: GEMCSCSegment.h:76
Point3DBase< float, LocalTag >
CSCSegment
Definition: CSCSegment.h:21
GEMCSCSegment
Definition: GEMCSCSegment.h:26
LocalError
Definition: LocalError.h:12
GEMCSCSegment::theGEMRecHits
std::vector< GEMRecHit > theGEMRecHits
Definition: GEMCSCSegment.h:86
CSCDetId
Definition: CSCDetId.h:26
GEMCSCSegment::localDirectionError
LocalError localDirectionError() const override
Error on the local direction.
Definition: GEMCSCSegment.cc:86
GEMCSCSegment::localPositionError
LocalError localPositionError() const override
Definition: GEMCSCSegment.cc:82
GEMRecHitCollection.h
AlgebraicSymMatrix
CLHEP::HepSymMatrix AlgebraicSymMatrix
Definition: AlgebraicObjects.h:15
GEMCSCSegment::~GEMCSCSegment
~GEMCSCSegment() override
Destructor.
Definition: GEMCSCSegment.cc:59
GEMCSCSegment::theOrigin
LocalPoint theOrigin
Definition: GEMCSCSegment.h:92
AlgebraicMatrix
CLHEP::HepMatrix AlgebraicMatrix
Definition: AlgebraicObjects.h:14
GEMCSCSegment::theCSCSegment
CSCSegment theCSCSegment
Definition: GEMCSCSegment.h:87
GEMCSCSegment::localPosition
LocalPoint localPosition() const override
Definition: GEMCSCSegment.h:45
GEMCSCSegment::cscDetId
CSCDetId cscDetId() const
Definition: GEMCSCSegment.h:81
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
GEMCSCSegment::cscRecHits
const std::vector< CSCRecHit2D > & cscRecHits() const
Definition: GEMCSCSegment.h:77
GEMCSCSegment::localDirection
LocalVector localDirection() const override
Local direction.
Definition: GEMCSCSegment.h:48
RecSegment.h
GEMCSCSegment::GEMCSCSegment
GEMCSCSegment()
Default constructor.
Definition: GEMCSCSegment.h:29
GEMCSCSegment::theChi2
double theChi2
Definition: GEMCSCSegment.h:95
GEMCSCSegment::degreesOfFreedom
int degreesOfFreedom() const override
Degrees of freedom of the segment fit.
Definition: GEMCSCSegment.h:64
GEMCSCSegment::theCovMatrix
AlgebraicSymMatrix theCovMatrix
Definition: GEMCSCSegment.h:94
CSCSegmentCollection.h