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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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

Constructor & Destructor Documentation

◆ ME0ChamberMasker()

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

Definition at line 67 of file ME0ChamberMasker.cc.

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 }

References digiTag_, m_agingObjTag, and 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.

108  {
109  edm::ESHandle<MuonSystemAging> agingObj = iSetup.getHandle(m_agingObjTag);
110 
111  m_maskedME0IDs = agingObj->m_ME0ChambEffs;
112 }

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

◆ 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.

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 }

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

◆ produce()

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

Definition at line 83 of file ME0ChamberMasker.cc.

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 }

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

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().

edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ME0ChamberMasker::m_agingObjTag
edm::ESGetToken< MuonSystemAging, MuonSystemAgingRcd > m_agingObjTag
Definition: ME0ChamberMasker.cc:52
edm::Handle
Definition: AssociativeIterator.h:50
ME0ChamberMasker::me0Minus_
bool me0Minus_
Definition: ME0ChamberMasker.cc:48
ME0ChamberMasker::m_digiTag
edm::EDGetTokenT< ME0DigiPreRecoCollection > m_digiTag
Definition: ME0ChamberMasker.cc:51
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::ESHandle
Definition: DTSurvey.h:22
MuonSystemAging::m_ME0ChambEffs
std::map< unsigned int, float > m_ME0ChambEffs
Definition: MuonSystemAging.h:23
iEvent
int iEvent
Definition: GenABIO.cc:224
ME0ChamberMasker::me0Plus_
bool me0Plus_
Definition: ME0ChamberMasker.cc:49
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
ME0ChamberMasker::digiTag_
edm::InputTag digiTag_
Definition: ME0ChamberMasker.cc:50
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ME0ChamberMasker::m_maskedME0IDs
std::map< unsigned int, float > m_maskedME0IDs
Definition: ME0ChamberMasker.cc:53
edm::InputTag
Definition: InputTag.h:15
ME0DigiPreRecoCollection
MuonDigiCollection< ME0DetId, ME0DigiPreReco > ME0DigiPreRecoCollection
Definition: ME0DigiPreRecoCollection.h:13