CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
SortMuonSegmentMatches Struct Reference

functor predicate for standard library sort algorithm More...

#include <MuonArbitrationMethods.h>

Public Member Functions

bool operator() (std::pair< reco::MuonChamberMatch *, reco::MuonSegmentMatch * > p1, std::pair< reco::MuonChamberMatch *, reco::MuonSegmentMatch * > p2)
 sorts vector of pairs of chamber and segment pointers More...
 
 SortMuonSegmentMatches (unsigned int flag)
 constructor takes arbitration type More...
 

Public Attributes

unsigned int flag_
 

Detailed Description

functor predicate for standard library sort algorithm

Definition at line 12 of file MuonArbitrationMethods.h.

Constructor & Destructor Documentation

SortMuonSegmentMatches::SortMuonSegmentMatches ( unsigned int  flag)
inline

constructor takes arbitration type

Definition at line 14 of file MuonArbitrationMethods.h.

References RemoveAddSevLevel::flag, and flag_.

Member Function Documentation

bool SortMuonSegmentMatches::operator() ( std::pair< reco::MuonChamberMatch *, reco::MuonSegmentMatch * >  p1,
std::pair< reco::MuonChamberMatch *, reco::MuonSegmentMatch * >  p2 
)
inline

sorts vector of pairs of chamber and segment pointers

Definition at line 18 of file MuonArbitrationMethods.h.

References reco::MuonSegmentMatch::BelongsToTrackByDR, reco::MuonSegmentMatch::BelongsToTrackByDRSlope, reco::MuonSegmentMatch::BelongsToTrackByDX, reco::MuonSegmentMatch::BelongsToTrackByDXSlope, reco::MuonSegmentMatch::BestInChamberByDR, reco::MuonSegmentMatch::BestInChamberByDRSlope, reco::MuonSegmentMatch::BestInChamberByDX, reco::MuonSegmentMatch::BestInChamberByDXSlope, reco::MuonSegmentMatch::BestInStationByDR, reco::MuonSegmentMatch::BestInStationByDRSlope, reco::MuonSegmentMatch::BestInStationByDX, reco::MuonSegmentMatch::BestInStationByDXSlope, reco::MuonChamberMatch::dXdZ, reco::MuonSegmentMatch::dXdZ, reco::MuonChamberMatch::dYdZ, reco::MuonSegmentMatch::dYdZ, flag_, reco::MuonSegmentMatch::hasZed(), funct::pow(), mathSSE::sqrt(), reco::MuonChamberMatch::x, reco::MuonSegmentMatch::x, reco::MuonChamberMatch::y, and reco::MuonSegmentMatch::y.

20  {
21  reco::MuonChamberMatch* cm1 = p1.first;
22  reco::MuonSegmentMatch* sm1 = p1.second;
23  reco::MuonChamberMatch* cm2 = p2.first;
24  reco::MuonSegmentMatch* sm2 = p2.second;
25 
29  return fabs(sm1->x-cm1->x) < fabs(sm2->x-cm2->x);
33  {
34  if((! sm1->hasZed()) || (! sm2->hasZed())) // no y information so return dx
35  return fabs(sm1->x-cm1->x) < fabs(sm2->x-cm2->x);
36  return sqrt(pow(sm1->x-cm1->x,2)+pow(sm1->y-cm1->y,2)) <
37  sqrt(pow(sm2->x-cm2->x,2)+pow(sm2->y-cm2->y,2));
38  }
42  return fabs(sm1->dXdZ-cm1->dXdZ) < fabs(sm2->dXdZ-cm2->dXdZ);
46  {
47  if((! sm1->hasZed()) || (! sm2->hasZed())) // no y information so return dx
48  return fabs(sm1->dXdZ-cm1->dXdZ) < fabs(sm2->dXdZ-cm2->dXdZ);
49  return sqrt(pow(sm1->dXdZ-cm1->dXdZ,2)+pow(sm1->dYdZ-cm1->dYdZ,2)) <
50  sqrt(pow(sm2->dXdZ-cm2->dXdZ,2)+pow(sm2->dYdZ-cm2->dYdZ,2));
51  }
52 
53  return false; // is this appropriate? fix this
54  }
static const unsigned int BestInStationByDRSlope
static const unsigned int BelongsToTrackByDXSlope
static const unsigned int BestInStationByDR
T sqrt(T t)
Definition: SSEVec.h:18
static const unsigned int BestInChamberByDX
static const unsigned int BestInChamberByDR
double p2[4]
Definition: TauolaWrapper.h:90
static const unsigned int BestInStationByDXSlope
static const unsigned int BestInChamberByDXSlope
static const unsigned int BelongsToTrackByDRSlope
static const unsigned int BelongsToTrackByDR
static const unsigned int BelongsToTrackByDX
double p1[4]
Definition: TauolaWrapper.h:89
static const unsigned int BestInStationByDX
static const unsigned int BestInChamberByDRSlope
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40

Member Data Documentation

unsigned int SortMuonSegmentMatches::flag_

Definition at line 56 of file MuonArbitrationMethods.h.

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