CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions
MuonSeedSimpleCleaner Class Reference

#include <MuonSeedSimpleCleaner.h>

Inheritance diagram for MuonSeedSimpleCleaner:
MuonSeedVCleaner

Public Member Functions

virtual void clean (TrajectorySeedCollection &seeds)
 
- Public Member Functions inherited from MuonSeedVCleaner
virtual ~MuonSeedVCleaner ()
 

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(), GeomDetEnumerators::isBarrel(), LocalTrajectoryParameters::momentum(), TrajectorySeed::nHits(), AlCaHLTBitMon_ParallelJobs::p, PTrajectoryStateOnDet::parameters(), PV3DBase< T, PVType, FrameType >::perp(), EnergyCorrector::pt, mps_fire::result, TrajectorySeed::startingState(), DetId::subdetId(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by clean().

28 {
29  bool result = true;
30  if(seed.nHits() == 1)
31  {
32  int rawId = seed.startingState().detId();
33  DetId detId(rawId);
34 
35  bool isBarrel = (detId.subdetId() == 1);
37  // homemade local-to-global
38  double pt = (isBarrel) ? -p.z() : p.perp();
39  if(fabs(pt) < 3.05)
40  {
41  result = false;
42  }
43  }
44  return result;
45 }
T perp() const
Definition: PV3DBase.h:72
bool isBarrel(GeomDetEnumerators::SubDetector m)
tuple result
Definition: mps_fire.py:83
T z() const
Definition: PV3DBase.h:64
unsigned int detId() const
LocalVector momentum() const
Momentum vector in the local frame.
Definition: DetId.h:18
PTrajectoryStateOnDet const & startingState() const
unsigned int nHits() const
const LocalTrajectoryParameters & parameters() const
void MuonSeedSimpleCleaner::clean ( TrajectorySeedCollection seeds)
virtual

Implements MuonSeedVCleaner.

Definition at line 3 of file MuonSeedSimpleCleaner.cc.

References checkPt(), counter, and fileCollector::seed.

4 {
5  for(std::vector<TrajectorySeed>::iterator seed = seeds.begin();
6  seed != seeds.end(); ++seed){
7  if(!checkPt(*seed))
8  {
9  seeds.erase(seed--);
10  }
11  else
12  {
13  int counter =0;
14  for(std::vector<TrajectorySeed>::iterator seed2 = seed;
15  seed2 != seeds.end(); ++seed2)
16  if( seed->startingState().parameters().vector() ==
17  seed2->startingState().parameters().vector() )
18  ++counter;
19  if( counter > 1 ) {
20  seeds.erase(seed--);
21  }
22  }
23  }
24 }
bool checkPt(const TrajectorySeed &seed) const
static std::atomic< unsigned int > counter