CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
PFEGammaProducer Class Reference

Producer for particle flow reconstructed particles (PFCandidates) More...

Inheritance diagram for PFEGammaProducer:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 PFEGammaProducer (const edm::ParameterSet &)
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 
- Public Member Functions inherited from edm::global::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
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

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

Private Member Functions

reco::ConversionCollection createSingleLegConversions (reco::PFCandidateEGammaExtraCollection &extras, const edm::RefProd< reco::ConversionCollection > &convProd) const
 

Private Attributes

const edm::EDPutTokenT< reco::CaloClusterCollectioncaloClusterCollectionEBEEPutToken_
 
const edm::EDPutTokenT< reco::CaloClusterCollectioncaloClusterCollectionESPutToken_
 
const edm::EDPutTokenT< reco::ConversionCollectionconversionCollectionPutToken_
 
const edm::EDGetTokenT< reco::PFCluster::EEtoPSAssociationeetopsSrc_
 
const PFEGammaAlgo::GBRForests gbrForests_
 
const edm::EDGetTokenT< reco::PFBlockCollectioninputTagBlocks_
 
const edm::EDPutTokenT< reco::PFCandidateCollectionpfCandidateCollectionPutToken_
 
const edm::EDPutTokenT< reco::PFCandidateEGammaExtraCollectionpfCandidateEGammaExtraCollectionPutToken_
 
const PFEGammaAlgo::PFEGConfigInfo pfEGConfigInfo_
 particle flow algorithm configuration More...
 
const edm::EDPutTokenT< reco::SuperClusterCollectionsuperClusterCollectionPutToken_
 
const edm::EDGetTokenT< reco::VertexCollectionvertices_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase 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
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Producer for particle flow reconstructed particles (PFCandidates)

This producer makes use of PFAlgo, the particle flow algorithm.

Author
Colin Bernet
Date
July 2006

Definition at line 36 of file PFEGammaProducer.cc.

Constructor & Destructor Documentation

◆ PFEGammaProducer()

PFEGammaProducer::PFEGammaProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 73 of file PFEGammaProducer.cc.

74  : inputTagBlocks_(consumes<reco::PFBlockCollection>(iConfig.getParameter<edm::InputTag>("blocks"))),
75  eetopsSrc_(consumes<reco::PFCluster::EEtoPSAssociation>(iConfig.getParameter<edm::InputTag>("EEtoPS_source"))),
76  vertices_(consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("vertexCollection"))),
77  pfCandidateCollectionPutToken_{produces<reco::PFCandidateCollection>()},
78  pfCandidateEGammaExtraCollectionPutToken_{produces<reco::PFCandidateEGammaExtraCollection>()},
79  superClusterCollectionPutToken_{produces<reco::SuperClusterCollection>()},
80  caloClusterCollectionEBEEPutToken_{produces<reco::CaloClusterCollection>("EBEEClusters")},
81  caloClusterCollectionESPutToken_{produces<reco::CaloClusterCollection>("ESClusters")},
82  conversionCollectionPutToken_{produces<reco::ConversionCollection>()},
84  .mvaEleCut = iConfig.getParameter<double>("pf_electron_mvaCut"),
85  .applyCrackCorrections = iConfig.getParameter<bool>("pf_electronID_crackCorrection"),
86  .produceEGCandsWithNoSuperCluster = iConfig.getParameter<bool>("produceEGCandsWithNoSuperCluster"),
87  .mvaConvCut = iConfig.getParameter<double>("pf_conv_mvaCut"),
88  },
90  iConfig,
91  } {}

Member Function Documentation

◆ createSingleLegConversions()

reco::ConversionCollection PFEGammaProducer::createSingleLegConversions ( reco::PFCandidateEGammaExtraCollection extras,
const edm::RefProd< reco::ConversionCollection > &  convProd 
) const
private

Definition at line 308 of file PFEGammaProducer.cc.

