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 hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () 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::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 33 of file ME0ChamberMasker.cc.

Constructor & Destructor Documentation

◆ ME0ChamberMasker()

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

Definition at line 65 of file ME0ChamberMasker.cc.

66  : me0Minus_(iConfig.getParameter<bool>("me0Minus")),
67  me0Plus_(iConfig.getParameter<bool>("me0Plus")),
68  digiTag_(iConfig.getParameter<edm::InputTag>("digiTag")) {
69  m_digiTag = consumes<ME0DigiPreRecoCollection>(digiTag_);
70  produces<ME0DigiPreRecoCollection>();
71 }

References digiTag_, and m_digiTag.

◆ ~ME0ChamberMasker()

ME0ChamberMasker::~ME0ChamberMasker ( )
override

Definition at line 73 of file ME0ChamberMasker.cc.

73 {}

Member Function Documentation

◆ beginRun()

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

Definition at line 105 of file ME0ChamberMasker.cc.

105  {
107  iSetup.get<MuonSystemAgingRcd>().get(agingObj);
108 
109  m_maskedME0IDs = agingObj->m_ME0ChambEffs;
110 }

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

◆ endRun()

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

Definition at line 114 of file ME0ChamberMasker.cc.

114 {}

◆ fillDescriptions()

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

Definition at line 117 of file ME0ChamberMasker.cc.

117  {
119  desc.add<edm::InputTag>("digiTag", edm::InputTag("simMuonME0Digis"));
120  desc.add<bool>("me0Minus", true);
121  desc.add<bool>("me0Plus", true);
122  descriptions.add("me0ChamberMasker", desc);
123 }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and HLT_2018_cff::InputTag.

◆ produce()

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

Definition at line 80 of file ME0ChamberMasker.cc.

80  {
81  using namespace edm;
82  std::unique_ptr<ME0DigiPreRecoCollection> filteredDigis(new ME0DigiPreRecoCollection());
83 
84  if (!digiTag_.label().empty()) {
86  iEvent.getByToken(m_digiTag, me0Digis);
87 
88  for (const auto& me0LayerId : (*me0Digis)) {
89  auto chambId = me0LayerId.first.chamberId();
90 
91  bool keepDigi = (!me0Minus_ && chambId.region() < 0) || (!me0Plus_ && chambId.region() > 0);
92 
93  uint32_t rawId = chambId.rawId();
94  if (keepDigi || m_maskedME0IDs.find(rawId) == m_maskedME0IDs.end()) {
95  filteredDigis->put(me0LayerId.second, me0LayerId.first);
96  }
97  }
98  }
99 
100  iEvent.put(std::move(filteredDigis));
101 }

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 49 of file ME0ChamberMasker.cc.

Referenced by ME0ChamberMasker(), and produce().

◆ m_digiTag

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

Definition at line 50 of file ME0ChamberMasker.cc.

Referenced by ME0ChamberMasker(), and produce().

◆ m_maskedME0IDs

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

Definition at line 51 of file ME0ChamberMasker.cc.

Referenced by beginRun(), and produce().

◆ me0Minus_

bool ME0ChamberMasker::me0Minus_
private

Definition at line 47 of file ME0ChamberMasker.cc.

Referenced by produce().

◆ me0Plus_

bool ME0ChamberMasker::me0Plus_
private

Definition at line 48 of file ME0ChamberMasker.cc.

Referenced by produce().

edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
MuonSystemAgingRcd
Definition: MuonSystemAgingRcd.h:20
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::Handle
Definition: AssociativeIterator.h:50
ME0ChamberMasker::me0Minus_
bool me0Minus_
Definition: ME0ChamberMasker.cc:47
ME0ChamberMasker::m_digiTag
edm::EDGetTokenT< ME0DigiPreRecoCollection > m_digiTag
Definition: ME0ChamberMasker.cc:50
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
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
MuonSystemAging::m_ME0ChambEffs
std::map< unsigned int, float > m_ME0ChambEffs
Definition: MuonSystemAging.h:23
iEvent
int iEvent
Definition: GenABIO.cc:224
get
#define get
ME0ChamberMasker::me0Plus_
bool me0Plus_
Definition: ME0ChamberMasker.cc:48
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
ME0ChamberMasker::digiTag_
edm::InputTag digiTag_
Definition: ME0ChamberMasker.cc:49
ME0ChamberMasker::m_maskedME0IDs
std::map< unsigned int, float > m_maskedME0IDs
Definition: ME0ChamberMasker.cc:51
edm::InputTag
Definition: InputTag.h:15
ME0DigiPreRecoCollection
MuonDigiCollection< ME0DetId, ME0DigiPreReco > ME0DigiPreRecoCollection
Definition: ME0DigiPreRecoCollection.h:13