CMS 3D CMS Logo

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

Public Member Functions

 Phase2L1TGMTSAMuonGhostCleaner (const edm::ParameterSet &)
 
 ~Phase2L1TGMTSAMuonGhostCleaner () 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

std::vector< l1t::SAMuonprodMuons (std::vector< l1t::SAMuon > &muons)
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

edm::EDGetTokenT< std::vector< l1t::SAMuon > > barrelTokenDisp_
 
edm::EDGetTokenT< std::vector< l1t::SAMuon > > barrelTokenPrompt_
 
edm::EDGetTokenT< std::vector< l1t::SAMuon > > fwdTokenDisp_
 
edm::EDGetTokenT< std::vector< l1t::SAMuon > > fwdTokenPrompt_
 
SAMuonCleaner ghostCleaner
 

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 25 of file Phase2L1TGMTSAMuonGhostCleaner.cc.

Constructor & Destructor Documentation

◆ Phase2L1TGMTSAMuonGhostCleaner()

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

Definition at line 54 of file Phase2L1TGMTSAMuonGhostCleaner.cc.

55  : barrelTokenPrompt_(consumes<std::vector<l1t::SAMuon> >(iConfig.getParameter<edm::InputTag>("barrelPrompt"))),
56  barrelTokenDisp_(consumes<std::vector<l1t::SAMuon> >(iConfig.getParameter<edm::InputTag>("barrelDisp"))),
57  fwdTokenPrompt_(consumes<std::vector<l1t::SAMuon> >(iConfig.getParameter<edm::InputTag>("forwardPrompt"))),
58  fwdTokenDisp_(consumes<std::vector<l1t::SAMuon> >(iConfig.getParameter<edm::InputTag>("forwardDisp"))) {
59  produces<std::vector<l1t::SAMuon> >("prompt");
60  produces<std::vector<l1t::SAMuon> >("displaced");
61 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< std::vector< l1t::SAMuon > > barrelTokenPrompt_
edm::EDGetTokenT< std::vector< l1t::SAMuon > > fwdTokenPrompt_
edm::EDGetTokenT< std::vector< l1t::SAMuon > > barrelTokenDisp_
edm::EDGetTokenT< std::vector< l1t::SAMuon > > fwdTokenDisp_

◆ ~Phase2L1TGMTSAMuonGhostCleaner()

Phase2L1TGMTSAMuonGhostCleaner::~Phase2L1TGMTSAMuonGhostCleaner ( )
overridedefault

Member Function Documentation

◆ prodMuons()

std::vector< l1t::SAMuon > Phase2L1TGMTSAMuonGhostCleaner::prodMuons ( std::vector< l1t::SAMuon > &  muons)
private

Definition at line 67 of file Phase2L1TGMTSAMuonGhostCleaner.cc.

References Phase2L1GMT::BITSGTETA, Phase2L1GMT::BITSGTPHI, Phase2L1GMT::BITSGTPT, Phase2L1GMT::BITSSAD0, Phase2L1GMT::BITSSAQUAL, Phase2L1GMT::BITSSAZ0, l1t::bmtf, SAMuonCleaner::cleanTFMuons(), muons_cff::finalMuons, ghostCleaner, visualization-live-secondInstance_cfg::m, amptDefaultParameters_cff::mu, and DiMuonV_cfg::muons.

Referenced by produce().

67  {
68  std::vector<l1t::SAMuon> cleanedMuons = ghostCleaner.cleanTFMuons(muons);
69  //here switch to the offical word required by the GT
70  std::vector<l1t::SAMuon> finalMuons;
71  for (const auto& mu : cleanedMuons) {
72  l1t::SAMuon m = mu;
73  if (m.tfType() == l1t::tftype::bmtf)
74  m.setHwQual(m.hwQual() >> 4);
75  int bstart = 0;
76  wordtype word(0);
77  bstart = wordconcat<wordtype>(word, bstart, m.hwPt() > 0, 1);
78  bstart = wordconcat<wordtype>(word, bstart, m.hwPt(), BITSGTPT);
79  bstart = wordconcat<wordtype>(word, bstart, m.hwPhi(), BITSGTPHI);
80  bstart = wordconcat<wordtype>(word, bstart, m.hwEta(), BITSGTETA);
81  bstart = wordconcat<wordtype>(word, bstart, m.hwZ0(), BITSSAZ0);
82  bstart = wordconcat<wordtype>(word, bstart, m.hwD0(), BITSSAD0);
83  bstart = wordconcat<wordtype>(word, bstart, m.hwCharge(), 1);
84  wordconcat<wordtype>(word, bstart, m.hwQual(), BITSSAQUAL);
85  m.setWord(word);
86  finalMuons.push_back(m);
87  }
88  return finalMuons;
89 } // ----- end of function Phase2L1TGMTSAMuonGhostCleaner::prodMuons -----
const int BITSGTETA
Definition: Constants.h:62
const int BITSSAD0
Definition: Constants.h:56
const int BITSGTPHI
Definition: Constants.h:61
const int BITSSAQUAL
Definition: Constants.h:57
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
Definition: DiMuonV_cfg.py:214
ap_uint< 64 > wordtype
Definition: Constants.h:101
uint64_t word
const int BITSGTPT
Definition: Constants.h:60
std::vector< l1t::SAMuon > cleanTFMuons(const std::vector< l1t::SAMuon > &muons)
const int BITSSAZ0
Definition: Constants.h:55

◆ produce()

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

Definition at line 92 of file Phase2L1TGMTSAMuonGhostCleaner.cc.

References SimL1Emulator_cff::barrelDisp, SimL1Emulator_cff::barrelPrompt, barrelTokenDisp_, barrelTokenPrompt_, SimL1Emulator_cff::forwardDisp, SimL1Emulator_cff::forwardPrompt, fwdTokenDisp_, fwdTokenPrompt_, iEvent, eostools::move(), DiMuonV_cfg::muons, and prodMuons().

92  {
93  using namespace edm;
94 
97 
99  iEvent.getByToken(barrelTokenDisp_, barrelDisp);
100 
102  iEvent.getByToken(fwdTokenPrompt_, forwardPrompt);
103 
105  iEvent.getByToken(fwdTokenDisp_, forwardDisp);
106 
107  // Prompt muons
108  std::vector<l1t::SAMuon> muons = *barrelPrompt.product();
109  muons.insert(muons.end(), forwardPrompt->begin(), forwardPrompt->end());
110  std::vector<l1t::SAMuon> finalPrompt = prodMuons(muons);
111 
112  // Displace muons
113  muons.clear();
114  muons = *barrelDisp.product();
115  muons.insert(muons.end(), forwardDisp->begin(), forwardDisp->end());
116  std::vector<l1t::SAMuon> finalDisp = prodMuons(muons);
117 
118  std::unique_ptr<std::vector<l1t::SAMuon> > prompt_ptr = std::make_unique<std::vector<l1t::SAMuon> >(finalPrompt);
119  std::unique_ptr<std::vector<l1t::SAMuon> > disp_ptr = std::make_unique<std::vector<l1t::SAMuon> >(finalDisp);
120  iEvent.put(std::move(prompt_ptr), "prompt");
121  iEvent.put(std::move(disp_ptr), "displaced");
122 }
edm::EDGetTokenT< std::vector< l1t::SAMuon > > barrelTokenPrompt_
edm::EDGetTokenT< std::vector< l1t::SAMuon > > fwdTokenPrompt_
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
Definition: DiMuonV_cfg.py:214
edm::EDGetTokenT< std::vector< l1t::SAMuon > > barrelTokenDisp_
int iEvent
Definition: GenABIO.cc:224
std::vector< l1t::SAMuon > prodMuons(std::vector< l1t::SAMuon > &muons)
HLT enums.
def move(src, dest)
Definition: eostools.py:511
edm::EDGetTokenT< std::vector< l1t::SAMuon > > fwdTokenDisp_

Member Data Documentation

◆ barrelTokenDisp_

edm::EDGetTokenT<std::vector<l1t::SAMuon> > Phase2L1TGMTSAMuonGhostCleaner::barrelTokenDisp_
private

Definition at line 37 of file Phase2L1TGMTSAMuonGhostCleaner.cc.

Referenced by produce().

◆ barrelTokenPrompt_

edm::EDGetTokenT<std::vector<l1t::SAMuon> > Phase2L1TGMTSAMuonGhostCleaner::barrelTokenPrompt_
private

Definition at line 36 of file Phase2L1TGMTSAMuonGhostCleaner.cc.

Referenced by produce().

◆ fwdTokenDisp_

edm::EDGetTokenT<std::vector<l1t::SAMuon> > Phase2L1TGMTSAMuonGhostCleaner::fwdTokenDisp_
private

Definition at line 39 of file Phase2L1TGMTSAMuonGhostCleaner.cc.

Referenced by produce().

◆ fwdTokenPrompt_

edm::EDGetTokenT<std::vector<l1t::SAMuon> > Phase2L1TGMTSAMuonGhostCleaner::fwdTokenPrompt_
private

Definition at line 38 of file Phase2L1TGMTSAMuonGhostCleaner.cc.

Referenced by produce().

◆ ghostCleaner

SAMuonCleaner Phase2L1TGMTSAMuonGhostCleaner::ghostCleaner
private

Definition at line 41 of file Phase2L1TGMTSAMuonGhostCleaner.cc.

Referenced by prodMuons().