CMS 3D CMS Logo

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

Public Member Functions

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

std::unique_ptr< FTLUncalibratedRecHitAlgoBasebarrel_
 
std::unique_ptr< FTLUncalibratedRecHitAlgoBaseendcap_
 
const edm::EDGetTokenT< FTLDigiCollectionftlbDigis_
 
const std::string ftlbInstance_
 
const edm::EDGetTokenT< FTLDigiCollectionftleDigis_
 
const std::string ftleInstance_
 

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

Constructor & Destructor Documentation

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

Definition at line 30 of file FTLUncalibratedRecHitProducer.cc.

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

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

Definition at line 51 of file FTLUncalibratedRecHitProducer.cc.

51 {}

Member Function Documentation

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

Definition at line 53 of file FTLUncalibratedRecHitProducer.cc.

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

53  {
54  // tranparently get things from event setup
55  barrel_->getEventSetup(es);
56  endcap_->getEventSetup(es);
57 
58  barrel_->getEvent(evt);
59  endcap_->getEvent(evt);
60 
61  // prepare output
62  auto barrelRechits = std::make_unique<FTLUncalibratedRecHitCollection>();
63  auto endcapRechits = std::make_unique<FTLUncalibratedRecHitCollection>();
64 
66  evt.getByToken(ftlbDigis_, hBarrel);
67  barrelRechits->reserve(hBarrel->size() / 2);
68  for (const auto& digi : *hBarrel) {
69  barrelRechits->emplace_back(barrel_->makeRecHit(digi));
70  }
71 
73  evt.getByToken(ftleDigis_, hEndcap);
74  endcapRechits->reserve(hEndcap->size() / 2);
75  for (const auto& digi : *hEndcap) {
76  endcapRechits->emplace_back(endcap_->makeRecHit(digi));
77  }
78 
79  // put the collection of recunstructed hits in the event
80  evt.put(std::move(barrelRechits), ftlbInstance_);
81  evt.put(std::move(endcapRechits), ftleInstance_);
82 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
std::unique_ptr< FTLUncalibratedRecHitAlgoBase > endcap_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
const edm::EDGetTokenT< FTLDigiCollection > ftlbDigis_
const edm::EDGetTokenT< FTLDigiCollection > ftleDigis_
std::unique_ptr< FTLUncalibratedRecHitAlgoBase > barrel_
size_type size() const
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

std::unique_ptr<FTLUncalibratedRecHitAlgoBase> FTLUncalibratedRecHitProducer::barrel_
private

Definition at line 27 of file FTLUncalibratedRecHitProducer.cc.

Referenced by FTLUncalibratedRecHitProducer(), and produce().

std::unique_ptr<FTLUncalibratedRecHitAlgoBase> FTLUncalibratedRecHitProducer::endcap_
private

Definition at line 27 of file FTLUncalibratedRecHitProducer.cc.

Referenced by FTLUncalibratedRecHitProducer(), and produce().

const edm::EDGetTokenT<FTLDigiCollection> FTLUncalibratedRecHitProducer::ftlbDigis_
private

Definition at line 21 of file FTLUncalibratedRecHitProducer.cc.

Referenced by produce().

const std::string FTLUncalibratedRecHitProducer::ftlbInstance_
private

Definition at line 24 of file FTLUncalibratedRecHitProducer.cc.

Referenced by FTLUncalibratedRecHitProducer(), and produce().

const edm::EDGetTokenT<FTLDigiCollection> FTLUncalibratedRecHitProducer::ftleDigis_
private

Definition at line 22 of file FTLUncalibratedRecHitProducer.cc.

Referenced by produce().

const std::string FTLUncalibratedRecHitProducer::ftleInstance_
private

Definition at line 25 of file FTLUncalibratedRecHitProducer.cc.

Referenced by FTLUncalibratedRecHitProducer(), and produce().