Skip to content

Commit

Permalink
Merge pull request cms-sw#138 from thomreis/l1t-muon-pass2-CMSSW_8_0_…
Browse files Browse the repository at this point in the history
…0_pre5_RegionalMuonCand-EMTF-address-scheme

merged
  • Loading branch information
thomreis committed Feb 1, 2016
2 parents 68fc0eb + 1543d6d commit e802ab2
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 14 deletions.
2 changes: 1 addition & 1 deletion DataFormats/L1TMuon/interface/RegionalMuonCand.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class RegionalMuonCand {
};
/// Enum to identify the individual parts of the EMTF track address
enum emtfAddress {
kME12=0, kME22=1
kSectorId=0, kME1=1, kME1SubSecId=2, kME1Order=3, kME2=4, kME2SubSecId=5, kME2Order=6, kME3=7, kME3SubSecId=8, kME3Order=9, kME4=10, kME4SubSecId=11, kME4Order=12
};


Expand Down
24 changes: 19 additions & 5 deletions L1Trigger/L1TMuon/interface/RegionalMuonRawDigiTranslator.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,25 @@ namespace l1t {
static const unsigned bmtfTrAddrStat3Shift_ = 6;
static const unsigned bmtfTrAddrStat4Mask_ = 0xF;
static const unsigned bmtfTrAddrStat4Shift_ = 2;
// TODO: set real widths and shifts for EMTF
static const unsigned emtfTrAddrMe12Mask_ = 0x1FFFFFFF;
static const unsigned emtfTrAddrMe12Shift_ = 0;
static const unsigned emtfTrAddrMe22Mask_ = 0x1FFFFFFF;
static const unsigned emtfTrAddrMe22Shift_ = 0;

static const unsigned emtfTrAddrSectIdMask_ = 0xF;
static const unsigned emtfTrAddrSectIdShift_ = 0;
static const unsigned emtfTrAddrMe1Mask_ = 0x1F;
static const unsigned emtfTrAddrMe1Shift_ = 4;
static const unsigned emtfTrAddrMe1SubSecIdShift_ = 9;
static const unsigned emtfTrAddrMe1OrderShift_ = 10;
static const unsigned emtfTrAddrMe2Mask_ = 0xF;
static const unsigned emtfTrAddrMe2Shift_ = 11;
static const unsigned emtfTrAddrMe2SubSecIdShift_ = 15;
static const unsigned emtfTrAddrMe2OrderShift_ = 16;
static const unsigned emtfTrAddrMe3Mask_ = 0x3;
static const unsigned emtfTrAddrMe3Shift_ = 17;
static const unsigned emtfTrAddrMe3SubSecIdShift_ = 19;
static const unsigned emtfTrAddrMe3OrderShift_ = 20;
static const unsigned emtfTrAddrMe4Mask_ = 0x3;
static const unsigned emtfTrAddrMe4Shift_ = 21;
static const unsigned emtfTrAddrMe4SubSecIdShift_ = 23;
static const unsigned emtfTrAddrMe4OrderShift_ = 24;
};
}

