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 hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () 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_
 
edm::ESGetToken< EcalMustacheSCParameters, EcalMustacheSCParametersRcdecalMustacheSCParametersToken_
 
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_
 
const EcalMustacheSCParametersmustacheSCParams_
 
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 34 of file PFPhotonTranslator.cc.

Member Typedef Documentation

◆ IsolationValueMaps

Definition at line 41 of file PFPhotonTranslator.cc.

Constructor & Destructor Documentation

◆ PFPhotonTranslator()

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

Definition at line 154 of file PFPhotonTranslator.cc.

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

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

◆ ~PFPhotonTranslator()

PFPhotonTranslator::~PFPhotonTranslator ( )
override

Definition at line 196 of file PFPhotonTranslator.cc.

196 {}

Member Function Documentation

◆ correspondingDaughterCandidate()

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

Definition at line 1080 of file PFPhotonTranslator.cc.

1081  {
1082  unsigned refindex = pfbe.index();
1083  // std::cout << " N daughters " << cand.numberOfDaughters() << std::endl;
1084  reco::PFCandidate::const_iterator myDaughterCandidate = cand.begin();
1086 
1087  for (; myDaughterCandidate != itend; ++myDaughterCandidate) {
1088  const reco::PFCandidate *myPFCandidate = (const reco::PFCandidate *)&*myDaughterCandidate;
1089  if (myPFCandidate->elementsInBlocks().size() != 1) {
1090  // std::cout << " Daughter with " << myPFCandidate.elementsInBlocks().size()<< " element in block " << std::endl;
1091  return cand;
1092  }
1093  if (myPFCandidate->elementsInBlocks()[0].second == refindex) {
1094  // std::cout << " Found it " << cand << std::endl;
1095  return *myPFCandidate;
1096  }
1097  }
1098  return cand;
1099 }

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 597 of file PFPhotonTranslator.cc.

600  {
601  const reco::PFClusterRef &myPFClusterRef = PFBE.clusterRef();
602  if (myPFClusterRef.isNull())
603  return;
604 
605  const reco::PFCluster &myPFCluster(*myPFClusterRef);
606  pfClusters.push_back(&myPFCluster);
607  //std::cout << " Creating BC " << myPFCluster.energy() << " " << coCandidate.ecalEnergy() <<" "<< coCandidate.rawEcalEnergy() <<std::endl;
608  //std::cout << " # hits " << myPFCluster.hitsAndFractions().size() << std::endl;
609 
610  // basicClusters.push_back(reco::CaloCluster(myPFCluster.energy(),
611  basicClusters.push_back(reco::CaloCluster( //coCandidate.rawEcalEnergy(),
612  myPFCluster.energy(),
613  myPFCluster.position(),
614  myPFCluster.caloID(),
615  myPFCluster.hitsAndFractions(),
616  myPFCluster.algo(),
617  myPFCluster.seed()));
618 }

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 628 of file PFPhotonTranslator.cc.

629  {
630  unsigned size = photPFCandidateIndex_.size();
631  unsigned basicClusterCounter = 0;
632  basicClusterPtr_.resize(size);
633 
634  for (unsigned iphot = 0; iphot < size; ++iphot) // loop on tracks
635  {
636  unsigned nbc = basicClusters_[iphot].size();
637  for (unsigned ibc = 0; ibc < nbc; ++ibc) // loop on basic clusters
638  {
639  // std::cout << "Track "<< iGSF << " ref " << basicClusterCounter << std::endl;
640  reco::CaloClusterPtr bcPtr(basicClustersHandle, basicClusterCounter);
641  basicClusterPtr_[iphot].push_back(bcPtr);
642  ++basicClusterCounter;
643  }
644  }
645 }

References findQualityFiles::size.

◆ createOneLegConversions()

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

Definition at line 753 of file PFPhotonTranslator.cc.

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

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

◆ createPhotonCores()

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

Definition at line 837 of file PFPhotonTranslator.cc.

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

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 924 of file PFPhotonTranslator.cc.

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

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 extraflags_cff::vtx.

◆ createPreshowerCluster()

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

Definition at line 620 of file PFPhotonTranslator.cc.

622  {
623  const reco::PFClusterRef &myPFClusterRef = PFBE.clusterRef();
624  preshowerClusters.push_back(reco::PreshowerCluster(
625  myPFClusterRef->energy(), myPFClusterRef->position(), myPFClusterRef->hitsAndFractions(), plane));
626 }

References reco::PFBlockElement::clusterRef().

◆ createPreshowerClusterPtrs()

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

Definition at line 647 of file PFPhotonTranslator.cc.

