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 }
edm::ESGetToken< MuonSystemAging, MuonSystemAgingRcd > m_agingObjToken
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< DTDigiCollection > m_digiToken

◆ ~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.

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

127  {
128  m_ChEffs.clear();
129 
130  edm::ESHandle<MuonSystemAging> agingObj = iSetup.getHandle(m_agingObjToken);
131 
132  m_ChEffs = agingObj->m_DTChambEffs;
133 }
edm::ESGetToken< MuonSystemAging, MuonSystemAgingRcd > m_agingObjToken
std::map< unsigned int, float > m_ChEffs
std::map< unsigned int, float > 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.

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

137  {
139  desc.add<edm::InputTag>("digiTag", edm::InputTag("simMuonDTDigis"));
140  descriptions.add("dtChamberMasker", desc);
141 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Definition at line 104 of file DTChamberMasker.cc.

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

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 }
constexpr bool isUninitialized() const noexcept
Definition: EDGetToken.h:104
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
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1

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