Skip to content

Commit

Permalink
Merge pull request #1 from tahuang1991/HMT_emulation_12_5_X
Browse files Browse the repository at this point in the history
Update the CSCDigi shower constructor and also where the constructor is called
  • Loading branch information
kakwok committed Aug 4, 2022
2 parents af71bd7 + e6bd40e commit 6d7b6e2
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 28 deletions.
17 changes: 12 additions & 5 deletions DataFormats/CSCDigi/interface/CSCShowerDigi.h
Expand Up @@ -11,16 +11,23 @@ class CSCShowerDigi {
// Run-3 definitions as provided in DN-20-033
enum Run3Shower { kInvalid = 0, kLoose = 1, kNominal = 2, kTight = 3 };
// Shower types. and showers from OTMB/TMB are assigned with kLCTShower
enum ShowerType { kInvalidShower = 0, kALCTShower = 1, kCLCTShower = 2, kLCTShower = 3 };
enum ShowerType {
kInvalidShower = 0,
kALCTShower = 1,
kCLCTShower = 2,
kLCTShower = 3,
kEMTFShower = 4,
kGMTShower = 5
};

/// Constructors
CSCShowerDigi(const uint16_t inTimeBits,
const uint16_t outTimeBits,
const uint16_t cscID,
const uint16_t bx,
const uint16_t showerType,
const uint16_t wireNHits,
const uint16_t compNHits);
const uint16_t bx = 0,
const uint16_t showerType = 4,
const uint16_t wireNHits = 0,
const uint16_t compNHits = 0);
/// default
CSCShowerDigi();

Expand Down
31 changes: 27 additions & 4 deletions DataFormats/CSCDigi/src/CSCShowerDigi.cc
Expand Up @@ -61,11 +61,34 @@ std::ostream& operator<<(std::ostream& o, const CSCShowerDigi& digi) {
compHitsStr += std::to_string(digi.getComparatorNHits());
std::string wireHitsStr(", wireHits ");
wireHitsStr += std::to_string(digi.getWireNHits());
std::string showerStr;
switch (showerType) {
case 0:
showerStr = "Invalid ShowerType";
break;
case 1:
showerStr = "AnodeShower";
break;
case 2:
showerStr = "CathodeShower";
break;
case 3:
showerStr = "MatchedShower";
break;
case 4:
showerStr = "EMTFShower";
break;
case 5:
showerStr = "GMTShower";
break;
default:
showerStr = "UnknownShowerType";
}

return o << (showerType == 0
? "Invalid ShowerType"
: (showerType == 1 ? "ALCTShower" : (showerType == 2 ? "CLCTShower" : "correlatedLCTShower")))
<< ": bx " << digi.getBX() << ", in-time bits " << digi.bitsInTime() << ", out-of-time bits "
//return o << (showerType == 0
// ? "Invalid ShowerType"
// : (showerType == 1 ? "ALCTShower" : (showerType == 2 ? "CLCTShower" : "correlatedLCTShower")))
return o << showerStr << ": bx " << digi.getBX() << ", in-time bits " << digi.bitsInTime() << ", out-of-time bits "
<< digi.bitsOutOfTime() << ((showerType == 1 or showerType == 3) ? wireHitsStr : "")
<< ((showerType == 2 or showerType == 3) ? compHitsStr : "") << ";";
}
2 changes: 1 addition & 1 deletion EventFilter/CSCRawToDigi/interface/CSCALCTHeader.h
Expand Up @@ -170,7 +170,7 @@ class CSCALCTHeader {
for (unsigned bx = 0; bx < header2007.lctBins; bx++) {
//CSCID is set to be 0
//ALCTshower, showerType_= 1, wireNHits and ComparatorNHits are not available in data
results.push_back(CSCShowerDigi(theALCTs[bx * 2].reserved & 0x3, 0, 0, bx, 1, 0, 0));
results.push_back(CSCShowerDigi(theALCTs[bx * 2].reserved & 0x3, 0, 0, bx, CSCShowerDigi::ShowerType::kALCTShower, 0, 0));
}
return results;
} else
Expand Down
6 changes: 3 additions & 3 deletions EventFilter/CSCRawToDigi/src/CSCTMBHeader2020_CCLUT.cc
Expand Up @@ -168,23 +168,23 @@ CSCShowerDigi CSCTMBHeader2020_CCLUT::showerDigi(uint32_t idlayer) const {
uint16_t bx = CSCConstants::LCT_CENTRAL_BX - bits.pop_l1a_match_win;
//LCTshower with showerType = 3. comparatorNHits from hmt_nhits() and wireNHit is not available
CSCShowerDigi result(
hmt_bits & 0x3, (hmt_bits >> 2) & 0x3, cscid, bx, 3, 0, hmt_nhits()); // 2-bits intime, 2-bits out of time
hmt_bits & 0x3, (hmt_bits >> 2) & 0x3, cscid, bx, CSCShowerDigi::ShowerType::kLCTShower, 0, hmt_nhits()); // 2-bits intime, 2-bits out of time
return result;
}

