CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
cms::CompareTrajLay Class Reference

#include <CosmicTrackFinder.h>

Public Member Functions

void AnalHits (const std::vector< TransientTrackingRecHit::ConstRecHitPointer > &hits)
 
bool operator() (Trajectory *t1, Trajectory *t2)
 

Private Attributes

bool ltib1
 
bool ltib2
 
bool ltob1
 
bool ltob2
 
unsigned int nlay
 

Detailed Description

Definition at line 19 of file CosmicTrackFinder.h.

Member Function Documentation

void cms::CompareTrajLay::AnalHits ( const std::vector< TransientTrackingRecHit::ConstRecHitPointer > &  hits)
inline

Definition at line 34 of file CosmicTrackFinder.h.

References ltib1, ltib2, ltob1, ltob2, and nlay.

Referenced by operator()().

34  {
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  }
bool cms::CompareTrajLay::operator() ( Trajectory t1,
Trajectory t2 
)
inline

Definition at line 21 of file CosmicTrackFinder.h.

References AnalHits(), Trajectory::chiSquared(), Trajectory::foundHits(), nlay, and Trajectory::recHits().

21  {
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  }
int foundHits() const
Definition: Trajectory.h:206
ConstRecHitContainer recHits() const
Definition: Trajectory.h:186
void AnalHits(const std::vector< TransientTrackingRecHit::ConstRecHitPointer > &hits)
float chiSquared() const
Definition: Trajectory.h:241

Member Data Documentation

bool cms::CompareTrajLay::ltib1
private

Definition at line 58 of file CosmicTrackFinder.h.

Referenced by AnalHits().

bool cms::CompareTrajLay::ltib2
private

Definition at line 58 of file CosmicTrackFinder.h.

Referenced by AnalHits().

bool cms::CompareTrajLay::ltob1
private

Definition at line 58 of file CosmicTrackFinder.h.

Referenced by AnalHits().

bool cms::CompareTrajLay::ltob2
private

Definition at line 58 of file CosmicTrackFinder.h.

Referenced by AnalHits().

unsigned int cms::CompareTrajLay::nlay
private

Definition at line 59 of file CosmicTrackFinder.h.

Referenced by AnalHits(), and operator()().