CMS 3D CMS Logo

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

Public Member Functions

 ME0ChamberMasker (const edm::ParameterSet &)
 
 ~ME0ChamberMasker () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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_
 
edm::EDGetTokenT< ME0DigiPreRecoCollectionm_digiTag
 
std::map< unsigned int, float > m_maskedME0IDs
 
bool me0Minus_
 
bool me0Plus_
 

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 34 of file ME0ChamberMasker.cc.

Constructor & Destructor Documentation

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

Definition at line 70 of file ME0ChamberMasker.cc.

References digiTag_, and m_digiTag.

70  :
71  me0Minus_(iConfig.getParameter<bool>("me0Minus") ),
72  me0Plus_(iConfig.getParameter<bool>("me0Plus") ),
73  digiTag_(iConfig.getParameter<edm::InputTag>("digiTag") )
74 {
75 
76  m_digiTag = consumes<ME0DigiPreRecoCollection>(digiTag_);
77  produces<ME0DigiPreRecoCollection>();
78 
79 }
T getParameter(std::string const &) const
edm::InputTag digiTag_
edm::EDGetTokenT< ME0DigiPreRecoCollection > m_digiTag
ME0ChamberMasker::~ME0ChamberMasker ( )
override

Definition at line 82 of file ME0ChamberMasker.cc.

83 {
84 
85 }

Member Function Documentation

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

Definition at line 128 of file ME0ChamberMasker.cc.

References edm::EventSetup::get(), m_maskedME0IDs, and MuonSystemAging::m_ME0ChambEffs.

129 {
130 
132  iSetup.get<MuonSystemAgingRcd>().get(agingObj);
133 
134  m_maskedME0IDs = agingObj->m_ME0ChambEffs;
135 
136 }
std::map< unsigned int, float > m_ME0ChambEffs
std::map< unsigned int, float > m_maskedME0IDs
void ME0ChamberMasker::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overrideprivate

Definition at line 142 of file ME0ChamberMasker.cc.

143 {
144 
145 }
void ME0ChamberMasker::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 151 of file ME0ChamberMasker.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and DEFINE_FWK_MODULE.

152 {
153 
155  desc.add<edm::InputTag>("digiTag", edm::InputTag("simMuonME0Digis"));
156  desc.add<bool>("me0Minus", true);
157  desc.add<bool>("me0Plus", true);
158  descriptions.add("me0ChamberMasker",desc);
159 
160 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void ME0ChamberMasker::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 93 of file ME0ChamberMasker.cc.

References digiTag_, edm::Event::getByToken(), edm::InputTag::label(), m_digiTag, m_maskedME0IDs, me0Minus_, me0Plus_, eostools::move(), and edm::Event::put().

94 {
95 
96  using namespace edm;
97  std::unique_ptr<ME0DigiPreRecoCollection> filteredDigis(new ME0DigiPreRecoCollection());
98 
99  if (!digiTag_.label().empty())
100  {
102  iEvent.getByToken(m_digiTag, me0Digis);
103 
104  for ( const auto & me0LayerId : (*me0Digis) )
105  {
106 
107  auto chambId = me0LayerId.first.chamberId();
108 
109  bool keepDigi = (!me0Minus_ && chambId.region() < 0 ) ||
110  (!me0Plus_ && chambId.region() > 0 ) ;
111 
112  uint32_t rawId = chambId.rawId();
113  if(keepDigi || m_maskedME0IDs.find(rawId) == m_maskedME0IDs.end())
114  {
115  filteredDigis->put(me0LayerId.second,me0LayerId.first);
116  }
117 
118  }
119  }
120 
121  iEvent.put(std::move(filteredDigis));
122 
123 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
MuonDigiCollection< ME0DetId, ME0DigiPreReco > ME0DigiPreRecoCollection
edm::InputTag digiTag_
std::string const & label() const
Definition: InputTag.h:36
HLT enums.
std::map< unsigned int, float > m_maskedME0IDs
edm::EDGetTokenT< ME0DigiPreRecoCollection > m_digiTag
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

edm::InputTag ME0ChamberMasker::digiTag_
private

Definition at line 52 of file ME0ChamberMasker.cc.

Referenced by ME0ChamberMasker(), and produce().

edm::EDGetTokenT<ME0DigiPreRecoCollection> ME0ChamberMasker::m_digiTag
private

Definition at line 53 of file ME0ChamberMasker.cc.

Referenced by ME0ChamberMasker(), and produce().

std::map<unsigned int, float> ME0ChamberMasker::m_maskedME0IDs
private

Definition at line 54 of file ME0ChamberMasker.cc.

Referenced by beginRun(), and produce().

bool ME0ChamberMasker::me0Minus_
private

Definition at line 50 of file ME0ChamberMasker.cc.

Referenced by produce().

bool ME0ChamberMasker::me0Plus_
private

Definition at line 51 of file ME0ChamberMasker.cc.

Referenced by produce().