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 Member Functions | Private Attributes
L1MuDTSectorProcessor Class Reference

#include <L1MuDTSectorProcessor.h>

Public Member Functions

const L1MuDTAssignmentUnitAU (int id) const
 return pointer to Assignment Unit, index [0,1] More...
 
bool brl () const
 is it a barrel-only Sector Processor? More...
 
const L1MuDTDataBufferdata () const
 return pointer to Data Buffer More...
 
L1MuDTDataBufferdata ()
 
const L1MuDTExtrapolationUnitEU () const
 return pointer to Extrapolation Unit More...
 
const L1MuDTSecProcIdid () const
 return Sector Processor identifier More...
 
 L1MuDTSectorProcessor (const L1MuDTTrackFinder &, const L1MuDTSecProcId &)
 constructor More...
 
const L1MuDTSectorProcessorneighbour () const
 return pointer to the next wheel neighbour More...
 
bool ovl () const
 is it an overlap region Sector Processor? More...
 
void print () const
 print muon candidates found by the Sector Processor More...
 
virtual void reset ()
 reset the Sector Processor More...
 
virtual void run (int bx, const edm::Event &e, const edm::EventSetup &c)
 run the Sector Processor More...
 
const L1MuDTTrackAssemblerTA () const
 return pointer to Track Assembler More...
 
const L1MuDTTrackFindertf () const
 return reference to barrel MTTF More...
 
L1MuDTTracktrack (int id) const
 return pointer to muon candidate, index [0,1] More...
 
L1MuDTTracktracK (int id) const
 return pointer to muon candidate, index [0,1] More...
 
virtual ~L1MuDTSectorProcessor ()
 destructor More...
 

Private Member Functions

bool anyTrack () const
 are there any non-empty muon candidates? More...
 

Private Attributes

std::vector
< L1MuDTAssignmentUnit * > 
m_AUs
 
L1MuDTDataBufferm_DataBuffer
 
L1MuDTExtrapolationUnitm_EU
 
L1MuDTSectorReceiverm_SectorReceiver
 
L1MuDTSecProcId m_spid
 
L1MuDTTrackAssemblerm_TA
 
const L1MuDTTrackFinderm_tf
 
std::vector< L1MuDTTrack * > m_TrackCands
 
std::vector< L1MuDTTrack * > m_TracKCands
 

Detailed Description

Sector Processor:

A Sector Processor consists of:

Date:
2008/05/09 15:01:59
Revision:
1.4

N. Neumeister CERN EP J. Troconiz UAM Madrid

Definition at line 54 of file L1MuDTSectorProcessor.h.

Constructor & Destructor Documentation

L1MuDTSectorProcessor::L1MuDTSectorProcessor ( const L1MuDTTrackFinder tf,
const L1MuDTSecProcId id 
)

constructor

Definition at line 55 of file L1MuDTSectorProcessor.cc.

References m_AUs, m_spid, m_TrackCands, and m_TracKCands.

56  :
57  m_tf(tf), m_spid(id),
59  m_DataBuffer(new L1MuDTDataBuffer(*this)),
60  m_EU(new L1MuDTExtrapolationUnit(*this)),
61  m_TA(new L1MuDTTrackAssembler(*this)),
63 
64  // 2 assignment units
65  m_AUs.reserve(2);
66  m_AUs.push_back(new L1MuDTAssignmentUnit(*this,0));
67  m_AUs.push_back(new L1MuDTAssignmentUnit(*this,1));
68 
69  // now the 2 track candidates
70  m_TrackCands.reserve(2);
71  m_TrackCands.push_back(new L1MuDTTrack(m_spid) );
72  m_TrackCands.push_back(new L1MuDTTrack(m_spid) );
73 
74  m_TracKCands.reserve(2);
75  m_TracKCands.push_back(new L1MuDTTrack(m_spid) );
76  m_TracKCands.push_back(new L1MuDTTrack(m_spid) );
77 
78 }
L1MuDTSectorReceiver * m_SectorReceiver
std::vector< L1MuDTAssignmentUnit * > m_AUs
std::vector< L1MuDTTrack * > m_TracKCands
L1MuDTExtrapolationUnit * m_EU
L1MuDTDataBuffer * m_DataBuffer
L1MuDTTrackAssembler * m_TA
const L1MuDTTrackFinder & m_tf
std::vector< L1MuDTTrack * > m_TrackCands
L1MuDTSectorProcessor::~L1MuDTSectorProcessor ( )
virtual