309  {
310  reco::ConversionCollection oneLegConversions{};
312  for (auto& extra : extras) {
313  for (const auto& tkrefmva : extra.singleLegConvTrackRefMva()) {
314  const reco::Track& trk = *tkrefmva.first;
315 
316  const reco::Vertex convVtx(trk.innerPosition(), error);
317  std::vector<reco::TrackRef> OneLegConvVector;
318  OneLegConvVector.push_back(tkrefmva.first);
319  std::vector<float> OneLegMvaVector;
320  OneLegMvaVector.push_back(tkrefmva.second);
321  std::vector<reco::CaloClusterPtr> dummymatchingBC;
323  scPtrVec.push_back(edm::refToPtr(extra.superClusterRef()));
324 
325  std::vector<math::XYZPointF> trackPositionAtEcalVec;
326  std::vector<math::XYZPointF> innPointVec;
327  std::vector<math::XYZVectorF> trackPinVec;
328  std::vector<math::XYZVectorF> trackPoutVec;
329  math::XYZPointF trackPositionAtEcal(trk.outerPosition().X(), trk.outerPosition().Y(), trk.outerPosition().Z());
330  trackPositionAtEcalVec.push_back(trackPositionAtEcal);
331 
332  math::XYZPointF innPoint(trk.innerPosition().X(), trk.innerPosition().Y(), trk.innerPosition().Z());
333  innPointVec.push_back(innPoint);
334 
335  math::XYZVectorF trackPin(trk.innerMomentum().X(), trk.innerMomentum().Y(), trk.innerMomentum().Z());
336  trackPinVec.push_back(trackPin);
337 
338  math::XYZVectorF trackPout(trk.outerMomentum().X(), trk.outerMomentum().Y(), trk.outerMomentum().Z());
339  trackPoutVec.push_back(trackPout);
340 
341  float DCA = trk.d0();
342  float mvaval = tkrefmva.second;
343  reco::Conversion singleLegConvCandidate(scPtrVec,
344  OneLegConvVector,
345  trackPositionAtEcalVec,
346  convVtx,
347  dummymatchingBC,
348  DCA,
349  innPointVec,
350  trackPinVec,
351  trackPoutVec,
352  mvaval,
354  singleLegConvCandidate.setOneLegMVA(OneLegMvaVector);
355  oneLegConversions.push_back(singleLegConvCandidate);
356 
357  reco::ConversionRef convref(convProd, oneLegConversions.size() - 1);
358  extra.addSingleLegConversionRef(convref);
359  }
360  }
361  return oneLegConversions;
362 }

References reco::TrackBase::d0(), relativeConstraints::error, reco::Track::innerMomentum(), reco::Track::innerPosition(), reco::Track::outerMomentum(), reco::Track::outerPosition(), reco::Conversion::pflow, edm::PtrVector< T >::push_back(), edm::refToPtr(), and reco::Conversion::setOneLegMVA().

Referenced by produce().

◆ fillDescriptions()

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

Definition at line 364 of file PFEGammaProducer.cc.

364  {
366  desc.add<bool>("produceEGCandsWithNoSuperCluster", false)
367  ->setComment("Allow building of candidates with no input or output supercluster?");
368  desc.add<double>("pf_electron_mvaCut", -0.1);
369  desc.add<bool>("pf_electronID_crackCorrection", false);
370  desc.add<double>("pf_conv_mvaCut", 0.0);
371  desc.add<edm::InputTag>("blocks", edm::InputTag("particleFlowBlock"))->setComment("PF Blocks label");
372  desc.add<edm::InputTag>("EEtoPS_source", edm::InputTag("particleFlowClusterECAL"))
373  ->setComment("EE to PS association");
374  desc.add<edm::InputTag>("vertexCollection", edm::InputTag("offlinePrimaryVertices"));
375  desc.add<edm::FileInPath>("pf_electronID_mvaWeightFile",
376  edm::FileInPath("RecoParticleFlow/PFProducer/data/PfElectrons23Jan_BDT.weights.xml.gz"));
377  desc.add<edm::FileInPath>("pf_convID_mvaWeightFile",
378  edm::FileInPath("RecoParticleFlow/PFProducer/data/pfConversionAug0411_BDT.weights.xml.gz"));
379  descriptions.add("particleFlowEGamma", desc);
380 }

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

◆ produce()

void PFEGammaProducer::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overridevirtual

Implements edm::global::EDProducerBase.

Definition at line 93 of file PFEGammaProducer.cc.

93  {
94  LOGDRESSED("PFEGammaProducer") << "START event: " << iEvent.id().event() << " in run " << iEvent.id().run()
95  << std::endl;
96 
97  // output collections
98  reco::PFCandidateCollection egCandidates{};
100  reco::SuperClusterCollection sClusters{};
101 
102  // preshower conditions
103  edm::ESHandle<ESEEIntercalibConstants> esEEInterCalibHandle_;
104  iSetup.get<ESEEIntercalibConstantsRcd>().get(esEEInterCalibHandle_);
105 
106  edm::ESHandle<ESChannelStatus> esChannelStatusHandle_;
107  iSetup.get<ESChannelStatusRcd>().get(esChannelStatusHandle_);
108 
109  //Assign the PFAlgo Parameters
110  auto const& primaryVertices = iEvent.get(vertices_);
111  auto const* primaryVertex = &primaryVertices.front();
112  for (auto const& pv : primaryVertices) {
113  if (pv.isValid() && !pv.isFake()) {
114  primaryVertex = &pv;
115  break;
116  }
117  }
118 
119  PFEGammaAlgo pfEGammaAlgo{pfEGConfigInfo_,
120  gbrForests_,
121  iEvent.get(eetopsSrc_),
122  *esEEInterCalibHandle_,
123  *esChannelStatusHandle_,
124  *primaryVertex};
125 
126  // get the collection of blocks
127 
128  LOGDRESSED("PFEGammaProducer") << "getting blocks" << std::endl;
129  auto blocks = iEvent.getHandle(inputTagBlocks_);
130 
131  LOGDRESSED("PFEGammaProducer") << "EGPFlow is starting..." << std::endl;
132 
133 #ifdef PFLOW_DEBUG
134  assert(blocks.isValid() && "edm::Handle to blocks was null!");
135  std::ostringstream str;
136  //str<<(*pfAlgo_)<<std::endl;
137  // cout << (*pfAlgo_) << std::endl;
138  LOGDRESSED("PFEGammaProducer") << str.str() << std::endl;
139 #endif
140 
141  // sort elements in three lists:
142  std::list<reco::PFBlockRef> hcalBlockRefs;
143  std::list<reco::PFBlockRef> ecalBlockRefs;
144  std::list<reco::PFBlockRef> hoBlockRefs;
145  std::list<reco::PFBlockRef> otherBlockRefs;
146 
147  for (unsigned i = 0; i < blocks->size(); ++i) {
148  reco::PFBlockRef blockref(blocks, i);
149 
150  const edm::OwnVector<reco::PFBlockElement>& elements = blockref->elements();
151 
152  LOGDRESSED("PFEGammaProducer") << "Found " << elements.size() << " PFBlockElements in block: " << i << std::endl;
153 
154  bool singleEcalOrHcal = false;
155  if (elements.size() == 1) {
156  switch (elements[0].type()) {
158  edm::LogError("PFEGammaProducer") << "PFBLOCKALGO BUG!!!! Found a SuperCluster in a block by itself!";
159  break;
163  ecalBlockRefs.push_back(blockref);
164  singleEcalOrHcal = true;
165  break;
169  if (elements[0].clusterRef()->flags() & reco::CaloCluster::badHcalMarker)
170  continue;
171  hcalBlockRefs.push_back(blockref);
172  singleEcalOrHcal = true;
173  break;
175  // Single HO elements are likely to be noise. Not considered for now.
176  hoBlockRefs.push_back(blockref);
177  singleEcalOrHcal = true;
178  break;
179  default:
180  break;
181  }
182  }
183 
184  if (!singleEcalOrHcal) {
185  otherBlockRefs.push_back(blockref);
186  }
187  } //loop blocks
188 
189  // loop on blocks that are not single ecal, single ps1, single ps2 , or
190  // single hcal and produce unbiased collection of EGamma Candidates
191 
192  //printf("loop over blocks\n");
193  unsigned nblcks = 0;
194 
195  // this auto is a const reco::PFBlockRef&
196  for (const auto& blockref : otherBlockRefs) {
197  ++nblcks;
198  // this auto is a: const edm::OwnVector< reco::PFBlockElement >&
199  const auto& elements = blockref->elements();
200  // make a copy of the link data, which will be edited.
201  //PFBlock::LinkData linkData = block.linkData();
202 
203  auto output = pfEGammaAlgo(blockref);
204 
205  if (!output.candidates.empty()) {
206  LOGDRESSED("PFEGammaProducer") << "Block with " << elements.size() << " elements produced "
207  << output.candidates.size() << " e-g candidates!" << std::endl;
208  }
209 
210  const size_t egsize = egCandidates.size();
211  egCandidates.resize(egsize + output.candidates.size());
212  std::move(output.candidates.begin(), output.candidates.end(), egCandidates.begin() + egsize);
213 
214  const size_t egxsize = egExtra.size();
215  egExtra.resize(egxsize + output.candidateExtras.size());
216  std::move(output.candidateExtras.begin(), output.candidateExtras.end(), egExtra.begin() + egxsize);
217 
218  const size_t rscsize = sClusters.size();
219  sClusters.resize(rscsize + output.refinedSuperClusters.size());
220  std::move(output.refinedSuperClusters.begin(), output.refinedSuperClusters.end(), sClusters.begin() + rscsize);
221  }
222 
223  LOGDRESSED("PFEGammaProducer") << "Running PFEGammaAlgo on all blocks produced = " << egCandidates.size()
224  << " e-g candidates!" << std::endl;
225 
226  auto sClusterProd = iEvent.getRefBeforePut<reco::SuperClusterCollection>();
227  auto egXtraProd = iEvent.getRefBeforePut<reco::PFCandidateEGammaExtraCollection>();
228 
229  //set the correct references to refined SC and EG extra using the refprods
230  for (unsigned int i = 0; i < egCandidates.size(); ++i) {
231  reco::PFCandidate& cand = egCandidates.at(i);
232  reco::PFCandidateEGammaExtra& xtra = egExtra.at(i);
233 
234  reco::PFCandidateEGammaExtraRef extraref(egXtraProd, i);
235  reco::SuperClusterRef refinedSCRef(sClusterProd, i);
236 
237  xtra.setSuperClusterRef(refinedSCRef);
238  cand.setSuperClusterRef(refinedSCRef);
239  cand.setPFEGammaExtraRef(extraref);
240  }
241 
242  //build collections of output CaloClusters from the used PFClusters
243  reco::CaloClusterCollection caloClustersEBEE{};
244  reco::CaloClusterCollection caloClustersES{};
245 
246  std::map<edm::Ptr<reco::CaloCluster>, unsigned int> pfClusterMapEBEE; //maps of pfclusters to caloclusters
247  std::map<edm::Ptr<reco::CaloCluster>, unsigned int> pfClusterMapES;
248 
249  for (const auto& sc : sClusters) {
250  for (reco::CaloCluster_iterator pfclus = sc.clustersBegin(); pfclus != sc.clustersEnd(); ++pfclus) {
251  if (!pfClusterMapEBEE.count(*pfclus)) {
252  reco::CaloCluster caloclus(**pfclus);
253  caloClustersEBEE.push_back(caloclus);
254  pfClusterMapEBEE[*pfclus] = caloClustersEBEE.size() - 1;
255  } else {
256  throw cms::Exception("PFEgammaProducer::produce")
257  << "Found an EB/EE pfcluster matched to more than one supercluster!" << std::dec << std::endl;
258  }
259  }
260  for (reco::CaloCluster_iterator pfclus = sc.preshowerClustersBegin(); pfclus != sc.preshowerClustersEnd();
261  ++pfclus) {
262  if (!pfClusterMapES.count(*pfclus)) {
263  reco::CaloCluster caloclus(**pfclus);
264  caloClustersES.push_back(caloclus);
265  pfClusterMapES[*pfclus] = caloClustersES.size() - 1;
266  } else {
267  throw cms::Exception("PFEgammaProducer::produce")
268  << "Found an ES pfcluster matched to more than one supercluster!" << std::dec << std::endl;
269  }
270  }
271  }
272 
273  //put calocluster output collections in event and get orphan handles to create ptrs
274  auto const& caloClusHandleEBEE = iEvent.emplace(caloClusterCollectionEBEEPutToken_, std::move(caloClustersEBEE));
275  auto const& caloClusHandleES = iEvent.emplace(caloClusterCollectionESPutToken_, std::move(caloClustersES));
276 
277  //relink superclusters to output caloclusters
278  for (auto& sc : sClusters) {
279  edm::Ptr<reco::CaloCluster> seedptr(caloClusHandleEBEE, pfClusterMapEBEE[sc.seed()]);
280  sc.setSeed(seedptr);
281 
283  for (reco::CaloCluster_iterator pfclus = sc.clustersBegin(); pfclus != sc.clustersEnd(); ++pfclus) {
284  edm::Ptr<reco::CaloCluster> clusptr(caloClusHandleEBEE, pfClusterMapEBEE[*pfclus]);
285  clusters.push_back(clusptr);
286  }
287  sc.setClusters(clusters);
288 
289  reco::CaloClusterPtrVector psclusters;
290  for (reco::CaloCluster_iterator pfclus = sc.preshowerClustersBegin(); pfclus != sc.preshowerClustersEnd();
291  ++pfclus) {
292  edm::Ptr<reco::CaloCluster> clusptr(caloClusHandleES, pfClusterMapES[*pfclus]);
293  psclusters.push_back(clusptr);
294  }
295  sc.setPreshowerClusters(psclusters);
296  }
297 
298  //create and fill references to single leg conversions
299  auto singleLegConv = createSingleLegConversions(egExtra, iEvent.getRefBeforePut<reco::ConversionCollection>());
300 
301  // release our demonspawn into the wild to cause havoc
302  iEvent.emplace(superClusterCollectionPutToken_, std::move(sClusters));
304  iEvent.emplace(conversionCollectionPutToken_, std::move(singleLegConv));
305  iEvent.emplace(pfCandidateCollectionPutToken_, std::move(egCandidates));
306 }

References cms::cuda::assert(), reco::CaloCluster::badHcalMarker, gather_cfg::blocks, caloClusterCollectionEBEEPutToken_, caloClusterCollectionESPutToken_, bsc_activity_cfg::clusters, conversionCollectionPutToken_, createSingleLegConversions(), TauDecayModes::dec, reco::PFBlockElement::ECAL, eetopsSrc_, bookConverter::elements, Exception, HLT_FULL_cff::flags, gbrForests_, edm::EventSetup::get(), get, reco::PFBlockElement::HCAL, reco::PFBlockElement::HFEM, reco::PFBlockElement::HFHAD, reco::PFBlockElement::HO, mps_fire::i, iEvent, inputTagBlocks_, LOGDRESSED, eostools::move(), convertSQLitetoXML_cfg::output, pfCandidateCollectionPutToken_, pfCandidateEGammaExtraCollectionPutToken_, pfEGConfigInfo_, BeamMonitor_cff::primaryVertex, zMuMuMuonUserData::primaryVertices, reco::PFBlockElement::PS1, reco::PFBlockElement::PS2, edm::PtrVector< T >::push_back(), MetAnalyzer::pv(), reco::PFBlockElement::SC, reco::PFCandidateEGammaExtra::setSuperClusterRef(), str, superClusterCollectionPutToken_, and vertices_.

Member Data Documentation

◆ caloClusterCollectionEBEEPutToken_

const edm::EDPutTokenT<reco::CaloClusterCollection> PFEGammaProducer::caloClusterCollectionEBEEPutToken_
private

Definition at line 55 of file PFEGammaProducer.cc.

Referenced by produce().

◆ caloClusterCollectionESPutToken_

const edm::EDPutTokenT<reco::CaloClusterCollection> PFEGammaProducer::caloClusterCollectionESPutToken_
private

Definition at line 56 of file PFEGammaProducer.cc.

Referenced by produce().

◆ conversionCollectionPutToken_

const edm::EDPutTokenT<reco::ConversionCollection> PFEGammaProducer::conversionCollectionPutToken_
private

Definition at line 57 of file PFEGammaProducer.cc.

Referenced by produce().

◆ eetopsSrc_

const edm::EDGetTokenT<reco::PFCluster::EEtoPSAssociation> PFEGammaProducer::eetopsSrc_
private

Definition at line 49 of file PFEGammaProducer.cc.

Referenced by produce().

◆ gbrForests_

const PFEGammaAlgo::GBRForests PFEGammaProducer::gbrForests_
private

Definition at line 61 of file PFEGammaProducer.cc.

Referenced by produce().

◆ inputTagBlocks_

const edm::EDGetTokenT<reco::PFBlockCollection> PFEGammaProducer::inputTagBlocks_
private

Definition at line 48 of file PFEGammaProducer.cc.

Referenced by produce().

◆ pfCandidateCollectionPutToken_

const edm::EDPutTokenT<reco::PFCandidateCollection> PFEGammaProducer::pfCandidateCollectionPutToken_
private

Definition at line 52 of file PFEGammaProducer.cc.

Referenced by produce().

◆ pfCandidateEGammaExtraCollectionPutToken_

const edm::EDPutTokenT<reco::PFCandidateEGammaExtraCollection> PFEGammaProducer::pfCandidateEGammaExtraCollectionPutToken_
private

Definition at line 53 of file PFEGammaProducer.cc.

Referenced by produce().

◆ pfEGConfigInfo_

const PFEGammaAlgo::PFEGConfigInfo PFEGammaProducer::pfEGConfigInfo_
private

particle flow algorithm configuration

Definition at line 60 of file PFEGammaProducer.cc.

Referenced by produce().

◆ superClusterCollectionPutToken_

const edm::EDPutTokenT<reco::SuperClusterCollection> PFEGammaProducer::superClusterCollectionPutToken_
private

Definition at line 54 of file PFEGammaProducer.cc.

Referenced by produce().

◆ vertices_

const edm::EDGetTokenT<reco::VertexCollection> PFEGammaProducer::vertices_
private

Definition at line 50 of file PFEGammaProducer.cc.

Referenced by produce().

reco::Track::outerPosition
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:62
reco::Track::outerMomentum
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
Definition: Track.h:65
reco::Conversion
Definition: Conversion.h:23
reco::PFBlockElement::HO
Definition: PFBlockElement.h:42
mps_fire.i
i
Definition: mps_fire.py:428
PFEGammaProducer::createSingleLegConversions
reco::ConversionCollection createSingleLegConversions(reco::PFCandidateEGammaExtraCollection &extras, const edm::RefProd< reco::ConversionCollection > &convProd) const
Definition: PFEGammaProducer.cc:308
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
ESChannelStatusRcd
Definition: ESChannelStatusRcd.h:5
PFEGammaProducer::superClusterCollectionPutToken_
const edm::EDPutTokenT< reco::SuperClusterCollection > superClusterCollectionPutToken_
Definition: PFEGammaProducer.cc:54
PFEGammaProducer::pfEGConfigInfo_
const PFEGammaAlgo::PFEGConfigInfo pfEGConfigInfo_
particle flow algorithm configuration
Definition: PFEGammaProducer.cc:60
PFEGammaProducer::caloClusterCollectionEBEEPutToken_
const edm::EDPutTokenT< reco::CaloClusterCollection > caloClusterCollectionEBEEPutToken_
Definition: PFEGammaProducer.cc:55
reco::PFBlockElement::SC
Definition: PFBlockElement.h:41
LOGDRESSED
#define LOGDRESSED(x)
Definition: PFEGammaProducer.cc:70
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89353
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
PFEGammaAlgo::PFEGConfigInfo::mvaEleCut
double mvaEleCut
Definition: PFEGammaAlgo.h:111
cms::cuda::assert
assert(be >=bs)
edm::PtrVectorItr
Definition: PtrVector.h:51
PFEGammaProducer::vertices_
const edm::EDGetTokenT< reco::VertexCollection > vertices_
Definition: PFEGammaProducer.cc:50
reco::PFBlockElement::HCAL
Definition: PFBlockElement.h:36
PFEGammaProducer::eetopsSrc_
const edm::EDGetTokenT< reco::PFCluster::EEtoPSAssociation > eetopsSrc_
Definition: PFEGammaProducer.cc:49
PFEGammaProducer::gbrForests_
const PFEGammaAlgo::GBRForests gbrForests_
Definition: PFEGammaProducer.cc:61
relativeConstraints.error
error
Definition: relativeConstraints.py:53
reco::PFCandidateEGammaExtra
Definition: PFCandidateEGammaExtra.h:25
reco::PFCandidateEGammaExtraCollection
std::vector< reco::PFCandidateEGammaExtra > PFCandidateEGammaExtraCollection
collection of PFCandidateEGammaExtras
Definition: PFCandidateEGammaExtraFwd.h:12
reco::PFCandidateEGammaExtra::setSuperClusterRef
void setSuperClusterRef(reco::SuperClusterRef sc)
set reference to the corresponding supercluster
Definition: PFCandidateEGammaExtra.h:108
edm::Ref< ConversionCollection >
reco::ConversionCollection
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
Definition: ConversionFwd.h:9
edm::refToPtr
Ptr< typename C::value_type > refToPtr(Ref< C, typename C::value_type, refhelper::FindUsingAdvance< C, typename C::value_type > > const &ref)
Definition: RefToPtr.h:18
PFEGammaProducer::inputTagBlocks_
const edm::EDGetTokenT< reco::PFBlockCollection > inputTagBlocks_
Definition: PFEGammaProducer.cc:48
BeamMonitor_cff.primaryVertex
primaryVertex
hltOfflineBeamSpot for HLTMON
Definition: BeamMonitor_cff.py:7
reco::SuperClusterCollection
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
Definition: SuperClusterFwd.h:9
edm::FileInPath
Definition: FileInPath.h:64
reco::Track::innerMomentum
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
Definition: Track.h:59
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
ESEEIntercalibConstantsRcd
Definition: ESEEIntercalibConstantsRcd.h:5
edm::PtrVector< CaloCluster >
reco::CaloCluster
Definition: CaloCluster.h:31
reco::CaloClusterCollection
std::vector< CaloCluster > CaloClusterCollection
collection of CaloCluster objects
Definition: CaloClusterFwd.h:19
reco::Track
Definition: Track.h:27
str
#define str(s)
Definition: TestProcessor.cc:51
edm::ESHandle< ESEEIntercalibConstants >
reco::CaloCluster::badHcalMarker
Definition: CaloCluster.h:50
PFEGammaProducer::caloClusterCollectionESPutToken_
const edm::EDPutTokenT< reco::CaloClusterCollection > caloClusterCollectionESPutToken_
Definition: PFEGammaProducer.cc:56
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
edm::PtrVector::push_back
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:149
reco::PFBlockElement::HFEM
Definition: PFBlockElement.h:39
zMuMuMuonUserData.primaryVertices
primaryVertices
Definition: zMuMuMuonUserData.py:12
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:39
reco::PFBlockElement::ECAL
Definition: PFBlockElement.h:35
cand
Definition: decayParser.h:32
reco::Track::innerPosition
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:56
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
iEvent
int iEvent
Definition: GenABIO.cc:224
reco::TrackBase::d0
double d0() const
dxy parameter in perigee convention (d0 = -dxy)
Definition: TrackBase.h:611
reco::PFBlockElement::HFHAD
Definition: PFBlockElement.h:40
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
get
#define get
edm::Ptr
Definition: AssociationVector.h:31
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
PFEGammaProducer::conversionCollectionPutToken_
const edm::EDPutTokenT< reco::ConversionCollection > conversionCollectionPutToken_
Definition: PFEGammaProducer.cc:57
bookConverter.elements
elements
Definition: bookConverter.py:147
eostools.move
def move(src, dest)
Definition: eostools.py:511
math::Error::type
ErrorD< N >::type type
Definition: Error.h:32
Exception
Definition: hltDiff.cc:246
reco::PFCandidateCollection
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
Definition: PFCandidateFwd.h:12
math::XYZVectorF
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float > > XYZVectorF
spatial vector with cartesian internal representation
Definition: Vector3D.h:16
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
PFEGammaAlgo
Definition: PFEGammaAlgo.h:62
HLT_FULL_cff.applyCrackCorrections
applyCrackCorrections
Definition: HLT_FULL_cff.py:13465
reco::PFBlockElement::PS1
Definition: PFBlockElement.h:33
math::XYZPointF
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
Definition: Point3D.h:10
HLT_FULL_cff.flags
flags
Definition: HLT_FULL_cff.py:13216
PFEGammaProducer::pfCandidateEGammaExtraCollectionPutToken_
const edm::EDPutTokenT< reco::PFCandidateEGammaExtraCollection > pfCandidateEGammaExtraCollectionPutToken_
Definition: PFEGammaProducer.cc:53
PFEGammaProducer::pfCandidateCollectionPutToken_
const edm::EDPutTokenT< reco::PFCandidateCollection > pfCandidateCollectionPutToken_
Definition: PFEGammaProducer.cc:52
gather_cfg.blocks
blocks
Definition: gather_cfg.py:90
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
edm::InputTag
Definition: InputTag.h:15
reco::Vertex
Definition: Vertex.h:35
reco::PFBlockElement::PS2
Definition: PFBlockElement.h:34
edm::OwnVector< reco::PFBlockElement >
reco::Conversion::pflow
Definition: Conversion.h:25