#include <CSCMotherboard.h>
Public Member Functions | |
void | clear () |
CSCMotherboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf) | |
CSCMotherboard () | |
std::vector< CSCCorrelatedLCTDigi > | getLCTs () |
std::vector< CSCCorrelatedLCTDigi > | readoutLCTs () |
std::vector< CSCCorrelatedLCTDigi > | run (const CSCWireDigiCollection *wiredc, const CSCComparatorDigiCollection *compdc) |
void | run (const std::vector< int > w_time[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES], const std::vector< int > hs_times[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS], const std::vector< int > ds_times[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS]) |
void | setConfigParameters (const CSCDBL1TPParameters *conf) |
~CSCMotherboard () | |
Public Attributes | |
CSCAnodeLCTProcessor * | alct |
CSCCathodeLCTProcessor * | clct |
Private Types | |
enum | { MAX_LCT_BINS = 16 } |
Private Member Functions | |
void | checkConfigParameters () |
CSCCorrelatedLCTDigi | constructLCTs (const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT) |
void | correlateLCTs (CSCALCTDigi bestALCT, CSCALCTDigi secondALCT, CSCCLCTDigi bestCLCT, CSCCLCTDigi secondCLCT) |
void | dumpConfigParams () const |
unsigned int | encodePattern (const int ptn, const int highPt) |
unsigned int | findQuality (const CSCALCTDigi &aLCT, const CSCCLCTDigi &cLCT) |
void | testLCT () |
Private Attributes | |
unsigned int | alct_trig_enable |
unsigned int | clct_trig_enable |
static const unsigned int | def_clct_trig_enable = 0 |
static const unsigned int | def_match_trig_window_size = 7 |
CSCCorrelatedLCTDigi | firstLCT [MAX_LCT_BINS] |
int | infoV |
bool | isMTCC |
bool | isTMB07 |
unsigned int | match_trig_enable |
unsigned int | match_trig_window_size |
unsigned int | mpc_block_me1a |
CSCCorrelatedLCTDigi | secondLCT [MAX_LCT_BINS] |
const unsigned | theEndcap |
const unsigned | theSector |
const unsigned | theStation |
const unsigned | theSubsector |
const unsigned | theTrigChamber |
unsigned int | tmb_l1a_window_size |
Static Private Attributes | |
static const unsigned int | def_alct_trig_enable = 0 |
static const unsigned int | def_match_trig_enable = 1 |
static const unsigned int | def_mpc_block_me1a = 1 |
static const unsigned int | def_tmb_l1a_window_size = 7 |
Correlates anode and cathode LCTs from the same chamber.
When the Trigger MotherBoard (TMB) is instantiated it instantiates an ALCT and CLCT board. The MotherBoard takes up to two LCTs from each anode and cathode LCT card and combines them into a single Correlated LCT. The output is up to two Correlated LCTs.
It can be run in either a test mode, where the arguments are a collection of wire times and arrays of halfstrip and distrip times, or for general use, with wire digi and comparator digi collections as arguments. In the latter mode, the wire & strip info is passed on the LCTProcessors, where it is decoded and converted into a convenient form. After running the anode and cathode LCTProcessors, TMB correlates the anode and cathode LCTs. At present, it simply matches the best CLCT with the best ALCT; perhaps a better algorithm will be determined in the future. The MotherBoard then determines a few more numbers (such as quality and pattern) from the ALCT and CLCT information, and constructs two correlated LCT "digis".
Based on code by Nick Wisniewski (nw@its.caltech.edu) and a framework by Darin Acosta (acosta@phys.ufl.edu).
Numerous later improvements by Jason Mumford and Slava Valuev (see cvs in ORCA). Porting from ORCA by S. Valuev (Slava.Valuev@cern.ch), May 2006.
Definition at line 43 of file CSCMotherboard.h.
anonymous enum [private] |
CSCMotherboard::CSCMotherboard | ( | unsigned | endcap, |
unsigned | station, | ||
unsigned | sector, | ||
unsigned | subsector, | ||
unsigned | chamber, | ||
const edm::ParameterSet & | conf | ||
) |
Normal constructor.
Definition at line 51 of file CSCMotherboard.cc.
References alct, alct_trig_enable, checkConfigParameters(), clct, clct_trig_enable, dumpConfigParams(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), infoV, isMTCC, isTMB07, match_trig_enable, match_trig_window_size, mpc_block_me1a, and tmb_l1a_window_size.
: theEndcap(endcap), theStation(station), theSector(sector), theSubsector(subsector), theTrigChamber(chamber) { // Normal constructor. -JM // Pass ALCT, CLCT, and common parameters on to ALCT and CLCT processors. static bool config_dumped = false; // Some configuration parameters and some details of the emulator // algorithms depend on whether we want to emulate the trigger logic // used in TB/MTCC or its idealized version (the latter was used in MC // studies since early ORCA days until (and including) CMSSW_2_1_X). edm::ParameterSet commonParams = conf.getParameter<edm::ParameterSet>("commonParam"); isMTCC = commonParams.getParameter<bool>("isMTCC"); // Switch for a new (2007) version of the TMB firmware. isTMB07 = commonParams.getParameter<bool>("isTMB07"); // Choose the appropriate set of configuration parameters depending on // isTMB07 and isMTCC flags. // Starting with CMSSW_3_1_X, these settings are overwritten by the // ones delivered by the EventSetup mechanism. edm::ParameterSet alctParams, clctParams; if (isTMB07) { alctParams = conf.getParameter<edm::ParameterSet>("alctParam07"); clctParams = conf.getParameter<edm::ParameterSet>("clctParam07"); } else if (isMTCC) { alctParams = conf.getParameter<edm::ParameterSet>("alctParamMTCC"); clctParams = conf.getParameter<edm::ParameterSet>("clctParamMTCC"); } else { alctParams = conf.getParameter<edm::ParameterSet>("alctParamOldMC"); clctParams = conf.getParameter<edm::ParameterSet>("clctParamOldMC"); } alct = new CSCAnodeLCTProcessor(endcap, station, sector, subsector, chamber, alctParams, commonParams); clct = new CSCCathodeLCTProcessor(endcap, station, sector, subsector, chamber, clctParams, commonParams); // Motherboard parameters: common for all configurations. edm::ParameterSet tmbParams = conf.getParameter<edm::ParameterSet>("tmbParam"); mpc_block_me1a = tmbParams.getParameter<unsigned int>("mpcBlockMe1a"); alct_trig_enable = tmbParams.getParameter<unsigned int>("alctTrigEnable"); clct_trig_enable = tmbParams.getParameter<unsigned int>("clctTrigEnable"); match_trig_enable = tmbParams.getParameter<unsigned int>("matchTrigEnable"); match_trig_window_size = tmbParams.getParameter<unsigned int>("matchTrigWindowSize"); tmb_l1a_window_size = // Common to CLCT and TMB tmbParams.getParameter<unsigned int>("tmbL1aWindowSize"); infoV = tmbParams.getUntrackedParameter<int>("verbosity", 0); // Check and print configuration parameters. checkConfigParameters(); if (infoV > 0 && !config_dumped) { dumpConfigParams(); config_dumped = true; } // test to make sure that what goes into a correlated LCT is also what // comes back out. // testLCT(); }
CSCMotherboard::CSCMotherboard | ( | ) |
Constructor for use during testing.
Definition at line 120 of file CSCMotherboard.cc.
References alct, alct_trig_enable, checkConfigParameters(), clct, clct_trig_enable, def_alct_trig_enable, def_clct_trig_enable, def_match_trig_enable, def_match_trig_window_size, def_mpc_block_me1a, def_tmb_l1a_window_size, dumpConfigParams(), infoV, isMTCC, isTMB07, match_trig_enable, match_trig_window_size, mpc_block_me1a, and tmb_l1a_window_size.
: theEndcap(1), theStation(1), theSector(1), theSubsector(1), theTrigChamber(1) { // Constructor used only for testing. -JM static bool config_dumped = false; isMTCC = false; isTMB07 = true; alct = new CSCAnodeLCTProcessor(); clct = new CSCCathodeLCTProcessor(); mpc_block_me1a = def_mpc_block_me1a; alct_trig_enable = def_alct_trig_enable; clct_trig_enable = def_clct_trig_enable; match_trig_enable = def_match_trig_enable; match_trig_window_size = def_match_trig_window_size; tmb_l1a_window_size = def_tmb_l1a_window_size; infoV = 2; // Check and print configuration parameters. checkConfigParameters(); if (infoV > 0 && !config_dumped) { dumpConfigParams(); config_dumped = true; } }
CSCMotherboard::~CSCMotherboard | ( | ) |
void CSCMotherboard::checkConfigParameters | ( | ) | [private] |
Make sure that the parameter values are within the allowed range.
Definition at line 186 of file CSCMotherboard.cc.
References alct_trig_enable, clct_trig_enable, def_alct_trig_enable, def_clct_trig_enable, def_match_trig_enable, def_match_trig_window_size, def_mpc_block_me1a, def_tmb_l1a_window_size, infoV, match_trig_enable, match_trig_window_size, mpc_block_me1a, and tmb_l1a_window_size.
Referenced by CSCMotherboard(), and setConfigParameters().
{ // Make sure that the parameter values are within the allowed range. // Max expected values. static const unsigned int max_mpc_block_me1a = 1 << 1; static const unsigned int max_alct_trig_enable = 1 << 1; static const unsigned int max_clct_trig_enable = 1 << 1; static const unsigned int max_match_trig_enable = 1 << 1; static const unsigned int max_match_trig_window_size = 1 << 4; static const unsigned int max_tmb_l1a_window_size = 1 << 4; // Checks. if (mpc_block_me1a >= max_mpc_block_me1a) { if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError") << "+++ Value of mpc_block_me1a, " << mpc_block_me1a << ", exceeds max allowed, " << max_mpc_block_me1a-1 << " +++\n" << "+++ Try to proceed with the default value, mpc_block_me1a=" << def_mpc_block_me1a << " +++\n"; mpc_block_me1a = def_mpc_block_me1a; } if (alct_trig_enable >= max_alct_trig_enable) { if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError") << "+++ Value of alct_trig_enable, " << alct_trig_enable << ", exceeds max allowed, " << max_alct_trig_enable-1 << " +++\n" << "+++ Try to proceed with the default value, alct_trig_enable=" << def_alct_trig_enable << " +++\n"; alct_trig_enable = def_alct_trig_enable; } if (clct_trig_enable >= max_clct_trig_enable) { if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError") << "+++ Value of clct_trig_enable, " << clct_trig_enable << ", exceeds max allowed, " << max_clct_trig_enable-1 << " +++\n" << "+++ Try to proceed with the default value, clct_trig_enable=" << def_clct_trig_enable << " +++\n"; clct_trig_enable = def_clct_trig_enable; } if (match_trig_enable >= max_match_trig_enable) { if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError") << "+++ Value of match_trig_enable, " << match_trig_enable << ", exceeds max allowed, " << max_match_trig_enable-1 << " +++\n" << "+++ Try to proceed with the default value, match_trig_enable=" << def_match_trig_enable << " +++\n"; match_trig_enable = def_match_trig_enable; } if (match_trig_window_size >= max_match_trig_window_size) { if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError") << "+++ Value of match_trig_window_size, " << match_trig_window_size << ", exceeds max allowed, " << max_match_trig_window_size-1 << " +++\n" << "+++ Try to proceed with the default value, match_trig_window_size=" << def_match_trig_window_size << " +++\n"; match_trig_window_size = def_match_trig_window_size; } if (tmb_l1a_window_size >= max_tmb_l1a_window_size) { if (infoV >= 0) edm::LogError("L1CSCTPEmulatorConfigError") << "+++ Value of tmb_l1a_window_size, " << tmb_l1a_window_size << ", exceeds max allowed, " << max_tmb_l1a_window_size-1 << " +++\n" << "+++ Try to proceed with the default value, tmb_l1a_window_size=" << def_tmb_l1a_window_size << " +++\n"; tmb_l1a_window_size = def_tmb_l1a_window_size; } }
void CSCMotherboard::clear | ( | void | ) |
Clears correlated LCT and passes clear signal on to cathode and anode LCT processors.
Definition at line 153 of file CSCMotherboard.cc.
References alct, clct, CSCCathodeLCTProcessor::clear(), CSCAnodeLCTProcessor::clear(), CSCCorrelatedLCTDigi::clear(), firstLCT, MAX_LCT_BINS, and secondLCT.
Referenced by run().
CSCCorrelatedLCTDigi CSCMotherboard::constructLCTs | ( | const CSCALCTDigi & | aLCT, |
const CSCCLCTDigi & | cLCT | ||
) | [private] |
Definition at line 547 of file CSCMotherboard.cc.
References encodePattern(), findQuality(), CSCCLCTDigi::getBend(), CSCALCTDigi::getBX(), CSCCLCTDigi::getBX(), CSCCLCTDigi::getKeyStrip(), CSCALCTDigi::getKeyWG(), CSCCLCTDigi::getPattern(), CSCCLCTDigi::getStripType(), CSCALCTDigi::isValid(), listBenchmarks::pattern, and theTrigChamber.
Referenced by correlateLCTs().
{ // CLCT pattern number unsigned int pattern = encodePattern(cLCT.getPattern(), cLCT.getStripType()); // LCT quality number unsigned int quality = findQuality(aLCT, cLCT); // Bunch crossing: get it from cathode LCT if anode LCT is not there. int bx = aLCT.isValid() ? aLCT.getBX() : cLCT.getBX(); // construct correlated LCT; temporarily assign track number of 0. int trknmb = 0; CSCCorrelatedLCTDigi thisLCT(trknmb, 1, quality, aLCT.getKeyWG(), cLCT.getKeyStrip(), pattern, cLCT.getBend(), bx, 0, 0, 0, theTrigChamber); return thisLCT; }
void CSCMotherboard::correlateLCTs | ( | CSCALCTDigi | bestALCT, |
CSCALCTDigi | secondALCT, | ||
CSCCLCTDigi | bestCLCT, | ||
CSCCLCTDigi | secondCLCT | ||
) | [private] |
Definition at line 492 of file CSCMotherboard.cc.
References alct_trig_enable, clct_trig_enable, constructLCTs(), firstLCT, CSCCorrelatedLCTDigi::getBX(), infoV, CSCALCTDigi::isValid(), CSCCLCTDigi::isValid(), match_trig_enable, MAX_LCT_BINS, secondLCT, and CSCCorrelatedLCTDigi::setTrknmb().
Referenced by run().
{ bool anodeBestValid = bestALCT.isValid(); bool anodeSecondValid = secondALCT.isValid(); bool cathodeBestValid = bestCLCT.isValid(); bool cathodeSecondValid = secondCLCT.isValid(); if (anodeBestValid && !anodeSecondValid) secondALCT = bestALCT; if (!anodeBestValid && anodeSecondValid) bestALCT = secondALCT; if (cathodeBestValid && !cathodeSecondValid) secondCLCT = bestCLCT; if (!cathodeBestValid && cathodeSecondValid) bestCLCT = secondCLCT; // ALCT-CLCT matching conditions are defined by "trig_enable" configuration // parameters. if ((alct_trig_enable && bestALCT.isValid()) || (clct_trig_enable && bestCLCT.isValid()) || (match_trig_enable && bestALCT.isValid() && bestCLCT.isValid())) { CSCCorrelatedLCTDigi lct = constructLCTs(bestALCT, bestCLCT); int bx = lct.getBX(); if (bx >= 0 && bx < MAX_LCT_BINS) { firstLCT[bx] = lct; firstLCT[bx].setTrknmb(1); } else { if (infoV > 0) edm::LogWarning("L1CSCTPEmulatorOutOfTimeLCT") << "+++ Bx of first LCT candidate, " << bx << ", is not within the allowed range, [0-" << MAX_LCT_BINS-1 << "); skipping it... +++\n"; } } if (((secondALCT != bestALCT) || (secondCLCT != bestCLCT)) && ((alct_trig_enable && secondALCT.isValid()) || (clct_trig_enable && secondCLCT.isValid()) || (match_trig_enable && secondALCT.isValid() && secondCLCT.isValid()))) { CSCCorrelatedLCTDigi lct = constructLCTs(secondALCT, secondCLCT); int bx = lct.getBX(); if (bx >= 0 && bx < MAX_LCT_BINS) { secondLCT[bx] = lct; secondLCT[bx].setTrknmb(2); } else { if (infoV > 0) edm::LogWarning("L1CSCTPEmulatorOutOfTimeLCT") << "+++ Bx of second LCT candidate, " << bx << ", is not within the allowed range, [0-" << MAX_LCT_BINS-1 << "); skipping it... +++\n"; } } }
void CSCMotherboard::dumpConfigParams | ( | ) | const [private] |
Dump TMB/MPC configuration parameters.
Definition at line 767 of file CSCMotherboard.cc.
References alct_trig_enable, clct_trig_enable, LogDebug, match_trig_enable, match_trig_window_size, mpc_block_me1a, and tmb_l1a_window_size.
Referenced by CSCMotherboard(), and setConfigParameters().
{ std::ostringstream strm; strm << "\n"; strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"; strm << "+ TMB configuration parameters: +\n"; strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"; strm << " mpc_block_me1a [block/not block triggers which come from ME1/A] = " << mpc_block_me1a << "\n"; strm << " alct_trig_enable [allow ALCT-only triggers] = " << alct_trig_enable << "\n"; strm << " clct_trig_enable [allow CLCT-only triggers] = " << clct_trig_enable << "\n"; strm << " match_trig_enable [allow matched ALCT-CLCT triggers] = " << match_trig_enable << "\n"; strm << " match_trig_window_size [ALCT-CLCT match window width, in 25 ns] = " << match_trig_window_size << "\n"; strm << " tmb_l1a_window_size [L1Accept window width, in 25 ns bins] = " << tmb_l1a_window_size << "\n"; strm << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"; LogDebug("CSCMotherboard") << strm.str(); }
unsigned int CSCMotherboard::encodePattern | ( | const int | ptn, |
const int | highPt | ||
) | [private] |
Definition at line 568 of file CSCMotherboard.cc.
References abs, isTMB07, and listBenchmarks::pattern.
Referenced by constructLCTs(), and testLCT().
{ const int kPatternBitWidth = 4; unsigned int pattern; if (!isTMB07) { // Cathode pattern number is a kPatternBitWidth-1 bit word. pattern = (abs(ptn) & ((1<<(kPatternBitWidth-1))-1)); // The pattern has the MSB (4th bit in the default version) set if it // consists of half-strips. if (stripType) { pattern = pattern | (1<<(kPatternBitWidth-1)); } } else { // In the TMB07 firmware, LCT pattern is just a 4-bit CLCT pattern. pattern = (abs(ptn) & ((1<<kPatternBitWidth)-1)); } return pattern; }
unsigned int CSCMotherboard::findQuality | ( | const CSCALCTDigi & | aLCT, |
const CSCCLCTDigi & | cLCT | ||
) | [private] |
Definition at line 594 of file CSCMotherboard.cc.
References CSCALCTDigi::getAccelerator(), CSCCLCTDigi::getPattern(), CSCCLCTDigi::getQuality(), CSCALCTDigi::getQuality(), CSCCLCTDigi::getStripType(), infoV, isTMB07, CSCALCTDigi::isValid(), CSCCLCTDigi::isValid(), evf::evtn::offset(), and listBenchmarks::pattern.
Referenced by constructLCTs(), and testLCT().
{ unsigned int quality = 0; if (!isTMB07) { bool isDistrip = (cLCT.getStripType() == 0); if (aLCT.isValid() && !(cLCT.isValid())) { // no CLCT if (aLCT.getAccelerator()) {quality = 1;} else {quality = 3;} } else if (!(aLCT.isValid()) && cLCT.isValid()) { // no ALCT if (isDistrip) {quality = 4;} else {quality = 5;} } else if (aLCT.isValid() && cLCT.isValid()) { // both ALCT and CLCT if (aLCT.getAccelerator()) {quality = 2;} // accelerator muon else { // collision muon // CLCT quality is, in fact, the number of layers hit, so subtract 3 // to get quality analogous to ALCT one. int sumQual = aLCT.getQuality() + (cLCT.getQuality()-3); if (sumQual < 1 || sumQual > 6) { if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorWrongValues") << "+++ findQuality: sumQual = " << sumQual << "+++ \n"; } if (isDistrip) { // distrip pattern if (sumQual == 2) {quality = 6;} else if (sumQual == 3) {quality = 7;} else if (sumQual == 4) {quality = 8;} else if (sumQual == 5) {quality = 9;} else if (sumQual == 6) {quality = 10;} } else { // halfstrip pattern if (sumQual == 2) {quality = 11;} else if (sumQual == 3) {quality = 12;} else if (sumQual == 4) {quality = 13;} else if (sumQual == 5) {quality = 14;} else if (sumQual == 6) {quality = 15;} } } } } #ifdef OLD else { // Temporary definition, used until July 2008. // First if statement is fictitious, just to help the CSC TF emulator // handle such cases (one needs to make sure they will be accounted for // in the new quality definition. if (!(aLCT.isValid()) || !(cLCT.isValid())) { if (aLCT.isValid() && !(cLCT.isValid())) quality = 1; // no CLCT else if (!(aLCT.isValid()) && cLCT.isValid()) quality = 2; // no ALCT else quality = 0; // both absent; should never happen. } else { // Sum of ALCT and CLCT quality bits. CLCT quality is, in fact, the // number of layers hit, so subtract 3 to put it to the same footing as // the ALCT quality. int sumQual = aLCT.getQuality() + (cLCT.getQuality()-3); if (sumQual < 1 || sumQual > 6) { if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorWrongValues") << "+++ findQuality: Unexpected sumQual = " << sumQual << "+++\n"; } // LCT quality is basically the sum of ALCT and CLCT qualities, but split // in two groups depending on the CLCT pattern id (higher quality for // straighter patterns). int offset = 0; if (cLCT.getPattern() <= 7) offset = 4; else offset = 9; quality = offset + sumQual; } } #endif else { // 2008 definition. if (!(aLCT.isValid()) || !(cLCT.isValid())) { if (aLCT.isValid() && !(cLCT.isValid())) quality = 1; // no CLCT else if (!(aLCT.isValid()) && cLCT.isValid()) quality = 2; // no ALCT else quality = 0; // both absent; should never happen. } else { int pattern = cLCT.getPattern(); if (pattern == 1) quality = 3; // layer-trigger in CLCT else { // CLCT quality is the number of layers hit minus 3. // CLCT quality is the number of layers hit. bool a4 = (aLCT.getQuality() >= 1); bool c4 = (cLCT.getQuality() >= 4); // quality = 4; "reserved for low-quality muons in future" if (!a4 && !c4) quality = 5; // marginal anode and cathode else if ( a4 && !c4) quality = 6; // HQ anode, but marginal cathode else if (!a4 && c4) quality = 7; // HQ cathode, but marginal anode else if ( a4 && c4) { if (aLCT.getAccelerator()) quality = 8; // HQ muon, but accel ALCT else { // quality = 9; "reserved for HQ muons with future patterns // quality = 10; "reserved for HQ muons with future patterns if (pattern == 2 || pattern == 3) quality = 11; else if (pattern == 4 || pattern == 5) quality = 12; else if (pattern == 6 || pattern == 7) quality = 13; else if (pattern == 8 || pattern == 9) quality = 14; else if (pattern == 10) quality = 15; else { if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorWrongValues") << "+++ findQuality: Unexpected CLCT pattern id = " << pattern << "+++\n"; } } } } } } return quality; }
std::vector< CSCCorrelatedLCTDigi > CSCMotherboard::getLCTs | ( | ) |
Returns vector of all found correlated LCTs, if any.
Definition at line 473 of file CSCMotherboard.cc.
References firstLCT, MAX_LCT_BINS, mpc_block_me1a, CSCTriggerNumbering::ringFromTriggerLabels(), secondLCT, theStation, and theTrigChamber.
Referenced by readoutLCTs().
{ std::vector<CSCCorrelatedLCTDigi> tmpV; bool me11 = (theStation == 1 && CSCTriggerNumbering::ringFromTriggerLabels(theStation, theTrigChamber)==1); // Do not report LCTs found in ME1/A if mpc_block_me1/a is set. for (int bx = 0; bx < MAX_LCT_BINS; bx++) { if (firstLCT[bx].isValid()) if (!mpc_block_me1a || (!me11 || firstLCT[bx].getStrip() <= 127)) tmpV.push_back(firstLCT[bx]); if (secondLCT[bx].isValid()) if (!mpc_block_me1a || (!me11 || secondLCT[bx].getStrip() <= 127)) tmpV.push_back(secondLCT[bx]); } return tmpV; }
std::vector< CSCCorrelatedLCTDigi > CSCMotherboard::readoutLCTs | ( | ) |
Returns vector of correlated LCTs in the read-out time window, if any.
Definition at line 397 of file CSCMotherboard.cc.
References getLCTs(), infoV, LogDebug, MAX_LCT_BINS, and tmb_l1a_window_size.
Referenced by run().
{ std::vector<CSCCorrelatedLCTDigi> tmpV; // The start time of the L1A*LCT coincidence window should be related // to the fifo_pretrig parameter, but I am not completely sure how. // Just choose it such that the window is centered at bx=7. This may // need further tweaking if the value of tmb_l1a_window_size changes. static int early_tbins = 4; // The number of LCT bins in the read-out is given by the // tmb_l1a_window_size parameter, but made even by setting the LSB // of tmb_l1a_window_size to 0. // static int lct_bins = // (tmb_l1a_window_size%2 == 0) ? tmb_l1a_window_size : tmb_l1a_window_size-1; // Empirical correction to match 2009 collision data (firmware change?) static int lct_bins = tmb_l1a_window_size; static int late_tbins = early_tbins + lct_bins; static int ifois = 0; if (ifois == 0) { if (infoV >= 0 && early_tbins < 0) { edm::LogWarning("L1CSCTPEmulatorSuspiciousParameters") << "+++ early_tbins = " << early_tbins << "; in-time LCTs are not getting read-out!!! +++" << "\n"; } if (late_tbins > MAX_LCT_BINS-1) { if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorSuspiciousParameters") << "+++ Allowed range of time bins, [0-" << late_tbins << "] exceeds max allowed, " << MAX_LCT_BINS-1 << " +++\n" << "+++ Set late_tbins to max allowed +++\n"; late_tbins = MAX_LCT_BINS-1; } ifois = 1; } // Start from the vector of all found correlated LCTs and select // those within the LCT*L1A coincidence window. int bx_readout = -1; std::vector<CSCCorrelatedLCTDigi> all_lcts = getLCTs(); for (std::vector <CSCCorrelatedLCTDigi>::const_iterator plct = all_lcts.begin(); plct != all_lcts.end(); plct++) { if (!plct->isValid()) continue; int bx = (*plct).getBX(); // Skip LCTs found too early relative to L1Accept. if (bx <= early_tbins) { if (infoV > 1) LogDebug("CSCMotherboard") << " Do not report correlated LCT on key halfstrip " << plct->getStrip() << " and key wire " << plct->getKeyWG() << ": found at bx " << bx << ", whereas the earliest allowed bx is " << early_tbins+1; continue; } // Skip LCTs found too late relative to L1Accept. if (bx > late_tbins) { if (infoV > 1) LogDebug("CSCMotherboard") << " Do not report correlated LCT on key halfstrip " << plct->getStrip() << " and key wire " << plct->getKeyWG() << ": found at bx " << bx << ", whereas the latest allowed bx is " << late_tbins; continue; } // For now, take only LCTs in the earliest bx in the read-out window: // in digi->raw step, LCTs have to be packed into the TMB header, and // there is room just for two. if (bx_readout == -1 || bx == bx_readout) { tmpV.push_back(*plct); if (bx_readout == -1) bx_readout = bx; } } return tmpV; }
void CSCMotherboard::run | ( | const std::vector< int > | w_time[CSCConstants::NUM_LAYERS][CSCConstants::MAX_NUM_WIRES], |
const std::vector< int > | hs_times[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS], | ||
const std::vector< int > | ds_times[CSCConstants::NUM_LAYERS][CSCConstants::NUM_HALF_STRIPS] | ||
) |
Test version of run function.
Definition at line 248 of file CSCMotherboard.cc.
References alct, CSCAnodeLCTProcessor::bestALCT, CSCCathodeLCTProcessor::bestCLCT, clct, clear(), correlateLCTs(), CSCALCTDigi::isValid(), CSCCLCTDigi::isValid(), match_trig_window_size, CSCAnodeLCTProcessor::MAX_ALCT_BINS, CSCCathodeLCTProcessor::MAX_CLCT_BINS, CSCAnodeLCTProcessor::run(), CSCCathodeLCTProcessor::run(), CSCAnodeLCTProcessor::secondALCT, and CSCCathodeLCTProcessor::secondCLCT.
Referenced by CSCTriggerPrimitivesBuilder::build().
{ // Debug version. -JM clear(); alct->run(w_times); // run anode LCT clct->run(hs_times, ds_times); // run cathodeLCT int bx_alct_matched = 0; for (int bx_clct = 0; bx_clct < CSCCathodeLCTProcessor::MAX_CLCT_BINS; bx_clct++) { if (clct->bestCLCT[bx_clct].isValid()) { bool is_matched = false; int bx_alct_start = bx_clct - match_trig_window_size/2; // int bx_alct_stop = bx_clct + match_trig_window_size/2; // Empirical correction to match 2009 collision data (firmware change?) int bx_alct_stop = bx_clct + match_trig_window_size/2 + match_trig_window_size%2; for (int bx_alct = bx_alct_start; bx_alct <= bx_alct_stop; bx_alct++) { if (bx_alct < 0 || bx_alct >= CSCAnodeLCTProcessor::MAX_ALCT_BINS) continue; if (alct->bestALCT[bx_alct].isValid()) { correlateLCTs(alct->bestALCT[bx_alct], alct->secondALCT[bx_alct], clct->bestCLCT[bx_clct], clct->secondCLCT[bx_clct]); is_matched = true; bx_alct_matched = bx_alct; break; } } // No ALCT within the match time interval found: report CLCT-only LCT // (use dummy ALCTs). if (!is_matched) { correlateLCTs(alct->bestALCT[bx_clct], alct->secondALCT[bx_clct], clct->bestCLCT[bx_clct], clct->secondCLCT[bx_clct]); } } // No valid CLCTs; attempt to make ALCT-only LCT (use dummy CLCTs). else { int bx_alct = bx_clct - match_trig_window_size/2; if (bx_alct >= 0 && bx_alct > bx_alct_matched) { if (alct->bestALCT[bx_alct].isValid()) { correlateLCTs(alct->bestALCT[bx_alct], alct->secondALCT[bx_alct], clct->bestCLCT[bx_clct], clct->secondCLCT[bx_clct]); } } } } }
std::vector< CSCCorrelatedLCTDigi > CSCMotherboard::run | ( | const CSCWireDigiCollection * | wiredc, |
const CSCComparatorDigiCollection * | compdc | ||
) |
Run function for normal usage. Runs cathode and anode LCT processors, takes results and correlates into CorrelatedLCT.
Definition at line 299 of file CSCMotherboard.cc.
References alct, CSCAnodeLCTProcessor::bestALCT, CSCCathodeLCTProcessor::bestCLCT, clct, clear(), correlateLCTs(), firstLCT, infoV, CSCALCTDigi::isValid(), CSCCLCTDigi::isValid(), LogDebug, LogTrace, match_trig_window_size, CSCAnodeLCTProcessor::MAX_ALCT_BINS, CSCCathodeLCTProcessor::MAX_CLCT_BINS, MAX_LCT_BINS, readoutLCTs(), CSCAnodeLCTProcessor::run(), CSCCathodeLCTProcessor::run(), CSCAnodeLCTProcessor::secondALCT, CSCCathodeLCTProcessor::secondCLCT, and secondLCT.
{ clear(); if (alct && clct) { { std::vector<CSCALCTDigi> alctV = alct->run(wiredc); // run anodeLCT } { std::vector<CSCCLCTDigi> clctV = clct->run(compdc); // run cathodeLCT } int bx_alct_matched = 0; // bx of last matched ALCT for (int bx_clct = 0; bx_clct < CSCCathodeLCTProcessor::MAX_CLCT_BINS; bx_clct++) { // There should be at least one valid ALCT or CLCT for a // correlated LCT to be formed. Decision on whether to reject // non-complete LCTs (and if yes of which type) is made further // upstream. if (clct->bestCLCT[bx_clct].isValid()) { // Look for ALCTs within the match-time window. The window is // centered at the CLCT bx; therefore, we make an assumption // that anode and cathode hits are perfectly synchronized. This // is always true for MC, but only an approximation when the // data is analyzed (which works fairly good as long as wide // windows are used). To get rid of this assumption, one would // need to access "full BX" words, which are not readily // available. bool is_matched = false; int bx_alct_start = bx_clct - match_trig_window_size/2; // int bx_alct_stop = bx_clct + match_trig_window_size/2; // Empirical correction to match 2009 collision data (firmware change?) int bx_alct_stop = bx_clct + match_trig_window_size/2 + match_trig_window_size%2; for (int bx_alct = bx_alct_start; bx_alct <= bx_alct_stop; bx_alct++) { if (bx_alct < 0 || bx_alct >= CSCAnodeLCTProcessor::MAX_ALCT_BINS) continue; if (alct->bestALCT[bx_alct].isValid()) { if (infoV > 1) LogTrace("CSCMotherboard") << "Successful ALCT-CLCT match: bx_clct = " << bx_clct << "; match window: [" << bx_alct_start << "; " << bx_alct_stop << "]; bx_alct = " << bx_alct; correlateLCTs(alct->bestALCT[bx_alct], alct->secondALCT[bx_alct], clct->bestCLCT[bx_clct], clct->secondCLCT[bx_clct]); is_matched = true; bx_alct_matched = bx_alct; break; } } // No ALCT within the match time interval found: report CLCT-only LCT // (use dummy ALCTs). if (!is_matched) { if (infoV > 1) LogTrace("CSCMotherboard") << "Unsuccessful ALCT-CLCT match (CLCT only): bx_clct = " << bx_clct << "; match window: [" << bx_alct_start << "; " << bx_alct_stop << "]"; correlateLCTs(alct->bestALCT[bx_clct], alct->secondALCT[bx_clct], clct->bestCLCT[bx_clct], clct->secondCLCT[bx_clct]); } } // No valid CLCTs; attempt to make ALCT-only LCT. Use only ALCTs // which have zeroth chance to be matched at later cathode times. // (I am not entirely sure this perfectly matches the firmware logic.) // Use dummy CLCTs. else { int bx_alct = bx_clct - match_trig_window_size/2; if (bx_alct >= 0 && bx_alct > bx_alct_matched) { if (alct->bestALCT[bx_alct].isValid()) { if (infoV > 1) LogTrace("CSCMotherboard") << "Unsuccessful ALCT-CLCT match (ALCT only): bx_alct = " << bx_alct; correlateLCTs(alct->bestALCT[bx_alct], alct->secondALCT[bx_alct], clct->bestCLCT[bx_clct], clct->secondCLCT[bx_clct]); } } } } if (infoV > 0) { for (int bx = 0; bx < MAX_LCT_BINS; bx++) { if (firstLCT[bx].isValid()) LogDebug("CSCMotherboard") << firstLCT[bx]; if (secondLCT[bx].isValid()) LogDebug("CSCMotherboard") << secondLCT[bx]; } } } else { if (infoV >= 0) edm::LogError("L1CSCTPEmulatorSetupError") << "+++ run() called for non-existing ALCT/CLCT processor! +++ \n"; } std::vector<CSCCorrelatedLCTDigi> tmpV = readoutLCTs(); return tmpV; }
void CSCMotherboard::setConfigParameters | ( | const CSCDBL1TPParameters * | conf | ) |
Set configuration parameters obtained via EventSetup mechanism.
Definition at line 163 of file CSCMotherboard.cc.
References alct, alct_trig_enable, checkConfigParameters(), clct, clct_trig_enable, dumpConfigParams(), match_trig_enable, match_trig_window_size, mpc_block_me1a, CSCCathodeLCTProcessor::setConfigParameters(), CSCAnodeLCTProcessor::setConfigParameters(), tmb_l1a_window_size, CSCDBL1TPParameters::tmbAlctTrigEnable(), CSCDBL1TPParameters::tmbClctTrigEnable(), CSCDBL1TPParameters::tmbMatchTrigEnable(), CSCDBL1TPParameters::tmbMatchTrigWindowSize(), CSCDBL1TPParameters::tmbMpcBlockMe1a(), and CSCDBL1TPParameters::tmbTmbL1aWindowSize().
Referenced by CSCTriggerPrimitivesBuilder::setConfigParameters().
{ static bool config_dumped = false; // Config. parameters for the TMB itself. mpc_block_me1a = conf->tmbMpcBlockMe1a(); alct_trig_enable = conf->tmbAlctTrigEnable(); clct_trig_enable = conf->tmbClctTrigEnable(); match_trig_enable = conf->tmbMatchTrigEnable(); match_trig_window_size = conf->tmbMatchTrigWindowSize(); tmb_l1a_window_size = conf->tmbTmbL1aWindowSize(); // Config. paramteres for ALCT and CLCT processors. alct->setConfigParameters(conf); clct->setConfigParameters(conf); // Check and print configuration parameters. checkConfigParameters(); if (!config_dumped) { dumpConfigParams(); config_dumped = true; } }
void CSCMotherboard::testLCT | ( | ) | [private] |
Definition at line 709 of file CSCMotherboard.cc.
References encodePattern(), findQuality(), CSCCLCTDigi::getBend(), CSCALCTDigi::getBX(), CSCCLCTDigi::getKeyStrip(), CSCALCTDigi::getKeyWG(), CSCCLCTDigi::getPattern(), CSCCLCTDigi::getStripType(), LogTrace, listBenchmarks::pattern, and strip().
{ unsigned int lctPattern, lctQuality; for (int pattern = 0; pattern < 8; pattern++) { for (int bend = 0; bend < 2; bend++) { for (int cfeb = 0; cfeb < 5; cfeb++) { for (int strip = 0; strip < 32; strip++) { for (int bx = 0; bx < 7; bx++) { for (int stripType = 0; stripType < 2; stripType++) { for (int quality = 3; quality < 7; quality++) { CSCCLCTDigi cLCT(1, quality, pattern, stripType, bend, strip, cfeb, bx); lctPattern = encodePattern(cLCT.getPattern(), cLCT.getStripType()); for (int aQuality = 0; aQuality < 4; aQuality++) { for (int wireGroup = 0; wireGroup < 120; wireGroup++) { for (int abx = 0; abx < 7; abx++) { CSCALCTDigi aLCT(1, aQuality, 0, 1, wireGroup, abx); lctQuality = findQuality(aLCT, cLCT); CSCCorrelatedLCTDigi thisLCT(0, 1, lctQuality, aLCT.getKeyWG(), cLCT.getKeyStrip(), lctPattern, cLCT.getBend(), aLCT.getBX()); if (lctPattern != static_cast<unsigned int>(thisLCT.getPattern()) ) LogTrace("CSCMotherboard") << "pattern mismatch: " << lctPattern << " " << thisLCT.getPattern(); if (bend != thisLCT.getBend()) LogTrace("CSCMotherboard") << "bend mismatch: " << bend << " " << thisLCT.getBend(); int key_strip = 32*cfeb + strip; if (key_strip != thisLCT.getStrip()) LogTrace("CSCMotherboard") << "strip mismatch: " << key_strip << " " << thisLCT.getStrip(); if (wireGroup != thisLCT.getKeyWG()) LogTrace("CSCMotherboard") << "wire group mismatch: " << wireGroup << " " << thisLCT.getKeyWG(); if (abx != thisLCT.getBX()) LogTrace("CSCMotherboard") << "bx mismatch: " << abx << " " << thisLCT.getBX(); if (lctQuality != static_cast<unsigned int>(thisLCT.getQuality())) LogTrace("CSCMotherboard") << "quality mismatch: " << lctQuality << " " << thisLCT.getQuality(); } } } } } } } } } } }
Anode LCT processor.
Definition at line 81 of file CSCMotherboard.h.
Referenced by CSCTriggerPrimitivesBuilder::build(), clear(), CSCMotherboard(), run(), setConfigParameters(), and ~CSCMotherboard().
unsigned int CSCMotherboard::alct_trig_enable [private] |
Definition at line 106 of file CSCMotherboard.h.
Referenced by checkConfigParameters(), correlateLCTs(), CSCMotherboard(), dumpConfigParams(), and setConfigParameters().
Cathode LCT processor.
Definition at line 84 of file CSCMotherboard.h.
Referenced by CSCTriggerPrimitivesBuilder::build(), clear(), CSCMotherboard(), run(), setConfigParameters(), and ~CSCMotherboard().
unsigned int CSCMotherboard::clct_trig_enable [private] |
Definition at line 106 of file CSCMotherboard.h.
Referenced by checkConfigParameters(), correlateLCTs(), CSCMotherboard(), dumpConfigParams(), and setConfigParameters().
const unsigned int CSCMotherboard::def_alct_trig_enable = 0 [static, private] |
Definition at line 111 of file CSCMotherboard.h.
Referenced by checkConfigParameters(), and CSCMotherboard().
const unsigned int CSCMotherboard::def_clct_trig_enable = 0 [private] |
Definition at line 111 of file CSCMotherboard.h.
Referenced by checkConfigParameters(), and CSCMotherboard().
const unsigned int CSCMotherboard::def_match_trig_enable = 1 [static, private] |
Definition at line 112 of file CSCMotherboard.h.
Referenced by checkConfigParameters(), and CSCMotherboard().
const unsigned int CSCMotherboard::def_match_trig_window_size = 7 [private] |
Definition at line 112 of file CSCMotherboard.h.
Referenced by checkConfigParameters(), and CSCMotherboard().
const unsigned int CSCMotherboard::def_mpc_block_me1a = 1 [static, private] |
Default values of configuration parameters.
Definition at line 110 of file CSCMotherboard.h.
Referenced by checkConfigParameters(), and CSCMotherboard().
const unsigned int CSCMotherboard::def_tmb_l1a_window_size = 7 [static, private] |
Definition at line 113 of file CSCMotherboard.h.
Referenced by checkConfigParameters(), and CSCMotherboard().
CSCCorrelatedLCTDigi CSCMotherboard::firstLCT[MAX_LCT_BINS] [private] |
Container for first correlated LCT.
Definition at line 119 of file CSCMotherboard.h.
Referenced by clear(), correlateLCTs(), getLCTs(), and run().
int CSCMotherboard::infoV [private] |
Verbosity level: 0: no print (default). 1: print LCTs found.
Definition at line 89 of file CSCMotherboard.h.
Referenced by checkConfigParameters(), correlateLCTs(), CSCMotherboard(), findQuality(), readoutLCTs(), and run().
bool CSCMotherboard::isMTCC [private] |
bool CSCMotherboard::isTMB07 [private] |
Flag for new (2007) version of TMB firmware.
Definition at line 102 of file CSCMotherboard.h.
Referenced by CSCMotherboard(), encodePattern(), and findQuality().
unsigned int CSCMotherboard::match_trig_enable [private] |
Definition at line 106 of file CSCMotherboard.h.
Referenced by checkConfigParameters(), correlateLCTs(), CSCMotherboard(), dumpConfigParams(), and setConfigParameters().
unsigned int CSCMotherboard::match_trig_window_size [private] |
Definition at line 107 of file CSCMotherboard.h.
Referenced by checkConfigParameters(), CSCMotherboard(), dumpConfigParams(), run(), and setConfigParameters().
unsigned int CSCMotherboard::mpc_block_me1a [private] |
Configuration parameters.
Definition at line 105 of file CSCMotherboard.h.
Referenced by checkConfigParameters(), CSCMotherboard(), dumpConfigParams(), getLCTs(), and setConfigParameters().
CSCCorrelatedLCTDigi CSCMotherboard::secondLCT[MAX_LCT_BINS] [private] |
Container for second correlated LCT.
Definition at line 122 of file CSCMotherboard.h.
Referenced by clear(), correlateLCTs(), getLCTs(), and run().
const unsigned CSCMotherboard::theEndcap [private] |
Chamber id (trigger-type labels).
Definition at line 92 of file CSCMotherboard.h.
const unsigned CSCMotherboard::theSector [private] |
Definition at line 94 of file CSCMotherboard.h.
const unsigned CSCMotherboard::theStation [private] |
Definition at line 93 of file CSCMotherboard.h.
Referenced by getLCTs().
const unsigned CSCMotherboard::theSubsector [private] |
Definition at line 95 of file CSCMotherboard.h.
const unsigned CSCMotherboard::theTrigChamber [private] |
Definition at line 96 of file CSCMotherboard.h.
Referenced by constructLCTs(), and getLCTs().
unsigned int CSCMotherboard::tmb_l1a_window_size [private] |
Definition at line 107 of file CSCMotherboard.h.
Referenced by checkConfigParameters(), CSCMotherboard(), dumpConfigParams(), readoutLCTs(), and setConfigParameters().