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

Public Member Functions

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

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

Constructor & Destructor Documentation

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

Definition at line 70 of file GEMChamberMasker.cc.

References digiTag_, and m_digiTag.

70  :
71  digiTag_(iConfig.getParameter<edm::InputTag>("digiTag") ),
72  ge11Minus_(iConfig.getParameter<bool>("ge11Minus") ),
73  ge11Plus_(iConfig.getParameter<bool>("ge11Plus") ),
74  ge21Minus_(iConfig.getParameter<bool>("ge21Minus") ),
75  ge21Plus_(iConfig.getParameter<bool>("ge21Plus") )
76 {
77 
78  m_digiTag = consumes<GEMDigiCollection>(digiTag_);
79  produces<GEMDigiCollection>();
80 
81 }
T getParameter(std::string const &) const
edm::EDGetTokenT< GEMDigiCollection > m_digiTag
edm::InputTag digiTag_
GEMChamberMasker::~GEMChamberMasker ( )

Definition at line 84 of file GEMChamberMasker.cc.

85 {
86 
87 }

Member Function Documentation

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

Reimplemented from edm::stream::EDProducerBase.

Definition at line 133 of file GEMChamberMasker.cc.

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

134 {
135 
137  iSetup.get<MuonSystemAgingRcd>().get(agingObj);
138 
139  m_maskedGEMIDs = agingObj->m_GEMChambEffs;
140 
141 }
std::map< unsigned int, float > m_GEMChambEffs
std::map< unsigned int, float > m_maskedGEMIDs
void GEMChamberMasker::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivatevirtual

Reimplemented from edm::stream::EDProducerBase.

Definition at line 147 of file GEMChamberMasker.cc.

148 {
149 
150 }
void GEMChamberMasker::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 153 of file GEMChamberMasker.cc.

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

154 {
155 
157  desc.add<edm::InputTag>("digiTag", edm::InputTag("simMuonGEMDigis"));
158  desc.add<bool>("ge11Minus", true);
159  desc.add<bool>("ge11Plus", true);
160  desc.add<bool>("ge21Minus", true);
161  desc.add<bool>("ge21Plus", true);
162 
163  descriptions.add("gemChamberMasker",desc);
164 
165 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void GEMChamberMasker::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Definition at line 96 of file GEMChamberMasker.cc.

References digiTag_, ge11Minus_, ge11Plus_, ge21Minus_, ge21Plus_, edm::Event::getByToken(), edm::InputTag::label(), m_digiTag, m_maskedGEMIDs, eostools::move(), and edm::Event::put().

97 {
98 
99  using namespace edm;
100  std::unique_ptr<GEMDigiCollection> filteredDigis(new GEMDigiCollection());
101 
102  if (!digiTag_.label().empty())
103  {
105  iEvent.getByToken(m_digiTag, gemDigis);
106 
107 
108  for ( const auto & gemLayerId : (*gemDigis) )
109  {
110  auto chambId = gemLayerId.first.chamberId();
111 
112  bool keepDigi = (!ge11Minus_ && chambId.station()==1 && chambId.region()<0 ) ||
113  (!ge11Plus_ && chambId.station()==1 && chambId.region()>0 ) ||
114  (!ge21Minus_ && chambId.station()==2 && chambId.region()<0 ) ||
115  (!ge21Plus_ && chambId.station()==2 && chambId.region()>0 ) ;
116 
117  uint32_t rawId = chambId.rawId();
118  if(keepDigi || m_maskedGEMIDs.find(rawId) == m_maskedGEMIDs.end())
119  {
120  filteredDigis->put(gemLayerId.second,gemLayerId.first);
121  }
122  }
123 
124  }
125 
126  iEvent.put(std::move(filteredDigis));
127 
128 }
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
edm::EDGetTokenT< GEMDigiCollection > m_digiTag
MuonDigiCollection< GEMDetId, GEMDigi > GEMDigiCollection
std::string const & label() const
Definition: InputTag.h:36
HLT enums.
edm::InputTag digiTag_
std::map< unsigned int, float > m_maskedGEMIDs
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

edm::InputTag GEMChamberMasker::digiTag_
private

Definition at line 47 of file GEMChamberMasker.cc.

Referenced by GEMChamberMasker(), and produce().

bool GEMChamberMasker::ge11Minus_
private

Definition at line 48 of file GEMChamberMasker.cc.

Referenced by produce().

bool GEMChamberMasker::ge11Plus_
private

Definition at line 49 of file GEMChamberMasker.cc.

Referenced by produce().

bool GEMChamberMasker::ge21Minus_
private

Definition at line 50 of file GEMChamberMasker.cc.

Referenced by produce().

bool GEMChamberMasker::ge21Plus_
private

Definition at line 51 of file GEMChamberMasker.cc.

Referenced by produce().

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

Definition at line 53 of file GEMChamberMasker.cc.

Referenced by GEMChamberMasker(), and produce().

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

Definition at line 54 of file GEMChamberMasker.cc.

Referenced by beginRun(), and produce().