Skip to content

Commit

Permalink
Merge pull request #33686 from dildick/from-CMSSW_12_0_X_2021-05-10-1…
Browse files Browse the repository at this point in the history
…100-more-lct-quality-control

Improve quality control for CSC trigger primitives
  • Loading branch information
cmsbuild committed May 11, 2021
2 parents 8e51994 + cf7e6b1 commit 34a1a27
Show file tree
Hide file tree
Showing 4 changed files with 207 additions and 99 deletions.
20 changes: 20 additions & 0 deletions DataFormats/CSCDigi/interface/CSCConstants.h
Expand Up @@ -22,6 +22,15 @@ class CSCConstants {
NUM_CFEBS_ME11_UNGANGED = NUM_CFEBS_ME1A_UNGANGED + NUM_CFEBS_ME1B, // 7
// Run-2: Maximum number of cathode front-end boards
MAX_CFEBS_RUN2 = NUM_CFEBS_ME11_UNGANGED, // 7
// CFEBS for the rest of the system
NUM_CFEBS_ME12 = 5,
NUM_CFEBS_ME13 = 4,
NUM_CFEBS_ME21 = 5,
NUM_CFEBS_ME22 = 5,
NUM_CFEBS_ME31 = 5,
NUM_CFEBS_ME32 = 5,
NUM_CFEBS_ME41 = 5,
NUM_CFEBS_ME42 = 5
};

enum FPGA_Latency { CLCT_EMUL_TIME_OFFSET = 3, ALCT_EMUL_TIME_OFFSET = 6 };
Expand Down Expand Up @@ -70,10 +79,21 @@ class CSCConstants {
NUM_HALF_STRIPS_ME1A_GANGED = NUM_CFEBS_ME1A_GANGED * NUM_HALF_STRIPS_PER_CFEB, // 32
NUM_HALF_STRIPS_ME1A_UNGANGED = NUM_CFEBS_ME1A_UNGANGED * NUM_HALF_STRIPS_PER_CFEB, // 96
NUM_HALF_STRIPS_ME1B = NUM_CFEBS_ME1B * NUM_HALF_STRIPS_PER_CFEB, // 128
NUM_HALF_STRIPS_ME11_GANGED = NUM_CFEBS_ME11_GANGED * NUM_HALF_STRIPS_PER_CFEB, // 160
NUM_HALF_STRIPS_ME11_UNGANGED = NUM_CFEBS_ME11_UNGANGED * NUM_HALF_STRIPS_PER_CFEB, // 224
// max halfstrip number in ME1/1 chambers
MAX_HALF_STRIP_ME1A_GANGED = NUM_HALF_STRIPS_ME1A_GANGED - 1, // 31
MAX_HALF_STRIP_ME1A_UNGANGED = NUM_HALF_STRIPS_ME1A_UNGANGED - 1, // 95
MAX_HALF_STRIP_ME1B = NUM_HALF_STRIPS_ME1B - 1, // 127
// half-strips for the rest of the system
NUM_HALF_STRIPS_ME12 = NUM_CFEBS_ME12 * NUM_HALF_STRIPS_PER_CFEB, // 160
NUM_HALF_STRIPS_ME13 = NUM_CFEBS_ME13 * NUM_HALF_STRIPS_PER_CFEB, // 128
NUM_HALF_STRIPS_ME21 = NUM_CFEBS_ME21 * NUM_HALF_STRIPS_PER_CFEB, // 160
NUM_HALF_STRIPS_ME22 = NUM_CFEBS_ME22 * NUM_HALF_STRIPS_PER_CFEB, // 160
NUM_HALF_STRIPS_ME31 = NUM_CFEBS_ME31 * NUM_HALF_STRIPS_PER_CFEB, // 160
NUM_HALF_STRIPS_ME32 = NUM_CFEBS_ME32 * NUM_HALF_STRIPS_PER_CFEB, // 160
NUM_HALF_STRIPS_ME41 = NUM_CFEBS_ME41 * NUM_HALF_STRIPS_PER_CFEB, // 160
NUM_HALF_STRIPS_ME42 = NUM_CFEBS_ME42 * NUM_HALF_STRIPS_PER_CFEB, // 160
};

// CSCs have 6 layers. The key (reference) layer is the third layer
Expand Down
40 changes: 26 additions & 14 deletions L1Trigger/CSCTriggerPrimitives/interface/LCTQualityControl.h
Expand Up @@ -3,7 +3,9 @@