648  {
649  unsigned size = photPFCandidateIndex_.size();
650  unsigned psClusterCounter = 0;
651  preshowerClusterPtr_.resize(size);
652 
653  for (unsigned iphot = 0; iphot < size; ++iphot) // loop on tracks
654  {
655  unsigned nbc = preshowerClusters_[iphot].size();
656  for (unsigned ibc = 0; ibc < nbc; ++ibc) // loop on basic clusters
657  {
658  // std::cout << "Track "<< iGSF << " ref " << basicClusterCounter << std::endl;
659  reco::CaloClusterPtr psPtr(preshowerClustersHandle, psClusterCounter);
660  preshowerClusterPtr_[iphot].push_back(psPtr);
661  ++psClusterCounter;
662  }
663  }
664 }

References findQualityFiles::size.

◆ createSuperClusters()

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

Definition at line 666 of file PFPhotonTranslator.cc.

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

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(), HLT_FULL_cff::superClusters, and trackerHitRTTI::vector.

◆ fetchCandidateCollection()

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

Definition at line 581 of file PFPhotonTranslator.cc.

583  {
584  bool found = iEvent.getByLabel(tag, c);
585 
586  if (!found && !emptyIsOk_) {
587  std::ostringstream err;
588  err << " cannot get PFCandidates: " << tag << std::endl;
589  edm::LogError("PFPhotonTranslator") << err.str();
590  }
591  return found;
592 }

References HltBtagPostValidation_cff::c, submitPVResolutionJobs::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 198 of file PFPhotonTranslator.cc.

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

References reco::PFBlockElement::ECAL, bookConverter::elements, reco::PFCandidate::gamma, edm::EventSetup::getData(), 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 96 of file PFPhotonTranslator.cc.

◆ basicClusterPtr_

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

Definition at line 110 of file PFPhotonTranslator.cc.

◆ basicClusters_

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

Definition at line 102 of file PFPhotonTranslator.cc.

◆ CandidatePtr_

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

Definition at line 116 of file PFPhotonTranslator.cc.

◆ conv1legPFCandidateIndex_

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

Definition at line 131 of file PFPhotonTranslator.cc.

◆ conv2legPFCandidateIndex_

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

Definition at line 132 of file PFPhotonTranslator.cc.

◆ ecalMustacheSCParametersToken_

edm::ESGetToken<EcalMustacheSCParameters, EcalMustacheSCParametersRcd> PFPhotonTranslator::ecalMustacheSCParametersToken_
private

Definition at line 138 of file PFPhotonTranslator.cc.

◆ EGPhotonCollection_

std::string PFPhotonTranslator::EGPhotonCollection_
private

Definition at line 94 of file PFPhotonTranslator.cc.

◆ egPhotonRef_

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

Definition at line 120 of file PFPhotonTranslator.cc.

◆ egSCRef_

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

Definition at line 118 of file PFPhotonTranslator.cc.

◆ emptyIsOk_

bool PFPhotonTranslator::emptyIsOk_
private

Definition at line 141 of file PFPhotonTranslator.cc.

◆ endcapEcalHits_

edm::InputTag PFPhotonTranslator::endcapEcalHits_
private

Definition at line 97 of file PFPhotonTranslator.cc.

◆ energyRegression_

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

Definition at line 123 of file PFPhotonTranslator.cc.

◆ energyRegressionError_

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

Definition at line 124 of file PFPhotonTranslator.cc.

◆ hcalTowers_

edm::InputTag PFPhotonTranslator::hcalTowers_
private

Definition at line 98 of file PFPhotonTranslator.cc.

◆ hOverEConeSize_

double PFPhotonTranslator::hOverEConeSize_
private

Definition at line 99 of file PFPhotonTranslator.cc.

◆ inputTagIsoVals_

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

Definition at line 87 of file PFPhotonTranslator.cc.

◆ inputTagPFCandidates_

edm::InputTag PFPhotonTranslator::inputTagPFCandidates_
private

Definition at line 86 of file PFPhotonTranslator.cc.

◆ mustacheSCParams_

const EcalMustacheSCParameters* PFPhotonTranslator::mustacheSCParams_
private

Definition at line 139 of file PFPhotonTranslator.cc.

◆ PFBasicClusterCollection_

std::string PFPhotonTranslator::PFBasicClusterCollection_
private

Definition at line 88 of file PFPhotonTranslator.cc.

◆ pfClusters_

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

Definition at line 104 of file PFPhotonTranslator.cc.

◆ pfConv_

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

Definition at line 127 of file PFPhotonTranslator.cc.

