|
 |
#include <L1Trigger/L1TMuon/src/L1TMuonProducer.cc>
|
void | addMuonsToCollections (MicroGMTConfiguration::InterMuonList &coll, MicroGMTConfiguration::InterMuonList &interout, std::unique_ptr< MuonBxCollection > &out, int bx) const |
|
void | beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override |
|
void | beginRun (edm::Run const &, edm::EventSetup const &) override |
|
void | calculateRank (MicroGMTConfiguration::InterMuonList &muons) const |
|
void | convertMuons (edm::Handle< MicroGMTConfiguration::InputCollection > const &in, MicroGMTConfiguration::InterMuonList &out, GMTInternalWedges &wedges, int bx) const |
|
void | endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override |
|
void | endRun (edm::Run const &, edm::EventSetup const &) override |
|
void | produce (edm::Event &, const edm::EventSetup &) override |
|
void | sortMuons (MicroGMTConfiguration::InterMuonList &, unsigned) const |
|
void | splitAndConvertMuons (edm::Handle< MicroGMTConfiguration::InputCollection > const &in, MicroGMTConfiguration::InterMuonList &out_pos, MicroGMTConfiguration::InterMuonList &out_neg, GMTInternalWedges &wedges_pos, GMTInternalWedges &wedges_neg, int bx) const |
|
Description: Takes txt-file input and produces barrel- / overlap- / forward TF muons
Implementation: [Notes on implementation]
Definition at line 58 of file L1TMuonProducer.cc.
◆ L1TMuonProducer()
Definition at line 140 of file L1TMuonProducer.cc.
166 produces<MuonBxCollection>();
167 produces<MuonBxCollection>(
"imdMuonsBMTF");
168 produces<MuonBxCollection>(
"imdMuonsEMTFPos");
169 produces<MuonBxCollection>(
"imdMuonsEMTFNeg");
170 produces<MuonBxCollection>(
"imdMuonsOMTFPos");
171 produces<MuonBxCollection>(
"imdMuonsOMTFNeg");
References edm::ParameterSet::getParameter(), m_autoBxRange, m_autoCancelMode, m_barrelTfInputTag, m_barrelTfInputToken, m_bxMax, m_bxMin, m_caloTowerInputToken, m_emtfCancelMode, m_endcapTfInputTag, m_endcapTfInputToken, m_overlapTfInputTag, m_overlapTfInputToken, m_trigTowerTag, AlCaHLTBitMon_QueryRunRegistry::string, and PDWG_EXOHSCP_cff::tracks.
◆ ~L1TMuonProducer()
L1TMuonProducer::~L1TMuonProducer |
( |
| ) |
|
|
override |
◆ addMuonsToCollections()
◆ beginLuminosityBlock()
◆ beginRun()
Definition at line 526 of file L1TMuonProducer.cc.
529 microGMTParamsRcd.
get(microGMTParamsHandle);
531 std::unique_ptr<L1TMuonGlobalParams_PUBLIC> microGMTParams(
533 if (microGMTParams->pnodes_.empty()) {
545 <<
"\n EMTF-|OMTF-| BMTF |OMTF+|EMTF+| CALO | res 0";
553 <<
"\n EMTF-|OMTF-| BMTF |OMTF+|EMTF+| CALO | res 0";
References cast_to_L1TMuonGlobalParams(), cast_to_L1TMuonGlobalParams_PUBLIC(), l1t::MicroGMTRankPtQualLUTFactory::create(), edm::EventSetup::get(), edm::eventsetup::EventSetupRecordImplementation< T >::get(), get, l1t::MicroGMTCancelOutUnit::initialise(), l1t::MicroGMTIsolationUnit::initialise(), m_autoCancelMode, m_bmtfInputsToDisable, m_caloInputsToDisable, m_cancelOutUnit, m_emtfCancelMode, m_emtfInputsToDisable, m_inputsToDisable, m_isolationUnit, m_maskedBmtfInputs, m_maskedCaloInputs, m_maskedEmtfInputs, m_maskedInputs, m_maskedOmtfInputs, m_omtfInputsToDisable, m_rankPtQualityLUT, microGMTParamsHelper, edm::ESHandle< T >::product(), and PDWG_EXOHSCP_cff::tracks.
◆ calculateRank()
◆ compareMuons()
◆ convertMuons()
Definition at line 490 of file L1TMuonProducer.cc.
495 for (
int i = 0;
i < 12; ++
i) {
496 wedges[
i] = std::vector<std::shared_ptr<GMTInternalMuon>>();
497 wedges[
i].reserve(3);
499 if (bx < in->getFirstBX() ||
bx >
in->getLastBX())
503 for (
size_t i = 0;
i <
in->size(
bx); ++
i, ++muIdx) {
507 if (currentLink !=
link) {
511 int gPhi = MicroGMTConfiguration::calcGlobalPhi(
512 in->at(
bx,
i).hwPhi(),
in->at(
bx,
i).trackFinderType(),
in->at(
bx,
i).processor());
513 int tfMuonIdx = 3 * (currentLink - 36) + muIdx;
514 std::shared_ptr<GMTInternalMuon> outMu = std::make_shared<GMTInternalMuon>(
in->at(
bx,
i), gPhi, tfMuonIdx);
515 out.emplace_back(outMu);
516 wedges[
in->at(
bx,
i).processor()].push_back(outMu);
518 for (
int i = 0;
i < 12; ++
i) {
519 if (wedges[
i].
size() > 3)
520 edm::LogWarning(
"Input Mismatch") <<
" too many inputs per processor for barrel. Wedge " <<
i <<
": Size "
521 << wedges[
i].size() << std::endl;
References l1GtPatternGenerator_cfi::bx, mps_fire::i, recoMuon::in, MainPageGenerator::link, m_inputsToDisable, m_maskedInputs, MillePedeFileConverter_cfg::out, and findQualityFiles::size.
Referenced by produce().
◆ endLuminosityBlock()
◆ endRun()
◆ fillDescriptions()
◆ produce()
Definition at line 181 of file L1TMuonProducer.cc.
265 splitAndConvertMuons(emtfMuons, internMuonsEmtfPos, internMuonsEmtfNeg, emtfPosWedges, emtfNegWedges,
bx);
266 splitAndConvertMuons(omtfMuons, internMuonsOmtfPos, internMuonsOmtfNeg, omtfPosWedges, omtfNegWedges,
bx);
315 for (
const auto&
mu : internalMuons) {
316 if (
mu->hwPt() > 0) {
318 (
mu->hwPt() - 1) * 0.5,
mu->hwEta() * 0.010875,
mu->hwGlobalPhi() * 0.010908, 0.0};
319 int iso =
mu->hwAbsIso() + (
mu->hwRelIso() << 1);
320 int outMuQual = MicroGMTConfiguration::setOutputMuonQuality(
mu->hwQual(),
mu->trackFinderType(),
mu->hwHF());
336 if (
mu->hwSignValid()) {
337 outMu.setCharge(1 - 2 *
mu->hwSign());
342 outMu.setHwEtaAtVtx(MicroGMTConfiguration::calcMuonHwEtaExtra(outMu));
343 outMu.setHwPhiAtVtx(MicroGMTConfiguration::calcMuonHwPhiExtra(outMu));
344 outMu.setEtaAtVtx(MicroGMTConfiguration::calcMuonEtaExtra(outMu));
345 outMu.setPhiAtVtx(MicroGMTConfiguration::calcMuonPhiExtra(outMu));
346 m_debugOut <<
mu->hwCaloPhi() <<
" " <<
mu->hwCaloEta() << std::endl;
347 outMuons->push_back(
bx, outMu);
References addMuonsToCollections(), l1t::bmtf, l1GtPatternGenerator_cfi::bx, l1tstage1emulator_dqm_sourceclient-live_cfg::bxMax, l1tstage1emulator_dqm_sourceclient-live_cfg::bxMin, calculateRank(), convertMuons(), l1t::emtf_neg, l1t::emtf_pos, l1t::MicroGMTIsolationUnit::extrapolateMuons(), BXVector< T >::getFirstBX(), BXVector< T >::getLastBX(), iEvent, l1t::MicroGMTIsolationUnit::isolatePreSummed(), m_autoBxRange, m_barrelTfInputToken, m_bmtfInputsToDisable, m_bxMax, m_bxMin, m_caloInputsToDisable, m_caloTowerInputToken, m_cancelOutUnit, m_debugOut, m_emtfCancelMode, m_emtfInputsToDisable, m_endcapTfInputToken, m_isolationUnit, m_maskedBmtfInputs, m_maskedCaloInputs, m_maskedEmtfInputs, m_maskedOmtfInputs, m_omtfInputsToDisable, m_overlapTfInputToken, SiStripPI::max, min(), eostools::move(), amptDefaultParameters_cff::mu, l1t::omtf_neg, l1t::omtf_pos, l1t::MicroGMTCancelOutUnit::setCancelOutBits(), l1t::MicroGMTCancelOutUnit::setCancelOutBitsOverlapBarrel(), l1t::MicroGMTCancelOutUnit::setCancelOutBitsOverlapEndcap(), l1t::MicroGMTIsolationUnit::setTowerSums(), sortMuons(), splitAndConvertMuons(), and PDWG_EXOHSCP_cff::tracks.
◆ sortMuons()
Definition at line 365 of file L1TMuonProducer.cc.
366 MicroGMTConfiguration::InterMuonList::iterator mu1;
368 for (mu1 =
muons.begin(); mu1 !=
muons.end(); ++mu1) {
369 (*mu1)->setHwWins(0);
373 for (mu1 =
muons.begin(); mu1 !=
muons.end(); ++mu1) {
374 int mu1CancelBit = (*mu1)->hwCancelBit();
375 nCancelled += mu1CancelBit;
378 for (; mu2 !=
muons.end(); ++mu2) {
379 if (mu1CancelBit != 1 && (*mu2)->hwCancelBit() != 1) {
380 if ((*mu1)->hwRank() >= (*mu2)->hwRank()) {
381 (*mu1)->increaseWins();
383 (*mu2)->increaseWins();
385 }
else if (mu1CancelBit != 1) {
386 (*mu1)->increaseWins();
387 }
else if ((*mu2)->hwCancelBit() != 1) {
388 (*mu2)->increaseWins();
393 size_t nMuonsBefore =
muons.size();
394 int minWins = nMuonsBefore - nSurvivors;
398 muons.remove_if([&minWins](
auto muon) {
return ((
muon->hwWins() < minWins) || (
muon->hwCancelBit() == 1)); });
References compareMuons(), and PDWG_BPHSkim_cff::muons.
Referenced by produce().
◆ splitAndConvertMuons()
Definition at line 443 of file L1TMuonProducer.cc.
450 for (
int i = 0;
i < 6; ++
i) {
451 wedges_pos[
i] = std::vector<std::shared_ptr<GMTInternalMuon>>();
452 wedges_pos[
i].reserve(3);
453 wedges_neg[
i] = std::vector<std::shared_ptr<GMTInternalMuon>>();
454 wedges_neg[
i].reserve(3);
456 if (bx < in->getFirstBX() ||
bx >
in->getLastBX())
460 for (
size_t i = 0;
i <
in->size(
bx); ++
i, ++muIdx) {
464 if (currentLink !=
link) {
468 int gPhi = MicroGMTConfiguration::calcGlobalPhi(
469 in->at(
bx,
i).hwPhi(),
in->at(
bx,
i).trackFinderType(),
in->at(
bx,
i).processor());
470 int tfMuonIdx = 3 * (currentLink - 36) + muIdx;
471 std::shared_ptr<GMTInternalMuon>
out = std::make_shared<GMTInternalMuon>(
in->at(
bx,
i), gPhi, tfMuonIdx);
472 if (
in->at(
bx,
i).hwEta() > 0) {
473 out_pos.push_back(
out);
474 wedges_pos[
in->at(
bx,
i).processor()].push_back(
out);
476 out_neg.emplace_back(
out);
477 wedges_neg[
in->at(
bx,
i).processor()].push_back(
out);
480 for (
int i = 0;
i < 6; ++
i) {
481 if (wedges_pos[
i].
size() > 3)
482 edm::LogWarning(
"Input Mismatch") <<
" too many inputs per processor for emtf+ / omtf+. Wedge " <<
i <<
": Size "
483 << wedges_pos[
i].size() << std::endl;
484 if (wedges_neg[
i].
size() > 3)
485 edm::LogWarning(
"Input Mismatch") <<
" too many inputs per processor for emtf- / omtf-. Wedge " <<
i <<
": Size "
486 << wedges_neg[
i].size() << std::endl;
References l1GtPatternGenerator_cfi::bx, mps_fire::i, recoMuon::in, MainPageGenerator::link, m_inputsToDisable, m_maskedInputs, MillePedeFileConverter_cfg::out, and findQualityFiles::size.
Referenced by produce().
◆ m_autoBxRange
bool L1TMuonProducer::m_autoBxRange |
|
private |
◆ m_autoCancelMode
bool L1TMuonProducer::m_autoCancelMode |
|
private |
◆ m_barrelTfInputTag
◆ m_barrelTfInputToken
◆ m_bmtfInputsToDisable
std::bitset<12> L1TMuonProducer::m_bmtfInputsToDisable |
|
private |
◆ m_bxMax
int L1TMuonProducer::m_bxMax |
|
private |
◆ m_bxMin
int L1TMuonProducer::m_bxMin |
|
private |
◆ m_caloInputsToDisable
std::bitset<28> L1TMuonProducer::m_caloInputsToDisable |
|
private |
◆ m_caloTowerInputToken
◆ m_cancelOutUnit
◆ m_debugOut
std::ofstream L1TMuonProducer::m_debugOut |
|
private |
◆ m_emtfCancelMode
◆ m_emtfInputsToDisable
std::bitset<12> L1TMuonProducer::m_emtfInputsToDisable |
|
private |
◆ m_endcapTfInputTag
◆ m_endcapTfInputToken
◆ m_inputsToDisable
std::bitset<72> L1TMuonProducer::m_inputsToDisable |
|
private |
◆ m_isolationUnit
◆ m_maskedBmtfInputs
std::bitset<12> L1TMuonProducer::m_maskedBmtfInputs |
|
private |
◆ m_maskedCaloInputs
std::bitset<28> L1TMuonProducer::m_maskedCaloInputs |
|
private |
◆ m_maskedEmtfInputs
std::bitset<12> L1TMuonProducer::m_maskedEmtfInputs |
|
private |
◆ m_maskedInputs
std::bitset<72> L1TMuonProducer::m_maskedInputs |
|
private |
◆ m_maskedOmtfInputs
std::bitset<12> L1TMuonProducer::m_maskedOmtfInputs |
|
private |
◆ m_omtfInputsToDisable
std::bitset<12> L1TMuonProducer::m_omtfInputsToDisable |
|
private |
◆ m_overlapTfInputTag
◆ m_overlapTfInputToken
◆ m_rankPtQualityLUT
◆ m_trigTowerTag
◆ microGMTParamsHelper
T const * product() const
void setCancelOutBits(GMTInternalWedges &, tftype, cancelmode)
Cancel out between sectors/wedges in one track finder.
edm::InputTag m_endcapTfInputTag
void setCancelOutBitsOverlapEndcap(GMTInternalWedges &, GMTInternalWedges &, cancelmode)
Cancel-out between overlap and endcap track finders.
edm::EDGetTokenT< MicroGMTConfiguration::InputCollection > m_overlapTfInputToken
GMTInternalMuonList InterMuonList
BXVector< Muon > MuonBxCollection
void initialise(L1TMuonGlobalParamsHelper *)
Initialisation from ES record.
std::bitset< 12 > m_bmtfInputsToDisable
void convertMuons(edm::Handle< MicroGMTConfiguration::InputCollection > const &in, MicroGMTConfiguration::InterMuonList &out, GMTInternalWedges &wedges, int bx) const
std::bitset< 12 > m_maskedOmtfInputs
edm::EDGetTokenT< MicroGMTConfiguration::CaloInputCollection > m_caloTowerInputToken
std::shared_ptr< MicroGMTRankPtQualLUT > m_rankPtQualityLUT
std::bitset< 12 > m_emtfInputsToDisable
std::map< int, std::vector< std::shared_ptr< GMTInternalMuon > > > GMTInternalWedges
edm::InputTag m_trigTowerTag
static ReturnType create(const std::string &filename, const int fwVersion, const unsigned ptFactor, const unsigned qualFactor)
void calculateRank(MicroGMTConfiguration::InterMuonList &muons) const
std::unique_ptr< L1TMuonGlobalParamsHelper > microGMTParamsHelper
void splitAndConvertMuons(edm::Handle< MicroGMTConfiguration::InputCollection > const &in, MicroGMTConfiguration::InterMuonList &out_pos, MicroGMTConfiguration::InterMuonList &out_neg, GMTInternalWedges &wedges_pos, GMTInternalWedges &wedges_neg, int bx) const
edm::EDGetTokenT< MicroGMTConfiguration::InputCollection > m_barrelTfInputToken
std::bitset< 28 > m_maskedCaloInputs
void setTowerSums(const MicroGMTConfiguration::CaloInputCollection &inputs, int bx)
edm::InputTag m_barrelTfInputTag
std::bitset< 12 > m_maskedBmtfInputs
std::bitset< 12 > m_maskedEmtfInputs
void extrapolateMuons(MicroGMTConfiguration::InterMuonList &) const
l1t::cancelmode m_emtfCancelMode
std::bitset< 72 > m_maskedInputs
edm::EDGetTokenT< MicroGMTConfiguration::InputCollection > m_endcapTfInputToken
MicroGMTIsolationUnit m_isolationUnit
static bool compareMuons(const std::shared_ptr< MicroGMTConfiguration::InterMuon > &mu1, const std::shared_ptr< MicroGMTConfiguration::InterMuon > &mu2)
T getParameter(std::string const &) const
void isolatePreSummed(MicroGMTConfiguration::InterMuonList &muons) const
void initialise(L1TMuonGlobalParamsHelper *)
Initialisation from ES record.
void setCancelOutBitsOverlapBarrel(GMTInternalWedges &, GMTInternalWedges &, cancelmode)
Cancel-out between overlap and barrel track finders.
std::bitset< 12 > m_omtfInputsToDisable
MicroGMTCancelOutUnit m_cancelOutUnit
const L1TMuonGlobalParams & cast_to_L1TMuonGlobalParams(const L1TMuonGlobalParams_PUBLIC &x)
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
void sortMuons(MicroGMTConfiguration::InterMuonList &, unsigned) const
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
const L1TMuonGlobalParams_PUBLIC & cast_to_L1TMuonGlobalParams_PUBLIC(const L1TMuonGlobalParams &x)
void addDefault(ParameterSetDescription const &psetDescription)
edm::InputTag m_overlapTfInputTag
std::bitset< 72 > m_inputsToDisable
std::bitset< 28 > m_caloInputsToDisable
void addMuonsToCollections(MicroGMTConfiguration::InterMuonList &coll, MicroGMTConfiguration::InterMuonList &interout, std::unique_ptr< MuonBxCollection > &out, int bx) const