CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
L1MuBMSectorProcessor Class Reference

#include <L1MuBMSectorProcessor.h>

Public Member Functions

const L1MuBMAssignmentUnitAU (int id) const
 return pointer to Assignment Unit, index [0,1] More...
 
bool brl () const
 is it a barrel-only Sector Processor? More...
 
const L1MuBMDataBufferdata () const
 return pointer to Data Buffer More...
 
L1MuBMDataBufferdata ()
 
const L1MuBMExtrapolationUnitEU () const
 return pointer to Extrapolation Unit More...
 
const L1MuBMSecProcIdid () const
 return Sector Processor identifier More...
 
 L1MuBMSectorProcessor (const L1MuBMTrackFinder &, const L1MuBMSecProcId &, edm::ConsumesCollector &&)
 constructor More...
 
const L1MuBMSectorProcessorneighbour () 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 L1MuBMTrackAssemblerTA () const
 return pointer to Track Assembler More...
 
const L1MuBMTrackFindertf () const
 return reference to barrel MTTF More...
 
L1MuBMTracktrack (int id) const
 return pointer to muon candidate, index [0,1] More...
 
L1MuBMTracktracK (int id) const
 return pointer to muon candidate, index [0,1] More...
 
virtual ~L1MuBMSectorProcessor ()
 destructor More...
 

Private Member Functions

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

Private Attributes

std::vector< L1MuBMAssignmentUnit * > m_AUs
 
L1MuBMDataBufferm_DataBuffer
 
L1MuBMExtrapolationUnitm_EU
 
L1MuBMSectorReceiverm_SectorReceiver
 
L1MuBMSecProcId m_spid
 
L1MuBMTrackAssemblerm_TA
 
const L1MuBMTrackFinderm_tf
 
std::vector< L1MuBMTrack * > m_TrackCands
 
std::vector< L1MuBMTrack * > m_TracKCands
 

Detailed Description

Sector Processor:

A Sector Processor consists of:

N. Neumeister CERN EP J. Troconiz UAM Madrid

Definition at line 54 of file L1MuBMSectorProcessor.h.

Constructor & Destructor Documentation

L1MuBMSectorProcessor::L1MuBMSectorProcessor ( const L1MuBMTrackFinder tf,
const L1MuBMSecProcId id,
edm::ConsumesCollector &&  iC 
)

constructor

Definition at line 54 of file L1MuBMSectorProcessor.cc.

References m_AUs, m_spid, m_TrackCands, and m_TracKCands.

56  :
57 
58  m_tf(tf), m_spid(id),
60  m_DataBuffer(new L1MuBMDataBuffer(*this)),
61  m_EU(new L1MuBMExtrapolationUnit(*this)),
62  m_TA(new L1MuBMTrackAssembler(*this)),
64 
65  // 2 assignment units
66  m_AUs.reserve(2);
67  m_AUs.push_back(new L1MuBMAssignmentUnit(*this,0));
68  m_AUs.push_back(new L1MuBMAssignmentUnit(*this,1));
69 
70  // now the 2 track candidates
71  m_TrackCands.reserve(2);
72  m_TrackCands.push_back(new L1MuBMTrack(m_spid) );
73  m_TrackCands.push_back(new L1MuBMTrack(m_spid) );
74 
75  m_TracKCands.reserve(2);
76  m_TracKCands.push_back(new L1MuBMTrack(m_spid) );
77  m_TracKCands.push_back(new L1MuBMTrack(m_spid) );
78 
79 }
std::vector< L1MuBMTrack * > m_TracKCands
std::vector< L1MuBMTrack * > m_TrackCands
const L1MuBMTrackFinder & m_tf
L1MuBMSectorReceiver * m_SectorReceiver
L1MuBMTrackAssembler * m_TA
L1MuBMDataBuffer * m_DataBuffer
std::vector< L1MuBMAssignmentUnit * > m_AUs
L1MuBMExtrapolationUnit * m_EU
def move(src, dest)
Definition: eostools.py:510
L1MuBMSectorProcessor::~L1MuBMSectorProcessor ( )
virtual

