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
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

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<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 34 of file L1TMuonQualityAdjuster.cc.

Constructor & Destructor Documentation

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

Definition at line 70 of file L1TMuonQualityAdjuster.cc.

References edm::ParameterSet::getParameter().

71 {
72  m_barrelTfInputTag = iConfig.getParameter<edm::InputTag>("bmtfInput");
73  m_overlapTfInputTag = iConfig.getParameter<edm::InputTag>("omtfInput");
74  m_endCapTfInputTag = iConfig.getParameter<edm::InputTag>("emtfInput");
75  m_bmtfBxOffset = iConfig.getParameter<int>("bmtfBxOffset");
76  m_barrelTfInputToken = consumes<l1t::RegionalMuonCandBxCollection>(m_barrelTfInputTag);
77  m_overlapTfInputToken = consumes<l1t::RegionalMuonCandBxCollection>(m_overlapTfInputTag);
78  m_endCapTfInputToken = consumes<l1t::RegionalMuonCandBxCollection>(m_endCapTfInputTag);
79  //register your products
80  produces<RegionalMuonCandBxCollection>("BMTF");
81  produces<RegionalMuonCandBxCollection>("OMTF");
82  produces<RegionalMuonCandBxCollection>("EMTF");
83 }
T getParameter(std::string const &) const
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > m_endCapTfInputToken
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > m_barrelTfInputToken
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > m_overlapTfInputToken
L1TMuonQualityAdjuster::~L1TMuonQualityAdjuster ( )
override

Definition at line 86 of file L1TMuonQualityAdjuster.cc.

87 {
88  // do anything here that needs to be done at desctruction time
89  // (e.g. close files, deallocate resources etc.)
90 }

Member Function Documentation

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

Definition at line 185 of file L1TMuonQualityAdjuster.cc.

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

Definition at line 173 of file L1TMuonQualityAdjuster.cc.

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

Definition at line 191 of file L1TMuonQualityAdjuster.cc.

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

Definition at line 179 of file L1TMuonQualityAdjuster.cc.

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

Definition at line 197 of file L1TMuonQualityAdjuster.cc.

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

197  {
198  //The following says we do not know what parameters are allowed so do no validation
199  // Please change this to state exactly what you do use, even if it is no parameters
201  desc.setUnknown();
202  descriptions.addDefault(desc);
203 }
void addDefault(ParameterSetDescription const &psetDescription)
void L1TMuonQualityAdjuster::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 100 of file L1TMuonQualityAdjuster.cc.

References BXVector< T >::begin(), BXVector< T >::end(), edm::Event::getByToken(), BXVector< T >::getFirstBX(), BXVector< T >::getLastBX(), edm::HandleBase::isValid(), eostools::move(), RPCpg::mu, edm::Event::put(), and l1t::RegionalMuonCand::setHwQual().

101 {
102  using namespace edm;
103 
104  std::unique_ptr<l1t::RegionalMuonCandBxCollection> filteredBMTFMuons (new l1t::RegionalMuonCandBxCollection());
105  std::unique_ptr<l1t::RegionalMuonCandBxCollection> filteredOMTFMuons (new l1t::RegionalMuonCandBxCollection());
106  std::unique_ptr<l1t::RegionalMuonCandBxCollection> filteredEMTFMuons (new l1t::RegionalMuonCandBxCollection());
107 
111 
112  iEvent.getByToken(m_barrelTfInputToken, bmtfMuons);
113  iEvent.getByToken(m_overlapTfInputToken, omtfMuons);
114  iEvent.getByToken(m_endCapTfInputToken, emtfMuons);
115 
116 
117  if (bmtfMuons.isValid()){
118  filteredBMTFMuons->setBXRange(bmtfMuons->getFirstBX(), bmtfMuons->getLastBX());
119  for (int bx = bmtfMuons->getFirstBX(); bx <= bmtfMuons->getLastBX(); ++bx) {
120  for (auto mu = bmtfMuons->begin(bx); mu != bmtfMuons->end(bx); ++mu) {
121  int newqual = 12;
122  l1t::RegionalMuonCand newMu((*mu));
123  newMu.setHwQual(newqual);
124  filteredBMTFMuons->push_back(bx+m_bmtfBxOffset, newMu);
125  }
126  }
127  } else {
128  //cout << "ERROR: did not find BMTF muons in event with label: " << m_barrelTfInputTag << "\n";
129  }
130 
131  if (emtfMuons.isValid()){
132  filteredEMTFMuons->setBXRange(emtfMuons->getFirstBX(), emtfMuons->getLastBX());
133  for (int bx = emtfMuons->getFirstBX(); bx <= emtfMuons->getLastBX(); ++bx) {
134  for (auto mu = emtfMuons->begin(bx); mu != emtfMuons->end(bx); ++mu) {
135  int newqual = 0;
136  if (mu->hwQual() == 11 || mu->hwQual() > 12) newqual=12;
137  l1t::RegionalMuonCand newMu((*mu));
138  newMu.setHwQual(newqual);
139  filteredEMTFMuons->push_back(bx, newMu);
140  }
141  }
142  } else {
143  //cout << "ERROR: did not find EMTF muons in event with label: " << m_endCapTfInputTag << "\n";
144  }
145 
146  if (omtfMuons.isValid()){
147  filteredOMTFMuons->setBXRange(omtfMuons->getFirstBX(), omtfMuons->getLastBX());
148  for (int bx = omtfMuons->getFirstBX(); bx <= omtfMuons->getLastBX(); ++bx) {
149  for (auto mu = omtfMuons->begin(bx); mu != omtfMuons->end(bx); ++mu) {
150  int newqual = 0;
151  if (mu->hwQual() > 0) newqual = 12;
152  l1t::RegionalMuonCand newMu((*mu));
153  newMu.setHwQual(newqual);
154  filteredOMTFMuons->push_back(bx, newMu);
155  }
156  }
157  } else {
158  //cout << "ERROR: did not find OMTF muons in event with label: " << m_overlapTfInputTag << "\n";
159  }
160 
161  //cout << "Size BMTF(-3): " << filteredBMTFMuons->size(-3) << "\n";
162  //cout << "Size BMTF: " << filteredBMTFMuons->size(0) << "\n";
163  //cout << "Size OMTF: " << filteredOMTFMuons->size(0) << "\n";
164  //cout << "Size EMTF: " << filteredEMTFMuons->size(0) << "\n";
165 
166  iEvent.put(std::move(filteredBMTFMuons), "BMTF");
167  iEvent.put(std::move(filteredOMTFMuons), "OMTF");
168  iEvent.put(std::move(filteredEMTFMuons), "EMTF");
169 }
const_iterator end(int bx) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > m_endCapTfInputToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
const int mu
Definition: Constants.h:22
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > m_barrelTfInputToken
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > m_overlapTfInputToken
int getFirstBX() const
HLT enums.
int getLastBX() const
const_iterator begin(int bx) const
def move(src, dest)
Definition: eostools.py:511

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.