CMS 3D CMS Logo

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 &)
 
 ~L1TMuonQualityAdjuster () override
 
- 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 beginLuminosityBlock (const edm::LuminosityBlock &, edm::EventSetup const &) override
 
void beginRun (const edm::Run &, edm::EventSetup const &) override
 
void endLuminosityBlock (const edm::LuminosityBlock &, edm::EventSetup const &) override
 
void endRun (const edm::Run &, edm::EventSetup const &) override
 
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 69 of file L1TMuonQualityAdjuster.cc.

References edm::ParameterSet::getParameter().

69  {
70  m_barrelTfInputTag = iConfig.getParameter<edm::InputTag>("bmtfInput");
71  m_overlapTfInputTag = iConfig.getParameter<edm::InputTag>("omtfInput");
72  m_endCapTfInputTag = iConfig.getParameter<edm::InputTag>("emtfInput");
73  m_bmtfBxOffset = iConfig.getParameter<int>("bmtfBxOffset");
74  m_barrelTfInputToken = consumes<l1t::RegionalMuonCandBxCollection>(m_barrelTfInputTag);
75  m_overlapTfInputToken = consumes<l1t::RegionalMuonCandBxCollection>(m_overlapTfInputTag);
76  m_endCapTfInputToken = consumes<l1t::RegionalMuonCandBxCollection>(m_endCapTfInputTag);
77  //register your products
78  produces<RegionalMuonCandBxCollection>("BMTF");
79  produces<RegionalMuonCandBxCollection>("OMTF");
80  produces<RegionalMuonCandBxCollection>("EMTF");
81 }
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

◆ ~L1TMuonQualityAdjuster()

L1TMuonQualityAdjuster::~L1TMuonQualityAdjuster ( )
override

Definition at line 83 of file L1TMuonQualityAdjuster.cc.

83  {
84  // do anything here that needs to be done at desctruction time
85  // (e.g. close files, deallocate resources etc.)
86 }

Member Function Documentation

◆ beginLuminosityBlock()

void L1TMuonQualityAdjuster::beginLuminosityBlock ( const edm::LuminosityBlock ,
edm::EventSetup const &   
)
overrideprivate

Definition at line 171 of file L1TMuonQualityAdjuster.cc.

171 {}

◆ beginRun()

void L1TMuonQualityAdjuster::beginRun ( const edm::Run ,
edm::EventSetup const &   
)
overrideprivate

Definition at line 165 of file L1TMuonQualityAdjuster.cc.

165 {}

◆ endLuminosityBlock()

void L1TMuonQualityAdjuster::endLuminosityBlock ( const edm::LuminosityBlock ,
edm::EventSetup const &   
)
overrideprivate

Definition at line 174 of file L1TMuonQualityAdjuster.cc.

174 {}

◆ endRun()

void L1TMuonQualityAdjuster::endRun ( const edm::Run ,
edm::EventSetup const &   
)
overrideprivate

Definition at line 168 of file L1TMuonQualityAdjuster.cc.

168 {}

◆ fillDescriptions()

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

Definition at line 177 of file L1TMuonQualityAdjuster.cc.

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

177  {
178  //The following says we do not know what parameters are allowed so do no validation
179  // Please change this to state exactly what you do use, even if it is no parameters
181  desc.setUnknown();
182  descriptions.addDefault(desc);
183 }
void addDefault(ParameterSetDescription const &psetDescription)

◆ produce()

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

Definition at line 93 of file L1TMuonQualityAdjuster.cc.

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

