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

#include <PFEGammaProducer.h>

Inheritance diagram for PFEGammaProducer:
edm::stream::EDProducer< edm::GlobalCache< pfEGHelpers::HeavyObjectCache > >

Public Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &) override
 
 PFEGammaProducer (const edm::ParameterSet &, const pfEGHelpers::HeavyObjectCache *)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~PFEGammaProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< pfEGHelpers::HeavyObjectCache > >
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
static void globalEndJob (pfEGHelpers::HeavyObjectCache const *)
 
static std::unique_ptr< pfEGHelpers::HeavyObjectCacheinitializeGlobalCache (const edm::ParameterSet &conf)
 

Private Member Functions

void createSingleLegConversions (reco::PFCandidateEGammaExtraCollection &extras, reco::ConversionCollection &oneLegConversions, const edm::RefProd< reco::ConversionCollection > &convProd)
 
void setPFEGParameters (PFEGammaAlgo::PFEGConfigInfo &)
 
void setPFVertexParameters (reco::VertexCollection const &primaryVertices)
 

Private Attributes

const std::string ebeeClustersCollection_
 
const edm::EDGetTokenT< reco::PFCluster::EEtoPSAssociationeetopsSrc_
 
const std::string esClustersCollection_
 
const edm::EDGetTokenT< reco::PFBlockCollectioninputTagBlocks_
 
std::unique_ptr< PFEGammaAlgopfeg_
 particle flow algorithm More...
 
reco::Vertex primaryVertex_
 Variables for PFEGamma. More...
 
const bool useVerticesForNeutral_
 
const edm::EDGetTokenT< reco::VertexCollectionvertices_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< pfEGHelpers::HeavyObjectCache > >
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

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 42 of file PFEGammaProducer.h.

Constructor & Destructor Documentation

PFEGammaProducer::PFEGammaProducer ( const edm::ParameterSet iConfig,
const pfEGHelpers::HeavyObjectCache  
)
explicit

Definition at line 36 of file PFEGammaProducer.cc.

References PFEGammaAlgo::PFEGConfigInfo::applyCrackCorrections, ebeeClustersCollection_, esClustersCollection_, edm::ParameterSet::getParameter(), PFEGammaAlgo::PFEGConfigInfo::mvaConvCut, PFEGammaAlgo::PFEGConfigInfo::mvaEleCut, PFEGammaAlgo::PFEGConfigInfo::produceEGCandsWithNoSuperCluster, setPFEGParameters(), and PFEGammaAlgo::PFEGConfigInfo::thePFEnergyCalibration.

38  : inputTagBlocks_ (consumes<reco::PFBlockCollection>(iConfig.getParameter<edm::InputTag>("blocks")))
39  , eetopsSrc_ (consumes<reco::PFCluster::EEtoPSAssociation>(
40  iConfig.getParameter<edm::InputTag>("EEtoPS_source")))
41  , vertices_ (consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("vertexCollection")))
42  , useVerticesForNeutral_ (iConfig.getParameter<bool>("useVerticesForNeutral"))
44  , ebeeClustersCollection_("EBEEClusters")
45  , esClustersCollection_ ("ESClusters")
46 {
47 
48  PFEGammaAlgo::PFEGConfigInfo algo_config;
49 
51  iConfig.getParameter<bool>("produceEGCandsWithNoSuperCluster");
52 
53  // register products
54  produces<reco::PFCandidateCollection>();
55  produces<reco::PFCandidateEGammaExtraCollection>();
56  produces<reco::SuperClusterCollection>();
57  produces<reco::CaloClusterCollection>(ebeeClustersCollection_);
58  produces<reco::CaloClusterCollection>(esClustersCollection_);
59  produces<reco::ConversionCollection>();
60 
61  //PFElectrons Configuration
62  algo_config.mvaEleCut
63  = iConfig.getParameter<double>("pf_electron_mvaCut");
64 
65 
66  algo_config.applyCrackCorrections
67  = iConfig.getParameter<bool>("pf_electronID_crackCorrection");
68 
69  algo_config.mvaConvCut = iConfig.getParameter<double>("pf_conv_mvaCut");
70 
71  algo_config.thePFEnergyCalibration.reset(new PFEnergyCalibration());
72 
73  //PFEGamma
74  setPFEGParameters(algo_config);
75 
76 }
const std::string esClustersCollection_
T getParameter(std::string const &) const
const std::string ebeeClustersCollection_
const bool useVerticesForNeutral_
std::shared_ptr< PFEnergyCalibration > thePFEnergyCalibration
Definition: PFEGammaAlgo.h:110
reco::Vertex primaryVertex_
Variables for PFEGamma.
void setPFEGParameters(PFEGammaAlgo::PFEGConfigInfo &)
const edm::EDGetTokenT< reco::PFCluster::EEtoPSAssociation > eetopsSrc_
const edm::EDGetTokenT< reco::VertexCollection > vertices_
const edm::EDGetTokenT< reco::PFBlockCollection > inputTagBlocks_
PFEGammaProducer::~PFEGammaProducer ( )
inlineoverride