destructor

Definition at line 85 of file L1MuDTSectorProcessor.cc.

References m_AUs, m_DataBuffer, m_EU, m_SectorReceiver, m_TA, m_TrackCands, and m_TracKCands.

85  {
86 
87  delete m_SectorReceiver;
88  delete m_DataBuffer;
89  delete m_EU;
90  delete m_TA;
91  delete m_AUs[0];
92  delete m_AUs[1];
93  delete m_TrackCands[0];
94  delete m_TrackCands[1];
95  delete m_TracKCands[0];
96  delete m_TracKCands[1];
97 
98 }
L1MuDTSectorReceiver * m_SectorReceiver
std::vector< L1MuDTAssignmentUnit * > m_AUs
std::vector< L1MuDTTrack * > m_TracKCands
L1MuDTExtrapolationUnit * m_EU
L1MuDTDataBuffer * m_DataBuffer
L1MuDTTrackAssembler * m_TA
std::vector< L1MuDTTrack * > m_TrackCands

Member Function Documentation

bool L1MuDTSectorProcessor::anyTrack ( ) const
private

are there any non-empty muon candidates?

Definition at line 242 of file L1MuDTSectorProcessor.cc.

References relativeConstraints::empty, and m_TrackCands.

Referenced by print().

242  {
243 
244  if ( m_TrackCands[0] && !m_TrackCands[0]->empty() ) return true;
245  if ( m_TrackCands[1] && !m_TrackCands[1]->empty() ) return true;
246 
247  return false;
248 
249 }
std::vector< L1MuDTTrack * > m_TrackCands
const L1MuDTAssignmentUnit* L1MuDTSectorProcessor::AU ( int  id) const
inline

return pointer to Assignment Unit, index [0,1]

Definition at line 99 of file L1MuDTSectorProcessor.h.

References id(), and m_AUs.

99 { return m_AUs[id]; }
std::vector< L1MuDTAssignmentUnit * > m_AUs
const L1MuDTSecProcId & id() const
return Sector Processor identifier
bool L1MuDTSectorProcessor::brl ( ) const
inline

is it a barrel-only Sector Processor?

Definition at line 83 of file L1MuDTSectorProcessor.h.

References m_spid, and L1MuDTSecProcId::ovl().

83 { return !m_spid.ovl(); }
bool ovl() const
is it an overlap region Sector Processor?
const L1MuDTDataBuffer* L1MuDTSectorProcessor::data ( ) const
inline
L1MuDTDataBuffer* L1MuDTSectorProcessor::data ( )
inline

Definition at line 90 of file L1MuDTSectorProcessor.h.

References m_DataBuffer.

90 { return m_DataBuffer; }
L1MuDTDataBuffer * m_DataBuffer
const L1MuDTExtrapolationUnit* L1MuDTSectorProcessor::EU ( ) const
inline

return pointer to Extrapolation Unit

Definition at line 93 of file L1MuDTSectorProcessor.h.

References m_EU.

Referenced by L1MuDTTrackAssembler::run().

93 { return m_EU; }
L1MuDTExtrapolationUnit * m_EU
const L1MuDTSecProcId& L1MuDTSectorProcessor::id ( void  ) const
inline
const L1MuDTSectorProcessor * L1MuDTSectorProcessor::neighbour ( ) const

return pointer to the next wheel neighbour

Definition at line 220 of file L1MuDTSectorProcessor.cc.

References abs, id(), m_spid, m_tf, L1MuDTSecProcId::sector(), L1MuDTTrackFinder::sp(), and L1MuDTSecProcId::wheel().

