CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
PFPhotonTranslator Class Reference
Inheritance diagram for PFPhotonTranslator:
edm::stream::EDProducer<>

Public Types

typedef std::vector< edm::Handle< edm::ValueMap< double > > > IsolationValueMaps
 
- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Public Member Functions

 PFPhotonTranslator (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~PFPhotonTranslator () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Member Functions

const reco::PFCandidatecorrespondingDaughterCandidate (const reco::PFCandidate &cand, const reco::PFBlockElement &pfbe) const
 
void createBasicCluster (const reco::PFBlockElement &, reco::BasicClusterCollection &basicClusters, std::vector< const reco::PFCluster * > &, const reco::PFCandidate &coCandidate) const
 
void createBasicClusterPtrs (const edm::OrphanHandle< reco::BasicClusterCollection > &basicClustersHandle)
 
void createOneLegConversions (const edm::OrphanHandle< reco::SuperClusterCollection > &superClustersHandle, reco::ConversionCollection &oneLegConversions)
 
void createPhotonCores (const edm::OrphanHandle< reco::SuperClusterCollection > &superClustersHandle, const edm::OrphanHandle< reco::ConversionCollection > &oneLegConversionHandle, reco::PhotonCoreCollection &photonCores)
 
void createPhotons (reco::VertexCollection &vertexCollection, edm::Handle< reco::PhotonCollection > &egPhotons, const edm::OrphanHandle< reco::PhotonCoreCollection > &photonCoresHandle, const IsolationValueMaps &isolationValues, reco::PhotonCollection &photons)
 
void createPreshowerCluster (const reco::PFBlockElement &PFBE, reco::PreshowerClusterCollection &preshowerClusters, unsigned plane) const
 
void createPreshowerClusterPtrs (const edm::OrphanHandle< reco::PreshowerClusterCollection > &preshowerClustersHandle)
 
void createSuperClusters (const reco::PFCandidateCollection &, reco::SuperClusterCollection &superClusters) const
 
bool fetchCandidateCollection (edm::Handle< reco::PFCandidateCollection > &c, const edm::InputTag &tag, const edm::Event &iEvent) const
 

Private Attributes

edm::InputTag barrelEcalHits_
 
std::vector< reco::CaloClusterPtrVectorbasicClusterPtr_
 
std::vector< reco::BasicClusterCollectionbasicClusters_
 
std::vector< reco::CandidatePtrCandidatePtr_
 
std::vector< int > conv1legPFCandidateIndex_
 
std::vector< int > conv2legPFCandidateIndex_
 
std::string EGPhotonCollection_
 
std::vector< reco::PhotonRefegPhotonRef_
 
std::vector< reco::SuperClusterRefegSCRef_
 
bool emptyIsOk_
 
edm::InputTag endcapEcalHits_
 
std::vector< float > energyRegression_
 
std::vector< float > energyRegressionError_
 
edm::InputTag hcalTowers_
 
double hOverEConeSize_
 
std::vector< edm::InputTaginputTagIsoVals_
 
edm::InputTag inputTagPFCandidates_
 
std::string PFBasicClusterCollection_
 
std::vector< std::vector< const reco::PFCluster * > > pfClusters_
 
std::vector< reco::ConversionRefVectorpfConv_
 
std::string PFConversionCollection_
 
std::string PFPhotonCollection_
 
std::string PFPhotonCoreCollection_
 
std::vector< float > pfPhotonMva_
 
std::string PFPreshowerClusterCollection_
 
std::vector< std::vector< reco::TrackRef > > pfSingleLegConv_
 
std::vector< std::vector< float > > pfSingleLegConvMva_
 
std::string PFSuperClusterCollection_
 
std::vector< int > photPFCandidateIndex_
 
std::vector< reco::CaloClusterPtrVectorpreshowerClusterPtr_
 
std::vector< reco::PreshowerClusterCollectionpreshowerClusters_
 
std::vector< reco::SuperClusterCollectionsuperClusters_
 
edm::ESHandle< CaloGeometrytheCaloGeom_
 
edm::ESHandle< CaloTopologytheCaloTopo_
 
std::string vertexProducer_
 

Detailed Description

Definition at line 32 of file PFPhotonTranslator.cc.

Member Typedef Documentation

◆ IsolationValueMaps

Definition at line 39 of file PFPhotonTranslator.cc.

Constructor & Destructor Documentation

◆ PFPhotonTranslator()

PFPhotonTranslator::PFPhotonTranslator ( const edm::ParameterSet iConfig)
explicit

Definition at line 148 of file PFPhotonTranslator.cc.

148  {
149  //std::cout << "PFPhotonTranslator" << std::endl;
150 
151  inputTagPFCandidates_ = iConfig.getParameter<edm::InputTag>("PFCandidate");
152 
153  edm::ParameterSet isoVals = iConfig.getParameter<edm::ParameterSet>("isolationValues");
154  inputTagIsoVals_.push_back(isoVals.getParameter<edm::InputTag>("pfChargedHadrons"));
155  inputTagIsoVals_.push_back(isoVals.getParameter<edm::InputTag>("pfPhotons"));
156  inputTagIsoVals_.push_back(isoVals.getParameter<edm::InputTag>("pfNeutralHadrons"));
157 
158  PFBasicClusterCollection_ = iConfig.getParameter<std::string>("PFBasicClusters");
159  PFPreshowerClusterCollection_ = iConfig.getParameter<std::string>("PFPreshowerClusters");
160  PFSuperClusterCollection_ = iConfig.getParameter<std::string>("PFSuperClusters");
161  PFConversionCollection_ = iConfig.getParameter<std::string>("PFConversionCollection");
162  PFPhotonCoreCollection_ = iConfig.getParameter<std::string>("PFPhotonCores");
163  PFPhotonCollection_ = iConfig.getParameter<std::string>("PFPhotons");
164 
165  EGPhotonCollection_ = iConfig.getParameter<std::string>("EGPhotons");
166 
167  vertexProducer_ = iConfig.getParameter<std::string>("primaryVertexProducer");
168 
169  barrelEcalHits_ = iConfig.getParameter<edm::InputTag>("barrelEcalHits");
170  endcapEcalHits_ = iConfig.getParameter<edm::InputTag>("endcapEcalHits");
171 
172  hcalTowers_ = iConfig.getParameter<edm::InputTag>("hcalTowers");
173  hOverEConeSize_ = iConfig.getParameter<double>("hOverEConeSize");
174 
175  if (iConfig.exists("emptyIsOk"))
176  emptyIsOk_ = iConfig.getParameter<bool>("emptyIsOk");
177  else
178  emptyIsOk_ = false;
179 
180  produces<reco::BasicClusterCollection>(PFBasicClusterCollection_);
181  produces<reco::PreshowerClusterCollection>(PFPreshowerClusterCollection_);
182  produces<reco::SuperClusterCollection>(PFSuperClusterCollection_);
183  produces<reco::PhotonCoreCollection>(PFPhotonCoreCollection_);
184  produces<reco::PhotonCollection>(PFPhotonCollection_);
185  produces<reco::ConversionCollection>(PFConversionCollection_);
186 }

References edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~PFPhotonTranslator()

PFPhotonTranslator::~PFPhotonTranslator ( )
override

Definition at line 188 of file PFPhotonTranslator.cc.

188 {}

Member Function Documentation

◆ correspondingDaughterCandidate()

const reco::PFCandidate & PFPhotonTranslator::correspondingDaughterCandidate ( const reco::PFCandidate cand,
const reco::PFBlockElement pfbe 
) const
private

Definition at line 1071 of file PFPhotonTranslator.cc.

1072  {
1073  unsigned refindex = pfbe.index();
1074  // std::cout << " N daughters " << cand.numberOfDaughters() << std::endl;
1075  reco::PFCandidate::const_iterator myDaughterCandidate = cand.begin();
1077 
1078  for (; myDaughterCandidate != itend; ++myDaughterCandidate) {
1079  const reco::PFCandidate *myPFCandidate = (const reco::PFCandidate *)&*myDaughterCandidate;
1080  if (myPFCandidate->elementsInBlocks().size() != 1) {
1081  // std::cout << " Daughter with " << myPFCandidate.elementsInBlocks().size()<< " element in block " << std::endl;
1082  return cand;
1083  }
1084  if (myPFCandidate->elementsInBlocks()[0].second == refindex) {
1085  // std::cout << " Found it " << cand << std::endl;
1086  return *myPFCandidate;
1087  }
1088  }
1089  return cand;
1090 }

References reco::PFCandidate::elementsInBlocks(), and reco::PFBlockElement::index().

◆ createBasicCluster()

void PFPhotonTranslator::createBasicCluster ( const reco::PFBlockElement PFBE,
reco::BasicClusterCollection basicClusters,
std::vector< const reco::PFCluster * > &  pfClusters,
const reco::PFCandidate coCandidate 
) const
private

Definition at line 588 of file PFPhotonTranslator.cc.

591  {
592  const reco::PFClusterRef &myPFClusterRef = PFBE.clusterRef();
593  if (myPFClusterRef.isNull())
594  return;
595 
596  const reco::PFCluster &myPFCluster(*myPFClusterRef);
597  pfClusters.push_back(&myPFCluster);
598  //std::cout << " Creating BC " << myPFCluster.energy() << " " << coCandidate.ecalEnergy() <<" "<< coCandidate.rawEcalEnergy() <<std::endl;
599  //std::cout << " # hits " << myPFCluster.hitsAndFractions().size() << std::endl;
600 
601  // basicClusters.push_back(reco::CaloCluster(myPFCluster.energy(),
602  basicClusters.push_back(reco::CaloCluster( //coCandidate.rawEcalEnergy(),
603  myPFCluster.energy(),
604  myPFCluster.position(),
605  myPFCluster.caloID(),
606  myPFCluster.hitsAndFractions(),
607  myPFCluster.algo(),
608  myPFCluster.seed()));
609 }

References reco::CaloCluster::algo(), reco::CaloCluster::caloID(), reco::PFBlockElement::clusterRef(), reco::PFCluster::energy(), reco::CaloCluster::hitsAndFractions(), edm::Ref< C, T, F >::isNull(), reco::CaloCluster::position(), and reco::CaloCluster::seed().

◆ createBasicClusterPtrs()

void PFPhotonTranslator::createBasicClusterPtrs ( const edm::OrphanHandle< reco::BasicClusterCollection > &  basicClustersHandle)
private

Definition at line 619 of file PFPhotonTranslator.cc.

620  {
621  unsigned size = photPFCandidateIndex_.size();
622  unsigned basicClusterCounter = 0;
623  basicClusterPtr_.resize(size);
624 
625  for (unsigned iphot = 0; iphot < size; ++iphot) // loop on tracks
626  {
627  unsigned nbc = basicClusters_[iphot].size();
628  for (unsigned ibc = 0; ibc < nbc; ++ibc) // loop on basic clusters
629  {
630  // std::cout << "Track "<< iGSF << " ref " << basicClusterCounter << std::endl;
631  reco::CaloClusterPtr bcPtr(basicClustersHandle, basicClusterCounter);
632  basicClusterPtr_[iphot].push_back(bcPtr);
633  ++basicClusterCounter;
634  }
635  }
636 }

References findQualityFiles::size.

◆ createOneLegConversions()

void PFPhotonTranslator::createOneLegConversions ( const edm::OrphanHandle< reco::SuperClusterCollection > &  superClustersHandle,
reco::ConversionCollection oneLegConversions 
)
private

Definition at line 744 of file PFPhotonTranslator.cc.

746  {
747  //std::cout << "createOneLegConversions" << std::endl;
748 
749  unsigned nphot = photPFCandidateIndex_.size();
750  for (unsigned iphot = 0; iphot < nphot; ++iphot) {
751  //if (conv1legPFCandidateIndex_[iphot]==-1) cout << "No OneLegConversions to add"<<endl;
752  //else std::cout << "Phot "<<iphot<< " nOneLegConversions to add : "<<pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]].size()<<endl;
753 
754  if (conv1legPFCandidateIndex_[iphot] > -1) {
755  for (unsigned iConv = 0; iConv < pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]].size(); iConv++) {
757  std::vector<reco::CaloClusterPtr> matchingBC;
759  const reco::Vertex *convVtx =
760  new reco::Vertex(pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->innerPosition(), error);
761 
762  //cout << "Vtx x="<<convVtx->x() << " y="<< convVtx->y()<<" z="<<convVtx->z()<< endl;
763  //cout << "VtxError x=" << convVtx->xError() << endl;
764 
765  std::vector<reco::TrackRef> OneLegConvVector;
766  OneLegConvVector.push_back(pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]);
767 
768  std::vector<reco::TrackRef> tr = OneLegConvVector;
769  std::vector<math::XYZPointF> trackPositionAtEcalVec;
770  std::vector<math::XYZPointF> innPointVec;
771  std::vector<math::XYZVectorF> trackPinVec;
772  std::vector<math::XYZVectorF> trackPoutVec;
773  math::XYZPointF trackPositionAtEcal(
774  pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->outerPosition().X(),
775  pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->outerPosition().Y(),
776  pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->outerPosition().Z());
777  math::XYZPointF innPoint(pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->innerPosition().X(),
778  pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->innerPosition().Y(),
779  pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->innerPosition().Z());
780  math::XYZVectorF trackPin(pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->innerMomentum().X(),
781  pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->innerMomentum().Y(),
782  pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->innerMomentum().Z());
783  math::XYZVectorF trackPout(pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->outerMomentum().X(),
784  pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->outerMomentum().Y(),
785  pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->outerMomentum().Z());
786  float DCA = pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]][iConv]->d0();
787  trackPositionAtEcalVec.push_back(trackPositionAtEcal);
788  innPointVec.push_back(innPoint);
789  trackPinVec.push_back(trackPin);
790  trackPoutVec.push_back(trackPout);
791  std::vector<float> OneLegMvaVector;
792  reco::Conversion myOneLegConversion(scPtrVec,
793  OneLegConvVector,
794  trackPositionAtEcalVec,
795  *convVtx,
796  matchingBC,
797  DCA,
798  innPointVec,
799  trackPinVec,
800  trackPoutVec,
803  OneLegMvaVector.push_back(pfSingleLegConvMva_[conv1legPFCandidateIndex_[iphot]][iConv]);
804  myOneLegConversion.setOneLegMVA(OneLegMvaVector);
805  //reco::Conversion myOneLegConversion(scPtrVec,
806  //OneLegConvVector, *convVtx, reco::Conversion::pflow);
807 
808  /*
809  std::cout << "One leg conversion created" << endl;
810  std::vector<edm::RefToBase<reco::Track> > convtracks = myOneLegConversion.tracks();
811  const std::vector<float> mvalist = myOneLegConversion.oneLegMVA();
812 
813  cout << "nTracks="<< convtracks.size()<<endl;
814  for (unsigned int itk=0; itk<convtracks.size(); itk++){
815  //double convtrackpt = convtracks[itk]->pt();
816  std::cout << "Track pt="<< convtracks[itk]->pt() << std::endl;
817  std::cout << "Track mva="<< mvalist[itk] << std::endl;
818  }
819  */
820  oneLegConversions.push_back(myOneLegConversion);
821 
822  //cout << "OneLegConv added"<<endl;
823  }
824  }
825  }
826 }

