CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
DTChamberMasker Class Reference

#include <SimMuon/DTDigitizer/plugins/DTChamberMasker.cc>

Inheritance diagram for DTChamberMasker:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 DTChamberMasker (const edm::ParameterSet &)
 
 ~DTChamberMasker ()
 
- 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 &)
 
- 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
 
void createMaskedChamberCollection (edm::ESHandle< DTGeometry > &)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

std::map< unsigned int, float > m_ChEffs
 
edm::EDGetTokenT< DTDigiCollectionm_digiToken
 

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

Description: Class to mask DT digis on a chamber by chamber basis

Definition at line 63 of file DTChamberMasker.cc.

Constructor & Destructor Documentation

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

Definition at line 93 of file DTChamberMasker.cc.

93  :
94  m_digiToken(consumes<DTDigiCollection>(iConfig.getParameter<edm::InputTag>("digiTag")) )
95 {
96 
97  produces<DTDigiCollection>();
98 
99 }
T getParameter(std::string const &) const
edm::EDGetTokenT< DTDigiCollection > m_digiToken
DTChamberMasker::~DTChamberMasker ( )

Definition at line 102 of file DTChamberMasker.cc.

103 {
104 
105 }

Member Function Documentation

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

Reimplemented from edm::stream::EDProducerBase.

Definition at line 145 of file DTChamberMasker.cc.

References edm::EventSetup::get(), m_ChEffs, and MuonSystemAging::m_DTChambEffs.

146 {
147 
148  m_ChEffs.clear();
149 
151  iSetup.get<MuonSystemAgingRcd>().get(agingObj);
152 
153  m_ChEffs = agingObj->m_DTChambEffs;
154 
155 }
std::map< unsigned int, float > m_ChEffs
std::map< unsigned int, float > m_DTChambEffs
void DTChamberMasker::createMaskedChamberCollection ( edm::ESHandle< DTGeometry > &  )
private
void DTChamberMasker::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 160 of file DTChamberMasker.cc.

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

161 {
162 
164  desc.add<edm::InputTag>("digiTag", edm::InputTag("simMuonDTDigis"));
165  descriptions.add("dtChamberMasker",desc);
166 
167 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void DTChamberMasker::produce ( edm::Event event,
const edm::EventSetup conditions 
)
overrideprivatevirtual

Definition at line 113 of file DTChamberMasker.cc.

References edm::RandomNumberGenerator::getEngine(), edm::EDGetTokenT< T >::isUninitialized(), m_ChEffs, m_digiToken, eostools::move(), and edm::Event::streamID().

114 {
115 
117  CLHEP::HepRandomEngine& randGen = randGenService->getEngine(event.streamID());
118 
119  std::unique_ptr<DTDigiCollection> filteredDigis(new DTDigiCollection());
120 
122  {
124  event.getByToken(m_digiToken, dtDigis);
125 
126  for ( const auto & dtLayerId : (*dtDigis) )
127  {
128 
129  uint32_t rawId = (dtLayerId.first).chamberId().rawId();
130  auto chEffIt = m_ChEffs.find(rawId);
131 
132  if (chEffIt == m_ChEffs.end() || randGen.flat() <= chEffIt->second)
133  filteredDigis->put(dtLayerId.second,dtLayerId.first);
134 
135  }
136 
137  }
138 
139  event.put(std::move(filteredDigis));
140 
141 }
std::map< unsigned int, float > m_ChEffs
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
edm::EDGetTokenT< DTDigiCollection > m_digiToken
MuonDigiCollection< DTLayerId, DTDigi > DTDigiCollection
StreamID streamID() const
Definition: Event.h:81
bool isUninitialized() const
Definition: EDGetToken.h:73
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

std::map<unsigned int, float> DTChamberMasker::m_ChEffs
private

Definition at line 82 of file DTChamberMasker.cc.

Referenced by beginRun(), and produce().

edm::EDGetTokenT<DTDigiCollection> DTChamberMasker::m_digiToken
private

Definition at line 81 of file DTChamberMasker.cc.

Referenced by produce().