CMS 3D CMS Logo

Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | Friends

L1GctEmLeafCard Class Reference

Emulates a leaf card programmed for electron sorting. More...

#include <L1GctEmLeafCard.h>

Inheritance diagram for L1GctEmLeafCard:
L1GctProcessor

List of all members.

Public Member Functions

virtual void fetchInput ()
L1GctElectronSortergetIsoElectronSorterU1 ()
L1GctElectronSortergetIsoElectronSorterU2 ()
L1GctElectronSortergetNonIsoElectronSorterU1 ()
L1GctElectronSortergetNonIsoElectronSorterU2 ()
std::vector< L1GctEmCandgetOutputIsoEmCands (int fpga)
std::vector< L1GctEmCandgetOutputNonIsoEmCands (int fpga)
int id ()
 L1GctEmLeafCard (int id)
 construct with ID
virtual void process ()
void reset ()
 clear buffers
void setBxRange (const int firstBx, const int numberOfBx)
 partially clear buffers
void setNextBx (const int bxnum)
 partially clear buffers
 ~L1GctEmLeafCard ()

Static Public Attributes

static const unsigned N_SORTERS = 4

Protected Member Functions

virtual void resetPipelines ()
virtual void resetProcessor ()
 Separate reset methods for the processor itself and any data stored in pipelines.
virtual void setupObjects ()
 Initialise inputs with null objects for the correct bunch crossing if required.

Private Attributes

int m_id
 card ID (0 or 1)
std::vector
< L1GctElectronSorter * > 
m_sorters

Friends

std::ostream & operator<< (std::ostream &s, const L1GctEmLeafCard &card)

Detailed Description

Emulates a leaf card programmed for electron sorting.

L1GctEmLeafCard This class does the 1st stage sorting of the electron candidates.

Author:
Jim Brooke
Date:
20/02/06

Definition at line 20 of file L1GctEmLeafCard.h.


Constructor & Destructor Documentation

L1GctEmLeafCard::L1GctEmLeafCard ( int  id)

construct with ID

Definition at line 10 of file L1GctEmLeafCard.cc.

References m_sorters.

                                       :
  m_id(id),
  m_sorters(4)
{
  
  // sorters 0 and 1 are in FPGA U1 and deal with RCT crates 4-8 (13-17)
  m_sorters.at(0) = new L1GctElectronSorter(5,true);
  m_sorters.at(1) = new L1GctElectronSorter(5,false);

  // sorters 2 and 3 are in FPGA U2 and deal with RCT crates 0-3 (9-12)
  m_sorters.at(2) = new L1GctElectronSorter(4,true);
  m_sorters.at(3) = new L1GctElectronSorter(4,false);
}
L1GctEmLeafCard::~L1GctEmLeafCard ( )

destruct

Definition at line 25 of file L1GctEmLeafCard.cc.

References m_sorters.

{
  delete m_sorters.at(0);
  delete m_sorters.at(1);
  delete m_sorters.at(2);
  delete m_sorters.at(3);
}

Member Function Documentation

void L1GctEmLeafCard::fetchInput ( ) [virtual]

fetch input data

Implements L1GctProcessor.

Definition at line 59 of file L1GctEmLeafCard.cc.

References i, m_sorters, and N_SORTERS.

                                 {
  for (unsigned i=0; i<N_SORTERS; i++) {
    m_sorters.at(i)->fetchInput();
  }
}
L1GctElectronSorter* L1GctEmLeafCard::getIsoElectronSorterU1 ( ) [inline]

Definition at line 58 of file L1GctEmLeafCard.h.

References m_sorters.

Referenced by L1GctElectronFinalSort::fetchInput().

{ return m_sorters.at(0); }
L1GctElectronSorter* L1GctEmLeafCard::getIsoElectronSorterU2 ( ) [inline]

Definition at line 60 of file L1GctEmLeafCard.h.

References m_sorters.

Referenced by L1GctElectronFinalSort::fetchInput().

{ return m_sorters.at(2); }
L1GctElectronSorter* L1GctEmLeafCard::getNonIsoElectronSorterU1 ( ) [inline]

Definition at line 59 of file L1GctEmLeafCard.h.

References m_sorters.

Referenced by L1GctElectronFinalSort::fetchInput().