220  {
221 
222  int sector = m_spid.sector();
223  int wheel = m_spid.wheel();
224 
225  // the neighbour is in the same wedge with the following definition:
226  // current SP -3 -2 -1 +1 +2 +3
227  // neighbour -2 -1 +1 0 +1 +2
228 
229  if ( wheel == 1) return 0;
230  wheel = (wheel == -1) ? 1 : (wheel/abs(wheel)) * (abs(wheel)-1);
231 
232  const L1MuDTSecProcId id(wheel,sector);
233 
234  return m_tf.sp(id);
235 
236 }
const L1MuDTSectorProcessor * sp(const L1MuDTSecProcId &) const
get a pointer to a Sector Processor
#define abs(x)
Definition: mlp_lapack.h:159
int sector() const
return sector number
const L1MuDTSecProcId & id() const
return Sector Processor identifier
int wheel() const
return wheel number
const L1MuDTTrackFinder & m_tf
bool L1MuDTSectorProcessor::ovl ( ) const
inline

is it an overlap region Sector Processor?

Definition at line 86 of file L1MuDTSectorProcessor.h.

References m_spid, and L1MuDTSecProcId::ovl().

Referenced by L1MuDTAssignmentUnit::getPtMethod(), L1MuDTSectorReceiver::receiveDTBXData(), and L1MuDTSectorReceiver::run().

86 { return m_spid.ovl(); }
bool ovl() const
is it an overlap region Sector Processor?
void L1MuDTSectorProcessor::print ( void  ) const

print muon candidates found by the Sector Processor

Definition at line 203 of file L1MuDTSectorProcessor.cc.

References anyTrack(), gather_cfg::cout, m_spid, and m_TrackCands.

203  {
204 
205  if ( anyTrack() ) {
206  cout << "Muon candidates found in " << m_spid << " : " << endl;
207  vector<L1MuDTTrack*>::const_iterator iter = m_TrackCands.begin();
208  while ( iter != m_TrackCands.end() ) {
209  if ( *iter) (*iter)->print();
210  iter++;
211  }
212  }
213 
214 }
bool anyTrack() const
are there any non-empty muon candidates?
tuple cout
Definition: gather_cfg.py:121
std::vector< L1MuDTTrack * > m_TrackCands
void L1MuDTSectorProcessor::reset ( void  )
virtual

reset the Sector Processor

Definition at line 184 of file L1MuDTSectorProcessor.cc.

References m_AUs, m_DataBuffer, m_EU, m_SectorReceiver, m_TA, m_TrackCands, m_TracKCands, L1MuDTDataBuffer::reset(), L1MuDTSectorReceiver::reset(), L1MuDTTrackAssembler::reset(), and L1MuDTExtrapolationUnit::reset().

Referenced by run().

184  {
185 
187  if ( m_DataBuffer ) m_DataBuffer->reset();
188  if ( m_EU ) m_EU->reset();
189  if ( m_TA ) m_TA->reset();
190  if ( m_AUs[0] ) m_AUs[0]->reset();
191  if ( m_AUs[1] ) m_AUs[1]->reset();
192  if ( m_TrackCands[0] ) m_TrackCands[0]->reset();
193  if ( m_TrackCands[1] ) m_TrackCands[1]->reset();
194  if ( m_TracKCands[0] ) m_TracKCands[0]->reset();
195  if ( m_TracKCands[1] ) m_TracKCands[1]->reset();
196 
197 }
void reset()
clear Sector Receiver
virtual void reset()
reset Extrapolation Unit
L1MuDTSectorReceiver * m_SectorReceiver
std::vector< L1MuDTAssignmentUnit * > m_AUs
void reset()
clear Data Buffer
std::vector< L1MuDTTrack * > m_TracKCands
L1MuDTExtrapolationUnit * m_EU
virtual void reset()
reset Track Assembler
L1MuDTDataBuffer * m_DataBuffer
L1MuDTTrackAssembler * m_TA
std::vector< L1MuDTTrack * > m_TrackCands
void L1MuDTSectorProcessor::run ( int  bx,
const edm::Event e,
const edm::EventSetup c 
)
virtual

run the Sector Processor

Definition at line 107 of file L1MuDTSectorProcessor.cc.