destructor

Definition at line 86 of file L1MuBMSectorProcessor.cc.

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

86  {
87 
88  delete m_SectorReceiver;
89  delete m_DataBuffer;
90  delete m_EU;
91  delete m_TA;
92  delete m_AUs[0];
93  delete m_AUs[1];
94  delete m_TrackCands[0];
95  delete m_TrackCands[1];
96  delete m_TracKCands[0];
97  delete m_TracKCands[1];
98 
99 }
std::vector< L1MuBMTrack * > m_TracKCands
std::vector< L1MuBMTrack * > m_TrackCands
L1MuBMSectorReceiver * m_SectorReceiver
L1MuBMTrackAssembler * m_TA
L1MuBMDataBuffer * m_DataBuffer
std::vector< L1MuBMAssignmentUnit * > m_AUs
L1MuBMExtrapolationUnit * m_EU

Member Function Documentation

bool L1MuBMSectorProcessor::anyTrack ( ) const
private

are there any non-empty muon candidates?

Definition at line 244 of file L1MuBMSectorProcessor.cc.

References relativeConstraints::empty, and m_TrackCands.

Referenced by print(), and tracK().

244  {
245 
246  if ( m_TrackCands[0] && !m_TrackCands[0]->empty() ) return true;
247  if ( m_TrackCands[1] && !m_TrackCands[1]->empty() ) return true;
248 
249  return false;
250 
251 }
std::vector< L1MuBMTrack * > m_TrackCands
const L1MuBMAssignmentUnit* L1MuBMSectorProcessor::AU ( int  id) const
inline

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

Definition at line 99 of file L1MuBMSectorProcessor.h.

References id(), and m_AUs.

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

is it a barrel-only Sector Processor?

Definition at line 83 of file L1MuBMSectorProcessor.h.

References m_spid, and L1MuBMSecProcId::ovl().

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

return pointer to Data Buffer

Definition at line 89 of file L1MuBMSectorProcessor.h.

References m_DataBuffer.

Referenced by L1MuBMSectorReceiver::receiveBBMXData(), L1MuBMSEU::run(), L1MuBMExtrapolationUnit::run(), and L1MuBMAssignmentUnit::TSR().

89 { return m_DataBuffer; }
L1MuBMDataBuffer * m_DataBuffer
L1MuBMDataBuffer* L1MuBMSectorProcessor::data ( )
inline

Definition at line 90 of file L1MuBMSectorProcessor.h.

References m_DataBuffer.

90 { return m_DataBuffer; }
L1MuBMDataBuffer * m_DataBuffer
const L1MuBMExtrapolationUnit* L1MuBMSectorProcessor::EU ( ) const
inline

return pointer to Extrapolation Unit

Definition at line 93 of file L1MuBMSectorProcessor.h.

References m_EU.

Referenced by L1MuBMTrackAssembler::run().

93 { return m_EU; }
L1MuBMExtrapolationUnit * m_EU
const L1MuBMSecProcId& L1MuBMSectorProcessor::id ( void  ) const
inline
const L1MuBMSectorProcessor * L1MuBMSectorProcessor::neighbour ( ) const

return pointer to the next wheel neighbour

Definition at line 222 of file L1MuBMSectorProcessor.cc.

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

222  {
223 
224  int sector = m_spid.sector();
225  int wheel = m_spid.wheel();
226 
227  // the neighbour is in the same wedge with the following definition:
228  // current SP -3 -2 -1 +1 +2 +3
229  // neighbour -2 -1 +1 0 +1 +2
230 
231  if ( wheel == 1) return nullptr;
232  wheel = (wheel == -1) ? 1 : (wheel/abs(wheel)) * (abs(wheel)-1);
233 
234  const L1MuBMSecProcId id(wheel,sector);
235 
236  return m_tf.sp(id);
237 
238 }
int sector() const
return sector number
const L1MuBMTrackFinder & m_tf
const L1MuBMSectorProcessor * sp(const L1MuBMSecProcId &) const
get a pointer to a Sector Processor
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const L1MuBMSecProcId & id() const
return Sector Processor identifier
int wheel() const
return wheel number
bool L1MuBMSectorProcessor::ovl ( ) const
inline

