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);
234 auto phoPtr = photons->ptrAt(idx);
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();
283 recHits = recHitsEEHandle.
product();
287 unsigned nSelectedCells = selectedCells.
size();
288 for (
unsigned icell = 0; icell < nSelectedCells; ++icell) {
290 if (it != recHits->
end()) {
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);
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
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_
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
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
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 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_
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
def unique(seq, keepstr=True)
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
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
edm::EDGetTokenT< edm::ValueMap< float > > PUPPIIsolation_neutral_hadrons_
bool isUninitialized() const
const Point & position() const
position
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_