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:

N. Neumeister CERN EP J. Troconiz UAM Madrid

Definition at line 52 of file L1MuDTSectorProcessor.h.

Constructor & Destructor Documentation

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

constructor

Definition at line 53 of file L1MuDTSectorProcessor.cc.

References m_AUs, m_spid, m_TrackCands, and m_TracKCands.

54  :
55  m_tf(tf), m_spid(id),
57  m_DataBuffer(new L1MuDTDataBuffer(*this)),
58  m_EU(new L1MuDTExtrapolationUnit(*this)),
59  m_TA(new L1MuDTTrackAssembler(*this)),
61 
62  // 2 assignment units
63  m_AUs.reserve(2);
64  m_AUs.push_back(new L1MuDTAssignmentUnit(*this,0));
65  m_AUs.push_back(new L1MuDTAssignmentUnit(*this,1));
66 
67  // now the 2 track candidates
68  m_TrackCands.reserve(2);
69  m_TrackCands.push_back(new L1MuDTTrack(m_spid) );
70  m_TrackCands.push_back(new L1MuDTTrack(m_spid) );
71 
72  m_TracKCands.reserve(2);
73  m_TracKCands.push_back(new L1MuDTTrack(m_spid) );
74  m_TracKCands.push_back(new L1MuDTTrack(m_spid) );
75 
76 }
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 83 of file L1MuDTSectorProcessor.cc.

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

83  {
84 
85  delete m_SectorReceiver;
86  delete m_DataBuffer;
87  delete m_EU;
88  delete m_TA;
89  delete m_AUs[0];
90  delete m_AUs[1];
91  delete m_TrackCands[0];
92  delete m_TrackCands[1];
93  delete m_TracKCands[0];
94  delete m_TracKCands[1];
95 
96 }
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 240 of file L1MuDTSectorProcessor.cc.

References relativeConstraints::empty, and m_TrackCands.

Referenced by print().

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

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

Definition at line 97 of file L1MuDTSectorProcessor.h.

References id(), and m_AUs.

