Go to the documentation of this file.00001
00007 #include "RecoMuon/MuonSeedGenerator/src/RPCSeedFinder.h"
00008 #include <iomanip>
00009
00010 using namespace std;
00011 using namespace edm;
00012
00013
00014 RPCSeedFinder::RPCSeedFinder() {
00015
00016
00017 isrecHitsset = false;
00018 isConfigured = false;
00019 isOutputset = false;
00020 isEventSetupset = false;
00021 oneSeed.clear();
00022 }
00023
00024 RPCSeedFinder::~RPCSeedFinder() {
00025
00026 }
00027
00028 void RPCSeedFinder::configure(const edm::ParameterSet& iConfig) {
00029
00030 oneSeed.configure(iConfig);
00031 isConfigured = true;
00032 }
00033
00034 void RPCSeedFinder::setOutput(std::vector<weightedTrajectorySeed> *goodweightedRef, std::vector<weightedTrajectorySeed> *candidateweightedRef) {
00035
00036 goodweightedSeedsRef = goodweightedRef;
00037 candidateweightedSeedsRef = candidateweightedRef;
00038 isOutputset = true;
00039 }
00040
00041 void RPCSeedFinder::setrecHits(ConstMuonRecHitContainer &recHits) {
00042
00043 oneSeed.clear();
00044 for (ConstMuonRecHitContainer::const_iterator iter = recHits.begin(); iter!= recHits.end(); iter++)
00045 oneSeed.add(*iter);
00046 isrecHitsset = true;
00047 }
00048
00049 void RPCSeedFinder::setEventSetup(const edm::EventSetup& iSetup) {
00050
00051 eSetup = &iSetup;
00052 isEventSetupset = true;
00053 }
00054
00055 void RPCSeedFinder::seed() {
00056
00057 cout << "[RPCSeedFinder] --> seeds called" << endl;
00058
00059 if(isrecHitsset == false || isOutputset == false || isConfigured == false || isEventSetupset == false)
00060 {
00061 cout << "Configuration or IO is not set yet" << endl;
00062 return;
00063 }
00064
00065 weightedTrajectorySeed theweightedSeed;
00066 int isGoodSeed = 0;
00067 const edm::EventSetup &iSetup = *eSetup;
00068 theweightedSeed = oneSeed.seed(iSetup, isGoodSeed);
00069
00070 if(isGoodSeed == 1)
00071 {
00072 cout << "[RPCSeedFinder] --> Seeds from " << oneSeed.nrhit() << " recHits." << endl;
00073 goodweightedSeedsRef->push_back(theweightedSeed);
00074 }
00075
00076 if(isGoodSeed >= 0)
00077 {
00078 candidateweightedSeedsRef->push_back(theweightedSeed);
00079 }
00080
00081
00082 oneSeed.clear();
00083 isrecHitsset = false;
00084 }
00085
00086
00087