CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
GEMPadDigiProducer Class Reference
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 hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

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

Definition at line 24 of file GEMPadDigiProducer.cc.

Constructor & Destructor Documentation

◆ GEMPadDigiProducer()

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

Definition at line 46 of file GEMPadDigiProducer.cc.

46  : geometry_(nullptr) {
47  digis_ = ps.getParameter<edm::InputTag>("InputCollection");
48 
49  digi_token_ = consumes<GEMDigiCollection>(digis_);
50 
51  produces<GEMPadDigiCollection>();
52  consumes<GEMDigiCollection>(digis_);
53 }

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

◆ ~GEMPadDigiProducer()

GEMPadDigiProducer::~GEMPadDigiProducer ( )
override

Definition at line 55 of file GEMPadDigiProducer.cc.

55 {}

Member Function Documentation

◆ beginRun()

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

Definition at line 64 of file GEMPadDigiProducer.cc.

64  {
66  eventSetup.get<MuonGeometryRecord>().get(hGeom);
67  geometry_ = &*hGeom;
68 }

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

◆ buildPads()

void GEMPadDigiProducer::buildPads ( const GEMDigiCollection digis,
GEMPadDigiCollection out_pads 
) const
private

Definition at line 84 of file GEMPadDigiProducer.cc.

84  {
85  for (const auto& p : geometry_->etaPartitions()) {
86  // set of <pad, bx> pairs, sorted first by pad then by bx
87  std::set<std::pair<int, int> > proto_pads;
88 
89  // walk over digis in this partition,
90  // and stuff them into a set of unique pads (equivalent of OR operation)
91  auto digis = det_digis.get(p->id());
92  for (auto d = digis.first; d != digis.second; ++d) {
93  int pad_num = static_cast<int>(p->padOfStrip(d->strip()));
94  proto_pads.emplace(pad_num, d->bx());
95  }
96 
97  // fill the output collections
98  for (const auto& d : proto_pads) {
99  GEMPadDigi pad_digi(d.first, d.second);
100  out_pads.insertDigi(p->id(), pad_digi);
101  }
102  }
103 }

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

Referenced by produce().

◆ fillDescriptions()

void GEMPadDigiProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 57 of file GEMPadDigiProducer.cc.

57  {
59  desc.add<edm::InputTag>("InputCollection", edm::InputTag("simMuonGEMDigis"));
60 
61  descriptions.add("simMuonGEMPadDigisDef", desc);
62 }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and HLT_2018_cff::InputTag.

◆ produce()

void GEMPadDigiProducer::produce ( edm::Event e,
const edm::EventSetup eventSetup 
)
override

Definition at line 70 of file GEMPadDigiProducer.cc.

70  {
72  e.getByToken(digi_token_, hdigis);
73 
74  // Create empty output
75  std::unique_ptr<GEMPadDigiCollection> pPads(new GEMPadDigiCollection());
76 
77  // build the pads
78  buildPads(*(hdigis.product()), *pPads);
79 
80  // store them in the event
81  e.put(std::move(pPads));
82 }

References buildPads(), digi_token_, MillePedeFileConverter_cfg::e, eostools::move(), and edm::Handle< T >::product().

Member Data Documentation

◆ digi_token_

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

Name of input digi Collection.

Definition at line 40 of file GEMPadDigiProducer.cc.

Referenced by GEMPadDigiProducer(), and produce().

◆ digis_

edm::InputTag GEMPadDigiProducer::digis_
private

Definition at line 41 of file GEMPadDigiProducer.cc.

Referenced by GEMPadDigiProducer().

◆ geometry_

const GEMGeometry* GEMPadDigiProducer::geometry_
private

Definition at line 43 of file GEMPadDigiProducer.cc.

Referenced by beginRun(), and buildPads().

edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
edm::Handle::product
T const * product() const
Definition: Handle.h:70
GEMPadDigi
Definition: GEMPadDigi.h:15
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
GEMPadDigiCollection
MuonDigiCollection< GEMDetId, GEMPadDigi > GEMPadDigiCollection
Definition: GEMPadDigiCollection.h:13
edm::Handle< GEMDigiCollection >
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::ESHandle< GEMGeometry >
GEMPadDigiProducer::digi_token_
edm::EDGetTokenT< GEMDigiCollection > digi_token_
Name of input digi Collection.
Definition: GEMPadDigiProducer.cc:40
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
GEMPadDigiProducer::buildPads
void buildPads(const GEMDigiCollection &digis, GEMPadDigiCollection &out_pads) const
Definition: GEMPadDigiProducer.cc:84
get
#define get
GEMPadDigiProducer::geometry_
const GEMGeometry * geometry_
Definition: GEMPadDigiProducer.cc:43
GEMPadDigiProducer::digis_
edm::InputTag digis_
Definition: GEMPadDigiProducer.cc:41
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
GEMGeometry::etaPartitions
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return a vector of all GEM eta partitions.
Definition: GEMGeometry.cc:40
ztail.d
d
Definition: ztail.py:151
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
edm::InputTag
Definition: InputTag.h:15
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37