{ return m_sorters.at(1); }
L1GctElectronSorter* L1GctEmLeafCard::getNonIsoElectronSorterU2 ( ) [inline]

Definition at line 61 of file L1GctEmLeafCard.h.

References m_sorters.

Referenced by L1GctElectronFinalSort::fetchInput().

{ return m_sorters.at(3); }
vector< L1GctEmCand > L1GctEmLeafCard::getOutputIsoEmCands ( int  fpga)

get the output candidates

Definition at line 73 of file L1GctEmLeafCard.cc.

References m_sorters.

                                                                 {
  if (fpga<2) {
    return m_sorters.at(2*fpga)->getOutputCands();
  }
  else {
    return vector<L1GctEmCand>(0);
  }
}
vector< L1GctEmCand > L1GctEmLeafCard::getOutputNonIsoEmCands ( int  fpga)

get the output candidates

Definition at line 83 of file L1GctEmLeafCard.cc.

References m_sorters.

                                                                    {
  if (fpga<2) {
    return m_sorters.at(2*fpga+1)->getOutputCands();
  }
  else {
    return vector<L1GctEmCand>(0);
  }
}
int L1GctEmLeafCard::id ( void  ) [inline]

get ID

Definition at line 47 of file L1GctEmLeafCard.h.

References m_id.

{ return m_id; }
void L1GctEmLeafCard::process ( ) [virtual]

process the event

Implements L1GctProcessor.

Definition at line 66 of file L1GctEmLeafCard.cc.

References i, m_sorters, and N_SORTERS.

                              {
  for (unsigned i=0; i<N_SORTERS; i++) {
    m_sorters.at(i)->process();
  }
}
void L1GctEmLeafCard::reset ( void  )

clear buffers

clear internal trigger data buffers

Reimplemented from L1GctProcessor.

Definition at line 35 of file L1GctEmLeafCard.cc.

References i, m_sorters, and N_SORTERS.

                            {
  L1GctProcessor::reset();
  for (unsigned i=0; i<N_SORTERS; i++) {
    m_sorters.at(i)->reset();
  }
}
virtual void L1GctEmLeafCard::resetPipelines ( ) [inline, protected, virtual]

Implements L1GctProcessor.

Definition at line 67 of file L1GctEmLeafCard.h.

{}
virtual void L1GctEmLeafCard::resetProcessor ( ) [inline, protected, virtual]

Separate reset methods for the processor itself and any data stored in pipelines.

Implements L1GctProcessor.

Definition at line 66 of file L1GctEmLeafCard.h.

{}
void L1GctEmLeafCard::setBxRange ( const int  firstBx,
const int  numberOfBx 
)

partially clear buffers

define the bunch crossing range to process

Reimplemented from L1GctProcessor.

Definition at line 43 of file L1GctEmLeafCard.cc.

References i, m_sorters, and N_SORTERS.

                                                                        {
  L1GctProcessor::setBxRange(firstBx, numberOfBx);
  for (unsigned i=0; i<N_SORTERS; i++) {
    m_sorters.at(i)->setBxRange(firstBx, numberOfBx);
  }
}
void L1GctEmLeafCard::setNextBx ( const int  bxnum)

partially clear buffers

clear input data buffers and process a new bunch crossing

Reimplemented from L1GctProcessor.

Definition at line 51 of file L1GctEmLeafCard.cc.

References i, m_sorters, and N_SORTERS.

                                            {
  L1GctProcessor::setNextBx(bx);
  for (unsigned i=0; i<N_SORTERS; i++) {
    m_sorters.at(i)->setNextBx(bx);
  }
}
virtual void L1GctEmLeafCard::setupObjects ( ) [inline, protected, virtual]

Initialise inputs with null objects for the correct bunch crossing if required.

Implements L1GctProcessor.

Definition at line 70 of file L1GctEmLeafCard.h.

{}

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const L1GctEmLeafCard card 
) [friend]

overload of cout operator


Member Data Documentation

int L1GctEmLeafCard::m_id [private]

card ID (0 or 1)

Definition at line 74 of file L1GctEmLeafCard.h.

Referenced by id(), and operator<<().

const unsigned L1GctEmLeafCard::N_SORTERS = 4 [static]

Definition at line 22 of file L1GctEmLeafCard.h.

Referenced by fetchInput(), process(), reset(), setBxRange(), and setNextBx().