Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uGT emulator code for hadronic shower triggers for Run-3 #951

Merged
merged 20 commits into from
Nov 16, 2021
Merged
1 change: 1 addition & 0 deletions DataFormats/L1TGlobal/interface/GlobalObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace l1t {
/// ObjNull catch all errors
enum GlobalObject {
gtMu,
gtMuShower,
gtEG,
gtJet,
gtTau,
Expand Down
5 changes: 5 additions & 0 deletions DataFormats/L1TGlobal/src/GlobalObject.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ using namespace l1t;

l1t::GlobalObject l1TGtObjectStringToEnum(const std::string& label) {
static const l1t::L1TGtObjectStringToEnum l1TGtObjectStringToEnumMap[] = {{"Mu", gtMu},
{"MuShower", gtMuShower},
{"EG", gtEG},
{"Tau", gtTau},
{"Jet", gtJet},
Expand Down Expand Up @@ -87,6 +88,10 @@ std::string l1t::l1TGtObjectEnumToString(const GlobalObject& gtObject) {
gtObjectString = "Mu";
} break;

case gtMuShower: {
gtObjectString = "MuShower";
} break;

case gtEG: {
gtObjectString = "EG";
} break;
Expand Down
10 changes: 9 additions & 1 deletion DataFormats/L1TMuon/interface/RegionalMuonShower.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@ namespace l1t {
RegionalMuonShower(bool oneNominalInTime = false,
bool oneNominalOutOfTime = false,
bool twoLooseInTime = false,
bool twoLooseOutOfTime = false);
bool twoLooseOutOfTime = false,
bool oneTightInTime = false,
bool oneTightOutOfTime = false);

~RegionalMuonShower();

void setOneNominalInTime(const bool bit) { isOneNominalInTime_ = bit; }
void setOneNominalOutOfTime(const bool bit) { isOneNominalOutOfTime_ = bit; }
void setOneTightInTime(const bool bit) { isOneTightInTime_ = bit; }
void setOneTightOutOfTime(const bool bit) { isOneTightOutOfTime_ = bit; }
void setTwoLooseOutOfTime(const bool bit) { isTwoLooseOutOfTime_ = bit; }
void setTwoLooseInTime(const bool bit) { isTwoLooseInTime_ = bit; }

Expand All @@ -34,6 +38,8 @@ namespace l1t {
bool isValid() const;
bool isOneNominalInTime() const { return isOneNominalInTime_; }
bool isOneNominalOutOfTime() const { return isOneNominalOutOfTime_; }
bool isOneTightInTime() const { return isOneTightInTime_; }
bool isOneTightOutOfTime() const { return isOneTightOutOfTime_; }
bool isTwoLooseInTime() const { return isTwoLooseInTime_; }
bool isTwoLooseOutOfTime() const { return isTwoLooseOutOfTime_; }

Expand All @@ -50,6 +56,8 @@ namespace l1t {
// in time and out-of-time qualities. only 2 bits each.
bool isOneNominalInTime_;
bool isOneNominalOutOfTime_;
bool isOneTightInTime_;
bool isOneTightOutOfTime_;
bool isTwoLooseInTime_;
bool isTwoLooseOutOfTime_;
int endcap_; // +/-1. For ME+ and ME-.
Expand Down
10 changes: 7 additions & 3 deletions DataFormats/L1TMuon/src/RegionalMuonShower.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
l1t::RegionalMuonShower::RegionalMuonShower(bool oneNominalInTime,
bool oneNominalOutOfTime,
bool twoLooseInTime,
bool twoLooseOutOfTime)
bool twoLooseOutOfTime,
bool oneTightInTime,
bool oneTightOutOfTime)
: isOneNominalInTime_(oneNominalInTime),
isOneNominalOutOfTime_(oneNominalOutOfTime),
isOneTightInTime_(oneTightInTime),
isOneTightOutOfTime_(oneTightOutOfTime),
isTwoLooseInTime_(twoLooseInTime),
isTwoLooseOutOfTime_(twoLooseOutOfTime),
endcap_(0),
Expand All @@ -15,10 +19,10 @@ l1t::RegionalMuonShower::RegionalMuonShower(bool oneNominalInTime,
l1t::RegionalMuonShower::~RegionalMuonShower() {}

bool l1t::RegionalMuonShower::isValid() const {
return isOneNominalInTime_ or isTwoLooseInTime_ or isOneNominalOutOfTime_ or isTwoLooseOutOfTime_;
return (isOneNominalInTime_ or isTwoLooseInTime_ or isOneTightInTime_);
}

bool l1t::RegionalMuonShower::operator==(const l1t::RegionalMuonShower& rhs) const {
return (isTwoLooseInTime_ == rhs.isTwoLooseInTime() and isOneNominalInTime_ == rhs.isOneNominalInTime() and
isTwoLooseOutOfTime_ == rhs.isTwoLooseOutOfTime() and isOneNominalOutOfTime_ == rhs.isOneNominalOutOfTime());
isOneTightInTime_ == rhs.isOneTightInTime());
}
3 changes: 2 additions & 1 deletion DataFormats/L1TMuon/src/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
<class name="l1t::RegionalMuonCandBxCollection"/>
<class name="edm::Wrapper<l1t::RegionalMuonCandBxCollection>"/>

<class name="l1t::RegionalMuonShower" ClassVersion="10">
<class name="l1t::RegionalMuonShower" ClassVersion="11">
<version ClassVersion="11" checksum="376206249"/>
<version ClassVersion="10" checksum="3501434665"/>
</class>
<class name="std::vector<l1t::RegionalMuonShower>"/>
Expand Down
59 changes: 46 additions & 13 deletions DataFormats/L1Trigger/interface/MuonShower.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,64 @@ namespace l1t {
MuonShower(bool oneNominalInTime = false,
bool oneNominalOutOfTime = false,
bool twoLooseInTime = false,
bool twoLooseOutOfTime = false);
bool twoLooseOutOfTime = false,
bool oneTightInTime = false,
bool oneTightOutOfTime = false);

~MuonShower() override;

void setOneNominalInTime(const bool bit) { isOneNominalInTime_ = bit; }
void setOneNominalOutOfTime(const bool bit) { isOneNominalOutOfTime_ = bit; }
void setTwoLooseInTime(const bool bit) { isTwoLooseInTime_ = bit; }
void setTwoLooseOutOfTime(const bool bit) { isTwoLooseOutOfTime_ = bit; }
/*
In CMSSW we consider 3 valid cases:
- 1 nominal shower (baseline trigger for physics at Run-3)
- 1 tight shower (backup trigger)
- 2 loose showers (to extend the physics reach)

In the uGT and UTM library, the hadronic shower trigger data is split
over 4 bits: 2 for in-time trigger data, 2 for out-of-time trigger data
- mus0, mus1 for in-time
- musOutOfTime0, musOutOfTime1 for out-of-time

The mapping for Run-3 startup is as follows:
- 1 nominal shower -> 0b01 (mus0)
- 1 tight shower -> 0b10 (mus1)

The 2 loose showers case would be mapped onto musOutOfTime0 and musOutOfTime1 later during Run-3
*/

void setMus0(const bool bit) { mus0_ = bit; }
void setMus1(const bool bit) { mus1_ = bit; }
void setMusOutOfTime0(const bool bit) { musOutOfTime0_ = bit; }
void setMusOutOfTime1(const bool bit) { musOutOfTime1_ = bit; }

bool mus0() const { return mus0_; }
bool mus1() const { return mus1_; }
bool musOutOfTime0() const { return musOutOfTime0_; }
bool musOutOfTime1() const { return musOutOfTime1_; }

// at least one bit must be valid
bool isValid() const;
bool isOneNominalInTime() const { return isOneNominalInTime_; }
bool isOneNominalOutOfTime() const { return isOneNominalOutOfTime_; }
bool isTwoLooseInTime() const { return isTwoLooseInTime_; }
bool isTwoLooseOutOfTime() const { return isTwoLooseOutOfTime_; }

// useful members for trigger performance studies
// needed at startup Run-3
bool isOneNominalInTime() const { return mus0_; }
bool isOneTightInTime() const { return mus1_; }
// to be developed during Run-3
bool isTwoLooseInTime() const { return false; }
// these options require more study
bool isOneNominalOutOfTime() const { return false; }
bool isTwoLooseOutOfTime() const { return false; }
bool isOneTightOutOfTime() const { return false; }

virtual bool operator==(const l1t::MuonShower& rhs) const;
virtual inline bool operator!=(const l1t::MuonShower& rhs) const { return !(operator==(rhs)); };

private:
// Run-3 definitions as provided in DN-20-033
// in time and out-of-time qualities. only 2 bits each.
bool isOneNominalInTime_;
bool isOneNominalOutOfTime_;
bool isTwoLooseInTime_;
bool isTwoLooseOutOfTime_;
bool mus0_;
bool mus1_;
bool musOutOfTime0_;
bool musOutOfTime1_;
};

} // namespace l1t
Expand Down
25 changes: 15 additions & 10 deletions DataFormats/L1Trigger/src/MuonShower.cc
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
#include "DataFormats/L1Trigger/interface/MuonShower.h"

l1t::MuonShower::MuonShower(bool oneNominalInTime, bool oneNominalOutOfTime, bool twoLooseInTime, bool twoLooseOutOfTime)
l1t::MuonShower::MuonShower(bool oneNominalInTime,
bool oneNominalOutOfTime,
bool twoLooseInTime,
bool twoLooseOutOfTime,
bool oneTightInTime,
bool oneTightOutOfTime)
: L1Candidate(math::PtEtaPhiMLorentzVector{0., 0., 0., 0.}, 0., 0., 0., 0, 0),
isOneNominalInTime_(oneNominalInTime),
isOneNominalOutOfTime_(oneNominalOutOfTime),
isTwoLooseInTime_(twoLooseInTime),
isTwoLooseOutOfTime_(twoLooseOutOfTime) {}
// in this object it makes more sense to the different shower types to
// the 4 bits, so that the object easily interfaces with the uGT emulator
mus0_(oneNominalInTime),
mus1_(oneTightInTime),
musOutOfTime0_(false),
musOutOfTime1_(false) {}

l1t::MuonShower::~MuonShower() {}

bool l1t::MuonShower::isValid() const {
return isOneNominalInTime_ or isTwoLooseInTime_ or isOneNominalOutOfTime_ or isTwoLooseOutOfTime_;
}
bool l1t::MuonShower::isValid() const { return mus0_ or mus1_ or musOutOfTime0_ or musOutOfTime1_; }

bool l1t::MuonShower::operator==(const l1t::MuonShower& rhs) const {
return (isTwoLooseInTime_ == rhs.isTwoLooseInTime() and isOneNominalInTime_ == rhs.isOneNominalInTime() and
isTwoLooseOutOfTime_ == rhs.isTwoLooseOutOfTime() and isOneNominalOutOfTime_ == rhs.isOneNominalOutOfTime());
return (mus0_ == rhs.mus0() and mus1_ == rhs.mus1() and musOutOfTime0_ == rhs.musOutOfTime0() and
musOutOfTime1_ == rhs.musOutOfTime1());
}
3 changes: 2 additions & 1 deletion DataFormats/L1Trigger/src/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@
<class name="l1t::MuonVectorRef"/>
<class name="edm::Wrapper<l1t::MuonVectorRef>"/>

<class name="l1t::MuonShower" ClassVersion="10">
<class name="l1t::MuonShower" ClassVersion="11">
<version ClassVersion="11" checksum="3610959089"/>
<version ClassVersion="10" checksum="3869296059"/>
</class>
<class name="edm::Ptr<l1t::MuonShower>"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ class CSCAnodeLCTProcessor : public CSCBaseboard {
unsigned showerMaxInTBin_;
unsigned showerMinOutTBin_;
unsigned showerMaxOutTBin_;
unsigned minLayersCentralTBin_;

/** Configuration parameters. */
unsigned int fifo_tbins, fifo_pretrig, drift_delay;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ class CSCCathodeLCTProcessor : public CSCBaseboard {
unsigned showerMaxInTBin_;
unsigned showerMinOutTBin_;
unsigned showerMaxOutTBin_;
unsigned minLayersCentralTBin_;

/** Configuration parameters. */
unsigned int fifo_tbins, fifo_pretrig; // only for test beam mode.
Expand Down
44 changes: 25 additions & 19 deletions L1Trigger/CSCTriggerPrimitives/python/params/showerParams.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
## loose -> 'loose anode or loose cathode'
## nominal -> 'nominal anode or nominal cathode'
## tight -> 'tight anode or tight cathode'
source = cms.uint32(0),
## 3: cathode and anode showers
## loose -> 'loose anode and loose cathode'
## nominal -> 'nominal anode and nominal cathode'
## tight -> 'tight anode and tight cathode'
source = cms.uint32(3),

## settings for cathode showers (counting CSCComparatorDigi)
cathodeShower = cms.PSet(
Expand All @@ -21,53 +25,55 @@
# ME1/1
100, 100, 100,
# ME1/2
54, 55, 61,
19, 38, 42,
# ME1/3
20, 20, 30,
8, 11, 15,
# ME2/1
35, 35, 35,
17, 33, 35,
# ME2/2
29, 29, 35,
10, 20, 24,
# ME3/1
35, 35, 40,
15, 31, 33,
# ME3/2
24, 25, 30,
9, 18, 22,
# ME4/1
36, 40, 40,
17, 34, 36,
# ME4/2
26, 30, 30
11, 22, 26
),
showerMinInTBin = cms.uint32(6),
showerMaxInTBin = cms.uint32(8),
showerMinOutTBin = cms.uint32(2),
showerMaxOutTBin = cms.uint32(5),
minLayersCentralTBin = cms.uint32(5),
),
## settings for anode showers (counting CSCWireDigi)
anodeShower = cms.PSet(
## {loose, nominal, tight} thresholds for hit counters
showerThresholds = cms.vuint32(
# ME1/1
104, 105, 107,
140, 140, 140,
# ME1/2
92, 100, 102,
20, 41, 45,
# ME1/3
32, 33, 48,
8, 12, 16,
# ME2/1
133, 134, 136,
28, 56, 58,
# ME2/2
83, 84, 86,
9, 18, 22,
# ME3/1
130, 131, 133,
26, 55, 57,
# ME3/2
74, 80, 87,
8, 16, 20,
# ME4/1
127, 128, 130,
31, 62, 64,
# ME4/2
88, 89, 94
13, 27, 31
),
showerMinInTBin = cms.uint32(8),
showerMaxInTBin = cms.uint32(10),
showerMaxInTBin = cms.uint32(8),
showerMinOutTBin = cms.uint32(4),
showerMaxOutTBin = cms.uint32(7),
minLayersCentralTBin = cms.uint32(5),
)
)
Loading