301 if (
iEvent.isRealData()) {
331 std::vector<edm::Handle<edm::Association<reco::GenParticleCollection>>> genMatches(
genMatchTokens_.size());
357 std::vector<edm::Handle<edm::ValueMap<Bool_t>>> idhandles;
358 std::vector<pat::Photon::IdPair> ids;
379 std::vector<Photon>* PATPhotons =
new std::vector<Photon>();
382 unsigned int idx = itPhoton -
photons->begin();
385 Photon aPhoton(photonRef);
388 aPhoton.embedSuperCluster();
390 aPhoton.embedSeedCluster();
392 aPhoton.embedBasicClusters();
394 aPhoton.embedPreshowerClusters();
396 std::vector<DetId> selectedCells;
397 bool barrel = itPhoton->isEB();
401 clusIt != itPhoton->superCluster()->clustersEnd();
404 DetId seed = lazyTools.getMaximum(**clusIt).first;
406 std::vector<DetId> dets5x5 =
409 selectedCells.insert(selectedCells.end(), dets5x5.begin(), dets5x5.end());
412 for (
const std::pair<DetId, float>&
hit : (*clusIt)->hitsAndFractions()) {
413 selectedCells.push_back(
hit.first);
419 std::sort(selectedCells.begin(), selectedCells.end());
420 std::unique(selectedCells.begin(), selectedCells.end());
433 recHits = recHitsEBHandle.product();
439 unsigned nSelectedCells = selectedCells.
size();
440 for (
unsigned icell = 0; icell < nSelectedCells; ++icell) {
446 selectedRecHits.
sort();
448 aPhoton.embedRecHits(&selectedRecHits);
452 for (
size_t i = 0,
n = genMatches.size();
i <
n; ++
i) {
454 aPhoton.addGenParticleRef(genPhoton);
457 aPhoton.embedGenParticle();
477 aPhoton.setIsolation(
it->first,
it->second);
481 for (
size_t j = 0, nd =
deposits.size();
j < nd; ++
j) {
492 ids[
i].second = (*idhandles[
i])[photonRef];
494 aPhoton.setPhotonIDs(ids);
502 bool passelectronveto =
false;
508 aPhoton.setPassElectronVeto(passelectronveto);
514 aPhoton.setSeedEnergy(photonRef->
superCluster()->seed()->energy());
520 recHitsEBHandle.product(),
526 aPhoton.setEMax(ecalRegData.
eMax());
527 aPhoton.setE2nd(ecalRegData.
e2nd());
528 aPhoton.setE3x3(ecalRegData.
e3x3());
529 aPhoton.setETop(ecalRegData.
eTop());
530 aPhoton.setEBottom(ecalRegData.
eBottom());
531 aPhoton.setELeft(ecalRegData.
eLeft());
532 aPhoton.setERight(ecalRegData.
eRight());
563 aPhoton.setEBottom(0);
565 aPhoton.setERight(0);
571 aPhoton.setMaxDRDPhi(0);
572 aPhoton.setMaxDRDEta(0);
573 aPhoton.setMaxDRRawEnergy(0);
574 aPhoton.setSubClusRawE1(0);
575 aPhoton.setSubClusRawE2(0);
576 aPhoton.setSubClusRawE3(0);
577 aPhoton.setSubClusDPhi1(0);
578 aPhoton.setSubClusDPhi2(0);
579 aPhoton.setSubClusDPhi3(0);
580 aPhoton.setSubClusDEta1(0);
581 aPhoton.setSubClusDEta2(0);
582 aPhoton.setSubClusDEta3(0);
584 aPhoton.setCryPhi(0);
585 aPhoton.setCryEta(0);
591 aPhoton.setIsolationPUPPI((*PUPPIIsolation_charged_hadrons)[phoPtr],
592 (*PUPPIIsolation_neutral_hadrons)[phoPtr],
593 (*PUPPIIsolation_photons)[phoPtr]);
595 aPhoton.setIsolationPUPPI(-999., -999., -999.);
610 aPhoton.setPflowIsolationVariables(newPFIsol);
614 PATPhotons->push_back(aPhoton);
621 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_