CMS 3D CMS Logo

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

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
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 14 of file FTLUncalibratedRecHitProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 32 of file FTLUncalibratedRecHitProducer.cc.

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

32  :
33  ftlbDigis_( consumes<FTLDigiCollection>( ps.getParameter<edm::InputTag>("barrelDigis") ) ),
34  ftleDigis_( consumes<FTLDigiCollection>( ps.getParameter<edm::InputTag>("endcapDigis") ) ),
35  ftlbInstance_( ps.getParameter<std::string>("BarrelHitsName") ),
36  ftleInstance_( ps.getParameter<std::string>("EndcapHitsName") ) {
37 
38  produces< FTLUncalibratedRecHitCollection >(ftlbInstance_);
39  produces< FTLUncalibratedRecHitCollection >(ftleInstance_);
40 
41  auto sumes = consumesCollector();
42 
43  const edm::ParameterSet& barrel = ps.getParameterSet("barrel");
44  const std::string& barrelAlgo = barrel.getParameter<std::string>("algoName");
45  barrel_.reset( FTLUncalibratedRecHitAlgoFactory::get()->create(barrelAlgo, barrel, sumes) );
46 
47  const edm::ParameterSet& endcap = ps.getParameterSet("endcap");
48  const std::string& endcapAlgo = endcap.getParameter<std::string>("algoName");
49  endcap_.reset( FTLUncalibratedRecHitAlgoFactory::get()->create(endcapAlgo, endcap, sumes) );
50 }
T getParameter(std::string const &) const
def create(alignables, pedeDump, additionalData, outputFile, config)
std::unique_ptr< FTLUncalibratedRecHitAlgoBase > endcap_
const edm::EDGetTokenT< FTLDigiCollection > ftlbDigis_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
const edm::EDGetTokenT< FTLDigiCollection > ftleDigis_
std::unique_ptr< FTLUncalibratedRecHitAlgoBase > barrel_
ParameterSet const & getParameterSet(std::string const &) const
T get(const Candidate &c)
Definition: component.h:55
FTLUncalibratedRecHitProducer::~FTLUncalibratedRecHitProducer ( )
override

Definition at line 52 of file FTLUncalibratedRecHitProducer.cc.

52  {
53 }

Member Function Documentation

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

Definition at line 56 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().

56  {
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->push_back( std::move(barrel_->makeRecHit(digi)) );
75  }
76 
78  evt.getByToken( ftleDigis_, hEndcap );
79  endcapRechits->reserve(hEndcap->size()/2);
80  for(const auto& digi : *hEndcap) {
81  endcapRechits->push_back( std::move(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 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
std::unique_ptr< FTLUncalibratedRecHitAlgoBase > endcap_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
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:510

Member Data Documentation

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

Definition at line 29 of file FTLUncalibratedRecHitProducer.cc.

Referenced by FTLUncalibratedRecHitProducer(), and produce().

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

Definition at line 29 of file FTLUncalibratedRecHitProducer.cc.

Referenced by FTLUncalibratedRecHitProducer(), and produce().

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

Definition at line 23 of file FTLUncalibratedRecHitProducer.cc.

Referenced by produce().

const std::string FTLUncalibratedRecHitProducer::ftlbInstance_
private

Definition at line 26 of file FTLUncalibratedRecHitProducer.cc.

Referenced by FTLUncalibratedRecHitProducer(), and produce().

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

Definition at line 24 of file FTLUncalibratedRecHitProducer.cc.

Referenced by produce().

const std::string FTLUncalibratedRecHitProducer::ftleInstance_
private

Definition at line 27 of file FTLUncalibratedRecHitProducer.cc.

Referenced by FTLUncalibratedRecHitProducer(), and produce().