Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 
0002 
0003 #include "Alignment/ReferenceTrajectories/interface/DualBzeroReferenceTrajectory.h"
0004 
0005 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0006 
0007 #include "DataFormats/CLHEP/interface/AlgebraicObjects.h"
0008 #include "DataFormats/TrajectoryState/interface/LocalTrajectoryParameters.h"
0009 
0010 #include "Alignment/ReferenceTrajectories/interface/BzeroReferenceTrajectory.h"
0011 
0012 DualBzeroReferenceTrajectory::DualBzeroReferenceTrajectory(const TrajectoryStateOnSurface& tsos,
0013                                                            const ConstRecHitContainer& forwardRecHits,
0014                                                            const ConstRecHitContainer& backwardRecHits,
0015                                                            const MagneticField* magField,
0016                                                            const reco::BeamSpot& beamSpot,
0017                                                            const ReferenceTrajectoryBase::Config& config)
0018     : DualReferenceTrajectory(tsos.localParameters().mixedFormatVector().kSize - 1,
0019                               numberOfUsedRecHits(forwardRecHits) + numberOfUsedRecHits(backwardRecHits) - 1,
0020                               config),
0021       theMomentumEstimate(config.momentumEstimate) {
0022   theValidityFlag = construct(tsos, forwardRecHits, backwardRecHits, magField, beamSpot);
0023 }
0024 
0025 ReferenceTrajectory* DualBzeroReferenceTrajectory::construct(const TrajectoryStateOnSurface& referenceTsos,
0026                                                              const ConstRecHitContainer& recHits,
0027                                                              double mass,
0028                                                              MaterialEffects materialEffects,
0029                                                              const PropagationDirection propDir,
0030                                                              const MagneticField* magField,
0031                                                              bool useBeamSpot,
0032                                                              const reco::BeamSpot& beamSpot) const {
0033   if (materialEffects >= breakPoints)
0034     throw cms::Exception("BadConfig") << "[DualBzeroReferenceTrajectory::construct] Wrong MaterialEffects: "
0035                                       << materialEffects;
0036 
0037   ReferenceTrajectoryBase::Config config(materialEffects, propDir, mass, theMomentumEstimate);
0038   config.useBeamSpot = useBeamSpot;
0039   config.hitsAreReverse = false;
0040   return new BzeroReferenceTrajectory(referenceTsos, recHits, magField, beamSpot, config);
0041 }
0042 
0043 AlgebraicVector DualBzeroReferenceTrajectory::extractParameters(const TrajectoryStateOnSurface& referenceTsos) const {
0044   AlgebraicVector param = asHepVector<5>(referenceTsos.localParameters().mixedFormatVector());
0045   return param.sub(2, 5);
0046 }