◆ PFConversionCollection_

std::string PFPhotonTranslator::PFConversionCollection_
private

Definition at line 93 of file PFPhotonTranslator.cc.

◆ PFPhotonCollection_

std::string PFPhotonTranslator::PFPhotonCollection_
private

Definition at line 92 of file PFPhotonTranslator.cc.

◆ PFPhotonCoreCollection_

std::string PFPhotonTranslator::PFPhotonCoreCollection_
private

Definition at line 91 of file PFPhotonTranslator.cc.

◆ pfPhotonMva_

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

Definition at line 122 of file PFPhotonTranslator.cc.

◆ PFPreshowerClusterCollection_

std::string PFPhotonTranslator::PFPreshowerClusterCollection_
private

Definition at line 89 of file PFPhotonTranslator.cc.

◆ pfSingleLegConv_

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

Definition at line 128 of file PFPhotonTranslator.cc.

◆ pfSingleLegConvMva_

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

Definition at line 129 of file PFPhotonTranslator.cc.

◆ PFSuperClusterCollection_

std::string PFPhotonTranslator::PFSuperClusterCollection_
private

Definition at line 90 of file PFPhotonTranslator.cc.

◆ photPFCandidateIndex_

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

Definition at line 114 of file PFPhotonTranslator.cc.

◆ preshowerClusterPtr_

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

Definition at line 112 of file PFPhotonTranslator.cc.

◆ preshowerClusters_

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

Definition at line 106 of file PFPhotonTranslator.cc.

◆ superClusters_

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

Definition at line 108 of file PFPhotonTranslator.cc.

◆ theCaloGeom_

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

Definition at line 135 of file PFPhotonTranslator.cc.

◆ theCaloTopo_

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

Definition at line 134 of file PFPhotonTranslator.cc.

◆ vertexProducer_

std::string PFPhotonTranslator::vertexProducer_
private

