CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ME0PadDigiProducer Class Reference
Inheritance diagram for ME0PadDigiProducer:
edm::stream::EDProducer<>

Public Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &) override
 
 ME0PadDigiProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~ME0PadDigiProducer () 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
 

Private Member Functions

void buildPads (const ME0DigiCollection &digis, ME0PadDigiCollection &out_pads) const
 

Private Attributes

edm::EDGetTokenT< ME0DigiCollectiondigi_token_
 Name of input digi Collection. More...
 
edm::InputTag digis_
 
const ME0Geometrygeometry_
 

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

Definition at line 23 of file ME0PadDigiProducer.cc.

Constructor & Destructor Documentation

◆ ME0PadDigiProducer()

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

Definition at line 43 of file ME0PadDigiProducer.cc.

43  : geometry_(nullptr) {
44  digis_ = ps.getParameter<edm::InputTag>("InputCollection");
45 
46  digi_token_ = consumes<ME0DigiCollection>(digis_);
47 
48  produces<ME0PadDigiCollection>();
49 }

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

◆ ~ME0PadDigiProducer()

ME0PadDigiProducer::~ME0PadDigiProducer ( )
override

Definition at line 51 of file ME0PadDigiProducer.cc.

51 {}

Member Function Documentation

◆ beginRun()

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

Definition at line 53 of file ME0PadDigiProducer.cc.

53  {
55  eventSetup.get<MuonGeometryRecord>().get(hGeom);
56  geometry_ = &*hGeom;
57 }

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

◆ buildPads()

void ME0PadDigiProducer::buildPads ( const ME0DigiCollection digis,
ME0PadDigiCollection out_pads 
) const
private

Definition at line 73 of file ME0PadDigiProducer.cc.

73  {
74  for (const auto& p : geometry_->etaPartitions()) {
75  // set of <pad, bx> pairs, sorted first by pad then by bx
76  std::set<std::pair<int, int> > proto_pads;
77 
78  // walk over digis in this partition,
79  // and stuff them into a set of unique pads (equivalent of OR operation)
80  auto digis = det_digis.get(p->id());
81  for (auto d = digis.first; d != digis.second; ++d) {
82  int pad_num = 1 + static_cast<int>(p->padOfStrip(d->strip()));
83  proto_pads.emplace(pad_num, d->bx());
84  }
85 
86  // fill the output collections
87  for (const auto& d : proto_pads) {
88  ME0PadDigi pad_digi(d.first, d.second);
89  out_pads.insertDigi(p->id(), pad_digi);
90  }
91  }
92 }

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

Referenced by produce().

◆ produce()

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

Definition at line 59 of file ME0PadDigiProducer.cc.

59  {
61  e.getByToken(digi_token_, hdigis);
62 
63  // Create empty output
64  std::unique_ptr<ME0PadDigiCollection> pPads(new ME0PadDigiCollection());
65 
66  // build the pads
67  buildPads(*(hdigis.product()), *pPads);
68 
69  // store them in the event
70  e.put(std::move(pPads));
71 }

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

Member Data Documentation

◆ digi_token_

edm::EDGetTokenT<ME0DigiCollection> ME0PadDigiProducer::digi_token_
private

Name of input digi Collection.

Definition at line 37 of file ME0PadDigiProducer.cc.

Referenced by ME0PadDigiProducer(), and produce().

◆ digis_

edm::InputTag ME0PadDigiProducer::digis_
private

Definition at line 38 of file ME0PadDigiProducer.cc.

Referenced by ME0PadDigiProducer().

◆ geometry_

const ME0Geometry* ME0PadDigiProducer::geometry_
private

Definition at line 40 of file ME0PadDigiProducer.cc.

Referenced by beginRun(), and buildPads().

ME0Geometry::etaPartitions
const std::vector< ME0EtaPartition const * > & etaPartitions() const
Return a vector of all ME0 eta partitions.
Definition: ME0Geometry.cc:33
edm::Handle::product
T const * product() const
Definition: Handle.h:70
ME0PadDigiCollection
MuonDigiCollection< ME0DetId, ME0PadDigi > ME0PadDigiCollection
Definition: ME0PadDigiCollection.h:13
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::Handle
Definition: AssociativeIterator.h:50
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
ME0PadDigiProducer::digis_
edm::InputTag digis_
Definition: ME0PadDigiProducer.cc:38
edm::ESHandle< ME0Geometry >
ME0PadDigiProducer::buildPads
void buildPads(const ME0DigiCollection &digis, ME0PadDigiCollection &out_pads) const
Definition: ME0PadDigiProducer.cc:73
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
ME0PadDigiProducer::geometry_
const ME0Geometry * geometry_
Definition: ME0PadDigiProducer.cc:40
ztail.d
d
Definition: ztail.py:151
ME0PadDigi
Definition: ME0PadDigi.h:15
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
edm::InputTag
Definition: InputTag.h:15
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
ME0PadDigiProducer::digi_token_
edm::EDGetTokenT< ME0DigiCollection > digi_token_
Name of input digi Collection.
Definition: ME0PadDigiProducer.cc:37