CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ME0PadDigiProducer Class Reference
Inheritance diagram for ME0PadDigiProducer:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 ME0PadDigiProducer (const edm::ParameterSet &ps)
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
bool wantsStreamLuminosityBlocks () const noexcept final
 
bool wantsStreamRuns () const noexcept final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

ME0PadDigiCollection buildPads (const ME0DigiCollection &digis, const ME0Geometry &geometry) const
 

Private Attributes

edm::EDGetTokenT< ME0DigiCollectiondigi_token_
 Name of input digi Collection. More...
 
edm::InputTag digis_
 
edm::ESGetToken< ME0Geometry, MuonGeometryRecordgeom_token_
 
edm::EDPutTokenT< ME0PadDigiCollectionput_token_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 24 of file ME0PadDigiProducer.cc.

Constructor & Destructor Documentation

◆ ME0PadDigiProducer()

ME0PadDigiProducer::ME0PadDigiProducer ( const edm::ParameterSet ps)
explicit

Definition at line 40 of file ME0PadDigiProducer.cc.

References digi_token_, digis_, geom_token_, edm::ParameterSet::getParameter(), and put_token_.

40  {
41  digis_ = ps.getParameter<edm::InputTag>("InputCollection");
42 
43  digi_token_ = consumes<ME0DigiCollection>(digis_);
44  geom_token_ = esConsumes<ME0Geometry, MuonGeometryRecord>();
45 
46  put_token_ = produces<ME0PadDigiCollection>();
47 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::ESGetToken< ME0Geometry, MuonGeometryRecord > geom_token_
edm::EDGetTokenT< ME0DigiCollection > digi_token_
Name of input digi Collection.
edm::EDPutTokenT< ME0PadDigiCollection > put_token_

Member Function Documentation

◆ buildPads()

ME0PadDigiCollection ME0PadDigiProducer::buildPads ( const ME0DigiCollection digis,
const ME0Geometry geometry 
) const
private

Definition at line 59 of file ME0PadDigiProducer.cc.

References ztail::d, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by produce().

60  {
61  ME0PadDigiCollection out_pads;
62  for (const auto& p : geometry.etaPartitions()) {
63  // set of <pad, bx> pairs, sorted first by pad then by bx
64  std::set<std::pair<int, int> > proto_pads;
65 
66  // walk over digis in this partition,
67  // and stuff them into a set of unique pads (equivalent of OR operation)
68  auto digis = det_digis.get(p->id());
69  for (auto d = digis.first; d != digis.second; ++d) {
70  int pad_num = 1 + static_cast<int>(p->padOfStrip(d->strip()));
71  proto_pads.emplace(pad_num, d->bx());
72  }
73 
74  // fill the output collections
75  for (const auto& d : proto_pads) {
76  ME0PadDigi pad_digi(d.first, d.second);
77  out_pads.insertDigi(p->id(), pad_digi);
78  }
79  }
80  return out_pads;
81 }
d
Definition: ztail.py:151

◆ produce()

void ME0PadDigiProducer::produce ( edm::StreamID  ,
edm::Event e,
const edm::EventSetup eventSetup 
) const
overridevirtual

Implements edm::global::EDProducerBase.

Definition at line 49 of file ME0PadDigiProducer.cc.

References buildPads(), digi_token_, MillePedeFileConverter_cfg::e, options_cfi::eventSetup, geom_token_, edm::Handle< T >::product(), and put_token_.

49  {
50  auto const& geometry = eventSetup.getData(geom_token_);
51 
53  e.getByToken(digi_token_, hdigis);
54 
55  // build the pads and store them in the event
56  e.emplace(put_token_, buildPads(*(hdigis.product()), geometry));
57 }
ME0PadDigiCollection buildPads(const ME0DigiCollection &digis, const ME0Geometry &geometry) const
edm::ESGetToken< ME0Geometry, MuonGeometryRecord > geom_token_
T const * product() const
Definition: Handle.h:70
edm::EDGetTokenT< ME0DigiCollection > digi_token_
Name of input digi Collection.
edm::EDPutTokenT< ME0PadDigiCollection > put_token_

Member Data Documentation

◆ digi_token_

edm::EDGetTokenT<ME0DigiCollection> ME0PadDigiProducer::digi_token_
private

Name of input digi Collection.

Definition at line 34 of file ME0PadDigiProducer.cc.

Referenced by ME0PadDigiProducer(), and produce().

◆ digis_

edm::InputTag ME0PadDigiProducer::digis_
private

Definition at line 35 of file ME0PadDigiProducer.cc.

Referenced by ME0PadDigiProducer().

◆ geom_token_

edm::ESGetToken<ME0Geometry, MuonGeometryRecord> ME0PadDigiProducer::geom_token_
private

Definition at line 36 of file ME0PadDigiProducer.cc.

Referenced by ME0PadDigiProducer(), and produce().

◆ put_token_

edm::EDPutTokenT<ME0PadDigiCollection> ME0PadDigiProducer::put_token_
private

Definition at line 37 of file ME0PadDigiProducer.cc.

Referenced by ME0PadDigiProducer(), and produce().