CMS 3D CMS Logo

Public Member Functions | Private Member Functions

MuonSeedSimpleCleaner Class Reference

#include <MuonSeedSimpleCleaner.h>

Inheritance diagram for MuonSeedSimpleCleaner:
MuonSeedVCleaner

List of all members.

Public Member Functions

virtual void clean (TrajectorySeedCollection &seeds)

Private Member Functions

bool checkPt (const TrajectorySeed &seed) const

Detailed Description

Definition at line 6 of file MuonSeedSimpleCleaner.h.


Member Function Documentation

bool MuonSeedSimpleCleaner::checkPt ( const TrajectorySeed seed) const [private]

Definition at line 27 of file MuonSeedSimpleCleaner.cc.

References PTrajectoryStateOnDet::detId(), LocalTrajectoryParameters::momentum(), TrajectorySeed::nHits(), L1TEmulatorMonitor_cff::p, PTrajectoryStateOnDet::parameters(), PV3DBase< T, PVType, FrameType >::perp(), ExpressReco_HICollisions_FallBack::pt, query::result, TrajectorySeed::startingState(), DetId::subdetId(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by clean().

{
  bool result = true;
  if(seed.nHits() == 1)
  {
    int rawId = seed.startingState().detId();
    DetId detId(rawId);

    bool isBarrel = (detId.subdetId() == 1);
    LocalVector p = seed.startingState().parameters().momentum();
    // homemade local-to-global
    double pt = (isBarrel) ? -p.z() : p.perp();
    if(fabs(pt) < 3.05)
    {
      result = false;
    }
  }
  return result;
}
void MuonSeedSimpleCleaner::clean ( TrajectorySeedCollection seeds) [virtual]

Implements MuonSeedVCleaner.

Definition at line 3 of file MuonSeedSimpleCleaner.cc.

References checkPt(), and cmsDriverOptions::counter.

{
  for(std::vector<TrajectorySeed>::iterator seed = seeds.begin();
      seed != seeds.end(); ++seed){
    if(!checkPt(*seed))
    {
       seeds.erase(seed--);
    }
    else
    {
      int counter =0;
      for(std::vector<TrajectorySeed>::iterator seed2 = seed;
          seed2 != seeds.end(); ++seed2)
        if( seed->startingState().parameters().vector() ==
            seed2->startingState().parameters().vector() )
          ++counter;
      if( counter > 1 ) {
         seeds.erase(seed--);
      }
    }
  }
}