CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
LCTQualityControl Class Reference

#include <LCTQualityControl.h>

Inheritance diagram for LCTQualityControl:
CSCBaseboard

Public Member Functions

void checkMultiplicityBX (const std::vector< CSCALCTDigi > &alcts) const
 
void checkMultiplicityBX (const std::vector< CSCCLCTDigi > &clcts) const
 
void checkMultiplicityBX (const std::vector< CSCCorrelatedLCTDigi > &lcts) const
 
template<class T >
void checkMultiplicityBX (const std::vector< T > &lcts, unsigned nLCT) const
 
void checkRange (int parameter, int min_value, int max_value, const std::string &comment, unsigned &errors) const
 
void checkValid (const CSCALCTDigi &alct, unsigned max_stubs=CSCConstants::MAX_ALCTS_PER_PROCESSOR) const
 
void checkValid (const CSCCLCTDigi &lct, unsigned max_stubs=CSCConstants::MAX_CLCTS_PER_PROCESSOR) const
 
void checkValid (const CSCCorrelatedLCTDigi &lct) const
 
void checkValid (const CSCCorrelatedLCTDigi &lct, const unsigned station, const unsigned ring) const
 
void checkValidReadout (const CSCALCTDigi &alct) const
 
std::pair< unsigned, unsigned > get_csc_alct_min_max_quality () const
 
std::pair< unsigned, unsigned > get_csc_clct_min_max_quality () const
 
std::pair< int, int > get_csc_clct_min_max_slope () const
 
std::pair< unsigned, unsigned > get_csc_lct_min_max_pattern () const
 
std::pair< unsigned, unsigned > get_csc_lct_min_max_quality (unsigned station, unsigned ring) const
 
