Skip to content

Commit

Permalink
Merge pull request #35314 from Dr15Jones/moreEsConsumesL1MuBMSectorPr…
Browse files Browse the repository at this point in the history
…ocessor

Added esConsumes to L1MuBMSectorProcessor
  • Loading branch information
cmsbuild committed Sep 28, 2021
2 parents b00abcf + 2c79af8 commit ac40444
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
18 changes: 6 additions & 12 deletions L1Trigger/L1TMuonBarrel/src/L1MuBMAssignmentUnit.cc
Expand Up @@ -72,7 +72,7 @@ L1MuBMAssignmentUnit::~L1MuBMAssignmentUnit() {}
//
// run Assignment Unit
//
void L1MuBMAssignmentUnit::run(const edm::EventSetup& c) {
void L1MuBMAssignmentUnit::run(const L1TMuonBarrelParams& bmtfParams) {
// enable track candidate
m_sp.track(m_id)->enable();
m_sp.tracK(m_id)->enable();
Expand All @@ -99,10 +99,10 @@ void L1MuBMAssignmentUnit::run(const edm::EventSetup& c) {
m_sp.tracK(m_id)->setBx(bx);

// assign phi
PhiAU(c);
PhiAU(bmtfParams);

// assign pt and charge
PtAU(c);
PtAU(bmtfParams);

// assign quality
QuaAU();
Expand All @@ -120,10 +120,7 @@ void L1MuBMAssignmentUnit::reset() {
//
// assign phi with 8 bit precision
//
void L1MuBMAssignmentUnit::PhiAU(const edm::EventSetup& c) {
const L1TMuonBarrelParamsRcd& bmtfParamsRcd = c.get<L1TMuonBarrelParamsRcd>();
bmtfParamsRcd.get(bmtfParamsHandle);
const L1TMuonBarrelParams& bmtfParams = *bmtfParamsHandle.product();
void L1MuBMAssignmentUnit::PhiAU(const L1TMuonBarrelParams& bmtfParams) {
thePhiLUTs = new L1MuBMLUTHandler(bmtfParams); ///< phi-assignment look-up tables
//thePhiLUTs->print();
// calculate phi at station 2 using 8 bits (precision = 0.625 degrees)
Expand Down Expand Up @@ -198,11 +195,8 @@ void L1MuBMAssignmentUnit::PhiAU(const edm::EventSetup& c) {
//
// assign pt with 5 bit precision
//
void L1MuBMAssignmentUnit::PtAU(const edm::EventSetup& c) {
const L1TMuonBarrelParamsRcd& bmtfParamsRcd = c.get<L1TMuonBarrelParamsRcd>();
bmtfParamsRcd.get(bmtfParamsHandle);
const L1TMuonBarrelParams& bmtfParams1 = *bmtfParamsHandle.product();
const L1TMuonBarrelParamsAllPublic& bmtfParams = L1TMuonBarrelParamsAllPublic(bmtfParams1);
void L1MuBMAssignmentUnit::PtAU(const L1TMuonBarrelParams& bmtfParams1) {
const L1TMuonBarrelParamsAllPublic bmtfParams(bmtfParams1);
thePtaLUTs = new L1MuBMLUTHandler(bmtfParams); ///< pt-assignment look-up tables
//thePtaLUTs->print();
// get pt-assignment method as function of track class and TS phib values
Expand Down
7 changes: 3 additions & 4 deletions L1Trigger/L1TMuonBarrel/src/L1MuBMAssignmentUnit.h
Expand Up @@ -57,16 +57,16 @@ class L1MuBMAssignmentUnit {
~L1MuBMAssignmentUnit();

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

/// reset Assignment Unit
void reset();

/// assign phi
void PhiAU(const edm::EventSetup& c);
void PhiAU(const L1TMuonBarrelParams&);

/// assign pt and charge
void PtAU(const edm::EventSetup& c);
void PtAU(const L1TMuonBarrelParams&);

/// assign quality
void QuaAU();
Expand Down Expand Up @@ -109,7 +109,6 @@ class L1MuBMAssignmentUnit {
std::vector<const L1MuBMTrackSegPhi*> m_TSphi;
L1MuBMLUTHandler::PtAssMethod m_ptAssMethod;

edm::ESHandle<L1TMuonBarrelParams> bmtfParamsHandle;
L1MuBMLUTHandler* thePtaLUTs; ///< pt-assignment look-up tables
L1MuBMLUTHandler* thePhiLUTs; ///< phi-assignment look-up tables
static unsigned short nbit_phi; ///< # of bits used for pt-assignment
Expand Down
7 changes: 5 additions & 2 deletions L1Trigger/L1TMuonBarrel/src/L1MuBMSectorProcessor.cc
Expand Up @@ -62,6 +62,7 @@ L1MuBMSectorProcessor::L1MuBMSectorProcessor(const L1MuBMTrackFinder& tf,
m_DataBuffer(new L1MuBMDataBuffer(*this)),
m_EU(new L1MuBMExtrapolationUnit(*this, iC)),
m_TA(new L1MuBMTrackAssembler(*this)),
m_bmtfParamsToken(iC.esConsumes()),
m_AUs(),
m_TrackCands(),
m_TracKCands() {
Expand Down Expand Up @@ -139,11 +140,13 @@ void L1MuBMSectorProcessor::run(int bx, const edm::Event& e, const edm::EventSet
m_TA->print();
}

L1TMuonBarrelParams const& bmtfParams = c.getData(m_bmtfParamsToken);

// assign pt, eta, phi and quality
if (m_AUs[0] && !m_TA->isEmpty(0))
m_AUs[0]->run(c);
m_AUs[0]->run(bmtfParams);
if (m_AUs[1] && !m_TA->isEmpty(1))
m_AUs[1]->run(c);
m_AUs[1]->run(bmtfParams);

if (m_spid.wheel() == -1) {
if (m_TrackCands[0] && !m_TrackCands[0]->empty() && m_TrackCands[0]->address(2) > 3 &&
Expand Down
3 changes: 3 additions & 0 deletions L1Trigger/L1TMuonBarrel/src/L1MuBMSectorProcessor.h
Expand Up @@ -46,6 +46,8 @@ class L1MuBMTrackAssembler;
class L1MuBMAssignmentUnit;
class L1MuBMTrackFinder;
class L1MuBMTrack;
class L1TMuonBarrelParams;
class L1TMuonBarrelParamsRcd;

// ---------------------
// -- Class Interface --
Expand Down Expand Up @@ -114,6 +116,7 @@ class L1MuBMSectorProcessor {
L1MuBMDataBuffer* m_DataBuffer;
L1MuBMExtrapolationUnit* m_EU;
L1MuBMTrackAssembler* m_TA;
const edm::ESGetToken<L1TMuonBarrelParams, L1TMuonBarrelParamsRcd> m_bmtfParamsToken;
std::vector<L1MuBMAssignmentUnit*> m_AUs;

std::vector<L1MuBMTrack*> m_TrackCands;
Expand Down

0 comments on commit ac40444

Please sign in to comment.