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()))
163 std::vector<const TrackingRecHit*> ownRecHits =
recHits();
165 if(ownRecHits.size() == 0){
167 return theSubTransientRecHits;
173 if(
isDT() &&
dimension() == 2 && ownRecHits.front()->dimension() == 1
174 && (geomDets.size() == 3 || geomDets.size() == 2) ){
176 std::vector<const GeomDet *> subGeomDets;
179 for(std::vector<const GeomDet *>::const_iterator geoDet = geomDets.begin();
180 geoDet != geomDets.end(); ++geoDet){
182 std::vector<const GeomDet *>
tmp = (*geoDet)->components();
183 std::copy(tmp.begin(),tmp.end(),back_inserter(subGeomDets));
188 geomDets = subGeomDets;
192 std::map<DetId,const GeomDet*> gemDetMap;
194 for (std::vector<const GeomDet*>::const_iterator subDet = geomDets.begin();
195 subDet != geomDets.end(); ++subDet)
196 gemDetMap[ (*subDet)->geographicalId() ] = *subDet;
198 std::map<DetId,const GeomDet*>::iterator gemDetMap_iter;
201 for (std::vector<const TrackingRecHit*>::const_iterator rechit = ownRecHits.begin();
202 rechit != ownRecHits.end(); ++rechit){
204 gemDetMap_iter = gemDetMap.find( (*rechit)->geographicalId() );
206 if(gemDetMap_iter != gemDetMap.end() )
213 return theSubTransientRecHits;
224 std::vector<TrackingRecHit*> seg2D =
recHits();
226 for(std::vector<TrackingRecHit*>::iterator it = seg2D.begin(); it != seg2D.end(); ++it){
227 std::vector<TrackingRecHit*> hits1D = (*it)->recHits();
229 for(std::vector<TrackingRecHit*>::iterator it2 = hits1D.begin(); it2 != hits1D.end(); ++it2)
230 (*it2)->setType(
bad);
236 std::vector<TrackingRecHit*> hits =
recHits();
237 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
bool isGEM() const
if this rec hit is a GEM rec hit
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.