File indexing completed on 2024-04-06 12:27:15
0001 #include "RecoMuon/TrackerSeedGenerator/plugins/CompositeTSG.h"
0002
0003 #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h"
0004 #include "RecoMuon/TrackerSeedGenerator/interface/TrackerSeedGeneratorFactory.h"
0005 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0006
0007 CompositeTSG::CompositeTSG(const edm::ParameterSet& par, edm::ConsumesCollector& IC) {
0008 theCategory = "CompositeTSG";
0009
0010
0011 std::vector<std::string> PSetNames = par.getParameter<std::vector<std::string> >("PSetNames");
0012
0013 for (std::vector<std::string>::iterator nIt = PSetNames.begin(); nIt != PSetNames.end(); nIt++) {
0014 edm::ParameterSet TSGpset = par.getParameter<edm::ParameterSet>(*nIt);
0015 if (TSGpset.empty()) {
0016 theNames.push_back((*nIt) + ":" + "NULL");
0017 theTSGs.emplace_back(nullptr);
0018 } else {
0019 std::string SeedGenName = TSGpset.getParameter<std::string>("ComponentName");
0020 theNames.push_back((*nIt) + ":" + SeedGenName);
0021 theTSGs.emplace_back(TrackerSeedGeneratorFactory::get()->create(SeedGenName, TSGpset, IC));
0022 }
0023 }
0024 }
0025
0026 CompositeTSG::~CompositeTSG() = default;
0027
0028 void CompositeTSG::init(const MuonServiceProxy* service) {
0029 theProxyService = service;
0030 for (unsigned int iTSG = 0; iTSG != theTSGs.size(); iTSG++) {
0031 if (theTSGs[iTSG])
0032 theTSGs[iTSG]->init(service);
0033 }
0034 }
0035
0036 void CompositeTSG::setEvent(const edm::Event& event) {
0037 theEvent = &event;
0038 for (unsigned int iTSG = 0; iTSG != theTSGs.size(); iTSG++) {
0039 if (theTSGs[iTSG])
0040 theTSGs[iTSG]->setEvent(event);
0041 }
0042 }