CSCShowerDigi CSCTMBHeader2020_CCLUT::anodeShowerDigi(uint32_t idlayer) const {
uint16_t cscid = bits.cscID;
uint16_t bx = CSCConstants::LCT_CENTRAL_BX - bits.pop_l1a_match_win;
//ALCT shower with showerType = 1. nhits_ is not available from unpack data
CSCShowerDigi result(bits.anode_hmt & 0x3, 0, cscid, bx, 1, 0, 0); // 2-bits intime, no out of time
CSCShowerDigi result(bits.anode_hmt & 0x3, 0, cscid, bx, CSCShowerDigi::ShowerType::kALCTShower, 0, 0); // 2-bits intime, no out of time
return result;
}

CSCShowerDigi CSCTMBHeader2020_CCLUT::cathodeShowerDigi(uint32_t idlayer) const {
uint16_t cscid = bits.cscID;
uint16_t bx = CSCConstants::LCT_CENTRAL_BX - bits.pop_l1a_match_win - bits.hmt_match_win + 3;
//CLCT shower with showerType = 2.
CSCShowerDigi result(bits.cathode_hmt & 0x3, 0, cscid, bx, 2, 0, hmt_nhits()); // 2-bits intime, no out of time
CSCShowerDigi result(bits.cathode_hmt & 0x3, 0, cscid, bx, CSCShowerDigi::ShowerType::kCLCTShower, 0, hmt_nhits()); // 2-bits intime, no out of time
return result;
}

Expand Down
6 changes: 3 additions & 3 deletions EventFilter/CSCRawToDigi/src/CSCTMBHeader2020_GEM.cc
Expand Up @@ -172,23 +172,23 @@ CSCShowerDigi CSCTMBHeader2020_GEM::showerDigi(uint32_t idlayer) const {
uint16_t bx = CSCConstants::LCT_CENTRAL_BX - bits.pop_l1a_match_win;
//LCTshower with showerType = 3. comparatorNHits from hmt_nhits() and wireNHits is not available
CSCShowerDigi result(
hmt_bits & 0x3, (hmt_bits >> 2) & 0x3, cscid, bx, 3, 0, hmt_nhits()); // 2-bits intime, 2-bits out of time
hmt_bits & 0x3, (hmt_bits >> 2) & 0x3, cscid, bx, CSCShowerDigi::ShowerType::kLCTShower, 0, hmt_nhits()); // 2-bits intime, 2-bits out of time
return result;
}

CSCShowerDigi CSCTMBHeader2020_GEM::anodeShowerDigi(uint32_t idlayer) const {
uint16_t cscid = bits.cscID;
uint16_t bx = CSCConstants::LCT_CENTRAL_BX - bits.pop_l1a_match_win;
//ALCT shower with showerType = 1. wireNHits is not available from unpack data
CSCShowerDigi result(bits.anode_hmt & 0x3, 0, cscid, bx, 1, 0, 0); // 2-bits intime, no out of time
CSCShowerDigi result(bits.anode_hmt & 0x3, 0, cscid, bx, CSCShowerDigi::ShowerType::kALCTShower, 0, 0); // 2-bits intime, no out of time
return result;
}

CSCShowerDigi CSCTMBHeader2020_GEM::cathodeShowerDigi(uint32_t idlayer) const {
uint16_t cscid = bits.cscID;
uint16_t bx = CSCConstants::LCT_CENTRAL_BX - bits.pop_l1a_match_win - bits.hmt_match_win + 3;
//CLCT shower with showerType = 2. comparatorNHits from hmt_nhits()
CSCShowerDigi result(bits.cathode_hmt & 0x3, 0, cscid, bx, 2, 0, hmt_nhits()); // 2-bits intime, no out of time
CSCShowerDigi result(bits.cathode_hmt & 0x3, 0, cscid, bx, CSCShowerDigi::ShowerType::kCLCTShower, 0, hmt_nhits()); // 2-bits intime, no out of time
return result;
}

Expand Down
6 changes: 3 additions & 3 deletions EventFilter/CSCRawToDigi/src/CSCTMBHeader2020_TMB.cc
Expand Up @@ -138,23 +138,23 @@ CSCShowerDigi CSCTMBHeader2020_TMB::showerDigi(uint32_t idlayer) const {
uint16_t bx = CSCConstants::LCT_CENTRAL_BX - bits.pop_l1a_match_win;
//LCTshower with showerType = 3. wireNHits is not avaiable
//TMB LCT shower is copied from ALCT shower
CSCShowerDigi result(hmt_bits & 0x3, (hmt_bits >> 2) & 0x3, cscid, bx, 3, 0, 0); // 2-bits intime, 2-bits out of time
CSCShowerDigi result(hmt_bits & 0x3, (hmt_bits >> 2) & 0x3, cscid, bx, CSCShowerDigi::ShowerType::kLCTShower, 0, 0); // 2-bits intime, 2-bits out of time
return result;
}

