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::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 GEMChamberMasker (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::global::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
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 

Private Attributes

const edm::InputTag digiTag_
 
const bool ge11Minus_
 
const bool ge11Plus_
 
const bool ge21Minus_
 
const bool ge21Plus_
 
const edm::ESGetToken< MuonSystemAging, MuonSystemAgingRcdm_agingObj
 
const edm::EDGetTokenT< GEMDigiCollectionm_digiTag
 
const edm::EDPutTokenT< GEMDigiCollectionm_putToken
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 30 of file GEMChamberMasker.cc.

Constructor & Destructor Documentation

◆ GEMChamberMasker()

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

Definition at line 62 of file GEMChamberMasker.cc.

63  : digiTag_(iConfig.getParameter<edm::InputTag>("digiTag")),
64  ge11Minus_(iConfig.getParameter<bool>("ge11Minus")),
65  ge11Plus_(iConfig.getParameter<bool>("ge11Plus")),
66  ge21Minus_(iConfig.getParameter<bool>("ge21Minus")),
67  ge21Plus_(iConfig.getParameter<bool>("ge21Plus")),
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const edm::ESGetToken< MuonSystemAging, MuonSystemAgingRcd > m_agingObj
const edm::EDGetTokenT< GEMDigiCollection > m_digiTag
const edm::EDPutTokenT< GEMDigiCollection > m_putToken
const edm::InputTag digiTag_

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 106 of file GEMChamberMasker.cc.

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

106  {
108  desc.add<edm::InputTag>("digiTag", edm::InputTag("simMuonGEMDigis"));
109  desc.add<bool>("ge11Minus", true);
110  desc.add<bool>("ge11Plus", true);
111  desc.add<bool>("ge21Minus", true);
112  desc.add<bool>("ge21Plus", true);
113 
114  descriptions.add("gemChamberMasker", desc);
115 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Implements edm::global::EDProducerBase.

Definition at line 77 of file GEMChamberMasker.cc.

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

77  {
78  using namespace edm;
79  GEMDigiCollection filteredDigis;
80 
81  auto const& agingObj = iSetup.getData(m_agingObj);
82 
83  auto const& maskedGEMIDs = agingObj.m_GEMChambEffs;
84 
85  if (!digiTag_.label().empty()) {
86  GEMDigiCollection const& gemDigis = iEvent.get(m_digiTag);
87 
88  for (const auto& gemLayerId : gemDigis) {
89  auto chambId = gemLayerId.first.chamberId();
90 
91  bool keepDigi = (!ge11Minus_ && chambId.station() == 1 && chambId.region() < 0) ||
92  (!ge11Plus_ && chambId.station() == 1 && chambId.region() > 0) ||
93  (!ge21Minus_ && chambId.station() == 2 && chambId.region() < 0) ||
94  (!ge21Plus_ && chambId.station() == 2 && chambId.region() > 0);
95 
96  uint32_t rawId = chambId.rawId();
97  if (keepDigi || maskedGEMIDs.find(rawId) == maskedGEMIDs.end()) {
98  filteredDigis.put(gemLayerId.second, gemLayerId.first);
99  }
100  }
101  }
102 
103  iEvent.emplace(m_putToken, std::move(filteredDigis));
104 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
std::string const & label() const
Definition: InputTag.h:36
int iEvent
Definition: GenABIO.cc:224
const edm::ESGetToken< MuonSystemAging, MuonSystemAgingRcd > m_agingObj
const edm::EDGetTokenT< GEMDigiCollection > m_digiTag
const edm::EDPutTokenT< GEMDigiCollection > m_putToken
HLT enums.
def move(src, dest)
Definition: eostools.py:511
const edm::InputTag digiTag_

Member Data Documentation

◆ digiTag_

const edm::InputTag GEMChamberMasker::digiTag_
private

Definition at line 40 of file GEMChamberMasker.cc.

Referenced by produce().

◆ ge11Minus_

const bool GEMChamberMasker::ge11Minus_
private

Definition at line 41 of file GEMChamberMasker.cc.

Referenced by produce().

◆ ge11Plus_

const bool GEMChamberMasker::ge11Plus_
private

Definition at line 42 of file GEMChamberMasker.cc.

Referenced by produce().

◆ ge21Minus_

const bool GEMChamberMasker::ge21Minus_
private

Definition at line 43 of file GEMChamberMasker.cc.

Referenced by produce().

◆ ge21Plus_

const bool GEMChamberMasker::ge21Plus_
private

Definition at line 44 of file GEMChamberMasker.cc.

Referenced by produce().

◆ m_agingObj

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

Definition at line 48 of file GEMChamberMasker.cc.

Referenced by produce().

◆ m_digiTag

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

Definition at line 46 of file GEMChamberMasker.cc.

Referenced by produce().

◆ m_putToken

const edm::EDPutTokenT<GEMDigiCollection> GEMChamberMasker::m_putToken
private

Definition at line 47 of file GEMChamberMasker.cc.

Referenced by produce().