CMS 3D CMS Logo

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