CMS 3D CMS Logo

LCTQualityControl.h
Go to the documentation of this file.
1 #ifndef L1Trigger_CSCTriggerPrimitives_LCTQualityControl_h
2 #define L1Trigger_CSCTriggerPrimitives_LCTQualityControl_h
3 
16 
17 #include <vector>
18 #include <algorithm>
19 
21 public:
22  // constructor
23  LCTQualityControl(unsigned endcap,
24  unsigned station,
25  unsigned sector,
26  unsigned subsector,
27  unsigned chamber,
28  const edm::ParameterSet& conf);
29 
31  ~LCTQualityControl() override = default;
32 
33  // Check if the ALCT is valid
34  void checkValidReadout(const CSCALCTDigi& alct) const;
35  void checkValid(const CSCALCTDigi& alct, unsigned max_stubs = CSCConstants::MAX_ALCTS_PER_PROCESSOR) const;
36 
37  // Check if the CLCT is valid
38  void checkValid(const CSCCLCTDigi& lct, unsigned max_stubs = CSCConstants::MAX_CLCTS_PER_PROCESSOR) const;
39 
40  // Check if the LCT is valid - TMB version
41  void checkValid(const CSCCorrelatedLCTDigi& lct) const;
42 
43  // Check if the LCT is valid - MPC version
44  void checkValid(const CSCCorrelatedLCTDigi& lct, const unsigned station, const unsigned ring) const;
45 
46  void checkRange(int parameter, int min_value, int max_value, const std::string& comment, unsigned& errors) const;
47 
48  template <class T>
49  void reportErrors(const T& lct, const unsigned errors) const;
50 
51  // no more than 2 LCTs per BX in the readout
52  void checkMultiplicityBX(const std::vector<CSCALCTDigi>& alcts) const;
53  void checkMultiplicityBX(const std::vector<CSCCLCTDigi>& clcts) const;
54  void checkMultiplicityBX(const std::vector<CSCCorrelatedLCTDigi>& lcts) const;
55  template <class T>
56  void checkMultiplicityBX(const std::vector<T>& lcts, unsigned nLCT) const;
57 
58  // for Phase-1 patterns
59  int getSlopePhase1(int pattern) const;
60 
61  // CSC max strip & max wire
62  unsigned get_csc_max_wire(int station, int ring) const;
63  unsigned get_csc_max_halfstrip(int station, int ring) const;
64  unsigned get_csc_max_quartstrip(int station, int ring) const;
65  unsigned get_csc_max_eighthstrip(int station, int ring) const;
66 
67  // slope values
68  std::pair<int, int> get_csc_clct_min_max_slope() const;
69 
70  // CLCT min, max CFEB numbers
71  std::pair<unsigned, unsigned> get_csc_min_max_cfeb(int station, int ring) const;
72 
73  // CSC min, max pattern
74  std::pair<unsigned, unsigned> get_csc_min_max_pattern(bool isRun3) const;
75  std::pair<unsigned, unsigned> get_csc_lct_min_max_pattern() const;
76 
77  // CSC max quality
78  unsigned get_csc_alct_max_quality(int station, int ring, bool runGEMCSC) const;
79  unsigned get_csc_clct_max_quality() const;
80  unsigned get_csc_lct_max_quality() const;
81 
82 private:
83  // min number of layers for a CLCT
85 };
86 
87 template <class T>
88 void LCTQualityControl::checkMultiplicityBX(const std::vector<T>& collection, unsigned nLCT) const {
89  std::unordered_map<int, unsigned> freq;
90  // check each BX
91  for (const auto& p : collection) {
92  if (p.isValid()) {
93  freq[p.getBX()]++;
94 
95  // too many ALCTs, CLCTs or LCTs in this BX
96  if (freq[p.getBX()] > nLCT) {
97  edm::LogError("LCTQualityControl") << "Collection with more than " << nLCT << " in BX " << p.getBX();
98  break;
99  }
100  }
101  }
102 }
103 
104 #endif
LCTQualityControl::checkValidReadout
void checkValidReadout(const CSCALCTDigi &alct) const
Definition: LCTQualityControl.cc:16
LCTQualityControl::getSlopePhase1
int getSlopePhase1(int pattern) const
Definition: LCTQualityControl.cc:224
pfMETsysShiftCorrections_cfi.parameter
parameter
Definition: pfMETsysShiftCorrections_cfi.py:118
LCTQualityControl::get_csc_min_max_pattern
std::pair< unsigned, unsigned > get_csc_min_max_pattern(bool isRun3) const
Definition: LCTQualityControl.cc:324
relativeConstraints.station
station
Definition: relativeConstraints.py:67
LCTQualityControl::nplanes_clct_hit_pattern
unsigned nplanes_clct_hit_pattern
Definition: LCTQualityControl.h:84
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CSCCorrelatedLCTDigi.h
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
CSCCLCTDigi
Definition: CSCCLCTDigi.h:17
CSCConstants::MAX_CLCTS_PER_PROCESSOR
Definition: CSCConstants.h:69
LCTQualityControl::~LCTQualityControl
~LCTQualityControl() override=default
LCTQualityControl::LCTQualityControl
LCTQualityControl(unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
Definition: LCTQualityControl.cc:5
CSCALCTDigi.h
errors
Definition: errors.py:1
LCTQualityControl::reportErrors
void reportErrors(const T &lct, const unsigned errors) const
Definition: LCTQualityControl.cc:29
hcaldqm::quantity::min_value
const std::map< ValueQuantityType, double > min_value
Definition: ValueQuantity.h:130
LCTQualityControl::checkRange
void checkRange(int parameter, int min_value, int max_value, const std::string &comment, unsigned &errors) const
Definition: LCTQualityControl.cc:20
LCTQualityControl::get_csc_lct_max_quality
unsigned get_csc_lct_max_quality() const
Definition: LCTQualityControl.cc:368
LCTQualityControl::get_csc_max_quartstrip
unsigned get_csc_max_quartstrip(int station, int ring) const
Definition: LCTQualityControl.cc:305
LCTQualityControl::get_csc_alct_max_quality
unsigned get_csc_alct_max_quality(int station, int ring, bool runGEMCSC) const
Definition: LCTQualityControl.cc:354
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
LCTQualityControl
Definition: LCTQualityControl.h:20
CSCConstants::MAX_ALCTS_PER_PROCESSOR
Definition: CSCConstants.h:72
CSCBaseboard
Definition: CSCBaseboard.h:14
universalConfigTemplate.collection
collection
Definition: universalConfigTemplate.py:81
LCTQualityControl::get_csc_min_max_cfeb
std::pair< unsigned, unsigned > get_csc_min_max_cfeb(int station, int ring) const
Definition: LCTQualityControl.cc:313
LCTQualityControl::checkValid
void checkValid(const CSCALCTDigi &alct, unsigned max_stubs=CSCConstants::MAX_ALCTS_PER_PROCESSOR) const
Definition: LCTQualityControl.cc:36
topSingleLeptonDQM_PU_cfi.pattern
pattern
Definition: topSingleLeptonDQM_PU_cfi.py:39
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
LCTQualityControl::get_csc_lct_min_max_pattern
std::pair< unsigned, unsigned > get_csc_lct_min_max_pattern() const
Definition: LCTQualityControl.cc:339
hcaldqm::quantity::max_value
const std::map< ValueQuantityType, double > max_value
Definition: ValueQuantity.h:190
LCTQualityControl::get_csc_max_wire
unsigned get_csc_max_wire(int station, int ring) const
Definition: LCTQualityControl.cc:263
T
long double T
Definition: Basic3DVectorLD.h:48
CSCALCTDigi
Definition: CSCALCTDigi.h:17
CSCCLCTDigi.h
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
LCTQualityControl::checkMultiplicityBX
void checkMultiplicityBX(const std::vector< CSCALCTDigi > &alcts) const
Definition: LCTQualityControl.cc:212
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
LCTQualityControl::get_csc_clct_min_max_slope
std::pair< int, int > get_csc_clct_min_max_slope() const
Definition: LCTQualityControl.cc:231
LCTQualityControl::get_csc_max_eighthstrip
unsigned get_csc_max_eighthstrip(int station, int ring) const
Definition: LCTQualityControl.cc:309
LCTQualityControl::get_csc_clct_max_quality
unsigned get_csc_clct_max_quality() const
Definition: LCTQualityControl.cc:363
LCTQualityControl::get_csc_max_halfstrip
unsigned get_csc_max_halfstrip(int station, int ring) const
Definition: LCTQualityControl.cc:283
CSCCorrelatedLCTDigi
Definition: CSCCorrelatedLCTDigi.h:19
CSCBaseboard.h