References relativeConstraints::error, reco::Conversion::pflow, reco::Conversion::setOneLegMVA(), HltBtagValidation_cff::Vertex, X, DOFs::Y, and DOFs::Z.

◆ createPhotonCores()

void PFPhotonTranslator::createPhotonCores ( const edm::OrphanHandle< reco::SuperClusterCollection > &  superClustersHandle,
const edm::OrphanHandle< reco::ConversionCollection > &  oneLegConversionHandle,
reco::PhotonCoreCollection photonCores 
)
private

Definition at line 828 of file PFPhotonTranslator.cc.

830  {
831  //std::cout << "createPhotonCores" << std::endl;
832 
833  unsigned nphot = photPFCandidateIndex_.size();
834 
835  unsigned i1legtot = 0;
836 
837  for (unsigned iphot = 0; iphot < nphot; ++iphot) {
838  //std::cout << "iphot="<<iphot<<std::endl;
839 
840  reco::PhotonCore myPhotonCore;
841 
842  reco::SuperClusterRef SCref(reco::SuperClusterRef(superClustersHandle, iphot));
843 
844  myPhotonCore.setPFlowPhoton(true);
845  myPhotonCore.setStandardPhoton(false);
846  myPhotonCore.setParentSuperCluster(SCref);
847  myPhotonCore.setSuperCluster(egSCRef_[iphot]);
848 
849  reco::ElectronSeedRefVector pixelSeeds = egPhotonRef_[iphot]->electronPixelSeeds();
850  for (unsigned iseed = 0; iseed < pixelSeeds.size(); iseed++) {
851  myPhotonCore.addElectronPixelSeed(pixelSeeds[iseed]);
852  }
853 
854  //cout << "PhotonCores : SC OK" << endl;
855 
856  //cout << "conv1legPFCandidateIndex_[iphot]="<<conv1legPFCandidateIndex_[iphot]<<endl;
857  //cout << "conv2legPFCandidateIndex_[iphot]="<<conv2legPFCandidateIndex_[iphot]<<endl;
858 
859  if (conv1legPFCandidateIndex_[iphot] > -1) {
860  for (unsigned int iConv = 0; iConv < pfSingleLegConv_[conv1legPFCandidateIndex_[iphot]].size(); iConv++) {
861  const reco::ConversionRef &OneLegRef(reco::ConversionRef(oneLegConversionHandle, i1legtot));
862  myPhotonCore.addOneLegConversion(OneLegRef);
863 
864  //cout << "PhotonCores : 1-leg OK" << endl;
865  /*
866  cout << "Testing 1-leg :"<<endl;
867  const reco::ConversionRefVector & conv = myPhotonCore.conversionsOneLeg();
868  for (unsigned int iconv=0; iconv<conv.size(); iconv++){
869  cout << "Testing 1-leg : iconv="<<iconv<<endl;
870  cout << "Testing 1-leg : nTracks="<<conv[iconv]->nTracks()<<endl;
871  cout << "Testing 1-leg : EoverP="<<conv[iconv]->EoverP()<<endl;
872  std::vector<edm::RefToBase<reco::Track> > convtracks = conv[iconv]->tracks();
873  for (unsigned int itk=0; itk<convtracks.size(); itk++){
874  //double convtrackpt = convtracks[itk]->pt();
875  std::cout << "Testing 1-leg : Track pt="<< convtracks[itk]->pt() << std::endl;
876  // std::cout << "Track mva="<< mvalist[itk] << std::endl;
877  }
878  }
879  */
880 
881  i1legtot++;
882  }
883  }
884 
885  if (conv2legPFCandidateIndex_[iphot] > -1) {
886  for (unsigned int iConv = 0; iConv < pfConv_[conv2legPFCandidateIndex_[iphot]].size(); iConv++) {
887  const reco::ConversionRef &TwoLegRef(pfConv_[conv2legPFCandidateIndex_[iphot]][iConv]);
888  myPhotonCore.addConversion(TwoLegRef);
889  }
890  //cout << "PhotonCores : 2-leg OK" << endl;
891 
892  /*
893  cout << "Testing 2-leg :"<<endl;
894  const reco::ConversionRefVector & conv = myPhotonCore.conversions();
895  for (unsigned int iconv=0; iconv<conv.size(); iconv++){
896  cout << "Testing 2-leg : iconv="<<iconv<<endl;
897  cout << "Testing 2-leg : nTracks="<<conv[iconv]->nTracks()<<endl;
898  cout << "Testing 2-leg : EoverP="<<conv[iconv]->EoverP()<<endl;
899  std::vector<edm::RefToBase<reco::Track> > convtracks = conv[iconv]->tracks();
900  for (unsigned int itk=0; itk<convtracks.size(); itk++){
901  //double convtrackpt = convtracks[itk]->pt();
902  std::cout << "Testing 2-leg : Track pt="<< convtracks[itk]->pt() << std::endl;
903  // std::cout << "Track mva="<< mvalist[itk] << std::endl;
904  }
905  }
906  */
907  }
908 
909  photonCores.push_back(myPhotonCore);
910  }
911 
912  //std::cout << "end of createPhotonCores"<<std::endl;
913 }

References reco::PhotonCore::addConversion(), reco::PhotonCore::addElectronPixelSeed(), reco::PhotonCore::addOneLegConversion(), iseed, reco::PhotonCore::setParentSuperCluster(), reco::PhotonCore::setPFlowPhoton(), reco::PhotonCore::setStandardPhoton(), reco::PhotonCore::setSuperCluster(), and edm::RefVector< C, T, F >::size().

◆ createPhotons()

void PFPhotonTranslator::createPhotons ( reco::VertexCollection vertexCollection,
edm::Handle< reco::PhotonCollection > &  egPhotons,
const edm::OrphanHandle< reco::PhotonCoreCollection > &  photonCoresHandle,
const IsolationValueMaps isolationValues,
reco::PhotonCollection photons 
)
private