CSCShowerDigi CSCTMBHeader2020_TMB::anodeShowerDigi(uint32_t idlayer) const {
uint16_t cscid = bits.cscID;
uint16_t bx = CSCConstants::LCT_CENTRAL_BX - bits.pop_l1a_match_win;
//ALCTshower with showerType = 1. wireNHits is not avaiable
CSCShowerDigi result(bits.anode_hmt & 0x3, 0, cscid, bx, 1, 0, 0); // 2-bits intime, no out of time
CSCShowerDigi result(bits.anode_hmt & 0x3, 0, cscid, bx, CSCShowerDigi::ShowerType::kALCTShower, 0, 0); // 2-bits intime, no out of time
return result;
}

CSCShowerDigi CSCTMBHeader2020_TMB::cathodeShowerDigi(uint32_t idlayer) const {
uint16_t cscid = bits.cscID;
uint16_t bx = CSCConstants::LCT_CENTRAL_BX - bits.pop_l1a_match_win;
//CLCTshower with showerType = 2. comparatorNhits is not avaiable for TMB yet
CSCShowerDigi result(bits.cathode_hmt & 0x3, 0, cscid, bx, 2, 0, 0); // 2-bits intime, no out of time
CSCShowerDigi result(bits.cathode_hmt & 0x3, 0, cscid, bx, CSCShowerDigi::ShowerType::kCLCTShower, 0, 0); // 2-bits intime, no out of time
return result;
}

Expand Down
Expand Up @@ -304,7 +304,9 @@ namespace l1t {
// Fill the CSCShowerDigi
CSCShowerDigi Shower_(ME_.HMT_inTime() == -99 ? 0 : ME_.HMT_inTime(),
ME_.HMT_outOfTime() == -99 ? 0 : ME_.HMT_outOfTime(),
Hit_.CSC_DetId());
Hit_.CSC_DetId(),
Hit_.BX(),
CSCShowerDigi::ShowerType::kEMTFShower);

// Set the stub number for this hit
// Each chamber can send up to 2 stubs per BX
Expand Down
7 changes: 2 additions & 5 deletions L1Trigger/CSCTriggerPrimitives/src/CSCAnodeLCTProcessor.cc
Expand Up @@ -85,10 +85,6 @@ CSCAnodeLCTProcessor::CSCAnodeLCTProcessor(unsigned endcap,
const auto& shower = showerParams_.getParameterSet("anodeShower");
thresholds_ = shower.getParameter<std::vector<unsigned>>("showerThresholds");
showerNumTBins_ = shower.getParameter<unsigned>("showerNumTBins");
//showerMinInTBin_ = shower.getParameter<unsigned>("showerMinInTBin");
//showerMaxInTBin_ = shower.getParameter<unsigned>("showerMaxInTBin");
//showerMinOutTBin_ = shower.getParameter<unsigned>("showerMinOutTBin");
//showerMaxOutTBin_ = shower.getParameter<unsigned>("showerMaxOutTBin");
minLayersCentralTBin_ = shower.getParameter<unsigned>("minLayersCentralTBin");
}

Expand Down Expand Up @@ -1415,6 +1411,7 @@ void CSCAnodeLCTProcessor::encodeHighMultiplicityBits() {
}
}
//ALCT shower construction with showerType_=1, comparatorhits_= 0;
anode_showers_[bx] = CSCShowerDigi(this_inTimeHMT, false, theTrigChamber, bx, 1, this_hitsInTime, 0);
anode_showers_[bx] = CSCShowerDigi(
this_inTimeHMT, false, theTrigChamber, bx, CSCShowerDigi::ShowerType::kALCTShower, this_hitsInTime, 0);
}
}
3 changes: 2 additions & 1 deletion L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc
Expand Up @@ -1294,6 +1294,7 @@ void CSCCathodeLCTProcessor::encodeHighMultiplicityBits() {
}
}
//CLCTshower constructor with showerType_ = 2, wirehits = 0;
cathode_showers_[bx] = CSCShowerDigi(this_inTimeHMT, false, theTrigChamber, bx, 2, 0, this_hitsInTime);
cathode_showers_[bx] = CSCShowerDigi(
this_inTimeHMT, false, theTrigChamber, bx, CSCShowerDigi::ShowerType::kCLCTShower, 0, this_hitsInTime);
}
}
9 changes: 7 additions & 2 deletions L1Trigger/CSCTriggerPrimitives/src/CSCMotherboard.cc
Expand Up @@ -640,8 +640,13 @@ void CSCMotherboard::matchShowers(CSCShowerDigi* anode_showers, CSCShowerDigi* c
matchHMT = 1;
}
//LCTShower with showerType = 3
showers_[bx] = CSCShowerDigi(
matchHMT & 3, false, ashower.getCSCID(), bx, 3, ashower.getWireNHits(), cshower.getComparatorNHits());
showers_[bx] = CSCShowerDigi(matchHMT & 3,
false,
ashower.getCSCID(),
bx,
CSCShowerDigi::ShowerType::kLCTShower,
ashower.getWireNHits(),
cshower.getComparatorNHits());
}
}

Expand Down

0 comments on commit 6d7b6e2

Please sign in to comment.