CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
 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 ()
 

Private Member Functions

void buildPads (const GEMDigiCollection &digis, GEMPadDigiCollection &out_pads)
 

Private Attributes

edm::EDGetTokenT
< GEMDigiCollection
digi_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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
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 15 of file GEMPadDigiProducer.cc.

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

16 : geometry_(nullptr)
17 {
18  digis_ = ps.getParameter<edm::InputTag>("InputCollection");
19 
20  digi_token_ = consumes<GEMDigiCollection>(digis_);
21 
22  produces<GEMPadDigiCollection>();
23  consumes<GEMDigiCollection>(digis_);
24 }
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 27 of file GEMPadDigiProducer.cc.

28 {}

Member Function Documentation

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

Reimplemented from edm::stream::EDProducerBase.

Definition at line 31 of file GEMPadDigiProducer.cc.

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

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

Definition at line 55 of file GEMPadDigiProducer.cc.

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

Referenced by produce().

56 {
57  auto etaPartitions = geometry_->etaPartitions();
58  for(auto p: etaPartitions)
59  {
60  // set of <pad, bx> pairs, sorted first by pad then by bx
61  std::set<std::pair<int, int> > proto_pads;
62 
63  // walk over digis in this partition,
64  // and stuff them into a set of unique pads (equivalent of OR operation)
65  auto digis = det_digis.get(p->id());
66  for (auto d = digis.first; d != digis.second; ++d)
67  {
68  int pad_num = 1 + static_cast<int>( p->padOfStrip(d->strip()) );
69  auto pad = std::make_pair(pad_num, d->bx());
70  proto_pads.insert(pad);
71  }
72 
73  // in the future, do some dead-time handling
74  // emulateDeadTime(proto_pads)
75 
76  // fill the output collections
77  for (auto & d: proto_pads)
78  {
79  GEMPadDigi pad_digi(d.first, d.second);
80  out_pads.insertDigi(p->id(), pad_digi);
81  }
82  }
83 }
const GEMGeometry * geometry_
tuple d
Definition: ztail.py:151
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

Implements edm::stream::EDProducerBase.

Definition at line 39 of file GEMPadDigiProducer.cc.

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

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

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().