Definition at line 915 of file PFPhotonTranslator.cc.

919  {
920  //cout << "createPhotons" << endl;
921 
922  unsigned nphot = photPFCandidateIndex_.size();
923 
924  for (unsigned iphot = 0; iphot < nphot; ++iphot) {
925  //std::cout << "iphot="<<iphot<<std::endl;
926 
927  reco::PhotonCoreRef PCref(reco::PhotonCoreRef(photonCoresHandle, iphot));
928 
929  math::XYZPoint vtx(0., 0., 0.);
930  if (!vertexCollection.empty())
931  vtx = vertexCollection.begin()->position();
932  //std::cout << "vtx made" << std::endl;
933 
934  math::XYZVector direction = PCref->parentSuperCluster()->position() - vtx;
935 
936  //It could be that pfSC energy gives not the best resolution : use smaller agregates for some cases ?
937  math::XYZVector P3 = direction.unit() * PCref->parentSuperCluster()->energy();
938  LorentzVector P4(P3.x(), P3.y(), P3.z(), PCref->parentSuperCluster()->energy());
939 
940  reco::Photon myPhoton(P4, PCref->parentSuperCluster()->position(), PCref, vtx);
941  //cout << "photon created"<<endl;
942 
943  reco::Photon::ShowerShape showerShape;
944  reco::Photon::SaturationInfo saturationInfo;
945  reco::Photon::FiducialFlags fiducialFlags;
946  reco::Photon::IsolationVariables isolationVariables03;
947  reco::Photon::IsolationVariables isolationVariables04;
948 
949  showerShape.e1x5 = egPhotonRef_[iphot]->e1x5();
950  showerShape.e2x5 = egPhotonRef_[iphot]->e2x5();
951  showerShape.e3x3 = egPhotonRef_[iphot]->e3x3();
952  showerShape.e5x5 = egPhotonRef_[iphot]->e5x5();
953  showerShape.maxEnergyXtal = egPhotonRef_[iphot]->maxEnergyXtal();
954  showerShape.sigmaEtaEta = egPhotonRef_[iphot]->sigmaEtaEta();
955  showerShape.sigmaIetaIeta = egPhotonRef_[iphot]->sigmaIetaIeta();
956  showerShape.hcalDepth1OverEcal = egPhotonRef_[iphot]->hadronicDepth1OverEm();
957  showerShape.hcalDepth2OverEcal = egPhotonRef_[iphot]->hadronicDepth2OverEm();
958  myPhoton.setShowerShapeVariables(showerShape);
959 
960  saturationInfo.nSaturatedXtals = egPhotonRef_[iphot]->nSaturatedXtals();
961  saturationInfo.isSeedSaturated = egPhotonRef_[iphot]->isSeedSaturated();
962  myPhoton.setSaturationInfo(saturationInfo);
963 
964  fiducialFlags.isEB = egPhotonRef_[iphot]->isEB();
965  fiducialFlags.isEE = egPhotonRef_[iphot]->isEE();
966  fiducialFlags.isEBEtaGap = egPhotonRef_[iphot]->isEBEtaGap();
967  fiducialFlags.isEBPhiGap = egPhotonRef_[iphot]->isEBPhiGap();
968  fiducialFlags.isEERingGap = egPhotonRef_[iphot]->isEERingGap();
969  fiducialFlags.isEEDeeGap = egPhotonRef_[iphot]->isEEDeeGap();
970  fiducialFlags.isEBEEGap = egPhotonRef_[iphot]->isEBEEGap();
971  myPhoton.setFiducialVolumeFlags(fiducialFlags);
972 
973  isolationVariables03.ecalRecHitSumEt = egPhotonRef_[iphot]->ecalRecHitSumEtConeDR03();
974  isolationVariables03.hcalTowerSumEt = egPhotonRef_[iphot]->hcalTowerSumEtConeDR03();
975  isolationVariables03.hcalDepth1TowerSumEt = egPhotonRef_[iphot]->hcalDepth1TowerSumEtConeDR03();
976  isolationVariables03.hcalDepth2TowerSumEt = egPhotonRef_[iphot]->hcalDepth2TowerSumEtConeDR03();
977  isolationVariables03.trkSumPtSolidCone = egPhotonRef_[iphot]->trkSumPtSolidConeDR03();
978  isolationVariables03.trkSumPtHollowCone = egPhotonRef_[iphot]->trkSumPtHollowConeDR03();
979  isolationVariables03.nTrkSolidCone = egPhotonRef_[iphot]->nTrkSolidConeDR03();
980  isolationVariables03.nTrkHollowCone = egPhotonRef_[iphot]->nTrkHollowConeDR03();
981  isolationVariables04.ecalRecHitSumEt = egPhotonRef_[iphot]->ecalRecHitSumEtConeDR04();
982  isolationVariables04.hcalTowerSumEt = egPhotonRef_[iphot]->hcalTowerSumEtConeDR04();
983  isolationVariables04.hcalDepth1TowerSumEt = egPhotonRef_[iphot]->hcalDepth1TowerSumEtConeDR04();
984  isolationVariables04.hcalDepth2TowerSumEt = egPhotonRef_[iphot]->hcalDepth2TowerSumEtConeDR04();
985  isolationVariables04.trkSumPtSolidCone = egPhotonRef_[iphot]->trkSumPtSolidConeDR04();
986  isolationVariables04.trkSumPtHollowCone = egPhotonRef_[iphot]->trkSumPtHollowConeDR04();
987  isolationVariables04.nTrkSolidCone = egPhotonRef_[iphot]->nTrkSolidConeDR04();
988  isolationVariables04.nTrkHollowCone = egPhotonRef_[iphot]->nTrkHollowConeDR04();
989  myPhoton.setIsolationVariables(isolationVariables04, isolationVariables03);
990 
992  myPFIso.chargedHadronIso = (*isolationValues[0])[CandidatePtr_[iphot]];
993  myPFIso.photonIso = (*isolationValues[1])[CandidatePtr_[iphot]];
994  myPFIso.neutralHadronIso = (*isolationValues[2])[CandidatePtr_[iphot]];
995  myPhoton.setPflowIsolationVariables(myPFIso);
996 
997  reco::Photon::PflowIDVariables myPFVariables;
998 
999  reco::Mustache myMustache;
1000  myMustache.MustacheID(
1001  *(myPhoton.parentSuperCluster()), myPFVariables.nClusterOutsideMustache, myPFVariables.etOutsideMustache);
1002  myPFVariables.mva = pfPhotonMva_[iphot];
1003  myPhoton.setPflowIDVariables(myPFVariables);
1004 
1005  //cout << "chargedHadronIso="<<myPhoton.chargedHadronIso()<<" photonIso="<<myPhoton.photonIso()<<" neutralHadronIso="<<myPhoton.neutralHadronIso()<<endl;
1006 
1007  // set PF-regression energy
1008  myPhoton.setCorrectedEnergy(
1010 
1011  /*
1012  if (basicClusters_[iphot].size()>0){
1013  // Cluster shape variables
1014  //Algorithms from EcalClusterTools could be adapted to PF photons ? (not based on 5x5 BC)
1015  //It happens that energy computed in eg e5x5 is greater than pfSC energy (EcalClusterTools gathering energies from adjacent crystals even if not belonging to the SC)
1016  const EcalRecHitCollection* hits = 0 ;
1017  int subdet = PCref->parentSuperCluster()->seed()->hitsAndFractions()[0].first.subdetId();
1018  if (subdet==EcalBarrel) hits = barrelRecHits;
1019  else if (subdet==EcalEndcap) hits = endcapRecHits;
1020  const CaloGeometry* geometry = theCaloGeom_.product();
1021 
1022  float maxXtal = EcalClusterTools::eMax( *(PCref->parentSuperCluster()->seed()), &(*hits) );
1023  //cout << "maxXtal="<<maxXtal<<endl;
1024  float e1x5 = EcalClusterTools::e1x5( *(PCref->parentSuperCluster()->seed()), &(*hits), &(*topology));
1025  //cout << "e1x5="<<e1x5<<endl;
1026  float e2x5 = EcalClusterTools::e2x5Max( *(PCref->parentSuperCluster()->seed()), &(*hits), &(*topology));
1027  //cout << "e2x5="<<e2x5<<endl;
1028  float e3x3 = EcalClusterTools::e3x3( *(PCref->parentSuperCluster()->seed()), &(*hits), &(*topology));
1029  //cout << "e3x3="<<e3x3<<endl;
1030  float e5x5 = EcalClusterTools::e5x5( *(PCref->parentSuperCluster()->seed()), &(*hits), &(*topology));
1031  //cout << "e5x5="<<e5x5<<endl;
1032  std::vector<float> cov = EcalClusterTools::covariances( *(PCref->parentSuperCluster()->seed()), &(*hits), &(*topology), geometry);
1033  float sigmaEtaEta = sqrt(cov[0]);
1034  //cout << "sigmaEtaEta="<<sigmaEtaEta<<endl;
1035  std::vector<float> locCov = EcalClusterTools::localCovariances( *(PCref->parentSuperCluster()->seed()), &(*hits), &(*topology));
1036  float sigmaIetaIeta = sqrt(locCov[0]);
1037  //cout << "sigmaIetaIeta="<<sigmaIetaIeta<<endl;
1038  //float r9 =e3x3/(PCref->parentSuperCluster()->rawEnergy());
1039 
1040 
1041  // calculate HoE
1042  const CaloTowerCollection* hcalTowersColl = hcalTowersHandle.product();
1043  EgammaTowerIsolation towerIso1(hOverEConeSize_,0.,0.,1,hcalTowersColl) ;
1044  EgammaTowerIsolation towerIso2(hOverEConeSize_,0.,0.,2,hcalTowersColl) ;
1045  double HoE1=towerIso1.getTowerESum(&(*PCref->parentSuperCluster()))/PCref->pfSuperCluster()->energy();
1046  double HoE2=towerIso2.getTowerESum(&(*PCref->parentSuperCluster()))/PCref->pfSuperCluster()->energy();
1047  //cout << "HoE1="<<HoE1<<endl;
1048  //cout << "HoE2="<<HoE2<<endl;
1049 
1050  reco::Photon::ShowerShape showerShape;
1051  showerShape.e1x5= e1x5;
1052  showerShape.e2x5= e2x5;
1053  showerShape.e3x3= e3x3;
1054  showerShape.e5x5= e5x5;
1055  showerShape.maxEnergyXtal = maxXtal;
1056  showerShape.sigmaEtaEta = sigmaEtaEta;
1057  showerShape.sigmaIetaIeta = sigmaIetaIeta;
1058  showerShape.hcalDepth1OverEcal = HoE1;
1059  showerShape.hcalDepth2OverEcal = HoE2;
1060  myPhoton.setShowerShapeVariables ( showerShape );
1061  //cout << "shower shape variables filled"<<endl;
1062  }
1063  */
1064 
1065  photons.push_back(myPhoton);
1066  }
1067 
1068  //std::cout << "end of createPhotons"<<std::endl;
1069 }

References reco::Photon::PflowIsolationVariables::chargedHadronIso, reco::Photon::IsolationVariables::ecalRecHitSumEt, reco::Photon::PflowIDVariables::etOutsideMustache, reco::Photon::IsolationVariables::hcalDepth1TowerSumEt, reco::Photon::IsolationVariables::hcalDepth2TowerSumEt, reco::Photon::IsolationVariables::hcalTowerSumEt, reco::Photon::FiducialFlags::isEB, reco::Photon::FiducialFlags::isEBEEGap, reco::Photon::FiducialFlags::isEBEtaGap, reco::Photon::FiducialFlags::isEBPhiGap, reco::Photon::FiducialFlags::isEE, reco::Photon::FiducialFlags::isEEDeeGap, reco::Photon::FiducialFlags::isEERingGap, electronProducer_cff::isolationValues, reco::Photon::SaturationInfo::isSeedSaturated, reco::Mustache::MustacheID(), reco::Photon::PflowIDVariables::mva, reco::Photon::PflowIDVariables::nClusterOutsideMustache, reco::Photon::PflowIsolationVariables::neutralHadronIso, reco::Photon::SaturationInfo::nSaturatedXtals, reco::Photon::IsolationVariables::nTrkHollowCone, reco::Photon::IsolationVariables::nTrkSolidCone, reco::Photon::PflowIsolationVariables::photonIso, BPHMonitor_cfi::photons, reco::Photon::regression2, reco::Photon::IsolationVariables::trkSumPtHollowCone, reco::Photon::IsolationVariables::trkSumPtSolidCone, spclusmultinvestigator_cfi::vertexCollection, and badGlobalMuonTaggersAOD_cff::vtx.

◆ createPreshowerCluster()

void PFPhotonTranslator::createPreshowerCluster ( const reco::PFBlockElement PFBE,
reco::PreshowerClusterCollection preshowerClusters,
unsigned  plane 
) const
private

Definition at line 611 of file PFPhotonTranslator.cc.

613  {
614  const reco::PFClusterRef &myPFClusterRef = PFBE.clusterRef();
615  preshowerClusters.push_back(reco::PreshowerCluster(
616  myPFClusterRef->energy(), myPFClusterRef->position(), myPFClusterRef->hitsAndFractions(), plane));
617 }

References reco::PFBlockElement::clusterRef().

◆ createPreshowerClusterPtrs()

void PFPhotonTranslator::createPreshowerClusterPtrs ( const edm::OrphanHandle< reco::PreshowerClusterCollection > &  preshowerClustersHandle)
private

Definition at line 638 of file PFPhotonTranslator.cc.

639  {
640  unsigned size = photPFCandidateIndex_.size();
641  unsigned psClusterCounter = 0;
642  preshowerClusterPtr_.resize(size);
643 
644  for (unsigned iphot = 0; iphot < size; ++iphot) // loop on tracks
645  {
646  unsigned nbc = preshowerClusters_[iphot].size();
647  for (unsigned ibc = 0; ibc < nbc; ++ibc) // loop on basic clusters
648  {
649  // std::cout << "Track "<< iGSF << " ref " << basicClusterCounter << std::endl;
650  reco::CaloClusterPtr psPtr(preshowerClustersHandle, psClusterCounter);
651  preshowerClusterPtr_[iphot].push_back(psPtr);
652  ++psClusterCounter;
653  }
654  }
655 }

References findQualityFiles::size.

◆ createSuperClusters()

void PFPhotonTranslator::createSuperClusters ( const reco::PFCandidateCollection pfCand,
reco::SuperClusterCollection superClusters 
) const
private

Definition at line 657 of file PFPhotonTranslator.cc.

658  {
659  unsigned nphot = photPFCandidateIndex_.size();
660  for (unsigned iphot = 0; iphot < nphot; ++iphot) {
661  //cout << "SC iphot=" << iphot << endl;
662 
663  // Computes energy position a la e/gamma
664  double sclusterE = 0;
665  double posX = 0.;
666  double posY = 0.;
667  double posZ = 0.;
668 
669  unsigned nbasics = basicClusters_[iphot].size();
670  for (unsigned ibc = 0; ibc < nbasics; ++ibc) {
671  //cout << "BC in SC : iphot="<<iphot<<endl;
672 
673  double e = basicClusters_[iphot][ibc].energy();
674  sclusterE += e;
675  posX += e * basicClusters_[iphot][ibc].position().X();
676  posY += e * basicClusters_[iphot][ibc].position().Y();
677  posZ += e * basicClusters_[iphot][ibc].position().Z();
678  }
679  posX /= sclusterE;
680  posY /= sclusterE;
681  posZ /= sclusterE;
682 
683  /*
684  if(pfCand[gsfPFCandidateIndex_[iphot]].gsfTrackRef()!=GsfTrackRef_[iphot])
685  {
686  edm::LogError("PFElectronTranslator") << " Major problem in PFElectron Translator" << std::endl;
687  }
688  */
689 
690  // compute the width
691  PFClusterWidthAlgo pfwidth(pfClusters_[iphot]);
692 
693  double correctedEnergy = pfCand[photPFCandidateIndex_[iphot]].ecalEnergy();
694  reco::SuperCluster mySuperCluster(correctedEnergy, math::XYZPoint(posX, posY, posZ));
695  // protection against empty basic cluster collection ; the value is -2 in this case
696  if (nbasics) {
697  // std::cout << "SuperCluster creation; energy " << pfCand[gsfPFCandidateIndex_[iphot]].ecalEnergy();
698  // std::cout << " " << pfCand[gsfPFCandidateIndex_[iphot]].rawEcalEnergy() << std::endl;
699  // std::cout << "Seed energy from basic " << basicClusters_[iphot][0].energy() << std::endl;
700  mySuperCluster.setSeed(basicClusterPtr_[iphot][0]);
701  } else {
702  // std::cout << "SuperCluster creation ; seed energy " << 0 << std::endl;
703  //std::cout << "SuperCluster creation ; energy " << pfCand[photPFCandidateIndex_[iphot]].ecalEnergy();
704  //std::cout << " " << pfCand[photPFCandidateIndex_[iphot]].rawEcalEnergy() << std::endl;
705  // std::cout << " No seed found " << 0 << std::endl;
706  // std::cout << " MVA " << pfCand[gsfPFCandidateIndex_[iphot]].mva_e_pi() << std::endl;
707  mySuperCluster.setSeed(reco::CaloClusterPtr());
708  }
709  // the seed should be the first basic cluster
710 
711  for (unsigned ibc = 0; ibc < nbasics; ++ibc) {
712  mySuperCluster.addCluster(basicClusterPtr_[iphot][ibc]);
713  // std::cout <<"Adding Ref to SC " << basicClusterPtr_[iphot][ibc].index() << std::endl;
714  const std::vector<std::pair<DetId, float> > &v1 = basicClusters_[iphot][ibc].hitsAndFractions();
715  // std::cout << " Number of cells " << v1.size() << std::endl;
716  for (std::vector<std::pair<DetId, float> >::const_iterator diIt = v1.begin(); diIt != v1.end(); ++diIt) {
717  // std::cout << " Adding DetId " << (diIt->first).rawId() << " " << diIt->second << std::endl;
718  mySuperCluster.addHitAndFraction(diIt->first, diIt->second);
719  } // loop over rechits
720  }
721 
722  unsigned nps = preshowerClusterPtr_[iphot].size();
723  for (unsigned ips = 0; ips < nps; ++ips) {
724  mySuperCluster.addPreshowerCluster(preshowerClusterPtr_[iphot][ips]);
725  }
726 
727  // Set the preshower energy
728  mySuperCluster.setPreshowerEnergy(pfCand[photPFCandidateIndex_[iphot]].pS1Energy() +
729  pfCand[photPFCandidateIndex_[iphot]].pS2Energy());
730 
731  // Set the cluster width
732  mySuperCluster.setEtaWidth(pfwidth.pflowEtaWidth());
733  mySuperCluster.setPhiWidth(pfwidth.pflowPhiWidth());
734  // Force the computation of rawEnergy_ of the reco::SuperCluster
735  mySuperCluster.rawEnergy();
736 
737  //cout << "SC energy="<< mySuperCluster.energy()<<endl;
738 
739  superClusters.push_back(mySuperCluster);
740  //std::cout << "nb super clusters in collection : "<<superClusters.size()<<std::endl;
741  }
742 }

References reco::SuperCluster::addCluster(), reco::CaloCluster::addHitAndFraction(), reco::SuperCluster::addPreshowerCluster(), MillePedeFileConverter_cfg::e, PFClusterWidthAlgo::pflowEtaWidth(), PFClusterWidthAlgo::pflowPhiWidth(), RecoTauValidation_cfi::posX, RecoTauValidation_cfi::posY, reco::SuperCluster::rawEnergy(), reco::SuperCluster::setEtaWidth(), reco::SuperCluster::setPhiWidth(), reco::SuperCluster::setPreshowerEnergy(), reco::SuperCluster::setSeed(), and HLT_2018_cff::superClusters.

◆ fetchCandidateCollection()

bool PFPhotonTranslator::fetchCandidateCollection ( edm::Handle< reco::PFCandidateCollection > &  c,
const edm::InputTag tag,
const edm::Event iEvent 
) const
private

Definition at line 572 of file PFPhotonTranslator.cc.

574  {
575  bool found = iEvent.getByLabel(tag, c);
576 
577  if (!found && !emptyIsOk_) {
578  std::ostringstream err;
579  err << " cannot get PFCandidates: " << tag << std::endl;
580  edm::LogError("PFPhotonTranslator") << err.str();
581  }
582  return found;
583 }

References HltBtagPostValidation_cff::c, runTheMatrix::err, newFWLiteAna::found, iEvent, and GlobalPosition_Frontier_DevDB_cff::tag.

◆ produce()

void PFPhotonTranslator::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 190 of file PFPhotonTranslator.cc.

190  {
191  //cout << "NEW EVENT"<<endl;
192 
193  auto basicClusters_p = std::make_unique<reco::BasicClusterCollection>();
194 
195  auto psClusters_p = std::make_unique<reco::PreshowerClusterCollection>();
196 
197  /*
198  auto SingleLeg_p = std::make_unique<reco::ConversionCollection>();
199  */
200 
201  reco::SuperClusterCollection outputSuperClusterCollection;
202  reco::ConversionCollection outputOneLegConversionCollection;
203  reco::PhotonCoreCollection outputPhotonCoreCollection;
205 
206  outputSuperClusterCollection.clear();
207  outputOneLegConversionCollection.clear();
208  outputPhotonCoreCollection.clear();
209  outputPhotonCollection.clear();
210 
213 
215  iEvent.getByLabel(EGPhotonCollection_, egPhotons);
216 
217  Handle<reco::VertexCollection> vertexHandle;
218 
220  for (size_t j = 0; j < inputTagIsoVals_.size(); ++j) {
221  iEvent.getByLabel(inputTagIsoVals_[j], isolationValues[j]);
222  }
223 
224  // clear the vectors
225  photPFCandidateIndex_.clear();
226  basicClusters_.clear();
227  pfClusters_.clear();
228  preshowerClusters_.clear();
229  superClusters_.clear();
230  basicClusterPtr_.clear();
231  preshowerClusterPtr_.clear();
232  CandidatePtr_.clear();
233  egSCRef_.clear();
234  egPhotonRef_.clear();
235  pfPhotonMva_.clear();
236  energyRegression_.clear();
237  energyRegressionError_.clear();
238  pfConv_.clear();
239  pfSingleLegConv_.clear();
240  pfSingleLegConvMva_.clear();
243 
244  // loop on the candidates
245  //CC@@
246  // we need first to create AND put the SuperCluster,
247  // basic clusters and presh clusters collection
248  // in order to get a working Handle
249  unsigned ncand = (status) ? pfCandidates->size() : 0;
250 
251  unsigned iphot = 0;
252  unsigned iconv1leg = 0;
253  unsigned iconv2leg = 0;
254 
255  for (unsigned i = 0; i < ncand; ++i) {
256  const reco::PFCandidate &cand = (*pfCandidates)[i];
257  if (cand.particleId() != reco::PFCandidate::gamma)
258  continue;
259  //cout << "cand.mva_nothing_gamma()="<<cand. mva_nothing_gamma()<<endl;
260  if (cand.mva_nothing_gamma() > 0.001) //Found PFPhoton with PFPhoton Extras saved
261  {
262  //cout << "NEW PHOTON" << endl;
263 
264  //std::cout << "nDoubleLegConv="<<cand.photonExtraRef()->conversionRef().size()<<std::endl;
265 
266  if (!cand.photonExtraRef()->conversionRef().empty()) {
267  pfConv_.push_back(reco::ConversionRefVector());
268 
269  const reco::ConversionRefVector &doubleLegConvColl = cand.photonExtraRef()->conversionRef();
270  for (unsigned int iconv = 0; iconv < doubleLegConvColl.size(); iconv++) {
271  pfConv_[iconv2leg].push_back(doubleLegConvColl[iconv]);
272  }
273 
274  conv2legPFCandidateIndex_.push_back(iconv2leg);
275  iconv2leg++;
276  } else
277  conv2legPFCandidateIndex_.push_back(-1);
278 
279  const std::vector<reco::TrackRef> &singleLegConvColl = cand.photonExtraRef()->singleLegConvTrackRef();
280  const std::vector<float> &singleLegConvCollMva = cand.photonExtraRef()->singleLegConvMva();
281 
282  //std::cout << "nSingleLegConv=" <<singleLegConvColl.size() << std::endl;
283 
284  if (!singleLegConvColl.empty()) {
285  pfSingleLegConv_.push_back(std::vector<reco::TrackRef>());
286  pfSingleLegConvMva_.push_back(std::vector<float>());
287 
288  //cout << "nTracks="<< singleLegConvColl.size()<<endl;
289  for (unsigned int itk = 0; itk < singleLegConvColl.size(); itk++) {
290  //cout << "Track pt="<< singleLegConvColl[itk]->pt() <<endl;
291 
292  pfSingleLegConv_[iconv1leg].push_back(singleLegConvColl[itk]);
293  pfSingleLegConvMva_[iconv1leg].push_back(singleLegConvCollMva[itk]);
294  }
295 
296  conv1legPFCandidateIndex_.push_back(iconv1leg);
297 
298  iconv1leg++;
299  } else
300  conv1legPFCandidateIndex_.push_back(-1);
301  }
302 
303  photPFCandidateIndex_.push_back(i);
304  pfPhotonMva_.push_back(cand.mva_nothing_gamma());
305  energyRegression_.push_back(cand.photonExtraRef()->MVAGlobalCorrE());
306  energyRegressionError_.push_back(cand.photonExtraRef()->MVAGlobalCorrEError());
308  pfClusters_.push_back(std::vector<const reco::PFCluster *>());
311 
312  reco::PFCandidatePtr ptrToPFPhoton(pfCandidates, i);
313  CandidatePtr_.push_back(ptrToPFPhoton);
314  egSCRef_.push_back(cand.superClusterRef());
315  //std::cout << "PFPhoton cand " << iphot << std::endl;
316 
317  int iegphot = 0;
318  for (reco::PhotonCollection::const_iterator gamIter = egPhotons->begin(); gamIter != egPhotons->end(); ++gamIter) {
319  if (cand.superClusterRef() == gamIter->superCluster()) {
320  reco::PhotonRef PhotRef(reco::PhotonRef(egPhotons, iegphot));
321  egPhotonRef_.push_back(PhotRef);
322  }
323  iegphot++;
324  }
325 
326  //std::cout << "Cand elements in blocks : " << cand.elementsInBlocks().size() << std::endl;
327 
328  for (unsigned iele = 0; iele < cand.elementsInBlocks().size(); ++iele) {
329  // first get the block
330  reco::PFBlockRef blockRef = cand.elementsInBlocks()[iele].first;
331  //
332  unsigned elementIndex = cand.elementsInBlocks()[iele].second;
333  // check it actually exists
334  if (blockRef.isNull())
335  continue;
336 
337  // then get the elements of the block
338  const edm::OwnVector<reco::PFBlockElement> &elements = (*blockRef).elements();
339 
340  const reco::PFBlockElement &pfbe(elements[elementIndex]);
341  // The first ECAL element should be the cluster associated to the GSF; defined as the seed
342  if (pfbe.type() == reco::PFBlockElement::ECAL) {
343  //std::cout << "BlockElement ECAL" << std::endl;
344  // the Brem photons are saved as daughter PFCandidate; this
345  // is convenient to access the corrected energy
346  // std::cout << " Found candidate " << correspondingDaughterCandidate(coCandidate,pfbe) << " " << coCandidate << std::endl;
348  }
349  if (pfbe.type() == reco::PFBlockElement::PS1) {
350  //std::cout << "BlockElement PS1" << std::endl;
352  }
353  if (pfbe.type() == reco::PFBlockElement::PS2) {
354  //std::cout << "BlockElement PS2" << std::endl;
356  }
357 
358  } // loop on the elements
359 
360  // save the basic clusters
361  basicClusters_p->insert(basicClusters_p->end(), basicClusters_[iphot].begin(), basicClusters_[iphot].end());
362  // save the preshower clusters
363  psClusters_p->insert(psClusters_p->end(), preshowerClusters_[iphot].begin(), preshowerClusters_[iphot].end());
364 
365  ++iphot;
366 
367  } // loop on PFCandidates
368 
369  //Save the basic clusters and get an handle as to be able to create valid Refs (thanks to Claude)
370  // std::cout << " Number of basic clusters " << basicClusters_p->size() << std::endl;
372  iEvent.put(std::move(basicClusters_p), PFBasicClusterCollection_);
373 
374  //preshower clusters
376  iEvent.put(std::move(psClusters_p), PFPreshowerClusterCollection_);
377 
378  // now that the Basic clusters are in the event, the Ref can be created
379  createBasicClusterPtrs(bcRefProd);
380  // now that the preshower clusters are in the event, the Ref can be created
381  createPreshowerClusterPtrs(psRefProd);
382 
383  // and now the Super cluster can be created with valid references
384  //if(status) createSuperClusters(*pfCandidates,*superClusters_p);
385  if (status)
386  createSuperClusters(*pfCandidates, outputSuperClusterCollection);
387 
388  //std::cout << "nb superclusters in collection : "<<outputSuperClusterCollection.size()<<std::endl;
389 
390  // Let's put the super clusters in the event
391  auto superClusters_p = std::make_unique<reco::SuperClusterCollection>(outputSuperClusterCollection);
393  iEvent.put(std::move(superClusters_p), PFSuperClusterCollection_);
394 
395  /*
396  int ipho=0;
397  for (reco::SuperClusterCollection::const_iterator gamIter = scRefProd->begin(); gamIter != scRefProd->end(); ++gamIter){
398  std::cout << "SC i="<<ipho<<" energy="<<gamIter->energy()<<std::endl;
399  ipho++;
400  }
401  */
402 
403  //1-leg conversions
404 
405  if (status)
406  createOneLegConversions(scRefProd, outputOneLegConversionCollection);
407 
408  auto SingleLeg_p = std::make_unique<reco::ConversionCollection>(outputOneLegConversionCollection);
410  iEvent.put(std::move(SingleLeg_p), PFConversionCollection_);
411  /*
412  int iconv = 0;
413  for (reco::ConversionCollection::const_iterator convIter = ConvRefProd->begin(); convIter != ConvRefProd->end(); ++convIter){
414 
415  std::cout << "OneLegConv i="<<iconv<<" nTracks="<<convIter->nTracks()<<" EoverP="<<convIter->EoverP() <<std::endl;
416  std::vector<edm::RefToBase<reco::Track> > convtracks = convIter->tracks();
417  for (unsigned int itk=0; itk<convtracks.size(); itk++){
418  std::cout << "Track pt="<< convtracks[itk]->pt() << std::endl;
419  }
420 
421  iconv++;
422  }
423  */
424 
425  //create photon cores
426  //if(status) createPhotonCores(pfCandidates, scRefProd, *photonCores_p);
427  if (status)
428  createPhotonCores(scRefProd, ConvRefProd, outputPhotonCoreCollection);
429 
430  //std::cout << "nb photoncores in collection : "<<outputPhotonCoreCollection.size()<<std::endl;
431 
432  // Put the photon cores in the event
433  auto photonCores_p = std::make_unique<reco::PhotonCoreCollection>(outputPhotonCoreCollection);
434  //std::cout << "photon core collection put in unique_ptr"<<std::endl;
436  iEvent.put(std::move(photonCores_p), PFPhotonCoreCollection_);
437 
438  //std::cout << "photon core have been put in the event"<<std::endl;
439  /*
440  int ipho=0;
441  for (reco::PhotonCoreCollection::const_iterator gamIter = pcRefProd->begin(); gamIter != pcRefProd->end(); ++gamIter){
442  std::cout << "PhotonCore i="<<ipho<<" energy="<<gamIter->parentSuperCluster()->energy()<<std::endl;
443  //for (unsigned int i=0; i<)
444 
445  std::cout << "PhotonCore i="<<ipho<<" nconv2leg="<<gamIter->conversions().size()<<" nconv1leg="<<gamIter->conversionsOneLeg().size()<<std::endl;
446 
447  const reco::ConversionRefVector & conv = gamIter->conversions();
448  for (unsigned int iconv=0; iconv<conv.size(); iconv++){
449  cout << "2-leg iconv="<<iconv<<endl;
450  cout << "2-leg nTracks="<<conv[iconv]->nTracks()<<endl;
451  cout << "2-leg EoverP="<<conv[iconv]->EoverP()<<endl;
452  cout << "2-leg ConvAlgorithm="<<conv[iconv]->algo()<<endl;
453  }
454 
455  const reco::ConversionRefVector & convbis = gamIter->conversionsOneLeg();
456  for (unsigned int iconv=0; iconv<convbis.size(); iconv++){
457  cout << "1-leg iconv="<<iconv<<endl;
458  cout << "1-leg nTracks="<<convbis[iconv]->nTracks()<<endl;
459  cout << "1-leg EoverP="<<convbis[iconv]->EoverP()<<endl;
460  cout << "1-leg ConvAlgorithm="<<convbis[iconv]->algo()<<endl;
461  }
462 
463  ipho++;
464  }
465  */
466 
467  //load vertices
469  bool validVertex = true;
470  iEvent.getByLabel(vertexProducer_, vertexHandle);
471  if (!vertexHandle.isValid()) {
472  edm::LogWarning("PhotonProducer") << "Error! Can't get the product primary Vertex Collection "
473  << "\n";
474  validVertex = false;
475  }
476  if (validVertex)
477  vertexCollection = *(vertexHandle.product());
478 
479  /*
480  //load Ecal rechits
481  bool validEcalRecHits=true;
482  Handle<EcalRecHitCollection> barrelHitHandle;
483  EcalRecHitCollection barrelRecHits;
484  iEvent.getByLabel(barrelEcalHits_, barrelHitHandle);
485  if (!barrelHitHandle.isValid()) {
486  edm::LogError("PhotonProducer") << "Error! Can't get the product "<<barrelEcalHits_.label();
487  validEcalRecHits=false;
488  }
489  if ( validEcalRecHits) barrelRecHits = *(barrelHitHandle.product());
490 
491  Handle<EcalRecHitCollection> endcapHitHandle;
492  iEvent.getByLabel(endcapEcalHits_, endcapHitHandle);
493  EcalRecHitCollection endcapRecHits;
494  if (!endcapHitHandle.isValid()) {
495  edm::LogError("PhotonProducer") << "Error! Can't get the product "<<endcapEcalHits_.label();
496  validEcalRecHits=false;
497  }
498  if( validEcalRecHits) endcapRecHits = *(endcapHitHandle.product());
499 
500  //load detector topology & geometry
501  iSetup.get<CaloGeometryRecord>().get(theCaloGeom_);
502 
503  edm::ESHandle<CaloTopology> pTopology;
504  iSetup.get<CaloTopologyRecord>().get(theCaloTopo_);
505  const CaloTopology *topology = theCaloTopo_.product();
506 
507  // get Hcal towers collection
508  Handle<CaloTowerCollection> hcalTowersHandle;
509  iEvent.getByLabel(hcalTowers_, hcalTowersHandle);
510  */
511 
512  //create photon collection
513  //if(status) createPhotons(vertexCollection, pcRefProd, topology, &barrelRecHits, &endcapRecHits, hcalTowersHandle, isolationValues, outputPhotonCollection);
514  if (status)
516 
517  // Put the photons in the event
518  auto photons_p = std::make_unique<reco::PhotonCollection>(outputPhotonCollection);
519  //std::cout << "photon collection put in unique_ptr"<<std::endl;
520  const edm::OrphanHandle<reco::PhotonCollection> photonRefProd = iEvent.put(std::move(photons_p), PFPhotonCollection_);
521  //std::cout << "photons have been put in the event"<<std::endl;
522 
523  /*
524  ipho=0;
525  for (reco::PhotonCollection::const_iterator gamIter = photonRefProd->begin(); gamIter != photonRefProd->end(); ++gamIter){
526  std::cout << "Photon i="<<ipho<<" pfEnergy="<<gamIter->parentSuperCluster()->energy()<<std::endl;
527 
528  const reco::ConversionRefVector & conv = gamIter->conversions();
529  cout << "conversions obtained : conv.size()="<< conv.size()<<endl;
530  for (unsigned int iconv=0; iconv<conv.size(); iconv++){
531  cout << "iconv="<<iconv<<endl;
532  cout << "nTracks="<<conv[iconv]->nTracks()<<endl;
533  cout << "EoverP="<<conv[iconv]->EoverP()<<endl;
534 
535  cout << "Vtx x="<<conv[iconv]->conversionVertex().x() << " y="<< conv[iconv]->conversionVertex().y()<<" z="<<conv[iconv]->conversionVertex().z()<< endl;
536  cout << "VtxError x=" << conv[iconv]->conversionVertex().xError() << endl;
537 
538  std::vector<edm::RefToBase<reco::Track> > convtracks = conv[iconv]->tracks();
539  //cout << "nTracks="<< convtracks.size()<<endl;
540  for (unsigned int itk=0; itk<convtracks.size(); itk++){
541  double convtrackpt = convtracks[itk]->pt();
542  const edm::RefToBase<reco::Track> & mytrack = convtracks[itk];
543  cout << "Track pt="<< convtrackpt <<endl;
544  cout << "Track origin="<<gamIter->conversionTrackOrigin(mytrack)<<endl;
545  }
546  }
547 
548  //1-leg
549  const reco::ConversionRefVector & convbis = gamIter->conversionsOneLeg();
550  cout << "conversions obtained : conv.size()="<< convbis.size()<<endl;
551  for (unsigned int iconv=0; iconv<convbis.size(); iconv++){
552  cout << "iconv="<<iconv<<endl;
553  cout << "nTracks="<<convbis[iconv]->nTracks()<<endl;
554  cout << "EoverP="<<convbis[iconv]->EoverP()<<endl;
555 
556  cout << "Vtx x="<<convbis[iconv]->conversionVertex().x() << " y="<< convbis[iconv]->conversionVertex().y()<<" z="<<convbis[iconv]->conversionVertex().z()<< endl;
557  cout << "VtxError x=" << convbis[iconv]->conversionVertex().xError() << endl;
558 
559  std::vector<edm::RefToBase<reco::Track> > convtracks = convbis[iconv]->tracks();
560  //cout << "nTracks="<< convtracks.size()<<endl;
561  for (unsigned int itk=0; itk<convtracks.size(); itk++){
562  double convtrackpt = convtracks[itk]->pt();
563  cout << "Track pt="<< convtrackpt <<endl;
564  cout << "Track origin="<<gamIter->conversionTrackOrigin((convtracks[itk]))<<endl;
565  }
566  }
567  ipho++;
568  }
569  */
570 }

References reco::PFBlockElement::ECAL, bookConverter::elements, reco::PFCandidate::gamma, mps_fire::i, iEvent, edm::Ref< C, T, F >::isNull(), electronProducer_cff::isolationValues, edm::HandleBase::isValid(), dqmiolumiharvest::j, eostools::move(), gedPhotons_cfi::outputPhotonCollection, zmumugammaAnalyzer_cfi::pfCandidates, edm::Handle< T >::product(), reco::PFBlockElement::PS1, reco::PFBlockElement::PS2, edm::RefVector< C, T, F >::size(), mps_update::status, reco::PFBlockElement::type(), and spclusmultinvestigator_cfi::vertexCollection.

Member Data Documentation

◆ barrelEcalHits_

edm::InputTag PFPhotonTranslator::barrelEcalHits_
private

Definition at line 94 of file PFPhotonTranslator.cc.

◆ basicClusterPtr_

std::vector<reco::CaloClusterPtrVector> PFPhotonTranslator::basicClusterPtr_
private

Definition at line 108 of file PFPhotonTranslator.cc.

◆ basicClusters_

std::vector<reco::BasicClusterCollection> PFPhotonTranslator::basicClusters_
private

Definition at line 100 of file PFPhotonTranslator.cc.

◆ CandidatePtr_

std::vector<reco::CandidatePtr> PFPhotonTranslator::CandidatePtr_
private

Definition at line 114 of file PFPhotonTranslator.cc.

◆ conv1legPFCandidateIndex_

std::vector<int> PFPhotonTranslator::conv1legPFCandidateIndex_
private

Definition at line 129 of file PFPhotonTranslator.cc.

◆ conv2legPFCandidateIndex_

std::vector<int> PFPhotonTranslator::conv2legPFCandidateIndex_
private

Definition at line 130 of file PFPhotonTranslator.cc.

◆ EGPhotonCollection_

std::string PFPhotonTranslator::EGPhotonCollection_
private

Definition at line 92 of file PFPhotonTranslator.cc.

◆ egPhotonRef_

std::vector<reco::PhotonRef> PFPhotonTranslator::egPhotonRef_
private

Definition at line 118 of file PFPhotonTranslator.cc.

◆ egSCRef_

std::vector<reco::SuperClusterRef> PFPhotonTranslator::egSCRef_
private

Definition at line 116 of file PFPhotonTranslator.cc.

◆ emptyIsOk_

bool PFPhotonTranslator::emptyIsOk_
private

Definition at line 135 of file PFPhotonTranslator.cc.

◆ endcapEcalHits_

edm::InputTag PFPhotonTranslator::endcapEcalHits_
private

Definition at line 95 of file PFPhotonTranslator.cc.

◆ energyRegression_

std::vector<float> PFPhotonTranslator::energyRegression_
private

Definition at line 121 of file PFPhotonTranslator.cc.

◆ energyRegressionError_

std::vector<float> PFPhotonTranslator::energyRegressionError_
private

Definition at line 122 of file PFPhotonTranslator.cc.

◆ hcalTowers_

edm::InputTag PFPhotonTranslator::hcalTowers_
private

Definition at line 96 of file PFPhotonTranslator.cc.

◆ hOverEConeSize_

double PFPhotonTranslator::hOverEConeSize_
private

Definition at line 97 of file PFPhotonTranslator.cc.

◆ inputTagIsoVals_

std::vector<edm::InputTag> PFPhotonTranslator::inputTagIsoVals_
private

Definition at line 85 of file PFPhotonTranslator.cc.

◆ inputTagPFCandidates_

edm::InputTag PFPhotonTranslator::inputTagPFCandidates_
private

Definition at line 84 of file PFPhotonTranslator.cc.

◆ PFBasicClusterCollection_

std::string PFPhotonTranslator::PFBasicClusterCollection_
private

Definition at line 86 of file PFPhotonTranslator.cc.

◆ pfClusters_

std::vector<std::vector<const reco::PFCluster *> > PFPhotonTranslator::pfClusters_
private

Definition at line 102 of file PFPhotonTranslator.cc.

◆ pfConv_

std::vector<reco::ConversionRefVector> PFPhotonTranslator::pfConv_
private

Definition at line 125 of file PFPhotonTranslator.cc.

◆ PFConversionCollection_

std::string PFPhotonTranslator::PFConversionCollection_
private

Definition at line 91 of file PFPhotonTranslator.cc.

◆ PFPhotonCollection_

std::string PFPhotonTranslator::PFPhotonCollection_
private

Definition at line 90 of file PFPhotonTranslator.cc.

◆ PFPhotonCoreCollection_

std::string PFPhotonTranslator::PFPhotonCoreCollection_
private

Definition at line 89 of file PFPhotonTranslator.cc.

◆ pfPhotonMva_

std::vector<float> PFPhotonTranslator::pfPhotonMva_
private

Definition at line 120 of file PFPhotonTranslator.cc.

◆ PFPreshowerClusterCollection_

std::string PFPhotonTranslator::PFPreshowerClusterCollection_
private

Definition at line 87 of file PFPhotonTranslator.cc.

◆ pfSingleLegConv_

std::vector<std::vector<reco::TrackRef> > PFPhotonTranslator::pfSingleLegConv_
private

Definition at line 126 of file PFPhotonTranslator.cc.

◆ pfSingleLegConvMva_

std::vector<std::vector<float> > PFPhotonTranslator::pfSingleLegConvMva_
private

Definition at line 127 of file PFPhotonTranslator.cc.

◆ PFSuperClusterCollection_

std::string PFPhotonTranslator::PFSuperClusterCollection_
private

Definition at line 88 of file PFPhotonTranslator.cc.

◆ photPFCandidateIndex_

std::vector<int> PFPhotonTranslator::photPFCandidateIndex_
private

Definition at line 112 of file PFPhotonTranslator.cc.

◆ preshowerClusterPtr_

std::vector<reco::CaloClusterPtrVector> PFPhotonTranslator::preshowerClusterPtr_
private

Definition at line 110 of file PFPhotonTranslator.cc.

◆ preshowerClusters_

std::vector<reco::PreshowerClusterCollection> PFPhotonTranslator::preshowerClusters_
private

Definition at line 104 of file PFPhotonTranslator.cc.

◆ superClusters_

std::vector<reco::SuperClusterCollection> PFPhotonTranslator::superClusters_
private

Definition at line 106 of file PFPhotonTranslator.cc.

◆ theCaloGeom_

edm::ESHandle<CaloGeometry> PFPhotonTranslator::theCaloGeom_
private

Definition at line 133 of file PFPhotonTranslator.cc.

◆ theCaloTopo_

edm::ESHandle<CaloTopology> PFPhotonTranslator::theCaloTopo_
private

Definition at line 132 of file PFPhotonTranslator.cc.

◆ vertexProducer_

std::string PFPhotonTranslator::vertexProducer_
private

Definition at line 93 of file PFPhotonTranslator.cc.

reco::Conversion
Definition: Conversion.h:23
zmumugammaAnalyzer_cfi.pfCandidates
pfCandidates
Definition: zmumugammaAnalyzer_cfi.py:11
PFPhotonTranslator::PFPreshowerClusterCollection_
std::string PFPreshowerClusterCollection_
Definition: PFPhotonTranslator.cc:87
PFPhotonTranslator::EGPhotonCollection_
std::string EGPhotonCollection_
Definition: PFPhotonTranslator.cc:92
mps_fire.i
i
Definition: mps_fire.py:355
reco::PhotonCore::setPFlowPhoton
void setPFlowPhoton(const bool prov)
set the provenance
Definition: PhotonCore.h:58
reco::PhotonCore::setSuperCluster
void setSuperCluster(const reco::SuperClusterRef &r)
set reference to SuperCluster
Definition: PhotonCore.h:48
edm::Handle::product
T const * product() const
Definition: Handle.h:70
electronProducer_cff.isolationValues
isolationValues
Definition: electronProducer_cff.py:26
reco::Photon::SaturationInfo::nSaturatedXtals
int nSaturatedXtals
Definition: Photon.h:259
reco::SuperCluster
Definition: SuperCluster.h:18
mps_update.status
status
Definition: mps_update.py:69
X
#define X(str)
Definition: MuonsGrabber.cc:38
reco::Photon::FiducialFlags::isEE
bool isEE
Definition: Photon.h:96
PFPhotonTranslator::energyRegressionError_
std::vector< float > energyRegressionError_
Definition: PFPhotonTranslator.cc:122
edm::Ref::isNull
bool isNull() const
Checks for null.
Definition: Ref.h:235
PFPhotonTranslator::hcalTowers_
edm::InputTag hcalTowers_
Definition: PFPhotonTranslator.cc:96
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
reco::Photon::PflowIDVariables::etOutsideMustache
float etOutsideMustache
Definition: Photon.h:501
reco::Photon::IsolationVariables::ecalRecHitSumEt
float ecalRecHitSumEt
Definition: Photon.h:362
reco::PreshowerCluster
Definition: PreshowerCluster.h:17
reco::candidate::const_iterator
Definition: const_iterator.h:14
PFPhotonTranslator::PFConversionCollection_
std::string PFConversionCollection_
Definition: PFPhotonTranslator.cc:91
reco::Photon::SaturationInfo
Definition: Photon.h:258
PFPhotonTranslator::preshowerClusters_
std::vector< reco::PreshowerClusterCollection > preshowerClusters_
Definition: PFPhotonTranslator.cc:104
PFPhotonTranslator::superClusters_
std::vector< reco::SuperClusterCollection > superClusters_
Definition: PFPhotonTranslator.cc:106
reco::PhotonCore::addConversion
void addConversion(const reco::ConversionRef &r)
add single ConversionRef to the vector of Refs
Definition: PhotonCore.h:52
reco::Photon::PflowIsolationVariables::chargedHadronIso
float chargedHadronIso
Definition: Photon.h:460
edm::RefVector< ElectronSeedCollection >
PFPhotonTranslator::fetchCandidateCollection
bool fetchCandidateCollection(edm::Handle< reco::PFCandidateCollection > &c, const edm::InputTag &tag, const edm::Event &iEvent) const
Definition: PFPhotonTranslator.cc:572
PFPhotonTranslator::pfSingleLegConvMva_
std::vector< std::vector< float > > pfSingleLegConvMva_
Definition: PFPhotonTranslator.cc:127
PFPhotonTranslator::conv2legPFCandidateIndex_
std::vector< int > conv2legPFCandidateIndex_
Definition: PFPhotonTranslator.cc:130
PFPhotonTranslator::correspondingDaughterCandidate
const reco::PFCandidate & correspondingDaughterCandidate(const reco::PFCandidate &cand, const reco::PFBlockElement &pfbe) const
Definition: PFPhotonTranslator.cc:1071
reco::PFCandidate::elementsInBlocks
const ElementsInBlocks & elementsInBlocks() const
Definition: PFCandidate.cc:636
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
edm::Handle
Definition: AssociativeIterator.h:50
relativeConstraints.error
error
Definition: relativeConstraints.py:53
reco::Photon::PflowIsolationVariables::neutralHadronIso
float neutralHadronIso
Definition: Photon.h:464
PFPhotonTranslator::PFPhotonCollection_
std::string PFPhotonCollection_
Definition: PFPhotonTranslator.cc:90
edm::Ref< PFClusterCollection >
reco::ConversionCollection
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
Definition: ConversionFwd.h:9
PFPhotonTranslator::vertexProducer_
std::string vertexProducer_
Definition: PFPhotonTranslator.cc:93
reco::Mustache
Definition: Mustache.h:18
reco::SuperClusterCollection
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
Definition: SuperClusterFwd.h:9
PFPhotonTranslator::createPreshowerCluster
void createPreshowerCluster(const reco::PFBlockElement &PFBE, reco::PreshowerClusterCollection &preshowerClusters, unsigned plane) const
Definition: PFPhotonTranslator.cc:611
reco::Photon::PflowIsolationVariables
Definition: Photon.h:459
PFPhotonTranslator::endcapEcalHits_
edm::InputTag endcapEcalHits_
Definition: PFPhotonTranslator.cc:95
reco::Photon::FiducialFlags::isEBEEGap
bool isEBEEGap
Definition: Photon.h:101
reco::PhotonCore::setStandardPhoton
void setStandardPhoton(const bool prov)
Definition: PhotonCore.h:59
reco::Photon::IsolationVariables::hcalTowerSumEt
float hcalTowerSumEt
Definition: Photon.h:364
reco::Photon::FiducialFlags::isEB
bool isEB
Definition: Photon.h:95
edm::PtrVector< CaloCluster >
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
PFPhotonTranslator::photPFCandidateIndex_
std::vector< int > photPFCandidateIndex_
Definition: PFPhotonTranslator.cc:112
reco::Photon::FiducialFlags::isEEDeeGap
bool isEEDeeGap
Definition: Photon.h:100
PFPhotonTranslator::barrelEcalHits_
edm::InputTag barrelEcalHits_
Definition: PFPhotonTranslator.cc:94
reco::CaloCluster
Definition: CaloCluster.h:31
reco::PhotonCore
Definition: PhotonCore.h:24
reco::PhotonCore::addElectronPixelSeed
void addElectronPixelSeed(const reco::ElectronSeedRef &r)
set electron pixel seed ref
Definition: PhotonCore.h:56
reco::Photon::PflowIDVariables::mva
float mva
Definition: Photon.h:502
PFPhotonTranslator::pfSingleLegConv_
std::vector< std::vector< reco::TrackRef > > pfSingleLegConv_
Definition: PFPhotonTranslator.cc:126
reco::PreshowerClusterCollection
std::vector< PreshowerCluster > PreshowerClusterCollection
collection of PreshowerCluster objects
Definition: PreshowerClusterFwd.h:12
RecoTauValidation_cfi.posX
posX
Definition: RecoTauValidation_cfi.py:288
PFPhotonTranslator::basicClusters_
std::vector< reco::BasicClusterCollection > basicClusters_
Definition: PFPhotonTranslator.cc:100
reco::Photon::FiducialFlags::isEERingGap
bool isEERingGap
Definition: Photon.h:99
reco::PhotonCore::addOneLegConversion
void addOneLegConversion(const reco::ConversionRef &r)
add single ConversionRef to the vector of Refs
Definition: PhotonCore.h:54
PFPhotonTranslator::pfClusters_
std::vector< std::vector< const reco::PFCluster * > > pfClusters_
Definition: PFPhotonTranslator.cc:102
reco::BasicClusterCollection
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects
Definition: BasicClusterFwd.h:16
reco::Photon::IsolationVariables::trkSumPtSolidCone
float trkSumPtSolidCone
Definition: Photon.h:376
HLT_2018_cff.superClusters
superClusters
Definition: HLT_2018_cff.py:13791
badGlobalMuonTaggersAOD_cff.vtx
vtx
Definition: badGlobalMuonTaggersAOD_cff.py:5
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PFPhotonTranslator::inputTagPFCandidates_
edm::InputTag inputTagPFCandidates_
Definition: PFPhotonTranslator.cc:84
edm::LogWarning
Definition: MessageLogger.h:141
reco::PhotonCoreCollection
std::vector< PhotonCore > PhotonCoreCollection
collectin of PhotonCore objects
Definition: PhotonCoreFwd.h:9
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:674
edm::ParameterSet
Definition: ParameterSet.h:36
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
iseed
int iseed
Definition: AMPTWrapper.h:134
edm::LogError
Definition: MessageLogger.h:183
PFPhotonTranslator::inputTagIsoVals_
std::vector< edm::InputTag > inputTagIsoVals_
Definition: PFPhotonTranslator.cc:85
reco::Photon::IsolationVariables::nTrkSolidCone
int nTrkSolidCone
Definition: Photon.h:380
PFPhotonTranslator::createBasicCluster
void createBasicCluster(const reco::PFBlockElement &, reco::BasicClusterCollection &basicClusters, std::vector< const reco::PFCluster * > &, const reco::PFCandidate &coCandidate) const
Definition: PFPhotonTranslator.cc:588
runTheMatrix.err
err
Definition: runTheMatrix.py:288
PFPhotonTranslator::CandidatePtr_
std::vector< reco::CandidatePtr > CandidatePtr_
Definition: PFPhotonTranslator.cc:114
reco::Photon::FiducialFlags::isEBPhiGap
bool isEBPhiGap
Definition: Photon.h:98
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
reco::Photon::FiducialFlags
Definition: Photon.h:93
reco::PFBlockElement::ECAL
Definition: PFBlockElement.h:35
cand
Definition: decayParser.h:34
reco::Mustache::MustacheID
void MustacheID(const CaloClusterPtrVector &clusters, int &nclusters, float &EoutsideMustache)
Definition: Mustache.cc:148
iEvent
int iEvent
Definition: GenABIO.cc:224
PFPhotonTranslator::hOverEConeSize_
double hOverEConeSize_
Definition: PFPhotonTranslator.cc:97
DOFs::Z
Definition: AlignPCLThresholdsWriter.cc:37
PFPhotonTranslator::basicClusterPtr_
std::vector< reco::CaloClusterPtrVector > basicClusterPtr_
Definition: PFPhotonTranslator.cc:108
reco::PFCandidate::gamma
Definition: PFCandidate.h:48
BPHMonitor_cfi.photons
photons
Definition: BPHMonitor_cfi.py:91
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
PFPhotonTranslator::createSuperClusters
void createSuperClusters(const reco::PFCandidateCollection &, reco::SuperClusterCollection &superClusters) const
Definition: PFPhotonTranslator.cc:657
reco::Photon::IsolationVariables
Definition: Photon.h:358
PFPhotonTranslator::PFSuperClusterCollection_
std::string PFSuperClusterCollection_
Definition: PFPhotonTranslator.cc:88
reco::PFBlockElement
Abstract base class for a PFBlock element (track, cluster...)
Definition: PFBlockElement.h:26
reco::Photon::IsolationVariables::trkSumPtHollowCone
float trkSumPtHollowCone
Definition: Photon.h:378
edm::Ptr< CaloCluster >
reco::Photon::FiducialFlags::isEBEtaGap
bool isEBEtaGap
Definition: Photon.h:97
reco::Photon
Definition: Photon.h:21
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
PFPhotonTranslator::createPreshowerClusterPtrs
void createPreshowerClusterPtrs(const edm::OrphanHandle< reco::PreshowerClusterCollection > &preshowerClustersHandle)
Definition: PFPhotonTranslator.cc:638
bookConverter.elements
elements
Definition: bookConverter.py:147
reco::Photon::ShowerShape
Definition: Photon.h:137
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::OrphanHandle
Definition: EDProductfwd.h:39
PFPhotonTranslator::createOneLegConversions
void createOneLegConversions(const edm::OrphanHandle< reco::SuperClusterCollection > &superClustersHandle, reco::ConversionCollection &oneLegConversions)
Definition: PFPhotonTranslator.cc:744
reco::Photon::PflowIDVariables
Definition: Photon.h:499
HltBtagValidation_cff.Vertex
Vertex
Definition: HltBtagValidation_cff.py:32
DOFs::Y
Definition: AlignPCLThresholdsWriter.cc:37
reco::Photon::IsolationVariables::nTrkHollowCone
int nTrkHollowCone
Definition: Photon.h:382
PFPhotonTranslator::createPhotonCores
void createPhotonCores(const edm::OrphanHandle< reco::SuperClusterCollection > &superClustersHandle, const edm::OrphanHandle< reco::ConversionCollection > &oneLegConversionHandle, reco::PhotonCoreCollection &photonCores)
Definition: PFPhotonTranslator.cc:828
PFPhotonTranslator::pfPhotonMva_
std::vector< float > pfPhotonMva_
Definition: PFPhotonTranslator.cc:120
gedPhotons_cfi.outputPhotonCollection
outputPhotonCollection
Definition: gedPhotons_cfi.py:30
PFPhotonTranslator::egSCRef_
std::vector< reco::SuperClusterRef > egSCRef_
Definition: PFPhotonTranslator.cc:116
spclusmultinvestigator_cfi.vertexCollection
vertexCollection
Definition: spclusmultinvestigator_cfi.py:4
LorentzVector
math::XYZTLorentzVector LorentzVector
Definition: HLTMuonMatchAndPlot.h:49
math::Error::type
ErrorD< N >::type type
Definition: Error.h:32
PFClusterWidthAlgo
Definition: PFClusterWidthAlgo.h:6
PFPhotonTranslator::preshowerClusterPtr_
std::vector< reco::CaloClusterPtrVector > preshowerClusterPtr_
Definition: PFPhotonTranslator.cc:110
reco::PFCluster
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:46
reco::Photon::PflowIDVariables::nClusterOutsideMustache
int nClusterOutsideMustache
Definition: Photon.h:500
math::XYZVectorF
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float > > XYZVectorF
spatial vector with cartesian internal representation
Definition: Vector3D.h:16
PFPhotonTranslator::pfConv_
std::vector< reco::ConversionRefVector > pfConv_
Definition: PFPhotonTranslator.cc:125
reco::Photon::SaturationInfo::isSeedSaturated
bool isSeedSaturated
Definition: Photon.h:260
reco::Photon::PflowIsolationVariables::photonIso
float photonIso
Definition: Photon.h:465
PFPhotonTranslator::createPhotons
void createPhotons(reco::VertexCollection &vertexCollection, edm::Handle< reco::PhotonCollection > &egPhotons, const edm::OrphanHandle< reco::PhotonCoreCollection > &photonCoresHandle, const IsolationValueMaps &isolationValues, reco::PhotonCollection &photons)
Definition: PFPhotonTranslator.cc:915
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:40
reco::PhotonCollection
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
reco::Photon::IsolationVariables::hcalDepth1TowerSumEt
float hcalDepth1TowerSumEt
Definition: Photon.h:366
PFPhotonTranslator::createBasicClusterPtrs
void createBasicClusterPtrs(const edm::OrphanHandle< reco::BasicClusterCollection > &basicClustersHandle)
Definition: PFPhotonTranslator.cc:619
PFPhotonTranslator::emptyIsOk_
bool emptyIsOk_
Definition: PFPhotonTranslator.cc:135
reco::PFBlockElement::PS1
Definition: PFBlockElement.h:33
reco::Photon::regression2
Definition: Photon.h:273
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
reco::Photon::IsolationVariables::hcalDepth2TowerSumEt
float hcalDepth2TowerSumEt
Definition: Photon.h:368
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
reco::PFBlockElement::index
unsigned index() const
Definition: PFBlockElement.h:86
math::XYZPointF
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
Definition: Point3D.h:10
edm::RefVector::size
size_type size() const
Size of the RefVector.
Definition: RefVector.h:102
edm::InputTag
Definition: InputTag.h:15
PFPhotonTranslator::egPhotonRef_
std::vector< reco::PhotonRef > egPhotonRef_
Definition: PFPhotonTranslator.cc:118
reco::Vertex
Definition: Vertex.h:35
RecoTauValidation_cfi.posY
posY
Definition: RecoTauValidation_cfi.py:289
reco::PhotonCore::setParentSuperCluster
void setParentSuperCluster(const reco::SuperClusterRef &r)
set reference to PFlow SuperCluster
Definition: PhotonCore.h:50
PFPhotonTranslator::PFBasicClusterCollection_
std::string PFBasicClusterCollection_
Definition: PFPhotonTranslator.cc:86
reco::PFBlockElement::PS2
Definition: PFBlockElement.h:34
edm::OwnVector< reco::PFBlockElement >
reco::Conversion::pflow
Definition: Conversion.h:25
PFPhotonTranslator::energyRegression_
std::vector< float > energyRegression_
Definition: PFPhotonTranslator.cc:121
PFPhotonTranslator::IsolationValueMaps
std::vector< edm::Handle< edm::ValueMap< double > > > IsolationValueMaps
Definition: PFPhotonTranslator.cc:39
PFPhotonTranslator::conv1legPFCandidateIndex_
std::vector< int > conv1legPFCandidateIndex_
Definition: PFPhotonTranslator.cc:129
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
reco::PFBlockElement::clusterRef
virtual const PFClusterRef & clusterRef() const
Definition: PFBlockElement.h:90
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
PFPhotonTranslator::PFPhotonCoreCollection_
std::string PFPhotonCoreCollection_
Definition: PFPhotonTranslator.cc:89