CMS 3D CMS Logo

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

Public Member Functions

 MTDRecHitProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &evt, const edm::EventSetup &es) override
 
 ~MTDRecHitProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Private Attributes

std::unique_ptr< MTDRecHitAlgoBasebarrel_
 
std::unique_ptr< MTDRecHitAlgoBaseendcap_
 
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 MTDRecHitProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 32 of file MTDRecHitProducer.cc.

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

32  :
33  ftlbURecHits_( consumes<FTLUncalibratedRecHitCollection>( ps.getParameter<edm::InputTag>("barrelUncalibratedRecHits") ) ),
34  ftleURecHits_( consumes<FTLUncalibratedRecHitCollection>( ps.getParameter<edm::InputTag>("endcapUncalibratedRecHits") ) ),
35  ftlbInstance_( ps.getParameter<std::string>("BarrelHitsName") ),
36  ftleInstance_( ps.getParameter<std::string>("EndcapHitsName") )
37 {
38 
39  produces< FTLRecHitCollection >(ftlbInstance_);
40  produces< FTLRecHitCollection >(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_.reset( MTDRecHitAlgoFactory::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_.reset( MTDRecHitAlgoFactory::get()->create(endcapAlgo, endcap, sumes) );
51 
52 }
T getParameter(std::string const &) const
def create(alignables, pedeDump, additionalData, outputFile, config)
std::unique_ptr< MTDRecHitAlgoBase > endcap_
const edm::EDGetTokenT< FTLUncalibratedRecHitCollection > ftleURecHits_
const std::string ftleInstance_
const std::string ftlbInstance_
ParameterSet const & getParameterSet(std::string const &) const
std::unique_ptr< MTDRecHitAlgoBase > barrel_
const edm::EDGetTokenT< FTLUncalibratedRecHitCollection > ftlbURecHits_
T get(const Candidate &c)
Definition: component.h:55
MTDRecHitProducer::~MTDRecHitProducer ( )
override

Definition at line 54 of file MTDRecHitProducer.cc.

54  {
55 }

Member Function Documentation

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

Definition at line 58 of file MTDRecHitProducer.cc.

References barrel_, DEFINE_FWK_MODULE, endcap_, flags, ftlbInstance_, ftlbURecHits_, ftleInstance_, ftleURecHits_, edm::Event::getByToken(), FTLRecHit::kGood, eostools::move(), edm::Event::put(), and edm::SortedCollection< T, SORT >::size().

58  {
59 
60 
61  // tranparently get things from event setup
62  barrel_->getEventSetup(es);
63  endcap_->getEventSetup(es);
64 
65  barrel_->getEvent(evt);
66  endcap_->getEvent(evt);
67 
68  // prepare output
69  auto barrelRechits = std::make_unique<FTLRecHitCollection>();
70  auto endcapRechits = std::make_unique<FTLRecHitCollection>();
71 
73  evt.getByToken( ftlbURecHits_, hBarrel );
74  barrelRechits->reserve(hBarrel->size()/2);
75  for(const auto& uhit : *hBarrel) {
76  uint32_t flags = FTLRecHit::kGood;
77  auto rechit = std::move( barrel_->makeRecHit(uhit, flags) );
78  if( flags == FTLRecHit::kGood ) barrelRechits->push_back( std::move(rechit) );
79  }
80 
82  evt.getByToken( ftleURecHits_, hEndcap );
83  endcapRechits->reserve(hEndcap->size()/2);
84  for(const auto& uhit : *hEndcap) {
85  uint32_t flags = FTLRecHit::kGood;
86  auto rechit = std::move( endcap_->makeRecHit(uhit, flags) );
87  if( flags == FTLRecHit::kGood ) endcapRechits->push_back( std::move(rechit) );
88  }
89 
90  // put the collection of recunstructed hits in the event
91  evt.put(std::move(barrelRechits), ftlbInstance_);
92  evt.put(std::move(endcapRechits), ftleInstance_);
93 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
std::unique_ptr< MTDRecHitAlgoBase > endcap_
const edm::EDGetTokenT< FTLUncalibratedRecHitCollection > ftleURecHits_
const std::string ftleInstance_
const std::string ftlbInstance_
size_type size() const
std::unique_ptr< MTDRecHitAlgoBase > barrel_
const edm::EDGetTokenT< FTLUncalibratedRecHitCollection > ftlbURecHits_
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

std::unique_ptr<MTDRecHitAlgoBase> MTDRecHitProducer::barrel_
private

Definition at line 29 of file MTDRecHitProducer.cc.

Referenced by MTDRecHitProducer(), and produce().

std::unique_ptr<MTDRecHitAlgoBase> MTDRecHitProducer::endcap_
private

Definition at line 29 of file MTDRecHitProducer.cc.

Referenced by MTDRecHitProducer(), and produce().

const std::string MTDRecHitProducer::ftlbInstance_
private

Definition at line 26 of file MTDRecHitProducer.cc.

Referenced by MTDRecHitProducer(), and produce().

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

Definition at line 23 of file MTDRecHitProducer.cc.

Referenced by produce().

const std::string MTDRecHitProducer::ftleInstance_
private

Definition at line 27 of file MTDRecHitProducer.cc.

Referenced by MTDRecHitProducer(), and produce().

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

Definition at line 24 of file MTDRecHitProducer.cc.

Referenced by produce().