Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:46:09

0001 
0002 #include "Alignment/ReferenceTrajectories/interface/BzeroReferenceTrajectory.h"
0003 
0004 #include "DataFormats/CLHEP/interface/AlgebraicObjects.h"
0005 #include "DataFormats/TrajectoryState/interface/LocalTrajectoryParameters.h"
0006 
0007 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0008 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
0009 
0010 BzeroReferenceTrajectory::BzeroReferenceTrajectory(const TrajectoryStateOnSurface& tsos,
0011                                                    const TransientTrackingRecHit::ConstRecHitContainer& recHits,
0012                                                    const MagneticField* magField,
0013                                                    const reco::BeamSpot& beamSpot,
0014                                                    const ReferenceTrajectoryBase::Config& config)
0015     : ReferenceTrajectory(tsos.localParameters().mixedFormatVector().kSize, recHits.size(), config),
0016       theMomentumEstimate(config.momentumEstimate) {
0017   // no check against magField == 0
0018 
0019   // No estimate for momentum of cosmics available -> set to default value.
0020   theParameters = asHepVector(tsos.localParameters().mixedFormatVector());
0021   theParameters[0] = 1. / theMomentumEstimate;
0022 
0023   LocalTrajectoryParameters locParamWithFixedMomentum(
0024       asSVector<5>(theParameters), tsos.localParameters().pzSign(), tsos.localParameters().charge());
0025 
0026   const TrajectoryStateOnSurface refTsosWithFixedMomentum(
0027       locParamWithFixedMomentum, tsos.localError(), tsos.surface(), magField, surfaceSide(config.propDir));
0028 
0029   if (config.hitsAreReverse) {
0030     TransientTrackingRecHit::ConstRecHitContainer fwdRecHits;
0031     fwdRecHits.reserve(recHits.size());
0032 
0033     for (TransientTrackingRecHit::ConstRecHitContainer::const_reverse_iterator it = recHits.rbegin();
0034          it != recHits.rend();
0035          ++it)
0036       fwdRecHits.push_back(*it);
0037 
0038     theValidityFlag = this->construct(refTsosWithFixedMomentum, fwdRecHits, magField, beamSpot);
0039   } else {
0040     theValidityFlag = this->construct(refTsosWithFixedMomentum, recHits, magField, beamSpot);
0041   }
0042 
0043   // Exclude momentum from the parameters and also the derivatives of the measurements w.r.t. the momentum.
0044   theParameters = theParameters.sub(2, 5);
0045   theDerivatives = theDerivatives.sub(1, theDerivatives.num_row(), 2, theDerivatives.num_col());
0046 }