CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/Alignment/ReferenceTrajectories/src/ReferenceTrajectoryBase.cc

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