CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
GEMChamberMasker Class Reference
Inheritance diagram for GEMChamberMasker:
edm::stream::EDProducer<>

Public Member Functions

 GEMChamberMasker (const edm::ParameterSet &)
 
 ~GEMChamberMasker () 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 &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_
 
bool ge11Minus_
 
bool ge11Plus_
 
bool ge21Minus_
 
bool ge21Plus_
 
edm::EDGetTokenT< GEMDigiCollectionm_digiTag
 
std::map< unsigned int, float > m_maskedGEMIDs
 

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

Definition at line 29 of file GEMChamberMasker.cc.

Constructor & Destructor Documentation

◆ GEMChamberMasker()

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

Definition at line 64 of file GEMChamberMasker.cc.

65  : digiTag_(iConfig.getParameter<edm::InputTag>("digiTag")),
66  ge11Minus_(iConfig.getParameter<bool>("ge11Minus")),
67  ge11Plus_(iConfig.getParameter<bool>("ge11Plus")),
68  ge21Minus_(iConfig.getParameter<bool>("ge21Minus")),
69  ge21Plus_(iConfig.getParameter<bool>("ge21Plus")) {
70  m_digiTag = consumes<GEMDigiCollection>(digiTag_);
71  produces<GEMDigiCollection>();
72 }

References digiTag_, and m_digiTag.

◆ ~GEMChamberMasker()

GEMChamberMasker::~GEMChamberMasker ( )
override

Definition at line 74 of file GEMChamberMasker.cc.

74 {}

Member Function Documentation

◆ beginRun()

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

Definition at line 109 of file GEMChamberMasker.cc.

109  {
111  iSetup.get<MuonSystemAgingRcd>().get(agingObj);
112 
113  m_maskedGEMIDs = agingObj->m_GEMChambEffs;
114 }

References edm::EventSetup::get(), get, MuonSystemAging::m_GEMChambEffs, and m_maskedGEMIDs.

◆ endRun()

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

Definition at line 118 of file GEMChamberMasker.cc.

118 {}

◆ fillDescriptions()

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

Definition at line 120 of file GEMChamberMasker.cc.

120  {
122  desc.add<edm::InputTag>("digiTag", edm::InputTag("simMuonGEMDigis"));
123  desc.add<bool>("ge11Minus", true);
124  desc.add<bool>("ge11Plus", true);
125  desc.add<bool>("ge21Minus", true);
126  desc.add<bool>("ge21Plus", true);
127 
128  descriptions.add("gemChamberMasker", desc);
129 }

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

◆ produce()

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

Definition at line 81 of file GEMChamberMasker.cc.

81  {
82  using namespace edm;
83  std::unique_ptr<GEMDigiCollection> filteredDigis(new GEMDigiCollection());
84 
85  if (!digiTag_.label().empty()) {
87  iEvent.getByToken(m_digiTag, gemDigis);
88 
89  for (const auto& gemLayerId : (*gemDigis)) {
90  auto chambId = gemLayerId.first.chamberId();
91 
92  bool keepDigi = (!ge11Minus_ && chambId.station() == 1 && chambId.region() < 0) ||
93  (!ge11Plus_ && chambId.station() == 1 && chambId.region() > 0) ||
94  (!ge21Minus_ && chambId.station() == 2 && chambId.region() < 0) ||
95  (!ge21Plus_ && chambId.station() == 2 && chambId.region() > 0);
96 
97  uint32_t rawId = chambId.rawId();
98  if (keepDigi || m_maskedGEMIDs.find(rawId) == m_maskedGEMIDs.end()) {
99  filteredDigis->put(gemLayerId.second, gemLayerId.first);
100  }
101  }
102  }
103 
104  iEvent.put(std::move(filteredDigis));
105 }

References digiTag_, ge11Minus_, ge11Plus_, ge21Minus_, ge21Plus_, iEvent, edm::InputTag::label(), m_digiTag, m_maskedGEMIDs, and eostools::move().

Member Data Documentation

◆ digiTag_

edm::InputTag GEMChamberMasker::digiTag_
private

Definition at line 43 of file GEMChamberMasker.cc.

Referenced by GEMChamberMasker(), and produce().

◆ ge11Minus_

bool GEMChamberMasker::ge11Minus_
private

Definition at line 44 of file GEMChamberMasker.cc.

Referenced by produce().

◆ ge11Plus_

bool GEMChamberMasker::ge11Plus_
private

Definition at line 45 of file GEMChamberMasker.cc.

Referenced by produce().

◆ ge21Minus_

bool GEMChamberMasker::ge21Minus_
private

Definition at line 46 of file GEMChamberMasker.cc.

Referenced by produce().

◆ ge21Plus_

bool GEMChamberMasker::ge21Plus_
private

Definition at line 47 of file GEMChamberMasker.cc.

Referenced by produce().

◆ m_digiTag

edm::EDGetTokenT<GEMDigiCollection> GEMChamberMasker::m_digiTag
private

Definition at line 49 of file GEMChamberMasker.cc.

Referenced by GEMChamberMasker(), and produce().

◆ m_maskedGEMIDs

std::map<unsigned int, float> GEMChamberMasker::m_maskedGEMIDs
private

Definition at line 50 of file GEMChamberMasker.cc.

Referenced by beginRun(), and produce().

edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
MuonSystemAgingRcd
Definition: MuonSystemAgingRcd.h:20
GEMDigiCollection
MuonDigiCollection< GEMDetId, GEMDigi > GEMDigiCollection
Definition: GEMDigiCollection.h:13
edm
HLT enums.
Definition: AlignableModifier.h:19
GEMChamberMasker::ge11Plus_
bool ge11Plus_
Definition: GEMChamberMasker.cc:45
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::Handle< GEMDigiCollection >
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
Definition: DTSurvey.h:22
GEMChamberMasker::m_digiTag
edm::EDGetTokenT< GEMDigiCollection > m_digiTag
Definition: GEMChamberMasker.cc:49
GEMChamberMasker::ge21Plus_
bool ge21Plus_
Definition: GEMChamberMasker.cc:47
GEMChamberMasker::m_maskedGEMIDs
std::map< unsigned int, float > m_maskedGEMIDs
Definition: GEMChamberMasker.cc:50
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
GEMChamberMasker::ge21Minus_
bool ge21Minus_
Definition: GEMChamberMasker.cc:46
iEvent
int iEvent
Definition: GenABIO.cc:224
GEMChamberMasker::ge11Minus_
bool ge11Minus_
Definition: GEMChamberMasker.cc:44
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
GEMChamberMasker::digiTag_
edm::InputTag digiTag_
Definition: GEMChamberMasker.cc:43
edm::InputTag
Definition: InputTag.h:15
MuonSystemAging::m_GEMChambEffs
std::map< unsigned int, float > m_GEMChambEffs
Definition: MuonSystemAging.h:22