Skip to content

Commit

Permalink
Merge pull request #35095 from Dr15Jones/esConsumesL1TMuonBarrelTrack…
Browse files Browse the repository at this point in the history
…Producer

Finish esConsumes migration for L1TMuonBarrelTrackProducer
  • Loading branch information
cmsbuild authored Sep 14, 2021
2 parents 86094ed + 7bfe8d8 commit 4cc06bc
Show file tree
Hide file tree
Showing 17 changed files with 73 additions and 166 deletions.
48 changes: 0 additions & 48 deletions L1Trigger/L1TMuonBarrel/interface/L1AbstractProcessor.h

This file was deleted.

13 changes: 6 additions & 7 deletions L1Trigger/L1TMuonBarrel/src/L1MuBMAssignmentUnit.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
// Base Class Headers --
//----------------------

#include "L1Trigger/L1TMuonBarrel/interface/L1AbstractProcessor.h"

//------------------------------------
// Collaborating Class Declarations --
//------------------------------------
Expand All @@ -39,7 +37,8 @@
#include "CondFormats/L1TObjects/interface/L1TMuonBarrelParams.h"
#include "CondFormats/DataRecord/interface/L1TMuonBarrelParamsRcd.h"

#include <FWCore/Framework/interface/ESHandle.h>
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "DataFormats/L1TMuon/interface/BMTF/L1MuBMAddressArray.h"

class L1MuBMTrackSegPhi;
Expand All @@ -49,19 +48,19 @@ class L1MuBMLUTHandler;
// -- Class Interface --
// ---------------------

