Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "RecoVertex/ConfigurableVertexReco/interface/ConfigurableVertexReconstructor.h"
0002 #include "RecoVertex/ConfigurableVertexReco/interface/VertexRecoManager.h"
0003 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0004 
0005 using namespace std;
0006 
0007 namespace {
0008   void errorNoReconstructor(const string& finder) {
0009     edm::LogError("ConfigurableVertexReconstructor") << "got no reconstructor for \"" << finder << "\"";
0010     vector<string> valid = VertexRecoManager::Instance().getNames();
0011     cout << "  Valid reconstructors are:";
0012     for (const auto& i : valid) {
0013       cout << " " << i;
0014     }
0015     cout << endl;
0016     throw std::string(finder + " not available!");
0017   }
0018 }  // namespace
0019 
0020 ConfigurableVertexReconstructor::ConfigurableVertexReconstructor(const edm::ParameterSet& p) : theRector(nullptr) {
0021   string finder = p.getParameter<string>("finder");
0022   theRector = VertexRecoManager::Instance().get(finder).release();
0023   if (!theRector) {
0024     errorNoReconstructor(finder);
0025   }
0026   theRector->configure(p);
0027   // theRector = theRector->clone();
0028   // theRector = new ReconstructorFromFitter ( KalmanVertexFitter() );
0029 }
0030 
0031 ConfigurableVertexReconstructor::~ConfigurableVertexReconstructor() { delete theRector; }
0032 
0033 ConfigurableVertexReconstructor::ConfigurableVertexReconstructor(const ConfigurableVertexReconstructor& o)
0034     : theRector(o.theRector->clone()) {}
0035 
0036 ConfigurableVertexReconstructor* ConfigurableVertexReconstructor::clone() const {
0037   return new ConfigurableVertexReconstructor(*this);
0038 }
0039 
0040 vector<TransientVertex> ConfigurableVertexReconstructor::vertices(const std::vector<reco::TransientTrack>& prims,
0041                                                                   const std::vector<reco::TransientTrack>& secs,
0042                                                                   const reco::BeamSpot& s) const {
0043   return theRector->vertices(prims, secs, s);
0044 }
0045 
0046 vector<TransientVertex> ConfigurableVertexReconstructor::vertices(const std::vector<reco::TransientTrack>& t,
0047                                                                   const reco::BeamSpot& s) const {
0048   return theRector->vertices(t, s);
0049 }
0050 
0051 vector<TransientVertex> ConfigurableVertexReconstructor::vertices(const std::vector<reco::TransientTrack>& t) const {
0052   return theRector->vertices(t);
0053 }