CMS 3D CMS Logo

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

#include <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 hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () 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

SimMuon/DTDigitizer/plugins/DTChamberMasker.cc

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

Definition at line 62 of file DTChamberMasker.cc.

Constructor & Destructor Documentation

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

Definition at line 89 of file DTChamberMasker.cc.

90  : m_digiToken(consumes<DTDigiCollection>(iConfig.getParameter<edm::InputTag>("digiTag"))) {
91  produces<DTDigiCollection>();
92 }
T getParameter(std::string const &) const
edm::EDGetTokenT< DTDigiCollection > m_digiToken
DTChamberMasker::~DTChamberMasker ( )
override

Definition at line 94 of file DTChamberMasker.cc.

94 {}

Member Function Documentation

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

Definition at line 124 of file DTChamberMasker.cc.

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

124  {
125  m_ChEffs.clear();
126 
128  iSetup.get<MuonSystemAgingRcd>().get(agingObj);
129 
130  m_ChEffs = agingObj->m_DTChambEffs;
131 }
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 135 of file DTChamberMasker.cc.

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

135  {
137  desc.add<edm::InputTag>("digiTag", edm::InputTag("simMuonDTDigis"));
138  descriptions.add("dtChamberMasker", desc);
139 }
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 101 of file DTChamberMasker.cc.

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

101  {
103  CLHEP::HepRandomEngine &randGen = randGenService->getEngine(event.streamID());
104 
105  std::unique_ptr<DTDigiCollection> filteredDigis(new DTDigiCollection());
106 
107  if (!m_digiToken.isUninitialized()) {
109  event.getByToken(m_digiToken, dtDigis);
110 
111  for (const auto &dtLayerId : (*dtDigis)) {
112  uint32_t rawId = (dtLayerId.first).chamberId().rawId();
113  auto chEffIt = m_ChEffs.find(rawId);
114 
115  if (chEffIt == m_ChEffs.end() || randGen.flat() <= chEffIt->second)
116  filteredDigis->put(dtLayerId.second, dtLayerId.first);
117  }
118  }
119 
120  event.put(std::move(filteredDigis));
121 }
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:70
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

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

Definition at line 79 of file DTChamberMasker.cc.

Referenced by beginRun(), and produce().

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

Definition at line 78 of file DTChamberMasker.cc.

Referenced by produce().