Expand Down
32 changes: 26 additions & 6 deletions L1Trigger/L1TMuon/src/RegionalMuonRawDigiTranslator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,19 @@ l1t::RegionalMuonRawDigiTranslator::fillRegionalMuonCand(RegionalMuonCand& mu, u
mu.setTrackSubAddress(RegionalMuonCand::kSegSelStat3, segSel & 0x4);
mu.setTrackSubAddress(RegionalMuonCand::kSegSelStat4, segSel & 0x8);
} else if (tf == emtf_neg || tf == emtf_pos) {
int me12 = (rawTrackAddress >> emtfTrAddrMe12Shift_) & emtfTrAddrMe12Mask_;
int me22 = (rawTrackAddress >> emtfTrAddrMe22Shift_) & emtfTrAddrMe22Mask_;
mu.setTrackSubAddress(RegionalMuonCand::kME12, me12);
mu.setTrackSubAddress(RegionalMuonCand::kME22, me22);
mu.setTrackSubAddress(RegionalMuonCand::kSectorId, (rawTrackAddress >> emtfTrAddrSectIdShift_) & emtfTrAddrSectIdMask_);
mu.setTrackSubAddress(RegionalMuonCand::kME1, (rawTrackAddress >> emtfTrAddrMe1Shift_) & emtfTrAddrMe1Mask_);
mu.setTrackSubAddress(RegionalMuonCand::kME1SubSecId, (rawTrackAddress >> emtfTrAddrMe1SubSecIdShift_) & 0x1);
mu.setTrackSubAddress(RegionalMuonCand::kME1Order, (rawTrackAddress >> emtfTrAddrMe1OrderShift_) & 0x1);
mu.setTrackSubAddress(RegionalMuonCand::kME2, (rawTrackAddress >> emtfTrAddrMe2Shift_) & emtfTrAddrMe2Mask_);
mu.setTrackSubAddress(RegionalMuonCand::kME2SubSecId, (rawTrackAddress >> emtfTrAddrMe2SubSecIdShift_) & 0x1);
mu.setTrackSubAddress(RegionalMuonCand::kME2Order, (rawTrackAddress >> emtfTrAddrMe2OrderShift_) & 0x1);
mu.setTrackSubAddress(RegionalMuonCand::kME3, (rawTrackAddress >> emtfTrAddrMe3Shift_) & emtfTrAddrMe3Mask_);
mu.setTrackSubAddress(RegionalMuonCand::kME3SubSecId, (rawTrackAddress >> emtfTrAddrMe3SubSecIdShift_) & 0x1);
mu.setTrackSubAddress(RegionalMuonCand::kME3Order, (rawTrackAddress >> emtfTrAddrMe3OrderShift_) & 0x1);
mu.setTrackSubAddress(RegionalMuonCand::kME4, (rawTrackAddress >> emtfTrAddrMe4Shift_) & emtfTrAddrMe4Mask_);
mu.setTrackSubAddress(RegionalMuonCand::kME4SubSecId, (rawTrackAddress >> emtfTrAddrMe4SubSecIdShift_) & 0x1);
mu.setTrackSubAddress(RegionalMuonCand::kME4Order, (rawTrackAddress >> emtfTrAddrMe4OrderShift_) & 0x1);
} else {
std::map<int, int> trackAddr;
trackAddr[0] = rawTrackAddress;
Expand Down Expand Up @@ -115,8 +124,19 @@ l1t::RegionalMuonRawDigiTranslator::generatePackedDataWords(const RegionalMuonCa
| (stat3 & bmtfTrAddrStat3Mask_) << bmtfTrAddrStat3Shift_
| (stat4 & bmtfTrAddrStat4Mask_) << bmtfTrAddrStat4Shift_;
} else if (tf == emtf_neg || tf == emtf_pos) {
rawTrkAddr = (mu.trackSubAddress(RegionalMuonCand::kME12) & emtfTrAddrMe12Mask_) << emtfTrAddrMe12Shift_
| (mu.trackSubAddress(RegionalMuonCand::kME22) & emtfTrAddrMe22Mask_) << emtfTrAddrMe22Shift_;
rawTrkAddr = (mu.trackSubAddress(RegionalMuonCand::kSectorId) & emtfTrAddrSectIdMask_) << emtfTrAddrSectIdShift_
| (mu.trackSubAddress(RegionalMuonCand::kME1) & emtfTrAddrMe1Mask_) << emtfTrAddrMe1Shift_
| (mu.trackSubAddress(RegionalMuonCand::kME1SubSecId) & 0x1) << emtfTrAddrMe1SubSecIdShift_
| (mu.trackSubAddress(RegionalMuonCand::kME1Order) & 0x1) << emtfTrAddrMe1OrderShift_
| (mu.trackSubAddress(RegionalMuonCand::kME2) & emtfTrAddrMe2Mask_) << emtfTrAddrMe2Shift_
| (mu.trackSubAddress(RegionalMuonCand::kME2SubSecId) & 0x1) << emtfTrAddrMe2SubSecIdShift_
| (mu.trackSubAddress(RegionalMuonCand::kME2Order) & 0x1) << emtfTrAddrMe2OrderShift_
| (mu.trackSubAddress(RegionalMuonCand::kME3) & emtfTrAddrMe3Mask_) << emtfTrAddrMe3Shift_
| (mu.trackSubAddress(RegionalMuonCand::kME3SubSecId) & 0x1) << emtfTrAddrMe3SubSecIdShift_
| (mu.trackSubAddress(RegionalMuonCand::kME3Order) & 0x1) << emtfTrAddrMe3OrderShift_
| (mu.trackSubAddress(RegionalMuonCand::kME4) & emtfTrAddrMe4Mask_) << emtfTrAddrMe4Shift_
| (mu.trackSubAddress(RegionalMuonCand::kME4SubSecId) & 0x1) << emtfTrAddrMe4SubSecIdShift_
| (mu.trackSubAddress(RegionalMuonCand::kME4Order) & 0x1) << emtfTrAddrMe4OrderShift_;
} else {
rawTrkAddr = mu.trackAddress().at(0);
}
Expand Down
4 changes: 2 additions & 2 deletions L1Trigger/L1TMuonEndCap/interface/MakeRegionalCand.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ l1t::RegionalMuonCand MakeRegionalCand(float pt, int phi, int theta,
Cand.setHwSignValid(0);
Cand.setHwQual(iQual);
// jl: FIXME this has to be adapted to the new schema of saving track addresses
Cand.setTrackSubAddress(l1t::RegionalMuonCand::kME12, trackaddress&0xf);
Cand.setTrackSubAddress(l1t::RegionalMuonCand::kME22, trackaddress>>4);
//Cand.setTrackSubAddress(l1t::RegionalMuonCand::kME12, trackaddress&0xf);
//Cand.setTrackSubAddress(l1t::RegionalMuonCand::kME22, trackaddress>>4);
Cand.setTFIdentifiers(sector,TFtype);


Expand Down

0 comments on commit e802ab2

Please sign in to comment.