CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

L1MuDTSectorProcessor Class Reference

#include <L1MuDTSectorProcessor.h>

List of all members.

Public Member Functions

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

Private Member Functions

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

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.

                                                                        :
      m_tf(tf), m_spid(id), 
      m_SectorReceiver(new L1MuDTSectorReceiver(*this)),
      m_DataBuffer(new L1MuDTDataBuffer(*this)),
      m_EU(new L1MuDTExtrapolationUnit(*this)),
      m_TA(new L1MuDTTrackAssembler(*this)), 
      m_AUs(), m_TrackCands(), m_TracKCands() {

  // 2 assignment units
  m_AUs.reserve(2);
  m_AUs.push_back(new L1MuDTAssignmentUnit(*this,0));
  m_AUs.push_back(new L1MuDTAssignmentUnit(*this,1));

  // now the 2 track candidates
  m_TrackCands.reserve(2);
  m_TrackCands.push_back(new L1MuDTTrack(m_spid) );
  m_TrackCands.push_back(new L1MuDTTrack(m_spid) );

  m_TracKCands.reserve(2);
  m_TracKCands.push_back(new L1MuDTTrack(m_spid) );
  m_TracKCands.push_back(new L1MuDTTrack(m_spid) );
  
}
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.

                                              {

  delete m_SectorReceiver;
  delete m_DataBuffer;
  delete m_EU;
  delete m_TA;
  delete m_AUs[0];
  delete m_AUs[1];
  delete m_TrackCands[0];
  delete m_TrackCands[1];
  delete m_TracKCands[0];
  delete m_TracKCands[1];

}

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().

                                           {

  if ( m_TrackCands[0] && !m_TrackCands[0]->empty() ) return true;
  if ( m_TrackCands[1] && !m_TrackCands[1]->empty() ) return true;
  
  return false;

}
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.

{ return m_AUs[id]; }
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().

{ return !m_spid.ovl(); }
const L1MuDTDataBuffer* L1MuDTSectorProcessor::data ( ) const [inline]
L1MuDTDataBuffer* L1MuDTSectorProcessor::data ( ) [inline]

Definition at line 90 of file L1MuDTSectorProcessor.h.

References m_DataBuffer.

