CMS 3D CMS Logo

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

Public Member Functions

 ME0ChamberMasker (const edm::ParameterSet &)
 
 ~ME0ChamberMasker () 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 beginRun (edm::Run const &, edm::EventSetup const &) override
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

edm::InputTag digiTag_
 
edm::ESGetToken< MuonSystemAging, MuonSystemAgingRcdm_agingObjTag
 
edm::EDGetTokenT< ME0DigiPreRecoCollectionm_digiTag
 
std::map< unsigned int, float > m_maskedME0IDs
 
bool me0Minus_
 
bool me0Plus_
 

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 ME0ChamberMasker.cc.

Constructor & Destructor Documentation

◆ ME0ChamberMasker()

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

Definition at line 67 of file ME0ChamberMasker.cc.

References digiTag_, m_agingObjTag, and m_digiTag.

68  : me0Minus_(iConfig.getParameter<bool>("me0Minus")),
69  me0Plus_(iConfig.getParameter<bool>("me0Plus")),
70  digiTag_(iConfig.getParameter<edm::InputTag>("digiTag")) {
71  m_digiTag = consumes<ME0DigiPreRecoCollection>(digiTag_);
72  m_agingObjTag = esConsumes<MuonSystemAging, MuonSystemAgingRcd, edm::Transition::BeginRun>();
73  produces<ME0DigiPreRecoCollection>();
74 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::InputTag digiTag_
edm::ESGetToken< MuonSystemAging, MuonSystemAgingRcd > m_agingObjTag
edm::EDGetTokenT< ME0DigiPreRecoCollection > m_digiTag

◆ ~ME0ChamberMasker()

ME0ChamberMasker::~ME0ChamberMasker ( )
override

Definition at line 76 of file ME0ChamberMasker.cc.

76 {}

Member Function Documentation

◆ beginRun()

void ME0ChamberMasker::beginRun ( edm::Run const &  run,
edm::EventSetup const &  iSetup 
)
overrideprivate

Definition at line 108 of file ME0ChamberMasker.cc.

References edm::EventSetup::getHandle(), m_agingObjTag, m_maskedME0IDs, and MuonSystemAging::m_ME0ChambEffs.

108  {
109  edm::ESHandle<MuonSystemAging> agingObj = iSetup.getHandle(m_agingObjTag);
110 
111  m_maskedME0IDs = agingObj->m_ME0ChambEffs;
112 }
std::map< unsigned int, float > m_ME0ChambEffs
edm::ESGetToken< MuonSystemAging, MuonSystemAgingRcd > m_agingObjTag
std::map< unsigned int, float > m_maskedME0IDs

◆ endRun()

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

Definition at line 116 of file ME0ChamberMasker.cc.

116 {}

◆ fillDescriptions()

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

Definition at line 119 of file ME0ChamberMasker.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and HLT_2022v12_cff::InputTag.

119  {
121  desc.add<edm::InputTag>("digiTag", edm::InputTag("simMuonME0Digis"));
122  desc.add<bool>("me0Minus", true);
123  desc.add<bool>("me0Plus", true);
124  descriptions.add("me0ChamberMasker", desc);
125 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Definition at line 83 of file ME0ChamberMasker.cc.

References digiTag_, iEvent, edm::InputTag::label(), m_digiTag, m_maskedME0IDs, me0Minus_, me0Plus_, and eostools::move().

83  {
84  using namespace edm;
85  std::unique_ptr<ME0DigiPreRecoCollection> filteredDigis(new ME0DigiPreRecoCollection());
86 
87  if (!digiTag_.label().empty()) {
89  iEvent.getByToken(m_digiTag, me0Digis);
90 
91  for (const auto& me0LayerId : (*me0Digis)) {
92  auto chambId = me0LayerId.first.chamberId();
93 
94  bool keepDigi = (!me0Minus_ && chambId.region() < 0) || (!me0Plus_ && chambId.region() > 0);
95 
96  uint32_t rawId = chambId.rawId();
97  if (keepDigi || m_maskedME0IDs.find(rawId) == m_maskedME0IDs.end()) {
98  filteredDigis->put(me0LayerId.second, me0LayerId.first);
99  }
100  }
101  }
102 
103  iEvent.put(std::move(filteredDigis));
104 }
std::string const & label() const
Definition: InputTag.h:36
int iEvent
Definition: GenABIO.cc:224
MuonDigiCollection< ME0DetId, ME0DigiPreReco > ME0DigiPreRecoCollection
edm::InputTag digiTag_
HLT enums.
std::map< unsigned int, float > m_maskedME0IDs
edm::EDGetTokenT< ME0DigiPreRecoCollection > m_digiTag
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ digiTag_

edm::InputTag ME0ChamberMasker::digiTag_
private

Definition at line 50 of file ME0ChamberMasker.cc.

Referenced by ME0ChamberMasker(), and produce().

◆ m_agingObjTag

edm::ESGetToken<MuonSystemAging, MuonSystemAgingRcd> ME0ChamberMasker::m_agingObjTag
private

Definition at line 52 of file ME0ChamberMasker.cc.

Referenced by beginRun(), and ME0ChamberMasker().

◆ m_digiTag

edm::EDGetTokenT<ME0DigiPreRecoCollection> ME0ChamberMasker::m_digiTag
private

Definition at line 51 of file ME0ChamberMasker.cc.

Referenced by ME0ChamberMasker(), and produce().

◆ m_maskedME0IDs

std::map<unsigned int, float> ME0ChamberMasker::m_maskedME0IDs
private

Definition at line 53 of file ME0ChamberMasker.cc.

Referenced by beginRun(), and produce().

◆ me0Minus_

bool ME0ChamberMasker::me0Minus_
private

Definition at line 48 of file ME0ChamberMasker.cc.

Referenced by produce().

◆ me0Plus_

bool ME0ChamberMasker::me0Plus_
private

Definition at line 49 of file ME0ChamberMasker.cc.

Referenced by produce().