Skip to content

Commit 025e9cc

Browse files
authored
Merge pull request cms-sw#33727 from dildick/from-CMSSW_12_0_X_2021-05-12-1100-data-members-run3-variables
Dedicated data members for Run-3 CSC trigger primitives
2 parents 7947c24 + 60d05fb commit 025e9cc

File tree

16 files changed

+191
-314
lines changed

16 files changed

+191
-314
lines changed

DataFormats/CSCDigi/interface/CSCALCTDigi.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,10 @@ class CSCALCTDigi {
128128
uint16_t bx_;
129129
uint16_t trknmb_;
130130
uint16_t fullbx_;
131-
/// Run-3 introduces high-multiplicity bits for CSCs.
132-
/// Note: In DN-20-016, 3 bits are allocated for HMT in the
133-
/// ALCT board. These bits are copied into the ALCT digi in CMSSW
131+
// In Run-3, CSC trigger data will include the high-multiplicity
132+
// bits for a chamber. These bits may indicate the observation of
133+
// "exotic" events. This data member was included in a prototype.
134+
// Later on, we developed a dedicated object: "CSCShowerDigi<Anode>"
134135
uint16_t hmt_;
135136

136137
Version version_;

DataFormats/CSCDigi/interface/CSCCLCTDigi.h

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ class CSCCLCTDigi {
1818
public:
1919
typedef std::vector<std::vector<uint16_t>> ComparatorContainer;
2020

21-
enum CLCTKeyStripMasks { kEighthStripMask = 0x1, kQuartStripMask = 0x1, kHalfStripMask = 0x1f };
22-
enum CLCTKeyStripShifts { kEighthStripShift = 6, kQuartStripShift = 5, kHalfStripShift = 0 };
23-
// temporary to facilitate CCLUT-EMTF/OMTF integration studies
24-
enum CLCTPatternMasks { kRun3SlopeMask = 0xf, kRun3PatternMask = 0x7, kLegacyPatternMask = 0xf };
25-
enum CLCTPatternShifts { kRun3SlopeShift = 7, kRun3PatternShift = 4, kLegacyPatternShift = 0 };
2621
enum class Version { Legacy = 0, Run3 };
2722
// for data vs emulator studies
2823
enum CLCTBXMask { kBXDataMask = 0x3 };
@@ -39,8 +34,13 @@ class CSCCLCTDigi {
3934
const uint16_t trknmb = 0,
4035
const uint16_t fullbx = 0,
4136
const int16_t compCode = -1,
42-
const Version version = Version::Legacy);
43-
/// default
37+
const Version version = Version::Legacy,
38+
const bool run3_quart_strip_bit = false,
39+
const bool run3_eighth_strip_bit = false,
40+
const uint16_t run3_pattern = 0,
41+
const uint16_t run3_slope = 0);
42+
43+
/// default (calls clear())
4444
CSCCLCTDigi();
4545

4646
/// clear this CLCT
@@ -59,22 +59,22 @@ class CSCCLCTDigi {
5959
void setQuality(const uint16_t quality) { quality_ = quality; }
6060

6161
/// return pattern
62-
uint16_t getPattern() const;
62+
uint16_t getPattern() const { return pattern_; }
6363

6464
/// set pattern
65-
void setPattern(const uint16_t pattern);
65+
void setPattern(const uint16_t pattern) { pattern_ = pattern; }
6666

6767
/// return pattern
68-
uint16_t getRun3Pattern() const;
68+
uint16_t getRun3Pattern() const { return run3_pattern_; }
6969

7070
/// set pattern
71-
void setRun3Pattern(const uint16_t pattern);
71+
void setRun3Pattern(const uint16_t pattern) { run3_pattern_ = pattern; }
7272

7373
/// return the slope
74-
uint16_t getSlope() const;
74+
uint16_t getSlope() const { return run3_slope_; }
7575

7676
/// set the slope
77-
void setSlope(const uint16_t slope);
77+
void setSlope(const uint16_t slope) { run3_slope_ = slope; }
7878

7979
/// slope in number of half-strips/layer
8080
/// negative means left-bending
@@ -96,22 +96,22 @@ class CSCCLCTDigi {
9696
void setBend(const uint16_t bend) { bend_ = bend; }
9797

9898
/// return halfstrip that goes from 0 to 31 in a (D)CFEB
99-
uint16_t getStrip() const;
99+
uint16_t getStrip() const { return strip_; }
100100

101101
/// set strip
102102
void setStrip(const uint16_t strip) { strip_ = strip; }
103103

104104
/// set single quart strip bit
105-
void setQuartStrip(const bool quartStrip);
105+
void setQuartStripBit(const bool quartStripBit) { run3_quart_strip_bit_ = quartStripBit; }
106106

107107
/// get single quart strip bit
108-
bool getQuartStrip() const;
108+
bool getQuartStripBit() const { return run3_quart_strip_bit_; }
109109

110110
/// set single eighth strip bit
111-
void setEighthStrip(const bool eighthStrip);
111+
void setEighthStripBit(const bool eighthStripBit) { run3_eighth_strip_bit_ = eighthStripBit; }
112112

113113
/// get single eighth strip bit
114-
bool getEighthStrip() const;
114+
bool getEighthStripBit() const { return run3_eighth_strip_bit_; }
115115

116116
/// return Key CFEB ID
117117
uint16_t getCFEB() const { return cfeb_; }
@@ -197,32 +197,39 @@ class CSCCLCTDigi {
197197
void setRun3(bool isRun3);
198198

199199
private:
200-
void setDataWord(const uint16_t newWord, uint16_t& word, const unsigned shift, const unsigned mask);
201-
uint16_t getDataWord(const uint16_t word, const unsigned shift, const unsigned mask) const;
202-
203200
uint16_t valid_;
204201
uint16_t quality_;
205-
// In Run-3, the 4-bit pattern number is reinterpreted as the
206-
// 4-bit bending value. There will be 16 bending values * 2 (left/right)
202+
// Run-1/2 pattern number.
203+
// For Run-3 CLCTs, please use run3_pattern_. For some backward
204+
// compatibility the trigger emulator translates run3_pattern_
205+
// approximately into pattern_ with a lookup table
207206
uint16_t pattern_;
208207
uint16_t striptype_; // not used since mid-2008
209208
// Common definition for left/right bending in Run-1, Run-2 and Run-3.
210209
// 0: right; 1: left
211210
uint16_t bend_;
212-
// In Run-3, the strip number receives two additional bits
213-
// strip[4:0] -> 1/2 strip value
214-
// strip[5] -> 1/4 strip bit
215-
// strip[6] -> 1/8 strip bit
211+
// actually the half-strip number
216212
uint16_t strip_;
217213
// There are up to 7 (D)CFEBs in a chamber
218214
uint16_t cfeb_;
219215
uint16_t bx_;
220216
uint16_t trknmb_;
221217
uint16_t fullbx_;
222218

223-
// new in Run-3: 12-bit comparator code
219+
// new members in Run-3:
220+
221+
// 12-bit comparator code
224222
// set by default to -1 for Run-1 and Run-2 CLCTs
225223
int16_t compCode_;
224+
// 1/4-strip bit set by CCLUT (see DN-19-059)
225+
bool run3_quart_strip_bit_;
226+
// 1/8-strip bit set by CCLUT
227+
bool run3_eighth_strip_bit_;
228+
// In Run-3, the CLCT digi has 3-bit pattern ID, 0 through 4
229+
uint16_t run3_pattern_;
230+
// 4-bit bending value. There will be 16 bending values * 2 (left/right)
231+
uint16_t run3_slope_;
232+
226233
// which hits are in this CLCT?
227234
ComparatorContainer hits_;
228235

DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h

Lines changed: 53 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,22 @@
1818

1919
class CSCCorrelatedLCTDigi {
2020
public:
21-
enum LCTKeyStripMasks { kEighthStripMask = 0x1, kQuartStripMask = 0x1, kHalfStripMask = 0xff };
22-
enum LCTKeyStripShifts { kEighthStripShift = 9, kQuartStripShift = 8, kHalfStripShift = 0 };
23-
// temporary to facilitate CCLUT-EMTF/OMTF integration studies
24-
enum LCTPatternMasks { kRun3SlopeMask = 0xf, kRun3PatternMask = 0x7, kLegacyPatternMask = 0xf };
25-
enum LCTPatternShifts { kRun3SlopeShift = 7, kRun3PatternShift = 4, kLegacyPatternShift = 0 };
2621
enum class Version { Legacy = 0, Run3 };
2722
// for data vs emulator studies
2823
enum LCTBXMask { kBXDataMask = 0x1 };
2924

25+
/// SIMULATION ONLY ////
26+
enum Type {
27+
CLCTALCT, // CLCT-centric
28+
ALCTCLCT, // ALCT-centric
29+
ALCTCLCTGEM, // ALCT-CLCT-1 GEM pad
30+
ALCTCLCT2GEM, // ALCT-CLCT-2 GEM pads in coincidence
31+
ALCT2GEM, // ALCT-2 GEM pads in coincidence
32+
CLCT2GEM, // CLCT-2 GEM pads in coincidence
33+
CLCTONLY, // Missing ALCT
34+
ALCTONLY // Missing CLCT
35+
};
36+
3037
/// Constructors
3138
CSCCorrelatedLCTDigi(const uint16_t trknmb,
3239
const uint16_t valid,
@@ -40,9 +47,14 @@ class CSCCorrelatedLCTDigi {
4047
const uint16_t bx0 = 0,
4148
const uint16_t syncErr = 0,
4249
const uint16_t cscID = 0,
43-
const uint16_t hmt = 0,
44-
const Version version = Version::Legacy);
45-
/// default
50+
const Version version = Version::Legacy,
51+
const bool run3_quart_strip_bit = false,
52+
const bool run3_eighth_strip_bit = false,
53+
const uint16_t run3_pattern = 0,
54+
const uint16_t run3_slope = 0,
55+
const int type = ALCTCLCT);
56+
57+
/// default (calls clear())
4658
CSCCorrelatedLCTDigi();
4759

4860
/// clear this LCT
@@ -64,16 +76,16 @@ class CSCCorrelatedLCTDigi {
6476
uint16_t getStrip(uint16_t n = 2) const;
6577

6678
/// set single quart strip bit
67-
void setQuartStrip(const bool quartStrip);
79+
void setQuartStripBit(const bool quartStripBit) { run3_quart_strip_bit_ = quartStripBit; }
6880

6981
/// get single quart strip bit
70-
bool getQuartStrip() const;
82+
bool getQuartStripBit() const { return run3_quart_strip_bit_; }
7183

7284
/// set single eighth strip bit
73-
void setEighthStrip(const bool eighthStrip);
85+
void setEighthStripBit(const bool eighthStripBit) { run3_eighth_strip_bit_ = eighthStripBit; }
7486

7587
/// get single eighth strip bit
76-
bool getEighthStrip() const;
88+
bool getEighthStripBit() const { return run3_eighth_strip_bit_; }
7789

7890
/*
7991
Strips are numbered starting from 1 in CMSSW
@@ -94,15 +106,14 @@ class CSCCorrelatedLCTDigi {
94106
*/
95107
float getFractionalStrip(uint16_t n = 2) const;
96108

97-
/// Legacy: return pattern ID
98-
/// Run-3: return the bending angle value
99-
uint16_t getPattern() const;
109+
/// return the Run-2 pattern ID
110+
uint16_t getPattern() const { return pattern; }
100111

101-
/// return pattern
102-
uint16_t getRun3Pattern() const;
112+
/// return the Run-3 pattern ID
113+
uint16_t getRun3Pattern() const { return run3_pattern_; }
103114

104115
/// return the slope
105-
uint16_t getSlope() const;
116+
uint16_t getSlope() const { return run3_slope_; }
106117

107118
/// slope in number of half-strips/layer
108119
/// negative means left-bending
@@ -166,13 +177,13 @@ class CSCCorrelatedLCTDigi {
166177
void setStrip(const uint16_t s) { strip = s; }
167178

168179
/// set pattern
169-
void setPattern(const uint16_t p);
180+
void setPattern(const uint16_t p) { pattern = p; }
170181

171-
/// set pattern
172-
void setRun3Pattern(const uint16_t pattern);
182+
/// set Run-3 pattern
183+
void setRun3Pattern(const uint16_t pattern) { run3_pattern_ = pattern; }
173184

174185
/// set the slope
175-
void setSlope(const uint16_t slope);
186+
void setSlope(const uint16_t slope) { run3_slope_ = slope; }
176187

177188
/// set bend
178189
void setBend(const uint16_t b) { bend = b; }
@@ -197,18 +208,6 @@ class CSCCorrelatedLCTDigi {
197208

198209
void setRun3(const bool isRun3);
199210

200-
/// SIMULATION ONLY ////
201-
enum Type {
202-
CLCTALCT, // CLCT-centric
203-
ALCTCLCT, // ALCT-centric
204-
ALCTCLCTGEM, // ALCT-CLCT-1 GEM pad
205-
ALCTCLCT2GEM, // ALCT-CLCT-2 GEM pads in coincidence
206-
ALCT2GEM, // ALCT-2 GEM pads in coincidence
207-
CLCT2GEM, // CLCT-2 GEM pads in coincidence
208-
CLCTONLY, // Missing ALCT
209-
ALCTONLY // Missing CLCT
210-
};
211-
212211
int getType() const { return type_; }
213212

214213
void setType(int type) { type_ = type; }
@@ -223,9 +222,6 @@ class CSCCorrelatedLCTDigi {
223222
const GEMPadDigi& getGEM2() const { return gem2_; }
224223

225224
private:
226-
void setDataWord(const uint16_t newWord, uint16_t& word, const unsigned shift, const unsigned mask);
227-
uint16_t getDataWord(const uint16_t word, const unsigned shift, const unsigned mask) const;
228-
229225
// Note: The Run-3 data format is substantially different than the
230226
// Run-1/2 data format. Some explanation is provided below. For
231227
// more information, please check "DN-20-016".
@@ -241,13 +237,12 @@ class CSCCorrelatedLCTDigi {
241237
uint16_t quality;
242238
// 7-bit key wire
243239
uint16_t keywire;
244-
// In Run-3, the strip number receives two additional bits
245-
// strip[7:0] -> 1/2 strip value
246-
// strip[8] -> 1/4 strip bit
247-
// strip[9] -> 1/8 strip bit
240+
// actually the 8-bit half-strip number
248241
uint16_t strip;
249-
// In Run-3, the 4-bit pattern number is reinterpreted as the
250-
// 4-bit bending value. There will be 16 bending values * 2 (left/right)
242+
// Run-1/2 pattern number.
243+
// For Run-3 CLCTs, please use run3_pattern_. For some backward
244+
// compatibility the trigger emulator translates run3_pattern_
245+
// approximately into pattern_ with a lookup table
251246
uint16_t pattern;
252247
// Common definition for left/right bending in Run-1, Run-2 and Run-3.
253248
// 0: right; 1: left
@@ -259,12 +254,22 @@ class CSCCorrelatedLCTDigi {
259254
uint16_t syncErr;
260255
// 4-bit CSC chamber identifier
261256
uint16_t cscID;
262-
// In Run-3, LCT data will be carrying the high-multiplicity bits
263-
// for chamber. These bits may indicate the observation of "exotic" events
264-
// Depending on the chamber type 2 or 3 bits will be repurposed
265-
// in the 32-bit LCT data word from the synchronization bit and
266-
// quality bits.
257+
258+
// new members in Run-3:
259+
260+
// In Run-3, CSC trigger data will include the high-multiplicity
261+
// bits for a chamber. These bits may indicate the observation of
262+
// "exotic" events. This data member was included in a prototype.
263+
// Later on, we developed a dedicated object: "CSCShowerDigi"
267264
uint16_t hmt;
265+
// 1/4-strip bit set by CCLUT (see DN-19-059)
266+
bool run3_quart_strip_bit_;
267+
// 1/8-strip bit set by CCLUT
268+
bool run3_eighth_strip_bit_;
269+
// In Run-3, the CLCT digi has 3-bit pattern ID, 0 through 4
270+
uint16_t run3_pattern_;
271+
// 4-bit bending value. There will be 16 bending values * 2 (left/right)
272+
uint16_t run3_slope_;
268273

269274
/// SIMULATION ONLY ////
270275
int type_;

DataFormats/CSCDigi/interface/CSCShowerDigi.h

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,41 +10,36 @@ class CSCShowerDigi {
1010
public:
1111
// Run-3 definitions as provided in DN-20-033
1212
enum Run3Shower { kInvalid = 0, kLoose = 1, kNominal = 2, kTight = 3 };
13-
enum BitMask { kInTimeMask = 0x2, kOutTimeMask = 0x2 };
14-
enum BitShift { kInTimeShift = 0, kOutTimeShift = 2 };
1513

1614
/// Constructors
1715
CSCShowerDigi(const uint16_t inTimeBits, const uint16_t outTimeBits, const uint16_t cscID);
1816
/// default
1917
CSCShowerDigi();
2018

2119
/// clear this Shower
22-
void clear() { bits_ = 0; }
20+
void clear();
2321

2422
/// data
2523
bool isValid() const;
2624

2725
bool isLooseInTime() const;
2826
bool isNominalInTime() const;
2927
bool isTightInTime() const;
30-
bool isLooseOutTime() const;
31-
bool isNominalOutTime() const;
32-
bool isTightOutTime() const;
28+
bool isLooseOutOfTime() const;
29+
bool isNominalOutOfTime() const;
30+
bool isTightOutOfTime() const;
3331

34-
uint16_t bits() const { return bits_; }
35-
uint16_t bitsInTime() const;
36-
uint16_t bitsOutTime() const;
32+
uint16_t bitsInTime() const { return bitsInTime_; }
33+
uint16_t bitsOutOfTime() const { return bitsOutOfTime_; }
3734

3835
uint16_t getCSCID() const { return cscID_; }
3936

4037
/// set cscID
4138
void setCSCID(const uint16_t c) { cscID_ = c; }
4239

4340
private:
44-
void setDataWord(const uint16_t newWord, uint16_t& word, const unsigned shift, const unsigned mask);
45-
uint16_t getDataWord(const uint16_t word, const unsigned shift, const unsigned mask) const;
46-
47-
uint16_t bits_;
41+
uint16_t bitsInTime_;
42+
uint16_t bitsOutOfTime_;
4843
// 4-bit CSC chamber identifier
4944
uint16_t cscID_;
5045
};

0 commit comments

Comments
 (0)