CMS 3D CMS Logo

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 &, edm::ConsumesCollector &&)
 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 53 of file L1MuDTSectorProcessor.h.

Constructor & Destructor Documentation

L1MuDTSectorProcessor::L1MuDTSectorProcessor ( const L1MuDTTrackFinder tf,
const L1MuDTSecProcId id,
edm::ConsumesCollector &&  iC 
)

constructor

Definition at line 53 of file L1MuDTSectorProcessor.cc.

References m_AUs, m_spid, m_TrackCands, and m_TracKCands.

55  :
56  m_tf(tf), m_spid(id),
58  m_DataBuffer(new L1MuDTDataBuffer(*this)),
59  m_EU(new L1MuDTExtrapolationUnit(*this)),
60  m_TA(new L1MuDTTrackAssembler(*this)),
62 
63  // 2 assignment units
64  m_AUs.reserve(2);
65  m_AUs.push_back(new L1MuDTAssignmentUnit(*this,0));
66  m_AUs.push_back(new L1MuDTAssignmentUnit(*this,1));
67 
68  // now the 2 track candidates
69  m_TrackCands.reserve(2);
70  m_TrackCands.push_back(new L1MuDTTrack(m_spid) );
71  m_TrackCands.push_back(new L1MuDTTrack(m_spid) );
72 
73  m_TracKCands.reserve(2);
74  m_TracKCands.push_back(new L1MuDTTrack(m_spid) );
75  m_TracKCands.push_back(new L1MuDTTrack(m_spid) );
76 
77 }
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
def move(src, dest)
Definition: eostools.py:511
std::vector< L1MuDTTrack * > m_TrackCands
L1MuDTSectorProcessor::~L1MuDTSectorProcessor ( )
virtual

destructor

Definition at line 84 of file L1MuDTSectorProcessor.cc.

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

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

References relativeConstraints::empty, and m_TrackCands.

Referenced by print(), and tracK().

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

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

Definition at line 98 of file L1MuDTSectorProcessor.h.

References id(), and m_AUs.

98 { 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 82 of file L1MuDTSectorProcessor.h.

References m_spid, and L1MuDTSecProcId::ovl().

82 { 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 89 of file L1MuDTSectorProcessor.h.

References m_DataBuffer.

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

return pointer to Extrapolation Unit

Definition at line 92 of file L1MuDTSectorProcessor.h.

References m_EU.

Referenced by L1MuDTTrackAssembler::run().

92 { 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 219 of file L1MuDTSectorProcessor.cc.

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

219  {
220 
221  int sector = m_spid.sector();
222  int wheel = m_spid.wheel();
223 
224  // the neighbour is in the same wedge with the following definition:
225  // current SP -3 -2 -1 +1 +2 +3
226  // neighbour -2 -1 +1 0 +1 +2
227 
228  if ( wheel == 1) return nullptr;
229  wheel = (wheel == -1) ? 1 : (wheel/abs(wheel)) * (abs(wheel)-1);
230 
231  const L1MuDTSecProcId id(wheel,sector);
232 
233  return m_tf.sp(id);
234 
235 }
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 85 of file L1MuDTSectorProcessor.h.

References m_spid, and L1MuDTSecProcId::ovl().

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

85 { 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 202 of file L1MuDTSectorProcessor.cc.

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

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

reset the Sector Processor

Definition at line 183 of file L1MuDTSectorProcessor.cc.

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

Referenced by run().

183  {
184 
186  if ( m_DataBuffer ) m_DataBuffer->reset();
187  if ( m_EU ) m_EU->reset();
188  if ( m_TA ) m_TA->reset();
189  if ( m_AUs[0] ) m_AUs[0]->reset();
190  if ( m_AUs[1] ) m_AUs[1]->reset();
191  if ( m_TrackCands[0] ) m_TrackCands[0]->reset();
192  if ( m_TrackCands[1] ) m_TrackCands[1]->reset();
193  if ( m_TracKCands[0] ) m_TracKCands[0]->reset();
194  if ( m_TracKCands[1] ) m_TracKCands[1]->reset();
195 
196 }
void reset() override
reset Extrapolation Unit
void reset()
clear Sector Receiver
L1MuDTSectorReceiver * m_SectorReceiver
std::vector< L1MuDTAssignmentUnit * > m_AUs
void reset()
clear Data Buffer
std::vector< L1MuDTTrack * > m_TracKCands
L1MuDTExtrapolationUnit * m_EU
L1MuDTDataBuffer * m_DataBuffer
L1MuDTTrackAssembler * m_TA
void reset() override
reset Track Assembler
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 106 of file L1MuDTSectorProcessor.cc.

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

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

return pointer to Track Assembler

Definition at line 95 of file L1MuDTSectorProcessor.h.

References m_TA.

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

95 { return m_TA; }
L1MuDTTrackAssembler * m_TA
const L1MuDTTrackFinder& L1MuDTSectorProcessor::tf ( ) const
inline
L1MuDTTrack* L1MuDTSectorProcessor::track ( int  id) const
inline

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

Definition at line 101 of file L1MuDTSectorProcessor.h.

References id(), and m_TrackCands.

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

101 { 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 104 of file L1MuDTSectorProcessor.h.

References anyTrack(), id(), and m_TracKCands.

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

104 { 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 117 of file L1MuDTSectorProcessor.h.

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

L1MuDTExtrapolationUnit* L1MuDTSectorProcessor::m_EU
private

Definition at line 118 of file L1MuDTSectorProcessor.h.

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

L1MuDTSectorReceiver* L1MuDTSectorProcessor::m_SectorReceiver
private

Definition at line 116 of file L1MuDTSectorProcessor.h.

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

L1MuDTSecProcId L1MuDTSectorProcessor::m_spid
private

Definition at line 114 of file L1MuDTSectorProcessor.h.

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

L1MuDTTrackAssembler* L1MuDTSectorProcessor::m_TA
private

Definition at line 119 of file L1MuDTSectorProcessor.h.

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

const L1MuDTTrackFinder& L1MuDTSectorProcessor::m_tf
private

Definition at line 113 of file L1MuDTSectorProcessor.h.

Referenced by neighbour(), run(), and tf().

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