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()))
168 std::vector<const TrackingRecHit*> ownRecHits =
recHits();
170 if(ownRecHits.size() == 0){
172 return theSubTransientRecHits;
178 if(
isDT() &&
dimension() == 2 && ownRecHits.front()->dimension() == 1
179 && (geomDets.size() == 3 || geomDets.size() == 2) ){
181 std::vector<const GeomDet *> subGeomDets;
184 for(std::vector<const GeomDet *>::const_iterator geoDet = geomDets.begin();
185 geoDet != geomDets.end(); ++geoDet){
187 std::vector<const GeomDet *>
tmp = (*geoDet)->components();
188 std::copy(tmp.begin(),tmp.end(),back_inserter(subGeomDets));
193 geomDets = subGeomDets;
197 std::map<DetId,const GeomDet*> gemDetMap;
199 for (std::vector<const GeomDet*>::const_iterator subDet = geomDets.begin();
200 subDet != geomDets.end(); ++subDet)
201 gemDetMap[ (*subDet)->geographicalId() ] = *subDet;
203 std::map<DetId,const GeomDet*>::iterator gemDetMap_iter;
206 for (std::vector<const TrackingRecHit*>::const_iterator rechit = ownRecHits.begin();
207 rechit != ownRecHits.end(); ++rechit){
209 gemDetMap_iter = gemDetMap.find( (*rechit)->geographicalId() );
211 if(gemDetMap_iter != gemDetMap.end() )
218 return theSubTransientRecHits;
229 std::vector<TrackingRecHit*> seg2D =
recHits();
231 for(std::vector<TrackingRecHit*>::iterator it = seg2D.begin(); it != seg2D.end(); ++it){
232 std::vector<TrackingRecHit*> hits1D = (*it)->recHits();
234 for(std::vector<TrackingRecHit*>::iterator it2 = hits1D.begin(); it2 != hits1D.end(); ++it2)
235 (*it2)->setType(
bad);
241 std::vector<TrackingRecHit*> hits =
recHits();
242 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.
std::shared_ptr< MuonTransientTrackingRecHit > MuonRecHitPointer
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.
bool isME0() const
if this rec hit is a ME0 rec hit
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 final
AlignmentPositionError const * alignmentPositionError() const
Return pointer to alignment errors.