L1Trigger/CSCTriggerPrimitives/src/CSCMotherboard.cc
std::vector<CSCCorrelatedLCTDigi> CSCMotherboard::readoutLCTs() const {
  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;

  // Empirical correction to match 2009 collision data (firmware change?)
  int lct_bins   = tmb_l1a_window_size;
  int late_tbins = early_tbins + lct_bins;

  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 > CSCConstants::MAX_LCT_TBINS-1) {
      if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorSuspiciousParameters")
        << "+++ Allowed range of time bins, [0-" << late_tbins
        << "] exceeds max allowed, " << CSCConstants::MAX_LCT_TBINS-1 << " +++\n"
        << "+++ Set late_tbins to max allowed +++\n";
      late_tbins = CSCConstants::MAX_LCT_TBINS-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;
  const std::vector<CSCCorrelatedLCTDigi>& all_lcts = getLCTs();
  for (auto 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;
    }

    // If (readout_earliest_2) 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
    // currently there is room just for two.
    if (readout_earliest_2) {
      if (bx_readout == -1 || bx == bx_readout) {
        tmpV.push_back(*plct);
        if (bx_readout == -1) bx_readout = bx;
      }
    }
    // if readout_earliest_2 == false, save all LCTs
    else tmpV.push_back(*plct);
  }
  return tmpV;
}
// Returns vector of read-out correlated LCTs, if any.  Starts with
// the vector of all found LCTs and selects the ones in the read-out
// time window.
Returns vector of read-out correlated LCTs, if any.  Starts with
the vector of all found LCTs and selects the ones in the read-out
time window.
Returns vector of read - out correlated LCTs if any . Starts with the vector of all found LCTs and selects the ones in the read - out time window .
std::vector<CSCCorrelatedLCTDigi> CSCMotherboard::readoutLCTs() const {
  std::vector<CSCCorrelatedLCTDigi> tmpV;
  int lct_bins   = tmb_l1a_window_size;
  int late_tbins = early_tbins + lct_bins;
  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 > CSCConstants::MAX_LCT_TBINS-1) {
      if (infoV >= 0) edm::LogWarning("L1CSCTPEmulatorSuspiciousParameters")
        << "+++ Allowed range of time bins, [0-" << late_tbins
        << "] exceeds max allowed, " << CSCConstants::MAX_LCT_TBINS-1 << " +++\n"
        << "+++ Set late_tbins to max allowed +++\n";
      late_tbins = CSCConstants::MAX_LCT_TBINS-1;
    }
    ifois = 1;
  }
  int bx_readout = -1;
  const std::vector<CSCCorrelatedLCTDigi>& all_lcts = getLCTs();
  for (auto plct = all_lcts.begin(); plct != all_lcts.end(); plct++) {
    if (!plct->isValid()) continue;
    int bx = (*plct).getBX();
    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;
    }
    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;
    }
    if (readout_earliest_2) {
      if (bx_readout == -1 || bx == bx_readout) {
        tmpV.push_back(*plct);
        if (bx_readout == -1) bx_readout = bx;
      }
    }
    else tmpV.push_back(*plct);
  }
  return tmpV;
}
std :: vector < CSCCorrelatedLCTDigi > CSCMotherboard :: readoutLCTs ( ) const { std :: vector < CSCCorrelatedLCTDigi > tmpV ; int lct_bins = tmb_l1a_window_size ; int late_tbins = early_tbins + lct_bins ; int ifois = 0 ; if ( ifois == 0 ) { if ( infoV >= 0 && early_tbins < 0 ) { edm :: LogWarning ( " " ) << " " << early_tbins << " " << " \n " ; } if ( late_tbins > CSCConstants :: MAX_LCT_TBINS - 1 ) { if ( infoV >= 0 ) edm :: LogWarning ( " " ) << " " << late_tbins << " " << CSCConstants :: MAX_LCT_TBINS - 1 << " \n " << " \n " ; late_tbins = CSCConstants :: MAX_LCT_TBINS - 1 ; } ifois = 1 ; } int bx_readout = -1 ; const std :: vector < CSCCorrelatedLCTDigi > & all_lcts = getLCTs ( ) ; for ( auto plct = all_lcts . begin ( ) ; plct != all_lcts . end ( ) ; plct ++ ) { if ( ! plct -> isValid ( ) ) continue ; int bx = ( * plct ) . getBX ( ) ; if ( bx <= early_tbins ) { if ( infoV > 1 ) LogDebug ( " " ) << " " << plct -> getStrip ( ) << " " << plct -> getKeyWG ( ) << " " << bx << " " << early_tbins + 1 ; continue ; } if ( bx > late_tbins ) { if ( infoV > 1 ) LogDebug ( " " ) << " " << plct -> getStrip ( ) << " " << plct -> getKeyWG ( ) << " " << bx << " " << late_tbins ; continue ; } if ( readout_earliest_2 ) { if ( bx_readout == -1 || bx == bx_readout ) { tmpV . push_back ( * plct ) ; if ( bx_readout == -1 ) bx_readout = bx ; } } else tmpV . push_back ( * plct ) ; } return tmpV ; }
Returns vector of read-out correlated LCTs, if any.
Returns vector of read - out correlated LCTs if any .
// 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; // Empirical correction to match 2009 collision data (firmware change?) // Start from the vector of all found correlated LCTs and select // those within the LCT*L1A coincidence window. // Skip LCTs found too early relative to L1Accept. // Skip LCTs found too late relative to L1Accept. // If (readout_earliest_2) 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 // currently there is room just for two. // if readout_earliest_2 == false, save all LCTs