is it an overlap region Sector Processor?

Definition at line 86 of file L1MuBMSectorProcessor.h.

References m_spid, and L1MuBMSecProcId::ovl().

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

print muon candidates found by the Sector Processor

Definition at line 205 of file L1MuBMSectorProcessor.cc.

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

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

reset the Sector Processor

Definition at line 186 of file L1MuBMSectorProcessor.cc.

References m_AUs, m_DataBuffer, m_EU, m_SectorReceiver, m_TA, m_TrackCands, m_TracKCands, L1MuBMDataBuffer::reset(), L1MuBMTrackAssembler::reset(), L1MuBMSectorReceiver::reset(), and L1MuBMExtrapolationUnit::reset().

Referenced by run().

186  {
187 
189  if ( m_DataBuffer ) m_DataBuffer->reset();
190  if ( m_EU ) m_EU->reset();
191  if ( m_TA ) m_TA->reset();
192  if ( m_AUs[0] ) m_AUs[0]->reset();
193  if ( m_AUs[1] ) m_AUs[1]->reset();
194  if ( m_TrackCands[0] ) m_TrackCands[0]->reset();
195  if ( m_TrackCands[1] ) m_TrackCands[1]->reset();
196  if ( m_TracKCands[0] ) m_TracKCands[0]->reset();
197  if ( m_TracKCands[1] ) m_TracKCands[1]->reset();
198 
199 }
std::vector< L1MuBMTrack * > m_TracKCands
void reset() override
reset Extrapolation Unit
void reset()
clear Data Buffer
std::vector< L1MuBMTrack * > m_TrackCands
void reset() override
reset Track Assembler
void reset()
clear Sector Receiver
L1MuBMSectorReceiver * m_SectorReceiver
L1MuBMTrackAssembler * m_TA
L1MuBMDataBuffer * m_DataBuffer
std::vector< L1MuBMAssignmentUnit * > m_AUs
L1MuBMExtrapolationUnit * m_EU
void L1MuBMSectorProcessor::run ( int  bx,
const edm::Event e,
const edm::EventSetup c 
)
virtual

run the Sector Processor

Definition at line 108 of file L1MuBMSectorProcessor.cc.

References gather_cfg::cout, L1MuBMTFConfig::Debug(), relativeConstraints::empty, L1MuBMTrackAssembler::isEmpty(), m_AUs, m_DataBuffer, m_EU, m_SectorReceiver, m_spid, m_TA, m_TrackCands, m_TracKCands, L1MuBMExtrapolationUnit::numberOfExt(), L1MuBMDataBuffer::numberTSphi(), L1MuBMTrackAssembler::print(), L1MuBMExtrapolationUnit::print(), L1MuBMDataBuffer::printTSphi(), reset(), L1MuBMTrackAssembler::run(), L1MuBMSectorReceiver::run(), L1MuBMExtrapolationUnit::run(), and L1MuBMSecProcId::wheel().

