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<>

Public Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &) override
 
 GEMPadDigiProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~GEMPadDigiProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

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
 

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

Definition at line 25 of file GEMPadDigiProducer.cc.

26 {}

Member Function Documentation

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

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_
T get() const
Definition: EventSetup.h:71
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 = 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 
)
override

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:125
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
void buildPads(const GEMDigiCollection &digis, GEMPadDigiCollection &out_pads) const
T const * product() const
Definition: Handle.h:74
MuonDigiCollection< GEMDetId, GEMPadDigi > GEMPadDigiCollection
edm::EDGetTokenT< GEMDigiCollection > digi_token_
Name of input digi Collection.
def move(src, dest)
Definition: eostools.py:511

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