class L1MuBMAssignmentUnit : public L1AbstractProcessor {
class L1MuBMAssignmentUnit {
public:
/// constructor
L1MuBMAssignmentUnit(L1MuBMSectorProcessor& sp, int id);

/// destructor
~L1MuBMAssignmentUnit() override;
~L1MuBMAssignmentUnit();

/// run Assignment Unit
void run(const edm::EventSetup& c) override;
void run(const edm::EventSetup& c);

/// reset Assignment Unit
void reset() override;
void reset();

/// assign phi
void PhiAU(const edm::EventSetup& c);
Expand Down
10 changes: 4 additions & 6 deletions L1Trigger/L1TMuonBarrel/src/L1MuBMERS.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
// Base Class Headers --
//----------------------

#include "L1Trigger/L1TMuonBarrel/interface/L1AbstractProcessor.h"

//------------------------------------
// Collaborating Class Declarations --
//------------------------------------
Expand All @@ -40,19 +38,19 @@ class L1MuBMSEU;
// -- Class Interface --
// ---------------------

class L1MuBMERS : public L1AbstractProcessor {
class L1MuBMERS {
public:
/// constructor
L1MuBMERS(const L1MuBMSEU&);

/// destructor
~L1MuBMERS() override;
~L1MuBMERS();

/// run L1MuBMERS
void run() override;
void run();

/// reset ERS
void reset() override;
void reset();

/// return extrapolation quality
inline unsigned int quality(int id) const { return m_quality[id]; }
Expand Down
9 changes: 1 addition & 8 deletions L1Trigger/L1TMuonBarrel/src/L1MuBMEUX.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,7 @@ bool L1MuBMEUX::operator==(const L1MuBMEUX& eux) const {
//
// run EUX
//
void L1MuBMEUX::run(const edm::EventSetup& c) {
//c.get< L1MuDTExtLutRcd >().get( theExtLUTs );
// c.get< L1MuDTTFParametersRcd >().get( pars );

const L1TMuonBarrelParamsRcd& bmtfParamsRcd = c.get<L1TMuonBarrelParamsRcd>();
bmtfParamsRcd.get(bmtfParamsHandle);
const L1TMuonBarrelParams& bmtfParams = *bmtfParamsHandle.product();

void L1MuBMEUX::run(const L1TMuonBarrelParams& bmtfParams) {
pars = bmtfParams.l1mudttfparams;
theExtLUTs = new L1MuBMLUTHandler(bmtfParams); ///< ext look-up tables

Expand Down
14 changes: 4 additions & 10 deletions L1Trigger/L1TMuonBarrel/src/L1MuBMEUX.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,12 @@
// Base Class Headers --
//----------------------

#include "L1Trigger/L1TMuonBarrel/interface/L1AbstractProcessor.h"
#include "L1Trigger/L1TMuonBarrel/interface/L1MuBMLUTHandler.h"

//------------------------------------
// Collaborating Class Declarations --
//------------------------------------

#include <FWCore/Framework/interface/ESHandle.h>
#include "CondFormats/L1TObjects/interface/L1TMuonBarrelParams.h"
#include "CondFormats/DataRecord/interface/L1TMuonBarrelParamsRcd.h"

Expand All @@ -49,22 +47,22 @@ class L1MuDTTFParameters;
// -- Class Interface --
// ---------------------

class L1MuBMEUX : public L1AbstractProcessor {
class L1MuBMEUX {
public:
/// constructor
L1MuBMEUX(const L1MuBMSectorProcessor& sp, const L1MuBMSEU& seu, int id);

/// destructor
~L1MuBMEUX() override;
~L1MuBMEUX();

/// equal operator
bool operator==(const L1MuBMEUX&) const;

/// run Extrapolator
void run(const edm::EventSetup& c) override;
void run(const L1TMuonBarrelParams& c);

/// reset Extrapolator
void reset() override;
void reset();

/// load data into EUX
void load(const L1MuBMTrackSegPhi* start_ts, const L1MuBMTrackSegPhi* target_ts);
Expand Down Expand Up @@ -118,15 +116,11 @@ class L1MuBMEUX : public L1AbstractProcessor {
const L1MuBMTrackSegPhi* m_start; // start track segment
const L1MuBMTrackSegPhi* m_target; // target track segment

edm::ESHandle<L1TMuonBarrelParams> bmtfParamsHandle;

//edm::ESHandle< L1MuDTExtLut > theExtLUTs; // extrapolation look-up tables
L1MuBMLUTHandler* theExtLUTs;
int const theExtFilter = 1; // extrapolation quality filter
unsigned short const nbit_phi = 12; // number of bits used for phi
unsigned short const nbit_phib = 10; // number of bits used for phib

//edm::ESHandle< L1MuDTTFParameters > pars;
L1MuDTTFParameters pars;
};

Expand Down
27 changes: 8 additions & 19 deletions L1Trigger/L1TMuonBarrel/src/L1MuBMEtaProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ L1MuBMEtaProcessor::L1MuBMEtaProcessor(const L1MuBMTrackFinder& tf, int id, edm:
m_epid(id),
m_foundPattern(0),
m_tseta(15),
m_bmtfParamsToken(iC.esConsumes()),
m_DTDigiToken(iC.consumes<L1MuDTChambThContainer>(L1MuBMTFConfig::getBMThetaDigiInputTag())) {
m_tseta.reserve(15);
}
Expand All @@ -84,13 +85,14 @@ L1MuBMEtaProcessor::~L1MuBMEtaProcessor() {}
// run Eta Processor
//
void L1MuBMEtaProcessor::run(int bx, const edm::Event& e, const edm::EventSetup& c) {
auto const& params = c.getData(m_bmtfParamsToken);
if (L1MuBMTFConfig::getEtaTF()) {
receiveData(bx, e, c);
runEtaTrackFinder(c);
receiveData(bx, e, params);
runEtaTrackFinder(params);
}

receiveAddresses();
runEtaMatchingUnit(c);
runEtaMatchingUnit(params);

assign();
}
Expand Down Expand Up @@ -208,17 +210,12 @@ void L1MuBMEtaProcessor::print() const {
//
// receive data ( 15*3 BBMX eta trigger primitives )
//
void L1MuBMEtaProcessor::receiveData(int bx, const edm::Event& e, const edm::EventSetup& c) {
//c.get< L1MuDTTFMasksRcd >().get( msks );
const L1TMuonBarrelParamsRcd& bmtfParamsRcd = c.get<L1TMuonBarrelParamsRcd>();
bmtfParamsRcd.get(bmtfParamsHandle);
const L1TMuonBarrelParams& bmtfParams = *bmtfParamsHandle.product();
void L1MuBMEtaProcessor::receiveData(int bx, const edm::Event& e, const L1TMuonBarrelParams& bmtfParams) {
msks = bmtfParams.l1mudttfmasks;
theEtaPatternLUT.m_lut = bmtfParams.lutparams_.eta_lut_; //l1mudttfetaplut; // ETF look-up table
theQualPatternLUT.m_lut = bmtfParams.lutparams_.qp_lut_; //l1mudttfqualplut; // EMU look-up tables

edm::Handle<L1MuDTChambThContainer> dttrig;
// e.getByLabel(L1MuBMTFConfig::getBMThetaDigiInputTag(),dttrig);
e.getByToken(m_DTDigiToken, dttrig);

// const int bx_offset = dttrig->correctBX();
Expand Down Expand Up @@ -308,11 +305,7 @@ void L1MuBMEtaProcessor::receiveAddresses() {
//
// run Eta Track Finder (ETF)
//
void L1MuBMEtaProcessor::runEtaTrackFinder(const edm::EventSetup& c) {
//c.get< L1MuDTEtaPatternLutRcd >().get( theEtaPatternLUT );
const L1TMuonBarrelParamsRcd& bmtfParamsRcd = c.get<L1TMuonBarrelParamsRcd>();
bmtfParamsRcd.get(bmtfParamsHandle);
const L1TMuonBarrelParams& bmtfParams = *bmtfParamsHandle.product();
void L1MuBMEtaProcessor::runEtaTrackFinder(const L1TMuonBarrelParams& bmtfParams) {
theEtaPatternLUT.m_lut = bmtfParams.lutparams_.eta_lut_; //l1mudttfetaplut; // ETF look-up table

// check if there are any data
Expand Down Expand Up @@ -358,11 +351,7 @@ void L1MuBMEtaProcessor::runEtaTrackFinder(const edm::EventSetup& c) {
//
// run Eta Matching Unit (EMU)
//
void L1MuBMEtaProcessor::runEtaMatchingUnit(const edm::EventSetup& c) {
//c.get< L1MuDTQualPatternLutRcd >().get( theQualPatternLUT );
const L1TMuonBarrelParamsRcd& bmtfParamsRcd = c.get<L1TMuonBarrelParamsRcd>();
bmtfParamsRcd.get(bmtfParamsHandle);
const L1TMuonBarrelParams& bmtfParams = *bmtfParamsHandle.product();
void L1MuBMEtaProcessor::runEtaMatchingUnit(const L1TMuonBarrelParams& bmtfParams) {
theQualPatternLUT.m_lut = bmtfParams.lutparams_.qp_lut_; //l1mudttfqualplut; // EMU look-up tables

// loop over all addresses
Expand Down
20 changes: 9 additions & 11 deletions L1Trigger/L1TMuonBarrel/src/L1MuBMEtaProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
// Collaborating Class Declarations --
//------------------------------------

#include <DataFormats/Common/interface/Handle.h>
#include <FWCore/Framework/interface/Event.h>
#include <FWCore/Framework/interface/ESHandle.h>
#include <FWCore/Framework/interface/EventSetup.h>
#include "DataFormats/Common/interface/Handle.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Utilities/interface/EDGetToken.h"
#include "DataFormats/L1TMuon/interface/BMTF/L1MuBMAddressArray.h"
#include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambThDigi.h"
Expand All @@ -54,6 +54,7 @@ class L1MuBMTrack;
class L1MuBMTEtaPatternLut;
class L1MuBMTQualPatternLut;
class L1MuDTTFMasks;
class L1TMuonBarrelParamsRcd;

// ---------------------
// -- Class Interface --
Expand Down Expand Up @@ -90,16 +91,16 @@ class L1MuBMEtaProcessor {

private:
/// receive data (eta trigger primitives)
void receiveData(int bx, const edm::Event& e, const edm::EventSetup& c);
void receiveData(int bx, const edm::Event& e, const L1TMuonBarrelParams& params);

/// receive addresses (from 6 Sector Processors)
void receiveAddresses();

/// run Eta Track Finder (ETF)
void runEtaTrackFinder(const edm::EventSetup& c);
void runEtaTrackFinder(const L1TMuonBarrelParams& params);

/// run Eta Matching Unit (EMU)
void runEtaMatchingUnit(const edm::EventSetup& c);
void runEtaMatchingUnit(const L1TMuonBarrelParams& params);

/// assign eta and etaFineBit
void assign();
Expand All @@ -124,10 +125,7 @@ class L1MuBMEtaProcessor {
L1MuBMTrack* m_TracKCand[12];
std::vector<const L1MuBMTrackSegEta*> m_tseta;

//edm::ESHandle< L1MuDTEtaPatternLut > theEtaPatternLUT; // ETF look-up table
//edm::ESHandle< L1MuDTQualPatternLut > theQualPatternLUT; // EMU look-up tables
//edm::ESHandle< L1MuDTTFMasks > msks;
edm::ESHandle<L1TMuonBarrelParams> bmtfParamsHandle;
edm::ESGetToken<L1TMuonBarrelParams, L1TMuonBarrelParamsRcd> m_bmtfParamsToken;
L1MuDTTFMasks msks;
L1MuBMTEtaPatternLut theEtaPatternLUT; // ETF look-up table
L1MuBMTQualPatternLut theQualPatternLUT; // EMU look-up tables
Expand Down
10 changes: 4 additions & 6 deletions L1Trigger/L1TMuonBarrel/src/L1MuBMExtrapolationUnit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ using namespace std;
// Constructors --
//----------------

L1MuBMExtrapolationUnit::L1MuBMExtrapolationUnit(const L1MuBMSectorProcessor& sp) : m_sp(sp), m_SEUs() {
L1MuBMExtrapolationUnit::L1MuBMExtrapolationUnit(const L1MuBMSectorProcessor& sp, edm::ConsumesCollector cc)
: m_sp(sp), m_SEUs(), m_paramsToken(cc.esConsumes()) {
for (int ext_idx = 0; ext_idx < MAX_EXT; ext_idx++) {
Extrapolation ext = static_cast<Extrapolation>(ext_idx);

Expand Down Expand Up @@ -92,10 +93,7 @@ L1MuBMExtrapolationUnit::~L1MuBMExtrapolationUnit() {
// run Extrapolation Unit
//
void L1MuBMExtrapolationUnit::run(const edm::EventSetup& c) {
//c.get< L1MuDTTFParametersRcd >().get( pars );
const L1TMuonBarrelParamsRcd& bmtfParamsRcd = c.get<L1TMuonBarrelParamsRcd>();
bmtfParamsRcd.get(bmtfParamsHandle);
const L1TMuonBarrelParams& bmtfParams = *bmtfParamsHandle.product();
const L1TMuonBarrelParams& bmtfParams = c.getData(m_paramsToken);
pars = bmtfParams.l1mudttfparams;

SEUmap::const_iterator iter;
Expand All @@ -110,7 +108,7 @@ void L1MuBMExtrapolationUnit::run(const edm::EventSetup& c) {

if (ts != nullptr && !ts->empty()) {
((*iter).second)->load(ts);
((*iter).second)->run(c);
((*iter).second)->run(bmtfParams);
}
}

Expand Down
Loading

0 comments on commit 4cc06bc

Please sign in to comment.