CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 &)
 
 ~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::RegionalMuonCandBxCollection
m_barrelTfInputToken
 
int m_bmtfBxOffset
 
edm::InputTag m_endCapTfInputTag
 
edm::EDGetTokenT
< l1t::RegionalMuonCandBxCollection
m_endCapTfInputToken
 
edm::InputTag m_overlapTfInputTag
 
edm::EDGetTokenT
< l1t::RegionalMuonCandBxCollection
m_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 ( 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 }
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > m_endCapTfInputToken
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > m_barrelTfInputToken
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > m_overlapTfInputToken
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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

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

Definition at line 171 of file L1TMuonQualityAdjuster.cc.

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

Definition at line 165 of file L1TMuonQualityAdjuster.cc.

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

Definition at line 174 of file L1TMuonQualityAdjuster.cc.

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

Definition at line 168 of file L1TMuonQualityAdjuster.cc.

168 {}
void L1TMuonQualityAdjuster::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 177 of file L1TMuonQualityAdjuster.cc.

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

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)
void L1TMuonQualityAdjuster::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 93 of file L1TMuonQualityAdjuster.cc.

References makePileupJSON::bx, edm::Event::getByToken(), eostools::move(), RPCpg::mu, edm::Event::put(), 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 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > m_endCapTfInputToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
def move
Definition: eostools.py:511
const int mu
Definition: Constants.h:22
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > m_barrelTfInputToken
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > m_overlapTfInputToken

Member Data Documentation

edm::InputTag L1TMuonQualityAdjuster::m_barrelTfInputTag
private

Definition at line 52 of file L1TMuonQualityAdjuster.cc.

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

Definition at line 48 of file L1TMuonQualityAdjuster.cc.

int L1TMuonQualityAdjuster::m_bmtfBxOffset
private

Definition at line 55 of file L1TMuonQualityAdjuster.cc.

edm::InputTag L1TMuonQualityAdjuster::m_endCapTfInputTag
private

Definition at line 54 of file L1TMuonQualityAdjuster.cc.

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

Definition at line 50 of file L1TMuonQualityAdjuster.cc.

edm::InputTag L1TMuonQualityAdjuster::m_overlapTfInputTag
private

Definition at line 53 of file L1TMuonQualityAdjuster.cc.

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

Definition at line 49 of file L1TMuonQualityAdjuster.cc.