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 Attributes
cms::CompareTrajLay Class Reference

#include <CosmicTrackFinder.h>

Public Member Functions

void AnalHits (std::vector< ConstReferenceCountingPointer< TransientTrackingRecHit > > 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 22 of file CosmicTrackFinder.h.

Member Function Documentation

void cms::CompareTrajLay::AnalHits ( std::vector< ConstReferenceCountingPointer< TransientTrackingRecHit > >  hits)
inline

Definition at line 37 of file CosmicTrackFinder.h.

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

Referenced by operator()().

37  {
38  ltob1=false; ltob2=false; ltib1=false; ltib2=false;
39  std::vector< ConstReferenceCountingPointer< TransientTrackingRecHit> >::const_iterator hit;
40  // ConstRecHitIterator hit;
41  for(hit=hits.begin();hit!=hits.end();hit++){
42  unsigned int iid=(*hit)->hit()->geographicalId().rawId();
43 
44  int sub=(iid>>25)&0x7 ;
45  int lay=(iid>>16) & 0xF;
46  if ((lay==1)&&(sub==3)) ltib1=true;
47  if ((lay==2)&&(sub==3)) ltib2=true;
48  if ((lay==1)&&(sub==5)) ltob1=true;
49  if ((lay==2)&&(sub==5)) ltob2=true;
50  }
52 
53  }
bool cms::CompareTrajLay::operator() ( Trajectory t1,
Trajectory t2 
)
inline

Definition at line 24 of file CosmicTrackFinder.h.

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

25  {
26  AnalHits(t1->recHits());
27  unsigned int alay=nlay;
28  AnalHits(t2->recHits());
29  unsigned int blay=nlay;
30  if (alay!=blay) return alay > blay;
31  if (t1->foundHits() != t2->foundHits())
32  return t1->foundHits()> t2->foundHits();
33  return t1->chiSquared()< t2->chiSquared();
34  // std::cout<<"chi "<<t1.chiSquared()<<" "<<t2.chiSquared()<<std::endl;
35  // return false;
36  }
int foundHits() const
Definition: Trajectory.h:190
void AnalHits(std::vector< ConstReferenceCountingPointer< TransientTrackingRecHit > > hits)
ConstRecHitContainer recHits(bool splitting=false) const
Definition: Trajectory.cc:67
double chiSquared() const
Definition: Trajectory.h:208

Member Data Documentation

bool cms::CompareTrajLay::ltib1
private

Definition at line 56 of file CosmicTrackFinder.h.

Referenced by AnalHits().

bool cms::CompareTrajLay::ltib2
private

Definition at line 56 of file CosmicTrackFinder.h.

Referenced by AnalHits().

bool cms::CompareTrajLay::ltob1
private

Definition at line 56 of file CosmicTrackFinder.h.

Referenced by AnalHits().

bool cms::CompareTrajLay::ltob2
private

Definition at line 56 of file CosmicTrackFinder.h.

Referenced by AnalHits().

unsigned int cms::CompareTrajLay::nlay
private

Definition at line 57 of file CosmicTrackFinder.h.

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