CMS 3D CMS Logo

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

#include <SimMuon/RPCDigitizer/plugins/RPCChamberMasker.cc>

Inheritance diagram for RPCChamberMasker:
edm::stream::EDProducer<>

Public Member Functions

 RPCChamberMasker (const edm::ParameterSet &)
 
 ~RPCChamberMasker () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void beginRun (edm::Run const &, edm::EventSetup const &) override
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

edm::InputTag digiTag_
 
std::map< RPCDetId, float > m_ChEffs
 
edm::EDGetTokenT< RPCDigiCollectionm_digiTag
 
bool theRE31_off
 
bool theRE41_off
 

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

Description:

Implementation: Class to mask RPC digis on a for single DetIds

Definition at line 52 of file RPCChamberMasker.cc.

Constructor & Destructor Documentation

◆ RPCChamberMasker()

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

Definition at line 84 of file RPCChamberMasker.cc.

85  : digiTag_(iConfig.getParameter<edm::InputTag>("digiTag")) {
86  m_digiTag = consumes<RPCDigiCollection>(digiTag_);
87  produces<RPCDigiCollection>();
88 
89  theRE31_off = iConfig.getParameter<bool>("descopeRE31");
90  theRE41_off = iConfig.getParameter<bool>("descopeRE41");
91 }

References digiTag_, edm::ParameterSet::getParameter(), m_digiTag, theRE31_off, and theRE41_off.

◆ ~RPCChamberMasker()

RPCChamberMasker::~RPCChamberMasker ( )
override

Definition at line 93 of file RPCChamberMasker.cc.

93 {}

Member Function Documentation

◆ beginRun()

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

Definition at line 122 of file RPCChamberMasker.cc.

122  {
123  m_ChEffs.clear();
124 
126  iSetup.get<MuonGeometryRecord>().get(rpcGeom);
127 
129  iSetup.get<MuonSystemAgingRcd>().get(agingObj);
130 
131  const auto rolls = rpcGeom->rolls();
132 
133  for (const auto* roll : rolls) {
134  RPCDetId rollId = roll->id();
135  uint32_t rollRawId = rollId.rawId();
136 
137  Float_t chamberEff = 1.;
138  for (const auto& agingPair : agingObj->m_RPCChambEffs) {
139  if (agingPair.first == rollRawId) {
140  chamberEff = agingPair.second;
141  break;
142  }
143 
144  if (theRE31_off && (roll->isIRPC() && (rollId.station() == 3))) {
145  chamberEff = 0;
146  }
147  if (theRE41_off && (roll->isIRPC() && (rollId.station() == 4))) {
148  chamberEff = 0;
149  }
150  }
151  m_ChEffs[rollId] = chamberEff;
152  }
153 }

References edm::EventSetup::get(), get, m_ChEffs, MuonSystemAging::m_RPCChambEffs, DetId::rawId(), RPCGeometry::rolls(), RPCDetId::station(), theRE31_off, and theRE41_off.

◆ endRun()

void RPCChamberMasker::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivate

Definition at line 157 of file RPCChamberMasker.cc.

157 {}

◆ fillDescriptions()

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

Definition at line 160 of file RPCChamberMasker.cc.

160  {
162  desc.add<edm::InputTag>("digiTag", edm::InputTag("preRPCDigis"));
163  desc.add<bool>("descopeRE31", false);
164  desc.add<bool>("descopeRE41", false);
165  descriptions.add("rpcChamberMasker", desc);
166 }

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

◆ produce()

void RPCChamberMasker::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 100 of file RPCChamberMasker.cc.

100  {
101  using namespace edm;
103  CLHEP::HepRandomEngine& randGen = randGenService->getEngine(iEvent.streamID());
104 
105  std::unique_ptr<RPCDigiCollection> filteredDigis(new RPCDigiCollection());
106  if (!digiTag_.label().empty()) {
108  iEvent.getByToken(m_digiTag, rpcDigis);
109 
110  for (const auto& rpcLayerId : (*rpcDigis)) {
111  int id = (rpcLayerId.first).rawId();
112  auto chEffIt = m_ChEffs.find(id);
113  if ((chEffIt != m_ChEffs.end()) && (randGen.flat() <= chEffIt->second))
114  filteredDigis->put(rpcLayerId.second, rpcLayerId.first);
115  }
116  }
117  iEvent.put(std::move(filteredDigis));
118 }

References digiTag_, edm::RandomNumberGenerator::getEngine(), iEvent, edm::InputTag::label(), m_ChEffs, m_digiTag, and eostools::move().

Member Data Documentation

◆ digiTag_

edm::InputTag RPCChamberMasker::digiTag_
private

Definition at line 66 of file RPCChamberMasker.cc.

Referenced by produce(), and RPCChamberMasker().

◆ m_ChEffs

std::map<RPCDetId, float> RPCChamberMasker::m_ChEffs
private

Definition at line 68 of file RPCChamberMasker.cc.

Referenced by beginRun(), and produce().

◆ m_digiTag

edm::EDGetTokenT<RPCDigiCollection> RPCChamberMasker::m_digiTag
private

Definition at line 67 of file RPCChamberMasker.cc.

Referenced by produce(), and RPCChamberMasker().

◆ theRE31_off

bool RPCChamberMasker::theRE31_off
private

Definition at line 69 of file RPCChamberMasker.cc.

Referenced by beginRun(), and RPCChamberMasker().

◆ theRE41_off

bool RPCChamberMasker::theRE41_off
private

Definition at line 70 of file RPCChamberMasker.cc.

Referenced by beginRun(), and RPCChamberMasker().

RPCChamberMasker::theRE31_off
bool theRE31_off
Definition: RPCChamberMasker.cc:69
edm::RandomNumberGenerator::getEngine
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
MuonSystemAging::m_RPCChambEffs
std::map< unsigned int, float > m_RPCChambEffs
Definition: MuonSystemAging.h:16
RPCDetId::station
int station() const
Definition: RPCDetId.h:78
MuonSystemAgingRcd
Definition: MuonSystemAgingRcd.h:20
edm
HLT enums.
Definition: AlignableModifier.h:19
RPCDetId
Definition: RPCDetId.h:16
RPCChamberMasker::m_digiTag
edm::EDGetTokenT< RPCDigiCollection > m_digiTag
Definition: RPCChamberMasker.cc:67
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::Handle< RPCDigiCollection >
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::ESHandle< RPCGeometry >
RPCChamberMasker::theRE41_off
bool theRE41_off
Definition: RPCChamberMasker.cc:70
RPCDigiCollection
MuonDigiCollection< RPCDetId, RPCDigi > RPCDigiCollection
Definition: RPCDigiCollection.h:13
edm::Service< edm::RandomNumberGenerator >
iEvent
int iEvent
Definition: GenABIO.cc:224
get
#define get
RPCChamberMasker::digiTag_
edm::InputTag digiTag_
Definition: RPCChamberMasker.cc:66
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
RPCChamberMasker::m_ChEffs
std::map< RPCDetId, float > m_ChEffs
Definition: RPCChamberMasker.cc:68
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
RPCGeometry::rolls
const std::vector< const RPCRoll * > & rolls() const
Return a vector of all RPC rolls.
Definition: RPCGeometry.cc:44
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
edm::InputTag
Definition: InputTag.h:15