CMS 3D CMS Logo

PFPhotonTranslator.cc
Go to the documentation of this file.
26 
27 class CaloGeometry;
28 class CaloTopology;
29 class DetId;
30 namespace edm {
31  class EventSetup;
32 } // namespace edm
33 
35 public:
36  explicit PFPhotonTranslator(const edm::ParameterSet &);
37  ~PFPhotonTranslator() override;
38 
39  void produce(edm::Event &, const edm::EventSetup &) override;
40 
41  typedef std::vector<edm::Handle<edm::ValueMap<double> > > IsolationValueMaps;
42 
43 private:
44  // to retrieve the collection from the event
46  const edm::InputTag &tag,
47  const edm::Event &iEvent) const;
48 
49  // makes a basic cluster from PFBlockElement and add it to the collection ; the corrected energy is taken
50  // from the PFCandidate
52  reco::BasicClusterCollection &basicClusters,
53  std::vector<const reco::PFCluster *> &,
54  const reco::PFCandidate &coCandidate) const;
55  // makes a preshower cluster from of PFBlockElement and add it to the collection
57  reco::PreshowerClusterCollection &preshowerClusters,
58  unsigned plane) const;
59 
60  // create the basic cluster Ptr
62 
63  // create the preshower cluster Refs
65 
66  // make a super cluster from its ingredients and add it to the collection
68 
70  reco::ConversionCollection &oneLegConversions);
71 
72  //create photon cores
74  const edm::OrphanHandle<reco::ConversionCollection> &oneLegConversionHandle,
75  reco::PhotonCoreCollection &photonCores);
76 
79  const edm::OrphanHandle<reco::PhotonCoreCollection> &photonCoresHandle,
82 
84  const reco::PFBlockElement &pfbe) const;
85 
87  std::vector<edm::InputTag> inputTagIsoVals_;
100 
101  // the collection of basic clusters associated to a photon
102  std::vector<reco::BasicClusterCollection> basicClusters_;
103  // the correcsponding PFCluster ref
104  std::vector<std::vector<const reco::PFCluster *> > pfClusters_;
105  // the collection of preshower clusters associated to a photon
106  std::vector<reco::PreshowerClusterCollection> preshowerClusters_;
107  // the super cluster collection (actually only one) associated to a photon
108  std::vector<reco::SuperClusterCollection> superClusters_;
109  // the references to the basic clusters associated to a photon
110  std::vector<reco::CaloClusterPtrVector> basicClusterPtr_;
111  // the references to the basic clusters associated to a photon
112  std::vector<reco::CaloClusterPtrVector> preshowerClusterPtr_;
113  // keep track of the index of the PF Candidate
114  std::vector<int> photPFCandidateIndex_;
115  // the list of candidatePtr
116  std::vector<reco::CandidatePtr> CandidatePtr_;
117  // the e/g SC associated
118  std::vector<reco::SuperClusterRef> egSCRef_;
119  // the e/g photon associated
120  std::vector<reco::PhotonRef> egPhotonRef_;
121  // the PF MVA and regression
122  std::vector<float> pfPhotonMva_;
123  std::vector<float> energyRegression_;
124  std::vector<float> energyRegressionError_;
125 
126  //Vector of vector of Conversions Refs
127  std::vector<reco::ConversionRefVector> pfConv_;
128  std::vector<std::vector<reco::TrackRef> > pfSingleLegConv_;
129  std::vector<std::vector<float> > pfSingleLegConvMva_;
130 
131  std::vector<int> conv1legPFCandidateIndex_;
132  std::vector<int> conv2legPFCandidateIndex_;
133 
136 
137  // Mustache SC parameters
140 
142 };
143 
145 
146 using namespace edm;
147 using namespace std;
148 using namespace reco;
149 
153 
155  //std::cout << "PFPhotonTranslator" << std::endl;
156 
157  inputTagPFCandidates_ = iConfig.getParameter<edm::InputTag>("PFCandidate");
158 
159  edm::ParameterSet isoVals = iConfig.getParameter<edm::ParameterSet>("isolationValues");
160  inputTagIsoVals_.push_back(isoVals.getParameter<edm::InputTag>("pfChargedHadrons"));
161  inputTagIsoVals_.push_back(isoVals.getParameter<edm::InputTag>("pfPhotons"));
162  inputTagIsoVals_.push_back(isoVals.getParameter<edm::InputTag>("pfNeutralHadrons"));
163 
164  PFBasicClusterCollection_ = iConfig.getParameter<std::string>("PFBasicClusters");
165  PFPreshowerClusterCollection_ = iConfig.getParameter<std::string>("PFPreshowerClusters");
166  PFSuperClusterCollection_ = iConfig.getParameter<std::string>("PFSuperClusters");
167  PFConversionCollection_ = iConfig.getParameter<std::string>("PFConversionCollection");
168  PFPhotonCoreCollection_ = iConfig.getParameter<std::string>("PFPhotonCores");
169  PFPhotonCollection_ = iConfig.getParameter<std::string>("PFPhotons");
170 
171  EGPhotonCollection_ = iConfig.getParameter<std::string>("EGPhotons");
172 
173  vertexProducer_ = iConfig.getParameter<std::string>("primaryVertexProducer");
174 
175  barrelEcalHits_ = iConfig.getParameter<edm::InputTag>("barrelEcalHits");
176  endcapEcalHits_ = iConfig.getParameter<edm::InputTag>("endcapEcalHits");
177 
178  hcalTowers_ = iConfig.getParameter<edm::InputTag>("hcalTowers");
179  hOverEConeSize_ = iConfig.getParameter<double>("hOverEConeSize");
180 
181  if (iConfig.exists("emptyIsOk"))
182  emptyIsOk_ = iConfig.getParameter<bool>("emptyIsOk");
183  else
184  emptyIsOk_ = false;
185 
186  ecalMustacheSCParametersToken_ = esConsumes<EcalMustacheSCParameters, EcalMustacheSCParametersRcd>();
187 
188  produces<reco::BasicClusterCollection>(PFBasicClusterCollection_);
189  produces<reco::PreshowerClusterCollection>(PFPreshowerClusterCollection_);
190  produces<reco::SuperClusterCollection>(PFSuperClusterCollection_);
191  produces<reco::PhotonCoreCollection>(PFPhotonCoreCollection_);
192  produces<reco::PhotonCollection>(PFPhotonCollection_);
193  produces<reco::ConversionCollection>(PFConversionCollection_);
194 }
195 
197 
199  //cout << "NEW EVENT"<<endl;
200  mustacheSCParams_ = &iSetup.getData(ecalMustacheSCParametersToken_);
201 
202  auto basicClusters_p = std::make_unique<reco::BasicClusterCollection>();
203 
204  auto psClusters_p = std::make_unique<reco::PreshowerClusterCollection>();
205 
206  /*
207  auto SingleLeg_p = std::make_unique<reco::ConversionCollection>();
208  */
209 
210  reco::SuperClusterCollection outputSuperClusterCollection;
211  reco::ConversionCollection outputOneLegConversionCollection;
212  reco::PhotonCoreCollection outputPhotonCoreCollection;
214 
215  outputSuperClusterCollection.clear();
216  outputOneLegConversionCollection.clear();
217  outputPhotonCoreCollection.clear();
218  outputPhotonCollection.clear();
219 
221  bool status = fetchCandidateCollection(pfCandidates, inputTagPFCandidates_, iEvent);
222 
224  iEvent.getByLabel(EGPhotonCollection_, egPhotons);
225 
226  Handle<reco::VertexCollection> vertexHandle;
227 
228  IsolationValueMaps isolationValues(inputTagIsoVals_.size());
229  for (size_t j = 0; j < inputTagIsoVals_.size(); ++j) {
230  iEvent.getByLabel(inputTagIsoVals_[j], isolationValues[j]);
231  }
232 
233  // clear the vectors
234  photPFCandidateIndex_.clear();
235  basicClusters_.clear();
236  pfClusters_.clear();
237  preshowerClusters_.clear();
238  superClusters_.clear();
239  basicClusterPtr_.clear();
240  preshowerClusterPtr_.clear();
241  CandidatePtr_.clear();
242  egSCRef_.clear();
243  egPhotonRef_.clear();
244  pfPhotonMva_.clear();
245  energyRegression_.clear();
246  energyRegressionError_.clear();
247  pfConv_.clear();
248  pfSingleLegConv_.clear();
249  pfSingleLegConvMva_.clear();
250  conv1legPFCandidateIndex_.clear();
251  conv2legPFCandidateIndex_.clear();
252 
253  // loop on the candidates
254  //CC@@
255  // we need first to create AND put the SuperCluster,
256  // basic clusters and presh clusters collection
257  // in order to get a working Handle
258  unsigned ncand = (status) ? pfCandidates->size() : 0;
259 
260  unsigned iphot = 0;
261  unsigned iconv1leg = 0;
262  unsigned iconv2leg = 0;
263 
264  for (unsigned i = 0; i < ncand; ++i) {
265  const reco::PFCandidate &cand = (*pfCandidates)[i];
266  if (cand.particleId() != reco::PFCandidate::gamma)
267  continue;
268  //cout << "cand.mva_nothing_gamma()="<<cand. mva_nothing_gamma()<<endl;
269  if (cand.mva_nothing_gamma() > 0.001) //Found PFPhoton with PFPhoton Extras saved
270  {
271  //cout << "NEW PHOTON" << endl;
272 
273  //std::cout << "nDoubleLegConv="<<cand.photonExtraRef()->conversionRef().size()<<std::endl;
274 
275  if (!cand.photonExtraRef()->conversionRef().empty()) {
276  pfConv_.push_back(reco::ConversionRefVector());
277 
278  const reco::ConversionRefVector &doubleLegConvColl = cand.photonExtraRef()->conversionRef();
279  for (unsigned int iconv = 0; iconv < doubleLegConvColl.size(); iconv++) {
280  pfConv_[iconv2leg].push_back(doubleLegConvColl[iconv]);
281  }
282 
283  conv2legPFCandidateIndex_.push_back(iconv2leg);
284  iconv2leg++;
285  } else
286  conv2legPFCandidateIndex_.push_back(-1);
287 
288  const std::vector<reco::TrackRef> &singleLegConvColl = cand.photonExtraRef()->singleLegConvTrackRef();
289  const std::vector<float> &singleLegConvCollMva = cand.photonExtraRef()->singleLegConvMva();
290 
291  //std::cout << "nSingleLegConv=" <<singleLegConvColl.size() << std::endl;
292 
293  if (!singleLegConvColl.empty()) {
294  pfSingleLegConv_.push_back(std::vector<reco::TrackRef>());
295  pfSingleLegConvMva_.push_back(std::vector<float>());
296 
297  //cout << "nTracks="<< singleLegConvColl.size()<<endl;
298  for (unsigned int itk = 0; itk < singleLegConvColl.size(); itk++) {
299  //cout << "Track pt="<< singleLegConvColl[itk]->pt() <<endl;
300 
301  pfSingleLegConv_[iconv1leg].push_back(singleLegConvColl[itk]);
302  pfSingleLegConvMva_[iconv1leg].push_back(singleLegConvCollMva[itk]);
303  }
304 
305  conv1legPFCandidateIndex_.push_back(iconv1leg);
306 
307  iconv1leg++;
308  } else
309  conv1legPFCandidateIndex_.push_back(-1);
310  }
311 
312  photPFCandidateIndex_.push_back(i);
313  pfPhotonMva_.push_back(cand.mva_nothing_gamma());
314  energyRegression_.push_back(cand.photonExtraRef()->MVAGlobalCorrE());
315  energyRegressionError_.push_back(cand.photonExtraRef()->MVAGlobalCorrEError());
316  basicClusters_.push_back(reco::BasicClusterCollection());
317  pfClusters_.push_back(std::vector<const reco::PFCluster *>());
318  preshowerClusters_.push_back(reco::PreshowerClusterCollection());
319  superClusters_.push_back(reco::SuperClusterCollection());
320 
321  reco::PFCandidatePtr ptrToPFPhoton(pfCandidates, i);
322  CandidatePtr_.push_back(ptrToPFPhoton);
323  egSCRef_.push_back(cand.superClusterRef());
324  //std::cout << "PFPhoton cand " << iphot << std::endl;
325 
326  int iegphot = 0;
327  for (reco::PhotonCollection::const_iterator gamIter = egPhotons->begin(); gamIter != egPhotons->end(); ++gamIter) {
328  if (cand.superClusterRef() == gamIter->superCluster()) {
329  reco::PhotonRef PhotRef(reco::PhotonRef(egPhotons, iegphot));
330  egPhotonRef_.push_back(PhotRef);
331  }
332  iegphot++;
333  }
334 
335  //std::cout << "Cand elements in blocks : " << cand.elementsInBlocks().size() << std::endl;
336 
337  for (unsigned iele = 0; iele < cand.elementsInBlocks().size(); ++iele) {
338  // first get the block
339  reco::PFBlockRef blockRef = cand.elementsInBlocks()[iele].first;
340  //
341  unsigned elementIndex = cand.elementsInBlocks()[iele].second;
342  // check it actually exists
343  if (blockRef.isNull())
344  continue;
345 
346  // then get the elements of the block
347  const edm::OwnVector<reco::PFBlockElement> &elements = (*blockRef).elements();
348 
349  const reco::PFBlockElement &pfbe(elements[elementIndex]);
350  // The first ECAL element should be the cluster associated to the GSF; defined as the seed
351  if (pfbe.type() == reco::PFBlockElement::ECAL) {
352  //std::cout << "BlockElement ECAL" << std::endl;
353  // the Brem photons are saved as daughter PFCandidate; this
354  // is convenient to access the corrected energy
355  // std::cout << " Found candidate " << correspondingDaughterCandidate(coCandidate,pfbe) << " " << coCandidate << std::endl;
356  createBasicCluster(pfbe, basicClusters_[iphot], pfClusters_[iphot], correspondingDaughterCandidate(cand, pfbe));
357  }
358  if (pfbe.type() == reco::PFBlockElement::PS1) {
359  //std::cout << "BlockElement PS1" << std::endl;
360  createPreshowerCluster(pfbe, preshowerClusters_[iphot], 1);
361  }
362  if (pfbe.type() == reco::PFBlockElement::PS2) {
363  //std::cout << "BlockElement PS2" << std::endl;
364  createPreshowerCluster(pfbe, preshowerClusters_[iphot], 2);
365  }
366 
367  } // loop on the elements
368 
369  // save the basic clusters
370  basicClusters_p->insert(basicClusters_p->end(), basicClusters_[iphot].begin(), basicClusters_[iphot].end());
371  // save the preshower clusters
372  psClusters_p->insert(psClusters_p->end(), preshowerClusters_[iphot].begin(), preshowerClusters_[iphot].end());
373 
374  ++iphot;
375 
376  } // loop on PFCandidates
377 
378  //Save the basic clusters and get an handle as to be able to create valid Refs (thanks to Claude)
379  // std::cout << " Number of basic clusters " << basicClusters_p->size() << std::endl;
381  iEvent.put(std::move(basicClusters_p), PFBasicClusterCollection_);
382 
383  //preshower clusters
385  iEvent.put(std::move(psClusters_p), PFPreshowerClusterCollection_);
386 
387  // now that the Basic clusters are in the event, the Ref can be created
388  createBasicClusterPtrs(bcRefProd);
389  // now that the preshower clusters are in the event, the Ref can be created
390  createPreshowerClusterPtrs(psRefProd);
391 
392  // and now the Super cluster can be created with valid references
393  //if(status) createSuperClusters(*pfCandidates,*superClusters_p);
394  if (status)
395  createSuperClusters(*pfCandidates, outputSuperClusterCollection);
396 
397  //std::cout << "nb superclusters in collection : "<<outputSuperClusterCollection.size()<<std::endl;
398 
399  // Let's put the super clusters in the event
400  auto superClusters_p = std::make_unique<reco::SuperClusterCollection>(outputSuperClusterCollection);
402  iEvent.put(std::move(superClusters_p), PFSuperClusterCollection_);
403 
404  /*
405  int ipho=0;
406  for (reco::SuperClusterCollection::const_iterator gamIter = scRefProd->begin(); gamIter != scRefProd->end(); ++gamIter){
407  std::cout << "SC i="<<ipho<<" energy="<<gamIter->energy()<<std::endl;
408  ipho++;
409  }
410  */
411 
412  //1-leg conversions
413 
414  if (status)
415  createOneLegConversions(scRefProd, outputOneLegConversionCollection);
416 
417  auto SingleLeg_p = std::make_unique<reco::ConversionCollection>(outputOneLegConversionCollection);
419  iEvent.put(std::move(SingleLeg_p), PFConversionCollection_);
420  /*
421  int iconv = 0;
422  for (reco::ConversionCollection::const_iterator convIter = ConvRefProd->begin(); convIter != ConvRefProd->end(); ++convIter){
423 
424  std::cout << "OneLegConv i="<<iconv<<" nTracks="<<convIter->nTracks()<<" EoverP="<<convIter->EoverP() <<std::endl;
425  std::vector<edm::RefToBase<reco::Track> > convtracks = convIter->tracks();
426  for (unsigned int itk=0; itk<convtracks.size(); itk++){
427  std::cout << "Track pt="<< convtracks[itk]->pt() << std::endl;
428  }
429 
430  iconv++;
431  }
432  */
433 
434  //create photon cores
435  //if(status) createPhotonCores(pfCandidates, scRefProd, *photonCores_p);
436  if (status)
437  createPhotonCores(scRefProd, ConvRefProd, outputPhotonCoreCollection);
438 
439  //std::cout << "nb photoncores in collection : "<<outputPhotonCoreCollection.size()<<std::endl;
440 
441  // Put the photon cores in the event
442  auto photonCores_p = std::make_unique<reco::PhotonCoreCollection>(outputPhotonCoreCollection);
443  //std::cout << "photon core collection put in unique_ptr"<<std::endl;
445  iEvent.put(std::move(photonCores_p), PFPhotonCoreCollection_);
446 
447  //std::cout << "photon core have been put in the event"<<std::endl;
448  /*
449  int ipho=0;
450  for (reco::PhotonCoreCollection::const_iterator gamIter = pcRefProd->begin(); gamIter != pcRefProd->end(); ++gamIter){
451  std::cout << "PhotonCore i="<<ipho<<" energy="<<gamIter->parentSuperCluster()->energy()<<std::endl;
452  //for (unsigned int i=0; i<)
453 
454  std::cout << "PhotonCore i="<<ipho<<" nconv2leg="<<gamIter->conversions().size()<<" nconv1leg="<<gamIter->conversionsOneLeg().size()<<std::endl;
455 
456  const reco::ConversionRefVector & conv = gamIter->conversions();
457  for (unsigned int iconv=0; iconv<conv.size(); iconv++){
458  cout << "2-leg iconv="<<iconv<<endl;
459  cout << "2-leg nTracks="<<conv[iconv]->nTracks()<<endl;
460  cout << "2-leg EoverP="<<conv[iconv]->EoverP()<<endl;
461  cout << "2-leg ConvAlgorithm="<<conv[iconv]->algo()<<endl;
462  }
463 
464  const reco::ConversionRefVector & convbis = gamIter->conversionsOneLeg();
465  for (unsigned int iconv=0; iconv<convbis.size(); iconv++){
466  cout << "1-leg iconv="<<iconv<<endl;
467  cout << "1-leg nTracks="<<convbis[iconv]->nTracks()<<endl;
468  cout << "1-leg EoverP="<<convbis[iconv]->EoverP()<<endl;
469  cout << "1-leg ConvAlgorithm="<<convbis[iconv]->algo()<<endl;
470  }
471 
472  ipho++;
473  }
474  */
475 
476  //load vertices
478  bool validVertex = true;
479  iEvent.getByLabel(vertexProducer_, vertexHandle);
480  if (!vertexHandle.isValid()) {
481  edm::LogWarning("PhotonProducer") << "Error! Can't get the product primary Vertex Collection "
482  << "\n";
483  validVertex = false;
484  }
485  if (validVertex)
486  vertexCollection = *(vertexHandle.product());
487 
488  /*
489  //load Ecal rechits
490  bool validEcalRecHits=true;
491  Handle<EcalRecHitCollection> barrelHitHandle;
492  EcalRecHitCollection barrelRecHits;
493  iEvent.getByLabel(barrelEcalHits_, barrelHitHandle);
494  if (!barrelHitHandle.isValid()) {
495  edm::LogError("PhotonProducer") << "Error! Can't get the product "<<barrelEcalHits_.label();
496  validEcalRecHits=false;
497  }
498  if ( validEcalRecHits) barrelRecHits = *(barrelHitHandle.product());
499 
500  Handle<EcalRecHitCollection> endcapHitHandle;
501  iEvent.getByLabel(endcapEcalHits_, endcapHitHandle);
502  EcalRecHitCollection endcapRecHits;
503  if (!endcapHitHandle.isValid()) {
504  edm::LogError("PhotonProducer") << "Error! Can't get the product "<<endcapEcalHits_.label();
505  validEcalRecHits=false;
506  }
507  if( validEcalRecHits) endcapRecHits = *(endcapHitHandle.product());
508 
509  //load detector topology & geometry
510  iSetup.get<CaloGeometryRecord>().get(theCaloGeom_);
511 
512  edm::ESHandle<CaloTopology> pTopology;
513  iSetup.get<CaloTopologyRecord>().get(theCaloTopo_);
514  const CaloTopology *topology = theCaloTopo_.product();
515 
516  // get Hcal rechits collection
517  Handle<CaloTowerCollection> hcalTowersHandle;
518  iEvent.getByLabel(hcalTowers_, hcalTowersHandle);
519  */
520 
521  //create photon collection
522  //if(status) createPhotons(vertexCollection, pcRefProd, topology, &barrelRecHits, &endcapRecHits, hcalRecHitsHandle, isolationValues, outputPhotonCollection);
523  if (status)
524  createPhotons(vertexCollection, egPhotons, pcRefProd, isolationValues, outputPhotonCollection);
525 
526  // Put the photons in the event
527  auto photons_p = std::make_unique<reco::PhotonCollection>(outputPhotonCollection);
528  //std::cout << "photon collection put in unique_ptr"<<std::endl;
529  const edm::OrphanHandle<reco::PhotonCollection> photonRefProd = iEvent.put(std::move(photons_p), PFPhotonCollection_);
530  //std::cout << "photons have been put in the event"<<std::endl;
531 
532  /*
533  ipho=0;
534  for (reco::PhotonCollection::const_iterator gamIter = photonRefProd->begin(); gamIter != photonRefProd->end(); ++gamIter){
535  std::cout << "Photon i="<<ipho<<" pfEnergy="<<gamIter->parentSuperCluster()->energy()<<std::endl;
536 
537  const reco::ConversionRefVector & conv = gamIter->conversions();
538  cout << "conversions obtained : conv.size()="<< conv.size()<<endl;
539  for (unsigned int iconv=0; iconv<conv.size(); iconv++){
540  cout << "iconv="<<iconv<<endl;
541  cout << "nTracks="<<conv[iconv]->nTracks()<<endl;
542  cout << "EoverP="<<conv[iconv]->EoverP()<<endl;
543 
544  cout << "Vtx x="<<conv[iconv]->conversionVertex().x() << " y="<< conv[iconv]->conversionVertex().y()<<" z="<<conv[iconv]->conversionVertex().z()<< endl;
545  cout << "VtxError x=" << conv[iconv]->conversionVertex().xError() << endl;
546 
547  std::vector<edm::RefToBase<reco::Track> > convtracks = conv[iconv]->tracks();
548  //cout << "nTracks="<< convtracks.size()<<endl;
549  for (unsigned int itk=0; itk<convtracks.size(); itk++){
550  double convtrackpt = convtracks[itk]->pt();
551  const edm::RefToBase<reco::Track> & mytrack = convtracks[itk];
552  cout << "Track pt="<< convtrackpt <<endl;
553  cout << "Track origin="<<gamIter->conversionTrackOrigin(mytrack)<<endl;
554  }
555  }
556 
557  //1-leg
558  const reco::ConversionRefVector & convbis = gamIter->conversionsOneLeg();
559  cout << "conversions obtained : conv.size()="<< convbis.size()<<endl;
560  for (unsigned int iconv=0; iconv<convbis.size(); iconv++){
561  cout << "iconv="<<iconv<<endl;
562  cout << "nTracks="<<convbis[iconv]->nTracks()<<endl;
563  cout << "EoverP="<<convbis[iconv]->EoverP()<<endl;
564 
565  cout << "Vtx x="<<convbis[iconv]->conversionVertex().x() << " y="<< convbis[iconv]->conversionVertex().y()<<" z="<<convbis[iconv]->conversionVertex().z()<< endl;
566  cout << "VtxError x=" << convbis[iconv]->conversionVertex().xError() << endl;
567 
568  std::vector<edm::RefToBase<reco::Track> > convtracks = convbis[iconv]->tracks();
569  //cout << "nTracks="<< convtracks.size()<<endl;
570  for (unsigned int itk=0; itk<convtracks.size(); itk++){
571  double convtrackpt = convtracks[itk]->pt();
572  cout << "Track pt="<< convtrackpt <<endl;
573  cout << "Track origin="<<gamIter->conversionTrackOrigin((convtracks[itk]))<<endl;
574  }
575  }
576  ipho++;
577  }
578  */
579 }
580 
582  const edm::InputTag &tag,
583  const edm::Event &iEvent) const {
584  bool found = iEvent.getByLabel(tag, c);
585 
586  if (!found && !emptyIsOk_) {
587  std::ostringstream err;
588  err << " cannot get PFCandidates: " << tag << std::endl;
589  edm::LogError("PFPhotonTranslator") << err.str();
590  }
591  return found;
592 }
593 
594 // The basic cluster is a copy of the PFCluster -> the energy is not corrected
595 // It should be possible to get the corrected energy (including the associated PS energy)
596 // from the PFCandidate daugthers ; Needs some work
598  reco::BasicClusterCollection &basicClusters,
599  std::vector<const reco::PFCluster *> &pfClusters,
600  const reco::PFCandidate &coCandidate) const {
601  const reco::PFClusterRef &myPFClusterRef = PFBE.clusterRef();
602  if (myPFClusterRef.isNull())
603  return;
604 
605  const reco::PFCluster &myPFCluster(*myPFClusterRef);
606  pfClusters.push_back(&myPFCluster);
607  //std::cout << " Creating BC " << myPFCluster.energy() << " " << coCandidate.ecalEnergy() <<" "<< coCandidate.rawEcalEnergy() <<std::endl;
608  //std::cout << " # hits " << myPFCluster.hitsAndFractions().size() << std::endl;
609 
610  // basicClusters.push_back(reco::CaloCluster(myPFCluster.energy(),
611  basicClusters.push_back(reco::CaloCluster( //coCandidate.rawEcalEnergy(),
612  myPFCluster.energy(),
613  myPFCluster.position(),
614  myPFCluster.caloID(),
615  myPFCluster.hitsAndFractions(),
616  myPFCluster.algo(),
617  myPFCluster.seed()));
618 }
619 
621  reco::PreshowerClusterCollection &preshowerClusters,
622  unsigned plane) const {
623  const reco::PFClusterRef &myPFClusterRef = PFBE.clusterRef();
624  preshowerClusters.push_back(reco::PreshowerCluster(
625  myPFClusterRef->energy(), myPFClusterRef->position(), myPFClusterRef->hitsAndFractions(), plane));
626 }
627 
629  const edm::OrphanHandle<reco::BasicClusterCollection> &basicClustersHandle) {
630  unsigned size = photPFCandidateIndex_.size();
631  unsigned basicClusterCounter = 0;
632  basicClusterPtr_.resize(size);
633 
634  for (unsigned iphot = 0; iphot < size; ++iphot) // loop on tracks
635  {
636  unsigned nbc = basicClusters_[iphot].size();
637  for (unsigned ibc = 0; ibc < nbc; ++ibc) // loop on basic clusters
638  {
639  // std::cout << "Track "<< iGSF << " ref " << basicClusterCounter << std::endl;
640  reco::CaloClusterPtr bcPtr(basicClustersHandle, basicClusterCounter);
641  basicClusterPtr_[iphot].push_back(bcPtr);
642  ++basicClusterCounter;
643  }
644  }
645 }
646 
648  const edm::OrphanHandle<reco::PreshowerClusterCollection> &preshowerClustersHandle) {
649  unsigned size = photPFCandidateIndex_.size();
650  unsigned psClusterCounter = 0;
651  preshowerClusterPtr_.resize(size);
652 
653  for (unsigned iphot = 0; iphot < size; ++iphot) // loop on tracks
654  {
655  unsigned nbc = preshowerClusters_[iphot].size();
656  for (unsigned ibc = 0; ibc < nbc; ++ibc) // loop on basic clusters
657  {
658  // std::cout << "Track "<< iGSF << " ref " << basicClusterCounter << std::endl;
659  reco::CaloClusterPtr psPtr(preshowerClustersHandle, psClusterCounter);
660  preshowerClusterPtr_[iphot].push_back(psPtr);
661  ++psClusterCounter;
662  }
663  }
664 }
665 
668  unsigned nphot = photPFCandidateIndex_.size();
669  for (unsigned iphot = 0; iphot < nphot; ++iphot) {
670  //cout << "SC iphot=" << iphot << endl;
671 
672  // Computes energy position a la e/gamma
673  double sclusterE = 0;
674  double posX = 0.;
675  double posY = 0.;
676  double posZ = 0.;
677 
678  unsigned nbasics = basicClusters_[iphot].size();
679  for (unsigned ibc = 0; ibc < nbasics; ++ibc) {
680  //cout << "BC in SC : iphot="<<iphot<<endl;
681 
682  double e = basicClusters_[iphot][ibc].energy();
683  sclusterE += e;
684  posX += e * basicClusters_[iphot][ibc].position().X();
685  posY += e * basicClusters_[iphot][ibc].position().Y();
686  posZ += e * basicClusters_[iphot][ibc].position().Z();
687  }
688  posX /= sclusterE;
689  posY /= sclusterE;
690  posZ /= sclusterE;
691 
692  /*
693  if(pfCand[gsfPFCandidateIndex_[iphot]].gsfTrackRef()!=GsfTrackRef_[iphot])
694  {
695  edm::LogError("PFElectronTranslator") << " Major problem in PFElectron Translator" << std::endl;
696  }
697  */
698 
699  // compute the width
700  PFClusterWidthAlgo pfwidth(pfClusters_[iphot]);
701 
702  double correctedEnergy = pfCand[photPFCandidateIndex_[iphot]].ecalEnergy();
703  reco::SuperCluster mySuperCluster(correctedEnergy, math::XYZPoint(posX, posY, posZ));
704  // protection against empty basic cluster collection ; the value is -2 in this case
705  if (nbasics) {
706  // std::cout << "SuperCluster creation; energy " << pfCand[gsfPFCandidateIndex_[iphot]].ecalEnergy();
707  // std::cout << " " << pfCand[gsfPFCandidateIndex_[iphot]].rawEcalEnergy() << std::endl;
708  // std::cout << "Seed energy from basic " << basicClusters_[iphot][0].energy() << std::endl;
709  mySuperCluster.setSeed(basicClusterPtr_[iphot][0]);
710  } else {
711  // std::cout << "SuperCluster creation ; seed energy " << 0 << std::endl;
712  //std::cout << "SuperCluster creation ; energy " << pfCand[photPFCandidateIndex_[iphot]].ecalEnergy();
713  //std::cout << " " << pfCand[photPFCandidateIndex_[iphot]].rawEcalEnergy() << std::endl;
714  // std::cout << " No seed found " << 0 << std::endl;
715  // std::cout << " MVA " << pfCand[gsfPFCandidateIndex_[iphot]].mva_e_pi() << std::endl;
716  mySuperCluster.setSeed(reco::CaloClusterPtr());
717  }
718  // the seed should be the first basic cluster
719 
720  for (unsigned ibc = 0; ibc < nbasics; ++ibc) {
721  mySuperCluster.addCluster(basicClusterPtr_[iphot][ibc]);
722  // std::cout <<"Adding Ref to SC " << basicClusterPtr_[iphot][ibc].index() << std::endl;
723  const std::vector<std::pair<DetId, float> > &v1 = basicClusters_[iphot][ibc].hitsAndFractions();
724  // std::cout << " Number of cells " << v1.size() << std::endl;
725  for (std::vector<std::pair<DetId, float> >::const_iterator diIt = v1.begin(); diIt != v1.end(); ++diIt) {
726  // std::cout << " Adding DetId " << (diIt->first).rawId() << " " << diIt->second << std::endl;
727  mySuperCluster.addHitAndFraction(diIt->first, diIt->second);
728  } // loop over rechits
729  }
730 
731  unsigned nps = preshowerClusterPtr_[iphot].size();
732  for (unsigned ips = 0; ips < nps; ++ips) {
733  mySuperCluster.addPreshowerCluster(preshowerClusterPtr_[iphot][ips]);
734  }
735 
736  // Set the preshower energy
737  mySuperCluster.setPreshowerEnergy(pfCand[photPFCandidateIndex_[iphot]].pS1Energy() +
738  pfCand[photPFCandidateIndex_[iphot]].pS2Energy());
739 
740  // Set the cluster width
741  mySuperCluster.setEtaWidth(pfwidth.pflowEtaWidth());
742  mySuperCluster.setPhiWidth(pfwidth.pflowPhiWidth());
743  // Force the computation of rawEnergy_ of the reco::SuperCluster
744  mySuperCluster.rawEnergy();
745 
746  //cout << "SC energy="<< mySuperCluster.energy()<<endl;
747 
748  superClusters.push_back(mySuperCluster);
749  //std::cout << "nb super clusters in collection : "<<superClusters.size()<<std::endl;
750  }
751 }
752 
754  const edm::OrphanHandle<reco::SuperClusterCollection> &superClustersHandle,
755  reco::ConversionCollection &oneLegConversions) {
756  //std::cout << "createOneLegConversions" << std::endl;
757 
758  unsigned nphot = photPFCandidateIndex_.size();
759  for (unsigned iphot = 0; iphot < nphot; ++iphot) {
760  //if (conv1legPFCandidateIndex_[iphot]==-1) cout << "No OneLegConversions to add"<<endl;
761  //else std::cout << "Phot "<<iphot<< " nOneLegConversions to add : "<<pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]].size()<<endl;
762 
763  if (conv1legPFCandidateIndex_[iphot] > -1) {
764  for (unsigned iConv = 0; iConv < pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]].size(); iConv++) {
766  std::vector<reco::CaloClusterPtr> matchingBC;
768  const reco::Vertex *convVtx =
769  new reco::Vertex(pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->innerPosition(), error);
770 
771  //cout << "Vtx x="<<convVtx->x() << " y="<< convVtx->y()<<" z="<<convVtx->z()<< endl;
772  //cout << "VtxError x=" << convVtx->xError() << endl;
773 
774  std::vector<reco::TrackRef> OneLegConvVector;
775  OneLegConvVector.push_back(pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]);
776 
777  std::vector<reco::TrackRef> tr = OneLegConvVector;
778  std::vector<math::XYZPointF> trackPositionAtEcalVec;
779  std::vector<math::XYZPointF> innPointVec;
780  std::vector<math::XYZVectorF> trackPinVec;
781  std::vector<math::XYZVectorF> trackPoutVec;
782  math::XYZPointF trackPositionAtEcal(
783  pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->outerPosition().X(),
784  pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->outerPosition().Y(),
785  pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->outerPosition().Z());
786  math::XYZPointF innPoint(pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->innerPosition().X(),
787  pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->innerPosition().Y(),
788  pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->innerPosition().Z());
789  math::XYZVectorF trackPin(pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->innerMomentum().X(),
790  pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->innerMomentum().Y(),
791  pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->innerMomentum().Z());
792  math::XYZVectorF trackPout(pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->outerMomentum().X(),
793  pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->outerMomentum().Y(),
794  pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->outerMomentum().Z());
795  float DCA = pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->d0();
796  trackPositionAtEcalVec.push_back(trackPositionAtEcal);
797  innPointVec.push_back(innPoint);
798  trackPinVec.push_back(trackPin);
799  trackPoutVec.push_back(trackPout);
800  std::vector<float> OneLegMvaVector;
801  reco::Conversion myOneLegConversion(scPtrVec,
802  OneLegConvVector,
803  trackPositionAtEcalVec,
804  *convVtx,
805  matchingBC,
806  DCA,
807  innPointVec,
808  trackPinVec,
809  trackPoutVec,
810  pfSingleLegConvMva_[conv1legPFCandidateIndex_[iphot]][iConv],
812  OneLegMvaVector.push_back(pfSingleLegConvMva_[conv1legPFCandidateIndex_[iphot]][iConv]);
813  myOneLegConversion.setOneLegMVA(OneLegMvaVector);
814  //reco::Conversion myOneLegConversion(scPtrVec,
815  //OneLegConvVector, *convVtx, reco::Conversion::pflow);
816 
817  /*
818  std::cout << "One leg conversion created" << endl;
819  std::vector<edm::RefToBase<reco::Track> > convtracks = myOneLegConversion.tracks();
820  const std::vector<float> mvalist = myOneLegConversion.oneLegMVA();
821 
822  cout << "nTracks="<< convtracks.size()<<endl;
823  for (unsigned int itk=0; itk<convtracks.size(); itk++){
824  //double convtrackpt = convtracks[itk]->pt();
825  std::cout << "Track pt="<< convtracks[itk]->pt() << std::endl;
826  std::cout << "Track mva="<< mvalist[itk] << std::endl;
827  }
828  */
829  oneLegConversions.push_back(myOneLegConversion);
830 
831  //cout << "OneLegConv added"<<endl;
832  }
833  }
834  }
835 }
836 
838  const edm::OrphanHandle<reco::ConversionCollection> &oneLegConversionHandle,
839  reco::PhotonCoreCollection &photonCores) {
840  //std::cout << "createPhotonCores" << std::endl;
841 
842  unsigned nphot = photPFCandidateIndex_.size();
843 
844  unsigned i1legtot = 0;
845 
846  for (unsigned iphot = 0; iphot < nphot; ++iphot) {
847  //std::cout << "iphot="<<iphot<<std::endl;
848 
849  reco::PhotonCore myPhotonCore;
850 
851  reco::SuperClusterRef SCref(reco::SuperClusterRef(superClustersHandle, iphot));
852 
853  myPhotonCore.setPFlowPhoton(true);
854  myPhotonCore.setStandardPhoton(false);
855  myPhotonCore.setParentSuperCluster(SCref);
856  myPhotonCore.setSuperCluster(egSCRef_[iphot]);
857 
858  reco::ElectronSeedRefVector pixelSeeds = egPhotonRef_[iphot]->electronPixelSeeds();
859  for (unsigned iseed = 0; iseed < pixelSeeds.size(); iseed++) {
860  myPhotonCore.addElectronPixelSeed(pixelSeeds[iseed]);
861  }
862 
863  //cout << "PhotonCores : SC OK" << endl;
864 
865  //cout << "conv1legPFCandidateIndex_[iphot]="<<conv1legPFCandidateIndex_[iphot]<<endl;
866  //cout << "conv2legPFCandidateIndex_[iphot]="<<conv2legPFCandidateIndex_[iphot]<<endl;
867 
868  if (conv1legPFCandidateIndex_[iphot] > -1) {
869  for (unsigned int iConv = 0; iConv < pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]].size(); iConv++) {
870  const reco::ConversionRef &OneLegRef(reco::ConversionRef(oneLegConversionHandle, i1legtot));
871  myPhotonCore.addOneLegConversion(OneLegRef);
872 
873  //cout << "PhotonCores : 1-leg OK" << endl;
874  /*
875  cout << "Testing 1-leg :"<<endl;
876  const reco::ConversionRefVector & conv = myPhotonCore.conversionsOneLeg();
877  for (unsigned int iconv=0; iconv<conv.size(); iconv++){
878  cout << "Testing 1-leg : iconv="<<iconv<<endl;
879  cout << "Testing 1-leg : nTracks="<<conv[iconv]->nTracks()<<endl;
880  cout << "Testing 1-leg : EoverP="<<conv[iconv]->EoverP()<<endl;
881  std::vector<edm::RefToBase<reco::Track> > convtracks = conv[iconv]->tracks();
882  for (unsigned int itk=0; itk<convtracks.size(); itk++){
883  //double convtrackpt = convtracks[itk]->pt();
884  std::cout << "Testing 1-leg : Track pt="<< convtracks[itk]->pt() << std::endl;
885  // std::cout << "Track mva="<< mvalist[itk] << std::endl;
886  }
887  }
888  */
889 
890  i1legtot++;
891  }
892  }
893 
894  if (conv2legPFCandidateIndex_[iphot] > -1) {
895  for (unsigned int iConv = 0; iConv < pfConv_[conv2legPFCandidateIndex_[iphot]].size(); iConv++) {
896  const reco::ConversionRef &TwoLegRef(pfConv_[conv2legPFCandidateIndex_[iphot]][iConv]);
897  myPhotonCore.addConversion(TwoLegRef);
898  }
899  //cout << "PhotonCores : 2-leg OK" << endl;
900 
901  /*
902  cout << "Testing 2-leg :"<<endl;
903  const reco::ConversionRefVector & conv = myPhotonCore.conversions();
904  for (unsigned int iconv=0; iconv<conv.size(); iconv++){
905  cout << "Testing 2-leg : iconv="<<iconv<<endl;
906  cout << "Testing 2-leg : nTracks="<<conv[iconv]->nTracks()<<endl;
907  cout << "Testing 2-leg : EoverP="<<conv[iconv]->EoverP()<<endl;
908  std::vector<edm::RefToBase<reco::Track> > convtracks = conv[iconv]->tracks();
909  for (unsigned int itk=0; itk<convtracks.size(); itk++){
910  //double convtrackpt = convtracks[itk]->pt();
911  std::cout << "Testing 2-leg : Track pt="<< convtracks[itk]->pt() << std::endl;
912  // std::cout << "Track mva="<< mvalist[itk] << std::endl;
913  }
914  }
915  */
916  }
917 
918  photonCores.push_back(myPhotonCore);
919  }
920 
921  //std::cout << "end of createPhotonCores"<<std::endl;
922 }
923 
926  const edm::OrphanHandle<reco::PhotonCoreCollection> &photonCoresHandle,
929  //cout << "createPhotons" << endl;
930 
931  unsigned nphot = photPFCandidateIndex_.size();
932 
933  for (unsigned iphot = 0; iphot < nphot; ++iphot) {
934  //std::cout << "iphot="<<iphot<<std::endl;
935 
936  reco::PhotonCoreRef PCref(reco::PhotonCoreRef(photonCoresHandle, iphot));
937 
938  math::XYZPoint vtx(0., 0., 0.);
939  if (!vertexCollection.empty())
940  vtx = vertexCollection.begin()->position();
941  //std::cout << "vtx made" << std::endl;
942 
943  math::XYZVector direction = PCref->parentSuperCluster()->position() - vtx;
944 
945  //It could be that pfSC energy gives not the best resolution : use smaller agregates for some cases ?
946  math::XYZVector P3 = direction.unit() * PCref->parentSuperCluster()->energy();
947  LorentzVector P4(P3.x(), P3.y(), P3.z(), PCref->parentSuperCluster()->energy());
948 
949  reco::Photon myPhoton(P4, PCref->parentSuperCluster()->position(), PCref, vtx);
950  //cout << "photon created"<<endl;
951 
952  reco::Photon::ShowerShape showerShape;
953  reco::Photon::SaturationInfo saturationInfo;
954  reco::Photon::FiducialFlags fiducialFlags;
955  reco::Photon::IsolationVariables isolationVariables03;
956  reco::Photon::IsolationVariables isolationVariables04;
957 
958  showerShape.e1x5 = egPhotonRef_[iphot]->e1x5();
959  showerShape.e2x5 = egPhotonRef_[iphot]->e2x5();
960  showerShape.e3x3 = egPhotonRef_[iphot]->e3x3();
961  showerShape.e5x5 = egPhotonRef_[iphot]->e5x5();
962  showerShape.maxEnergyXtal = egPhotonRef_[iphot]->maxEnergyXtal();
963  showerShape.sigmaEtaEta = egPhotonRef_[iphot]->sigmaEtaEta();
964  showerShape.sigmaIetaIeta = egPhotonRef_[iphot]->sigmaIetaIeta();
965  for (uint id = 0; id < showerShape.hcalOverEcal.size(); ++id) {
966  showerShape.hcalOverEcal[id] = egPhotonRef_[iphot]->hcalOverEcal(id + 1);
967  }
968  myPhoton.setShowerShapeVariables(showerShape);
969 
970  saturationInfo.nSaturatedXtals = egPhotonRef_[iphot]->nSaturatedXtals();
971  saturationInfo.isSeedSaturated = egPhotonRef_[iphot]->isSeedSaturated();
972  myPhoton.setSaturationInfo(saturationInfo);
973 
974  fiducialFlags.isEB = egPhotonRef_[iphot]->isEB();
975  fiducialFlags.isEE = egPhotonRef_[iphot]->isEE();
976  fiducialFlags.isEBEtaGap = egPhotonRef_[iphot]->isEBEtaGap();
977  fiducialFlags.isEBPhiGap = egPhotonRef_[iphot]->isEBPhiGap();
978  fiducialFlags.isEERingGap = egPhotonRef_[iphot]->isEERingGap();
979  fiducialFlags.isEEDeeGap = egPhotonRef_[iphot]->isEEDeeGap();
980  fiducialFlags.isEBEEGap = egPhotonRef_[iphot]->isEBEEGap();
981  myPhoton.setFiducialVolumeFlags(fiducialFlags);
982 
983  isolationVariables03.ecalRecHitSumEt = egPhotonRef_[iphot]->ecalRecHitSumEtConeDR03();
984  for (uint id = 0; id < isolationVariables03.hcalRecHitSumEt.size(); ++id) {
985  isolationVariables03.hcalRecHitSumEt[id] = egPhotonRef_[iphot]->hcalTowerSumEtConeDR03(id + 1);
986  }
987  isolationVariables03.trkSumPtSolidCone = egPhotonRef_[iphot]->trkSumPtSolidConeDR03();
988  isolationVariables03.trkSumPtHollowCone = egPhotonRef_[iphot]->trkSumPtHollowConeDR03();
989  isolationVariables03.nTrkSolidCone = egPhotonRef_[iphot]->nTrkSolidConeDR03();
990  isolationVariables03.nTrkHollowCone = egPhotonRef_[iphot]->nTrkHollowConeDR03();
991  isolationVariables04.ecalRecHitSumEt = egPhotonRef_[iphot]->ecalRecHitSumEtConeDR04();
992  for (uint id = 0; id < isolationVariables04.hcalRecHitSumEt.size(); ++id) {
993  isolationVariables04.hcalRecHitSumEt[id] = egPhotonRef_[iphot]->hcalTowerSumEtConeDR04(id + 1);
994  }
995  isolationVariables04.trkSumPtSolidCone = egPhotonRef_[iphot]->trkSumPtSolidConeDR04();
996  isolationVariables04.trkSumPtHollowCone = egPhotonRef_[iphot]->trkSumPtHollowConeDR04();
997  isolationVariables04.nTrkSolidCone = egPhotonRef_[iphot]->nTrkSolidConeDR04();
998  isolationVariables04.nTrkHollowCone = egPhotonRef_[iphot]->nTrkHollowConeDR04();
999  myPhoton.setIsolationVariables(isolationVariables04, isolationVariables03);
1000 
1002  myPFIso.chargedHadronIso = (*isolationValues[0])[CandidatePtr_[iphot]];
1003  myPFIso.photonIso = (*isolationValues[1])[CandidatePtr_[iphot]];
1004  myPFIso.neutralHadronIso = (*isolationValues[2])[CandidatePtr_[iphot]];
1005  myPhoton.setPflowIsolationVariables(myPFIso);
1006 
1007  reco::Photon::PflowIDVariables myPFVariables;
1008 
1009  reco::Mustache myMustache(mustacheSCParams_);
1010  myMustache.MustacheID(
1011  *(myPhoton.parentSuperCluster()), myPFVariables.nClusterOutsideMustache, myPFVariables.etOutsideMustache);
1012  myPFVariables.mva = pfPhotonMva_[iphot];
1013  myPhoton.setPflowIDVariables(myPFVariables);
1014 
1015  //cout << "chargedHadronIso="<<myPhoton.chargedHadronIso()<<" photonIso="<<myPhoton.photonIso()<<" neutralHadronIso="<<myPhoton.neutralHadronIso()<<endl;
1016 
1017  // set PF-regression energy
1018  myPhoton.setCorrectedEnergy(
1019  reco::Photon::regression2, energyRegression_[iphot], energyRegressionError_[iphot], false);
1020 
1021  /*
1022  if (basicClusters_[iphot].size()>0){
1023  // Cluster shape variables
1024  //Algorithms from EcalClusterTools could be adapted to PF photons ? (not based on 5x5 BC)
1025  //It happens that energy computed in eg e5x5 is greater than pfSC energy (EcalClusterTools gathering energies from adjacent crystals even if not belonging to the SC)
1026  const EcalRecHitCollection* hits = 0 ;
1027  int subdet = PCref->parentSuperCluster()->seed()->hitsAndFractions()[0].first.subdetId();
1028  if (subdet==EcalBarrel) hits = barrelRecHits;
1029  else if (subdet==EcalEndcap) hits = endcapRecHits;
1030  const CaloGeometry* geometry = theCaloGeom_.product();
1031 
1032  float maxXtal = EcalClusterTools::eMax( *(PCref->parentSuperCluster()->seed()), &(*hits) );
1033  //cout << "maxXtal="<<maxXtal<<endl;
1034  float e1x5 = EcalClusterTools::e1x5( *(PCref->parentSuperCluster()->seed()), &(*hits), &(*topology));
1035  //cout << "e1x5="<<e1x5<<endl;
1036  float e2x5 = EcalClusterTools::e2x5Max( *(PCref->parentSuperCluster()->seed()), &(*hits), &(*topology));
1037  //cout << "e2x5="<<e2x5<<endl;
1038  float e3x3 = EcalClusterTools::e3x3( *(PCref->parentSuperCluster()->seed()), &(*hits), &(*topology));
1039  //cout << "e3x3="<<e3x3<<endl;
1040  float e5x5 = EcalClusterTools::e5x5( *(PCref->parentSuperCluster()->seed()), &(*hits), &(*topology));
1041  //cout << "e5x5="<<e5x5<<endl;
1042  std::vector<float> cov = EcalClusterTools::covariances( *(PCref->parentSuperCluster()->seed()), &(*hits), &(*topology), geometry);
1043  float sigmaEtaEta = sqrt(cov[0]);
1044  //cout << "sigmaEtaEta="<<sigmaEtaEta<<endl;
1045  std::vector<float> locCov = EcalClusterTools::localCovariances( *(PCref->parentSuperCluster()->seed()), &(*hits), &(*topology));
1046  float sigmaIetaIeta = sqrt(locCov[0]);
1047  //cout << "sigmaIetaIeta="<<sigmaIetaIeta<<endl;
1048  //float r9 =e3x3/(PCref->parentSuperCluster()->rawEnergy());
1049 
1050 
1051  // calculate HoE
1052  const CaloTowerCollection* hcalTowersColl = hcalTowersHandle.product();
1053  EgammaTowerIsolation towerIso1(hOverEConeSize_,0.,0.,1,hcalTowersColl) ;
1054  EgammaTowerIsolation towerIso2(hOverEConeSize_,0.,0.,2,hcalTowersColl) ;
1055  double HoE1=towerIso1.getTowerESum(&(*PCref->parentSuperCluster()))/PCref->pfSuperCluster()->energy();
1056  double HoE2=towerIso2.getTowerESum(&(*PCref->parentSuperCluster()))/PCref->pfSuperCluster()->energy();
1057  //cout << "HoE1="<<HoE1<<endl;
1058  //cout << "HoE2="<<HoE2<<endl;
1059 
1060  reco::Photon::ShowerShape showerShape;
1061  showerShape.e1x5= e1x5;
1062  showerShape.e2x5= e2x5;
1063  showerShape.e3x3= e3x3;
1064  showerShape.e5x5= e5x5;
1065  showerShape.maxEnergyXtal = maxXtal;
1066  showerShape.sigmaEtaEta = sigmaEtaEta;
1067  showerShape.sigmaIetaIeta = sigmaIetaIeta;
1068  showerShape.hcalDepth1OverEcal = HoE1;
1069  showerShape.hcalDepth2OverEcal = HoE2;
1070  myPhoton.setShowerShapeVariables ( showerShape );
1071  //cout << "shower shape variables filled"<<endl;
1072  }
1073  */
1074 
1075  photons.push_back(myPhoton);
1076  }
1077 
1078  //std::cout << "end of createPhotons"<<std::endl;
1079 }
1080 
1082  const reco::PFBlockElement &pfbe) const {
1083  unsigned refindex = pfbe.index();
1084  // std::cout << " N daughters " << cand.numberOfDaughters() << std::endl;
1085  reco::PFCandidate::const_iterator myDaughterCandidate = cand.begin();
1087 
1088  for (; myDaughterCandidate != itend; ++myDaughterCandidate) {
1089  const reco::PFCandidate *myPFCandidate = (const reco::PFCandidate *)&*myDaughterCandidate;
1090  if (myPFCandidate->elementsInBlocks().size() != 1) {
1091  // std::cout << " Daughter with " << myPFCandidate.elementsInBlocks().size()<< " element in block " << std::endl;
1092  return cand;
1093  }
1094  if (myPFCandidate->elementsInBlocks()[0].second == refindex) {
1095  // std::cout << " Found it " << cand << std::endl;
1096  return *myPFCandidate;
1097  }
1098  }
1099  return cand;
1100 }
reco::Conversion
Definition: Conversion.h:23
Handle.h
zmumugammaAnalyzer_cfi.pfCandidates
pfCandidates
Definition: zmumugammaAnalyzer_cfi.py:11
PFPhotonTranslator::PFPreshowerClusterCollection_
std::string PFPreshowerClusterCollection_
Definition: PFPhotonTranslator.cc:89
PFPhotonTranslator::EGPhotonCollection_
std::string EGPhotonCollection_
Definition: PFPhotonTranslator.cc:94
mps_fire.i
i
Definition: mps_fire.py:428
reco::PhotonCore::setPFlowPhoton
void setPFlowPhoton(const bool prov)
set the provenance
Definition: PhotonCore.h:58
reco::PhotonCore::setSuperCluster
void setSuperCluster(const reco::SuperClusterRef &r)
set reference to SuperCluster
Definition: PhotonCore.h:48
PFClusterWidthAlgo::pflowEtaWidth
double pflowEtaWidth() const
Definition: PFClusterWidthAlgo.h:15
MessageLogger.h
edm::Handle::product
T const * product() const
Definition: Handle.h:70
electronProducer_cff.isolationValues
isolationValues
Definition: electronProducer_cff.py:26
reco::Photon::SaturationInfo::nSaturatedXtals
int nSaturatedXtals
Definition: Photon.h:300
ESHandle.h
PFCandidate.h
reco::SuperCluster
Definition: SuperCluster.h:18
mps_update.status
status
Definition: mps_update.py:68
X
#define X(str)
Definition: MuonsGrabber.cc:38
reco::Photon::FiducialFlags::isEE
bool isEE
Definition: Photon.h:97
BasicCluster.h
PFPhotonTranslator::energyRegressionError_
std::vector< float > energyRegressionError_
Definition: PFPhotonTranslator.cc:124
edm::Ref::isNull
bool isNull() const
Checks for null.
Definition: Ref.h:235
edm
HLT enums.
Definition: AlignableModifier.h:19
PFPhotonTranslator::hcalTowers_
edm::InputTag hcalTowers_
Definition: PFPhotonTranslator.cc:98
reco::SuperCluster::setEtaWidth
void setEtaWidth(double ew)
Definition: SuperCluster.h:74
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
reco::Photon::PflowIDVariables::etOutsideMustache
float etOutsideMustache
Definition: Photon.h:561
reco::Photon::IsolationVariables::ecalRecHitSumEt
float ecalRecHitSumEt
Definition: Photon.h:403
PreshowerCluster.h
reco::PreshowerCluster
Definition: PreshowerCluster.h:17
reco::candidate::const_iterator
Definition: const_iterator.h:14
reco::Photon::IsolationVariables::hcalRecHitSumEt
std::array< float, 7 > hcalRecHitSumEt
Definition: Photon.h:416
PFPhotonTranslator::PFConversionCollection_
std::string PFConversionCollection_
Definition: PFPhotonTranslator.cc:93
reco::Photon::SaturationInfo
Definition: Photon.h:299
PFPhotonTranslator::preshowerClusters_
std::vector< reco::PreshowerClusterCollection > preshowerClusters_
Definition: PFPhotonTranslator.cc:106
EDProducer.h
LorentzVector
math::XYZTLorentzVector LorentzVector
Definition: PFPhotonTranslator.cc:150
PFPhotonTranslator::superClusters_
std::vector< reco::SuperClusterCollection > superClusters_
Definition: PFPhotonTranslator.cc:108
reco::PhotonCore::addConversion
void addConversion(const reco::ConversionRef &r)
add single ConversionRef to the vector of Refs
Definition: PhotonCore.h:52
PFPhotonTranslator::PFPhotonTranslator
PFPhotonTranslator(const edm::ParameterSet &)
Definition: PFPhotonTranslator.cc:154
reco::Photon::PflowIsolationVariables::chargedHadronIso
float chargedHadronIso
Definition: Photon.h:520
edm::RefVector< ConversionCollection >
PFPhotonTranslator::fetchCandidateCollection
bool fetchCandidateCollection(edm::Handle< reco::PFCandidateCollection > &c, const edm::InputTag &tag, const edm::Event &iEvent) const
Definition: PFPhotonTranslator.cc:581
PFPhotonTranslator::pfSingleLegConvMva_
std::vector< std::vector< float > > pfSingleLegConvMva_
Definition: PFPhotonTranslator.cc:129
PhotonCore.h
PFPhotonTranslator::conv2legPFCandidateIndex_
std::vector< int > conv2legPFCandidateIndex_
Definition: PFPhotonTranslator.cc:132
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
PFPhotonTranslator::correspondingDaughterCandidate
const reco::PFCandidate & correspondingDaughterCandidate(const reco::PFCandidate &cand, const reco::PFBlockElement &pfbe) const
Definition: PFPhotonTranslator.cc:1081
reco::SuperCluster::setPreshowerEnergy
void setPreshowerEnergy(double preshowerEnergy)
Definition: SuperCluster.h:70
reco::PFCandidate::elementsInBlocks
const ElementsInBlocks & elementsInBlocks() const
Definition: PFCandidate.cc:636
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
edm::Handle
Definition: AssociativeIterator.h:50
relativeConstraints.error
error
Definition: relativeConstraints.py:53
EcalMustacheSCParameters
Definition: EcalMustacheSCParameters.h:13
parallelization.uint
uint
Definition: parallelization.py:124
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
CaloTopology
Definition: CaloTopology.h:19
reco::Photon::PflowIsolationVariables::neutralHadronIso
float neutralHadronIso
Definition: Photon.h:524
PFPhotonTranslator::PFPhotonCollection_
std::string PFPhotonCollection_
Definition: PFPhotonTranslator.cc:92
Mustache.h
edm::Ref< PhotonCollection >
EcalMustacheSCParametersRcd.h
reco::ConversionCollection
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
Definition: ConversionFwd.h:9
hltEgammaHLTExtra_cfi.pixelSeeds
pixelSeeds
Definition: hltEgammaHLTExtra_cfi.py:6
PFClusterWidthAlgo::pflowPhiWidth
double pflowPhiWidth() const
Definition: PFClusterWidthAlgo.h:14
HLT_FULL_cff.superClusters
superClusters
Definition: HLT_FULL_cff.py:15191
reco::SuperCluster::addCluster
void addCluster(const CaloClusterPtr &r)
add reference to constituent BasicCluster
Definition: SuperCluster.h:122
PFPhotonTranslator::vertexProducer_
std::string vertexProducer_
Definition: PFPhotonTranslator.cc:95
reco::Mustache
Definition: Mustache.h:28
reco::SuperCluster::setSeed
void setSeed(const CaloClusterPtr &r)
list of used xtals by DetId // now inherited by CaloCluster
Definition: SuperCluster.h:107
reco::SuperClusterCollection
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
Definition: SuperClusterFwd.h:9
Point
math::XYZPoint Point
Definition: PFPhotonTranslator.cc:151
DetId
Definition: DetId.h:17
MakerMacros.h
PFPhotonTranslator::createPreshowerCluster
void createPreshowerCluster(const reco::PFBlockElement &PFBE, reco::PreshowerClusterCollection &preshowerClusters, unsigned plane) const
Definition: PFPhotonTranslator.cc:620
Photon.h
reco::Photon::PflowIsolationVariables
Definition: Photon.h:519
CaloGeometry
Definition: CaloGeometry.h:21
reco::PFCluster::energy
double energy() const
cluster energy
Definition: PFCluster.h:74
PFPhotonTranslator::endcapEcalHits_
edm::InputTag endcapEcalHits_
Definition: PFPhotonTranslator.cc:97
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
PFCandidatePhotonExtra.h
reco::Photon::FiducialFlags::isEBEEGap
bool isEBEEGap
Definition: Photon.h:102
reco::PhotonCore::setStandardPhoton
void setStandardPhoton(const bool prov)
Definition: PhotonCore.h:59
reco::Photon::FiducialFlags::isEB
bool isEB
Definition: Photon.h:96
edm::PtrVector< CaloCluster >
PFPhotonTranslator::photPFCandidateIndex_
std::vector< int > photPFCandidateIndex_
Definition: PFPhotonTranslator.cc:114
reco::Photon::FiducialFlags::isEEDeeGap
bool isEEDeeGap
Definition: Photon.h:101
PFPhotonTranslator::barrelEcalHits_
edm::InputTag barrelEcalHits_
Definition: PFPhotonTranslator.cc:96
reco::CaloCluster
Definition: CaloCluster.h:31
reco::PhotonCore
Definition: PhotonCore.h:24
PFBlockElement.h
reco::PhotonCore::addElectronPixelSeed
void addElectronPixelSeed(const reco::ElectronSeedRef &r)
set electron pixel seed ref
Definition: PhotonCore.h:56
edm::ESHandle< CaloTopology >
PFCluster.h
reco::Photon::PflowIDVariables::mva
float mva
Definition: Photon.h:562
PFPhotonTranslator::pfSingleLegConv_
std::vector< std::vector< reco::TrackRef > > pfSingleLegConv_
Definition: PFPhotonTranslator.cc:128
reco::PreshowerClusterCollection
std::vector< PreshowerCluster > PreshowerClusterCollection
collection of PreshowerCluster objects
Definition: PreshowerClusterFwd.h:12
RecoTauValidation_cfi.posX
posX
Definition: RecoTauValidation_cfi.py:287
PFPhotonTranslator::basicClusters_
std::vector< reco::BasicClusterCollection > basicClusters_
Definition: PFPhotonTranslator.cc:102
PFClusterWidthAlgo.h
reco::Photon::FiducialFlags::isEERingGap
bool isEERingGap
Definition: Photon.h:100
reco::PhotonCore::addOneLegConversion
void addOneLegConversion(const reco::ConversionRef &r)
add single ConversionRef to the vector of Refs
Definition: PhotonCore.h:54
PFPhotonTranslator::pfClusters_
std::vector< std::vector< const reco::PFCluster * > > pfClusters_
Definition: PFPhotonTranslator.cc:104
reco::BasicClusterCollection
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects
Definition: BasicClusterFwd.h:16
reco::Photon::IsolationVariables::trkSumPtSolidCone
float trkSumPtSolidCone
Definition: Photon.h:420
PFPhotonTranslator::inputTagPFCandidates_
edm::InputTag inputTagPFCandidates_
Definition: PFPhotonTranslator.cc:86
reco::PhotonCoreCollection
std::vector< PhotonCore > PhotonCoreCollection
collectin of PhotonCore objects
Definition: PhotonCoreFwd.h:9
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:681
edm::ParameterSet
Definition: ParameterSet.h:47
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
iseed
int iseed
Definition: AMPTWrapper.h:134
PFPhotonTranslator::inputTagIsoVals_
std::vector< edm::InputTag > inputTagIsoVals_
Definition: PFPhotonTranslator.cc:87
reco::Photon::IsolationVariables::nTrkSolidCone
int nTrkSolidCone
Definition: Photon.h:424
Event.h
reco::CaloCluster::hitsAndFractions
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
Definition: CaloCluster.h:210
makeGlobalPositionRcd_cfg.tag
tag
Definition: makeGlobalPositionRcd_cfg.py:6
PFPhotonTranslator::createBasicCluster
void createBasicCluster(const reco::PFBlockElement &, reco::BasicClusterCollection &basicClusters, std::vector< const reco::PFCluster * > &, const reco::PFCandidate &coCandidate) const
Definition: PFPhotonTranslator.cc:597
PFPhotonTranslator::~PFPhotonTranslator
~PFPhotonTranslator() override
Definition: PFPhotonTranslator.cc:196
PFPhotonTranslator::CandidatePtr_
std::vector< reco::CandidatePtr > CandidatePtr_
Definition: PFPhotonTranslator.cc:116
reco::CaloCluster::addHitAndFraction
void addHitAndFraction(DetId id, float fraction)
Definition: CaloCluster.h:203
EcalMustacheSCParameters.h
reco::Photon::FiducialFlags::isEBPhiGap
bool isEBPhiGap
Definition: Photon.h:99
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
reco::Photon::FiducialFlags
Definition: Photon.h:94
reco::PFBlockElement::ECAL
Definition: PFBlockElement.h:35
cand
Definition: decayParser.h:32
reco::Mustache::MustacheID
void MustacheID(const CaloClusterPtrVector &clusters, int &nclusters, float &EoutsideMustache)
Definition: Mustache.cc:95
LorentzVector.h
iEvent
int iEvent
Definition: GenABIO.cc:224
PFPhotonTranslator::hOverEConeSize_
double hOverEConeSize_
Definition: PFPhotonTranslator.cc:99
PFPhotonTranslator::basicClusterPtr_
std::vector< reco::CaloClusterPtrVector > basicClusterPtr_
Definition: PFPhotonTranslator.cc:110
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
reco::PFCandidate::gamma
Definition: PFCandidate.h:49
edm::stream::EDProducer
Definition: EDProducer.h:36
reco::Conversion::setOneLegMVA
void setOneLegMVA(const std::vector< float > &mva)
set the MVS output from PF for one leg conversions
Definition: Conversion.h:163
BPHMonitor_cfi.photons
photons
Definition: BPHMonitor_cfi.py:91
edm::EventSetup
Definition: EventSetup.h:58
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
PFPhotonTranslator::createSuperClusters
void createSuperClusters(const reco::PFCandidateCollection &, reco::SuperClusterCollection &superClusters) const
Definition: PFPhotonTranslator.cc:666
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
reco::SuperCluster::addPreshowerCluster
void addPreshowerCluster(const CaloClusterPtr &r)
add reference to constituent BasicCluster
Definition: SuperCluster.h:128
reco::Photon::IsolationVariables
Definition: Photon.h:399
PFPhotonTranslator::PFSuperClusterCollection_
std::string PFSuperClusterCollection_
Definition: PFPhotonTranslator.cc:90
reco::CaloCluster::seed
DetId seed() const
return DetId of seed
Definition: CaloCluster.h:219
edm::ESGetToken< EcalMustacheSCParameters, EcalMustacheSCParametersRcd >
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PFPhotonTranslator::mustacheSCParams_
const EcalMustacheSCParameters * mustacheSCParams_
Definition: PFPhotonTranslator.cc:139
reco::PFBlockElement
Abstract base class for a PFBlock element (track, cluster...)
Definition: PFBlockElement.h:26
reco::Photon::IsolationVariables::trkSumPtHollowCone
float trkSumPtHollowCone
Definition: Photon.h:422
reco::CaloCluster::position
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:154
edm::Ptr< PFCandidate >
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
ValueMap.h
reco::Photon::FiducialFlags::isEBEtaGap
bool isEBEtaGap
Definition: Photon.h:98
PFBlock.h
reco::Photon
Definition: Photon.h:22
PFPhotonTranslator::createPreshowerClusterPtrs
void createPreshowerClusterPtrs(const edm::OrphanHandle< reco::PreshowerClusterCollection > &preshowerClustersHandle)
Definition: PFPhotonTranslator.cc:647
bookConverter.elements
elements
Definition: bookConverter.py:147
reco::Photon::ShowerShape
Definition: Photon.h:138
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
PFPhotonTranslator
Definition: PFPhotonTranslator.cc:34
edm::OrphanHandle
Definition: EDProductfwd.h:39
PFPhotonTranslator::createOneLegConversions
void createOneLegConversions(const edm::OrphanHandle< reco::SuperClusterCollection > &superClustersHandle, reco::ConversionCollection &oneLegConversions)
Definition: PFPhotonTranslator.cc:753
reco::Photon::PflowIDVariables
Definition: Photon.h:559
HltBtagValidation_cff.Vertex
Vertex
Definition: HltBtagValidation_cff.py:32
reco::Photon::IsolationVariables::nTrkHollowCone
int nTrkHollowCone
Definition: Photon.h:426
PFPhotonTranslator::createPhotonCores
void createPhotonCores(const edm::OrphanHandle< reco::SuperClusterCollection > &superClustersHandle, const edm::OrphanHandle< reco::ConversionCollection > &oneLegConversionHandle, reco::PhotonCoreCollection &photonCores)
Definition: PFPhotonTranslator.cc:837
PFPhotonTranslator::pfPhotonMva_
std::vector< float > pfPhotonMva_
Definition: PFPhotonTranslator.cc:122
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:19
Vertex.h
gedPhotons_cfi.outputPhotonCollection
outputPhotonCollection
Definition: gedPhotons_cfi.py:31
PFPhotonTranslator::egSCRef_
std::vector< reco::SuperClusterRef > egSCRef_
Definition: PFPhotonTranslator.cc:118
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
spclusmultinvestigator_cfi.vertexCollection
vertexCollection
Definition: spclusmultinvestigator_cfi.py:4
reco::CaloCluster::algo
AlgoId algo() const
algorithm identifier
Definition: CaloCluster.h:190
LorentzVector
math::XYZTLorentzVector LorentzVector
Definition: HLTMuonMatchAndPlot.h:49
reco::SuperCluster::rawEnergy
double rawEnergy() const
raw uncorrected energy (sum of energies of component BasicClusters)
Definition: SuperCluster.h:58
math::Error::type
ErrorD< N >::type type
Definition: Error.h:32
SuperCluster.h
PFClusterWidthAlgo
Definition: PFClusterWidthAlgo.h:6
PFPhotonTranslator::preshowerClusterPtr_
std::vector< reco::CaloClusterPtrVector > preshowerClusterPtr_
Definition: PFPhotonTranslator.cc:112
reco::PFCandidateCollection
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
Definition: PFCandidateFwd.h:12
reco::PFCluster
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:42
reco::CaloCluster::caloID
const CaloID & caloID() const
Definition: CaloCluster.h:201
reco::Photon::PflowIDVariables::nClusterOutsideMustache
int nClusterOutsideMustache
Definition: Photon.h:560
math::XYZVectorF
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float > > XYZVectorF
spatial vector with cartesian internal representation
Definition: Vector3D.h:16
PFPhotonTranslator::pfConv_
std::vector< reco::ConversionRefVector > pfConv_
Definition: PFPhotonTranslator.cc:127
reco::Photon::SaturationInfo::isSeedSaturated
bool isSeedSaturated
Definition: Photon.h:301
reco::SuperCluster::setPhiWidth
void setPhiWidth(double pw)
Definition: SuperCluster.h:73
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
reco::Photon::PflowIsolationVariables::photonIso
float photonIso
Definition: Photon.h:525
BeamSpotPI::Y
Definition: BeamSpotPayloadInspectorHelper.h:32
PFPhotonTranslator::createPhotons
void createPhotons(reco::VertexCollection &vertexCollection, edm::Handle< reco::PhotonCollection > &egPhotons, const edm::OrphanHandle< reco::PhotonCoreCollection > &photonCoresHandle, const IsolationValueMaps &isolationValues, reco::PhotonCollection &photons)
Definition: PFPhotonTranslator.cc:924
reco::PFBlockElement::type
Type type() const
Definition: PFBlockElement.h:69
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
reco::PhotonCollection
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
PFPhotonTranslator::createBasicClusterPtrs
void createBasicClusterPtrs(const edm::OrphanHandle< reco::BasicClusterCollection > &basicClustersHandle)
Definition: PFPhotonTranslator.cc:628
PFPhotonTranslator::emptyIsOk_
bool emptyIsOk_
Definition: PFPhotonTranslator.cc:141
reco::PFBlockElement::PS1
Definition: PFBlockElement.h:33
ParameterSet.h
reco::Photon::regression2
Definition: Photon.h:314
PFPhotonTranslator::ecalMustacheSCParametersToken_
edm::ESGetToken< EcalMustacheSCParameters, EcalMustacheSCParametersRcd > ecalMustacheSCParametersToken_
Definition: PFPhotonTranslator.cc:138
BeamSpotPI::Z
Definition: BeamSpotPayloadInspectorHelper.h:33
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
reco::PFBlockElement::index
unsigned index() const
Definition: PFBlockElement.h:86
math::XYZPointF
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
Definition: Point3D.h:10
edm::Event
Definition: Event.h:73
Vector
math::XYZVector Vector
Definition: PFPhotonTranslator.cc:152
edm::RefVector::size
size_type size() const
Size of the RefVector.
Definition: RefVector.h:102
Vector3D.h
PFPhotonTranslator::theCaloTopo_
edm::ESHandle< CaloTopology > theCaloTopo_
Definition: PFPhotonTranslator.cc:134
edm::InputTag
Definition: InputTag.h:15
PFPhotonTranslator::egPhotonRef_
std::vector< reco::PhotonRef > egPhotonRef_
Definition: PFPhotonTranslator.cc:120
reco::Vertex
Definition: Vertex.h:35
RecoTauValidation_cfi.posY
posY
Definition: RecoTauValidation_cfi.py:288
reco::PhotonCore::setParentSuperCluster
void setParentSuperCluster(const reco::SuperClusterRef &r)
set reference to PFlow SuperCluster
Definition: PhotonCore.h:50
PFPhotonTranslator::PFBasicClusterCollection_
std::string PFBasicClusterCollection_
Definition: PFPhotonTranslator.cc:88
reco::PFBlockElement::PS2
Definition: PFBlockElement.h:34
edm::OwnVector< reco::PFBlockElement >
reco::Conversion::pflow
Definition: Conversion.h:25
PFPhotonTranslator::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: PFPhotonTranslator.cc:198
PFPhotonTranslator::energyRegression_
std::vector< float > energyRegression_
Definition: PFPhotonTranslator.cc:123
PFPhotonTranslator::IsolationValueMaps
std::vector< edm::Handle< edm::ValueMap< double > > > IsolationValueMaps
Definition: PFPhotonTranslator.cc:41
PFPhotonTranslator::conv1legPFCandidateIndex_
std::vector< int > conv1legPFCandidateIndex_
Definition: PFPhotonTranslator.cc:131
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
reco::PFBlockElement::clusterRef
virtual const PFClusterRef & clusterRef() const
Definition: PFBlockElement.h:90
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
PFPhotonTranslator::PFPhotonCoreCollection_
std::string PFPhotonCoreCollection_
Definition: PFPhotonTranslator.cc:91
PFPhotonTranslator::theCaloGeom_
edm::ESHandle< CaloGeometry > theCaloGeom_
Definition: PFPhotonTranslator.cc:135