CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/RecoMuon/TrackerSeedGenerator/plugins/CompositeTSG.cc

Go to the documentation of this file.
00001 #include "RecoMuon/TrackerSeedGenerator/plugins/CompositeTSG.h"
00002 
00003 #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h"
00004 #include "RecoMuon/TrackerSeedGenerator/interface/TrackerSeedGeneratorFactory.h"
00005 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00006 
00007 CompositeTSG::CompositeTSG(const edm::ParameterSet & par){
00008   theCategory = "CompositeTSG";
00009 
00010   //configure the individual components of the TSG
00011   std::vector<std::string> PSetNames =  par.getParameter<std::vector<std::string> >("PSetNames");
00012 
00013   for (std::vector<std::string>::iterator nIt = PSetNames.begin();nIt!=PSetNames.end();nIt++){
00014     edm::ParameterSet TSGpset = par.getParameter<edm::ParameterSet>(*nIt);
00015     if (TSGpset.empty()) {
00016       theNames.push_back((*nIt)+":"+"NULL");
00017       theTSGs.push_back((TrackerSeedGenerator*)(0));
00018     }else {
00019       std::string SeedGenName = TSGpset.getParameter<std::string>("ComponentName");
00020       theNames.push_back((*nIt)+":"+SeedGenName);
00021       theTSGs.push_back(TrackerSeedGeneratorFactory::get()->create(SeedGenName,TSGpset));
00022     }
00023   }
00024   
00025 }
00026 
00027 CompositeTSG::~CompositeTSG(){
00028   //delete the components ?
00029 }
00030 
00031 
00032 void CompositeTSG::init(const MuonServiceProxy* service){
00033   theProxyService = service;
00034   for (unsigned int iTSG=0; iTSG!=theTSGs.size();iTSG++){
00035     if(theTSGs[iTSG]) theTSGs[iTSG]->init(service);
00036   }
00037 }
00038 
00039 void CompositeTSG::setEvent(const edm::Event &event){
00040   theEvent = &event;
00041   for (unsigned int iTSG=0; iTSG!=theTSGs.size();iTSG++){
00042     if(theTSGs[iTSG]) theTSGs[iTSG]->setEvent(event);
00043   }
00044 }