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
Allow for ME0 triggers to be produced from pads directly #27731
Merged
cmsbuild
merged 4 commits into
cms-sw:master
from
dildick:from-CMSSW_11_0_X_2019-08-08-1100-me0-triggers-from-pads
Sep 26, 2019
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
me0TriggerDigis = cms.EDProducer("ME0TriggerProducer", | ||
ME0PadDigiClusterProducer = cms.InputTag("simMuonME0PadDigiClusters"), | ||
ME0PadDigiClusters = cms.InputTag("simMuonME0PadDigiClusters"), | ||
ME0PadDigis = cms.InputTag("simMuonME0PadDigis"), | ||
useClusters = cms.bool(False), | ||
tmbParam = cms.PSet() | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,13 @@ | ||
#include "L1Trigger/ME0Trigger/interface/ME0TriggerBuilder.h" | ||
#include "L1Trigger/ME0Trigger/interface/ME0Motherboard.h" | ||
#include "FWCore/MessageLogger/interface/MessageLogger.h" | ||
#include "Geometry/Records/interface/MuonGeometryRecord.h" | ||
#include "Geometry/GEMGeometry/interface/ME0Geometry.h" | ||
|
||
ME0TriggerBuilder::ME0TriggerBuilder(const edm::ParameterSet& conf) { | ||
config_ = conf; | ||
|
||
for (int endc = 0; endc < 2; endc++) { | ||
for (int cham = 0; cham < 18; cham++) { | ||
if ((endc <= 0 || endc > MAX_ENDCAPS) || (cham <= 0 || cham > MAX_CHAMBERS)) { | ||
edm::LogError("L1ME0TPEmulatorSetupError") | ||
<< "+++ trying to instantiate TMB of illegal ME0 id [" | ||
<< " endcap = " << endc << " chamber = " << cham << "]; skipping it... +++\n"; | ||
continue; | ||
} | ||
for (int endc = 0; endc < MAX_ENDCAPS; endc++) { | ||
for (int cham = 0; cham < MAX_CHAMBERS; cham++) { | ||
tmb_[endc][cham].reset(new ME0Motherboard(endc, cham, config_)); | ||
} | ||
} | ||
} | ||
|
||
ME0TriggerBuilder::~ME0TriggerBuilder() {} | ||
|
||
void ME0TriggerBuilder::build(const ME0PadDigiClusterCollection* me0Pads, ME0TriggerDigiCollection& oc_trig) { | ||
for (int endc = 0; endc < 2; endc++) { | ||
for (int cham = 0; cham < 18; cham++) { | ||
ME0Motherboard* tmb = tmb_[endc][cham].get(); | ||
tmb->setME0Geometry(me0_g); | ||
|
||
// 0th layer means whole chamber. | ||
const int region(endc == 0 ? -1 : 1); | ||
ME0DetId detid(region, 0, cham, 0); | ||
|
||
// Run processors only if chamber exists in geometry. | ||
if (tmb == nullptr || me0_g->chamber(detid) == nullptr) | ||
continue; | ||
|
||
tmb->run(me0Pads); | ||
|
||
std::vector<ME0TriggerDigi> trigV = tmb->readoutTriggers(); | ||
|
||
if (!trigV.empty()) { | ||
LogTrace("L1ME0Trigger") << "ME0TriggerBuilder got results in " << detid << std::endl | ||
<< "Put " << trigV.size() << " Trigger digi" << ((trigV.size() > 1) ? "s " : " ") | ||
<< "in collection\n"; | ||
oc_trig.put(std::make_pair(trigV.begin(), trigV.end()), detid); | ||
} | ||
} | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use the enum values MAX_ENDCAPS and MAX_CHAMBERS here instead of magic numbers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dildick although @kpedro88 has signed this PR I share his comment, I will merge it but please update it in a next round