CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/RecoVertex/ConfigurableVertexReco/src/ConfigurableMultiVertexFitter.cc

Go to the documentation of this file.
00001 #include "RecoVertex/ConfigurableVertexReco/interface/ConfigurableMultiVertexFitter.h"
00002 #include "RecoVertex/MultiVertexFit/interface/MultiVertexReconstructor.h"
00003 #include "RecoVertex/ConfigurableVertexReco/interface/ConfigurableVertexReconstructor.h"
00004 // #include "RecoVertex/ConfigurableVertexReco/interface/ConfigurableTrimmedKalmanFinder.h"
00005 #include "RecoVertex/MultiVertexFit/interface/MultiVertexBSeeder.h"
00006 
00007 namespace {
00008   edm::ParameterSet mydefaults()
00009   {
00010     edm::ParameterSet ret;
00011     ret.addParameter<double>("sigmacut",9.0);
00012     ret.addParameter<double>("Tini",8.0);
00013     ret.addParameter<double>("ratio",0.25);
00014     ret.addParameter<int>("cheat",0);
00015     edm::ParameterSet nest;
00016     nest.addParameter<std::string>("finder","mbs");
00017     ret.addParameter<edm::ParameterSet>("ini",nest);
00018     return ret;
00019   }
00020 
00021   const AnnealingSchedule * schedule ( const edm::ParameterSet & m )
00022   {
00023     return new GeometricAnnealing(
00024         m.getParameter<double>("sigmacut"), 
00025         m.getParameter<double>("Tini"),
00026         m.getParameter<double>("ratio") );
00027   }
00028   
00029   const VertexReconstructor * initialiser ( const edm::ParameterSet & p )
00030   {
00031     // std::cout << "[ConfigurableMultiVertexFitter] ini: " << p << std::endl;
00032     return new ConfigurableVertexReconstructor ( p );
00033   } 
00034 }
00035 
00036 ConfigurableMultiVertexFitter::ConfigurableMultiVertexFitter() :
00037   theRector ( new MultiVertexReconstructor( MultiVertexBSeeder() ) ),
00038   theCheater(0)
00039 {}
00040 
00041 void ConfigurableMultiVertexFitter::configure(
00042     const edm::ParameterSet & n )
00043 {
00044   edm::ParameterSet m=n;
00045   m.augment ( mydefaults() );
00046   // print ( m );
00047   const AnnealingSchedule * ann = schedule ( m );
00048   const VertexReconstructor * ini = initialiser ( m.getParameter<edm::ParameterSet>("ini") );
00049   if ( theRector ) delete theRector;
00050   theRector = new MultiVertexReconstructor( *ini, *ann );
00051   theCheater=m.getParameter<int>("cheat");
00052   delete ann;
00053   delete ini;
00054 }
00055 
00056 ConfigurableMultiVertexFitter::~ConfigurableMultiVertexFitter()
00057 {
00058   if ( theRector ) delete theRector;
00059 }
00060 
00061 ConfigurableMultiVertexFitter::ConfigurableMultiVertexFitter 
00062     ( const ConfigurableMultiVertexFitter & o ) :
00063   theRector ( o.theRector->clone() ),
00064   theCheater(o.theCheater)
00065 {}
00066 
00067 
00068 ConfigurableMultiVertexFitter * ConfigurableMultiVertexFitter::clone() const
00069 {
00070   return new ConfigurableMultiVertexFitter ( *this );
00071 }
00072 
00073 std::vector < TransientVertex > ConfigurableMultiVertexFitter::vertices ( 
00074     const std::vector < reco::TransientTrack > & t,
00075     const reco::BeamSpot & s ) const
00076 {
00077   return theRector->vertices ( t, s );
00078 }
00079 
00080 std::vector < TransientVertex > ConfigurableMultiVertexFitter::vertices ( 
00081     const std::vector < reco::TransientTrack > & prims,
00082     const std::vector < reco::TransientTrack > & secs,
00083     const reco::BeamSpot & s ) const
00084 {
00085   return theRector->vertices ( prims, secs, s );
00086 }
00087 
00088 std::vector < TransientVertex > ConfigurableMultiVertexFitter::vertices ( 
00089     const std::vector < reco::TransientTrack > & t ) const
00090 {
00091   return theRector->vertices ( t );
00092 }
00093 
00094 edm::ParameterSet ConfigurableMultiVertexFitter::defaults() const
00095 {
00096   return mydefaults();
00097 }
00098 
00099 #include "RecoVertex/ConfigurableVertexReco/interface/ConfRecoBuilder.h"
00100 
00101 namespace {
00102   ConfRecoBuilder < ConfigurableMultiVertexFitter > t ( "mvf", "Multi Vertex Fitter" );
00103 }