References gather_cfg::cout, L1MuDTTFConfig::Debug(), relativeConstraints::empty, L1MuDTTrackAssembler::isEmpty(), m_AUs, m_DataBuffer, m_EU, m_SectorReceiver, m_spid, m_TA, m_TrackCands, m_TracKCands, L1MuDTExtrapolationUnit::numberOfExt(), L1MuDTDataBuffer::numberTSphi(), L1MuDTTrackAssembler::print(), L1MuDTExtrapolationUnit::print(), L1MuDTDataBuffer::printTSphi(), reset(), L1MuDTSectorReceiver::run(), L1MuDTTrackAssembler::run(), L1MuDTExtrapolationUnit::run(), and L1MuDTSecProcId::wheel().

107  {
108 
109  // receive data and store them into the data buffer
110  if ( m_SectorReceiver ) m_SectorReceiver->run(bx, e, c);
111 
112  // check content of data buffer
113  if ( m_DataBuffer ) {
114  if ( L1MuDTTFConfig::Debug(4) && m_DataBuffer->numberTSphi() > 0 ) {
115  cout << "Phi track segments received by " << m_spid << " : " << endl;
117  }
118  }
119 
120  // perform all extrapolations
121  int n_ext = 0; // number of successful extrapolations
122  if ( m_EU && m_DataBuffer && m_DataBuffer->numberTSphi() > 1 ) {
123  m_EU->run(c);
124  n_ext = m_EU->numberOfExt();
125  if ( L1MuDTTFConfig::Debug(3) && n_ext > 0 ) {
126  cout << "Number of successful extrapolations : " << n_ext << endl;
127  m_EU->print();
128  }
129  }
130 
131  // hardware debug (output from Extrapolator and Quality Sorter)
132  // m_EU->print(1);
133 
134  // perform track assembling
135  if ( m_TA && n_ext > 0 ) {
136  m_TA->run();
137  if ( L1MuDTTFConfig::Debug(3) ) m_TA->print();
138  }
139 
140  // assign pt, eta, phi and quality
141  if ( m_AUs[0] && !m_TA->isEmpty(0) ) m_AUs[0]->run(c);
142  if ( m_AUs[1] && !m_TA->isEmpty(1) ) m_AUs[1]->run(c);
143 
144  if ( m_spid.wheel() == -1 ) {
145  if ( m_TrackCands[0] && !m_TrackCands[0]->empty() && m_TrackCands[0]->address(2)>3 && m_TrackCands[0]->address(2)<6 ) m_TrackCands[0]->reset();
146  if ( m_TrackCands[0] && !m_TrackCands[0]->empty() && m_TrackCands[0]->address(3)>3 && m_TrackCands[0]->address(3)<6 ) m_TrackCands[0]->reset();
147  if ( m_TrackCands[0] && !m_TrackCands[0]->empty() && m_TrackCands[0]->address(4)>3 && m_TrackCands[0]->address(4)<6 ) m_TrackCands[0]->reset();
148 
149  if ( m_TracKCands[0] && !m_TracKCands[0]->empty() && m_TracKCands[0]->address(2)>3 && m_TracKCands[0]->address(2)<6 ) m_TracKCands[0]->reset();
150  if ( m_TracKCands[0] && !m_TracKCands[0]->empty() && m_TracKCands[0]->address(3)>3 && m_TracKCands[0]->address(3)<6 ) m_TracKCands[0]->reset();
151  if ( m_TracKCands[0] && !m_TracKCands[0]->empty() && m_TracKCands[0]->address(4)>3 && m_TracKCands[0]->address(4)<6 ) m_TracKCands[0]->reset();
152 
153  if ( m_TrackCands[1] && !m_TrackCands[1]->empty() && m_TrackCands[1]->address(2)>3 && m_TrackCands[1]->address(2)<6 ) m_TrackCands[1]->reset();
154  if ( m_TrackCands[1] && !m_TrackCands[1]->empty() && m_TrackCands[1]->address(3)>3 && m_TrackCands[1]->address(3)<6 ) m_TrackCands[1]->reset();
155  if ( m_TrackCands[1] && !m_TrackCands[1]->empty() && m_TrackCands[1]->address(4)>3 && m_TrackCands[1]->address(4)<6 ) m_TrackCands[1]->reset();
156 
157  if ( m_TracKCands[1] && !m_TracKCands[1]->empty() && m_TracKCands[1]->address(2)>3 && m_TracKCands[1]->address(2)<6 ) m_TracKCands[1]->reset();
158  if ( m_TracKCands[1] && !m_TracKCands[1]->empty() && m_TracKCands[1]->address(3)>3 && m_TracKCands[1]->address(3)<6 ) m_TracKCands[1]->reset();
159  if ( m_TracKCands[1] && !m_TracKCands[1]->empty() && m_TracKCands[1]->address(4)>3 && m_TracKCands[1]->address(4)<6 ) m_TracKCands[1]->reset();
160 
161  if ( m_TrackCands[0] && !m_TrackCands[0]->empty() && m_TrackCands[0]->address(2)>7 && m_TrackCands[0]->address(2)<10 ) m_TrackCands[0]->reset();
162  if ( m_TrackCands[0] && !m_TrackCands[0]->empty() && m_TrackCands[0]->address(3)>7 && m_TrackCands[0]->address(3)<10 ) m_TrackCands[0]->reset();
163  if ( m_TrackCands[0] && !m_TrackCands[0]->empty() && m_TrackCands[0]->address(4)>7 && m_TrackCands[0]->address(4)<10 ) m_TrackCands[0]->reset();
164 
165  if ( m_TracKCands[0] && !m_TracKCands[0]->empty() && m_TracKCands[0]->address(2)>7 && m_TracKCands[0]->address(2)<10 ) m_TracKCands[0]->reset();
166  if ( m_TracKCands[0] && !m_TracKCands[0]->empty() && m_TracKCands[0]->address(3)>7 && m_TracKCands[0]->address(3)<10 ) m_TracKCands[0]->reset();
167  if ( m_TracKCands[0] && !m_TracKCands[0]->empty() && m_TracKCands[0]->address(4)>7 && m_TracKCands[0]->address(4)<10 ) m_TracKCands[0]->reset();
168 
169  if ( m_TrackCands[1] && !m_TrackCands[1]->empty() && m_TrackCands[1]->address(2)>7 && m_TrackCands[1]->address(2)<10 ) m_TrackCands[1]->reset();
170  if ( m_TrackCands[1] && !m_TrackCands[1]->empty() && m_TrackCands[1]->address(3)>7 && m_TrackCands[1]->address(3)<10 ) m_TrackCands[1]->reset();
171  if ( m_TrackCands[1] && !m_TrackCands[1]->empty() && m_TrackCands[1]->address(4)>7 && m_TrackCands[1]->address(4)<10 ) m_TrackCands[1]->reset();
172 
173  if ( m_TracKCands[1] && !m_TracKCands[1]->empty() && m_TracKCands[1]->address(2)>7 && m_TracKCands[1]->address(2)<10 ) m_TracKCands[1]->reset();
174  if ( m_TracKCands[1] && !m_TracKCands[1]->empty() && m_TracKCands[1]->address(3)>7 && m_TracKCands[1]->address(3)<10 ) m_TracKCands[1]->reset();
175  if ( m_TracKCands[1] && !m_TracKCands[1]->empty() && m_TracKCands[1]->address(4)>7 && m_TracKCands[1]->address(4)<10 ) m_TracKCands[1]->reset();
176  }
177 
178 }
void printTSphi() const
print all phi track segments which are in the buffer
L1MuDTSectorReceiver * m_SectorReceiver
std::vector< L1MuDTAssignmentUnit * > m_AUs
void print() const
print result of Track Assembler
void print(int level=0) const
print all successful extrapolations
virtual void reset()
reset the Sector Processor
virtual void run()
run Track Assembler
std::vector< L1MuDTTrack * > m_TracKCands
L1MuDTExtrapolationUnit * m_EU
static bool Debug()
virtual void run(int bx, const edm::Event &e, const edm::EventSetup &c)
run the Sector Processor
int numberTSphi() const
return number of non-empty phi track segments
bool isEmpty(int id) const
is it a valid Track Class?
int numberOfExt() const
return number of successful extrapolations
L1MuDTDataBuffer * m_DataBuffer
void run(int bx, const edm::Event &e, const edm::EventSetup &c)
receive track segment data from the DTBX and CSC chamber triggers
int wheel() const
return wheel number
tuple cout
Definition: gather_cfg.py:121
L1MuDTTrackAssembler * m_TA
std::vector< L1MuDTTrack * > m_TrackCands
virtual void run(const edm::EventSetup &c)
run Extrapolation Unit
const L1MuDTTrackAssembler* L1MuDTSectorProcessor::TA ( ) const
inline

