Skip to content

Commit

Permalink
Merge pull request #33727 from dildick/from-CMSSW_12_0_X_2021-05-12-1…
Browse files Browse the repository at this point in the history
…100-data-members-run3-variables

Dedicated data members for Run-3 CSC trigger primitives
  • Loading branch information
cmsbuild authored May 28, 2021
2 parents 7947c24 + 60d05fb commit 025e9cc
Show file tree
Hide file tree
Showing 16 changed files with 191 additions and 314 deletions.
7 changes: 4 additions & 3 deletions DataFormats/CSCDigi/interface/CSCALCTDigi.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,10 @@ class CSCALCTDigi {
uint16_t bx_;
uint16_t trknmb_;
uint16_t fullbx_;
/// Run-3 introduces high-multiplicity bits for CSCs.
/// Note: In DN-20-016, 3 bits are allocated for HMT in the
/// ALCT board. These bits are copied into the ALCT digi in CMSSW
// In Run-3, CSC trigger data will include the high-multiplicity
// bits for a chamber. These bits may indicate the observation of
// "exotic" events. This data member was included in a prototype.
// Later on, we developed a dedicated object: "CSCShowerDigi<Anode>"
uint16_t hmt_;

Version version_;
Expand Down
63 changes: 35 additions & 28 deletions DataFormats/CSCDigi/interface/CSCCLCTDigi.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ class CSCCLCTDigi {
public:
typedef std::vector<std::vector<uint16_t>> ComparatorContainer;

enum CLCTKeyStripMasks { kEighthStripMask = 0x1, kQuartStripMask = 0x1, kHalfStripMask = 0x1f };
enum CLCTKeyStripShifts { kEighthStripShift = 6, kQuartStripShift = 5, kHalfStripShift = 0 };
// temporary to facilitate CCLUT-EMTF/OMTF integration studies
enum CLCTPatternMasks { kRun3SlopeMask = 0xf, kRun3PatternMask = 0x7, kLegacyPatternMask = 0xf };
enum CLCTPatternShifts { kRun3SlopeShift = 7, kRun3PatternShift = 4, kLegacyPatternShift = 0 };
enum class Version { Legacy = 0, Run3 };
// for data vs emulator studies
enum CLCTBXMask { kBXDataMask = 0x3 };
Expand All @@ -39,8 +34,13 @@ class CSCCLCTDigi {
const uint16_t trknmb = 0,
const uint16_t fullbx = 0,
const int16_t compCode = -1,
const Version version = Version::Legacy);
/// default
const Version version = Version::Legacy,
const bool run3_quart_strip_bit = false,
const bool run3_eighth_strip_bit = false,
const uint16_t run3_pattern = 0,
const uint16_t run3_slope = 0);

/// default (calls clear())
CSCCLCTDigi();

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

/// return pattern
uint16_t getPattern() const;
uint16_t getPattern() const { return pattern_; }

/// set pattern
void setPattern(const uint16_t pattern);
void setPattern(const uint16_t pattern) { pattern_ = pattern; }

/// return pattern
uint16_t getRun3Pattern() const;
uint16_t getRun3Pattern() const { return run3_pattern_; }

/// set pattern
void setRun3Pattern(const uint16_t pattern);
void setRun3Pattern(const uint16_t pattern) { run3_pattern_ = pattern; }

/// return the slope
uint16_t getSlope() const;
uint16_t getSlope() const { return run3_slope_; }

/// set the slope
void setSlope(const uint16_t slope);
void setSlope(const uint16_t slope) { run3_slope_ = slope; }

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

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

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

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

/// get single quart strip bit
bool getQuartStrip() const;
bool getQuartStripBit() const { return run3_quart_strip_bit_; }

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

/// get single eighth strip bit
bool getEighthStrip() const;
bool getEighthStripBit() const { return run3_eighth_strip_bit_; }

/// return Key CFEB ID
uint16_t getCFEB() const { return cfeb_; }
Expand Down Expand Up @@ -197,32 +197,39 @@ class CSCCLCTDigi {
void setRun3(bool isRun3);

private:
void setDataWord(const uint16_t newWord, uint16_t& word, const unsigned shift, const unsigned mask);
uint16_t getDataWord(const uint16_t word, const unsigned shift, const unsigned mask) const;

uint16_t valid_;
uint16_t quality_;
// In Run-3, the 4-bit pattern number is reinterpreted as the
// 4-bit bending value. There will be 16 bending values * 2 (left/right)
// Run-1/2 pattern number.
// For Run-3 CLCTs, please use run3_pattern_. For some backward
// compatibility the trigger emulator translates run3_pattern_
// approximately into pattern_ with a lookup table
uint16_t pattern_;
uint16_t striptype_; // not used since mid-2008
// Common definition for left/right bending in Run-1, Run-2 and Run-3.
// 0: right; 1: left
uint16_t bend_;
// In Run-3, the strip number receives two additional bits
// strip[4:0] -> 1/2 strip value
// strip[5] -> 1/4 strip bit
// strip[6] -> 1/8 strip bit
// actually the half-strip number
uint16_t strip_;
// There are up to 7 (D)CFEBs in a chamber
uint16_t cfeb_;
uint16_t bx_;
uint16_t trknmb_;
uint16_t fullbx_;

// new in Run-3: 12-bit comparator code
// new members in Run-3:

// 12-bit comparator code
// set by default to -1 for Run-1 and Run-2 CLCTs
int16_t compCode_;
// 1/4-strip bit set by CCLUT (see DN-19-059)
bool run3_quart_strip_bit_;
// 1/8-strip bit set by CCLUT
bool run3_eighth_strip_bit_;
// In Run-3, the CLCT digi has 3-bit pattern ID, 0 through 4
uint16_t run3_pattern_;
// 4-bit bending value. There will be 16 bending values * 2 (left/right)
uint16_t run3_slope_;

// which hits are in this CLCT?
ComparatorContainer hits_;

Expand Down
101 changes: 53 additions & 48 deletions DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,22 @@

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

/// SIMULATION ONLY ////
enum Type {
CLCTALCT, // CLCT-centric
ALCTCLCT, // ALCT-centric
ALCTCLCTGEM, // ALCT-CLCT-1 GEM pad
ALCTCLCT2GEM, // ALCT-CLCT-2 GEM pads in coincidence
ALCT2GEM, // ALCT-2 GEM pads in coincidence
CLCT2GEM, // CLCT-2 GEM pads in coincidence
CLCTONLY, // Missing ALCT
ALCTONLY // Missing CLCT
};

/// Constructors
CSCCorrelatedLCTDigi(const uint16_t trknmb,
const uint16_t valid,
Expand All @@ -40,9 +47,14 @@ class CSCCorrelatedLCTDigi {
const uint16_t bx0 = 0,
const uint16_t syncErr = 0,
const uint16_t cscID = 0,
const uint16_t hmt = 0,
const Version version = Version::Legacy);
/// default
const Version version = Version::Legacy,
const bool run3_quart_strip_bit = false,
const bool run3_eighth_strip_bit = false,
const uint16_t run3_pattern = 0,
const uint16_t run3_slope = 0,
const int type = ALCTCLCT);

/// default (calls clear())
CSCCorrelatedLCTDigi();

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

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

/// get single quart strip bit
bool getQuartStrip() const;
bool getQuartStripBit() const { return run3_quart_strip_bit_; }

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

/// get single eighth strip bit
bool getEighthStrip() const;
bool getEighthStripBit() const { return run3_eighth_strip_bit_; }

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

/// Legacy: return pattern ID
/// Run-3: return the bending angle value
uint16_t getPattern() const;
/// return the Run-2 pattern ID
uint16_t getPattern() const { return pattern; }

/// return pattern
uint16_t getRun3Pattern() const;
/// return the Run-3 pattern ID
uint16_t getRun3Pattern() const { return run3_pattern_; }

/// return the slope
uint16_t getSlope() const;
uint16_t getSlope() const { return run3_slope_; }

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

/// set pattern
void setPattern(const uint16_t p);
void setPattern(const uint16_t p) { pattern = p; }

/// set pattern
void setRun3Pattern(const uint16_t pattern);
/// set Run-3 pattern
void setRun3Pattern(const uint16_t pattern) { run3_pattern_ = pattern; }

/// set the slope
void setSlope(const uint16_t slope);
void setSlope(const uint16_t slope) { run3_slope_ = slope; }

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

void setRun3(const bool isRun3);

/// SIMULATION ONLY ////
enum Type {
CLCTALCT, // CLCT-centric
ALCTCLCT, // ALCT-centric
ALCTCLCTGEM, // ALCT-CLCT-1 GEM pad
ALCTCLCT2GEM, // ALCT-CLCT-2 GEM pads in coincidence
ALCT2GEM, // ALCT-2 GEM pads in coincidence
CLCT2GEM, // CLCT-2 GEM pads in coincidence
CLCTONLY, // Missing ALCT
ALCTONLY // Missing CLCT
};

int getType() const { return type_; }

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

private:
void setDataWord(const uint16_t newWord, uint16_t& word, const unsigned shift, const unsigned mask);
uint16_t getDataWord(const uint16_t word, const unsigned shift, const unsigned mask) const;

// Note: The Run-3 data format is substantially different than the
// Run-1/2 data format. Some explanation is provided below. For
// more information, please check "DN-20-016".
Expand All @@ -241,13 +237,12 @@ class CSCCorrelatedLCTDigi {
uint16_t quality;
// 7-bit key wire
uint16_t keywire;
// In Run-3, the strip number receives two additional bits
// strip[7:0] -> 1/2 strip value
// strip[8] -> 1/4 strip bit
// strip[9] -> 1/8 strip bit
// actually the 8-bit half-strip number
uint16_t strip;
// In Run-3, the 4-bit pattern number is reinterpreted as the
// 4-bit bending value. There will be 16 bending values * 2 (left/right)
// Run-1/2 pattern number.
// For Run-3 CLCTs, please use run3_pattern_. For some backward
// compatibility the trigger emulator translates run3_pattern_
// approximately into pattern_ with a lookup table
uint16_t pattern;
// Common definition for left/right bending in Run-1, Run-2 and Run-3.
// 0: right; 1: left
Expand All @@ -259,12 +254,22 @@ class CSCCorrelatedLCTDigi {
uint16_t syncErr;
// 4-bit CSC chamber identifier
uint16_t cscID;
// In Run-3, LCT data will be carrying the high-multiplicity bits
// for chamber. These bits may indicate the observation of "exotic" events
// Depending on the chamber type 2 or 3 bits will be repurposed
// in the 32-bit LCT data word from the synchronization bit and
// quality bits.

// new members in Run-3:

// In Run-3, CSC trigger data will include the high-multiplicity
// bits for a chamber. These bits may indicate the observation of
// "exotic" events. This data member was included in a prototype.
// Later on, we developed a dedicated object: "CSCShowerDigi"
uint16_t hmt;
// 1/4-strip bit set by CCLUT (see DN-19-059)
bool run3_quart_strip_bit_;
// 1/8-strip bit set by CCLUT
bool run3_eighth_strip_bit_;
// In Run-3, the CLCT digi has 3-bit pattern ID, 0 through 4
uint16_t run3_pattern_;
// 4-bit bending value. There will be 16 bending values * 2 (left/right)
uint16_t run3_slope_;

/// SIMULATION ONLY ////
int type_;
Expand Down
21 changes: 8 additions & 13 deletions DataFormats/CSCDigi/interface/CSCShowerDigi.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,36 @@ class CSCShowerDigi {
public:
// Run-3 definitions as provided in DN-20-033
enum Run3Shower { kInvalid = 0, kLoose = 1, kNominal = 2, kTight = 3 };
enum BitMask { kInTimeMask = 0x2, kOutTimeMask = 0x2 };
enum BitShift { kInTimeShift = 0, kOutTimeShift = 2 };

/// Constructors
CSCShowerDigi(const uint16_t inTimeBits, const uint16_t outTimeBits, const uint16_t cscID);
/// default
CSCShowerDigi();

/// clear this Shower
void clear() { bits_ = 0; }
void clear();

/// data
bool isValid() const;

bool isLooseInTime() const;
bool isNominalInTime() const;
bool isTightInTime() const;
bool isLooseOutTime() const;
bool isNominalOutTime() const;
bool isTightOutTime() const;
bool isLooseOutOfTime() const;
bool isNominalOutOfTime() const;
bool isTightOutOfTime() const;

uint16_t bits() const { return bits_; }
uint16_t bitsInTime() const;
uint16_t bitsOutTime() const;
uint16_t bitsInTime() const { return bitsInTime_; }
uint16_t bitsOutOfTime() const { return bitsOutOfTime_; }

uint16_t getCSCID() const { return cscID_; }

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

private:
void setDataWord(const uint16_t newWord, uint16_t& word, const unsigned shift, const unsigned mask);
uint16_t getDataWord(const uint16_t word, const unsigned shift, const unsigned mask) const;

uint16_t bits_;
uint16_t bitsInTime_;
uint16_t bitsOutOfTime_;
// 4-bit CSC chamber identifier
uint16_t cscID_;
};
Expand Down
Loading

0 comments on commit 025e9cc

Please sign in to comment.