CMS 3D CMS Logo

DTRecSegment2D.cc
Go to the documentation of this file.
1 
7 /* This Class Header */
9 
10 /* Collaborating Class Header */
11 
12 /* C++ Headers */
13 #include <iostream>
14 using namespace std;
15 /* ====================================================================== */
16 
17 /* static member definition */
18 
19 //This function is only used to initialize theProjectionMatrix at load time
22  theProjectionMatrix[0][1] = 1;
23  theProjectionMatrix[1][3] = 1;
24  return theProjectionMatrix;
25 }
27 
28 /* Operations */
34  // if ( det().alignmentPositionError()) {
35  // LocalError lape =
36  // ErrorFrameTransformer().transform( det().alignmentPositionError()->globalError(),
37  // det().surface());
38  // m[0][0] = lv.xx();
39  // m[0][1] = 0.;
40  // m[1][1] = lp.xx()+lape.xx();
41  // } else {
42  m[0][0] = theCovMatrix[0][0];
43  m[0][1] = theCovMatrix[0][1];
44  m[1][1] = theCovMatrix[1][1];
45  //};
46 
47  //cout << "theCovMatrix elements " << theCovMatrix[0][0] << " , " << theCovMatrix[0][1] <<
48  // " , " << theCovMatrix[1][0] << " , " << theCovMatrix[1][1] << endl;
49 
50  return m;
51 }
52 
54 
55 DTRecSegment2D::DTRecSegment2D(DetId id, const vector<DTRecHit1D>& hits)
56  : RecSegment(id), theChi2(0.0), theT0(0.), theVdrift(0.), theHits(hits) {}
57 
60  LocalVector& direction,
61  AlgebraicSymMatrix& covMatrix,
62  double chi2,
63  std::vector<DTRecHit1D>& hits1D)
64  : RecSegment(id),
65  thePosition(position),
66  theDirection(direction),
67  theCovMatrix(covMatrix),
68  theChi2(chi2),
69  theT0(0.),
70  theVdrift(0.),
71  theHits(hits1D) {}
72 
73 /* Operations */
75 
77 
78 int DTRecSegment2D::degreesOfFreedom() const { return theHits.size() - dimension(); }
79 
80 ostream& operator<<(ostream& os, const DTRecSegment2D& seg) {
81  os << "Pos " << seg.localPosition() << " Dir: " << seg.localDirection() << " chi2/ndof: " << seg.chi2() << "/"
82  << seg.degreesOfFreedom();
83  return os;
84 }
85 
86 std::vector<const TrackingRecHit*> DTRecSegment2D::recHits() const {
87  std::vector<const TrackingRecHit*> pointersOfRecHits;
88 
89  for (std::vector<DTRecHit1D>::const_iterator rechit = theHits.begin(); rechit != theHits.end(); rechit++)
90  pointersOfRecHits.push_back(&(*rechit));
91 
92  return pointersOfRecHits;
93 }
94 
95 std::vector<TrackingRecHit*> DTRecSegment2D::recHits() {
96  std::vector<TrackingRecHit*> pointersOfRecHits;
97 
98  for (std::vector<DTRecHit1D>::iterator rechit = theHits.begin(); rechit != theHits.end(); rechit++)
99  pointersOfRecHits.push_back(&(*rechit));
100 
101  return pointersOfRecHits;
102 }
103 
104 std::vector<DTRecHit1D> DTRecSegment2D::specificRecHits() const { return theHits; }
105 
106 void DTRecSegment2D::update(std::vector<DTRecHit1D>& updatedRecHits) { theHits = updatedRecHits; }
107 
109 
111 
113 
114 void DTRecSegment2D::setChi2(const double& chi2) { theChi2 = chi2; }
115 
116 void DTRecSegment2D::setT0(const double& t0) { theT0 = t0; }
117 
118 void DTRecSegment2D::setVdrift(const double& vdrift) { theVdrift = vdrift; }
Vector3DBase< float, LocalTag >
DTRecSegment2D::thePosition
LocalPoint thePosition
Definition: DTRecSegment2D.h:131
operator<<
ostream & operator<<(ostream &os, const DTRecSegment2D &seg)
Definition: DTRecSegment2D.cc:80
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
DTRecSegment2D::t0
double t0() const
Get the segment t0 (if recomputed, 0 is returned otherwise)
Definition: DTRecSegment2D.h:114
DTRecSegment2D.h
pos
Definition: PixelAliasList.h:18
DTRecSegment2D::update
void update(std::vector< DTRecHit1D > &updatedRecHits)
Definition: DTRecSegment2D.cc:106
RecSegment
Definition: RecSegment.h:27
DTRecSegment2D::theChi2
double theChi2
Definition: DTRecSegment2D.h:139
DTRecSegment2D::~DTRecSegment2D
~DTRecSegment2D() override
Destructor.
Definition: DTRecSegment2D.cc:53
DTRecSegment2D::theProjectionMatrix
static const AlgebraicMatrix theProjectionMatrix
Definition: DTRecSegment2D.h:146
DTRecSegment2D::localDirectionError
LocalError localDirectionError() const override
the local direction error (xx,xy,yy) in SL frame: only xx is not 0.
Definition: DTRecSegment2D.cc:76
DTRecSegment2D::theHits
std::vector< DTRecHit1D > theHits
Definition: DTRecSegment2D.h:143
DTRecSegment2D::setDirection
void setDirection(const LocalVector &dir)
Definition: DTRecSegment2D.cc:110
hltPixelTracks_cff.chi2
chi2
Definition: hltPixelTracks_cff.py:25
DTRecSegment2D::localPositionError
LocalError localPositionError() const override
local position error in SL frame
Definition: DTRecSegment2D.cc:74
DTRecSegment2D::recHits
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
Definition: DTRecSegment2D.cc:86
DetId
Definition: DetId.h:17
FrontierCondition_GT_autoExpress_cfi.t0
t0
Definition: FrontierCondition_GT_autoExpress_cfi.py:148
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
Point3DBase< float, LocalTag >
DTRecSegment2D::setPosition
void setPosition(const LocalPoint &pos)
Definition: DTRecSegment2D.cc:108
initTheProjectionMatrix
static AlgebraicMatrix initTheProjectionMatrix()
Definition: DTRecSegment2D.cc:20
DTRecSegment2D::dimension
int dimension() const override
return 2. The dimension of the matrix
Definition: DTRecSegment2D.h:81
DTRecSegment2D
Definition: DTRecSegment2D.h:45
DTRecSegment2D::chi2
double chi2() const override
the chi2 of the fit
Definition: DTRecSegment2D.h:96
LocalError
Definition: LocalError.h:12
DTRecSegment2D::theDirection
LocalVector theDirection
Definition: DTRecSegment2D.h:132
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
DTRecSegment2D::localPosition
LocalPoint localPosition() const override
local position in SL frame
Definition: DTRecSegment2D.h:84
AlgebraicSymMatrix
CLHEP::HepSymMatrix AlgebraicSymMatrix
Definition: AlgebraicObjects.h:15
std
Definition: JetResolutionObject.h:76
AlgebraicMatrix
CLHEP::HepMatrix AlgebraicMatrix
Definition: AlgebraicObjects.h:14
DTRecSegment2D::setT0
void setT0(const double &t0)
Definition: DTRecSegment2D.cc:116
bscTrigger_cfi.theHits
theHits
Definition: bscTrigger_cfi.py:18
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
DTRecSegment2D::parametersError
AlgebraicSymMatrix parametersError() const override
Definition: DTRecSegment2D.cc:29
DTRecSegment2D::setVdrift
void setVdrift(const double &vdrift)
Definition: DTRecSegment2D.cc:118
DTRecSegment2D::specificRecHits
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
Definition: DTRecSegment2D.cc:104
theProjectionMatrix
static const AlgebraicMatrix theProjectionMatrix
Definition: CSCSegment.cc:79
DTRecSegment2D::setCovMatrix
void setCovMatrix(const AlgebraicSymMatrix &cov)
Definition: DTRecSegment2D.cc:112
DTRecSegment2D::degreesOfFreedom
int degreesOfFreedom() const override
return the DOF of the segment
Definition: DTRecSegment2D.cc:78
DTRecSegment2D::theT0
double theT0
Definition: DTRecSegment2D.h:140
DTRecSegment2D::localDirection
LocalVector localDirection() const override
the local direction in SL frame
Definition: DTRecSegment2D.h:90
DTRecSegment2D::theVdrift
double theVdrift
Definition: DTRecSegment2D.h:141
DTRecSegment2D::theCovMatrix
AlgebraicSymMatrix theCovMatrix
Definition: DTRecSegment2D.h:137
DTRecSegment2D::setChi2
void setChi2(const double &chi2)
Definition: DTRecSegment2D.cc:114
DTRecSegment2D::DTRecSegment2D
DTRecSegment2D()
Definition: DTRecSegment2D.h:49
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23