CMS 3D CMS Logo

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

Public Member Functions

 PFClusterTimeAssigner (const edm::ParameterSet &conf)
 
virtual void produce (edm::Event &e, const edm::EventSetup &es)
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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 ()
 
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, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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 & itemsToGetFromEvent () 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)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::EDGetTokenT< reco::PFClusterCollectionclustersTok_
 
edm::EDGetTokenT< edm::ValueMap< float > > timesTok_
 

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
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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 20 of file PFClusterTimeAssigner.cc.

Constructor & Destructor Documentation

PFClusterTimeAssigner::PFClusterTimeAssigner ( const edm::ParameterSet conf)
inline

Definition at line 22 of file PFClusterTimeAssigner.cc.

References fastPrimaryVertexProducer_cfi::clusters, clustersTok_, MillePedeFileConverter_cfg::e, fillDescriptions(), edm::ParameterSet::getParameter(), produce(), create_public_lumi_plots::times, and timesTok_.

22  {
23  const edm::InputTag& clusters =
24  conf.getParameter<edm::InputTag>("src");
25  clustersTok_ = consumes<reco::PFClusterCollection>( clusters );
26 
27  const edm::InputTag& times =
28  conf.getParameter<edm::InputTag>("timeSrc");
29  timesTok_ = consumes<edm::ValueMap<float> >( times );
30 
31  produces<reco::PFClusterCollection>();
32  }
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::ValueMap< float > > timesTok_
edm::EDGetTokenT< reco::PFClusterCollection > clustersTok_

Member Function Documentation

void PFClusterTimeAssigner::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 73 of file PFClusterTimeAssigner.cc.

References edm::ConfigurationDescriptions::add(), and edm::ParameterSetDescription::add().

Referenced by PFClusterTimeAssigner().

73  {
75  desc.add<edm::InputTag>("src",edm::InputTag("particleFlowClusterECALUncorrected"));
76  desc.add<edm::InputTag>("timeSrc",edm::InputTag("ecalBarrelClusterFastTimer"));
77  descriptions.add("particleFlowClusterTimeAssignerDefault",desc);
78 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void PFClusterTimeAssigner::produce ( edm::Event e,
const edm::EventSetup es 
)
virtual

Definition at line 45 of file PFClusterTimeAssigner.cc.

References fastPrimaryVertexProducer_cfi::clusters, clustersTok_, edm::Event::getByToken(), mps_fire::i, eostools::move(), MillePedeFileConverter_cfg::out, edm::Event::put(), ntuplemaker::time, create_public_lumi_plots::times, and timesTok_.

Referenced by PFClusterTimeAssigner().

45  {
46  auto clusters_out = std::make_unique<reco::PFClusterCollection>();
47 
49  e.getByToken(clustersTok_,clustersH);
51  e.getByToken(timesTok_,timesH);
52 
53  auto const & clusters = *clustersH;
54  auto const & times = *timesH;
55 
56  clusters_out->reserve(clusters.size());
57  clusters_out->insert(clusters_out->end(),
58  clusters.begin(),clusters.end());
59 
60  //build the EE->PS association
61  auto& out = *clusters_out;
62  for( unsigned i = 0; i < out.size(); ++i ) {
63 
64  edm::Ref<reco::PFClusterCollection> clusterRef(clustersH,i);
65  const float time = times[clusterRef];
66  out[i].setTime(time);
67 
68  }
69 
70  e.put(std::move(clusters_out));
71 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
edm::EDGetTokenT< edm::ValueMap< float > > timesTok_
edm::EDGetTokenT< reco::PFClusterCollection > clustersTok_
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

edm::EDGetTokenT<reco::PFClusterCollection> PFClusterTimeAssigner::clustersTok_
private

Definition at line 38 of file PFClusterTimeAssigner.cc.

Referenced by PFClusterTimeAssigner(), and produce().

edm::EDGetTokenT<edm::ValueMap<float> > PFClusterTimeAssigner::timesTok_
private

Definition at line 39 of file PFClusterTimeAssigner.cc.

Referenced by PFClusterTimeAssigner(), and produce().