Go to the documentation of this file.00001 #include "RecoMuon/MuonSeedGenerator/plugins/MuonSeedMerger.h"
00002
00014
00015 #include "FWCore/Framework/interface/Event.h"
00016 #include "FWCore/Framework/interface/EventSetup.h"
00017 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00018 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00019
00020
00021 #include "DataFormats/TrajectorySeed/interface/TrajectorySeed.h"
00022 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
00023 #include "DataFormats/Common/interface/View.h"
00024
00025 using namespace std;
00026 using namespace edm;
00027
00028 MuonSeedMerger::MuonSeedMerger(const ParameterSet& parameterSet){
00029 const string metname = "Muon|RecoMuon|MuonSeedMerger";
00030
00031 theSeedCollectionLabels = parameterSet.getParameter<vector<InputTag> >("SeedCollections");
00032
00033 LogTrace(metname)<< "MuonSeedMerger will Merge the following seed collections:";
00034 for(vector<InputTag>::const_iterator label = theSeedCollectionLabels.begin();
00035 label != theSeedCollectionLabels.end(); ++label)
00036 LogTrace(metname) << *label;
00037
00038
00039 produces<TrajectorySeedCollection>();
00040 }
00041
00042
00043 MuonSeedMerger:: ~MuonSeedMerger(){}
00044
00045 void MuonSeedMerger::produce(Event& event, const EventSetup& eventSetup){
00046
00047 const string metname = "Muon|RecoMuon|MuonSeedMerger";
00048
00049 std::auto_ptr<TrajectorySeedCollection> output(new TrajectorySeedCollection());
00050
00051 Handle<View<TrajectorySeed> > seeds;
00052
00053 for(vector<InputTag>::const_iterator label = theSeedCollectionLabels.begin();
00054 label != theSeedCollectionLabels.end(); ++label){
00055 event.getByLabel(*label,seeds);
00056 LogTrace(metname) << *label << " has "<< seeds->size() <<" seeds";
00057 for(View<TrajectorySeed>::const_iterator seed = seeds->begin(); seed != seeds->end(); ++seed)
00058 output->push_back(*seed);
00059 }
00060
00061 event.put(output);
00062 }