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
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,
MuonSystemAgingRcd
m_agingObjTag
 
edm::EDGetTokenT
< ME0DigiPreRecoCollection
m_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 ( 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 }
edm::InputTag digiTag_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< MuonSystemAging, MuonSystemAgingRcd > m_agingObjTag
edm::EDGetTokenT< ME0DigiPreRecoCollection > m_digiTag
ME0ChamberMasker::~ME0ChamberMasker ( )
override

Definition at line 76 of file ME0ChamberMasker.cc.

76 {}

Member Function Documentation

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, and m_maskedME0IDs.

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

Definition at line 116 of file ME0ChamberMasker.cc.

116 {}
void ME0ChamberMasker::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 119 of file ME0ChamberMasker.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, and HLT_FULL_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 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void ME0ChamberMasker::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 83 of file ME0ChamberMasker.cc.

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

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 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
MuonDigiCollection< ME0DetId, ME0DigiPreReco > ME0DigiPreRecoCollection
def move
Definition: eostools.py:511
edm::InputTag digiTag_
std::string const & label() const
Definition: InputTag.h:36
std::map< unsigned int, float > m_maskedME0IDs
edm::EDGetTokenT< ME0DigiPreRecoCollection > m_digiTag

Member Data Documentation

edm::InputTag ME0ChamberMasker::digiTag_
private

Definition at line 50 of file ME0ChamberMasker.cc.

Referenced by ME0ChamberMasker(), and produce().

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

Definition at line 52 of file ME0ChamberMasker.cc.

Referenced by beginRun(), and ME0ChamberMasker().

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

Definition at line 51 of file ME0ChamberMasker.cc.

Referenced by ME0ChamberMasker(), and produce().

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

Definition at line 53 of file ME0ChamberMasker.cc.

Referenced by beginRun(), and produce().

bool ME0ChamberMasker::me0Minus_
private

Definition at line 48 of file ME0ChamberMasker.cc.

Referenced by produce().

bool ME0ChamberMasker::me0Plus_
private

Definition at line 49 of file ME0ChamberMasker.cc.

Referenced by produce().