97 { 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 81 of file L1MuDTSectorProcessor.h.

References m_spid, and L1MuDTSecProcId::ovl().

81 { 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 88 of file L1MuDTSectorProcessor.h.

References m_DataBuffer.

Referenced by cuy.FindIssue::__init__().

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

return pointer to Extrapolation Unit

Definition at line 91 of file L1MuDTSectorProcessor.h.

References m_EU.

Referenced by L1MuDTTrackAssembler::run().

91 { 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 218 of file L1MuDTSectorProcessor.cc.

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

218  {
219 
220  int sector = m_spid.sector();
221  int wheel = m_spid.wheel();
222 
223  // the neighbour is in the same wedge with the following definition:
224  // current SP -3 -2 -1 +1 +2 +3
225  // neighbour -2 -1 +1 0 +1 +2
226 
227  if ( wheel == 1) return 0;
228  wheel = (wheel == -1) ? 1 : (wheel/abs(wheel)) * (abs(wheel)-1);
229 
230  const L1MuDTSecProcId id(wheel,sector);
231 
232  return m_tf.sp(id);
233 
234 }
const L1MuDTSectorProcessor * sp(const L1MuDTSecProcId &) const
get a pointer to a Sector Processor
int sector() const
return sector number
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
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 84 of file L1MuDTSectorProcessor.h.

References m_spid, and L1MuDTSecProcId::ovl().

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

84 { 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 201 of file L1MuDTSectorProcessor.cc.

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

201  {
202 
203  if ( anyTrack() ) {
204  cout << "Muon candidates found in " << m_spid << " : " << endl;
205  vector<L1MuDTTrack*>::const_iterator iter = m_TrackCands.begin();
206  while ( iter != m_TrackCands.end() ) {
207  if ( *iter) (*iter)->print();
208  iter++;
209  }
210  }
211 
212 }
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 182 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().

182  {
183 
185  if ( m_DataBuffer ) m_DataBuffer->reset();
186  if ( m_EU ) m_EU->reset();
187  if ( m_TA ) m_TA->reset();
188  if ( m_AUs[0] ) m_AUs[0]->reset();
189  if ( m_AUs[1] ) m_AUs[1]->reset();
190  if ( m_TrackCands[0] ) m_TrackCands[0]->reset();
191  if ( m_TrackCands[1] ) m_TrackCands[1]->reset();
192  if ( m_TracKCands[0] ) m_TracKCands[0]->reset();
193  if ( m_TracKCands[1] ) m_TracKCands[1]->reset();
194 
195 }
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 105 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().

105  {
106 
107  // receive data and store them into the data buffer
108  if ( m_SectorReceiver ) m_SectorReceiver->run(bx, e, c);
109 
110  // check content of data buffer
111  if ( m_DataBuffer ) {
112  if ( L1MuDTTFConfig::Debug(4) && m_DataBuffer->numberTSphi() > 0 ) {
113  cout << "Phi track segments received by " << m_spid << " : " << endl;
115  }
116  }
117 
118  // perform all extrapolations
119  int n_ext = 0; // number of successful extrapolations
120  if ( m_EU && m_DataBuffer && m_DataBuffer->numberTSphi() > 1 ) {
121  m_EU->run(c);
122  n_ext = m_EU->numberOfExt();
123  if ( L1MuDTTFConfig::Debug(3) && n_ext > 0 ) {
124  cout << "Number of successful extrapolations : " << n_ext << endl;
125  m_EU->print();
126  }
127  }
128 
129  // hardware debug (output from Extrapolator and Quality Sorter)
130  // m_EU->print(1);
131 
132  // perform track assembling
133  if ( m_TA && n_ext > 0 ) {
134  m_TA->run();
135  if ( L1MuDTTFConfig::Debug(3) ) m_TA->print();
136  }
137 
138  // assign pt, eta, phi and quality
139  if ( m_AUs[0] && !m_TA->isEmpty(0) ) m_AUs[0]->run(c);
140  if ( m_AUs[1] && !m_TA->isEmpty(1) ) m_AUs[1]->run(c);
141 
142  if ( m_spid.wheel() == -1 ) {
143  if ( m_TrackCands[0] && !m_TrackCands[0]->empty() && m_TrackCands[0]->address(2)>3 && m_TrackCands[0]->address(2)<6 ) m_TrackCands[0]->reset();
144  if ( m_TrackCands[0] && !m_TrackCands[0]->empty() && m_TrackCands[0]->address(3)>3 && m_TrackCands[0]->address(3)<6 ) m_TrackCands[0]->reset();
145  if ( m_TrackCands[0] && !m_TrackCands[0]->empty() && m_TrackCands[0]->address(4)>3 && m_TrackCands[0]->address(4)<6 ) m_TrackCands[0]->reset();
146 
147  if ( m_TracKCands[0] && !m_TracKCands[0]->empty() && m_TracKCands[0]->address(2)>3 && m_TracKCands[0]->address(2)<6 ) m_TracKCands[0]->reset();
148  if ( m_TracKCands[0] && !m_TracKCands[0]->empty() && m_TracKCands[0]->address(3)>3 && m_TracKCands[0]->address(3)<6 ) m_TracKCands[0]->reset();
149  if ( m_TracKCands[0] && !m_TracKCands[0]->empty() && m_TracKCands[0]->address(4)>3 && m_TracKCands[0]->address(4)<6 ) m_TracKCands[0]->reset();
150 
151  if ( m_TrackCands[1] && !m_TrackCands[1]->empty() && m_TrackCands[1]->address(2)>3 && m_TrackCands[1]->address(2)<6 ) m_TrackCands[1]->reset();
152  if ( m_TrackCands[1] && !m_TrackCands[1]->empty() && m_TrackCands[1]->address(3)>3 && m_TrackCands[1]->address(3)<6 ) m_TrackCands[1]->reset();
153  if ( m_TrackCands[1] && !m_TrackCands[1]->empty() && m_TrackCands[1]->address(4)>3 && m_TrackCands[1]->address(4)<6 ) m_TrackCands[1]->reset();
154 
155  if ( m_TracKCands[1] && !m_TracKCands[1]->empty() && m_TracKCands[1]->address(2)>3 && m_TracKCands[1]->address(2)<6 ) m_TracKCands[1]->reset();
156  if ( m_TracKCands[1] && !m_TracKCands[1]->empty() && m_TracKCands[1]->address(3)>3 && m_TracKCands[1]->address(3)<6 ) m_TracKCands[1]->reset();
157  if ( m_TracKCands[1] && !m_TracKCands[1]->empty() && m_TracKCands[1]->address(4)>3 && m_TracKCands[1]->address(4)<6 ) m_TracKCands[1]->reset();
158 
159  if ( m_TrackCands[0] && !m_TrackCands[0]->empty() && m_TrackCands[0]->address(2)>7 && m_TrackCands[0]->address(2)<10 ) m_TrackCands[0]->reset();
160  if ( m_TrackCands[0] && !m_TrackCands[0]->empty() && m_TrackCands[0]->address(3)>7 && m_TrackCands[0]->address(3)<10 ) m_TrackCands[0]->reset();
161  if ( m_TrackCands[0] && !m_TrackCands[0]->empty() && m_TrackCands[0]->address(4)>7 && m_TrackCands[0]->address(4)<10 ) m_TrackCands[0]->reset();
162 
163  if ( m_TracKCands[0] && !m_TracKCands[0]->empty() && m_TracKCands[0]->address(2)>7 && m_TracKCands[0]->address(2)<10 ) m_TracKCands[0]->reset();
164  if ( m_TracKCands[0] && !m_TracKCands[0]->empty() && m_TracKCands[0]->address(3)>7 && m_TracKCands[0]->address(3)<10 ) m_TracKCands[0]->reset();
165  if ( m_TracKCands[0] && !m_TracKCands[0]->empty() && m_TracKCands[0]->address(4)>7 && m_TracKCands[0]->address(4)<10 ) m_TracKCands[0]->reset();
166 
167  if ( m_TrackCands[1] && !m_TrackCands[1]->empty() && m_TrackCands[1]->address(2)>7 && m_TrackCands[1]->address(2)<10 ) m_TrackCands[1]->reset();
168  if ( m_TrackCands[1] && !m_TrackCands[1]->empty() && m_TrackCands[1]->address(3)>7 && m_TrackCands[1]->address(3)<10 ) m_TrackCands[1]->reset();
169  if ( m_TrackCands[1] && !m_TrackCands[1]->empty() && m_TrackCands[1]->address(4)>7 && m_TrackCands[1]->address(4)<10 ) m_TrackCands[1]->reset();
170 
171  if ( m_TracKCands[1] && !m_TracKCands[1]->empty() && m_TracKCands[1]->address(2)>7 && m_TracKCands[1]->address(2)<10 ) m_TracKCands[1]->reset();
172  if ( m_TracKCands[1] && !m_TracKCands[1]->empty() && m_TracKCands[1]->address(3)>7 && m_TracKCands[1]->address(3)<10 ) m_TracKCands[1]->reset();
173  if ( m_TracKCands[1] && !m_TracKCands[1]->empty() && m_TracKCands[1]->address(4)>7 && m_TracKCands[1]->address(4)<10 ) m_TracKCands[1]->reset();
174  }
175 
176 }
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 94 of file L1MuDTSectorProcessor.h.

References m_TA.

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

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

return reference to barrel MTTF

Definition at line 78 of file L1MuDTSectorProcessor.h.

References m_tf.

78 { 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 100 of file L1MuDTSectorProcessor.h.

References id(), and m_TrackCands.

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

100 { 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 103 of file L1MuDTSectorProcessor.h.

References id(), and m_TracKCands.

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

103 { 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 116 of file L1MuDTSectorProcessor.h.

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

L1MuDTExtrapolationUnit* L1MuDTSectorProcessor::m_EU
private

Definition at line 117 of file L1MuDTSectorProcessor.h.

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

L1MuDTSectorReceiver* L1MuDTSectorProcessor::m_SectorReceiver
private

Definition at line 115 of file L1MuDTSectorProcessor.h.

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

L1MuDTSecProcId L1MuDTSectorProcessor::m_spid
private

Definition at line 113 of file L1MuDTSectorProcessor.h.

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

L1MuDTTrackAssembler* L1MuDTSectorProcessor::m_TA
private

Definition at line 118 of file L1MuDTSectorProcessor.h.

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

const L1MuDTTrackFinder& L1MuDTSectorProcessor::m_tf
private

Definition at line 112 of file L1MuDTSectorProcessor.h.

Referenced by neighbour(), and tf().

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