CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1MuDTERS.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1MuDTERS
4 //
5 // Description: Extrapolation Result Selector
6 //
7 //
8 // $Date: 2007/02/27 11:44:00 $
9 // $Revision: 1.2 $
10 //
11 // Author :
12 // N. Neumeister CERN EP
13 //
14 //--------------------------------------------------
15 
16 //-----------------------
17 // This Class's Header --
18 //-----------------------
19 
21 
22 //---------------
23 // C++ Headers --
24 //---------------
25 
26 #include <iostream>
27 #include <algorithm>
28 
29 //-------------------------------
30 // Collaborating Class Headers --
31 //-------------------------------
32 
37 
38 using namespace std;
39 
40 // --------------------------------
41 // class L1MuDTERS
42 //---------------------------------
43 
44 //----------------
45 // Constructors --
46 //----------------
47 
48 L1MuDTERS::L1MuDTERS(const L1MuDTSEU& seu) : m_seu(seu) {
49 
50  reset();
51 
52 }
53 
54 
55 //--------------
56 // Destructor --
57 //--------------
58 
60 
61 
62 //--------------
63 // Operations --
64 //--------------
65 
66 //
67 // run ERS
68 //
70 
71  int n_ext = m_seu.numberOfExt();
72  if ( n_ext > 0 ) {
73  vector<L1MuDTEUX*>::const_iterator first = m_seu.eux().begin();
74  vector<L1MuDTEUX*>::const_iterator last = m_seu.eux().end();
75  vector<L1MuDTEUX*>::const_iterator first_max;
76  vector<L1MuDTEUX*>::const_iterator second_max;
77 
78  // find the best extrapolation
79  first_max = max_element(first, last, L1MuDTEUX::EUX_Comp() );
80  m_address[0] = (*first_max)->address();
81  m_quality[0] = (*first_max)->quality();
82  m_start[0] = (*first_max)->ts().first;
83  m_target[0] = (*first_max)->ts().second;
84 
85 
86  if ( n_ext > 1 ) {
87  // find the second best extrapolation
88  second_max = max_element(first, last, L1MuDTEUX::EUX_Comp(*first_max) );
89  m_address[1] = (*second_max)->address();
90  m_quality[1] = (*second_max)->quality();
91  m_start[1] = (*second_max)->ts().first;
92  m_target[1] = (*second_max)->ts().second;
93  }
94 
95  if ( L1MuDTTFConfig::Debug(4) ) {
96  cout << "ERS : " << endl;
97  cout << "\t first : " << m_address[0] << '\t' << m_quality[0] << endl;
98  cout << "\t second : " << m_address[1] << '\t' << m_quality[1] << endl;
99  }
100 
101  }
102 
103 }
104 
105 
106 //
107 // reset ERS
108 //
110 
111  for ( int id = 0; id < 2; id++ ) {
112  m_quality[id] = 0;
113  m_address[id] = 15;
114  m_start[id] = 0;
115  m_target[id] = 0;
116  }
117 
118 }
119 
120 
121 //
122 // return pointer to start and target track segment
123 //
124 pair<const L1MuDTTrackSegPhi*, const L1MuDTTrackSegPhi*> L1MuDTERS::ts(int id) const {
125 
126  return pair<const L1MuDTTrackSegPhi*,const L1MuDTTrackSegPhi*>(m_start[id],m_target[id]);
127 
128 }
virtual ~L1MuDTERS()
destructor
Definition: L1MuDTERS.cc:59
virtual void reset()
reset ERS
Definition: L1MuDTERS.cc:109
L1MuDTERS(const L1MuDTSEU &)
constructor
Definition: L1MuDTERS.cc:48
const L1MuDTTrackSegPhi * m_start[2]
Definition: L1MuDTERS.h:77
unsigned short int m_address[2]
Definition: L1MuDTERS.h:75
static bool Debug()
bool first
Definition: L1TdeRCT.cc:94
helper class for finding the best and second best extrapolation
Definition: L1MuDTEUX.h:79
virtual void run()
run L1MuDTERS
Definition: L1MuDTERS.cc:69
const L1MuDTTrackSegPhi * m_target[2]
Definition: L1MuDTERS.h:78
const L1MuDTSEU & m_seu
Definition: L1MuDTERS.h:72
unsigned short int m_quality[2]
Definition: L1MuDTERS.h:74
int numberOfExt() const
return number of successful extrapolations
Definition: L1MuDTSEU.cc:189
tuple cout
Definition: gather_cfg.py:121
const std::vector< L1MuDTEUX * > & eux() const
return pointer to an Extrapolator
Definition: L1MuDTSEU.h:94
std::pair< const L1MuDTTrackSegPhi *, const L1MuDTTrackSegPhi * > ts(int id) const
return pointer to start and target track segment
Definition: L1MuDTERS.cc:124