Skip to content
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

OMTF muon trigger emulator: fix in the RPC clusterization #37866

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,4 +1,4 @@
#include "L1Trigger/L1TMuonOverlapPhase1/plugins/L1MuonOverlapPhase1ParamsDBProducer.h"
#include "L1MuonOverlapPhase1ParamsDBProducer.h"

#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
#include "CondFormats/L1TObjects/interface/L1TMuonOverlapParams.h"
Expand Down
@@ -1,4 +1,5 @@
#include "L1Trigger/L1TMuonOverlapPhase1/plugins/L1TMuonOverlapPhase1ParamsESProducer.h"
#include "L1TMuonOverlapPhase1ParamsESProducer.h"

#include "CondFormats/L1TObjects/interface/L1TMuonOverlapParams.h"
#include "CondFormats/DataRecord/interface/L1TMuonOverlapParamsRcd.h"
#include "L1Trigger/L1TMuonOverlapPhase1/interface/Omtf/XMLConfigReader.h"
Expand Down
@@ -1,4 +1,5 @@
#include "L1TMuonOverlapPhase1TrackProducer.h"

#include "FWCore/Utilities/interface/EDGetToken.h"
#include "FWCore/Utilities/interface/InputTag.h"

Expand Down
12 changes: 9 additions & 3 deletions L1Trigger/L1TMuonOverlapPhase1/src/Omtf/OMTFinputMaker.cc
Expand Up @@ -191,12 +191,18 @@ void RpcDigiToStubsConverterOmtf::addRPCstub(MuonStubPtrs2D& muonStubsInLayers,
muonStubsInLayers[iLayer][iInput + 1]->type = MuonStub::RPC_DROPPED;
} else if (cluster.size() > config->getRpcMaxClusterSize()) {
//marking as dropped the one that was added before on the iInput
if (muonStubsInLayers[iLayer][iInput])
if (muonStubsInLayers[iLayer][iInput]) {
muonStubsInLayers[iLayer][iInput]->type = MuonStub::RPC_DROPPED;
else {

muonStubsInLayers[iLayer][iInput + 1] = std::make_shared<MuonStub>(stub);
muonStubsInLayers[iLayer][iInput + 1]->type = MuonStub::RPC_DROPPED;
} else {
//no stub was added at this input already, so adding a stub and marking it as dropped
muonStubsInLayers.at(iLayer).at(iInput) = std::make_shared<MuonStub>(stub);
muonStubsInLayers[iLayer].at(iInput) = std::make_shared<MuonStub>(stub);
muonStubsInLayers[iLayer][iInput]->type = MuonStub::RPC_DROPPED;

muonStubsInLayers[iLayer][iInput + 1] = std::make_shared<MuonStub>(stub);
muonStubsInLayers[iLayer][iInput + 1]->type = MuonStub::RPC_DROPPED;
}
} else
OMTFinputMaker::addStub(config, muonStubsInLayers, iLayer, iInput, stub);
Expand Down
9 changes: 1 addition & 8 deletions L1Trigger/L1TMuonOverlapPhase1/src/RpcClusterization.cc
Expand Up @@ -16,14 +16,7 @@ RpcClusterization::~RpcClusterization() {}
std::vector<RpcCluster> RpcClusterization::getClusters(const RPCDetId& roll, std::vector<RPCDigi>& digis) const {
std::vector<RpcCluster> allClusters;

if (!dropAllClustersIfMoreThanMax) {
//with the 2018 firmware the agreement is better with this sort
std::sort(digis.begin(), digis.end(), [](const RPCDigi& a, const RPCDigi& b) { return a.strip() < b.strip(); });
} else {
//with the fixed RPC clusterization (Nov 2021 firmware) the data to emulator agreement is better if this reverse is used here,
//with the 2018 firmware the agreement is worse with this reverse,
std::reverse(digis.begin(), digis.end());
}
std::sort(digis.begin(), digis.end(), [](const RPCDigi& a, const RPCDigi& b) { return a.strip() < b.strip(); });

typedef std::pair<unsigned int, unsigned int> Cluster;

Expand Down