CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10/src/RecoMuon/MuonSeedGenerator/src/MuonSeedSimpleCleaner.cc

Go to the documentation of this file.
00001 #include "RecoMuon/MuonSeedGenerator/src/MuonSeedSimpleCleaner.h"
00002 
00003 void MuonSeedSimpleCleaner::clean(TrajectorySeedCollection & seeds)
00004 {
00005   for(std::vector<TrajectorySeed>::iterator seed = seeds.begin();
00006       seed != seeds.end(); ++seed){
00007     if(!checkPt(*seed))
00008     {
00009        seeds.erase(seed--);
00010     }
00011     else
00012     {
00013       int counter =0;
00014       for(std::vector<TrajectorySeed>::iterator seed2 = seed;
00015           seed2 != seeds.end(); ++seed2)
00016         if( seed->startingState().parameters().vector() ==
00017             seed2->startingState().parameters().vector() )
00018           ++counter;
00019       if( counter > 1 ) {
00020          seeds.erase(seed--);
00021       }
00022     }
00023   }
00024 }
00025 
00026 
00027 bool MuonSeedSimpleCleaner::checkPt(const TrajectorySeed & seed) const
00028 {
00029   bool result = true;
00030   if(seed.nHits() == 1)
00031   {
00032     int rawId = seed.startingState().detId();
00033     DetId detId(rawId);
00034 
00035     bool isBarrel = (detId.subdetId() == 1);
00036     LocalVector p = seed.startingState().parameters().momentum();
00037     // homemade local-to-global
00038     double pt = (isBarrel) ? -p.z() : p.perp();
00039     if(fabs(pt) < 3.05)
00040     {
00041       result = false;
00042     }
00043   }
00044   return result;
00045 }
00046