CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/Alignment/ReferenceTrajectories/src/DualBzeroReferenceTrajectory.cc

Go to the documentation of this file.
00001 
00002 
00003 #include "Alignment/ReferenceTrajectories/interface/DualBzeroReferenceTrajectory.h"
00004 
00005 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
00006 
00007 #include "DataFormats/CLHEP/interface/AlgebraicObjects.h" 
00008 #include "DataFormats/TrajectoryState/interface/LocalTrajectoryParameters.h"
00009 
00010 #include "Alignment/ReferenceTrajectories/interface/BzeroReferenceTrajectory.h"
00011 
00012 
00013 DualBzeroReferenceTrajectory::DualBzeroReferenceTrajectory( const TrajectoryStateOnSurface &referenceTsos,
00014                                                             const ConstRecHitContainer &forwardRecHits,
00015                                                             const ConstRecHitContainer &backwardRecHits,
00016                                                             const MagneticField *magField,
00017                                                             MaterialEffects materialEffects,
00018                                                             PropagationDirection propDir,
00019                                                             double mass,
00020                                                             double momentumEstimate, 
00021                                                             bool useBeamSpot,
00022                                                             const reco::BeamSpot &beamSpot)
00023   : DualReferenceTrajectory(referenceTsos.localParameters().mixedFormatVector().kSize - 1,
00024                             numberOfUsedRecHits(forwardRecHits) + numberOfUsedRecHits(backwardRecHits) - 1),
00025     theMomentumEstimate(momentumEstimate)
00026 {
00027     theValidityFlag = DualReferenceTrajectory::construct(referenceTsos,
00028                                                          forwardRecHits,
00029                                                          backwardRecHits,
00030                                                          mass, materialEffects,
00031                                                          propDir, magField,
00032                                                          useBeamSpot, beamSpot);
00033 }
00034 
00035 
00036 ReferenceTrajectory*
00037 DualBzeroReferenceTrajectory::construct(const TrajectoryStateOnSurface &referenceTsos, 
00038                                         const ConstRecHitContainer &recHits,
00039                                         double mass, MaterialEffects materialEffects,
00040                                         const PropagationDirection propDir,
00041                                         const MagneticField *magField,
00042                                         bool useBeamSpot,
00043                                         const reco::BeamSpot &beamSpot) const
00044 {
00045   if (materialEffects >= breakPoints)  throw cms::Exception("BadConfig")
00046     << "[DualBzeroReferenceTrajectory::construct] Wrong MaterialEffects: " << materialEffects;
00047   
00048   return new BzeroReferenceTrajectory(referenceTsos, recHits,
00049                                       false, magField,
00050                                       materialEffects, propDir,
00051                                       mass, theMomentumEstimate, useBeamSpot, beamSpot);
00052 }
00053 
00054 
00055 AlgebraicVector
00056 DualBzeroReferenceTrajectory::extractParameters(const TrajectoryStateOnSurface &referenceTsos) const
00057 {
00058   AlgebraicVector param = asHepVector<5>( referenceTsos.localParameters().mixedFormatVector() );
00059   return param.sub( 2, 5 );
00060 }