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 
18 
19 #include <vector>
20 #include <algorithm>
21 
23 public:
24  // constructor
25  LCTQualityControl(unsigned endcap,
26  unsigned station,
27  unsigned sector,
28  unsigned subsector,
29  unsigned chamber,
30  const edm::ParameterSet& conf);
31 
33  ~LCTQualityControl() override = default;
34 
35  // Check if the ALCT is valid
36  void checkValidReadout(const CSCALCTDigi& alct) const;
37  void checkValid(const CSCALCTDigi& alct, unsigned max_stubs = CSCConstants::MAX_ALCTS_PER_PROCESSOR) const;
38 
39  // Check if the CLCT is valid
40  void checkValid(const CSCCLCTDigi& lct, unsigned max_stubs = CSCConstants::MAX_CLCTS_PER_PROCESSOR) const;
41 
42  // Check if the LCT is valid - TMB version
43  void checkValid(const CSCCorrelatedLCTDigi& lct) const;
44 
45  // Check if the LCT is valid - MPC version
46  void checkValid(const CSCCorrelatedLCTDigi& lct, const unsigned station, const unsigned ring) const;
47 
48  void checkRange(int parameter, int min_value, int max_value, const std::string& comment, unsigned& errors) const;
49 
50  template <class T>
51  void reportErrors(const T& lct, const unsigned errors) const;
52 
53  // no more than 2 LCTs per BX in the readout
54  void checkMultiplicityBX(const std::vector<CSCALCTDigi>& alcts) const;
55  void checkMultiplicityBX(const std::vector<CSCCLCTDigi>& clcts) const;
56  void checkMultiplicityBX(const std::vector<CSCCorrelatedLCTDigi>& lcts) const;
57  template <class T>
58  void checkMultiplicityBX(const std::vector<T>& lcts, unsigned nLCT) const;
59 
60  // for Phase-1 patterns
61  int getSlopePhase1(unsigned pattern) const;
62 
63  /*
64  CSC max strip & max wire
65  Need to pass station and ring, because we want to reuse the LCTQualityControl in the
66  MPC where the station and ring are considered arguments, not data members.
67  */
68  unsigned get_csc_max_wiregroup(unsigned station, unsigned ring) const;
69  unsigned get_csc_max_halfstrip(unsigned station, unsigned ring) const;
70  unsigned get_csc_max_quartstrip(unsigned station, unsigned ring) const;
71  unsigned get_csc_max_eighthstrip(unsigned station, unsigned ring) const;
72 
73  // slope values
74  std::pair<int, int> get_csc_clct_min_max_slope() const;
75 
76  // CLCT min, max CFEB numbers
77  std::pair<unsigned, unsigned> get_csc_min_max_cfeb() const;
78 
79  // CSC min, max pattern
80  std::pair<unsigned, unsigned> get_csc_min_max_pattern() const;
81  std::pair<unsigned, unsigned> get_csc_min_max_pattern_run3() const;
82  std::pair<unsigned, unsigned> get_csc_lct_min_max_pattern() const;
83 
84  /*
85  CSC min, max quality
86  Need to pass station and ring for the LCT implementation, because we want to
87  reuse the LCTQualityControl in the MPC where the station and ring are considered
88  arguments, not data members.
89  */
90  std::pair<unsigned, unsigned> get_csc_alct_min_max_quality() const;
91  std::pair<unsigned, unsigned> get_csc_clct_min_max_quality() const;
92  std::pair<unsigned, unsigned> get_csc_lct_min_max_quality(unsigned station, unsigned ring) const;
93 
94 private:
95  // min number of layers for a CLCT
97 };
98 
99 template <class T>
100 void LCTQualityControl::checkMultiplicityBX(const std::vector<T>& collection, unsigned nLCT) const {
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 }
115 
116 #endif
LCTQualityControl::checkValidReadout
void checkValidReadout(const CSCALCTDigi &alct) const
Definition: LCTQualityControl.cc:17
pfMETsysShiftCorrections_cfi.parameter
parameter
Definition: pfMETsysShiftCorrections_cfi.py:118
LCTQualityControl::get_csc_max_eighthstrip
unsigned get_csc_max_eighthstrip(unsigned station, unsigned ring) const
Definition: LCTQualityControl.cc:398
relativeConstraints.station
station
Definition: relativeConstraints.py:67
LCTQualityControl::nplanes_clct_hit_pattern
unsigned nplanes_clct_hit_pattern
Definition: LCTQualityControl.h:96
CSCCorrelatedLCTDigi.h
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
LCTQualityControl::get_csc_lct_min_max_quality
std::pair< unsigned, unsigned > get_csc_lct_min_max_quality(unsigned station, unsigned ring) const
Definition: LCTQualityControl.cc:484
CSCCLCTDigi
Definition: CSCCLCTDigi.h:17
CSCConstants::MAX_CLCTS_PER_PROCESSOR
Definition: CSCConstants.h:132
LCTQualityControl::~LCTQualityControl
~LCTQualityControl() override=default
LCTQualityControl::get_csc_alct_min_max_quality
std::pair< unsigned, unsigned > get_csc_alct_min_max_quality() const
Definition: LCTQualityControl.cc:463
LCTQualityControl::LCTQualityControl
LCTQualityControl(unsigned endcap, unsigned station, unsigned sector, unsigned subsector, unsigned chamber, const edm::ParameterSet &conf)
Definition: LCTQualityControl.cc:6
CSCALCTDigi.h
errors
Definition: errors.py:1
LCTQualityControl::reportErrors
void reportErrors(const T &lct, const unsigned errors) const
Definition: LCTQualityControl.cc:30
LCTQualityControl::get_csc_min_max_pattern_run3
std::pair< unsigned, unsigned > get_csc_min_max_pattern_run3() const
Definition: LCTQualityControl.cc:446
LCTQualityControl::get_csc_max_wiregroup
unsigned get_csc_max_wiregroup(unsigned station, unsigned ring) const
Definition: LCTQualityControl.cc:335
LCTQualityControl::get_csc_min_max_pattern
std::pair< unsigned, unsigned > get_csc_min_max_pattern() const
Definition: LCTQualityControl.cc:444
LCTQualityControl::get_csc_max_quartstrip
unsigned get_csc_max_quartstrip(unsigned station, unsigned ring) const
Definition: LCTQualityControl.cc:394
hcaldqm::quantity::min_value
const std::map< ValueQuantityType, double > min_value
Definition: ValueQuantity.h:134
LCTQualityControl::get_csc_max_halfstrip
unsigned get_csc_max_halfstrip(unsigned station, unsigned ring) const
Definition: LCTQualityControl.cc:355
LCTQualityControl::checkRange
void checkRange(int parameter, int min_value, int max_value, const std::string &comment, unsigned &errors) const
Definition: LCTQualityControl.cc:21
edm::ParameterSet
Definition: ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
LCTQualityControl
Definition: LCTQualityControl.h:22
CSCConstants::MAX_ALCTS_PER_PROCESSOR
Definition: CSCConstants.h:135
CSCBaseboard
Definition: CSCBaseboard.h:14
universalConfigTemplate.collection
collection
Definition: universalConfigTemplate.py:81
LCTQualityControl::checkValid
void checkValid(const CSCALCTDigi &alct, unsigned max_stubs=CSCConstants::MAX_ALCTS_PER_PROCESSOR) const
Definition: LCTQualityControl.cc:37
topSingleLeptonDQM_PU_cfi.pattern
pattern
Definition: topSingleLeptonDQM_PU_cfi.py:39
LCTQualityControl::get_csc_min_max_cfeb
std::pair< unsigned, unsigned > get_csc_min_max_cfeb() const
Definition: LCTQualityControl.cc:402
LCTQualityControl::getSlopePhase1
int getSlopePhase1(unsigned pattern) const
Definition: LCTQualityControl.cc:296
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:448
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LCTQualityControl::get_csc_clct_min_max_quality
std::pair< unsigned, unsigned > get_csc_clct_min_max_quality() const
Definition: LCTQualityControl.cc:474
hcaldqm::quantity::max_value
const std::map< ValueQuantityType, double > max_value
Definition: ValueQuantity.h:196
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:284
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:303
CSCCorrelatedLCTDigi
Definition: CSCCorrelatedLCTDigi.h:19
CSCBaseboard.h