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

◆ ~DTChamberMasker()

DTChamberMasker::~DTChamberMasker ( )
override

Definition at line 94 of file DTChamberMasker.cc.

94 {}

Member Function Documentation

◆ beginRun()

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

Definition at line 124 of file DTChamberMasker.cc.

124  {
125  m_ChEffs.clear();
126 
128  iSetup.get<MuonSystemAgingRcd>().get(agingObj);
129 
130  m_ChEffs = agingObj->m_DTChambEffs;
131 }

References edm::EventSetup::get(), get, 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 135 of file DTChamberMasker.cc.

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

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

◆ produce()

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

Definition at line 101 of file DTChamberMasker.cc.

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 }

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

Member Data Documentation

◆ m_ChEffs

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

Definition at line 79 of file DTChamberMasker.cc.

Referenced by beginRun(), and produce().

◆ m_digiToken

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

Definition at line 78 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:79
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
MuonSystemAgingRcd
Definition: MuonSystemAgingRcd.h:20
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
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::EDGetTokenT::isUninitialized
bool isUninitialized() const
Definition: EDGetToken.h:70
edm::ESHandle
Definition: DTSurvey.h:22
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::Service< edm::RandomNumberGenerator >
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
DTChamberMasker::m_digiToken
edm::EDGetTokenT< DTDigiCollection > m_digiToken
Definition: DTChamberMasker.cc:78
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