File indexing completed on 2024-04-06 12:01:04
0001 #ifndef CommonTools_Egamma_ConversionTools_h
0002 #define CommonTools_Egamma_ConversionTools_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 #include "DataFormats/Math/interface/Point3D.h"
0024 #include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
0025 #include "DataFormats/EgammaCandidates/interface/Photon.h"
0026 #include "DataFormats/EgammaCandidates/interface/ConversionFwd.h"
0027 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0028 #include "DataFormats/Math/interface/Point3D.h"
0029 #include "DataFormats/GsfTrackReco/interface/GsfTrackFwd.h"
0030
0031 class ConversionTools {
0032 public:
0033 ConversionTools() {}
0034
0035 static bool isGoodConversion(const reco::Conversion &conv,
0036 const math::XYZPoint &beamspot,
0037 float lxyMin = 2.0,
0038 float probMin = 1e-6,
0039 unsigned int nHitsBeforeVtxMax = 1);
0040
0041 static bool matchesConversion(const reco::GsfElectron &ele,
0042 const reco::Conversion &conv,
0043 bool allowCkfMatch = true,
0044 bool allowAmbiguousGsfMatch = false);
0045 static bool matchesConversion(const reco::GsfElectronCore &eleCore,
0046 const reco::Conversion &conv,
0047 bool allowCkfMatch = true);
0048 static bool matchesConversion(const reco::SuperCluster &sc,
0049 const reco::Conversion &conv,
0050 float dRMax = 0.1,
0051 float dEtaMax = 999.,
0052 float dPhiMax = 999.);
0053 static bool matchesConversion(const edm::RefToBase<reco::Track> &trk, const reco::Conversion &conv);
0054 static bool matchesConversion(const reco::TrackRef &trk, const reco::Conversion &conv);
0055 static bool matchesConversion(const reco::GsfTrackRef &trk, const reco::Conversion &conv);
0056
0057 static bool hasMatchedConversion(const reco::GsfElectron &ele,
0058 const reco::ConversionCollection &convCol,
0059 const math::XYZPoint &beamspot,
0060 bool allowCkfMatch = true,
0061 float lxyMin = 2.0,
0062 float probMin = 1e-6,
0063 unsigned int nHitsBeforeVtxMax = 0);
0064
0065 static bool hasMatchedConversion(const reco::TrackRef &trk,
0066 const reco::ConversionCollection &convCol,
0067 const math::XYZPoint &beamspot,
0068 float lxyMin = 2.0,
0069 float probMin = 1e-6,
0070 unsigned int nHitsBeforeVtxMax = 1);
0071
0072 static bool hasMatchedConversion(const reco::SuperCluster &sc,
0073 const reco::ConversionCollection &convCol,
0074 const math::XYZPoint &beamspot,
0075 float dRMax = 0.1,
0076 float dEtaMax = 999.,
0077 float dPhiMax = 999.,
0078 float lxyMin = 2.0,
0079 float probMin = 1e-6,
0080 unsigned int nHitsBeforeVtxMax = 1);
0081
0082 static reco::Conversion const *matchedConversion(const reco::GsfElectron &ele,
0083 const reco::ConversionCollection &convCol,
0084 const math::XYZPoint &beamspot,
0085 bool allowCkfMatch = true,
0086 float lxyMin = 2.0,
0087 float probMin = 1e-6,
0088 unsigned int nHitsBeforeVtxMax = 0);
0089
0090 static reco::Conversion const *matchedConversion(const reco::GsfElectronCore &eleCore,
0091 const reco::ConversionCollection &convCol,
0092 const math::XYZPoint &beamspot,
0093 bool allowCkfMatch = true,
0094 float lxyMin = 2.0,
0095 float probMin = 1e-6,
0096 unsigned int nHitsBeforeVtxMax = 0);
0097
0098 static reco::Conversion const *matchedConversion(const reco::TrackRef &trk,
0099 const reco::ConversionCollection &convCol,
0100 const math::XYZPoint &beamspot,
0101 float lxyMin = 2.0,
0102 float probMin = 1e-6,
0103 unsigned int nHitsBeforeVtxMax = 1);
0104
0105 static reco::Conversion const *matchedConversion(const reco::SuperCluster &sc,
0106 const reco::ConversionCollection &convCol,
0107 const math::XYZPoint &beamspot,
0108 float dRMax = 0.1,
0109 float dEtaMax = 999.,
0110 float dPhiMax = 999.,
0111 float lxyMin = 2.0,
0112 float probMin = 1e-6,
0113 unsigned int nHitsBeforeVtxMax = 1);
0114
0115 static bool hasMatchedPromptElectron(const reco::SuperClusterRef &sc,
0116 const reco::GsfElectronCollection &eleCol,
0117 const reco::ConversionCollection &convCol,
0118 const math::XYZPoint &beamspot,
0119 bool allowCkfMatch = true,
0120 float lxyMin = 2.0,
0121 float probMin = 1e-6,
0122 unsigned int nHitsBeforeVtxMax = 0);
0123
0124 static reco::GsfElectron const *matchedPromptElectron(const reco::SuperClusterRef &sc,
0125 const reco::GsfElectronCollection &eleCol,
0126 const reco::ConversionCollection &convCol,
0127 const math::XYZPoint &beamspot,
0128 bool allowCkfMatch = true,
0129 float lxyMin = 2.0,
0130 float probMin = 1e-6,
0131 unsigned int nHitsBeforeVtxMax = 0);
0132
0133 static float getVtxFitProb(const reco::Conversion *conv);
0134 };
0135 #endif