unsigned get_csc_max_eighthstrip (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_wiregroup (unsigned station, unsigned ring) const
 
std::pair< unsigned, unsigned > get_csc_min_max_cfeb () const
 
std::pair< unsigned, unsigned > get_csc_min_max_pattern () const
 
std::pair< unsigned, unsigned > get_csc_min_max_pattern_run3 () const
 
int getSlopePhase1 (unsigned pattern) const
 
 LCTQualityControl (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
template<class T >
void reportErrors (const T &lct, const unsigned errors) const
 
 ~LCTQualityControl () override=default
 
- Public Member Functions inherited from CSCBaseboard
 CSCBaseboard (unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
 
 CSCBaseboard ()
 
std::string getCSCName () const
 
CSCDetId id () const
 
void setCSCGeometry (const CSCGeometry *g)
 
virtual ~CSCBaseboard ()=default
 

Private Attributes

unsigned nplanes_clct_hit_pattern
 

Additional Inherited Members

- Protected Member Functions inherited from CSCBaseboard
void checkConfigParameters (unsigned int &var, const unsigned int var_max, const unsigned int var_def, const std::string &var_str)
 
- Protected Attributes inherited from CSCBaseboard
edm::ParameterSet alctParams_
 
edm::ParameterSet clctParams_
 
edm::ParameterSet commonParams_
 
const CSCChambercscChamber_
 
const CSCGeometrycscGeometry_
 
CSCDetId cscId_
 
bool disableME1a_
 
bool enableAlctPhase2_
 
bool gangedME1a_
 
int infoV
 
bool isME11_
 
bool isME12_
 
bool isME13_
 
bool isME21_
 
bool isME22_
 
bool isME31_
 
bool isME32_
 
bool isME41_
 
bool isME42_
 
bool runCCLUT_
 
bool runCCLUT_OTMB_
 
bool runCCLUT_TMB_
 
bool runME11ILT_
 
bool runME11Up_
 
bool runME21ILT_
 
bool runME21Up_
 
bool runME31Up_
 
bool runME41Up_
 
bool runPhase2_
 
edm::ParameterSet showerParams_
 
unsigned theChamber
 
std::string theCSCName_
 
const unsigned theEndcap
 
int theRegion
 
unsigned theRing
 
const unsigned theSector
 
const unsigned theStation
 
const unsigned theSubsector
 
const unsigned theTrigChamber
 
edm::ParameterSet tmbParams_
 

Detailed Description

Definition at line 22 of file LCTQualityControl.h.

Constructor & Destructor Documentation

LCTQualityControl::LCTQualityControl ( unsigned  endcap,
unsigned  station,
unsigned  sector,
unsigned  subsector,
unsigned  chamber,
const edm::ParameterSet conf 
)

Definition at line 6 of file LCTQualityControl.cc.

References CSCBaseboard::clctParams_, edm::ParameterSet::getParameter(), and nplanes_clct_hit_pattern.

12  : CSCBaseboard(endcap, station, sector, subsector, chamber, conf) {
13  nplanes_clct_hit_pattern = clctParams_.getParameter<unsigned int>("clctNplanesHitPattern");
14 }
unsigned nplanes_clct_hit_pattern
edm::ParameterSet clctParams_
Definition: CSCBaseboard.h:84
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
LCTQualityControl::~LCTQualityControl ( )
overridedefault

Default destructor.

Member Function Documentation

void LCTQualityControl::checkMultiplicityBX ( const std::vector< CSCALCTDigi > &  alcts) const

Definition at line 284 of file LCTQualityControl.cc.

References CSCConstants::MAX_ALCTS_READOUT.

Referenced by checkMultiplicityBX().

void LCTQualityControl::checkMultiplicityBX ( const std::vector< CSCCLCTDigi > &  clcts) const
void LCTQualityControl::checkMultiplicityBX ( const std::vector< CSCCorrelatedLCTDigi > &  lcts) const
template<class T >
void LCTQualityControl::checkMultiplicityBX ( const std::vector< T > &  lcts,
unsigned  nLCT 
) const

Definition at line 100 of file LCTQualityControl.h.

References AlCaHLTBitMon_ParallelJobs::p.

100  {
101  std::unordered_map<int, unsigned> freq;
102  // check each BX
103  for (const auto& p : collection) {
104  if (p.isValid()) {
105  freq[p.getBX()]++;
106 
107  // too many ALCTs, CLCTs or LCTs in this BX
108  if (freq[p.getBX()] > nLCT) {
109  edm::LogError("LCTQualityControl") << "Collection with more than " << nLCT << " in BX " << p.getBX();
110  break;
111  }
112  }
113  }
114 }
Log< level::Error, false > LogError
void LCTQualityControl::checkRange ( int  parameter,
int  min_value,
int  max_value,
const std::string &  comment,
unsigned &  errors 
) const

Definition at line 21 of file LCTQualityControl.cc.

Referenced by checkValid().

22  {
23  if (value < min_value or value > max_value) {
24  edm::LogError("LCTQualityControl") << comment << value << "; allowed [" << min_value << ", " << max_value << "]";
25  errors++;
26  }
27 }
Log< level::Error, false > LogError
const std::map< ValueQuantityType, double > min_value
const std::map< ValueQuantityType, double > max_value
void LCTQualityControl::checkValid ( const CSCALCTDigi alct,
unsigned  max_stubs = CSCConstants::MAX_ALCTS_PER_PROCESSOR 
) const

Definition at line 37 of file LCTQualityControl.cc.

References checkRange(), get_csc_alct_min_max_quality(), get_csc_max_wiregroup(), CSCALCTDigi::getBX(), CSCALCTDigi::getCollisionB(), CSCALCTDigi::getKeyWG(), CSCALCTDigi::getQuality(), CSCALCTDigi::getTrknmb(), CSCALCTDigi::isValid(), CSCConstants::MAX_ALCT_TBINS, reportErrors(), CSCBaseboard::theRing, and CSCBaseboard::theStation.

Referenced by checkValid(), and checkValidReadout().

37  {
38  const unsigned max_wiregroup = get_csc_max_wiregroup(theStation, theRing);
39  const auto& [min_quality, max_quality] = get_csc_alct_min_max_quality();
40 
41  unsigned errors = 0;
42 
43  // stub must be valid
44  checkRange(alct.isValid(), 1, 1, "CSCALCTDigi with invalid bit set: ", errors);
45 
46  // ALCT number is 1 or 2
47  checkRange(alct.getTrknmb(), 1, max_stubs, "CSCALCTDigi with invalid track number: ", errors);
48 
49  // ALCT quality must be valid
50  // number of layers - 3
51  checkRange(alct.getQuality(), min_quality, max_quality, "CSCALCTDigi with invalid quality: ", errors);
52 
53  // ALCT key wire-group must be within bounds
54  checkRange(alct.getKeyWG(), 0, max_wiregroup - 1, "CSCALCTDigi with invalid wire-group: ", errors);
55 
56  // ALCT with out-of-time BX
57  checkRange(alct.getBX(), 0, CSCConstants::MAX_ALCT_TBINS - 1, "CSCALCTDigi with invalid BX: ", errors);
58 
59  // ALCT is neither accelerator or collision
60  checkRange(alct.getCollisionB(), 0, 1, "CSCALCTDigi with invalid accel/coll biit: ", errors);
61 
62  reportErrors(alct, errors);
63 }
uint16_t getCollisionB() const
Definition: CSCALCTDigi.h:61
uint16_t getQuality() const
return quality of a pattern
Definition: CSCALCTDigi.h:46
unsigned get_csc_max_wiregroup(unsigned station, unsigned ring) const
bool isValid() const
check ALCT validity (1 - valid ALCT)
Definition: CSCALCTDigi.h:40
uint16_t getBX() const
return BX - five low bits of BXN counter tagged by the ALCT
Definition: CSCALCTDigi.h:73
void reportErrors(const T &lct, const unsigned errors) const
void checkRange(int parameter, int min_value, int max_value, const std::string &comment, unsigned &errors) const
uint16_t getTrknmb() const
return track number (1,2)
Definition: CSCALCTDigi.h:79
std::pair< unsigned, unsigned > get_csc_alct_min_max_quality() const
uint16_t getKeyWG() const
return key wire group
Definition: CSCALCTDigi.h:67
const unsigned theStation
Definition: CSCBaseboard.h:43
unsigned theRing
Definition: CSCBaseboard.h:48
void LCTQualityControl::checkValid ( const CSCCLCTDigi lct,
unsigned  max_stubs = CSCConstants::MAX_CLCTS_PER_PROCESSOR 
) const

Definition at line 66 of file LCTQualityControl.cc.

References checkRange(), get_csc_clct_min_max_quality(), get_csc_clct_min_max_slope(), get_csc_max_eighthstrip(), get_csc_max_halfstrip(), get_csc_max_quartstrip(), get_csc_min_max_cfeb(), get_csc_min_max_pattern(), get_csc_min_max_pattern_run3(), CSCCLCTDigi::getBend(), CSCCLCTDigi::getBX(), CSCCLCTDigi::getCFEB(), CSCCLCTDigi::getCompCode(), CSCCLCTDigi::getKeyStrip(), CSCCLCTDigi::getPattern(), CSCCLCTDigi::getQuality(), CSCCLCTDigi::getRun3Pattern(), CSCCLCTDigi::getSlope(), CSCCLCTDigi::getStrip(), CSCCLCTDigi::getTrknmb(), CSCCLCTDigi::isValid(), CSCConstants::MAX_CLCT_TBINS, CSCConstants::NUM_HALF_STRIPS_PER_CFEB, funct::pow(), reportErrors(), CSCBaseboard::runCCLUT_, CSCBaseboard::theRing, and CSCBaseboard::theStation.

66  {
67  const unsigned max_strip = get_csc_max_halfstrip(theStation, theRing);
68  const auto& [min_pattern_run2, max_pattern_run2] = get_csc_min_max_pattern();
69  const auto& [min_pattern_run3, max_pattern_run3] = get_csc_min_max_pattern_run3();
70  const auto& [min_slope, max_slope] = get_csc_clct_min_max_slope();
71  const auto& [min_cfeb, max_cfeb] = get_csc_min_max_cfeb();
72  const auto& [min_quality, max_quality] = get_csc_clct_min_max_quality();
73 
74  unsigned errors = 0;
75 
76  // CLCT must be valid
77  checkRange(clct.isValid(), 1, 1, "CSCCLCTDigi with invalid bit set: ", errors);
78 
79  // CLCT number is 1 or max
80  checkRange(clct.getTrknmb(), 1, max_stubs, "CSCCLCTDigi with invalid track number: ", errors);
81 
82  // CLCT quality must be valid
83  // CLCTs require at least 4 layers hit
84  // Run-3: ME1/1 CLCTs require only 3 layers
85  // Run-4: ME2/1 CLCTs require only 3 layers
86  checkRange(clct.getQuality(), min_quality, max_quality, "CSCCLCTDigi with invalid quality: ", errors);
87 
88  // CLCT half-strip must be within bounds
89  checkRange(
90  clct.getStrip(), 0, CSCConstants::NUM_HALF_STRIPS_PER_CFEB - 1, "CSCCLCTDigi with invalid half-strip: ", errors);
91 
92  // CLCT key half-strip must be within bounds
93  checkRange(clct.getKeyStrip(), 0, max_strip - 1, "CSCCLCTDigi with invalid key half-strip: ", errors);
94 
95  // CLCT with out-of-time BX
96  checkRange(clct.getBX(), 0, CSCConstants::MAX_CLCT_TBINS - 1, "CSCCLCTDigi with invalid BX: ", errors);
97 
98  // CLCT with neither left nor right bending
99  checkRange(clct.getBend(), 0, 1, "CSCCLCTDigi with invalid bending: ", errors);
100 
101  // CLCT with an invalid pattern ID
102  checkRange(
103  clct.getPattern(), min_pattern_run2, max_pattern_run2, "CSCCLCTDigi with invalid Run-2 pattern ID: ", errors);
104 
105  // CLCT with an invalid pattern ID
106  checkRange(
107  clct.getRun3Pattern(), min_pattern_run3, max_pattern_run3, "CSCCLCTDigi with invalid Run-3 pattern ID: ", errors);
108 
109  // CLCT with an invalid slope
110  checkRange(clct.getSlope(), min_slope, max_slope, "CSCCLCTDigi with invalid slope: ", errors);
111 
112  // CLCT with an invalid CFEB ID
113  checkRange(clct.getCFEB(), min_cfeb, max_cfeb, "CSCCLCTDigi with invalid CFEB ID: ", errors);
114 
115  if (runCCLUT_) {
116  // CLCT comparator code is invalid
117  checkRange(clct.getCompCode(), 0, std::pow(2, 12) - 1, "CSCCLCTDigi with invalid comparator code: ", errors);
118 
119  const unsigned max_quartstrip = get_csc_max_quartstrip(theStation, theRing);
120  const unsigned max_eighthstrip = get_csc_max_eighthstrip(theStation, theRing);
121 
122  // CLCT key quart-strip must be within bounds
123  checkRange(clct.getKeyStrip(4), 0, max_quartstrip - 1, "CSCCLCTDigi with invalid key quart-strip: ", errors);
124 
125  // CLCT key eighth-strip must be within bounds
126  checkRange(clct.getKeyStrip(8), 0, max_eighthstrip - 1, "CSCCLCTDigi with invalid key quart-strip: ", errors);
127  }
128 
129  reportErrors(clct, errors);
130 }
std::pair< unsigned, unsigned > get_csc_clct_min_max_quality() const
std::pair< int, int > get_csc_clct_min_max_slope() const
std::pair< unsigned, unsigned > get_csc_min_max_cfeb() const
std::pair< unsigned, unsigned > get_csc_min_max_pattern() const
void reportErrors(const T &lct, const unsigned errors) const
unsigned get_csc_max_halfstrip(unsigned station, unsigned ring) const
void checkRange(int parameter, int min_value, int max_value, const std::string &comment, unsigned &errors) const
unsigned get_csc_max_quartstrip(unsigned station, unsigned ring) const
unsigned get_csc_max_eighthstrip(unsigned station, unsigned ring) const
std::pair< unsigned, unsigned > get_csc_min_max_pattern_run3() const
const unsigned theStation
Definition: CSCBaseboard.h:43
unsigned theRing
Definition: CSCBaseboard.h:48
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
void LCTQualityControl::checkValid ( const CSCCorrelatedLCTDigi lct) const

Definition at line 132 of file LCTQualityControl.cc.

References checkValid(), CSCBaseboard::theRing, and CSCBaseboard::theStation.

132 { checkValid(lct, theStation, theRing); }
const unsigned theStation
Definition: CSCBaseboard.h:43
void checkValid(const CSCALCTDigi &alct, unsigned max_stubs=CSCConstants::MAX_ALCTS_PER_PROCESSOR) const
unsigned theRing
Definition: CSCBaseboard.h:48
void LCTQualityControl::checkValid ( const CSCCorrelatedLCTDigi lct,
const unsigned  station,
const unsigned  ring 
) const

Definition at line 134 of file LCTQualityControl.cc.

References CSCCorrelatedLCTDigi::ALCT2GEM, LCTQualityAssignment::ALCT_2GEM, LCTQualityAssignment::ALCT_CLCT, LCTQualityAssignment::ALCT_CLCT_1GEM_CSCBend, LCTQualityAssignment::ALCT_CLCT_1GEM_GEMCSCBend, LCTQualityAssignment::ALCT_CLCT_2GEM_CSCBend, LCTQualityAssignment::ALCT_CLCT_2GEM_GEMCSCBend, CSCCorrelatedLCTDigi::ALCTCLCT, CSCCorrelatedLCTDigi::ALCTCLCT2GEM, CSCCorrelatedLCTDigi::ALCTCLCTGEM, CSCCorrelatedLCTDigi::ALCTONLY, checkRange(), CSCCorrelatedLCTDigi::CLCT2GEM, LCTQualityAssignment::CLCT_2GEM, CSCCorrelatedLCTDigi::CLCTALCT, CSCCorrelatedLCTDigi::CLCTONLY, get_csc_lct_min_max_quality(), get_csc_max_eighthstrip(), get_csc_max_halfstrip(), get_csc_max_quartstrip(), get_csc_max_wiregroup(), get_csc_min_max_pattern(), get_csc_min_max_pattern_run3(), CSCCorrelatedLCTDigi::getBend(), CSCCorrelatedLCTDigi::getBX(), CSCCorrelatedLCTDigi::getCSCID(), CSCCorrelatedLCTDigi::getGEM1(), CSCCorrelatedLCTDigi::getGEM2(), CSCCorrelatedLCTDigi::getKeyWG(), CSCCorrelatedLCTDigi::getMPCLink(), CSCCorrelatedLCTDigi::getPattern(), CSCCorrelatedLCTDigi::getQuality(), CSCCorrelatedLCTDigi::getRun3Pattern(), CSCCorrelatedLCTDigi::getStrip(), CSCCorrelatedLCTDigi::getTrknmb(), CSCCorrelatedLCTDigi::getType(), LCTQualityAssignment::HighQ, CSCBaseboard::isME11_, CSCBaseboard::isME21_, GEMPadDigi::isValid(), CSCCorrelatedLCTDigi::isValid(), LCTQualityAssignment::LowQ, CSCConstants::MAX_LCT_TBINS, CSCConstants::MAX_LCTS_PER_MPC, CSCTriggerNumbering::maxTriggerCscId(), LCTQualityAssignment::MedQ, CSCTriggerNumbering::minTriggerCscId(), or, reportErrors(), CSCBaseboard::runCCLUT_, CSCBaseboard::runME11ILT_, and CSCBaseboard::runME21ILT_.

134  {
135  const unsigned max_strip = get_csc_max_halfstrip(station, ring);
136  const unsigned max_quartstrip = get_csc_max_quartstrip(station, ring);
137  const unsigned max_eighthstrip = get_csc_max_eighthstrip(station, ring);
138  const unsigned max_wiregroup = get_csc_max_wiregroup(station, ring);
139  const auto& [min_pattern_run2, max_pattern_run2] = get_csc_min_max_pattern();
140  const auto& [min_pattern_run3, max_pattern_run3] = get_csc_min_max_pattern_run3();
141  const auto& [min_quality, max_quality] = get_csc_lct_min_max_quality(station, ring);
142 
143  unsigned errors = 0;
144 
145  // LCT must be valid
146  checkRange(lct.isValid(), 1, 1, "CSCCorrelatedLCTDigi with invalid bit set: ", errors);
147 
148  // LCT number is 1 or 2
149  checkRange(lct.getTrknmb(), 1, 2, "CSCCorrelatedLCTDigi with invalid track number: ", errors);
150 
151  // LCT quality must be valid
152  checkRange(lct.getQuality(), min_quality, max_quality, "CSCCorrelatedLCTDigi with invalid quality: ", errors);
153 
154  // LCT key half-strip must be within bounds
155  checkRange(lct.getStrip(), 0, max_strip - 1, "CSCCorrelatedLCTDigi with invalid key half-strip: ", errors);
156 
157  // LCT key quart-strip must be within bounds
158  checkRange(lct.getStrip(4), 0, max_quartstrip - 1, "CSCCorrelatedLCTDigi with invalid key quart-strip: ", errors);
159 
160  // LCT key eighth-strip must be within bounds
161  checkRange(lct.getStrip(8), 0, max_eighthstrip - 1, "CSCCorrelatedLCTDigi with invalid key eighth-strip: ", errors);
162 
163  // LCT key wire-group must be within bounds
164  checkRange(lct.getKeyWG(), 0, max_wiregroup - 1, "CSCCorrelatedLCTDigi with invalid wire-group: ", errors);
165 
166  // LCT with out-of-time BX
167  checkRange(lct.getBX(), 0, CSCConstants::MAX_LCT_TBINS - 1, "CSCCorrelatedLCTDigi with invalid BX: ", errors);
168 
169  // LCT with neither left nor right bending
170  checkRange(lct.getBend(), 0, 1, "CSCCorrelatedLCTDigi with invalid bending: ", errors);
171 
172  // LCT with invalid MPC link
173  checkRange(lct.getMPCLink(), 0, CSCConstants::MAX_LCTS_PER_MPC, "CSCCorrelatedLCTDigi with MPC link: ", errors);
174 
175  // LCT with invalid CSCID
176  checkRange(lct.getCSCID(),
179  "CSCCorrelatedLCTDigi with invalid CSCID: ",
180  errors);
181 
182  // LCT with an invalid pattern ID
183  checkRange(lct.getPattern(),
184  min_pattern_run2,
185  max_pattern_run2,
186  "CSCCorrelatedLCTDigi with invalid Run-2 pattern ID: ",
187  errors);
188 
190  min_pattern_run3,
191  max_pattern_run3,
192  "CSCCorrelatedLCTDigi with invalid Run-3 pattern ID: ",
193  errors);
194 
195  // simulated LCT type must be valid
198  edm::LogError("LCTQualityControl") << "CSCCorrelatedLCTDigi with invalid type (SIM): " << lct.getType()
199  << "; allowed [" << CSCCorrelatedLCTDigi::ALCTCLCT << ", "
201  errors++;
202  }
203 
204  // non-GEM-CSC stations ALWAYS send out ALCTCLCT type LCTs
205  if (!isME11_ and !isME21_) {
207  edm::LogError("LCTQualityControl") << "CSCCorrelatedLCTDigi with invalid type (SIM) in this station: "
208  << lct.getType() << "; allowed [" << CSCCorrelatedLCTDigi::ALCTCLCT << "]";
209  errors++;
210  }
211  }
212 
213  // GEM-CSC stations can send out GEM-type LCTs ONLY when the ILT is turned on!
214  if ((isME11_ and !runME11ILT_) or (isME21_ and !runME21ILT_)) {
216  edm::LogError("LCTQualityControl") << "CSCCorrelatedLCTDigi with invalid type (SIM) with GEM-CSC trigger not on: "
217  << lct.getType() << "; allowed [" << CSCCorrelatedLCTDigi::ALCTCLCT << "]";
218  errors++;
219  }
220  }
221 
222  // GEM-CSC types must have at least one valid GEM hit
225  !lct.getGEM1().isValid() and !lct.getGEM2().isValid()) {
226  edm::LogError("LCTQualityControl") << "CSCCorrelatedLCTDigi with valid GEM-CSC type (SIM) has no valid GEM hits: "
227  << lct.getType();
228  errors++;
229  }
230 
231  // LCT type does not agree with the LCT quality when CCLUT is on
232  if (runCCLUT_) {
233  const bool ME11ILT(isME11_ and runME11ILT_);
234  const bool ME21ILT(isME21_ and runME21ILT_);
235 
236  // GEM-CSC cases
237  if (ME11ILT or ME21ILT) {
238  const bool case1(lct.getType() == CSCCorrelatedLCTDigi::ALCT2GEM and
239  lct.getQuality() == static_cast<unsigned>(LCTQualityAssignment::LCT_QualityRun3GEM::ALCT_2GEM));
240  const bool case2(lct.getType() == CSCCorrelatedLCTDigi::CLCT2GEM and
241  lct.getQuality() == static_cast<unsigned>(LCTQualityAssignment::LCT_QualityRun3GEM::CLCT_2GEM));
242  const bool case3(lct.getType() == CSCCorrelatedLCTDigi::ALCTCLCTGEM and
243  lct.getQuality() ==
245  const bool case4(lct.getType() == CSCCorrelatedLCTDigi::ALCTCLCTGEM and
246  lct.getQuality() ==
248  const bool case5(lct.getType() == CSCCorrelatedLCTDigi::ALCTCLCT2GEM and
249  lct.getQuality() ==
251  const bool case6(lct.getType() == CSCCorrelatedLCTDigi::ALCTCLCT2GEM and
252  lct.getQuality() ==
254  const bool case7(lct.getType() == CSCCorrelatedLCTDigi::ALCTCLCT and
255  lct.getQuality() == static_cast<unsigned>(LCTQualityAssignment::LCT_QualityRun3GEM::ALCT_CLCT));
256 
257  if (!(case1 or case2 or case3 or case4 or case5 or case6 or case7)) {
258  edm::LogError("LCTQualityControl")
259  << "CSCCorrelatedLCTDigi with valid GEM-CSC type (SIM) has no matching Run-3 quality: " << lct.getType()
260  << " " << lct.getQuality();
261  errors++;
262  }
263  }
264 
265  // regular cases
266  else {
267  const bool case1(lct.getType() == CSCCorrelatedLCTDigi::ALCTCLCT and
268  lct.getQuality() == static_cast<unsigned>(LCTQualityAssignment::LCT_QualityRun3::LowQ));
269  const bool case2(lct.getType() == CSCCorrelatedLCTDigi::ALCTCLCT and
270  lct.getQuality() == static_cast<unsigned>(LCTQualityAssignment::LCT_QualityRun3::MedQ));
271  const bool case3(lct.getType() == CSCCorrelatedLCTDigi::ALCTCLCT and
272  lct.getQuality() == static_cast<unsigned>(LCTQualityAssignment::LCT_QualityRun3::HighQ));
273  if (!(case1 or case2 or case3)) {
274  edm::LogError("LCTQualityControl")
275  << "CSCCorrelatedLCTDigi with invalid CSC type (SIM) has no matching Run-3 quality: " << lct.getType()
276  << " " << lct.getQuality();
277  errors++;
278  }
279  }
280  }
281  reportErrors(lct, errors);
282 }
bool isValid() const
Definition: GEMPadDigi.cc:26
uint16_t getBend() const
unsigned get_csc_max_wiregroup(unsigned station, unsigned ring) const
uint16_t getBX() const
return BX
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
const GEMPadDigi & getGEM1() const
uint16_t getPattern() const
return the Run-2 pattern ID
Log< level::Error, false > LogError
std::pair< unsigned, unsigned > get_csc_min_max_pattern() const
uint16_t getMPCLink() const
return MPC link number, 0 means not sorted, 1-3 give MPC sorting rank
void reportErrors(const T &lct, const unsigned errors) const
unsigned get_csc_max_halfstrip(unsigned station, unsigned ring) const
uint16_t getKeyWG() const
return the key wire group. counts from 0.
void checkRange(int parameter, int min_value, int max_value, const std::string &comment, unsigned &errors) const
uint16_t getCSCID() const
std::pair< unsigned, unsigned > get_csc_lct_min_max_quality(unsigned station, unsigned ring) const
unsigned get_csc_max_quartstrip(unsigned station, unsigned ring) const
uint16_t getTrknmb() const
return track number
unsigned get_csc_max_eighthstrip(unsigned station, unsigned ring) const
std::pair< unsigned, unsigned > get_csc_min_max_pattern_run3() const
uint16_t getStrip(uint16_t n=2) const
return the key halfstrip from 0,159
uint16_t getRun3Pattern() const
return the Run-3 pattern ID
const GEMPadDigi & getGEM2() const
uint16_t getQuality() const
return the Quality
bool isValid() const
return valid pattern bit
void LCTQualityControl::checkValidReadout ( const CSCALCTDigi alct) const

Definition at line 17 of file LCTQualityControl.cc.

References checkValid(), and CSCConstants::MAX_ALCTS_READOUT.

17  {
19 }
void checkValid(const CSCALCTDigi &alct, unsigned max_stubs=CSCConstants::MAX_ALCTS_PER_PROCESSOR) const
std::pair< unsigned, unsigned > LCTQualityControl::get_csc_alct_min_max_quality ( ) const

Definition at line 463 of file LCTQualityControl.cc.

References CSCBaseboard::isME21_, and CSCBaseboard::runME21ILT_.

Referenced by checkValid().

463  {
464  // quality is number of layers - 3
465  // at least 4 layers for CSC-only trigger
466  unsigned min_quality = 1;
467  if (isME21_ and runME21ILT_) {
468  // at least 3 layers for GEM-CSC trigger in ME2/1
469  min_quality = 0;
470  }
471  return std::make_pair(min_quality, 3);
472 }
std::pair< unsigned, unsigned > LCTQualityControl::get_csc_clct_min_max_quality ( ) const

Definition at line 474 of file LCTQualityControl.cc.

References CSCBaseboard::isME11_, CSCBaseboard::isME21_, or, CSCBaseboard::runME11ILT_, and CSCBaseboard::runME21ILT_.

Referenced by checkValid().

474  {
475  // quality is number of layers
476  unsigned min_quality = 4;
477  if ((runME11ILT_ and isME11_) or (runME21ILT_ and isME21_)) {
478  // at least 3 layers for GEM-CSC trigger in ME1/1 or ME2/1
479  min_quality = 3;
480  }
481  return std::make_pair(min_quality, 6);
482 }
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
std::pair< int, int > LCTQualityControl::get_csc_clct_min_max_slope ( ) const

Definition at line 303 of file LCTQualityControl.cc.

References CSCBaseboard::runCCLUT_.

Referenced by checkValid().

303  {
304  int min_slope, max_slope;
305  // Run-3 case with CCLUT
306  // 5-bit number (includes the L/R bending)
307  if (runCCLUT_) {
308  min_slope = 0;
309  max_slope = 15;
310  }
311  // Run-1 or Run-2 case
312  // Run-3 case without CCLUT
313  else {
314  min_slope = -10;
315  max_slope = 10;
316  }
317 
318  return std::make_pair(min_slope, max_slope);
319 }
std::pair< unsigned, unsigned > LCTQualityControl::get_csc_lct_min_max_pattern ( ) const

Definition at line 448 of file LCTQualityControl.cc.

References CSCBaseboard::runCCLUT_.

448  {
449  unsigned min_pattern, max_pattern;
450  // Run-1 or Run-2 case
451  if (!runCCLUT_) {
452  min_pattern = 2;
453  max_pattern = 10;
454  }
455  // Run-3 case: pattern Id is interpreted as the slope!
456  else {
457  min_pattern = 0;
458  max_pattern = 15;
459  }
460  return std::make_pair(min_pattern, max_pattern);
461 }
std::pair< unsigned, unsigned > LCTQualityControl::get_csc_lct_min_max_quality ( unsigned  station,
unsigned  ring 
) const

Definition at line 484 of file LCTQualityControl.cc.

References LCTQualityAssignment::ALCT_2GEM, LCTQualityAssignment::ALCT_CLCT_2GEM_GEMCSCBend, LCTQualityAssignment::HighQ, LCTQualityAssignment::HQ_ANODE_MARGINAL_CATHODE, LCTQualityAssignment::HQ_PATTERN_10, LCTQualityAssignment::HQ_PATTERN_2_3, CSCBaseboard::isME11_, CSCBaseboard::isME21_, LCTQualityAssignment::LowQ, or, CSCBaseboard::runCCLUT_, CSCBaseboard::runME11ILT_, and CSCBaseboard::runME21ILT_.

Referenced by checkValid().

484  {
485  // Run-1 or Run-2
486  unsigned min_quality = static_cast<unsigned>(LCTQualityAssignment::LCT_QualityRun2::HQ_PATTERN_2_3);
487  unsigned max_quality = static_cast<unsigned>(LCTQualityAssignment::LCT_QualityRun2::HQ_PATTERN_10);
488 
489  const bool GEMCSC = (isME11_ and runME11ILT_) or (isME21_ and runME21ILT_);
490 
491  // Run-3 with CCLUT on
492  if (runCCLUT_ and !GEMCSC) {
493  min_quality = static_cast<unsigned>(LCTQualityAssignment::LCT_QualityRun3::LowQ);
494  max_quality = static_cast<unsigned>(LCTQualityAssignment::LCT_QualityRun3::HighQ);
495  }
496 
497  // Run-3 with GEM-CSC on (low-quality CLCTs are permitted, but use Run-2 data format)
498  if (!runCCLUT_ and GEMCSC) {
499  min_quality = static_cast<unsigned>(LCTQualityAssignment::LCT_QualityRun2::HQ_ANODE_MARGINAL_CATHODE);
500  max_quality = static_cast<unsigned>(LCTQualityAssignment::LCT_QualityRun2::HQ_PATTERN_10);
501  }
502 
503  // Run-3 CSC with GEM-CSC on and CCLUT on
504  if (runCCLUT_ and GEMCSC) {
505  min_quality = static_cast<unsigned>(LCTQualityAssignment::LCT_QualityRun3GEM::ALCT_2GEM);
506  max_quality = static_cast<unsigned>(LCTQualityAssignment::LCT_QualityRun3GEM::ALCT_CLCT_2GEM_GEMCSCBend);
507  }
508  return std::make_pair(min_quality, max_quality);
509 }
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
unsigned LCTQualityControl::get_csc_max_eighthstrip ( unsigned  station,
unsigned  ring 
) const

Definition at line 398 of file LCTQualityControl.cc.

References get_csc_max_halfstrip().

Referenced by checkValid().

398  {
399  return get_csc_max_halfstrip(station, ring) * 4;
400 }
unsigned get_csc_max_halfstrip(unsigned station, unsigned ring) const
unsigned LCTQualityControl::get_csc_max_halfstrip ( unsigned  station,
unsigned  ring 
) const

Definition at line 355 of file LCTQualityControl.cc.

References CSCBaseboard::gangedME1a_, CSCConstants::NUM_HALF_STRIPS_ME11_GANGED, CSCConstants::NUM_HALF_STRIPS_ME11_UNGANGED, CSCConstants::NUM_HALF_STRIPS_ME12, CSCConstants::NUM_HALF_STRIPS_ME13, CSCConstants::NUM_HALF_STRIPS_ME1A_GANGED, CSCConstants::NUM_HALF_STRIPS_ME1A_UNGANGED, CSCConstants::NUM_HALF_STRIPS_ME21, CSCConstants::NUM_HALF_STRIPS_ME22, and CSCConstants::NUM_HALF_STRIPS_ME31.

Referenced by checkValid(), get_csc_max_eighthstrip(), and get_csc_max_quartstrip().

355  {
356  unsigned max_half_strip = 0;
357  // ME1/1a
358  if (station == 1 && ring == 4 and gangedME1a_) {
360  } else if (station == 1 && ring == 4 and !gangedME1a_) {
362  }
363  // ME1/1b
364  // In the CSC local trigger
365  // ME1/a is taken together with ME1/b
366  else if (station == 1 && ring == 1 and gangedME1a_) {
368  } else if (station == 1 && ring == 1 and !gangedME1a_) {
370  }
371  // ME1/2
372  else if (station == 1 && ring == 2) {
373  max_half_strip = CSCConstants::NUM_HALF_STRIPS_ME12;
374  }
375  // ME1/3
376  else if (station == 1 && ring == 3) {
377  max_half_strip = CSCConstants::NUM_HALF_STRIPS_ME13;
378  }
379  // ME2/1
380  else if (station == 2 && ring == 1) {
381  max_half_strip = CSCConstants::NUM_HALF_STRIPS_ME21;
382  }
383  // ME3/1, ME4/1
384  else if (station >= 3 && ring == 1) {
385  max_half_strip = CSCConstants::NUM_HALF_STRIPS_ME31;
386  }
387  // ME2/2, ME3/2, ME4/2
388  else if (station >= 2 && ring == 2) {
389  max_half_strip = CSCConstants::NUM_HALF_STRIPS_ME22;
390  }
391  return max_half_strip;
392 }
bool gangedME1a_
Definition: CSCBaseboard.h:97
unsigned LCTQualityControl::get_csc_max_quartstrip ( unsigned  station,
unsigned  ring 
) const

Definition at line 394 of file LCTQualityControl.cc.

References get_csc_max_halfstrip().

Referenced by checkValid().

394  {
395  return get_csc_max_halfstrip(station, ring) * 2;
396 }
unsigned get_csc_max_halfstrip(unsigned station, unsigned ring) const
unsigned LCTQualityControl::get_csc_max_wiregroup ( unsigned  station,
unsigned  ring 
) const

Definition at line 335 of file LCTQualityControl.cc.

References CSCConstants::NUM_WIREGROUPS_ME11, CSCConstants::NUM_WIREGROUPS_ME12, CSCConstants::NUM_WIREGROUPS_ME13, CSCConstants::NUM_WIREGROUPS_ME21, CSCConstants::NUM_WIREGROUPS_ME22, and CSCConstants::NUM_WIREGROUPS_ME31.

Referenced by checkValid().

335  {
336  unsigned max_wiregroup = 0;
337  if (station == 1 && ring == 4) { // ME1/1a
338  max_wiregroup = CSCConstants::NUM_WIREGROUPS_ME11;
339  } else if (station == 1 && ring == 1) { // ME1/1b
340  max_wiregroup = CSCConstants::NUM_WIREGROUPS_ME11;
341  } else if (station == 1 && ring == 2) { // ME1/2
342  max_wiregroup = CSCConstants::NUM_WIREGROUPS_ME12;
343  } else if (station == 1 && ring == 3) { // ME1/3
344  max_wiregroup = CSCConstants::NUM_WIREGROUPS_ME13;
345  } else if (station == 2 && ring == 1) { // ME2/1
346  max_wiregroup = CSCConstants::NUM_WIREGROUPS_ME21;
347  } else if (station >= 3 && ring == 1) { // ME3/1, ME4/1
348  max_wiregroup = CSCConstants::NUM_WIREGROUPS_ME31;
349  } else if (station >= 2 && ring == 2) { // ME2/2, ME3/2, ME4/2
350  max_wiregroup = CSCConstants::NUM_WIREGROUPS_ME22;
351  }
352  return max_wiregroup;
353 }
std::pair< unsigned, unsigned > LCTQualityControl::get_csc_min_max_cfeb ( ) const

Definition at line 402 of file LCTQualityControl.cc.

References CSCBaseboard::gangedME1a_, CSCConstants::NUM_CFEBS_ME11_GANGED, CSCConstants::NUM_CFEBS_ME11_UNGANGED, CSCConstants::NUM_CFEBS_ME12, CSCConstants::NUM_CFEBS_ME13, CSCConstants::NUM_CFEBS_ME1A_GANGED, CSCConstants::NUM_CFEBS_ME1A_UNGANGED, CSCConstants::NUM_CFEBS_ME21, CSCConstants::NUM_CFEBS_ME22, CSCConstants::NUM_CFEBS_ME31, CSCBaseboard::theRing, and CSCBaseboard::theStation.

Referenced by checkValid().

402  {
403  // counts at 0!
404  unsigned min_cfeb = 0;
405  unsigned max_cfeb = 0;
406 
407  // ME1/1a
408  if (theStation == 1 && theRing == 4 and gangedME1a_) {
410  } else if (theStation == 1 && theRing == 4 and !gangedME1a_) {
412  }
413  // ME1/1b
414  // In the CSC local trigger
415  // ME1/a is taken together with ME1/b
416  else if (theStation == 1 && theRing == 1 and gangedME1a_) {
418  } else if (theStation == 1 && theRing == 1 and !gangedME1a_) {
420  }
421  // ME1/2
422  else if (theStation == 1 && theRing == 2) {
423  max_cfeb = CSCConstants::NUM_CFEBS_ME12;
424  }
425  // ME1/3
426  else if (theStation == 1 && theRing == 3) {
427  max_cfeb = CSCConstants::NUM_CFEBS_ME13;
428  }
429  // ME2/1
430  else if (theStation == 2 && theRing == 1) {
431  max_cfeb = CSCConstants::NUM_CFEBS_ME21;
432  }
433  // ME3/1, ME4/1
434  else if (theStation >= 3 && theRing == 1) {
435  max_cfeb = CSCConstants::NUM_CFEBS_ME31;
436  }
437  // ME2/2, ME3/2, ME4/2
438  else if (theStation >= 2 && theRing == 2) {
439  max_cfeb = CSCConstants::NUM_CFEBS_ME22;
440  }
441  return std::make_pair(min_cfeb, max_cfeb - 1);
442 }
bool gangedME1a_
Definition: CSCBaseboard.h:97
const unsigned theStation
Definition: CSCBaseboard.h:43
unsigned theRing
Definition: CSCBaseboard.h:48
std::pair< unsigned, unsigned > LCTQualityControl::get_csc_min_max_pattern ( ) const

Definition at line 444 of file LCTQualityControl.cc.

Referenced by checkValid().

444 { return std::make_pair(2, 10); }
std::pair< unsigned, unsigned > LCTQualityControl::get_csc_min_max_pattern_run3 ( ) const

Definition at line 446 of file LCTQualityControl.cc.

Referenced by checkValid().

446 { return std::make_pair(0, 4); }
int LCTQualityControl::getSlopePhase1 ( unsigned  pattern) const

Definition at line 296 of file LCTQualityControl.cc.

References CSCConstants::NUM_CLCT_PATTERNS.

296  {
297  // PID 2 is actually a left-bending pattern with a negative slope
298  // PID 3 is actually a right-bending pattern with a positive slope
299  int slopeList[CSCConstants::NUM_CLCT_PATTERNS] = {0, 0, -8, 8, -6, 6, -4, 4, -2, 2, 0};
300  return slopeList[pattern];
301 }
template<class T >
void LCTQualityControl::reportErrors ( const T lct,
const unsigned  errors 
) const

Definition at line 30 of file LCTQualityControl.cc.

References CSCBaseboard::cscId_.

Referenced by checkValid().

30  {
31  if (errors > 0) {
32  edm::LogError("LCTQualityControl") << "Invalid stub in " << cscId_ << " (" << errors << " errors):\n" << lct;
33  }
34 }
Log< level::Error, false > LogError
CSCDetId cscId_
Definition: CSCBaseboard.h:63

Member Data Documentation

unsigned LCTQualityControl::nplanes_clct_hit_pattern
private

Definition at line 96 of file LCTQualityControl.h.

Referenced by LCTQualityControl().