93  {
94  using namespace edm;
95 
96  std::unique_ptr<l1t::RegionalMuonCandBxCollection> filteredBMTFMuons(new l1t::RegionalMuonCandBxCollection());
97  std::unique_ptr<l1t::RegionalMuonCandBxCollection> filteredOMTFMuons(new l1t::RegionalMuonCandBxCollection());
98  std::unique_ptr<l1t::RegionalMuonCandBxCollection> filteredEMTFMuons(new l1t::RegionalMuonCandBxCollection());
99 
103 
104  iEvent.getByToken(m_barrelTfInputToken, bmtfMuons);
105  iEvent.getByToken(m_overlapTfInputToken, omtfMuons);
106  iEvent.getByToken(m_endCapTfInputToken, emtfMuons);
107 
108  if (bmtfMuons.isValid()) {
109  filteredBMTFMuons->setBXRange(bmtfMuons->getFirstBX(), bmtfMuons->getLastBX());
110  for (int bx = bmtfMuons->getFirstBX(); bx <= bmtfMuons->getLastBX(); ++bx) {
111  for (auto mu = bmtfMuons->begin(bx); mu != bmtfMuons->end(bx); ++mu) {
112  int newqual = 12;
113  l1t::RegionalMuonCand newMu((*mu));
114  newMu.setHwQual(newqual);
115  filteredBMTFMuons->push_back(bx + m_bmtfBxOffset, newMu);
116  }
117  }
118  } else {
119  //cout << "ERROR: did not find BMTF muons in event with label: " << m_barrelTfInputTag << "\n";
120  }
121 
122  if (emtfMuons.isValid()) {
123  filteredEMTFMuons->setBXRange(emtfMuons->getFirstBX(), emtfMuons->getLastBX());
124  for (int bx = emtfMuons->getFirstBX(); bx <= emtfMuons->getLastBX(); ++bx) {
125  for (auto mu = emtfMuons->begin(bx); mu != emtfMuons->end(bx); ++mu) {
126  int newqual = 0;
127  if (mu->hwQual() == 11 || mu->hwQual() > 12)
128  newqual = 12;
129  l1t::RegionalMuonCand newMu((*mu));
130  newMu.setHwQual(newqual);
131  filteredEMTFMuons->push_back(bx, newMu);
132  }
133  }
134  } else {
135  //cout << "ERROR: did not find EMTF muons in event with label: " << m_endCapTfInputTag << "\n";
136  }
137 
138  if (omtfMuons.isValid()) {
139  filteredOMTFMuons->setBXRange(omtfMuons->getFirstBX(), omtfMuons->getLastBX());
140  for (int bx = omtfMuons->getFirstBX(); bx <= omtfMuons->getLastBX(); ++bx) {
141  for (auto mu = omtfMuons->begin(bx); mu != omtfMuons->end(bx); ++mu) {
142  int newqual = 0;
143  if (mu->hwQual() > 0)
144  newqual = 12;
145  l1t::RegionalMuonCand newMu((*mu));
146  newMu.setHwQual(newqual);
147  filteredOMTFMuons->push_back(bx, newMu);
148  }
149  }
150  } else {
151  //cout << "ERROR: did not find OMTF muons in event with label: " << m_overlapTfInputTag << "\n";
152  }
153 
154  //cout << "Size BMTF(-3): " << filteredBMTFMuons->size(-3) << "\n";
155  //cout << "Size BMTF: " << filteredBMTFMuons->size(0) << "\n";
156  //cout << "Size OMTF: " << filteredOMTFMuons->size(0) << "\n";
157  //cout << "Size EMTF: " << filteredEMTFMuons->size(0) << "\n";
158 
159  iEvent.put(std::move(filteredBMTFMuons), "BMTF");
160  iEvent.put(std::move(filteredOMTFMuons), "OMTF");
161  iEvent.put(std::move(filteredEMTFMuons), "EMTF");
162 }
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 52 of file L1TMuonQualityAdjuster.cc.

◆ m_barrelTfInputToken

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

Definition at line 48 of file L1TMuonQualityAdjuster.cc.

◆ m_bmtfBxOffset

int L1TMuonQualityAdjuster::m_bmtfBxOffset
private

Definition at line 55 of file L1TMuonQualityAdjuster.cc.

◆ m_endCapTfInputTag

edm::InputTag L1TMuonQualityAdjuster::m_endCapTfInputTag
private

Definition at line 54 of file L1TMuonQualityAdjuster.cc.

◆ m_endCapTfInputToken

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

Definition at line 50 of file L1TMuonQualityAdjuster.cc.

◆ m_overlapTfInputTag

edm::InputTag L1TMuonQualityAdjuster::m_overlapTfInputTag
private

Definition at line 53 of file L1TMuonQualityAdjuster.cc.

◆ m_overlapTfInputToken

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

Definition at line 49 of file L1TMuonQualityAdjuster.cc.