30 if (dynamic_cast<const RecSegment*>(
hit()) )
38 if (dynamic_cast<const RecSegment*>(
hit()))
65 if(err.num_row() == 1) {
71 err[0][0] += lape.
cxx();
72 }
else if (err.num_row() == 2) {
80 lapeMatrix[1][1] = lape.
cxx();
82 lapeMatrix[0][1] = lape.
cphixx();
84 if(err.num_row() != lapeMatrix.num_row())
85 throw cms::Exception(
"MuonTransientTrackingRecHit::parametersError")
86 <<
"Discrepancy between alignment error matrix and error matrix: APE "
87 << lapeMatrix.num_row()
88 <<
", error matrix " << err.num_row()
92 }
else if (err.num_row() == 4) {
93 positions[0] = par[2];
94 positions[1] = par[3];
95 directions[0] = par[0];
96 directions[1] = par[1];
101 lapeMatrix[2][2] = lape.
cxx();
102 lapeMatrix[2][3] = lape.
cyx();
103 lapeMatrix[3][3] = lape.
cyy();
108 lapeMatrix[0][2] = lape.
cphixx();
109 lapeMatrix[0][3] = lape.
cphixy();
110 lapeMatrix[1][3] = lape.
cphiyy();
111 lapeMatrix[1][2] = lape.
cphiyx();
113 if(err.num_row() != lapeMatrix.num_row())
114 throw cms::Exception(
"MuonTransientTrackingRecHit::parametersError")
115 <<
"Discrepancy between alignment error matrix and error matrix: APE "
116 << lapeMatrix.num_row()
117 <<
", error matrix " << err.num_row()
128 if (dynamic_cast<const RecSegment*>(
hit()))
135 if (dynamic_cast<const RecSegment*>(
hit()))
159 std::vector<const TrackingRecHit*> ownRecHits =
recHits();
161 if(ownRecHits.size() == 0){
163 return theSubTransientRecHits;
169 if(
isDT() &&
dimension() == 2 && ownRecHits.front()->dimension() == 1
170 && (geomDets.size() == 3 || geomDets.size() == 2) ){
172 std::vector<const GeomDet *> subGeomDets;
175 for(std::vector<const GeomDet *>::const_iterator geoDet = geomDets.begin();
176 geoDet != geomDets.end(); ++geoDet){
178 std::vector<const GeomDet *>
tmp = (*geoDet)->components();
179 std::copy(tmp.begin(),tmp.end(),back_inserter(subGeomDets));
184 geomDets = subGeomDets;
188 std::map<DetId,const GeomDet*> gemDetMap;
190 for (std::vector<const GeomDet*>::const_iterator subDet = geomDets.begin();
191 subDet != geomDets.end(); ++subDet)
192 gemDetMap[ (*subDet)->geographicalId() ] = *subDet;
194 std::map<DetId,const GeomDet*>::iterator gemDetMap_iter;
197 for (std::vector<const TrackingRecHit*>::const_iterator rechit = ownRecHits.begin();
198 rechit != ownRecHits.end(); ++rechit){
200 gemDetMap_iter = gemDetMap.find( (*rechit)->geographicalId() );
202 if(gemDetMap_iter != gemDetMap.end() )
209 return theSubTransientRecHits;
220 std::vector<TrackingRecHit*> seg2D =
recHits();
222 for(std::vector<TrackingRecHit*>::iterator it = seg2D.begin(); it != seg2D.end(); ++it){
223 std::vector<TrackingRecHit*> hits1D = (*it)->recHits();
225 for(std::vector<TrackingRecHit*>::iterator it2 = hits1D.begin(); it2 != hits1D.end(); ++it2)
226 (*it2)->setType(
bad);
232 std::vector<TrackingRecHit*> hits =
recHits();
233 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::MuonRecHitPointer MuonRecHitPointer
virtual double chi2() const
Chi square of the fit for segments, else 0.
virtual MuonTransientTrackingRecHit * clone() const override
virtual const TrackingRecHit * hit() const
virtual GlobalVector globalDirection() const
Direction in 3D for segments, otherwise (0,0,0)
virtual LocalPoint localPosition() const override
std::vector< ConstRecHitPointer > RecHitContainer
virtual int dimension() const
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
virtual std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
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.
virtual AlgebraicSymMatrix parametersError() const
const GeomDet * det() const
DetId geographicalId() const
The label of this GeomDet.
std::shared_ptr< TrackingRecHit const > RecHitPointer
std::vector< ConstRecHitPointer > ConstRecHitContainer
virtual std::vector< const GeomDet * > components() const
Returns direct components, if any.
CLHEP::HepVector AlgebraicVector
virtual LocalError localDirectionError() const
Error on the local direction.
virtual AlgebraicVector parameters() const
virtual ConstRecHitContainer transientHits() const override
return the sub components of this transient rechit
std::vector< std::vector< double > > tmp
virtual AlgebraicSymMatrix parametersError() const override
CLHEP::HepSymMatrix AlgebraicSymMatrix
MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
TrackingRecHit * trackingRecHit_
DetId geographicalId() const
virtual const Surface * surface() const
AlignmentPositionError const * alignmentPositionError() const
Return pointer to alignment errors.