Skip to content

Commit

Permalink
Merge pull request #37866 from kbunkow/from-CMSSW_12_4_X_KB_RPC_clust…
Browse files Browse the repository at this point in the history
…erization_fix

OMTF muon trigger emulator: fix in the RPC clusterization
  • Loading branch information
cmsbuild committed May 11, 2022
2 parents 9b05910 + 4728f3c commit 3a01815
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
@@ -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

0 comments on commit 3a01815

Please sign in to comment.