CMS 3D CMS Logo

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

#include <GEMPadDigiProducer.h>

Inheritance diagram for GEMPadDigiProducer:
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
 
 GEMPadDigiProducer (const edm::ParameterSet &ps)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
virtual ~GEMPadDigiProducer ()
 
- 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
 
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
 
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 GEMDigiCollection &digis, GEMPadDigiCollection &out_pads) const
 

Private Attributes

edm::EDGetTokenT< GEMDigiCollectiondigi_token_
 Name of input digi Collection. More...
 
edm::InputTag digis_
 
const GEMGeometrygeometry_
 

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

producer for GEM-CSC trigger pads

Definition at line 19 of file GEMPadDigiProducer.h.

Constructor & Destructor Documentation

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

Definition at line 13 of file GEMPadDigiProducer.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<GEMDigiCollection>(digis_);
19 
20  produces<GEMPadDigiCollection>();
21  consumes<GEMDigiCollection>(digis_);
22 }
T getParameter(std::string const &) const
const GEMGeometry * geometry_
edm::EDGetTokenT< GEMDigiCollection > digi_token_
Name of input digi Collection.
GEMPadDigiProducer::~GEMPadDigiProducer ( )
virtual

Definition at line 25 of file GEMPadDigiProducer.cc.

26 {}

Member Function Documentation

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

Definition at line 29 of file GEMPadDigiProducer.cc.

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

30 {
32  eventSetup.get<MuonGeometryRecord>().get(hGeom);
33  geometry_ = &*hGeom;
34 }
const GEMGeometry * geometry_
const T & get() const
Definition: EventSetup.h:55
void GEMPadDigiProducer::buildPads ( const GEMDigiCollection digis,
GEMPadDigiCollection out_pads 
) const
private

Definition at line 53 of file GEMPadDigiProducer.cc.

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

Referenced by produce().

54 {
55  for(const auto& p: geometry_->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  // in the future, do some dead-time handling
70  // emulateDeadTime(proto_pads)
71 
72  // fill the output collections
73  for (const auto& d: proto_pads)
74  {
75  GEMPadDigi pad_digi(d.first, d.second);
76  out_pads.insertDigi(p->id(), pad_digi);
77  }
78  }
79 }
const GEMGeometry * geometry_
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return a vector of all GEM eta partitions.
Definition: GEMGeometry.cc:63
void GEMPadDigiProducer::produce ( edm::Event e,
const edm::EventSetup eventSetup 
)
overridevirtual

Definition at line 37 of file GEMPadDigiProducer.cc.

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

38 {
40  e.getByToken(digi_token_, hdigis);
41 
42  // Create empty output
43  std::unique_ptr<GEMPadDigiCollection> pPads(new GEMPadDigiCollection());
44 
45  // build the pads
46  buildPads(*(hdigis.product()), *pPads);
47 
48  // store them in the event
49  e.put(std::move(pPads));
50 }
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
void buildPads(const GEMDigiCollection &digis, GEMPadDigiCollection &out_pads) const
T const * product() const
Definition: Handle.h:81
MuonDigiCollection< GEMDetId, GEMPadDigi > GEMPadDigiCollection
edm::EDGetTokenT< GEMDigiCollection > digi_token_
Name of input digi Collection.
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

edm::EDGetTokenT<GEMDigiCollection> GEMPadDigiProducer::digi_token_
private

Name of input digi Collection.

Definition at line 38 of file GEMPadDigiProducer.h.

Referenced by GEMPadDigiProducer(), and produce().

edm::InputTag GEMPadDigiProducer::digis_
private

Definition at line 39 of file GEMPadDigiProducer.h.

Referenced by GEMPadDigiProducer().

const GEMGeometry* GEMPadDigiProducer::geometry_
private

Definition at line 41 of file GEMPadDigiProducer.h.

Referenced by beginRun(), and buildPads().