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<>

Public Member Functions

 DTChamberMasker (const edm::ParameterSet &)
 
 ~DTChamberMasker () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 

Private Member Functions

void beginRun (edm::Run const &, edm::EventSetup const &) override
 
void createMaskedChamberCollection (edm::ESHandle< DTGeometry > &)
 
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
 

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 ( )
override

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 
)
overrideprivate

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 
)
overrideprivate

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:96
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().