27 if (dynamic_cast<const RecSegment*>(
hit()))
34 if (dynamic_cast<const RecSegment*>(
hit()))
57 if (err.num_row() == 1) {
63 err[0][0] += lape.
cxx();
64 }
else if (err.num_row() == 2) {
72 lapeMatrix[1][1] = lape.
cxx();
74 lapeMatrix[0][1] = lape.
cphixx();
76 if (err.num_row() != lapeMatrix.num_row())
77 throw cms::Exception(
"MuonTransientTrackingRecHit::parametersError")
78 <<
"Discrepancy between alignment error matrix and error matrix: APE " << lapeMatrix.num_row()
79 <<
", error matrix " << err.num_row() << std::endl;
82 }
else if (err.num_row() == 4) {
83 positions[0] = par[2];
84 positions[1] = par[3];
85 directions[0] = par[0];
86 directions[1] = par[1];
91 lapeMatrix[2][2] = lape.
cxx();
92 lapeMatrix[2][3] = lape.
cyx();
93 lapeMatrix[3][3] = lape.
cyy();
98 lapeMatrix[0][2] = lape.
cphixx();
99 lapeMatrix[0][3] = lape.
cphixy();
100 lapeMatrix[1][3] = lape.
cphiyy();
101 lapeMatrix[1][2] = lape.
cphiyx();
103 if (err.num_row() != lapeMatrix.num_row())
104 throw cms::Exception(
"MuonTransientTrackingRecHit::parametersError")
105 <<
"Discrepancy between alignment error matrix and error matrix: APE " << lapeMatrix.num_row()
106 <<
", error matrix " << err.num_row() << std::endl;
115 if (dynamic_cast<const RecSegment*>(
hit()))
122 if (dynamic_cast<const RecSegment*>(
hit()))
144 std::vector<const TrackingRecHit*> ownRecHits =
recHits();
146 if (ownRecHits.empty()) {
148 return theSubTransientRecHits;
154 if (
isDT() &&
dimension() == 2 && ownRecHits.front()->dimension() == 1 &&
155 (geomDets.size() == 3 || geomDets.size() == 2)) {
157 std::vector<const GeomDet*> subGeomDets;
160 for (std::vector<const GeomDet*>::const_iterator geoDet = geomDets.begin(); geoDet != geomDets.end(); ++geoDet) {
162 std::vector<const GeomDet*>
tmp = (*geoDet)->components();
163 std::copy(tmp.begin(), tmp.end(), back_inserter(subGeomDets));
168 geomDets = subGeomDets;
172 std::map<DetId, const GeomDet*> gemDetMap;
174 for (std::vector<const GeomDet*>::const_iterator subDet = geomDets.begin(); subDet != geomDets.end(); ++subDet)
175 gemDetMap[(*subDet)->geographicalId()] = *subDet;
177 std::map<DetId, const GeomDet*>::iterator gemDetMap_iter;
180 for (std::vector<const TrackingRecHit*>::const_iterator rechit = ownRecHits.begin(); rechit != ownRecHits.end();
182 gemDetMap_iter = gemDetMap.find((*rechit)->geographicalId());
184 if (gemDetMap_iter != gemDetMap.end())
185 theSubTransientRecHits.push_back(
188 theSubTransientRecHits.push_back(
191 return theSubTransientRecHits;
200 std::vector<TrackingRecHit*> seg2D =
recHits();
202 for (std::vector<TrackingRecHit*>::iterator it = seg2D.begin(); it != seg2D.end(); ++it) {
203 std::vector<TrackingRecHit*> hits1D = (*it)->recHits();
205 for (std::vector<TrackingRecHit*>::iterator it2 = hits1D.begin(); it2 != hits1D.end(); ++it2)
206 (*it2)->setType(
bad);
211 std::vector<TrackingRecHit*> hits =
recHits();
212 for (std::vector<TrackingRecHit*>::iterator it = hits.begin(); it != hits.end(); ++it)
virtual int degreesOfFreedom() const
Degrees of freedom for segments, else 0.
bool isCSC() const
if this rec hit is a CSC rec hit
AlgebraicSymMatrix parametersError() const override
Local3DVector LocalVector
MuonTransientTrackingRecHit::MuonRecHitPointer MuonRecHitPointer
const Surface * surface() const final
virtual double chi2() const
Chi square of the fit for segments, else 0.
virtual GlobalVector globalDirection() const
Direction in 3D for segments, otherwise (0,0,0)
const TrackingRecHit * hit() const override
std::vector< ConstRecHitPointer > RecHitContainer
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
bool isGEM() const
if this rec hit is a GEM rec hit
virtual std::vector< const GeomDet * > components() const
Returns direct components, if any.
virtual GlobalError globalDirectionError() const
Error on the global direction.
bool isRPC() const
if this rec hit is a RPC rec hit
bool isDT() const
if this rec hit is a DT rec hit
const GlobalErrorExtended & globalError() const
virtual LocalVector localDirection() const
Direction in 3D for segments, otherwise (0,0,0)
MuonTransientTrackingRecHit(const GeomDet *geom, const TrackingRecHit *rh)
Construct from a TrackingRecHit and its GeomDet.
LocalPoint localPosition() const override
std::shared_ptr< MuonTransientTrackingRecHit > MuonRecHitPointer
AlgebraicVector parameters() const override
const GeomDet * det() const
DetId geographicalId() const
The label of this GeomDet.
std::shared_ptr< TrackingRecHit const > RecHitPointer
std::vector< ConstRecHitPointer > ConstRecHitContainer
CLHEP::HepVector AlgebraicVector
virtual LocalError localDirectionError() const
Error on the local direction.
bool isME0() const
if this rec hit is a ME0 rec hit
ConstRecHitContainer transientHits() const override
return the sub components of this transient rechit
AlgebraicSymMatrix parametersError() const override
CLHEP::HepSymMatrix AlgebraicSymMatrix
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
TrackingRecHit * trackingRecHit_
DetId geographicalId() const
int dimension() const override
AlignmentPositionError const * alignmentPositionError() const
Return pointer to alignment errors.
MuonTransientTrackingRecHit * clone() const override