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<>

Public Member Functions

 PFClusterTimeAssigner (const edm::ParameterSet &conf)
 
void produce (edm::Event &e, const edm::EventSetup &es) override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 19 of file PFClusterTimeAssigner.cc.

Constructor & Destructor Documentation

◆ PFClusterTimeAssigner()

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

Definition at line 21 of file PFClusterTimeAssigner.cc.

References bsc_activity_cfg::clusters, clustersTok_, edm::ParameterSet::getParameter(), timeResosTok_, and timesTok_.

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

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 73 of file PFClusterTimeAssigner.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and ProducerED_cfi::InputTag.

73  {
75  desc.add<edm::InputTag>("src", edm::InputTag("particleFlowClusterECALUncorrected"));
76  desc.add<edm::InputTag>("timeSrc", edm::InputTag("ecalBarrelClusterFastTimer"));
77  desc.add<edm::InputTag>("timeResoSrc", edm::InputTag("ecalBarrelClusterFastTimer"));
78  descriptions.add("particleFlowClusterTimeAssignerDefault", desc);
79 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void PFClusterTimeAssigner::produce ( edm::Event e,
const edm::EventSetup es 
)
override

Definition at line 45 of file PFClusterTimeAssigner.cc.

References bsc_activity_cfg::clusters, clustersTok_, MillePedeFileConverter_cfg::e, mps_fire::i, eostools::move(), MillePedeFileConverter_cfg::out, hcalRecHitTable_cff::time, timeResosTok_, and timesTok_.

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

Member Data Documentation

◆ clustersTok_

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

Definition at line 38 of file PFClusterTimeAssigner.cc.

Referenced by PFClusterTimeAssigner(), and produce().

◆ timeResosTok_

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

Definition at line 40 of file PFClusterTimeAssigner.cc.

Referenced by PFClusterTimeAssigner(), and produce().

◆ timesTok_

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

Definition at line 39 of file PFClusterTimeAssigner.cc.

Referenced by PFClusterTimeAssigner(), and produce().