304 if (
iEvent.isRealData()) {
334 std::vector<edm::Handle<edm::Association<reco::GenParticleCollection>>> genMatches(
genMatchTokens_.size());
360 std::vector<edm::Handle<edm::ValueMap<Bool_t>>> idhandles;
361 std::vector<pat::Photon::IdPair> ids;
382 std::vector<Photon>* PATPhotons =
new std::vector<Photon>();
385 unsigned int idx = itPhoton -
photons->begin();
388 Photon aPhoton(photonRef);
391 aPhoton.embedSuperCluster();
393 aPhoton.embedSeedCluster();
395 aPhoton.embedBasicClusters();
397 aPhoton.embedPreshowerClusters();
399 std::vector<DetId> selectedCells;
400 bool barrel = itPhoton->isEB();
404 clusIt != itPhoton->superCluster()->clustersEnd();
407 DetId seed = lazyTools.getMaximum(**clusIt).first;
409 std::vector<DetId> dets5x5 =
412 selectedCells.insert(selectedCells.end(), dets5x5.begin(), dets5x5.end());
415 for (
const std::pair<DetId, float>&
hit : (*clusIt)->hitsAndFractions()) {
416 selectedCells.push_back(
hit.first);
422 std::sort(selectedCells.begin(), selectedCells.end());
423 std::unique(selectedCells.begin(), selectedCells.end());
436 recHits = recHitsEBHandle.product();
442 unsigned nSelectedCells = selectedCells.
size();
443 for (
unsigned icell = 0; icell < nSelectedCells; ++icell) {
449 selectedRecHits.
sort();
451 aPhoton.embedRecHits(&selectedRecHits);
455 for (
size_t i = 0,
n = genMatches.size();
i <
n; ++
i) {
457 aPhoton.addGenParticleRef(genPhoton);
460 aPhoton.embedGenParticle();
480 aPhoton.setIsolation(it->first, it->second);
484 for (
size_t j = 0, nd =
deposits.size();
j < nd; ++
j) {
495 ids[
i].second = (*idhandles[
i])[photonRef];
497 aPhoton.setPhotonIDs(ids);
505 bool passelectronveto =
false;
511 aPhoton.setPassElectronVeto(passelectronveto);
517 aPhoton.setSeedEnergy(photonRef->
superCluster()->seed()->energy());
523 recHitsEBHandle.product(),
529 aPhoton.setEMax(ecalRegData.
eMax());
530 aPhoton.setE2nd(ecalRegData.
e2nd());
531 aPhoton.setE3x3(ecalRegData.
e3x3());
532 aPhoton.setETop(ecalRegData.
eTop());
533 aPhoton.setEBottom(ecalRegData.
eBottom());
534 aPhoton.setELeft(ecalRegData.
eLeft());
535 aPhoton.setERight(ecalRegData.
eRight());
566 aPhoton.setEBottom(0);
568 aPhoton.setERight(0);
574 aPhoton.setMaxDRDPhi(0);
575 aPhoton.setMaxDRDEta(0);
576 aPhoton.setMaxDRRawEnergy(0);
577 aPhoton.setSubClusRawE1(0);
578 aPhoton.setSubClusRawE2(0);
579 aPhoton.setSubClusRawE3(0);
580 aPhoton.setSubClusDPhi1(0);
581 aPhoton.setSubClusDPhi2(0);
582 aPhoton.setSubClusDPhi3(0);
583 aPhoton.setSubClusDEta1(0);
584 aPhoton.setSubClusDEta2(0);
585 aPhoton.setSubClusDEta3(0);
587 aPhoton.setCryPhi(0);
588 aPhoton.setCryEta(0);
594 aPhoton.setIsolationPUPPI((*PUPPIIsolation_charged_hadrons)[phoPtr],
595 (*PUPPIIsolation_neutral_hadrons)[phoPtr],
596 (*PUPPIIsolation_photons)[phoPtr]);
598 aPhoton.setIsolationPUPPI(-999., -999., -999.);
613 aPhoton.setPflowIsolationVariables(newPFIsol);
617 PATPhotons->push_back(aPhoton);
624 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_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
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_
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_