CMS 3D CMS Logo

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

#include <ME0PadDigiProducer.h>

Inheritance diagram for ME0PadDigiProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginRun (const edm::Run &, const edm::EventSetup &) override
 
 ME0PadDigiProducer (const edm::ParameterSet &ps)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
virtual ~ME0PadDigiProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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 ()
 
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, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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::vector< ModuleDescription const * > &modules, 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
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void buildPads (const ME0DigiCollection &digis, ME0PadDigiCollection &out_pads) const
 

Private Attributes

edm::EDGetTokenT< ME0DigiCollectiondigi_token_
 Name of input digi Collection. More...
 
edm::InputTag digis_
 
const ME0Geometrygeometry_
 

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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 18 of file ME0PadDigiProducer.h.

Constructor & Destructor Documentation

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

Definition at line 13 of file ME0PadDigiProducer.cc.

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

14 : geometry_(nullptr)
15 {
16  digis_ = ps.getParameter<edm::InputTag>("InputCollection");
17 
18  digi_token_ = consumes<ME0DigiCollection>(digis_);
19 
20  produces<ME0PadDigiCollection>();
21 }
T getParameter(std::string const &) const
edm::EDGetTokenT< ME0DigiCollection > digi_token_
Name of input digi Collection.
const ME0Geometry * geometry_
ME0PadDigiProducer::~ME0PadDigiProducer ( )
virtual

Definition at line 24 of file ME0PadDigiProducer.cc.

25 {}

Member Function Documentation

void ME0PadDigiProducer::beginRun ( const edm::Run run,
const edm::EventSetup eventSetup 
)
overridevirtual

Definition at line 28 of file ME0PadDigiProducer.cc.

References geometry_, and edm::EventSetup::get().

29 {
31  eventSetup.get<MuonGeometryRecord>().get(hGeom);
32  geometry_ = &*hGeom;
33 }
const T & get() const
Definition: EventSetup.h:56
const ME0Geometry * geometry_
void ME0PadDigiProducer::buildPads ( const ME0DigiCollection digis,
ME0PadDigiCollection out_pads 
) const
private

Definition at line 52 of file ME0PadDigiProducer.cc.

References edmIntegrityCheck::d, ME0Geometry::etaPartitions(), geometry_, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by produce().

53 {
54  auto etaPartitions = geometry_->etaPartitions();
55  for(const auto& p: etaPartitions)
56  {
57  // set of <pad, bx> pairs, sorted first by pad then by bx
58  std::set<std::pair<int, int> > proto_pads;
59 
60  // walk over digis in this partition,
61  // and stuff them into a set of unique pads (equivalent of OR operation)
62  auto digis = det_digis.get(p->id());
63  for (auto d = digis.first; d != digis.second; ++d)
64  {
65  int pad_num = 1 + static_cast<int>( p->padOfStrip(d->strip()) );
66  proto_pads.emplace(pad_num, d->bx());
67  }
68 
69  // fill the output collections
70  for (const auto & d: proto_pads)
71  {
72  ME0PadDigi pad_digi(d.first, d.second);
73  out_pads.insertDigi(p->id(), pad_digi);
74  }
75  }
76 }
const std::vector< ME0EtaPartition const * > & etaPartitions() const
Return a vector of all ME0 eta partitions.
Definition: ME0Geometry.cc:59
const ME0Geometry * geometry_
void ME0PadDigiProducer::produce ( edm::Event e,
const edm::EventSetup eventSetup 
)
overridevirtual

Definition at line 36 of file ME0PadDigiProducer.cc.

References buildPads(), digi_token_, edm::Event::getByToken(), eostools::move(), edm::Handle< T >::product(), and edm::Event::put().

37 {
39  e.getByToken(digi_token_, hdigis);
40 
41  // Create empty output
42  std::unique_ptr<ME0PadDigiCollection> pPads(new ME0PadDigiCollection());
43 
44  // build the pads
45  buildPads(*(hdigis.product()), *pPads);
46 
47  // store them in the event
48  e.put(std::move(pPads));
49 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
MuonDigiCollection< ME0DetId, ME0PadDigi > ME0PadDigiCollection
edm::EDGetTokenT< ME0DigiCollection > digi_token_
Name of input digi Collection.
T const * product() const
Definition: Handle.h:81
void buildPads(const ME0DigiCollection &digis, ME0PadDigiCollection &out_pads) const
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

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

Name of input digi Collection.

Definition at line 35 of file ME0PadDigiProducer.h.

Referenced by ME0PadDigiProducer(), and produce().

edm::InputTag ME0PadDigiProducer::digis_
private

Definition at line 36 of file ME0PadDigiProducer.h.

Referenced by ME0PadDigiProducer().

const ME0Geometry* ME0PadDigiProducer::geometry_
private

Definition at line 38 of file ME0PadDigiProducer.h.

Referenced by beginRun(), and buildPads().