108  {
109 
110  // receive data and store them into the data buffer
111  if ( m_SectorReceiver ) m_SectorReceiver->run(bx, e, c);
112 
113  // check content of data buffer
114  if ( m_DataBuffer ) {
115  if ( L1MuBMTFConfig::Debug(4) && m_DataBuffer->numberTSphi() > 0 ) {
116  cout << "Phi track segments received by " << m_spid << " : " << endl;
118  }
119  }
120 
121  // perform all extrapolations
122  int n_ext = 0; // number of successful extrapolations
123  if ( m_EU && m_DataBuffer && m_DataBuffer->numberTSphi() > 1 ) {
124  m_EU->run(c);
125  n_ext = m_EU->numberOfExt();
126  if ( L1MuBMTFConfig::Debug(3) && n_ext > 0 ) {
127 // if ( print_flag && n_ext > 0 ) {
128  cout << "Number of successful extrapolations : " << n_ext << endl;
129  m_EU->print();
130  }
131  }
132 
133  // hardware debug (output from Extrapolator and Quality Sorter)
134  // m_EU->print(1);
135 
136  // perform track assembling
137  if ( m_TA && n_ext > 0 ) {
138  m_TA->run();
139  if ( L1MuBMTFConfig::Debug(3) ) m_TA->print();
140  }
141 
142  // assign pt, eta, phi and quality
143  if ( m_AUs[0] && !m_TA->isEmpty(0) ) m_AUs[0]->run(c);
144  if ( m_AUs[1] && !m_TA->isEmpty(1) ) m_AUs[1]->run(c);
145 
146  if ( m_spid.wheel() == -1 ) {
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[0] && !m_TracKCands[0]->empty() && m_TracKCands[0]->address(2)>3 && m_TracKCands[0]->address(2)<6 ) m_TracKCands[0]->reset();
152  if ( m_TracKCands[0] && !m_TracKCands[0]->empty() && m_TracKCands[0]->address(3)>3 && m_TracKCands[0]->address(3)<6 ) m_TracKCands[0]->reset();
153  if ( m_TracKCands[0] && !m_TracKCands[0]->empty() && m_TracKCands[0]->address(4)>3 && m_TracKCands[0]->address(4)<6 ) m_TracKCands[0]->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[1] && !m_TracKCands[1]->empty() && m_TracKCands[1]->address(2)>3 && m_TracKCands[1]->address(2)<6 ) m_TracKCands[1]->reset();
160  if ( m_TracKCands[1] && !m_TracKCands[1]->empty() && m_TracKCands[1]->address(3)>3 && m_TracKCands[1]->address(3)<6 ) m_TracKCands[1]->reset();
161  if ( m_TracKCands[1] && !m_TracKCands[1]->empty() && m_TracKCands[1]->address(4)>3 && m_TracKCands[1]->address(4)<6 ) m_TracKCands[1]->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[0] && !m_TracKCands[0]->empty() && m_TracKCands[0]->address(2)>7 && m_TracKCands[0]->address(2)<10 ) m_TracKCands[0]->reset();
168  if ( m_TracKCands[0] && !m_TracKCands[0]->empty() && m_TracKCands[0]->address(3)>7 && m_TracKCands[0]->address(3)<10 ) m_TracKCands[0]->reset();
169  if ( m_TracKCands[0] && !m_TracKCands[0]->empty() && m_TracKCands[0]->address(4)>7 && m_TracKCands[0]->address(4)<10 ) m_TracKCands[0]->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  if ( m_TracKCands[1] && !m_TracKCands[1]->empty() && m_TracKCands[1]->address(2)>7 && m_TracKCands[1]->address(2)<10 ) m_TracKCands[1]->reset();
176  if ( m_TracKCands[1] && !m_TracKCands[1]->empty() && m_TracKCands[1]->address(3)>7 && m_TracKCands[1]->address(3)<10 ) m_TracKCands[1]->reset();
177  if ( m_TracKCands[1] && !m_TracKCands[1]->empty() && m_TracKCands[1]->address(4)>7 && m_TracKCands[1]->address(4)<10 ) m_TracKCands[1]->reset();
178  }
179 
180 }
void run(const edm::EventSetup &c) override
run Extrapolation Unit
int numberTSphi() const
return number of non-empty phi track segments
void run(int bx, const edm::Event &e, const edm::EventSetup &c)
receive track segment data from the BBMX and CSC chamber triggers
void printTSphi() const
print all phi track segments which are in the buffer
std::vector< L1MuBMTrack * > m_TracKCands
void run() override
run Track Assembler
void print() const
print result of Track Assembler
std::vector< L1MuBMTrack * > m_TrackCands
int numberOfExt() const
return number of successful extrapolations
void print(int level=0) const
print all successful extrapolations
bool isEmpty(int id) const
is it a valid Track Class?
static bool Debug()
L1MuBMSectorReceiver * m_SectorReceiver
L1MuBMTrackAssembler * m_TA
L1MuBMDataBuffer * m_DataBuffer
std::vector< L1MuBMAssignmentUnit * > m_AUs
L1MuBMExtrapolationUnit * m_EU
virtual void run(int bx, const edm::Event &e, const edm::EventSetup &c)
run the Sector Processor
virtual void reset()
reset the Sector Processor
int wheel() const
return wheel number
const L1MuBMTrackAssembler* L1MuBMSectorProcessor::TA ( ) const
inline

