CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
L1TMuonQualityAdjuster Class Reference
Inheritance diagram for L1TMuonQualityAdjuster:
edm::stream::EDProducer<>

Public Member Functions

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

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

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

Private Attributes

edm::InputTag m_barrelTfInputTag
 
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollectionm_barrelTfInputToken
 
int m_bmtfBxOffset
 
edm::InputTag m_endCapTfInputTag
 
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollectionm_endCapTfInputToken
 
edm::InputTag m_overlapTfInputTag
 
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollectionm_overlapTfInputToken
 

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 34 of file L1TMuonQualityAdjuster.cc.

Constructor & Destructor Documentation

◆ L1TMuonQualityAdjuster()

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

Definition at line 64 of file L1TMuonQualityAdjuster.cc.

References edm::ParameterSet::getParameter().

64  {
65  m_barrelTfInputTag = iConfig.getParameter<edm::InputTag>("bmtfInput");
66  m_overlapTfInputTag = iConfig.getParameter<edm::InputTag>("omtfInput");
67  m_endCapTfInputTag = iConfig.getParameter<edm::InputTag>("emtfInput");
68  m_bmtfBxOffset = iConfig.getParameter<int>("bmtfBxOffset");
69  m_barrelTfInputToken = consumes<l1t::RegionalMuonCandBxCollection>(m_barrelTfInputTag);
70  m_overlapTfInputToken = consumes<l1t::RegionalMuonCandBxCollection>(m_overlapTfInputTag);
71  m_endCapTfInputToken = consumes<l1t::RegionalMuonCandBxCollection>(m_endCapTfInputTag);
72  //register your products
73  produces<RegionalMuonCandBxCollection>("BMTF");
74  produces<RegionalMuonCandBxCollection>("OMTF");
75  produces<RegionalMuonCandBxCollection>("EMTF");
76 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > m_endCapTfInputToken
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > m_barrelTfInputToken
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > m_overlapTfInputToken

Member Function Documentation

◆ fillDescriptions()

void L1TMuonQualityAdjuster::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 155 of file L1TMuonQualityAdjuster.cc.

References edm::ConfigurationDescriptions::addDefault(), and submitPVResolutionJobs::desc.

155  {
156  //The following says we do not know what parameters are allowed so do no validation
157  // Please change this to state exactly what you do use, even if it is no parameters
159  desc.setUnknown();
160  descriptions.addDefault(desc);
161 }
void addDefault(ParameterSetDescription const &psetDescription)

◆ produce()

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

Definition at line 83 of file L1TMuonQualityAdjuster.cc.

References BXVector< T >::begin(), nano_mu_digi_cff::bx, BXVector< T >::end(), BXVector< T >::getFirstBX(), BXVector< T >::getLastBX(), iEvent, edm::HandleBase::isValid(), eostools::move(), amptDefaultParameters_cff::mu, and l1t::RegionalMuonCand::setHwQual().

83  {
84  using namespace edm;
85 
86  std::unique_ptr<l1t::RegionalMuonCandBxCollection> filteredBMTFMuons(new l1t::RegionalMuonCandBxCollection());
87  std::unique_ptr<l1t::RegionalMuonCandBxCollection> filteredOMTFMuons(new l1t::RegionalMuonCandBxCollection());
88  std::unique_ptr<l1t::RegionalMuonCandBxCollection> filteredEMTFMuons(new l1t::RegionalMuonCandBxCollection());
89 
93 
94  iEvent.getByToken(m_barrelTfInputToken, bmtfMuons);
95  iEvent.getByToken(m_overlapTfInputToken, omtfMuons);
96  iEvent.getByToken(m_endCapTfInputToken, emtfMuons);
97 
98  if (bmtfMuons.isValid()) {
99  filteredBMTFMuons->setBXRange(bmtfMuons->getFirstBX(), bmtfMuons->getLastBX());
100  for (int bx = bmtfMuons->getFirstBX(); bx <= bmtfMuons->getLastBX(); ++bx) {
101  for (auto mu = bmtfMuons->begin(bx); mu != bmtfMuons->end(bx); ++mu) {
102  int newqual = 12;
103  l1t::RegionalMuonCand newMu((*mu));
104  newMu.setHwQual(newqual);
105  filteredBMTFMuons->push_back(bx + m_bmtfBxOffset, newMu);
106  }
107  }
108  } else {
109  //cout << "ERROR: did not find BMTF muons in event with label: " << m_barrelTfInputTag << "\n";
110  }
111 
112  if (emtfMuons.isValid()) {
113  filteredEMTFMuons->setBXRange(emtfMuons->getFirstBX(), emtfMuons->getLastBX());
114  for (int bx = emtfMuons->getFirstBX(); bx <= emtfMuons->getLastBX(); ++bx) {
115  for (auto mu = emtfMuons->begin(bx); mu != emtfMuons->end(bx); ++mu) {
116  int newqual = 0;
117  if (mu->hwQual() == 11 || mu->hwQual() > 12)
118  newqual = 12;
119  l1t::RegionalMuonCand newMu((*mu));
120  newMu.setHwQual(newqual);
121  filteredEMTFMuons->push_back(bx, newMu);
122  }
123  }
124  } else {
125  //cout << "ERROR: did not find EMTF muons in event with label: " << m_endCapTfInputTag << "\n";
126  }
127 
128  if (omtfMuons.isValid()) {
129  filteredOMTFMuons->setBXRange(omtfMuons->getFirstBX(), omtfMuons->getLastBX());
130  for (int bx = omtfMuons->getFirstBX(); bx <= omtfMuons->getLastBX(); ++bx) {
131  for (auto mu = omtfMuons->begin(bx); mu != omtfMuons->end(bx); ++mu) {
132  int newqual = 0;
133  if (mu->hwQual() > 0)
134  newqual = 12;
135  l1t::RegionalMuonCand newMu((*mu));
136  newMu.setHwQual(newqual);
137  filteredOMTFMuons->push_back(bx, newMu);
138  }
139  }
140  } else {
141  //cout << "ERROR: did not find OMTF muons in event with label: " << m_overlapTfInputTag << "\n";
142  }
143 
144  //cout << "Size BMTF(-3): " << filteredBMTFMuons->size(-3) << "\n";
145  //cout << "Size BMTF: " << filteredBMTFMuons->size(0) << "\n";
146  //cout << "Size OMTF: " << filteredOMTFMuons->size(0) << "\n";
147  //cout << "Size EMTF: " << filteredEMTFMuons->size(0) << "\n";
148 
149  iEvent.put(std::move(filteredBMTFMuons), "BMTF");
150  iEvent.put(std::move(filteredOMTFMuons), "OMTF");
151  iEvent.put(std::move(filteredEMTFMuons), "EMTF");
152 }
int getLastBX() const
int getFirstBX() const
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > m_endCapTfInputToken
const_iterator begin(int bx) const
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > m_barrelTfInputToken
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > m_overlapTfInputToken
bool isValid() const
Definition: HandleBase.h:70
const_iterator end(int bx) const
HLT enums.
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ m_barrelTfInputTag

edm::InputTag L1TMuonQualityAdjuster::m_barrelTfInputTag
private

Definition at line 47 of file L1TMuonQualityAdjuster.cc.

◆ m_barrelTfInputToken

edm::EDGetTokenT<l1t::RegionalMuonCandBxCollection> L1TMuonQualityAdjuster::m_barrelTfInputToken
private

Definition at line 43 of file L1TMuonQualityAdjuster.cc.

◆ m_bmtfBxOffset

int L1TMuonQualityAdjuster::m_bmtfBxOffset
private

Definition at line 50 of file L1TMuonQualityAdjuster.cc.

◆ m_endCapTfInputTag

edm::InputTag L1TMuonQualityAdjuster::m_endCapTfInputTag
private

Definition at line 49 of file L1TMuonQualityAdjuster.cc.

◆ m_endCapTfInputToken

edm::EDGetTokenT<l1t::RegionalMuonCandBxCollection> L1TMuonQualityAdjuster::m_endCapTfInputToken
private

Definition at line 45 of file L1TMuonQualityAdjuster.cc.

◆ m_overlapTfInputTag

edm::InputTag L1TMuonQualityAdjuster::m_overlapTfInputTag
private

Definition at line 48 of file L1TMuonQualityAdjuster.cc.

◆ m_overlapTfInputToken

edm::EDGetTokenT<l1t::RegionalMuonCandBxCollection> L1TMuonQualityAdjuster::m_overlapTfInputToken
private

Definition at line 44 of file L1TMuonQualityAdjuster.cc.