CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CosmicTrackFinder.h
Go to the documentation of this file.
1 #ifndef CosmicTrackFinder_h
2 #define CosmicTrackFinder_h
3 
4 // Package: RecoTracker/SingleTrackPattern
5 // Class: CosmicTrackFinder
6 // Original Author: Michele Pioppi-INFN perugia
7 
8 
18 
19 namespace cms
20 {
22  public:
24  Trajectory *t2){
25  AnalHits(t1->recHits());
26  unsigned int alay=nlay;
27  AnalHits(t2->recHits());
28  unsigned int blay=nlay;
29  if (alay!=blay) return alay > blay;
30  if (t1->foundHits() != t2->foundHits())
31  return t1->foundHits()> t2->foundHits();
32  return t1->chiSquared()< t2->chiSquared();
33  // std::cout<<"chi "<<t1.chiSquared()<<" "<<t2.chiSquared()<<std::endl;
34  // return false;
35  }
36  void AnalHits(const std::vector< TransientTrackingRecHit::ConstRecHitPointer >& hits){
37  ltob1=false; ltob2=false; ltib1=false; ltib2=false;
38  // ConstRecHitIterator hit;
39  for(auto hit=hits.begin();hit!=hits.end();hit++){
40  unsigned int iid=(*hit)->hit()->geographicalId().rawId();
41 
42  int sub=(iid>>25)&0x7 ;
43  int lay=(iid>>16) & 0xF;
44  if ((lay==1)&&(sub==3)) ltib1=true;
45  if ((lay==2)&&(sub==3)) ltib2=true;
46  if ((lay==1)&&(sub==5)) ltob1=true;
47  if ((lay==2)&&(sub==5)) ltob2=true;
48  }
50 
51  }
52 
53  private:
55  unsigned int nlay;
56 
57  };
59  public:
61  Trajectory *t2){
62  if (t1->foundHits() != t2->foundHits())
63  return t1->foundHits()> t2->foundHits();
64  return t1->chiSquared()< t2->chiSquared();
65  }
66  };
68  {
69 
71  public:
72 
73  explicit CosmicTrackFinder(const edm::ParameterSet& conf);
74 
75  virtual ~CosmicTrackFinder();
76 
77  virtual void produce(edm::Event& e, const edm::EventSetup& c);
78 
79  private:
84  bool trinevents;
86  };
87 }
88 
89 #endif
int foundHits() const
Definition: Trajectory.h:234
bool operator()(Trajectory *t1, Trajectory *t2)
TrajectoryStateOnSurface TSOS
CosmicTrajectoryBuilder cosmicTrajectoryBuilder_
CRackTrajectoryBuilder crackTrajectoryBuilder_
void AnalHits(const std::vector< TransientTrackingRecHit::ConstRecHitPointer > &hits)
bool operator()(Trajectory *t1, Trajectory *t2)
CosmicTrackFinder(const edm::ParameterSet &conf)
tuple conf
Definition: dbtoconf.py:185
virtual void produce(edm::Event &e, const edm::EventSetup &c)
float chiSquared() const
Definition: Trajectory.h:252
edm::ParameterSet conf_