Definition at line 46 of file PFEGammaProducer.h.

46 {}

Member Function Documentation

void PFEGammaProducer::beginRun ( const edm::Run ,
const edm::EventSetup  
)
inlineoverride
void PFEGammaProducer::createSingleLegConversions ( reco::PFCandidateEGammaExtraCollection extras,
reco::ConversionCollection oneLegConversions,
const edm::RefProd< reco::ConversionCollection > &  convProd 
)
private

Definition at line 350 of file PFEGammaProducer.cc.

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 beginRun(), and produce().

353 {
354 
356  for (auto &extra : extras){
357  for (const auto &tkrefmva : extra.singleLegConvTrackRefMva()) {
358  const reco::Track &trk = *tkrefmva.first;
359 
360  const reco::Vertex convVtx(trk.innerPosition(), error);
361  std::vector<reco::TrackRef> OneLegConvVector;
362  OneLegConvVector.push_back(tkrefmva.first);
363  std::vector< float > OneLegMvaVector;
364  OneLegMvaVector.push_back(tkrefmva.second);
365  std::vector<reco::CaloClusterPtr> dummymatchingBC;
367  scPtrVec.push_back(edm::refToPtr(extra.superClusterRef()));
368 
369  std::vector<math::XYZPointF>trackPositionAtEcalVec;
370  std::vector<math::XYZPointF>innPointVec;
371  std::vector<math::XYZVectorF>trackPinVec;
372  std::vector<math::XYZVectorF>trackPoutVec;
373  math::XYZPointF trackPositionAtEcal(trk.outerPosition().X(), trk.outerPosition().Y(), trk.outerPosition().Z());
374  trackPositionAtEcalVec.push_back(trackPositionAtEcal);
375 
376  math::XYZPointF innPoint(trk.innerPosition().X(), trk.innerPosition().Y(), trk.innerPosition().Z());
377  innPointVec.push_back(innPoint);
378 
379  math::XYZVectorF trackPin(trk.innerMomentum().X(), trk.innerMomentum().Y(), trk.innerMomentum().Z());
380  trackPinVec.push_back(trackPin);
381 
382  math::XYZVectorF trackPout(trk.outerMomentum().X(), trk.outerMomentum().Y(), trk.outerMomentum().Z());
383  trackPoutVec.push_back( trackPout );
384 
385  float DCA = trk.d0() ;
386  float mvaval = tkrefmva.second;
387  reco::Conversion singleLegConvCandidate(scPtrVec,
388  OneLegConvVector,
389  trackPositionAtEcalVec,
390  convVtx,
391  dummymatchingBC,
392  DCA,
393  innPointVec,
394  trackPinVec,
395  trackPoutVec,
396  mvaval,
398  singleLegConvCandidate.setOneLegMVA(OneLegMvaVector);
399  oneLegConversions.push_back(singleLegConvCandidate);
400 
401  reco::ConversionRef convref(convProd,oneLegConversions.size()-1);
402  extra.addSingleLegConversionRef(convref);
403 
404  }
405 
406  }
407 
408 }
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
double d0() const
dxy parameter in perigee convention (d0 = -dxy)
Definition: TrackBase.h:636
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:140
ErrorD< N >::type type
Definition: Error.h:33
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
Definition: Point3D.h:10
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:67
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:57
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float > > XYZVectorF
spatial vector with cartesian internal representation
Definition: Vector3D.h:17
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
Definition: Track.h:72
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
Definition: Track.h:62
void PFEGammaProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 410 of file PFEGammaProducer.cc.

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

Referenced by beginRun().

410  {
412  desc.add<bool> ("useVerticesForNeutral", true);
413  desc.add<bool> ("produceEGCandsWithNoSuperCluster", false)->setComment("Allow building of candidates with no input or output supercluster?");
414  desc.add<double>("pf_electron_mvaCut", -0.1);
415  desc.add<bool> ("pf_electronID_crackCorrection", false);
416  desc.add<double>("pf_conv_mvaCut", 0.0);
417  desc.add<edm::InputTag> ("blocks", edm::InputTag("particleFlowBlock"))->setComment("PF Blocks label");
418  desc.add<edm::InputTag> ("EEtoPS_source", edm::InputTag("particleFlowClusterECAL"))->setComment("EE to PS association");
419  desc.add<edm::InputTag> ("vertexCollection", edm::InputTag("offlinePrimaryVertices"));
420  desc.add<edm::FileInPath>("pf_electronID_mvaWeightFile",
421  edm::FileInPath("RecoParticleFlow/PFProducer/data/PfElectrons23Jan_BDT.weights.xml.gz"));
422  desc.add<edm::FileInPath>("pf_convID_mvaWeightFile",
423  edm::FileInPath("RecoParticleFlow/PFProducer/data/pfConversionAug0411_BDT.weights.xml.gz"));
424  descriptions.add("particleFlowEGamma", desc);
425 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void PFEGammaProducer::globalEndJob ( pfEGHelpers::HeavyObjectCache const *  )
inlinestatic

Definition at line 53 of file PFEGammaProducer.h.

References produce().

53 {}
static std::unique_ptr<pfEGHelpers::HeavyObjectCache> PFEGammaProducer::initializeGlobalCache ( const edm::ParameterSet conf)
inlinestatic

Definition at line 49 of file PFEGammaProducer.h.

49  {
50  return std::unique_ptr<pfEGHelpers::HeavyObjectCache>(new pfEGHelpers::HeavyObjectCache(conf));
51  }
void PFEGammaProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 79 of file PFEGammaProducer.cc.

References reco::CaloCluster::badHcalMarker, gather_cfg::blocks, fastPrimaryVertexProducer_cfi::clusters, createSingleLegConversions(), TauDecayModes::dec, ebeeClustersCollection_, reco::PFBlockElement::ECAL, eetopsSrc_, allElectronIsolations_cfi::elements, esClustersCollection_, edm::EventID::event(), Exception, flags, edm::EventSetup::get(), edm::Event::get(), edm::Event::getHandle(), edm::Event::getRefBeforePut(), reco::PFBlockElement::HCAL, reco::PFBlockElement::HFEM, reco::PFBlockElement::HFHAD, reco::PFBlockElement::HO, mps_fire::i, edm::EventBase::id(), inputTagBlocks_, LOGDRESSED, eostools::move(), pfeg_, edm::ESHandle< T >::product(), reco::PFBlockElement::PS1, reco::PFBlockElement::PS2, edm::PtrVector< T >::push_back(), edm::Event::put(), edm::EventID::run(), SimDataFormats::CaloAnalysis::sc, reco::PFBlockElement::SC, reco::PFCandidate::setPFEGammaExtraRef(), setPFVertexParameters(), reco::PFCandidateEGammaExtra::setSuperClusterRef(), reco::PFCandidate::setSuperClusterRef(), edm::OwnVector< T, P >::size(), str, and vertices_.

Referenced by globalEndJob().

80  {
81 
82  LOGDRESSED("PFEGammaProducer")
83  <<"START event: "
84  <<iEvent.id().event()
85  <<" in run "<<iEvent.id().run()<<std::endl;
86 
87 
88  // output collections
89  auto egCandidates_ = std::make_unique<reco::PFCandidateCollection>();
90  auto egExtra_ = std::make_unique<reco::PFCandidateEGammaExtraCollection>();
91  auto sClusters_ = std::make_unique<reco::SuperClusterCollection>();
92 
93  // Get the EE-PS associations
94  pfeg_->setEEtoPSAssociation(iEvent.get(eetopsSrc_));
95 
96  // preshower conditions
97  edm::ESHandle<ESEEIntercalibConstants> esEEInterCalibHandle_;
98  iSetup.get<ESEEIntercalibConstantsRcd>().get(esEEInterCalibHandle_);
99  pfeg_->setAlphaGamma_ESplanes_fromDB(esEEInterCalibHandle_.product());
100 
101  edm::ESHandle<ESChannelStatus> esChannelStatusHandle_;
102  iSetup.get<ESChannelStatusRcd>().get(esChannelStatusHandle_);
103  pfeg_->setESChannelStatus(esChannelStatusHandle_.product());
104 
105  //Assign the PFAlgo Parameters
107 
108  // get the collection of blocks
109 
110  LOGDRESSED("PFEGammaProducer")<<"getting blocks"<<std::endl;
111  auto blocks = iEvent.getHandle( inputTagBlocks_);
112 
113  LOGDRESSED("PFEGammaProducer")
114  <<"EGPFlow is starting..."<<std::endl;
115 
116 #ifdef PFLOW_DEBUG
117  assert( blocks.isValid() && "edm::Handle to blocks was null!");
118  std::ostringstream str;
119  //str<<(*pfAlgo_)<<std::endl;
120  // cout << (*pfAlgo_) << std::endl;
121  LOGDRESSED("PFEGammaProducer") <<str.str()<<std::endl;
122 #endif
123 
124  // sort elements in three lists:
125  std::list< reco::PFBlockRef > hcalBlockRefs;
126  std::list< reco::PFBlockRef > ecalBlockRefs;
127  std::list< reco::PFBlockRef > hoBlockRefs;
128  std::list< reco::PFBlockRef > otherBlockRefs;
129 
130  for( unsigned i=0; i<blocks->size(); ++i ) {
131  // reco::PFBlockRef blockref( blockh,i );
132  //reco::PFBlockRef blockref = createBlockRef( *blocks, i);
133  reco::PFBlockRef blockref(blocks, i);
134 
136  elements = blockref->elements();
137 
138  LOGDRESSED("PFEGammaProducer")
139  << "Found " << elements.size()
140  << " PFBlockElements in block: " << i << std::endl;
141 
142  bool singleEcalOrHcal = false;
143  if( elements.size() == 1 ){
144  switch( elements[0].type() ) {
146  edm::LogError("PFEGammaProducer")
147  << "PFBLOCKALGO BUG!!!! Found a SuperCluster in a block by itself!";
151  ecalBlockRefs.push_back( blockref );
152  singleEcalOrHcal = true;
153  break;
157  if (elements[0].clusterRef()->flags() & reco::CaloCluster::badHcalMarker) continue;
158  hcalBlockRefs.push_back( blockref );
159  singleEcalOrHcal = true;
160  break;
162  // Single HO elements are likely to be noise. Not considered for now.
163  hoBlockRefs.push_back( blockref );
164  singleEcalOrHcal = true;
165  break;
166  default:
167  break;
168  }
169  }
170 
171  if(!singleEcalOrHcal) {
172  otherBlockRefs.push_back( blockref );
173  }
174  }//loop blocks
175 
176  // loop on blocks that are not single ecal, single ps1, single ps2 , or
177  // single hcal and produce unbiased collection of EGamma Candidates
178 
179  //printf("loop over blocks\n");
180  unsigned nblcks = 0;
181 
182  // this auto is a const reco::PFBlockRef&
183  for( const auto& blockref : otherBlockRefs ) {
184  ++nblcks;
185  // this auto is a: const edm::OwnVector< reco::PFBlockElement >&
186  const auto& elements = blockref->elements();
187  // make a copy of the link data, which will be edited.
188  //PFBlock::LinkData linkData = block.linkData();
189 
190  pfeg_->buildAndRefineEGObjects(globalCache(),blockref);
191 
192  if( !pfeg_->getCandidates().empty() ) {
193  LOGDRESSED("PFEGammaProducer")
194  << "Block with " << elements.size()
195  << " elements produced "
196  << pfeg_->getCandidates().size()
197  << " e-g candidates!" << std::endl;
198  }
199 
200  const size_t egsize = egCandidates_->size();
201  egCandidates_->resize(egsize + pfeg_->getCandidates().size());
202  reco::PFCandidateCollection::iterator eginsertfrom =
203  egCandidates_->begin() + egsize;
204  std::move(pfeg_->getCandidates().begin(),
205  pfeg_->getCandidates().end(),
206  eginsertfrom);
207 
208  const size_t egxsize = egExtra_->size();
209  egExtra_->resize(egxsize + pfeg_->getEGExtra().size());
210  reco::PFCandidateEGammaExtraCollection::iterator egxinsertfrom =
211  egExtra_->begin() + egxsize;
212  std::move(pfeg_->getEGExtra().begin(),
213  pfeg_->getEGExtra().end(),
214  egxinsertfrom);
215 
216  const size_t rscsize = sClusters_->size();
217  sClusters_->resize(rscsize + pfeg_->getRefinedSCs().size());
218  reco::SuperClusterCollection::iterator rscinsertfrom =
219  sClusters_->begin() + rscsize;
220  std::move(pfeg_->getRefinedSCs().begin(),
221  pfeg_->getRefinedSCs().end(),
222  rscinsertfrom);
223  }
224 
225  LOGDRESSED("PFEGammaProducer")
226  << "Running PFEGammaAlgo on all blocks produced = "
227  << egCandidates_->size() << " e-g candidates!"
228  << std::endl;
229 
232 
235 
236  //set the correct references to refined SC and EG extra using the refprods
237  for (unsigned int i=0; i < egCandidates_->size(); ++i) {
238  reco::PFCandidate &cand = egCandidates_->at(i);
239  reco::PFCandidateEGammaExtra &xtra = egExtra_->at(i);
240 
241  reco::PFCandidateEGammaExtraRef extraref(egXtraProd,i);
242  reco::SuperClusterRef refinedSCRef(sClusterProd,i);
243 
244  xtra.setSuperClusterRef(refinedSCRef);
245  cand.setSuperClusterRef(refinedSCRef);
246  cand.setPFEGammaExtraRef(extraref);
247  }
248 
249  //build collections of output CaloClusters from the used PFClusters
250  auto caloClustersEBEE = std::make_unique<reco::CaloClusterCollection>();
251  auto caloClustersES = std::make_unique<reco::CaloClusterCollection>();
252 
253  std::map<edm::Ptr<reco::CaloCluster>, unsigned int> pfClusterMapEBEE; //maps of pfclusters to caloclusters
254  std::map<edm::Ptr<reco::CaloCluster>, unsigned int> pfClusterMapES;
255 
256  for( const auto& sc : *sClusters_ ) {
257  for (reco::CaloCluster_iterator pfclus = sc.clustersBegin(); pfclus!=sc.clustersEnd(); ++pfclus) {
258  if (!pfClusterMapEBEE.count(*pfclus)) {
259  reco::CaloCluster caloclus(**pfclus);
260  caloClustersEBEE->push_back(caloclus);
261  pfClusterMapEBEE[*pfclus] = caloClustersEBEE->size() - 1;
262  }
263  else {
264  throw cms::Exception("PFEgammaProducer::produce")
265  << "Found an EB/EE pfcluster matched to more than one supercluster!"
266  << std::dec << std::endl;
267  }
268  }
269  for (reco::CaloCluster_iterator pfclus = sc.preshowerClustersBegin(); pfclus!=sc.preshowerClustersEnd(); ++pfclus) {
270  if (!pfClusterMapES.count(*pfclus)) {
271  reco::CaloCluster caloclus(**pfclus);
272  caloClustersES->push_back(caloclus);
273  pfClusterMapES[*pfclus] = caloClustersES->size() - 1;
274  }
275  else {
276  throw cms::Exception("PFEgammaProducer::produce")
277  << "Found an ES pfcluster matched to more than one supercluster!"
278  << std::dec << std::endl;
279  }
280  }
281  }
282 
283  //put calocluster output collections in event and get orphan handles to create ptrs
284  auto const& caloClusHandleEBEE = iEvent.put(std::move(caloClustersEBEE),ebeeClustersCollection_);
285  auto const& caloClusHandleES = iEvent.put(std::move(caloClustersES),esClustersCollection_);
286 
287  //relink superclusters to output caloclusters
288  for( auto& sc : *sClusters_ ) {
289  edm::Ptr<reco::CaloCluster> seedptr(caloClusHandleEBEE,pfClusterMapEBEE[sc.seed()]);
290  sc.setSeed(seedptr);
291 
293  for (reco::CaloCluster_iterator pfclus = sc.clustersBegin(); pfclus!=sc.clustersEnd(); ++pfclus) {
294  edm::Ptr<reco::CaloCluster> clusptr(caloClusHandleEBEE,pfClusterMapEBEE[*pfclus]);
295  clusters.push_back(clusptr);
296  }
297  sc.setClusters(clusters);
298 
299  reco::CaloClusterPtrVector psclusters;
300  for (reco::CaloCluster_iterator pfclus = sc.preshowerClustersBegin(); pfclus!=sc.preshowerClustersEnd(); ++pfclus) {
301  edm::Ptr<reco::CaloCluster> clusptr(caloClusHandleES,pfClusterMapES[*pfclus]);
302  psclusters.push_back(clusptr);
303  }
304  sc.setPreshowerClusters(psclusters);
305  }
306 
307  //create and fill references to single leg conversions
309  auto singleLegConv_ = std::make_unique<reco::ConversionCollection>();
310  createSingleLegConversions(*egExtra_, *singleLegConv_, convProd);
311 
312  // release our demonspawn into the wild to cause havoc
313  iEvent.put(std::move(sClusters_));
314  iEvent.put(std::move(egExtra_));
315  iEvent.put(std::move(singleLegConv_));
316  iEvent.put(std::move(egCandidates_));
317 }
RunNumber_t run() const
Definition: EventID.h:39
const std::string esClustersCollection_
type
Definition: HCALResponse.h:21
EventNumber_t event() const
Definition: EventID.h:41
const std::string ebeeClustersCollection_
void createSingleLegConversions(reco::PFCandidateEGammaExtraCollection &extras, reco::ConversionCollection &oneLegConversions, const edm::RefProd< reco::ConversionCollection > &convProd)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
void setSuperClusterRef(reco::SuperClusterRef sc)
set reference to the corresponding supercluster
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:140
size_type size() const
Definition: OwnVector.h:264
void setPFVertexParameters(reco::VertexCollection const &primaryVertices)
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
Definition: ConversionFwd.h:9
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
Definition: Event.h:539
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
std::vector< reco::PFCandidateEGammaExtra > PFCandidateEGammaExtraCollection
collection of PFCandidateEGammaExtras
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:326
RefProd< PROD > getRefBeforePut()
Definition: Event.h:150
const edm::EDGetTokenT< reco::PFCluster::EEtoPSAssociation > eetopsSrc_
std::unique_ptr< PFEGammaAlgo > pfeg_
particle flow algorithm
const edm::EDGetTokenT< reco::VertexCollection > vertices_
const edm::EDGetTokenT< reco::PFBlockCollection > inputTagBlocks_
edm::EventID id() const
Definition: EventBase.h:59
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:40
#define LOGDRESSED(x)
T get() const
Definition: EventSetup.h:71
void setPFEGammaExtraRef(const reco::PFCandidateEGammaExtraRef &ref)
set the PF EGamma Extra Ref
Definition: PFCandidate.cc:650
void setSuperClusterRef(const reco::SuperClusterRef &scRef)
Definition: PFCandidate.cc:629
#define str(s)
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:511
void PFEGammaProducer::setPFEGParameters ( PFEGammaAlgo::PFEGConfigInfo cfg)
private

Definition at line 321 of file PFEGammaProducer.cc.

References MillePedeFileConverter_cfg::e, AlCaHLTBitMon_ParallelJobs::p, pfeg_, primaryVertex_, PFEGammaAlgo::PFEGConfigInfo::primaryVtx, and useVerticesForNeutral_.

Referenced by beginRun(), and PFEGammaProducer().

321  {
322 
323  //for MVA pass PV if there is one in the collection otherwise pass a dummy
324  if(!useVerticesForNeutral_) { // create a dummy PV
326  e(0, 0) = 0.0015 * 0.0015;
327  e(1, 1) = 0.0015 * 0.0015;
328  e(2, 2) = 15. * 15.;
329  reco::Vertex::Point p(0, 0, 0);
330  primaryVertex_ = reco::Vertex(p, e, 0, 0, 0);
331  }
332  cfg.primaryVtx = &primaryVertex_;
333  pfeg_.reset(new PFEGammaAlgo(cfg));
334 }
const bool useVerticesForNeutral_
math::Error< dimension >::type Error
covariance error matrix (3x3)
Definition: Vertex.h:43
const reco::Vertex * primaryVtx
Definition: PFEGammaAlgo.h:114
reco::Vertex primaryVertex_
Variables for PFEGamma.
math::XYZPoint Point
point in the space
Definition: Vertex.h:39
std::unique_ptr< PFEGammaAlgo > pfeg_
particle flow algorithm
void PFEGammaProducer::setPFVertexParameters ( reco::VertexCollection const &  primaryVertices)
private

Definition at line 337 of file PFEGammaProducer.cc.

References pfeg_, primaryVertex_, and MetAnalyzer::pv().

Referenced by beginRun(), and produce().

338 {
340  for(auto const& pv : primaryVertices) {
341  if(pv.isValid() && !pv.isFake()) {
342  primaryVertex_ = pv;
343  break;
344  }
345  }
346 
347  pfeg_->setPhotonPrimaryVtx(primaryVertex_ );
348 }
def pv(vc)
Definition: MetAnalyzer.py:7
reco::Vertex primaryVertex_
Variables for PFEGamma.
primaryVertices
Definition: jets_cff.py:24
std::unique_ptr< PFEGammaAlgo > pfeg_
particle flow algorithm

Member Data Documentation

const std::string PFEGammaProducer::ebeeClustersCollection_
private

Definition at line 85 of file PFEGammaProducer.h.

Referenced by PFEGammaProducer(), and produce().

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

Definition at line 72 of file PFEGammaProducer.h.

Referenced by produce().

const std::string PFEGammaProducer::esClustersCollection_
private

Definition at line 86 of file PFEGammaProducer.h.

Referenced by PFEGammaProducer(), and produce().

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

Definition at line 71 of file PFEGammaProducer.h.

Referenced by produce().

std::unique_ptr<PFEGammaAlgo> PFEGammaProducer::pfeg_
private

particle flow algorithm

Definition at line 83 of file PFEGammaProducer.h.

Referenced by produce(), setPFEGParameters(), and setPFVertexParameters().

reco::Vertex PFEGammaProducer::primaryVertex_
private

Variables for PFEGamma.

Definition at line 80 of file PFEGammaProducer.h.

Referenced by setPFEGParameters(), and setPFVertexParameters().

const bool PFEGammaProducer::useVerticesForNeutral_
private

Definition at line 76 of file PFEGammaProducer.h.

Referenced by setPFEGParameters().

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

Definition at line 73 of file PFEGammaProducer.h.

Referenced by produce().