315 if (
iEvent.isRealData()) {
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);
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();
453 unsigned nSelectedCells = selectedCells.
size();
454 for (
unsigned icell = 0; icell < nSelectedCells; ++icell) {
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) {
506 ids[
i].second = (*idhandles[
i])[photonRef];
508 aPhoton.setPhotonIDs(ids);
516 bool passelectronveto =
false;
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);
635 std::unique_ptr<std::vector<Photon>> myPhotons(PATPhotons);
float maxSubClusDRDEta() const
bool hasPixelSeed() const
Bool flagging photons having a non-zero size vector of Ref to electornPixel seeds.
bool embedPreshowerClusters_
bool enabled() const
'true' if this there is at least one efficiency configured
float sigmaIPhiIPhi() const
void newEvent(const edm::Event &event)
To be called for each new event, reads in the ValueMaps for efficiencies.
float seedCrysPhiOrY() const
pat::PATUserDataHelper< pat::Photon > userDataHelper_
edm::EDGetTokenT< EcalRecHitCollection > reducedEndcapRecHitCollectionToken_
float maxSubClusDRDPhi() const
bool enabled() const
True if it has a non null configuration.
std::vector< edm::Handle< edm::ValueMap< IsoDeposit > > > IsoDepositMaps
const Point & position() const
position
float seedCrysIPhiOrIY() const
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
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)
float maxSubClusDRRawEnergy() const
edm::EDGetTokenT< reco::BeamSpot > beamLineToken_
T const * product() const
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)
std::vector< edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > > genMatchTokens_
float seedCrysEtaOrX() const
pat::helper::KinResolutionsLoader resolutionLoader_
edm::EDGetTokenT< edm::ValueMap< float > > hcalPFClusterIsoT_
GreaterByEt< Photon > eTComparator_
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
const CaloGeometry * ecalGeometry_
float seedCrysIEtaOrIX() const
void fill(const edm::View< T > &coll, int idx, IsolationValuePairs &isolations) const
IsolationLabels isoDepositLabels_
const std::vector< float > & subClusDEta() const
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
const std::vector< float > & subClusDPhi() const
void beginEvent(const edm::Event &event, const edm::EventSetup &eventSetup)
const CaloTopology * ecalTopology_
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
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.
def unique(seq, keepstr=True)
bool enabled() const
'true' if this there is at least one efficiency configured
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_photons_
bool getData(T &iHolder) const
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
std::vector< NameTag > photIDSrcs_
pat::helper::MultiIsolator isolator_
void add(ObjectType &patObject, edm::Event const &iEvent, edm::EventSetup const &iSetup)
float sigmaIEtaIEta() const
std::vector< std::pair< pat::IsolationKeys, float > > IsolationValuePairs
float sigmaIEtaIPhi() const
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_charged_hadrons_
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
float maxSubClusDR() 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
const std::vector< float > & subClusRawEnergy() const
edm::EDGetTokenT< reco::ConversionCollection > hConversionsToken_
edm::EDGetTokenT< reco::GsfElectronCollection > electronToken_