File indexing completed on 2024-04-06 12:27:08
0001 #include "RecoMuon/MuonSeedGenerator/src/MuonSeedSimpleCleaner.h"
0002
0003 void MuonSeedSimpleCleaner::clean(TrajectorySeedCollection& seeds) {
0004 for (std::vector<TrajectorySeed>::iterator seed = seeds.begin(); seed != seeds.end(); ++seed) {
0005 if (!checkPt(*seed)) {
0006 seeds.erase(seed--);
0007 } else {
0008 int counter = 0;
0009 for (std::vector<TrajectorySeed>::iterator seed2 = seed; seed2 != seeds.end(); ++seed2)
0010 if (seed->startingState().parameters().vector() == seed2->startingState().parameters().vector())
0011 ++counter;
0012 if (counter > 1) {
0013 seeds.erase(seed--);
0014 }
0015 }
0016 }
0017 }
0018
0019 bool MuonSeedSimpleCleaner::checkPt(const TrajectorySeed& seed) const {
0020 bool result = true;
0021 if (seed.nHits() == 1) {
0022 int rawId = seed.startingState().detId();
0023 DetId detId(rawId);
0024
0025 bool isBarrel = (detId.subdetId() == 1);
0026 LocalVector p = seed.startingState().parameters().momentum();
0027
0028 double pt = (isBarrel) ? -p.z() : p.perp();
0029 if (fabs(pt) < 3.05) {
0030 result = false;
0031 }
0032 }
0033 return result;
0034 }