CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
L1TMuonQualityAdjuster Class Reference
Inheritance diagram for L1TMuonQualityAdjuster:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 L1TMuonQualityAdjuster (const edm::ParameterSet &)
 
 ~L1TMuonQualityAdjuster ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

virtual void beginJob ()
 
virtual void beginLuminosityBlock (edm::LuminosityBlock &, edm::EventSetup const &)
 
virtual void beginRun (edm::Run &, edm::EventSetup const &)
 
virtual void endJob ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock &, edm::EventSetup const &)
 
virtual void endRun (edm::Run &, edm::EventSetup const &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 

Private Attributes

edm::InputTag m_barrelTfInputTag
 
edm::EDGetTokenT
< l1t::RegionalMuonCandBxCollection
m_barrelTfInputToken
 
int m_bmtfBxOffset
 
edm::InputTag m_endCapTfInputTag
 
edm::EDGetTokenT
< l1t::RegionalMuonCandBxCollection
m_endCapTfInputToken
 
edm::InputTag m_overlapTfInputTag
 
edm::EDGetTokenT
< l1t::RegionalMuonCandBxCollection
m_overlapTfInputToken
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 34 of file L1TMuonQualityAdjuster.cc.

Constructor & Destructor Documentation

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

Definition at line 72 of file L1TMuonQualityAdjuster.cc.

References edm::ParameterSet::getParameter().

73 {
74  m_barrelTfInputTag = iConfig.getParameter<edm::InputTag>("bmtfInput");
75  m_overlapTfInputTag = iConfig.getParameter<edm::InputTag>("omtfInput");
76  m_endCapTfInputTag = iConfig.getParameter<edm::InputTag>("emtfInput");
77  m_bmtfBxOffset = iConfig.getParameter<int>("bmtfBxOffset");
78  m_barrelTfInputToken = consumes<l1t::RegionalMuonCandBxCollection>(m_barrelTfInputTag);
79  m_overlapTfInputToken = consumes<l1t::RegionalMuonCandBxCollection>(m_overlapTfInputTag);
80  m_endCapTfInputToken = consumes<l1t::RegionalMuonCandBxCollection>(m_endCapTfInputTag);
81  //register your products
82  produces<RegionalMuonCandBxCollection>("BMTF");
83  produces<RegionalMuonCandBxCollection>("OMTF");
84  produces<RegionalMuonCandBxCollection>("EMTF");
85 }
T getParameter(std::string const &) const
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > m_endCapTfInputToken
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > m_barrelTfInputToken
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > m_overlapTfInputToken
L1TMuonQualityAdjuster::~L1TMuonQualityAdjuster ( )

Definition at line 88 of file L1TMuonQualityAdjuster.cc.

89 {
90  // do anything here that needs to be done at desctruction time
91  // (e.g. close files, deallocate resources etc.)
92 }

Member Function Documentation

void L1TMuonQualityAdjuster::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 175 of file L1TMuonQualityAdjuster.cc.

176 {
177 }
void L1TMuonQualityAdjuster::beginLuminosityBlock ( edm::LuminosityBlock ,
edm::EventSetup const &   
)
privatevirtual

Definition at line 198 of file L1TMuonQualityAdjuster.cc.

199 {
200 }
void L1TMuonQualityAdjuster::beginRun ( edm::Run ,
edm::EventSetup const &   
)
privatevirtual

Definition at line 186 of file L1TMuonQualityAdjuster.cc.

187 {
188 }
void L1TMuonQualityAdjuster::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 181 of file L1TMuonQualityAdjuster.cc.

181  {
182 }
void L1TMuonQualityAdjuster::endLuminosityBlock ( edm::LuminosityBlock ,
edm::EventSetup const &   
)
privatevirtual

Definition at line 204 of file L1TMuonQualityAdjuster.cc.

205 {
206 }
void L1TMuonQualityAdjuster::endRun ( edm::Run ,
edm::EventSetup const &   
)
privatevirtual

Definition at line 192 of file L1TMuonQualityAdjuster.cc.

193 {
194 }
void L1TMuonQualityAdjuster::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 210 of file L1TMuonQualityAdjuster.cc.

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

210  {
211  //The following says we do not know what parameters are allowed so do no validation
212  // Please change this to state exactly what you do use, even if it is no parameters
214  desc.setUnknown();
215  descriptions.addDefault(desc);
216 }
void addDefault(ParameterSetDescription const &psetDescription)
void L1TMuonQualityAdjuster::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 102 of file L1TMuonQualityAdjuster.cc.

References edm::Event::getByToken(), RPCpg::mu, edm::Event::put(), and l1t::RegionalMuonCand::setHwQual().

103 {
104  using namespace edm;
105 
106  std::auto_ptr<l1t::RegionalMuonCandBxCollection> filteredBMTFMuons (new l1t::RegionalMuonCandBxCollection());
107  std::auto_ptr<l1t::RegionalMuonCandBxCollection> filteredOMTFMuons (new l1t::RegionalMuonCandBxCollection());
108  std::auto_ptr<l1t::RegionalMuonCandBxCollection> filteredEMTFMuons (new l1t::RegionalMuonCandBxCollection());
109 
113 
114  iEvent.getByToken(m_barrelTfInputToken, bmtfMuons);
115  iEvent.getByToken(m_overlapTfInputToken, omtfMuons);
116  iEvent.getByToken(m_endCapTfInputToken, emtfMuons);
117 
118 
119  if (bmtfMuons.isValid()){
120  filteredBMTFMuons->setBXRange(bmtfMuons->getFirstBX(), bmtfMuons->getLastBX());
121  for (int bx = bmtfMuons->getFirstBX(); bx <= bmtfMuons->getLastBX(); ++bx) {
122  for (auto mu = bmtfMuons->begin(bx); mu != bmtfMuons->end(bx); ++mu) {
123  int newqual = 12;
124  l1t::RegionalMuonCand newMu((*mu));
125  newMu.setHwQual(newqual);
126  filteredBMTFMuons->push_back(bx+m_bmtfBxOffset, newMu);
127  }
128  }
129  } else {
130  //cout << "ERROR: did not find BMTF muons in event with label: " << m_barrelTfInputTag << "\n";
131  }
132 
133  if (emtfMuons.isValid()){
134  filteredEMTFMuons->setBXRange(emtfMuons->getFirstBX(), emtfMuons->getLastBX());
135  for (int bx = emtfMuons->getFirstBX(); bx <= emtfMuons->getLastBX(); ++bx) {
136  for (auto mu = emtfMuons->begin(bx); mu != emtfMuons->end(bx); ++mu) {
137  int newqual = 0;
138  if (mu->hwQual() == 11 || mu->hwQual() > 12) newqual=12;
139  l1t::RegionalMuonCand newMu((*mu));
140  newMu.setHwQual(newqual);
141  filteredEMTFMuons->push_back(bx, newMu);
142  }
143  }
144  } else {
145  //cout << "ERROR: did not find EMTF muons in event with label: " << m_endCapTfInputTag << "\n";
146  }
147 
148  if (omtfMuons.isValid()){
149  filteredOMTFMuons->setBXRange(omtfMuons->getFirstBX(), omtfMuons->getLastBX());
150  for (int bx = omtfMuons->getFirstBX(); bx <= omtfMuons->getLastBX(); ++bx) {
151  for (auto mu = omtfMuons->begin(bx); mu != omtfMuons->end(bx); ++mu) {
152  int newqual = 0;
153  if (mu->hwQual() > 0) newqual = 12;
154  l1t::RegionalMuonCand newMu((*mu));
155  newMu.setHwQual(newqual);
156  filteredOMTFMuons->push_back(bx, newMu);
157  }
158  }
159  } else {
160  //cout << "ERROR: did not find OMTF muons in event with label: " << m_overlapTfInputTag << "\n";
161  }
162 
163  //cout << "Size BMTF(-3): " << filteredBMTFMuons->size(-3) << "\n";
164  //cout << "Size BMTF: " << filteredBMTFMuons->size(0) << "\n";
165  //cout << "Size OMTF: " << filteredOMTFMuons->size(0) << "\n";
166  //cout << "Size EMTF: " << filteredEMTFMuons->size(0) << "\n";
167 
168  iEvent.put(filteredBMTFMuons, "BMTF");
169  iEvent.put(filteredOMTFMuons, "OMTF");
170  iEvent.put(filteredEMTFMuons, "EMTF");
171 }
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > m_endCapTfInputToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
const int mu
Definition: Constants.h:22
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > m_barrelTfInputToken
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > m_overlapTfInputToken

Member Data Documentation

edm::InputTag L1TMuonQualityAdjuster::m_barrelTfInputTag
private

Definition at line 54 of file L1TMuonQualityAdjuster.cc.

edm::EDGetTokenT<l1t::RegionalMuonCandBxCollection> L1TMuonQualityAdjuster::m_barrelTfInputToken
private

Definition at line 50 of file L1TMuonQualityAdjuster.cc.

int L1TMuonQualityAdjuster::m_bmtfBxOffset
private

Definition at line 57 of file L1TMuonQualityAdjuster.cc.

edm::InputTag L1TMuonQualityAdjuster::m_endCapTfInputTag
private

Definition at line 56 of file L1TMuonQualityAdjuster.cc.

edm::EDGetTokenT<l1t::RegionalMuonCandBxCollection> L1TMuonQualityAdjuster::m_endCapTfInputToken
private

Definition at line 52 of file L1TMuonQualityAdjuster.cc.

edm::InputTag L1TMuonQualityAdjuster::m_overlapTfInputTag
private

Definition at line 55 of file L1TMuonQualityAdjuster.cc.

edm::EDGetTokenT<l1t::RegionalMuonCandBxCollection> L1TMuonQualityAdjuster::m_overlapTfInputToken
private

Definition at line 51 of file L1TMuonQualityAdjuster.cc.