CMS 3D CMS Logo

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

Public Member Functions

 GEMChamberMasker (const edm::ParameterSet &)
 
 ~GEMChamberMasker () 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_
 
bool ge11Minus_
 
bool ge11Plus_
 
bool ge21Minus_
 
bool ge21Plus_
 
edm::ESGetToken< MuonSystemAging, MuonSystemAgingRcdm_agingObj
 
edm::EDGetTokenT< GEMDigiCollectionm_digiTag
 
std::map< unsigned int, float > m_maskedGEMIDs
 

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 30 of file GEMChamberMasker.cc.

Constructor & Destructor Documentation

◆ GEMChamberMasker()

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

Definition at line 66 of file GEMChamberMasker.cc.

References digiTag_, m_agingObj, and m_digiTag.

67  : digiTag_(iConfig.getParameter<edm::InputTag>("digiTag")),
68  ge11Minus_(iConfig.getParameter<bool>("ge11Minus")),
69  ge11Plus_(iConfig.getParameter<bool>("ge11Plus")),
70  ge21Minus_(iConfig.getParameter<bool>("ge21Minus")),
71  ge21Plus_(iConfig.getParameter<bool>("ge21Plus")) {
72  m_digiTag = consumes<GEMDigiCollection>(digiTag_);
73  m_agingObj = esConsumes<MuonSystemAging, MuonSystemAgingRcd, edm::Transition::BeginRun>();
74  produces<GEMDigiCollection>();
75 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< GEMDigiCollection > m_digiTag
edm::ESGetToken< MuonSystemAging, MuonSystemAgingRcd > m_agingObj
edm::InputTag digiTag_

◆ ~GEMChamberMasker()

GEMChamberMasker::~GEMChamberMasker ( )
override

Definition at line 77 of file GEMChamberMasker.cc.

77 {}

Member Function Documentation

◆ beginRun()

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

Definition at line 112 of file GEMChamberMasker.cc.

References edm::EventSetup::getHandle(), m_agingObj, MuonSystemAging::m_GEMChambEffs, and m_maskedGEMIDs.

112  {
113  edm::ESHandle<MuonSystemAging> agingObj = iSetup.getHandle(m_agingObj);
114 
115  m_maskedGEMIDs = agingObj->m_GEMChambEffs;
116 }
std::map< unsigned int, float > m_GEMChambEffs
edm::ESGetToken< MuonSystemAging, MuonSystemAgingRcd > m_agingObj
std::map< unsigned int, float > m_maskedGEMIDs

◆ endRun()

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

Definition at line 120 of file GEMChamberMasker.cc.

120 {}

◆ fillDescriptions()

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

Definition at line 122 of file GEMChamberMasker.cc.

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

122  {
124  desc.add<edm::InputTag>("digiTag", edm::InputTag("simMuonGEMDigis"));
125  desc.add<bool>("ge11Minus", true);
126  desc.add<bool>("ge11Plus", true);
127  desc.add<bool>("ge21Minus", true);
128  desc.add<bool>("ge21Plus", true);
129 
130  descriptions.add("gemChamberMasker", desc);
131 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Definition at line 84 of file GEMChamberMasker.cc.

References digiTag_, ge11Minus_, ge11Plus_, ge21Minus_, ge21Plus_, iEvent, edm::InputTag::label(), m_digiTag, m_maskedGEMIDs, eostools::move(), and nano_mu_digi_cff::rawId.

84  {
85  using namespace edm;
86  std::unique_ptr<GEMDigiCollection> filteredDigis(new GEMDigiCollection());
87 
88  if (!digiTag_.label().empty()) {
90  iEvent.getByToken(m_digiTag, gemDigis);
91 
92  for (const auto& gemLayerId : (*gemDigis)) {
93  auto chambId = gemLayerId.first.chamberId();
94 
95  bool keepDigi = (!ge11Minus_ && chambId.station() == 1 && chambId.region() < 0) ||
96  (!ge11Plus_ && chambId.station() == 1 && chambId.region() > 0) ||
97  (!ge21Minus_ && chambId.station() == 2 && chambId.region() < 0) ||
98  (!ge21Plus_ && chambId.station() == 2 && chambId.region() > 0);
99 
100  uint32_t rawId = chambId.rawId();
101  if (keepDigi || m_maskedGEMIDs.find(rawId) == m_maskedGEMIDs.end()) {
102  filteredDigis->put(gemLayerId.second, gemLayerId.first);
103  }
104  }
105  }
106 
107  iEvent.put(std::move(filteredDigis));
108 }
edm::EDGetTokenT< GEMDigiCollection > m_digiTag
MuonDigiCollection< GEMDetId, GEMDigi > GEMDigiCollection
std::string const & label() const
Definition: InputTag.h:36
int iEvent
Definition: GenABIO.cc:224
HLT enums.
edm::InputTag digiTag_
std::map< unsigned int, float > m_maskedGEMIDs
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ digiTag_

edm::InputTag GEMChamberMasker::digiTag_
private

Definition at line 44 of file GEMChamberMasker.cc.

Referenced by GEMChamberMasker(), and produce().

◆ ge11Minus_

bool GEMChamberMasker::ge11Minus_
private

Definition at line 45 of file GEMChamberMasker.cc.

Referenced by produce().

◆ ge11Plus_

bool GEMChamberMasker::ge11Plus_
private

Definition at line 46 of file GEMChamberMasker.cc.

Referenced by produce().

◆ ge21Minus_

bool GEMChamberMasker::ge21Minus_
private

Definition at line 47 of file GEMChamberMasker.cc.

Referenced by produce().

◆ ge21Plus_

bool GEMChamberMasker::ge21Plus_
private

Definition at line 48 of file GEMChamberMasker.cc.

Referenced by produce().

◆ m_agingObj

edm::ESGetToken<MuonSystemAging, MuonSystemAgingRcd> GEMChamberMasker::m_agingObj
private

Definition at line 51 of file GEMChamberMasker.cc.

Referenced by beginRun(), and GEMChamberMasker().

◆ m_digiTag

edm::EDGetTokenT<GEMDigiCollection> GEMChamberMasker::m_digiTag
private

Definition at line 50 of file GEMChamberMasker.cc.

Referenced by GEMChamberMasker(), and produce().

◆ m_maskedGEMIDs

std::map<unsigned int, float> GEMChamberMasker::m_maskedGEMIDs
private

Definition at line 52 of file GEMChamberMasker.cc.

Referenced by beginRun(), and produce().