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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

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

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

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

SimMuon/DTDigitizer/plugins/DTChamberMasker.cc

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::DTChamberMasker ( const edm::ParameterSet iConfig)
explicit

Definition at line 91 of file DTChamberMasker.cc.

92  : m_digiToken(consumes<DTDigiCollection>(iConfig.getParameter<edm::InputTag>("digiTag"))),
93  m_agingObjToken(esConsumes<MuonSystemAging, MuonSystemAgingRcd>()) {
94  produces<DTDigiCollection>();
95 }

◆ ~DTChamberMasker()

DTChamberMasker::~DTChamberMasker ( )
override

Definition at line 97 of file DTChamberMasker.cc.

97 {}

Member Function Documentation

◆ beginRun()

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

Definition at line 127 of file DTChamberMasker.cc.

127  {
128  m_ChEffs.clear();
129 
130  edm::ESHandle<MuonSystemAging> agingObj = iSetup.getHandle(m_agingObjToken);
131 
132  m_ChEffs = agingObj->m_DTChambEffs;
133 }

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

◆ createMaskedChamberCollection()

void DTChamberMasker::createMaskedChamberCollection ( edm::ESHandle< DTGeometry > &  )
private

◆ fillDescriptions()

void DTChamberMasker::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 137 of file DTChamberMasker.cc.

137  {
139  desc.add<edm::InputTag>("digiTag", edm::InputTag("simMuonDTDigis"));
140  descriptions.add("dtChamberMasker", desc);
141 }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and HLT_FULL_cff::InputTag.

◆ produce()

void DTChamberMasker::produce ( edm::Event event,
const edm::EventSetup conditions 
)
overrideprivate

Definition at line 104 of file DTChamberMasker.cc.

104  {
106  CLHEP::HepRandomEngine &randGen = randGenService->getEngine(event.streamID());
107 
108  std::unique_ptr<DTDigiCollection> filteredDigis(new DTDigiCollection());
109 
110  if (!m_digiToken.isUninitialized()) {
112  event.getByToken(m_digiToken, dtDigis);
113 
114  for (const auto &dtLayerId : (*dtDigis)) {
115  uint32_t rawId = (dtLayerId.first).chamberId().rawId();
116  auto chEffIt = m_ChEffs.find(rawId);
117 
118  if (chEffIt == m_ChEffs.end() || randGen.flat() <= chEffIt->second)
119  filteredDigis->put(dtLayerId.second, dtLayerId.first);
120  }
121  }
122 
123  event.put(std::move(filteredDigis));
124 }

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

Member Data Documentation

◆ m_agingObjToken

edm::ESGetToken<MuonSystemAging, MuonSystemAgingRcd> DTChamberMasker::m_agingObjToken
private

Definition at line 80 of file DTChamberMasker.cc.

Referenced by beginRun().

◆ m_ChEffs

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

Definition at line 81 of file DTChamberMasker.cc.

Referenced by beginRun(), and produce().

◆ m_digiToken

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

Definition at line 79 of file DTChamberMasker.cc.

Referenced by produce().

edm::RandomNumberGenerator::getEngine
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
DTChamberMasker::m_ChEffs
std::map< unsigned int, float > m_ChEffs
Definition: DTChamberMasker.cc:81
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::EDGetTokenT::isUninitialized
constexpr bool isUninitialized() const noexcept
Definition: EDGetToken.h:99
DTDigiCollection
MuonDigiCollection< DTLayerId, DTDigi > DTDigiCollection
Definition: DTDigiCollection.h:15
edm::Handle< DTDigiCollection >
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::ESHandle
Definition: DTSurvey.h:22
edm::Service< edm::RandomNumberGenerator >
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
DTChamberMasker::m_agingObjToken
edm::ESGetToken< MuonSystemAging, MuonSystemAgingRcd > m_agingObjToken
Definition: DTChamberMasker.cc:80
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
DTChamberMasker::m_digiToken
edm::EDGetTokenT< DTDigiCollection > m_digiToken
Definition: DTChamberMasker.cc:79
MuonSystemAging::m_DTChambEffs
std::map< unsigned int, float > m_DTChambEffs
Definition: MuonSystemAging.h:19
event
Definition: event.py:1
edm::InputTag
Definition: InputTag.h:15