Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "Alignment/TwoBodyDecay/interface/TwoBodyDecayFitter.h"
0002 
0003 TwoBodyDecayFitter::TwoBodyDecayFitter(const edm::ParameterSet &config)
0004     : theVertexFinder(new DefaultLinearizationPointFinder()),
0005       theLinPointFinder(new TwoBodyDecayLinearizationPointFinder(config)),
0006       theEstimator(new TwoBodyDecayEstimator(config)) {}
0007 
0008 TwoBodyDecayFitter::TwoBodyDecayFitter(const edm::ParameterSet &config,
0009                                        const LinearizationPointFinder *vf,
0010                                        const TwoBodyDecayLinearizationPointFinder *lpf,
0011                                        const TwoBodyDecayEstimator *est)
0012     : theVertexFinder(vf->clone()), theLinPointFinder(lpf->clone()), theEstimator(est->clone()) {}
0013 
0014 TwoBodyDecayFitter::~TwoBodyDecayFitter(void) {}
0015 
0016 const TwoBodyDecay TwoBodyDecayFitter::estimate(const std::vector<reco::TransientTrack> &tracks,
0017                                                 const TwoBodyDecayVirtualMeasurement &vm) const {
0018   // get geometrical linearization point
0019   GlobalPoint linVertex = theVertexFinder->getLinearizationPoint(tracks);
0020 
0021   // create linearized track states
0022   std::vector<RefCountedLinearizedTrackState> linTracks;
0023   linTracks.push_back(theLinTrackStateFactory.linearizedTrackState(linVertex, tracks[0]));
0024   linTracks.push_back(theLinTrackStateFactory.linearizedTrackState(linVertex, tracks[1]));
0025 
0026   // get full linearization point (geomatrical & kinematical)
0027   const TwoBodyDecayParameters linPoint =
0028       theLinPointFinder->getLinearizationPoint(linTracks, vm.primaryMass(), vm.secondaryMass());
0029 
0030   // make the fit
0031   return theEstimator->estimate(linTracks, linPoint, vm);
0032 }
0033 
0034 const TwoBodyDecay TwoBodyDecayFitter::estimate(const std::vector<reco::TransientTrack> &tracks,
0035                                                 const std::vector<TrajectoryStateOnSurface> &tsos,
0036                                                 const TwoBodyDecayVirtualMeasurement &vm) const {
0037   // get geometrical linearization point
0038   std::vector<FreeTrajectoryState> freeTrajStates;
0039   freeTrajStates.push_back(*tsos[0].freeState());
0040   freeTrajStates.push_back(*tsos[1].freeState());
0041   GlobalPoint linVertex = theVertexFinder->getLinearizationPoint(freeTrajStates);
0042 
0043   // create linearized track states
0044   std::vector<RefCountedLinearizedTrackState> linTracks;
0045   linTracks.push_back(theLinTrackStateFactory.linearizedTrackState(linVertex, tracks[0], tsos[0]));
0046   linTracks.push_back(theLinTrackStateFactory.linearizedTrackState(linVertex, tracks[1], tsos[1]));
0047 
0048   // get full linearization point (geomatrical & kinematical)
0049   const TwoBodyDecayParameters linPoint =
0050       theLinPointFinder->getLinearizationPoint(linTracks, vm.primaryMass(), vm.secondaryMass());
0051 
0052   // make the fit
0053   return theEstimator->estimate(linTracks, linPoint, vm);
0054 }