345 std::vector<edm::Handle<edm::Association<reco::GenParticleCollection>>> genMatches(
genMatchTokens_.size());
371 std::vector<edm::Handle<edm::ValueMap<Bool_t>>> idhandles;
372 std::vector<pat::Photon::IdPair> ids;
393 std::vector<Photon>* PATPhotons =
new std::vector<Photon>();
396 unsigned int idx = itPhoton - photons->begin();
399 Photon aPhoton(photonRef);
400 auto phoPtr = photons->ptrAt(idx);
402 aPhoton.embedSuperCluster();
404 aPhoton.embedSeedCluster();
406 aPhoton.embedBasicClusters();
408 aPhoton.embedPreshowerClusters();
410 std::vector<DetId> selectedCells;
411 bool barrel = itPhoton->isEB();
415 clusIt != itPhoton->superCluster()->clustersEnd();
418 DetId seed = lazyTools.getMaximum(**clusIt).first;
420 std::vector<DetId> dets5x5 =
423 selectedCells.insert(selectedCells.end(), dets5x5.begin(), dets5x5.end());
426 for (
const std::pair<DetId, float>&
hit : (*clusIt)->hitsAndFractions()) {
427 selectedCells.push_back(
hit.first);
433 std::sort(selectedCells.begin(), selectedCells.end());
434 std::unique(selectedCells.begin(), selectedCells.end());
447 recHits = recHitsEBHandle.product();
449 recHits = recHitsEEHandle.
product();
453 unsigned nSelectedCells = selectedCells.
size();
454 for (
unsigned icell = 0; icell < nSelectedCells; ++icell) {
456 if (it != recHits->
end()) {
460 selectedRecHits.
sort();
462 aPhoton.embedRecHits(&selectedRecHits);
466 for (
size_t i = 0,
n = genMatches.size();
i <
n; ++
i) {
468 aPhoton.addGenParticleRef(genPhoton);
471 aPhoton.embedGenParticle();
491 aPhoton.setIsolation(it->first, it->second);
495 for (
size_t j = 0, nd = deposits.size();
j < nd; ++
j) {
499 for (
size_t j = 0;
j < isolationValues.size(); ++
j) {
506 ids[
i].second = (*idhandles[
i])[photonRef];
508 aPhoton.setPhotonIDs(ids);
516 bool passelectronveto =
false;
520 photonRef->
superCluster(), *hElectrons, *hConversions, beamSpotHandle->position());
522 aPhoton.setPassElectronVeto(passelectronveto);
528 aPhoton.setSeedEnergy(photonRef->
superCluster()->seed()->energy());
534 recHitsEBHandle.product(),
540 aPhoton.setEMax(ecalRegData.
eMax());
541 aPhoton.setE2nd(ecalRegData.
e2nd());
542 aPhoton.setE3x3(ecalRegData.
e3x3());
543 aPhoton.setETop(ecalRegData.
eTop());
544 aPhoton.setEBottom(ecalRegData.
eBottom());
545 aPhoton.setELeft(ecalRegData.
eLeft());
546 aPhoton.setERight(ecalRegData.
eRight());
577 aPhoton.setEBottom(0);
579 aPhoton.setERight(0);
585 aPhoton.setMaxDRDPhi(0);
586 aPhoton.setMaxDRDEta(0);
587 aPhoton.setMaxDRRawEnergy(0);
588 aPhoton.setSubClusRawE1(0);
589 aPhoton.setSubClusRawE2(0);
590 aPhoton.setSubClusRawE3(0);
591 aPhoton.setSubClusDPhi1(0);
592 aPhoton.setSubClusDPhi2(0);
593 aPhoton.setSubClusDPhi3(0);
594 aPhoton.setSubClusDEta1(0);
595 aPhoton.setSubClusDEta2(0);
596 aPhoton.setSubClusDEta3(0);
598 aPhoton.setCryPhi(0);
599 aPhoton.setCryEta(0);
605 aPhoton.setIsolationPUPPI((*PUPPIIsolation_charged_hadrons)[phoPtr],
606 (*PUPPIIsolation_neutral_hadrons)[phoPtr],
607 (*PUPPIIsolation_photons)[phoPtr]);
609 aPhoton.setIsolationPUPPI(-999., -999., -999.);
624 aPhoton.setPflowIsolationVariables(newPFIsol);
628 PATPhotons->push_back(aPhoton);
632 std::sort(PATPhotons->begin(), PATPhotons->end(),
eTComparator_);
635 std::unique_ptr<std::vector<Photon>> myPhotons(PATPhotons);
bool enabled() const
'true' if this there is at least one efficiency configured
float sigmaIPhiIPhi() const
bool embedPreshowerClusters_
void newEvent(const edm::Event &event)
To be called for each new event, reads in the ValueMaps for efficiencies.
const std::vector< float > & subClusRawEnergy() const
Analysis-level Photon class.
pat::PATUserDataHelper< pat::Photon > userDataHelper_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
float maxSubClusDRRawEnergy() const
float maxSubClusDRDEta() const
edm::EDGetTokenT< EcalRecHitCollection > reducedEndcapRecHitCollectionToken_
std::vector< edm::Handle< edm::ValueMap< IsoDeposit > > > IsoDepositMaps
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< edm::EDGetTokenT< edm::ValueMap< Bool_t > > > photIDTokens_
void fill(const reco::SuperCluster &superClus, const EcalRecHitCollection *ebRecHits, const EcalRecHitCollection *eeRecHits, const CaloGeometry *geom, const CaloTopology *topology, const reco::VertexCollection *vertices)
edm::EDGetTokenT< reco::BeamSpot > beamLineToken_
constexpr bool isUninitialized() const noexcept
edm::EDGetTokenT< edm::View< reco::Photon > > photonToken_
std::vector< EcalRecHit >::const_iterator const_iterator
edm::EDGetTokenT< edm::ValueMap< float > > ecalPFClusterIsoT_
void push_back(T const &t)
float seedCrysPhiOrY() const
std::vector< edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > > genMatchTokens_
pat::helper::KinResolutionsLoader resolutionLoader_
float sigmaIEtaIEta() const
edm::EDGetTokenT< edm::ValueMap< float > > hcalPFClusterIsoT_
GreaterByEt< Photon > eTComparator_
const CaloGeometry * ecalGeometry_
float sigmaIEtaIPhi() const
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
bool enabled() const
'true' if this there is at least one efficiency configured
bool getData(T &iHolder) const
bool enabled() const
True if it has a non null configuration.
IsolationLabels isoDepositLabels_
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
void beginEvent(const edm::Event &event, const edm::EventSetup &eventSetup)
const CaloTopology * ecalTopology_
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
float seedCrysIPhiOrIY() const
IsolationLabels isolationValueLabels_
std::vector< edm::EDGetTokenT< edm::ValueMap< IsoDeposit > > > isoDepositTokens_
pat::helper::EfficiencyLoader efficiencyLoader_
void newEvent(const edm::Event &event, const edm::EventSetup &setup)
To be called for each new event, reads in the EventSetup object.
float maxSubClusDR() const
float seedCrysIEtaOrIX() const
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_photons_
float maxSubClusDRDPhi() const
std::vector< NameTag > photIDSrcs_
pat::helper::MultiIsolator isolator_
float seedCrysEtaOrX() const
const_iterator end() const
std::vector< std::pair< pat::IsolationKeys, float > > IsolationValuePairs
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_charged_hadrons_
T const * product() const
bool hasPixelSeed() const
Bool flagging photons having a non-zero size vector of Ref to electornPixel seeds.
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
const std::vector< float > & subClusDEta() const
iterator find(key_type k)
const std::vector< float > & subClusDPhi() const
const EcalClusterLazyTools::ESGetTokens ecalClusterToolsESGetTokens_
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
const edm::ESGetToken< CaloTopology, CaloTopologyRecord > ecalTopologyToken_
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_neutral_hadrons_
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > ecalGeometryToken_
edm::EDGetTokenT< EcalRecHitCollection > reducedBarrelRecHitCollectionToken_
std::vector< edm::EDGetTokenT< edm::ValueMap< double > > > isolationValueTokens_
std::vector< edm::Handle< edm::ValueMap< double > > > IsolationValueMaps
edm::EDGetTokenT< reco::ConversionCollection > hConversionsToken_
void fill(const edm::View< T > &coll, int idx, IsolationValuePairs &isolations) const
edm::EDGetTokenT< reco::GsfElectronCollection > electronToken_