CMS 3D CMS Logo

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

Public Member Functions

 MTDUncalibratedRecHitProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &evt, const edm::EventSetup &es) override
 
 ~MTDUncalibratedRecHitProducer () 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 Attributes

std::unique_ptr< BTLUncalibratedRecHitAlgoBasebarrel_
 
std::unique_ptr< ETLUncalibratedRecHitAlgoBaseendcap_
 
const edm::EDGetTokenT< BTLDigiCollectionftlbDigis_
 
const std::string ftlbInstance_
 
const edm::EDGetTokenT< ETLDigiCollectionftleDigis_
 
const std::string ftleInstance_
 

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 14 of file MTDUncalibratedRecHitProducer.cc.

Constructor & Destructor Documentation

◆ MTDUncalibratedRecHitProducer()

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

Definition at line 31 of file MTDUncalibratedRecHitProducer.cc.

32  : ftlbDigis_(consumes<BTLDigiCollection>(ps.getParameter<edm::InputTag>("barrelDigis"))),
33  ftleDigis_(consumes<ETLDigiCollection>(ps.getParameter<edm::InputTag>("endcapDigis"))),
34  ftlbInstance_(ps.getParameter<std::string>("BarrelHitsName")),
35  ftleInstance_(ps.getParameter<std::string>("EndcapHitsName")) {
36  produces<FTLUncalibratedRecHitCollection>(ftlbInstance_);
37  produces<FTLUncalibratedRecHitCollection>(ftleInstance_);
38 
39  auto sumes = consumesCollector();
40 
41  const edm::ParameterSet& barrel = ps.getParameterSet("barrel");
42  const std::string& barrelAlgo = barrel.getParameter<std::string>("algoName");
43  barrel_ = std::unique_ptr<BTLUncalibratedRecHitAlgoBase>{
44  BTLUncalibratedRecHitAlgoFactory::get()->create(barrelAlgo, barrel, sumes)};
45 
46  const edm::ParameterSet& endcap = ps.getParameterSet("endcap");
47  const std::string& endcapAlgo = endcap.getParameter<std::string>("algoName");
48  endcap_ = std::unique_ptr<ETLUncalibratedRecHitAlgoBase>{
49  ETLUncalibratedRecHitAlgoFactory::get()->create(endcapAlgo, endcap, sumes)};
50 }

References Reference_intrackfit_cff::barrel, barrel_, makeMuonMisalignmentScenario::endcap, endcap_, ftlbInstance_, ftleInstance_, get, edm::ParameterSet::getParameterSet(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~MTDUncalibratedRecHitProducer()

MTDUncalibratedRecHitProducer::~MTDUncalibratedRecHitProducer ( )
override

Definition at line 52 of file MTDUncalibratedRecHitProducer.cc.

52 {}

Member Function Documentation

◆ produce()

void MTDUncalibratedRecHitProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
override

Definition at line 54 of file MTDUncalibratedRecHitProducer.cc.

54  {
55  // tranparently get things from event setup
56  barrel_->getEventSetup(es);
57  endcap_->getEventSetup(es);
58 
59  barrel_->getEvent(evt);
60  endcap_->getEvent(evt);
61 
62  // prepare output
63  auto barrelRechits = std::make_unique<FTLUncalibratedRecHitCollection>();
64  auto endcapRechits = std::make_unique<FTLUncalibratedRecHitCollection>();
65 
67  evt.getByToken(ftlbDigis_, hBarrel);
68  barrelRechits->reserve(hBarrel->size() / 2);
69  for (const auto& digi : *hBarrel) {
70  barrelRechits->emplace_back(barrel_->makeRecHit(digi));
71  }
72 
74  evt.getByToken(ftleDigis_, hEndcap);
75  endcapRechits->reserve(hEndcap->size() / 2);
76  for (const auto& digi : *hEndcap) {
77  endcapRechits->emplace_back(endcap_->makeRecHit(digi));
78  }
79 
80  // put the collection of recunstructed hits in the event
81  evt.put(std::move(barrelRechits), ftlbInstance_);
82  evt.put(std::move(endcapRechits), ftleInstance_);
83 }

References barrel_, endcap_, ftlbDigis_, ftlbInstance_, ftleDigis_, ftleInstance_, edm::Event::getByToken(), eostools::move(), edm::Event::put(), and edm::SortedCollection< T, SORT >::size().

Member Data Documentation

◆ barrel_

std::unique_ptr<BTLUncalibratedRecHitAlgoBase> MTDUncalibratedRecHitProducer::barrel_
private

Definition at line 27 of file MTDUncalibratedRecHitProducer.cc.

Referenced by MTDUncalibratedRecHitProducer(), and produce().

◆ endcap_

std::unique_ptr<ETLUncalibratedRecHitAlgoBase> MTDUncalibratedRecHitProducer::endcap_
private

Definition at line 28 of file MTDUncalibratedRecHitProducer.cc.

Referenced by MTDUncalibratedRecHitProducer(), and produce().

◆ ftlbDigis_

const edm::EDGetTokenT<BTLDigiCollection> MTDUncalibratedRecHitProducer::ftlbDigis_
private

Definition at line 21 of file MTDUncalibratedRecHitProducer.cc.

Referenced by produce().

◆ ftlbInstance_

const std::string MTDUncalibratedRecHitProducer::ftlbInstance_
private

Definition at line 24 of file MTDUncalibratedRecHitProducer.cc.

Referenced by MTDUncalibratedRecHitProducer(), and produce().

◆ ftleDigis_

const edm::EDGetTokenT<ETLDigiCollection> MTDUncalibratedRecHitProducer::ftleDigis_
private

Definition at line 22 of file MTDUncalibratedRecHitProducer.cc.

Referenced by produce().

◆ ftleInstance_

const std::string MTDUncalibratedRecHitProducer::ftleInstance_
private

Definition at line 25 of file MTDUncalibratedRecHitProducer.cc.

Referenced by MTDUncalibratedRecHitProducer(), and produce().

Reference_intrackfit_cff.barrel
list barrel
Definition: Reference_intrackfit_cff.py:37
edm::SortedCollection::size
size_type size() const
Definition: SortedCollection.h:215
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
edm::Handle
Definition: AssociativeIterator.h:50
MTDUncalibratedRecHitProducer::ftleDigis_
const edm::EDGetTokenT< ETLDigiCollection > ftleDigis_
Definition: MTDUncalibratedRecHitProducer.cc:22
MTDUncalibratedRecHitProducer::endcap_
std::unique_ptr< ETLUncalibratedRecHitAlgoBase > endcap_
Definition: MTDUncalibratedRecHitProducer.cc:28
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
MTDUncalibratedRecHitProducer::ftleInstance_
const std::string ftleInstance_
Definition: MTDUncalibratedRecHitProducer.cc:25
edm::ParameterSet
Definition: ParameterSet.h:47
MTDUncalibratedRecHitProducer::barrel_
std::unique_ptr< BTLUncalibratedRecHitAlgoBase > barrel_
Definition: MTDUncalibratedRecHitProducer.cc:27
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
get
#define get
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
MTDUncalibratedRecHitProducer::ftlbDigis_
const edm::EDGetTokenT< BTLDigiCollection > ftlbDigis_
Definition: MTDUncalibratedRecHitProducer.cc:21
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::InputTag
Definition: InputTag.h:15
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2128
MTDUncalibratedRecHitProducer::ftlbInstance_
const std::string ftlbInstance_
Definition: MTDUncalibratedRecHitProducer.cc:24