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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

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_
 
edm::ESGetToken< ME0Geometry, MuonGeometryRecordgeom_token_
 
const ME0Geometrygeometry_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 24 of file ME0PadDigiProducer.cc.

Constructor & Destructor Documentation

◆ ME0PadDigiProducer()

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

Definition at line 45 of file ME0PadDigiProducer.cc.

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

45  : geometry_(nullptr) {
46  digis_ = ps.getParameter<edm::InputTag>("InputCollection");
47 
48  digi_token_ = consumes<ME0DigiCollection>(digis_);
49  geom_token_ = esConsumes<ME0Geometry, MuonGeometryRecord, edm::Transition::BeginRun>();
50 
51  produces<ME0PadDigiCollection>();
52 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< ME0Geometry, MuonGeometryRecord > geom_token_
edm::EDGetTokenT< ME0DigiCollection > digi_token_
Name of input digi Collection.
const ME0Geometry * geometry_

◆ ~ME0PadDigiProducer()

ME0PadDigiProducer::~ME0PadDigiProducer ( )
override

Definition at line 54 of file ME0PadDigiProducer.cc.

54 {}

Member Function Documentation

◆ beginRun()

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

Definition at line 56 of file ME0PadDigiProducer.cc.

References options_cfi::eventSetup, geom_token_, and geometry_.

56  {
58  geometry_ = &*hGeom;
59 }
edm::ESGetToken< ME0Geometry, MuonGeometryRecord > geom_token_
const ME0Geometry * geometry_

◆ buildPads()

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

Definition at line 75 of file ME0PadDigiProducer.cc.

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

Referenced by produce().

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

◆ produce()

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

Definition at line 61 of file ME0PadDigiProducer.cc.

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

61  {
63  e.getByToken(digi_token_, hdigis);
64 
65  // Create empty output
66  std::unique_ptr<ME0PadDigiCollection> pPads(new ME0PadDigiCollection());
67 
68  // build the pads
69  buildPads(*(hdigis.product()), *pPads);
70 
71  // store them in the event
72  e.put(std::move(pPads));
73 }
T const * product() const
Definition: Handle.h:70
MuonDigiCollection< ME0DetId, ME0PadDigi > ME0PadDigiCollection
edm::EDGetTokenT< ME0DigiCollection > digi_token_
Name of input digi Collection.
def move(src, dest)
Definition: eostools.py:511
void buildPads(const ME0DigiCollection &digis, ME0PadDigiCollection &out_pads) const

Member Data Documentation

◆ digi_token_

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

Name of input digi Collection.

Definition at line 38 of file ME0PadDigiProducer.cc.

Referenced by ME0PadDigiProducer(), and produce().

◆ digis_

edm::InputTag ME0PadDigiProducer::digis_
private

Definition at line 39 of file ME0PadDigiProducer.cc.

Referenced by ME0PadDigiProducer().

◆ geom_token_

edm::ESGetToken<ME0Geometry, MuonGeometryRecord> ME0PadDigiProducer::geom_token_
private

Definition at line 40 of file ME0PadDigiProducer.cc.

Referenced by beginRun(), and ME0PadDigiProducer().

◆ geometry_

const ME0Geometry* ME0PadDigiProducer::geometry_
private

Definition at line 42 of file ME0PadDigiProducer.cc.

Referenced by beginRun(), and buildPads().