return pointer to Track Assembler

Definition at line 96 of file L1MuBMSectorProcessor.h.

References m_TA.

Referenced by L1MuBMAssignmentUnit::getPtMethod(), L1MuBMAssignmentUnit::QuaAU(), L1MuBMAssignmentUnit::Quality(), and L1MuBMAssignmentUnit::run().

96 { return m_TA; }
L1MuBMTrackAssembler * m_TA
const L1MuBMTrackFinder& L1MuBMSectorProcessor::tf ( ) const
inline

return reference to barrel MTTF

Definition at line 80 of file L1MuBMSectorProcessor.h.

References m_tf.

80 { return m_tf; }
const L1MuBMTrackFinder & m_tf
L1MuBMTrack* L1MuBMSectorProcessor::track ( int  id) const
inline

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

Definition at line 102 of file L1MuBMSectorProcessor.h.

References id(), and m_TrackCands.

Referenced by L1MuBMAssignmentUnit::PhiAU(), L1MuBMAssignmentUnit::PtAU(), L1MuBMAssignmentUnit::QuaAU(), L1MuBMEtaProcessor::receiveAddresses(), L1MuBMWedgeSorter::run(), and L1MuBMAssignmentUnit::run().

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

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

Definition at line 105 of file L1MuBMSectorProcessor.h.

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

Referenced by L1MuBMAssignmentUnit::PhiAU(), L1MuBMAssignmentUnit::PtAU(), L1MuBMAssignmentUnit::QuaAU(), L1MuBMEtaProcessor::receiveAddresses(), and L1MuBMAssignmentUnit::run().

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

Member Data Documentation

std::vector<L1MuBMAssignmentUnit*> L1MuBMSectorProcessor::m_AUs
private
L1MuBMDataBuffer* L1MuBMSectorProcessor::m_DataBuffer
private

Definition at line 118 of file L1MuBMSectorProcessor.h.

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

L1MuBMExtrapolationUnit* L1MuBMSectorProcessor::m_EU
private

Definition at line 119 of file L1MuBMSectorProcessor.h.

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

L1MuBMSectorReceiver* L1MuBMSectorProcessor::m_SectorReceiver
private

Definition at line 117 of file L1MuBMSectorProcessor.h.

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

L1MuBMSecProcId L1MuBMSectorProcessor::m_spid
private

Definition at line 115 of file L1MuBMSectorProcessor.h.

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

L1MuBMTrackAssembler* L1MuBMSectorProcessor::m_TA
private

Definition at line 120 of file L1MuBMSectorProcessor.h.

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

const L1MuBMTrackFinder& L1MuBMSectorProcessor::m_tf
private

Definition at line 114 of file L1MuBMSectorProcessor.h.

Referenced by neighbour(), and tf().

std::vector<L1MuBMTrack*> L1MuBMSectorProcessor::m_TrackCands
private
std::vector<L1MuBMTrack*> L1MuBMSectorProcessor::m_TracKCands
private