CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
Phase2L1TGMTKMTFProducer Class Reference
Inheritance diagram for Phase2L1TGMTKMTFProducer:
edm::stream::EDProducer<>

Public Member Functions

 Phase2L1TGMTKMTFProducer (const edm::ParameterSet &)
 
 ~Phase2L1TGMTKMTFProducer () override=default
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

std::unique_ptr< KMTFkmtf_
 
unsigned int Ndisplaced
 
unsigned int Nprompt
 
edm::EDGetTokenT< l1t::MuonStubCollectionstubToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 38 of file Phase2L1TGMTKMTFProducer.cc.

Constructor & Destructor Documentation

◆ Phase2L1TGMTKMTFProducer()

Phase2L1TGMTKMTFProducer::Phase2L1TGMTKMTFProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 64 of file Phase2L1TGMTKMTFProducer.cc.

65  : stubToken_(consumes<l1t::MuonStubCollection>(iConfig.getParameter<edm::InputTag>("stubs"))),
66  kmtf_(new KMTF(iConfig.getParameter<int>("verbose"), iConfig.getParameter<edm::ParameterSet>("algo"))),
67  Nprompt(iConfig.getParameter<uint>("Nprompt")),
68  Ndisplaced(iConfig.getParameter<uint>("Ndisplaced")) {
69  produces<std::vector<l1t::SAMuon> >("prompt").setBranchAlias("prompt");
70  produces<std::vector<l1t::SAMuon> >("displaced").setBranchAlias("displaced");
71  produces<std::vector<l1t::KMTFTrack> >("kmtfTracks");
72 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< l1t::MuonStubCollection > stubToken_
std::unique_ptr< KMTF > kmtf_

◆ ~Phase2L1TGMTKMTFProducer()

Phase2L1TGMTKMTFProducer::~Phase2L1TGMTKMTFProducer ( )
overridedefault

Member Function Documentation

◆ produce()

void Phase2L1TGMTKMTFProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 79 of file Phase2L1TGMTKMTFProducer.cc.

References Phase2L1GMT::BITSETA, Phase2L1GMT::BITSPHI, Phase2L1GMT::BITSPT, Phase2L1GMT::BITSSAD0, l1t::bmtf, BPHMonitor_cff::displaced, PVValHelper::dxy, mps_fire::i, iEvent, kmtf_, eostools::move(), AlCaHLTBitMon_ParallelJobs::p, SimL1Emulator_cff::stubs, stubToken_, HLT_2024v13_cff::track, and parallelization::uint.

79  {
80  using namespace edm;
82  iEvent.getByToken(stubToken_, stubHandle);
83 
85  for (uint i = 0; i < stubHandle->size(); ++i) {
86  l1t::MuonStubRef stub(stubHandle, i);
87  if (stub->bxNum() == 0)
88  stubs.push_back(stub);
89  }
90 
91  // KMTF
92  std::vector<SAMuon> prompt;
93  std::vector<SAMuon> displaced;
94  std::pair<std::vector<l1t::KMTFTrack>, std::vector<l1t::KMTFTrack> > kmtfOutput = kmtf_->process(stubs, 0, 32);
95  std::vector<l1t::KMTFTrack> kmtfTracks;
96  for (const auto& track : kmtfOutput.first) {
97  kmtfTracks.push_back(track);
98  l1t::SAMuon p(track.p4(),
99  (track.curvatureAtVertex() < 0),
100  track.ptPrompt(),
101  track.coarseEta(),
102  track.phiAtMuon() / (1 << 5),
103  0,
104  0,
105  track.stubs().size() - 1);
106  p.setTF(l1t::tftype::bmtf);
107  int bstart = 0;
108  wordtype word(0);
109  bstart = wordconcat<wordtype>(word, bstart, 1, 1);
110  bstart = wordconcat<wordtype>(word, bstart, p.hwCharge(), 1);
111  bstart = wordconcat<wordtype>(word, bstart, p.hwPt(), BITSPT);
112  bstart = wordconcat<wordtype>(word, bstart, p.hwPhi(), BITSPHI);
113  bstart = wordconcat<wordtype>(word, bstart, p.hwEta(), BITSETA);
114  bstart = wordconcat<wordtype>(word, bstart, p.hwD0(), BITSSAD0);
115  bstart = wordconcat<wordtype>(word, bstart, track.rankPrompt(), 8);
116 
117  for (const auto& stub : track.stubs())
118  p.addStub(stub);
119  p.setWord(word);
120  prompt.push_back(p);
121  }
122 
123  for (const auto& track : kmtfOutput.second) {
124  kmtfTracks.push_back(track);
125  ap_int<7> dxy = track.dxy() * ap_ufixed<8, 1>(1.606);
126  l1t::SAMuon p(track.displacedP4(),
127  (track.curvatureAtMuon() < 0),
128  track.ptDisplaced(),
129  track.coarseEta(),
130  track.phiAtMuon() / (1 << 5),
131  0,
132  dxy,
133  track.approxDispChi2());
134  p.setTF(l1t::tftype::bmtf);
135  int bstart = 0;
136  wordtype word(0);
137  bstart = wordconcat<wordtype>(word, bstart, 1, 1);
138  bstart = wordconcat<wordtype>(word, bstart, p.hwCharge(), 1);
139  bstart = wordconcat<wordtype>(word, bstart, p.hwPt(), BITSPT);
140  bstart = wordconcat<wordtype>(word, bstart, p.hwPhi(), BITSPHI);
141  bstart = wordconcat<wordtype>(word, bstart, p.hwEta(), BITSETA);
142  bstart = wordconcat<wordtype>(word, bstart, p.hwD0(), BITSSAD0);
143  bstart = wordconcat<wordtype>(word, bstart, track.rankDisp(), 8);
144 
145  for (const auto& stub : track.stubs()) {
146  p.addStub(stub);
147  }
148  p.setWord(word);
149  displaced.push_back(p);
150  }
151  std::unique_ptr<std::vector<l1t::SAMuon> > prompt_ptr = std::make_unique<std::vector<l1t::SAMuon> >(prompt);
152  std::unique_ptr<std::vector<l1t::SAMuon> > displaced_ptr = std::make_unique<std::vector<l1t::SAMuon> >(displaced);
153  std::unique_ptr<std::vector<l1t::KMTFTrack> > kmtf_ptr = std::make_unique<std::vector<l1t::KMTFTrack> >(kmtfTracks);
154  iEvent.put(std::move(prompt_ptr), "prompt");
155  iEvent.put(std::move(displaced_ptr), "displaced");
156  iEvent.put(std::move(kmtf_ptr), "kmtfTracks");
157 }
const int BITSSAD0
Definition: Constants.h:56
std::vector< edm::Ref< MuonStubCollection > > MuonStubRefVector
Definition: MuonStub.h:44
ap_uint< 64 > wordtype
Definition: Constants.h:101
uint64_t word
int iEvent
Definition: GenABIO.cc:224
const int BITSETA
Definition: Constants.h:26
edm::EDGetTokenT< l1t::MuonStubCollection > stubToken_
const int BITSPT
Definition: Constants.h:24
const int BITSPHI
Definition: Constants.h:25
HLT enums.
std::unique_ptr< KMTF > kmtf_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ kmtf_

std::unique_ptr<KMTF> Phase2L1TGMTKMTFProducer::kmtf_
private

Definition at line 48 of file Phase2L1TGMTKMTFProducer.cc.

Referenced by produce().

◆ Ndisplaced

unsigned int Phase2L1TGMTKMTFProducer::Ndisplaced
private

Definition at line 50 of file Phase2L1TGMTKMTFProducer.cc.

◆ Nprompt

unsigned int Phase2L1TGMTKMTFProducer::Nprompt
private

Definition at line 49 of file Phase2L1TGMTKMTFProducer.cc.

◆ stubToken_

edm::EDGetTokenT<l1t::MuonStubCollection> Phase2L1TGMTKMTFProducer::stubToken_
private

Definition at line 47 of file Phase2L1TGMTKMTFProducer.cc.

Referenced by produce().