return pointer to Track Assembler

Definition at line 96 of file L1MuDTSectorProcessor.h.

References m_TA.

Referenced by L1MuDTAssignmentUnit::getPtMethod(), L1MuDTAssignmentUnit::QuaAU(), and L1MuDTAssignmentUnit::run().

96 { return m_TA; }
L1MuDTTrackAssembler * m_TA
const L1MuDTTrackFinder& L1MuDTSectorProcessor::tf ( ) const
inline

return reference to barrel MTTF

Definition at line 80 of file L1MuDTSectorProcessor.h.

References m_tf.

80 { return m_tf; }
const L1MuDTTrackFinder & m_tf
L1MuDTTrack* L1MuDTSectorProcessor::track ( int  id) const
inline

return pointer to muon candidate, index [0,1]

Definition at line 102 of file L1MuDTSectorProcessor.h.

References id(), and m_TrackCands.

Referenced by L1MuDTAssignmentUnit::PhiAU(), L1MuDTAssignmentUnit::PtAU(), L1MuDTAssignmentUnit::QuaAU(), L1MuDTEtaProcessor::receiveAddresses(), L1MuDTWedgeSorter::run(), and L1MuDTAssignmentUnit::run().

102 { return m_TrackCands[id]; }
const L1MuDTSecProcId & id() const
return Sector Processor identifier
std::vector< L1MuDTTrack * > m_TrackCands
L1MuDTTrack* L1MuDTSectorProcessor::tracK ( int  id) const
inline

