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

Public Member Functions

 ME0ChamberMasker (const edm::ParameterSet &)
 
 ~ME0ChamberMasker ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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 ()
 
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, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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::vector< ModuleDescription const * > &modules, 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
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

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

Private Member Functions

virtual void beginRun (edm::Run const &, edm::EventSetup const &) override
 
virtual void endRun (edm::Run const &, edm::EventSetup const &) override
 
virtual 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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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)
 

Detailed Description

Definition at line 34 of file ME0ChamberMasker.cc.

Constructor & Destructor Documentation

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

Definition at line 70 of file ME0ChamberMasker.cc.

References digiTag_, and m_digiTag.

70  :
71  me0Minus_(iConfig.getParameter<bool>("me0Minus") ),
72  me0Plus_(iConfig.getParameter<bool>("me0Plus") ),
73  digiTag_(iConfig.getParameter<edm::InputTag>("digiTag") )
74 {
75 
76  m_digiTag = consumes<ME0DigiPreRecoCollection>(digiTag_);
77  produces<ME0DigiPreRecoCollection>();
78 
79 }
T getParameter(std::string const &) const
edm::InputTag digiTag_
edm::EDGetTokenT< ME0DigiPreRecoCollection > m_digiTag
ME0ChamberMasker::~ME0ChamberMasker ( )

Definition at line 82 of file ME0ChamberMasker.cc.

83 {
84 
85 }

Member Function Documentation

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

Reimplemented from edm::stream::EDProducerBase.

Definition at line 128 of file ME0ChamberMasker.cc.

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

129 {
130 
132  iSetup.get<MuonSystemAgingRcd>().get(agingObj);
133 
134  m_maskedME0IDs = agingObj->m_ME0ChambEffs;
135 
136 }
std::map< unsigned int, float > m_ME0ChambEffs
std::map< unsigned int, float > m_maskedME0IDs
void ME0ChamberMasker::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from edm::stream::EDProducerBase.

Definition at line 142 of file ME0ChamberMasker.cc.

143 {
144 
145 }
void ME0ChamberMasker::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 151 of file ME0ChamberMasker.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and DEFINE_FWK_MODULE.

152 {
153 
155  desc.add<edm::InputTag>("digiTag", edm::InputTag("simMuonME0Digis"));
156  desc.add<bool>("me0Minus", true);
157  desc.add<bool>("me0Plus", true);
158  descriptions.add("me0ChamberMasker",desc);
159 
160 }
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 
)
overrideprivatevirtual

Definition at line 93 of file ME0ChamberMasker.cc.

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

94 {
95 
96  using namespace edm;
97  std::unique_ptr<ME0DigiPreRecoCollection> filteredDigis(new ME0DigiPreRecoCollection());
98 
99  if (!digiTag_.label().empty())
100  {
102  iEvent.getByToken(m_digiTag, me0Digis);
103 
104  for ( const auto & me0LayerId : (*me0Digis) )
105  {
106 
107  auto chambId = me0LayerId.first.chamberId();
108 
109  bool keepDigi = (!me0Minus_ && chambId.region() < 0 ) ||
110  (!me0Plus_ && chambId.region() > 0 ) ;
111 
112  uint32_t rawId = chambId.rawId();
113  if(keepDigi || m_maskedME0IDs.find(rawId) == m_maskedME0IDs.end())
114  {
115  filteredDigis->put(me0LayerId.second,me0LayerId.first);
116  }
117 
118  }
119  }
120 
121  iEvent.put(std::move(filteredDigis));
122 
123 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
MuonDigiCollection< ME0DetId, ME0DigiPreReco > ME0DigiPreRecoCollection
edm::InputTag digiTag_
std::string const & label() const
Definition: InputTag.h:36
HLT enums.
std::map< unsigned int, float > m_maskedME0IDs
edm::EDGetTokenT< ME0DigiPreRecoCollection > m_digiTag
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

edm::InputTag ME0ChamberMasker::digiTag_
private

Definition at line 52 of file ME0ChamberMasker.cc.

Referenced by ME0ChamberMasker(), and produce().

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

Definition at line 53 of file ME0ChamberMasker.cc.

Referenced by ME0ChamberMasker(), and produce().

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

Definition at line 54 of file ME0ChamberMasker.cc.

Referenced by beginRun(), and produce().

bool ME0ChamberMasker::me0Minus_
private

Definition at line 50 of file ME0ChamberMasker.cc.

Referenced by produce().

bool ME0ChamberMasker::me0Plus_
private

Definition at line 51 of file ME0ChamberMasker.cc.

Referenced by produce().