CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuonSeedSimpleCleaner.cc
Go to the documentation of this file.
2 
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 }
25 
26 
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 }
46 
bool checkPt(const TrajectorySeed &seed) const
T perp() const
Definition: PV3DBase.h:72
virtual void clean(TrajectorySeedCollection &seeds)
std::vector< TrajectorySeed > TrajectorySeedCollection
T z() const
Definition: PV3DBase.h:64
tuple result
Definition: query.py:137
unsigned int detId() const
LocalVector momentum() const
Momentum vector in the local frame.
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
Definition: DetId.h:20
PTrajectoryStateOnDet const & startingState() const
unsigned int nHits() const
const LocalTrajectoryParameters & parameters() const