Definition at line 144 of file PATPhotonProducer.cc.
146 if (
iEvent.isRealData()) {
179 std::vector<edm::Handle<edm::Association<reco::GenParticleCollection>>> genMatches(
genMatchTokens_.size());
205 std::vector<edm::Handle<edm::ValueMap<Bool_t>>> idhandles;
206 std::vector<pat::Photon::IdPair> ids;
227 std::vector<Photon> *PATPhotons =
new std::vector<Photon>();
230 unsigned int idx = itPhoton -
photons->begin();
233 Photon aPhoton(photonRef);
236 aPhoton.embedSuperCluster();
238 aPhoton.embedSeedCluster();
240 aPhoton.embedBasicClusters();
242 aPhoton.embedPreshowerClusters();
244 std::vector<DetId> selectedCells;
245 bool barrel = itPhoton->isEB();
249 clusIt != itPhoton->superCluster()->clustersEnd();
252 DetId seed = lazyTools.getMaximum(**clusIt).first;
254 std::vector<DetId> dets5x5 =
257 selectedCells.insert(selectedCells.end(), dets5x5.begin(), dets5x5.end());
260 for (
const std::pair<DetId, float> &
hit : (*clusIt)->hitsAndFractions()) {
261 selectedCells.push_back(
hit.first);
267 std::sort(selectedCells.begin(), selectedCells.end());
268 std::unique(selectedCells.begin(), selectedCells.end());
281 recHits = recHitsEBHandle.product();
287 unsigned nSelectedCells = selectedCells.
size();
288 for (
unsigned icell = 0; icell < nSelectedCells; ++icell) {
294 selectedRecHits.
sort();
296 aPhoton.embedRecHits(&selectedRecHits);
300 for (
size_t i = 0,
n = genMatches.size();
i <
n; ++
i) {
302 aPhoton.addGenParticleRef(genPhoton);
305 aPhoton.embedGenParticle();
325 aPhoton.setIsolation(it->first, it->second);
329 for (
size_t j = 0, nd =
deposits.size();
j < nd; ++
j) {
340 ids[
i].second = (*idhandles[
i])[photonRef];
342 aPhoton.setPhotonIDs(ids);
350 bool passelectronveto =
false;
356 aPhoton.setPassElectronVeto(passelectronveto);
362 aPhoton.setSeedEnergy(photonRef->
superCluster()->seed()->energy());
368 recHitsEBHandle.product(),
374 aPhoton.setEMax(ecalRegData.
eMax());
375 aPhoton.setE2nd(ecalRegData.
e2nd());
376 aPhoton.setE3x3(ecalRegData.
e3x3());
377 aPhoton.setETop(ecalRegData.
eTop());
378 aPhoton.setEBottom(ecalRegData.
eBottom());
379 aPhoton.setELeft(ecalRegData.
eLeft());
380 aPhoton.setERight(ecalRegData.
eRight());
411 aPhoton.setEBottom(0);
413 aPhoton.setERight(0);
419 aPhoton.setMaxDRDPhi(0);
420 aPhoton.setMaxDRDEta(0);
421 aPhoton.setMaxDRRawEnergy(0);
422 aPhoton.setSubClusRawE1(0);
423 aPhoton.setSubClusRawE2(0);
424 aPhoton.setSubClusRawE3(0);
425 aPhoton.setSubClusDPhi1(0);
426 aPhoton.setSubClusDPhi2(0);
427 aPhoton.setSubClusDPhi3(0);
428 aPhoton.setSubClusDEta1(0);
429 aPhoton.setSubClusDEta2(0);
430 aPhoton.setSubClusDEta3(0);
432 aPhoton.setCryPhi(0);
433 aPhoton.setCryEta(0);
439 aPhoton.setIsolationPUPPI((*PUPPIIsolation_charged_hadrons)[phoPtr],
440 (*PUPPIIsolation_neutral_hadrons)[phoPtr],
441 (*PUPPIIsolation_photons)[phoPtr]);
443 aPhoton.setIsolationPUPPI(-999., -999., -999.);
458 aPhoton.setPflowIsolationVariables(newPFIsol);
462 PATPhotons->push_back(aPhoton);
466 std::sort(PATPhotons->begin(), PATPhotons->end(),
eTComparator_);
469 std::unique_ptr<std::vector<Photon>> myPhotons(PATPhotons);
References pat::PATUserDataHelper< ObjectType >::add(), addGenMatch_, pat::PATObject< ObjectType >::addGenParticleRef(), addPFClusterIso_, addPhotonID_, addPuppiIsolation_, Reference_intrackfit_cff::barrel, beamLineToken_, pat::helper::MultiIsolator::beginEvent(), EcalRegressionData::C1, EcalRegressionData::C2, EcalRegressionData::C3, CandIsolatorFromDeposits_cfi::deposits, EcalRegressionData::e2nd(), EcalRegressionData::e3x3(), EcalRegressionData::eBottom(), DetId::Ecal, EcalBarrel, EcalEndcap, ecalGeometry_, ecalPFClusterIsoT_, ecalTopology_, efficiencyLoader_, electronToken_, EcalRegressionData::eLeft(), EcalRegressionData::eMax(), pat::Photon::embedBasicClusters(), embedBasicClusters_, embedGenMatch_, pat::PATObject< ObjectType >::embedGenParticle(), pat::Photon::embedPreshowerClusters(), embedPreshowerClusters_, pat::Photon::embedRecHits(), embedRecHits_, pat::Photon::embedSeedCluster(), embedSeedCluster_, pat::Photon::embedSuperCluster(), embedSuperCluster_, pat::helper::EfficiencyLoader::enabled(), pat::helper::KinResolutionsLoader::enabled(), pat::helper::MultiIsolator::enabled(), pat::helper::MultiIsolator::endEvent(), EcalRegressionData::eRight(), eTComparator_, EcalRegressionData::eTop(), pat::helper::MultiIsolator::fill(), EcalRegressionData::fill(), dqmdumpme::first, genMatchTokens_, edm::EventSetup::get(), get, reco::Photon::getPflowIsolationVariables(), CaloTopology::getSubdetectorTopology(), CaloSubdetectorTopology::getWindow(), ConversionTools::hasMatchedPromptElectron(), reco::Photon::hasPixelSeed(), hcalPFClusterIsoT_, hConversionsToken_, mps_fire::i, training_settings::idx, iEvent, isoDepositLabels_, isoDepositTokens_, isolationValueLabels_, electronProducer_cff::isolationValues, isolationValueTokens_, isolator_, isolatorTmpStorage_, edm::EDGetTokenT< T >::isUninitialized(), edm::HandleBase::isValid(), dqmiolumiharvest::j, EcalRegressionData::maxSubClusDR(), EcalRegressionData::maxSubClusDRDEta(), EcalRegressionData::maxSubClusDRDPhi(), EcalRegressionData::maxSubClusDRRawEnergy(), eostools::move(), dqmiodumpmetadata::n, pat::helper::EfficiencyLoader::newEvent(), pat::helper::KinResolutionsLoader::newEvent(), photIDSrcs_, photIDTokens_, BPHMonitor_cfi::photons, photonToken_, reco::BeamSpot::position(), edm::Handle< T >::product(), PUPPIIsolation_charged_hadrons_, PUPPIIsolation_neutral_hadrons_, PUPPIIsolation_photons_, edm::SortedCollection< T, SORT >::push_back(), FastTrackerRecHitMaskProducer_cfi::recHits, reducedBarrelRecHitCollectionToken_, reducedEndcapRecHitCollectionToken_, resolutionLoader_, saveRegressionData_, SurveyInfoScenario_cff::seed, EcalRegressionData::seedCrysEtaOrX(), EcalRegressionData::seedCrysIEtaOrIX(), EcalRegressionData::seedCrysIPhiOrIY(), EcalRegressionData::seedCrysPhiOrY(), pat::Photon::setCryEta(), pat::Photon::setCryPhi(), pat::Photon::setE2nd(), pat::Photon::setE3x3(), pat::Photon::setEBottom(), pat::helper::EfficiencyLoader::setEfficiencies(), pat::Photon::setELeft(), pat::Photon::setEMax(), pat::Photon::setERight(), pat::Photon::setETop(), pat::Photon::setHasPixelSeed(), pat::Photon::setIEta(), pat::Photon::setIPhi(), pat::Photon::setIsoDeposit(), pat::Photon::setIsolation(), pat::Photon::setIsolationPUPPI(), pat::Photon::setMaxDR(), pat::Photon::setMaxDRDEta(), pat::Photon::setMaxDRDPhi(), pat::Photon::setMaxDRRawEnergy(), pat::Photon::setPassElectronVeto(), reco::Photon::setPflowIsolationVariables(), pat::Photon::setPhotonIDs(), pat::helper::KinResolutionsLoader::setResolutions(), pat::Photon::setSee(), pat::Photon::setSeedEnergy(), pat::Photon::setSep(), pat::Photon::setSpp(), pat::Photon::setSubClusDEta1(), pat::Photon::setSubClusDEta2(), pat::Photon::setSubClusDEta3(), pat::Photon::setSubClusDPhi1(), pat::Photon::setSubClusDPhi2(), pat::Photon::setSubClusDPhi3(), pat::Photon::setSubClusRawE1(), pat::Photon::setSubClusRawE2(), pat::Photon::setSubClusRawE3(), EcalRegressionData::sigmaIEtaIEta(), EcalRegressionData::sigmaIEtaIPhi(), EcalRegressionData::sigmaIPhiIPhi(), edm::SortedCollection< T, SORT >::size(), edm::SortedCollection< T, SORT >::sort(), EcalRegressionData::subClusDEta(), EcalRegressionData::subClusDPhi(), EcalRegressionData::subClusRawEnergy(), reco::Photon::PflowIsolationVariables::sumEcalClusterEt, reco::Photon::PflowIsolationVariables::sumHcalClusterEt, reco::Photon::superCluster(), tier0::unique(), userDataHelper_, and useUserData_.