00001 #ifndef PFElectronAlgo_H
00002 #define PFElectronAlgo_H
00003
00004 #include "DataFormats/ParticleFlowReco/interface/PFBlockFwd.h"
00005 #include "DataFormats/ParticleFlowReco/interface/PFBlock.h"
00006 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
00007 #include "RecoParticleFlow/PFClusterTools/interface/PFEnergyCalibration.h"
00008 #include "RecoParticleFlow/PFClusterTools/interface/PFEnergyResolution.h"
00009 #include "TMVA/Reader.h"
00010 #include <iostream>
00011 class reco::PFCandidate;
00012
00013 class PFElectronAlgo {
00014 public:
00015
00016
00017 PFElectronAlgo(const std::vector<double> chi2values,
00018 const double mvaEleCut,
00019 std::string mvaWeightFileEleID);
00020
00021
00022
00023 ~PFElectronAlgo(){delete tmvaReader_;};
00024
00025
00026 bool isElectronValidCandidate(const reco::PFBlockRef& blockRef,
00027 std::vector<bool>& active)
00028 {
00029 isvalid_=false;
00030 RunPFElectron(blockRef,active);
00031 return isvalid_;};
00032
00033
00034 std::vector<reco::PFCandidate> getElectronCandidates() {return elCandidate_;};
00035
00036
00037 private:
00038 typedef std::vector<std::pair< unsigned int, std::vector<unsigned int> > > AssMap;
00039 void RunPFElectron(const reco::PFBlockRef& blockRef,
00040 std::vector<bool>& active);
00041
00042 uint FindClosestElement(const uint iele,
00043 std::multimap<double, unsigned>& Elems,
00044 float& chi2cut,
00045 std::vector<bool>& active,
00046 const reco::PFBlockRef& blockRef);
00047
00048
00049 bool findLinkPairs(const std::vector< std::pair<unsigned, double> >& MinRow,
00050 const std::vector<unsigned>& brem_it,
00051 const std::vector<unsigned>& clust_it,
00052 std::map<unsigned, unsigned>& finallink,
00053 float chi2cut);
00054
00055 uint FindClosestElementCond(const uint iele,
00056 std::multimap<double, unsigned>& Elems,
00057 float& chi2cut,float chi2Comp, uint indexComp,
00058 std::vector<bool>& active,
00059 const reco::PFBlockRef& blockRef);
00060
00061
00062 void MultipleGsfTrackAssociation(const reco::PFBlockRef& blockRef);
00063
00064 bool SetLinks(const reco::PFBlockRef& blockRef,
00065 AssMap& associatedToGSF_,
00066 AssMap& associatedToBrems_,
00067 std::vector<bool>& active);
00068
00069 void SetIDOutputs(const reco::PFBlockRef& blockRef,
00070 const AssMap& associatedToGSF_,
00071 const AssMap& associatedToBrems_);
00072
00073 void SetCandidates(const reco::PFBlockRef& blockRef,
00074 const AssMap& associatedToGSF_,
00075 const AssMap& associatedToBrems_);
00076
00077 void SetActive(const reco::PFBlockRef& blockRef,
00078 const AssMap& associatedToGSF_,
00079 const AssMap& associatedToBrems_,
00080 std::vector<bool>& active);
00081
00082
00083
00084 std::vector<reco::PFCandidate> elCandidate_;
00085 std::vector<double> BDToutput_;
00086 std::vector<double> chi2values_;
00087 std::vector<bool> GsfTrackSingleEcal_;
00088
00089 double mvaEleCut_;
00090 TMVA::Reader *tmvaReader_;
00091 const char *mvaWeightFile_;
00092
00093 float TEtotPinMode;
00094 float TEtotPinMean;
00095 float TEGsfPoutMode;
00096 float TDiffEtaGSFEcalEle;
00097 float TSigmaEtaEtaEle;
00098 float TChiEcalEle;
00099
00100 float TSumEBremPinPoutMode;
00101 float TSumEBremPinPoutMean;
00102 int TNumBrem;
00103 int TLateBrem;
00104 int TEarlyBrem;
00105
00106 bool isvalid_;
00107 };
00108 #endif