00001 #include "Alignment/ReferenceTrajectories/interface/ReferenceTrajectoryBase.h" 00002 00003 ReferenceTrajectoryBase::ReferenceTrajectoryBase(unsigned int nPar, unsigned int nHits) 00004 : theValidityFlag(false), theParamCovFlag(false), 00005 theNumberOfHits( nHits ), 00006 theTsosVec(), theRecHits(), 00007 theMeasurements(nMeasPerHit * nHits), theMeasurementsCov(nMeasPerHit * nHits, 0), 00008 theTrajectoryPositions(nMeasPerHit * nHits), 00009 theTrajectoryPositionCov(nMeasPerHit * nHits,0), 00010 theParameters(nPar), theParameterCov(nPar, 0), 00011 theDerivatives(nMeasPerHit * nHits, nPar, 0) 00012 { 00013 theTsosVec.reserve(nHits); 00014 theRecHits.reserve(nHits); 00015 } 00016 00017 00018 unsigned int 00019 ReferenceTrajectoryBase::numberOfUsedRecHits( const TransientTrackingRecHit::ConstRecHitContainer &recHits ) const 00020 { 00021 unsigned int nUsedHits = 0; 00022 TransientTrackingRecHit::ConstRecHitContainer::const_iterator itHit; 00023 for ( itHit = recHits.begin(); itHit != recHits.end(); ++itHit ) if ( useRecHit( *itHit ) ) ++nUsedHits; 00024 return nUsedHits; 00025 } 00026 00027 00028 bool 00029 ReferenceTrajectoryBase::useRecHit( const TransientTrackingRecHit::ConstRecHitPointer& hitPtr ) const 00030 { 00031 return hitPtr->isValid(); 00032 }