return pointer to muon candidate, index [0,1]

Definition at line 105 of file L1MuDTSectorProcessor.h.

References id(), and m_TracKCands.

Referenced by L1MuDTAssignmentUnit::PhiAU(), L1MuDTAssignmentUnit::PtAU(), L1MuDTAssignmentUnit::QuaAU(), L1MuDTEtaProcessor::receiveAddresses(), and L1MuDTAssignmentUnit::run().

105 { return m_TracKCands[id]; }
std::vector< L1MuDTTrack * > m_TracKCands
const L1MuDTSecProcId & id() const
return Sector Processor identifier

Member Data Documentation

std::vector<L1MuDTAssignmentUnit*> L1MuDTSectorProcessor::m_AUs
private
L1MuDTDataBuffer* L1MuDTSectorProcessor::m_DataBuffer
private

Definition at line 118 of file L1MuDTSectorProcessor.h.

Referenced by data(), reset(), run(), and ~L1MuDTSectorProcessor().

L1MuDTExtrapolationUnit* L1MuDTSectorProcessor::m_EU
private

Definition at line 119 of file L1MuDTSectorProcessor.h.

Referenced by EU(), reset(), run(), and ~L1MuDTSectorProcessor().

L1MuDTSectorReceiver* L1MuDTSectorProcessor::m_SectorReceiver
private

Definition at line 117 of file L1MuDTSectorProcessor.h.

Referenced by reset(), run(), and ~L1MuDTSectorProcessor().

L1MuDTSecProcId L1MuDTSectorProcessor::m_spid
private

Definition at line 115 of file L1MuDTSectorProcessor.h.

Referenced by brl(), id(), L1MuDTSectorProcessor(), neighbour(), ovl(), print(), and run().

L1MuDTTrackAssembler* L1MuDTSectorProcessor::m_TA
private

Definition at line 120 of file L1MuDTSectorProcessor.h.

Referenced by reset(), run(), TA(), and ~L1MuDTSectorProcessor().

const L1MuDTTrackFinder& L1MuDTSectorProcessor::m_tf
private

Definition at line 114 of file L1MuDTSectorProcessor.h.

Referenced by neighbour(), and tf().

std::vector<L1MuDTTrack*> L1MuDTSectorProcessor::m_TrackCands
private
std::vector<L1MuDTTrack*> L1MuDTSectorProcessor::m_TracKCands
private