Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:29:06

0001 #include "RecoVertex/ConfigurableVertexReco/interface/ConfigurableMultiVertexFitter.h"
0002 #include "RecoVertex/MultiVertexFit/interface/MultiVertexReconstructor.h"
0003 #include "RecoVertex/ConfigurableVertexReco/interface/ConfigurableVertexReconstructor.h"
0004 // #include "RecoVertex/ConfigurableVertexReco/interface/ConfigurableTrimmedKalmanFinder.h"
0005 #include "RecoVertex/MultiVertexFit/interface/MultiVertexBSeeder.h"
0006 
0007 namespace {
0008   edm::ParameterSet mydefaults() {
0009     edm::ParameterSet ret;
0010     ret.addParameter<double>("sigmacut", 9.0);
0011     ret.addParameter<double>("Tini", 8.0);
0012     ret.addParameter<double>("ratio", 0.25);
0013     ret.addParameter<int>("cheat", 0);
0014     edm::ParameterSet nest;
0015     nest.addParameter<std::string>("finder", "mbs");
0016     ret.addParameter<edm::ParameterSet>("ini", nest);
0017     return ret;
0018   }
0019 
0020   const AnnealingSchedule* schedule(const edm::ParameterSet& m) {
0021     return new GeometricAnnealing(
0022         m.getParameter<double>("sigmacut"), m.getParameter<double>("Tini"), m.getParameter<double>("ratio"));
0023   }
0024 
0025   const VertexReconstructor* initialiser(const edm::ParameterSet& p) {
0026     // std::cout << "[ConfigurableMultiVertexFitter] ini: " << p << std::endl;
0027     return new ConfigurableVertexReconstructor(p);
0028   }
0029 }  // namespace
0030 
0031 ConfigurableMultiVertexFitter::ConfigurableMultiVertexFitter()
0032     : theRector(new MultiVertexReconstructor(MultiVertexBSeeder())), theCheater(0) {}
0033 
0034 void ConfigurableMultiVertexFitter::configure(const edm::ParameterSet& n) {
0035   edm::ParameterSet m = n;
0036   m.augment(mydefaults());
0037   // print ( m );
0038   const AnnealingSchedule* ann = schedule(m);
0039   const VertexReconstructor* ini = initialiser(m.getParameter<edm::ParameterSet>("ini"));
0040   if (theRector)
0041     delete theRector;
0042   theRector = new MultiVertexReconstructor(*ini, *ann);
0043   theCheater = m.getParameter<int>("cheat");
0044   delete ann;
0045   delete ini;
0046 }
0047 
0048 ConfigurableMultiVertexFitter::~ConfigurableMultiVertexFitter() {
0049   if (theRector)
0050     delete theRector;
0051 }
0052 
0053 ConfigurableMultiVertexFitter::ConfigurableMultiVertexFitter(const ConfigurableMultiVertexFitter& o)
0054     : theRector(o.theRector->clone()), theCheater(o.theCheater) {}
0055 
0056 ConfigurableMultiVertexFitter* ConfigurableMultiVertexFitter::clone() const {
0057   return new ConfigurableMultiVertexFitter(*this);
0058 }
0059 
0060 std::vector<TransientVertex> ConfigurableMultiVertexFitter::vertices(const std::vector<reco::TransientTrack>& t,
0061                                                                      const reco::BeamSpot& s) const {
0062   return theRector->vertices(t, s);
0063 }
0064 
0065 std::vector<TransientVertex> ConfigurableMultiVertexFitter::vertices(const std::vector<reco::TransientTrack>& prims,
0066                                                                      const std::vector<reco::TransientTrack>& secs,
0067                                                                      const reco::BeamSpot& s) const {
0068   return theRector->vertices(prims, secs, s);
0069 }
0070 
0071 std::vector<TransientVertex> ConfigurableMultiVertexFitter::vertices(const std::vector<reco::TransientTrack>& t) const {
0072   return theRector->vertices(t);
0073 }
0074 
0075 edm::ParameterSet ConfigurableMultiVertexFitter::defaults() const { return mydefaults(); }
0076 
0077 #include "RecoVertex/ConfigurableVertexReco/interface/ConfRecoBuilder.h"
0078 
0079 namespace {
0080   const ConfRecoBuilder<ConfigurableMultiVertexFitter> t("mvf", "Multi Vertex Fitter");
0081 }