File indexing completed on 2024-04-06 12:04:49
0001 #ifndef ParticleFlowCandidate_PFCandidateEGammaExtra_h
0002 #define ParticleFlowCandidate_PFCandidateEGammaExtra_h
0003
0004 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0005 #include "DataFormats/GsfTrackReco/interface/GsfTrackFwd.h"
0006 #include "DataFormats/Math/interface/LorentzVector.h"
0007 #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h"
0008 #include "DataFormats/EgammaCandidates/interface/ConversionFwd.h"
0009 #include "DataFormats/ParticleFlowReco/interface/PFBlock.h"
0010 #include "DataFormats/ParticleFlowReco/interface/PFBlockFwd.h"
0011 #include "DataFormats/ParticleFlowReco/interface/PFBlockElementTrack.h"
0012 #include "DataFormats/ParticleFlowReco/interface/PFBlockElementCluster.h"
0013
0014 #include <iosfwd>
0015
0016 namespace reco {
0017
0018
0019
0020
0021
0022 typedef std::pair<reco::PFBlockRef, unsigned> ElementInBlock;
0023 typedef std::vector<ElementInBlock> ElementsInBlocks;
0024
0025 class PFCandidateEGammaExtra {
0026 public:
0027 enum StatusFlag {
0028 X = 0,
0029 Selected,
0030 ECALDrivenPreselected,
0031 MVASelected,
0032 Rejected
0033 };
0034
0035
0036 enum MvaVariable {
0037 MVA_FIRST = 0,
0038 MVA_LnPtGsf = MVA_FIRST,
0039 MVA_EtaGsf,
0040 MVA_SigmaPtOverPt,
0041 MVA_Fbrem,
0042 MVA_Chi2Gsf,
0043 MVA_NhitsKf,
0044 MVA_Chi2Kf,
0045 MVA_EtotOverPin,
0046 MVA_EseedOverPout,
0047 MVA_EbremOverDeltaP,
0048 MVA_DeltaEtaTrackCluster,
0049 MVA_LogSigmaEtaEta,
0050 MVA_HOverHE,
0051 MVA_LateBrem,
0052 MVA_FirstBrem,
0053 MVA_MVA,
0054 MVA_LAST
0055 };
0056
0057 enum ElectronVetoes {
0058 kFailsMVA,
0059 kKFTracksOnGSFCluster,
0060 kFailsTrackAndHCALIso,
0061 kKillAdditionalKFs,
0062 kItIsAPion,
0063 kCrazyEoverP,
0064 kTooLargeAngle,
0065 kN_EVETOS
0066 };
0067
0068 enum PhotonVetoes {
0069 kFailsTrackIso,
0070 kN_PHOVETOS
0071 };
0072
0073 public:
0074
0075 PFCandidateEGammaExtra();
0076
0077 PFCandidateEGammaExtra(const GsfTrackRef&);
0078
0079 ~PFCandidateEGammaExtra() { ; }
0080
0081
0082 void setGsfTrackRef(const reco::GsfTrackRef& ref);
0083
0084
0085 void setKfTrackRef(const reco::TrackRef& ref);
0086
0087
0088 void setGsfElectronClusterRef(const reco::PFBlockRef& blk, const reco::PFBlockElementCluster& ref) {
0089 eleGsfCluster_ = ElementInBlock(blk, ref.index());
0090 }
0091
0092
0093 reco::GsfTrackRef gsfTrackRef() const { return gsfTrackRef_; }
0094
0095
0096 reco::TrackRef kfTrackRef() const { return kfTrackRef_; }
0097
0098
0099 const ElementInBlock& gsfElectronClusterRef() const { return eleGsfCluster_; }
0100
0101
0102 reco::SuperClusterRef superClusterRef() const { return scRef_; }
0103
0104
0105 reco::SuperClusterRef superClusterPFECALRef() const { return scPFECALRef_; }
0106
0107
0108 void setSuperClusterRef(reco::SuperClusterRef sc) { scRef_ = sc; }
0109
0110
0111 void setSuperClusterPFECALRef(reco::SuperClusterRef sc) { scPFECALRef_ = sc; }
0112
0113
0114 void addSingleLegConvTrackRefMva(const std::pair<reco::TrackRef, float>& trackrefmva);
0115
0116
0117 const std::vector<std::pair<reco::TrackRef, float> >& singleLegConvTrackRefMva() const { return assoSingleLeg_; }
0118
0119
0120 void addConversionRef(const reco::ConversionRef& convref);
0121
0122
0123 reco::ConversionRefVector conversionRef() const { return assoConversionsRef_; }
0124
0125
0126 void addSingleLegConversionRef(const reco::ConversionRef& convref);
0127
0128
0129 reco::ConversionRefVector singleLegConversionRef() const { return singleLegConversions_; }
0130
0131
0132 void setLateBrem(float val);
0133
0134 void setEarlyBrem(float val);
0135
0136
0137 void setGsfTrackPout(const math::XYZTLorentzVector& pout);
0138
0139
0140 void setClusterEnergies(const std::vector<float>& energies);
0141
0142
0143 void setSigmaEtaEta(float val);
0144
0145
0146 void setDeltaEta(float val);
0147
0148
0149 void setHadEnergy(float val);
0150
0151
0152 void setMVA(float val);
0153
0154
0155 void setStatus(StatusFlag type, bool status = true);
0156
0157
0158 bool electronStatus(StatusFlag) const;
0159
0160
0161 int electronStatus() const { return status_; }
0162
0163
0164 bool mvaStatus(MvaVariable flag) const;
0165
0166
0167 const std::vector<float>& mvaVariables() const { return mvaVariables_; }
0168
0169
0170 float mvaVariable(MvaVariable var) const;
0171
0172
0173 float hadEnergy() const { return hadEnergy_; }
0174 float sigmaEtaEta() const { return sigmaEtaEta_; }
0175
0176
0177 void addExtraNonConvTrack(const reco::PFBlockRef& blk, const reco::PFBlockElementTrack& tkref) {
0178 if (!tkref.trackType(reco::PFBlockElement::T_FROM_GAMMACONV)) {
0179 assoNonConvExtraTracks_.push_back(std::make_pair(blk, tkref.index()));
0180 }
0181 }
0182 const ElementsInBlocks& extraNonConvTracks() const { return assoNonConvExtraTracks_; }
0183
0184 private:
0185 void setVariable(MvaVariable type, float var);
0186
0187 private:
0188
0189 reco::GsfTrackRef gsfTrackRef_;
0190
0191 reco::TrackRef kfTrackRef_;
0192
0193 ElementInBlock eleGsfCluster_;
0194
0195
0196 reco::SuperClusterRef scRef_;
0197
0198
0199 reco::SuperClusterRef scPFECALRef_;
0200
0201
0202 std::vector<std::pair<reco::TrackRef, float> > assoSingleLeg_;
0203
0204
0205 ElementsInBlocks assoNonConvExtraTracks_;
0206
0207
0208 reco::ConversionRefVector assoConversionsRef_;
0209
0210
0211 reco::ConversionRefVector singleLegConversions_;
0212
0213
0214
0215 std::vector<float> clusterEnergies_;
0216
0217
0218 std::vector<float> mvaVariables_;
0219
0220
0221 int mvaStatus_;
0222
0223
0224 int status_;
0225
0226
0227 math::XYZTLorentzVector pout_;
0228 float earlyBrem_;
0229 float lateBrem_;
0230 float sigmaEtaEta_;
0231 float hadEnergy_;
0232 float deltaEta_;
0233 };
0234
0235
0236 std::ostream& operator<<(std::ostream& out, const PFCandidateEGammaExtra& c);
0237
0238 }
0239 #endif