CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 
17 
18 namespace cms {
20  public:
21  bool operator()(Trajectory* t1, Trajectory* t2) {
22  AnalHits(t1->recHits());
23  unsigned int alay = nlay;
24  AnalHits(t2->recHits());
25  unsigned int blay = nlay;
26  if (alay != blay)
27  return alay > blay;
28  if (t1->foundHits() != t2->foundHits())
29  return t1->foundHits() > t2->foundHits();
30  return t1->chiSquared() < t2->chiSquared();
31  // std::cout<<"chi "<<t1.chiSquared()<<" "<<t2.chiSquared()<<std::endl;
32  // return false;
33  }
34  void AnalHits(const std::vector<TransientTrackingRecHit::ConstRecHitPointer>& hits) {
35  ltob1 = false;
36  ltob2 = false;
37  ltib1 = false;
38  ltib2 = false;
39  // ConstRecHitIterator hit;
40  for (auto hit = hits.begin(); hit != hits.end(); hit++) {
41  unsigned int iid = (*hit)->hit()->geographicalId().rawId();
42 
43  int sub = (iid >> 25) & 0x7;
44  int lay = (iid >> 16) & 0xF;
45  if ((lay == 1) && (sub == 3))
46  ltib1 = true;
47  if ((lay == 2) && (sub == 3))
48  ltib2 = true;
49  if ((lay == 1) && (sub == 5))
50  ltob1 = true;
51  if ((lay == 2) && (sub == 5))
52  ltob2 = true;
53  }
54  nlay = ltib1 + ltib2 + ltob1 + ltob2;
55  }
56 
57  private:
59  unsigned int nlay;
60  };
62  public:
63  bool operator()(Trajectory* t1, Trajectory* t2) {
64  if (t1->foundHits() != t2->foundHits())
65  return t1->foundHits() > t2->foundHits();
66  return t1->chiSquared() < t2->chiSquared();
67  }
68  };
71 
72  public:
73  explicit CosmicTrackFinder(const edm::ParameterSet& conf);
74 
75  ~CosmicTrackFinder() override;
76 
77  void produce(edm::Event& e, const edm::EventSetup& c) override;
78 
79  private:
84  bool trinevents;
91  };
92 } // namespace cms
93 
94 #endif
int foundHits() const
Definition: Trajectory.h:206
bool operator()(Trajectory *t1, Trajectory *t2)
const edm::EventSetup & c
TrajectoryStateOnSurface TSOS
edm::EDGetTokenT< SiStripRecHit2DCollection > stereorecHitsToken_
CosmicTrajectoryBuilder cosmicTrajectoryBuilder_
ConstRecHitContainer recHits() const
Definition: Trajectory.h:186
CRackTrajectoryBuilder crackTrajectoryBuilder_
void AnalHits(const std::vector< TransientTrackingRecHit::ConstRecHitPointer > &hits)
bool operator()(Trajectory *t1, Trajectory *t2)
edm::EDGetTokenT< SiPixelRecHitCollection > pixelRecHitsToken_
void produce(edm::Event &e, const edm::EventSetup &c) override
CosmicTrackFinder(const edm::ParameterSet &conf)
edm::EDGetTokenT< TrajectorySeedCollection > seedToken_
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > matchedrecHitsToken_
edm::EDGetTokenT< SiStripRecHit2DCollection > rphirecHitsToken_
float chiSquared() const
Definition: Trajectory.h:241
edm::ParameterSet conf_