CMS 3D CMS Logo

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

Public Member Functions

 FTLRecHitProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &evt, const edm::EventSetup &es) override
 
 ~FTLRecHitProducer () 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< FTLRecHitAlgoBasebarrel_
 
std::unique_ptr< FTLRecHitAlgoBaseendcap_
 
const std::string ftlbInstance_
 
const edm::EDGetTokenT< FTLUncalibratedRecHitCollectionftlbURecHits_
 
const std::string ftleInstance_
 
const edm::EDGetTokenT< FTLUncalibratedRecHitCollectionftleURecHits_
 

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 FTLRecHitProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 30 of file FTLRecHitProducer.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  : ftlbURecHits_(
32  consumes<FTLUncalibratedRecHitCollection>(ps.getParameter<edm::InputTag>("barrelUncalibratedRecHits"))),
34  consumes<FTLUncalibratedRecHitCollection>(ps.getParameter<edm::InputTag>("endcapUncalibratedRecHits"))),
35  ftlbInstance_(ps.getParameter<std::string>("BarrelHitsName")),
36  ftleInstance_(ps.getParameter<std::string>("EndcapHitsName")) {
37  produces<FTLRecHitCollection>(ftlbInstance_);
38  produces<FTLRecHitCollection>(ftleInstance_);
39 
40  auto sumes = consumesCollector();
41 
42  const edm::ParameterSet& barrel = ps.getParameterSet("barrel");
43  const std::string& barrelAlgo = barrel.getParameter<std::string>("algoName");
44  barrel_ = FTLRecHitAlgoFactory::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_ = FTLRecHitAlgoFactory::get()->create(endcapAlgo, endcap, sumes);
49 }
T getParameter(std::string const &) const
std::unique_ptr< FTLRecHitAlgoBase > endcap_
const std::string ftleInstance_
std::unique_ptr< FTLRecHitAlgoBase > barrel_
const edm::EDGetTokenT< FTLUncalibratedRecHitCollection > ftlbURecHits_
ParameterSet const & getParameterSet(std::string const &) const
const std::string ftlbInstance_
const edm::EDGetTokenT< FTLUncalibratedRecHitCollection > ftleURecHits_
FTLRecHitProducer::~FTLRecHitProducer ( )
override

Definition at line 51 of file FTLRecHitProducer.cc.

51 {}

Member Function Documentation

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

Definition at line 53 of file FTLRecHitProducer.cc.

References barrel_, DEFINE_FWK_MODULE, endcap_, HLT_2018_cff::flags, ftlbInstance_, ftlbURecHits_, ftleInstance_, ftleURecHits_, edm::Event::getByToken(), FTLRecHit::kGood, 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<FTLRecHitCollection>();
63  auto endcapRechits = std::make_unique<FTLRecHitCollection>();
64 
66  evt.getByToken(ftlbURecHits_, hBarrel);
67  barrelRechits->reserve(hBarrel->size() / 2);
68  for (const auto& uhit : *hBarrel) {
69  uint32_t flags = FTLRecHit::kGood;
70  auto rechit = barrel_->makeRecHit(uhit, flags);
71  if (flags == FTLRecHit::kGood)
72  barrelRechits->push_back(std::move(rechit));
73  }
74 
76  evt.getByToken(ftleURecHits_, hEndcap);
77  endcapRechits->reserve(hEndcap->size() / 2);
78  for (const auto& uhit : *hEndcap) {
79  uint32_t flags = FTLRecHit::kGood;
80  auto rechit = endcap_->makeRecHit(uhit, flags);
81  if (flags == FTLRecHit::kGood)
82  endcapRechits->push_back(std::move(rechit));
83  }
84 
85  // put the collection of recunstructed hits in the event
86  evt.put(std::move(barrelRechits), ftlbInstance_);
87  evt.put(std::move(endcapRechits), ftleInstance_);
88 }
std::unique_ptr< FTLRecHitAlgoBase > endcap_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
const std::string ftleInstance_
std::unique_ptr< FTLRecHitAlgoBase > barrel_
const edm::EDGetTokenT< FTLUncalibratedRecHitCollection > ftlbURecHits_
const std::string ftlbInstance_
size_type size() const
def move(src, dest)
Definition: eostools.py:511
const edm::EDGetTokenT< FTLUncalibratedRecHitCollection > ftleURecHits_

Member Data Documentation

std::unique_ptr<FTLRecHitAlgoBase> FTLRecHitProducer::barrel_
private

Definition at line 27 of file FTLRecHitProducer.cc.

Referenced by FTLRecHitProducer(), and produce().

std::unique_ptr<FTLRecHitAlgoBase> FTLRecHitProducer::endcap_
private

Definition at line 27 of file FTLRecHitProducer.cc.

Referenced by FTLRecHitProducer(), and produce().

const std::string FTLRecHitProducer::ftlbInstance_
private

Definition at line 24 of file FTLRecHitProducer.cc.

Referenced by FTLRecHitProducer(), and produce().

const edm::EDGetTokenT<FTLUncalibratedRecHitCollection> FTLRecHitProducer::ftlbURecHits_
private

Definition at line 21 of file FTLRecHitProducer.cc.

Referenced by produce().

const std::string FTLRecHitProducer::ftleInstance_
private

Definition at line 25 of file FTLRecHitProducer.cc.

Referenced by FTLRecHitProducer(), and produce().

const edm::EDGetTokenT<FTLUncalibratedRecHitCollection> FTLRecHitProducer::ftleURecHits_
private

Definition at line 22 of file FTLRecHitProducer.cc.

Referenced by produce().