Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:54:13

0001 #ifndef ParticleFlowCandidate_PFCandidateElectronExtra_h
0002 #define ParticleFlowCandidate_PFCandidateElectronExtra_h
0003 
0004 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0005 #include "DataFormats/GsfTrackReco/interface/GsfTrackFwd.h"
0006 #include "DataFormats/Math/interface/LorentzVector.h"
0007 
0008 #include <iosfwd>
0009 
0010 namespace reco {
0011   /** \class reco::PFCandidateElectronExtra
0012  *
0013  * extra information on the electron particle candidate from particle flow
0014  *
0015  */
0016   class PFCandidateElectronExtra {
0017   public:
0018     enum StatusFlag {
0019       X = 0,                  // undefined
0020       Selected,               // selected
0021       ECALDrivenPreselected,  // ECAL-driven electron pre-selected
0022       MVASelected,            // Passed the internal particle-flow selection (mva selection)
0023       Rejected                // Rejected
0024     };
0025 
0026     // if you had a variable update NMvaVariables
0027     enum MvaVariable {
0028       MVA_FIRST = 0,
0029       MVA_LnPtGsf = MVA_FIRST,
0030       MVA_EtaGsf,
0031       MVA_SigmaPtOverPt,
0032       MVA_Fbrem,
0033       MVA_Chi2Gsf,
0034       MVA_NhitsKf,
0035       MVA_Chi2Kf,
0036       MVA_EtotOverPin,
0037       MVA_EseedOverPout,
0038       MVA_EbremOverDeltaP,
0039       MVA_DeltaEtaTrackCluster,
0040       MVA_LogSigmaEtaEta,
0041       MVA_HOverHE,
0042       MVA_LateBrem,
0043       MVA_FirstBrem,
0044       MVA_MVA,
0045       MVA_LAST
0046     };
0047 
0048   public:
0049     /// constructor
0050     PFCandidateElectronExtra();
0051     /// constructor
0052     PFCandidateElectronExtra(const GsfTrackRef&);
0053     /// destructor
0054     ~PFCandidateElectronExtra() { ; }
0055 
0056     /// set gsftrack reference
0057     void setGsfTrackRef(const reco::GsfTrackRef& ref);
0058 
0059     /// set kf track reference
0060     void setKfTrackRef(const reco::TrackRef& ref);
0061 
0062     /// return a reference to the corresponding GSF track
0063     reco::GsfTrackRef gsfTrackRef() const { return gsfTrackRef_; }
0064 
0065     /// return a reference to the corresponding KF track
0066     reco::TrackRef kfTrackRef() const { return kfTrackRef_; }
0067 
0068     /// set LateBrem
0069     void setLateBrem(float val);
0070     /// set EarlyBrem
0071     void setEarlyBrem(float val);
0072 
0073     /// set the pout (not trivial to get from the GSF track)
0074     void setGsfTrackPout(const math::XYZTLorentzVector& pout);
0075 
0076     /// set the cluster energies. the Pout should be saved first
0077     void setClusterEnergies(const std::vector<float>& energies);
0078 
0079     /// set the sigmaetaeta
0080     void setSigmaEtaEta(float val);
0081 
0082     /// set the delta eta
0083     void setDeltaEta(float val);
0084 
0085     /// set the had energy. The cluster energies should be entered before
0086     void setHadEnergy(float val);
0087 
0088     /// set the result (mostly for debugging)
0089     void setMVA(float val);
0090 
0091     /// set status
0092     void setStatus(StatusFlag type, bool status = true);
0093 
0094     /// access to the status
0095     bool electronStatus(StatusFlag) const;
0096 
0097     /// access to the status
0098     int electronStatus() const { return status_; }
0099 
0100     /// access to mva variable status
0101     bool mvaStatus(MvaVariable flag) const;
0102 
0103     /// access to the mva variables
0104     const std::vector<float>& mvaVariables() const { return mvaVariables_; }
0105 
0106     /// access to any variable
0107     float mvaVariable(MvaVariable var) const;
0108 
0109     /// access to specific variables
0110     float hadEnergy() const { return hadEnergy_; }
0111     float sigmaEtaEta() const { return sigmaEtaEta_; }
0112 
0113   private:
0114     void setVariable(MvaVariable type, float var);
0115 
0116   private:
0117     /// Ref to the GSF track
0118     reco::GsfTrackRef gsfTrackRef_;
0119     /// Ref to the KF track
0120     reco::TrackRef kfTrackRef_;
0121 
0122     /// energy of individual clusters (corrected). The first cluster is the seed
0123     std::vector<float> clusterEnergies_;
0124 
0125     /// mva variables  -  transient !
0126     std::vector<float> mvaVariables_;
0127 
0128     /// status of  mva variables
0129     int mvaStatus_;
0130 
0131     /// Status of the electron
0132     int status_;
0133 
0134     /// Variables entering the MVA that should be saved
0135     math::XYZTLorentzVector pout_;
0136     float earlyBrem_;
0137     float lateBrem_;
0138     float sigmaEtaEta_;
0139     float hadEnergy_;
0140     float deltaEta_;
0141   };
0142 
0143   /// print the variables
0144   std::ostream& operator<<(std::ostream& out, const PFCandidateElectronExtra& c);
0145 
0146 }  // namespace reco
0147 #endif