Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:57:22

0001 #include "Alignment/ReferenceTrajectories/interface/ReferenceTrajectoryBase.h"
0002 
0003 ReferenceTrajectoryBase::ReferenceTrajectoryBase(unsigned int nPar,
0004                                                  unsigned int nHits,
0005                                                  unsigned int nVirtualPar,
0006                                                  unsigned int nVirtualMeas)
0007     : theValidityFlag(false),
0008       theParamCovFlag(false),
0009       theNumberOfHits(nHits),
0010       theNumberOfPars(nPar),
0011       theNumberOfVirtualMeas(nVirtualMeas),
0012       theNumberOfVirtualPars(nVirtualPar),
0013       theTsosVec(),
0014       theRecHits(),
0015       theMeasurements(nMeasPerHit * nHits + nVirtualMeas),
0016       theMeasurementsCov(nMeasPerHit * nHits + nVirtualMeas, 0),
0017       theTrajectoryPositions(nMeasPerHit * nHits),
0018       theTrajectoryPositionCov(nMeasPerHit * nHits, 0),
0019       theParameters(nPar),
0020       theParameterCov(nPar, 0),
0021       theDerivatives(nMeasPerHit * nHits + nVirtualMeas, nPar + nVirtualPar, 0),
0022       theInnerTrajectoryToCurvilinear(5, 5, 0),
0023       theInnerLocalToTrajectory(5, 5, 0) {
0024   theTsosVec.reserve(nHits);
0025   theRecHits.reserve(nHits);
0026 }
0027 
0028 unsigned int ReferenceTrajectoryBase::numberOfUsedRecHits(
0029     const TransientTrackingRecHit::ConstRecHitContainer& recHits) const {
0030   unsigned int nUsedHits = 0;
0031   TransientTrackingRecHit::ConstRecHitContainer::const_iterator itHit;
0032   for (itHit = recHits.begin(); itHit != recHits.end(); ++itHit)
0033     if (useRecHit(*itHit))
0034       ++nUsedHits;
0035   return nUsedHits;
0036 }
0037 
0038 bool ReferenceTrajectoryBase::useRecHit(const TransientTrackingRecHit::ConstRecHitPointer& hitPtr) const {
0039   return hitPtr->isValid();
0040 }