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
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

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

Constructor & Destructor Documentation

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

Definition at line 33 of file MTDUncalibratedRecHitProducer.cc.

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

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

Definition at line 53 of file MTDUncalibratedRecHitProducer.cc.

53  {
54 }

Member Function Documentation

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

Definition at line 57 of file MTDUncalibratedRecHitProducer.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().

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

Member Data Documentation

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

Definition at line 29 of file MTDUncalibratedRecHitProducer.cc.

Referenced by MTDUncalibratedRecHitProducer(), and produce().

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

Definition at line 30 of file MTDUncalibratedRecHitProducer.cc.

Referenced by MTDUncalibratedRecHitProducer(), and produce().

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

Definition at line 23 of file MTDUncalibratedRecHitProducer.cc.

Referenced by produce().

const std::string MTDUncalibratedRecHitProducer::ftlbInstance_
private

Definition at line 26 of file MTDUncalibratedRecHitProducer.cc.

Referenced by MTDUncalibratedRecHitProducer(), and produce().

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

Definition at line 24 of file MTDUncalibratedRecHitProducer.cc.

Referenced by produce().

const std::string MTDUncalibratedRecHitProducer::ftleInstance_
private

Definition at line 27 of file MTDUncalibratedRecHitProducer.cc.

Referenced by MTDUncalibratedRecHitProducer(), and produce().