/** \class
*
* This class checks if ALCT, CLCT and LCT products are valid
* This class checks if ALCT, CLCT and LCT products are valid.
* It inherits from CSCBaseboard. Neither are physical boards at CMS
* But they are convenient classes in the trigger code.
*
* Author: Sven Dildick
*
Expand Down Expand Up @@ -56,28 +58,38 @@ class LCTQualityControl : public CSCBaseboard {
void checkMultiplicityBX(const std::vector<T>& lcts, unsigned nLCT) const;

// for Phase-1 patterns
int getSlopePhase1(int pattern) const;

// CSC max strip & max wire
unsigned get_csc_max_wire(int station, int ring) const;
unsigned get_csc_max_halfstrip(int station, int ring) const;
unsigned get_csc_max_quartstrip(int station, int ring) const;
unsigned get_csc_max_eighthstrip(int station, int ring) const;
int getSlopePhase1(unsigned pattern) const;

/*
CSC max strip & max wire
Need to pass station and ring, because we want to reuse the LCTQualityControl in the
MPC where the station and ring are considered arguments, not data members.
*/
unsigned get_csc_max_wiregroup(unsigned station, unsigned ring) const;
unsigned get_csc_max_halfstrip(unsigned station, unsigned ring) const;
unsigned get_csc_max_quartstrip(unsigned station, unsigned ring) const;
unsigned get_csc_max_eighthstrip(unsigned station, unsigned ring) const;

// slope values
std::pair<int, int> get_csc_clct_min_max_slope() const;

// CLCT min, max CFEB numbers
std::pair<unsigned, unsigned> get_csc_min_max_cfeb(int station, int ring) const;
std::pair<unsigned, unsigned> get_csc_min_max_cfeb() const;

// CSC min, max pattern
std::pair<unsigned, unsigned> get_csc_min_max_pattern(bool isRun3) const;
std::pair<unsigned, unsigned> get_csc_min_max_pattern() const;
std::pair<unsigned, unsigned> get_csc_min_max_pattern_run3() const;
std::pair<unsigned, unsigned> get_csc_lct_min_max_pattern() const;

// CSC max quality
unsigned get_csc_alct_max_quality(int station, int ring, bool runGEMCSC) const;
unsigned get_csc_clct_max_quality() const;
unsigned get_csc_lct_max_quality() const;
/*
CSC min, max quality
Need to pass station and ring for the LCT implementation, because we want to
reuse the LCTQualityControl in the MPC where the station and ring are considered
arguments, not data members.
*/
std::pair<unsigned, unsigned> get_csc_alct_min_max_quality() const;
std::pair<unsigned, unsigned> get_csc_clct_min_max_quality() const;
std::pair<unsigned, unsigned> get_csc_lct_min_max_quality(unsigned station, unsigned ring) const;

private:
// min number of layers for a CLCT
Expand Down
4 changes: 2 additions & 2 deletions L1Trigger/CSCTriggerPrimitives/src/CSCAnodeLCTProcessor.cc
Expand Up @@ -222,7 +222,7 @@ std::vector<CSCALCTDigi> CSCAnodeLCTProcessor::run(const CSCWireDigiCollection*
}
}

if (numWireGroups <= 0 or (unsigned) numWireGroups > qualityControl_->get_csc_max_wire(theStation, theRing)) {
if (numWireGroups <= 0 or (unsigned) numWireGroups > qualityControl_->get_csc_max_wiregroup(theStation, theRing)) {
edm::LogError("CSCAnodeLCTProcessor|SetupError")
<< "+++ " << theCSCName_ << " (sector " << theSector << " subsector " << theSubsector << " trig id. "
<< theTrigChamber << "):"
Expand Down Expand Up @@ -284,7 +284,7 @@ void CSCAnodeLCTProcessor::run(const std::vector<int> wire[CSCConstants::NUM_LAY
if (!chamber_empty) {
for (int i_wire = 0; i_wire < numWireGroups; i_wire++) {
// extra check to make sure only valid wires are processed
const unsigned max_wire = qualityControl_->get_csc_max_wire(theStation, theRing);
const unsigned max_wire = qualityControl_->get_csc_max_wiregroup(theStation, theRing);
if (unsigned(i_wire) >= max_wire)
continue;

Expand Down

0 comments on commit 34a1a27

Please sign in to comment.