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);
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
Local3DVector LocalVector
MuonTransientTrackingRecHit::RecHitContainer MuonRecHitContainer
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)
ConstRecHitContainer transientHits() const override
return the sub components of this transient rechit
std::vector< ConstRecHitPointer > RecHitContainer
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
AlgebraicVector parameters() const override
bool isDT() const
if this rec hit is a DT rec hit
const TrackingRecHit * hit() const override
const GlobalErrorExtended & globalError() const
virtual LocalVector localDirection() const
Direction in 3D for segments, otherwise (0,0,0)
LocalPoint localPosition() const override
MuonTransientTrackingRecHit(const GeomDet *geom, const TrackingRecHit *rh)
Construct from a TrackingRecHit and its GeomDet.
MuonTransientTrackingRecHit * clone() const override
int dimension() const override
std::shared_ptr< MuonTransientTrackingRecHit > MuonRecHitPointer
const GeomDet * det() const
DetId geographicalId() const
The label of this GeomDet.
const Surface * surface() const final
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
std::shared_ptr< TrackingRecHit const > RecHitPointer
AlgebraicSymMatrix parametersError() const override
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
AlgebraicSymMatrix parametersError() const override
MuonTransientTrackingRecHit::MuonRecHitPointer MuonRecHitPointer
CLHEP::HepSymMatrix AlgebraicSymMatrix
TrackingRecHit * trackingRecHit_
DetId geographicalId() const
AlignmentPositionError const * alignmentPositionError() const
Return pointer to alignment errors.