Definition at line 95 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:89
PFPhotonTranslator::EGPhotonCollection_
std::string EGPhotonCollection_
Definition: PFPhotonTranslator.cc:94
mps_fire.i
i
Definition: mps_fire.py:428
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:124
edm::Ref::isNull
bool isNull() const
Checks for null.
Definition: Ref.h:235
PFPhotonTranslator::hcalTowers_
edm::InputTag hcalTowers_
Definition: PFPhotonTranslator.cc:98
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:93
reco::Photon::SaturationInfo
Definition: Photon.h:258
PFPhotonTranslator::preshowerClusters_
std::vector< reco::PreshowerClusterCollection > preshowerClusters_
Definition: PFPhotonTranslator.cc:106
PFPhotonTranslator::superClusters_
std::vector< reco::SuperClusterCollection > superClusters_
Definition: PFPhotonTranslator.cc:108
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:581
PFPhotonTranslator::pfSingleLegConvMva_
std::vector< std::vector< float > > pfSingleLegConvMva_
Definition: PFPhotonTranslator.cc:129
PFPhotonTranslator::conv2legPFCandidateIndex_
std::vector< int > conv2legPFCandidateIndex_
Definition: PFPhotonTranslator.cc:132
PFPhotonTranslator::correspondingDaughterCandidate
const reco::PFCandidate & correspondingDaughterCandidate(const reco::PFCandidate &cand, const reco::PFBlockElement &pfbe) const
Definition: PFPhotonTranslator.cc:1080
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
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
reco::Photon::PflowIsolationVariables::neutralHadronIso
float neutralHadronIso
Definition: Photon.h:464
PFPhotonTranslator::PFPhotonCollection_
std::string PFPhotonCollection_
Definition: PFPhotonTranslator.cc:92
edm::Ref< PFClusterCollection >
reco::ConversionCollection
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
Definition: ConversionFwd.h:9
HLT_FULL_cff.superClusters
superClusters
Definition: HLT_FULL_cff.py:15234
PFPhotonTranslator::vertexProducer_
std::string vertexProducer_
Definition: PFPhotonTranslator.cc:95
reco::Mustache
Definition: Mustache.h:28
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:620
reco::Photon::PflowIsolationVariables
Definition: Photon.h:459
PFPhotonTranslator::endcapEcalHits_
edm::InputTag endcapEcalHits_
Definition: PFPhotonTranslator.cc:97
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:114
reco::Photon::FiducialFlags::isEEDeeGap
bool isEEDeeGap
Definition: Photon.h:100
PFPhotonTranslator::barrelEcalHits_
edm::InputTag barrelEcalHits_
Definition: PFPhotonTranslator.cc:96
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:128
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:102
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:104
reco::BasicClusterCollection
std::vector< BasicCluster > BasicClusterCollection
collection of BasicCluster objects
Definition: BasicClusterFwd.h:16
reco::Photon::IsolationVariables::trkSumPtSolidCone
float trkSumPtSolidCone
Definition: Photon.h:376
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PFPhotonTranslator::inputTagPFCandidates_
edm::InputTag inputTagPFCandidates_
Definition: PFPhotonTranslator.cc:86
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:681
edm::ParameterSet
Definition: ParameterSet.h:47
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
iseed
int iseed
Definition: AMPTWrapper.h:134
PFPhotonTranslator::inputTagIsoVals_
std::vector< edm::InputTag > inputTagIsoVals_
Definition: PFPhotonTranslator.cc:87
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:597
PFPhotonTranslator::CandidatePtr_
std::vector< reco::CandidatePtr > CandidatePtr_
Definition: PFPhotonTranslator.cc:116
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:32
iEvent
int iEvent
Definition: GenABIO.cc:224
PFPhotonTranslator::hOverEConeSize_
double hOverEConeSize_
Definition: PFPhotonTranslator.cc:99
PFPhotonTranslator::basicClusterPtr_
std::vector< reco::CaloClusterPtrVector > basicClusterPtr_
Definition: PFPhotonTranslator.cc:110
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
reco::PFCandidate::gamma
Definition: PFCandidate.h:49
BPHMonitor_cfi.photons
photons
Definition: BPHMonitor_cfi.py:91
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
PFPhotonTranslator::createSuperClusters
void createSuperClusters(const reco::PFCandidateCollection &, reco::SuperClusterCollection &superClusters) const
Definition: PFPhotonTranslator.cc:666
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
reco::Photon::IsolationVariables
Definition: Photon.h:358
PFPhotonTranslator::PFSuperClusterCollection_
std::string PFSuperClusterCollection_
Definition: PFPhotonTranslator.cc:90
PFPhotonTranslator::mustacheSCParams_
const EcalMustacheSCParameters * mustacheSCParams_
Definition: PFPhotonTranslator.cc:139
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 >
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:120
reco::Photon::FiducialFlags::isEBEtaGap
bool isEBEtaGap
Definition: Photon.h:97
reco::Photon
Definition: Photon.h:21
PFPhotonTranslator::createPreshowerClusterPtrs
void createPreshowerClusterPtrs(const edm::OrphanHandle< reco::PreshowerClusterCollection > &preshowerClustersHandle)
Definition: PFPhotonTranslator.cc:647
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:753
reco::Photon::PflowIDVariables
Definition: Photon.h:499
HltBtagValidation_cff.Vertex
Vertex
Definition: HltBtagValidation_cff.py:32
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:837
PFPhotonTranslator::pfPhotonMva_
std::vector< float > pfPhotonMva_
Definition: PFPhotonTranslator.cc:122
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:18
gedPhotons_cfi.outputPhotonCollection
outputPhotonCollection
Definition: gedPhotons_cfi.py:30
PFPhotonTranslator::egSCRef_
std::vector< reco::SuperClusterRef > egSCRef_
Definition: PFPhotonTranslator.cc:118
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:112
reco::PFCluster
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:42
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:127
reco::Photon::SaturationInfo::isSeedSaturated
bool isSeedSaturated
Definition: Photon.h:260
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
reco::Photon::PflowIsolationVariables::photonIso
float photonIso
Definition: Photon.h:465
BeamSpotPI::Y
Definition: BeamSpotPayloadInspectorHelper.h:31
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:924
reco::PFCandidate
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:41
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:628
PFPhotonTranslator::emptyIsOk_
bool emptyIsOk_
Definition: PFPhotonTranslator.cc:141
reco::PFBlockElement::PS1
Definition: PFBlockElement.h:33
reco::Photon::regression2
Definition: Photon.h:273
PFPhotonTranslator::ecalMustacheSCParametersToken_
edm::ESGetToken< EcalMustacheSCParameters, EcalMustacheSCParametersRcd > ecalMustacheSCParametersToken_
Definition: PFPhotonTranslator.cc:138
BeamSpotPI::Z
Definition: BeamSpotPayloadInspectorHelper.h:32
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:120
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:88
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:123
PFPhotonTranslator::IsolationValueMaps
std::vector< edm::Handle< edm::ValueMap< double > > > IsolationValueMaps
Definition: PFPhotonTranslator.cc:41
PFPhotonTranslator::conv1legPFCandidateIndex_
std::vector< int > conv1legPFCandidateIndex_
Definition: PFPhotonTranslator.cc:131
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:91