CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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,
MuonSystemAgingRcd
m_agingObjToken
 
std::map< unsigned int, float > m_ChEffs
 
edm::EDGetTokenT
< DTDigiCollection
m_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 ( 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
edm::EDGetTokenT< DTDigiCollection > m_digiToken
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
DTChamberMasker::~DTChamberMasker ( )
override

Definition at line 97 of file DTChamberMasker.cc.

97 {}

Member Function Documentation

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, and m_ChEffs.

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
void DTChamberMasker::createMaskedChamberCollection ( edm::ESHandle< DTGeometry > &  )
private
void DTChamberMasker::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 137 of file DTChamberMasker.cc.

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

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

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

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:99
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
def move
Definition: eostools.py:511
MuonDigiCollection< DTLayerId, DTDigi > DTDigiCollection
StreamID streamID() const
Definition: Event.h:98

Member Data Documentation

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

Definition at line 80 of file DTChamberMasker.cc.

Referenced by beginRun().

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

Definition at line 81 of file DTChamberMasker.cc.

Referenced by beginRun(), and produce().

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

Definition at line 79 of file DTChamberMasker.cc.

Referenced by produce().