|
 |
#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 59 of file L1TMuonProducer.cc.
◆ L1TMuonProducer()
Definition at line 144 of file L1TMuonProducer.cc.
175 m_microGMTParamsToken = esConsumes<L1TMuonGlobalParams, L1TMuonGlobalParamsRcd, edm::Transition::BeginRun>();
176 m_o2oProtoToken = esConsumes<L1TMuonGlobalParams, L1TMuonGlobalParamsO2ORcd, edm::Transition::BeginRun>();
179 produces<MuonBxCollection>();
180 produces<MuonBxCollection>(
"imdMuonsBMTF");
181 produces<MuonBxCollection>(
"imdMuonsEMTFPos");
182 produces<MuonBxCollection>(
"imdMuonsEMTFNeg");
183 produces<MuonBxCollection>(
"imdMuonsOMTFPos");
184 produces<MuonBxCollection>(
"imdMuonsOMTFNeg");
References edm::ParameterSet::getParameter(), l1t::kftracks, m_autoBxRange, m_autoCancelMode, m_barrelTfInputTag, m_barrelTfInputToken, m_bmtfCancelMode, m_bxMax, m_bxMin, m_caloTowerInputToken, m_emtfCancelMode, m_endcapTfInputTag, m_endcapTfInputToken, m_microGMTParamsToken, m_o2oProtoToken, m_overlapTfInputTag, m_overlapTfInputToken, m_trigTowerTag, AlCaHLTBitMon_QueryRunRegistry::string, and tracks.
◆ ~L1TMuonProducer()
L1TMuonProducer::~L1TMuonProducer |
( |
| ) |
|
|
override |
◆ addMuonsToCollections()
◆ beginLuminosityBlock()
◆ beginRun()
Definition at line 564 of file L1TMuonProducer.cc.
567 std::unique_ptr<L1TMuonGlobalParams_PUBLIC> microGMTParams(
569 if (microGMTParams->pnodes_.empty()) {
580 <<
"\n EMTF-|OMTF-| BMTF |OMTF+|EMTF+| CALO | res 0";
588 <<
"\n EMTF-|OMTF-| BMTF |OMTF+|EMTF+| CALO | res 0";
References cast_to_L1TMuonGlobalParams(), cast_to_L1TMuonGlobalParams_PUBLIC(), l1t::MicroGMTRankPtQualLUTFactory::create(), edm::EventSetup::getHandle(), l1t::MicroGMTCancelOutUnit::initialise(), l1t::MicroGMTIsolationUnit::initialise(), l1t::kftracks, m_autoCancelMode, m_bmtfCancelMode, m_bmtfInputsToDisable, m_caloInputsToDisable, m_cancelOutUnit, m_emtfInputsToDisable, m_inputsToDisable, m_isolationUnit, m_maskedBmtfInputs, m_maskedCaloInputs, m_maskedEmtfInputs, m_maskedInputs, m_maskedOmtfInputs, m_microGMTParamsToken, m_o2oProtoToken, m_omtfInputsToDisable, m_rankPtQualityLUT, microGMTParamsHelper, and edm::ESHandle< T >::product().
◆ calculateRank()
◆ compareMuons()
◆ convertMuons()
Definition at line 525 of file L1TMuonProducer.cc.
530 for (
int i = 0;
i < 12; ++
i) {
531 wedges[
i] = std::vector<std::shared_ptr<GMTInternalMuon>>();
532 wedges[
i].reserve(3);
534 if (bx < in->getFirstBX() ||
bx >
in->getLastBX())
538 for (
size_t i = 0;
i <
in->size(
bx); ++
i, ++muIdx) {
539 if (
in->at(
bx,
i).hwPt() > 0) {
544 if (currentLink !=
link) {
548 int gPhi = MicroGMTConfiguration::calcGlobalPhi(
549 in->at(
bx,
i).hwPhi(),
in->at(
bx,
i).trackFinderType(),
in->at(
bx,
i).processor());
550 int tfMuonIdx = 3 * (currentLink - 36) + muIdx;
551 std::shared_ptr<GMTInternalMuon> outMu = std::make_shared<GMTInternalMuon>(
in->at(
bx,
i), gPhi, tfMuonIdx);
552 out.emplace_back(outMu);
553 wedges[
in->at(
bx,
i).processor()].push_back(outMu);
556 for (
int i = 0;
i < 12; ++
i) {
557 if (wedges[
i].
size() > 3)
558 edm::LogWarning(
"Input Mismatch") <<
" too many inputs per processor for barrel. Wedge " <<
i <<
": Size "
559 << 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 194 of file L1TMuonProducer.cc.
278 splitAndConvertMuons(emtfMuons, internMuonsEmtfPos, internMuonsEmtfNeg, emtfPosWedges, emtfNegWedges,
bx);
279 splitAndConvertMuons(omtfMuons, internMuonsOmtfPos, internMuonsOmtfNeg, omtfPosWedges, omtfNegWedges,
bx);
328 for (
const auto&
mu : internalMuons) {
329 if (
mu->hwPt() > 0) {
331 (
mu->hwPt() - 1) * 0.5,
mu->hwEta() * 0.010875,
mu->hwGlobalPhi() * 0.010908, 0.0};
332 int iso =
mu->hwAbsIso() + (
mu->hwRelIso() << 1);
333 int outMuQual = MicroGMTConfiguration::setOutputMuonQuality(
mu->hwQual(),
mu->trackFinderType(),
mu->hwHF());
351 outMu.setHwEtaAtVtx(MicroGMTConfiguration::calcMuonHwEtaExtra(outMu));
352 outMu.setHwPhiAtVtx(MicroGMTConfiguration::calcMuonHwPhiExtra(outMu));
353 outMu.setEtaAtVtx(MicroGMTConfiguration::calcMuonEtaExtra(outMu));
354 outMu.setPhiAtVtx(MicroGMTConfiguration::calcMuonPhiExtra(outMu));
357 int hwPtUnconstrained{
mu->hwPtUnconstrained()};
358 outMu.setPtUnconstrained(
359 hwPtUnconstrained == 0
361 : (hwPtUnconstrained - 1));
362 outMu.setHwPtUnconstrained(hwPtUnconstrained);
363 outMu.setHwDXY(
mu->hwDXY());
365 if (
mu->hwSignValid()) {
366 outMu.setCharge(1 - 2 *
mu->hwSign());
370 m_debugOut <<
mu->hwCaloPhi() <<
" " <<
mu->hwCaloEta() << std::endl;
371 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_bmtfCancelMode, 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(), and splitAndConvertMuons().
◆ sortMuons()
Definition at line 389 of file L1TMuonProducer.cc.
390 MicroGMTConfiguration::InterMuonList::iterator mu1;
392 for (mu1 =
muons.begin(); mu1 !=
muons.end(); ++mu1) {
393 (*mu1)->setHwWins(0);
397 for (mu1 =
muons.begin(); mu1 !=
muons.end(); ++mu1) {
398 int mu1CancelBit = (*mu1)->hwCancelBit();
399 nCancelled += mu1CancelBit;
402 for (; mu2 !=
muons.end(); ++mu2) {
403 if (mu1CancelBit != 1 && (*mu2)->hwCancelBit() != 1) {
404 if ((*mu1)->hwRank() >= (*mu2)->hwRank()) {
405 (*mu1)->increaseWins();
407 (*mu2)->increaseWins();
409 }
else if (mu1CancelBit != 1) {
410 (*mu1)->increaseWins();
411 }
else if ((*mu2)->hwCancelBit() != 1) {
412 (*mu2)->increaseWins();
417 size_t nMuonsBefore =
muons.size();
418 int minWins = nMuonsBefore - nSurvivors;
422 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 475 of file L1TMuonProducer.cc.
482 for (
int i = 0;
i < 6; ++
i) {
483 wedges_pos[
i] = std::vector<std::shared_ptr<GMTInternalMuon>>();
484 wedges_pos[
i].reserve(3);
485 wedges_neg[
i] = std::vector<std::shared_ptr<GMTInternalMuon>>();
486 wedges_neg[
i].reserve(3);
488 if (bx < in->getFirstBX() ||
bx >
in->getLastBX())
492 for (
size_t i = 0;
i <
in->size(
bx); ++
i, ++muIdx) {
493 if (
in->at(
bx,
i).hwPt() > 0) {
498 if (currentLink !=
link) {
502 int gPhi = MicroGMTConfiguration::calcGlobalPhi(
503 in->at(
bx,
i).hwPhi(),
in->at(
bx,
i).trackFinderType(),
in->at(
bx,
i).processor());
504 int tfMuonIdx = 3 * (currentLink - 36) + muIdx;
505 std::shared_ptr<GMTInternalMuon>
out = std::make_shared<GMTInternalMuon>(
in->at(
bx,
i), gPhi, tfMuonIdx);
506 if (
in->at(
bx,
i).hwEta() > 0) {
507 out_pos.push_back(
out);
508 wedges_pos[
in->at(
bx,
i).processor()].push_back(
out);
510 out_neg.emplace_back(
out);
511 wedges_neg[
in->at(
bx,
i).processor()].push_back(
out);
515 for (
int i = 0;
i < 6; ++
i) {
516 if (wedges_pos[
i].
size() > 3)
517 edm::LogWarning(
"Input Mismatch") <<
" too many inputs per processor for emtf+ / omtf+. Wedge " <<
i <<
": Size "
518 << wedges_pos[
i].size() << std::endl;
519 if (wedges_neg[
i].
size() > 3)
520 edm::LogWarning(
"Input Mismatch") <<
" too many inputs per processor for emtf- / omtf-. Wedge " <<
i <<
": Size "
521 << 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_bmtfCancelMode
◆ 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_microGMTParamsToken
◆ m_o2oProtoToken
◆ 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
l1t::cancelmode m_bmtfCancelMode
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::ESGetToken< L1TMuonGlobalParams, L1TMuonGlobalParamsO2ORcd > m_o2oProtoToken
Log< level::Warning, false > LogWarning
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
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
void extrapolateMuons(MicroGMTConfiguration::InterMuonList &) const
edm::ESGetToken< L1TMuonGlobalParams, L1TMuonGlobalParamsRcd > m_microGMTParamsToken
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)
void isolatePreSummed(MicroGMTConfiguration::InterMuonList &muons) const
Log< level::Info, true > LogVerbatim
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
T getParameter(std::string const &) const
const L1TMuonGlobalParams & cast_to_L1TMuonGlobalParams(const L1TMuonGlobalParams_PUBLIC &x)
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