{ return 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().

{ return 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().

                                                                    {

  int sector = m_spid.sector();
  int wheel  = m_spid.wheel();

  // the neighbour is in the same wedge with the following definition:
  // current SP  -3  -2  -1  +1  +2  +3
  // neighbour   -2  -1  +1   0  +1  +2

  if ( wheel == 1) return 0;
  wheel = (wheel == -1) ? 1 : (wheel/abs(wheel)) * (abs(wheel)-1);

  const L1MuDTSecProcId id(wheel,sector);

  return m_tf.sp(id);

}
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().

{ return m_spid.ovl(); }
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.

                                        {

  if ( anyTrack() ) {
    cout << "Muon candidates found in " << m_spid << " : " << endl;
    vector<L1MuDTTrack*>::const_iterator iter = m_TrackCands.begin();
    while ( iter != m_TrackCands.end() ) {
      if ( *iter) (*iter)->print();
      iter++;
    }
  }

}
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(), L1MuDTExtrapolationUnit::reset(), and L1MuDTTrackAssembler::reset().

Referenced by run().

                                  {

  if ( m_SectorReceiver ) m_SectorReceiver->reset();
  if ( m_DataBuffer ) m_DataBuffer->reset();
  if ( m_EU ) m_EU->reset();
  if ( m_TA ) m_TA->reset();
  if ( m_AUs[0] ) m_AUs[0]->reset();
  if ( m_AUs[1] ) m_AUs[1]->reset();
  if ( m_TrackCands[0] ) m_TrackCands[0]->reset();
  if ( m_TrackCands[1] ) m_TrackCands[1]->reset();
  if ( m_TracKCands[0] ) m_TracKCands[0]->reset();
  if ( m_TracKCands[1] ) m_TracKCands[1]->reset();

} 
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().

                                                                                 {

  // receive data and store them into the data buffer
  if ( m_SectorReceiver ) m_SectorReceiver->run(bx, e, c);

  // check content of data buffer
  if ( m_DataBuffer ) {
    if ( L1MuDTTFConfig::Debug(4) && m_DataBuffer->numberTSphi() > 0 ) {
      cout << "Phi track segments received by " << m_spid << " : " << endl;
      m_DataBuffer->printTSphi();
    }
  }

  // perform all extrapolations
  int n_ext = 0;        // number of successful extrapolations
  if ( m_EU && m_DataBuffer && m_DataBuffer->numberTSphi() > 1 ) {
    m_EU->run(c);
    n_ext = m_EU->numberOfExt();
    if ( L1MuDTTFConfig::Debug(3) && n_ext > 0  ) {
      cout << "Number of successful extrapolations : " << n_ext << endl;
      m_EU->print();
    }
  }

  // hardware debug (output from Extrapolator and Quality Sorter)
  // m_EU->print(1);

  // perform track assembling
  if ( m_TA &&  n_ext > 0 ) {
    m_TA->run();
    if ( L1MuDTTFConfig::Debug(3) ) m_TA->print();
  }

  // assign pt, eta, phi and quality
  if ( m_AUs[0] && !m_TA->isEmpty(0) ) m_AUs[0]->run(c);
  if ( m_AUs[1] && !m_TA->isEmpty(1) ) m_AUs[1]->run(c);

  if ( m_spid.wheel() == -1 ) {
    if ( m_TrackCands[0] && !m_TrackCands[0]->empty() && m_TrackCands[0]->address(2)>3 && m_TrackCands[0]->address(2)<6 ) m_TrackCands[0]->reset();
    if ( m_TrackCands[0] && !m_TrackCands[0]->empty() && m_TrackCands[0]->address(3)>3 && m_TrackCands[0]->address(3)<6 ) m_TrackCands[0]->reset();
    if ( m_TrackCands[0] && !m_TrackCands[0]->empty() && m_TrackCands[0]->address(4)>3 && m_TrackCands[0]->address(4)<6 ) m_TrackCands[0]->reset();

    if ( m_TracKCands[0] && !m_TracKCands[0]->empty() && m_TracKCands[0]->address(2)>3 && m_TracKCands[0]->address(2)<6 ) m_TracKCands[0]->reset();
    if ( m_TracKCands[0] && !m_TracKCands[0]->empty() && m_TracKCands[0]->address(3)>3 && m_TracKCands[0]->address(3)<6 ) m_TracKCands[0]->reset();
    if ( m_TracKCands[0] && !m_TracKCands[0]->empty() && m_TracKCands[0]->address(4)>3 && m_TracKCands[0]->address(4)<6 ) m_TracKCands[0]->reset();

    if ( m_TrackCands[1] && !m_TrackCands[1]->empty() && m_TrackCands[1]->address(2)>3 && m_TrackCands[1]->address(2)<6 ) m_TrackCands[1]->reset();
    if ( m_TrackCands[1] && !m_TrackCands[1]->empty() && m_TrackCands[1]->address(3)>3 && m_TrackCands[1]->address(3)<6 ) m_TrackCands[1]->reset();
    if ( m_TrackCands[1] && !m_TrackCands[1]->empty() && m_TrackCands[1]->address(4)>3 && m_TrackCands[1]->address(4)<6 ) m_TrackCands[1]->reset();

    if ( m_TracKCands[1] && !m_TracKCands[1]->empty() && m_TracKCands[1]->address(2)>3 && m_TracKCands[1]->address(2)<6 ) m_TracKCands[1]->reset();
    if ( m_TracKCands[1] && !m_TracKCands[1]->empty() && m_TracKCands[1]->address(3)>3 && m_TracKCands[1]->address(3)<6 ) m_TracKCands[1]->reset();
    if ( m_TracKCands[1] && !m_TracKCands[1]->empty() && m_TracKCands[1]->address(4)>3 && m_TracKCands[1]->address(4)<6 ) m_TracKCands[1]->reset();

    if ( m_TrackCands[0] && !m_TrackCands[0]->empty() && m_TrackCands[0]->address(2)>7 && m_TrackCands[0]->address(2)<10 ) m_TrackCands[0]->reset();
    if ( m_TrackCands[0] && !m_TrackCands[0]->empty() && m_TrackCands[0]->address(3)>7 && m_TrackCands[0]->address(3)<10 ) m_TrackCands[0]->reset();
    if ( m_TrackCands[0] && !m_TrackCands[0]->empty() && m_TrackCands[0]->address(4)>7 && m_TrackCands[0]->address(4)<10 ) m_TrackCands[0]->reset();

    if ( m_TracKCands[0] && !m_TracKCands[0]->empty() && m_TracKCands[0]->address(2)>7 && m_TracKCands[0]->address(2)<10 ) m_TracKCands[0]->reset();
    if ( m_TracKCands[0] && !m_TracKCands[0]->empty() && m_TracKCands[0]->address(3)>7 && m_TracKCands[0]->address(3)<10 ) m_TracKCands[0]->reset();
    if ( m_TracKCands[0] && !m_TracKCands[0]->empty() && m_TracKCands[0]->address(4)>7 && m_TracKCands[0]->address(4)<10 ) m_TracKCands[0]->reset();

    if ( m_TrackCands[1] && !m_TrackCands[1]->empty() && m_TrackCands[1]->address(2)>7 && m_TrackCands[1]->address(2)<10 ) m_TrackCands[1]->reset();
    if ( m_TrackCands[1] && !m_TrackCands[1]->empty() && m_TrackCands[1]->address(3)>7 && m_TrackCands[1]->address(3)<10 ) m_TrackCands[1]->reset();
    if ( m_TrackCands[1] && !m_TrackCands[1]->empty() && m_TrackCands[1]->address(4)>7 && m_TrackCands[1]->address(4)<10 ) m_TrackCands[1]->reset();

    if ( m_TracKCands[1] && !m_TracKCands[1]->empty() && m_TracKCands[1]->address(2)>7 && m_TracKCands[1]->address(2)<10 ) m_TracKCands[1]->reset();
    if ( m_TracKCands[1] && !m_TracKCands[1]->empty() && m_TracKCands[1]->address(3)>7 && m_TracKCands[1]->address(3)<10 ) m_TracKCands[1]->reset();
    if ( m_TracKCands[1] && !m_TracKCands[1]->empty() && m_TracKCands[1]->address(4)>7 && m_TracKCands[1]->address(4)<10 ) m_TracKCands[1]->reset();
  }

} 
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().

{ return m_TA; }
const L1MuDTTrackFinder& L1MuDTSectorProcessor::tf ( ) const [inline]

return reference to barrel MTTF

Definition at line 80 of file L1MuDTSectorProcessor.h.

References m_tf.

{ return m_tf; }
L1MuDTTrack* L1MuDTSectorProcessor::track ( int  id) const [inline]
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().

{ return m_TracKCands[id]; }

Member Data Documentation

Definition at line 118 of file L1MuDTSectorProcessor.h.

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

Definition at line 119 of file L1MuDTSectorProcessor.h.

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

Definition at line 117 of file L1MuDTSectorProcessor.h.

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

Definition at line 115 of file L1MuDTSectorProcessor.h.

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

Definition at line 120 of file L1MuDTSectorProcessor.h.

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

Definition at line 114 of file L1MuDTSectorProcessor.h.

Referenced by neighbour(), and tf().