170 std::vector<edm::Handle<edm::Association<reco::GenParticleCollection> > >genMatches(
genMatchTokens_.size());
194 std::vector<edm::Handle<edm::ValueMap<Bool_t> > > idhandles;
195 std::vector<pat::Photon::IdPair> ids;
216 std::vector<Photon> * PATPhotons =
new std::vector<Photon>();
219 unsigned int idx = itPhoton - photons->begin();
222 Photon aPhoton(photonRef);
223 auto phoPtr = photons -> ptrAt(idx);
229 std::vector<DetId> selectedCells;
230 bool barrel = itPhoton->isEB();
233 for (
reco::CaloCluster_iterator clusIt = itPhoton->superCluster()->clustersBegin(); clusIt!=itPhoton->superCluster()->clustersEnd(); ++clusIt) {
235 DetId seed = lazyTools.getMaximum(**clusIt).first;
239 selectedCells.insert(selectedCells.end(), dets5x5.begin(), dets5x5.end());
242 for (
const std::pair<DetId, float> &
hit : (*clusIt)->hitsAndFractions()) {
243 selectedCells.push_back(
hit.first);
249 std::sort(selectedCells.begin(),selectedCells.end());
250 std::unique(selectedCells.begin(),selectedCells.end());
264 if(photonRef->
superCluster()->seed()->hitsAndFractions().at(0).first.subdetId()==
EcalBarrel ) recHits = recHitsEBHandle.product();
271 unsigned nSelectedCells = selectedCells.
size();
272 for (
unsigned icell = 0 ; icell < nSelectedCells ; ++icell) {
274 if ( it != recHits->
end() ) {
278 selectedRecHits.
sort();
283 for(
size_t i = 0,
n = genMatches.size();
i <
n; ++
i) {
285 aPhoton.addGenParticleRef(genPhoton);
304 aPhoton.setIsolation(it->first, it->second);
308 for (
size_t j = 0, nd =
deposits.size(); j < nd; ++j) {
319 ids[
i].second = (*idhandles[
i])[photonRef];
321 aPhoton.setPhotonIDs(ids);
330 bool passelectronveto =
false;
335 aPhoton.setPassElectronVeto( passelectronveto );
342 aPhoton.setSeedEnergy( photonRef->
superCluster()->seed()->energy() );
348 recHitsEBHandle.product(),recHitsEEHandle.
product(),
351 aPhoton.setEMax( ecalRegData.
eMax() );
352 aPhoton.setE2nd( ecalRegData.
e2nd() );
353 aPhoton.setE3x3( ecalRegData.
e3x3() );
354 aPhoton.setETop( ecalRegData.
eTop() );
355 aPhoton.setEBottom( ecalRegData.
eBottom() );
356 aPhoton.setELeft( ecalRegData.
eLeft() );
357 aPhoton.setERight( ecalRegData.
eRight() );
385 aPhoton.setEBottom(0);
387 aPhoton.setERight(0);
393 aPhoton.setMaxDRDPhi(0);
394 aPhoton.setMaxDRDEta(0);
395 aPhoton.setMaxDRRawEnergy(0);
396 aPhoton.setSubClusRawE1(0);
397 aPhoton.setSubClusRawE2(0);
398 aPhoton.setSubClusRawE3(0);
399 aPhoton.setSubClusDPhi1(0);
400 aPhoton.setSubClusDPhi2(0);
401 aPhoton.setSubClusDPhi3(0);
402 aPhoton.setSubClusDEta1(0);
403 aPhoton.setSubClusDEta2(0);
404 aPhoton.setSubClusDEta3(0);
406 aPhoton.setCryPhi(0);
407 aPhoton.setCryEta(0);
412 if (
addPuppiIsolation_)aPhoton.setIsolationPUPPI((*PUPPIIsolation_charged_hadrons)[phoPtr], (*PUPPIIsolation_neutral_hadrons)[phoPtr], (*PUPPIIsolation_photons)[phoPtr]);
413 else aPhoton.setIsolationPUPPI(-999., -999.,-999.);
429 aPhoton.setPflowIsolationVariables(newPFIsol);
433 PATPhotons->push_back(aPhoton);
440 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_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< edm::Handle< edm::ValueMap< double > > > IsolationValueMaps
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_
std::vector< edm::Handle< edm::ValueMap< IsoDeposit > > > IsoDepositMaps
pat::helper::MultiIsolator isolator_
float seedCrysEtaOrX() const
const_iterator end() const
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
std::vector< std::pair< pat::IsolationKeys, float > > IsolationValuePairs
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_
edm::EDGetTokenT< reco::ConversionCollection > hConversionsToken_
void fill(const edm::View< T > &coll, int idx, IsolationValuePairs &isolations) const
edm::EDGetTokenT< reco::GsfElectronCollection > electronToken_