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::EDProducer 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::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 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 (const std::string &iProcessName, std::vector< const char * > &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::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 16 of file GEMPadDigiProducer.cc.

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

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

29 {}

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 32 of file GEMPadDigiProducer.cc.

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

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

Definition at line 56 of file GEMPadDigiProducer.cc.

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

Referenced by produce().

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

Implements edm::EDProducer.

Definition at line 40 of file GEMPadDigiProducer.cc.

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

41 {
43  e.getByToken(digi_token_, hdigis);
44 
45  // Create empty output
46  std::auto_ptr<GEMPadDigiCollection> pPads(new GEMPadDigiCollection());
47 
48  // build the pads
49  buildPads(*(hdigis.product()), *pPads);
50 
51  // store them in the event
52  e.put(pPads);
53 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
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().