CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/RecoEgamma/EgammaTools/interface/ConversionTools.h

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------------------------------
00002 // $Id: ConversionTools.h,v 1.2 2011/05/10 19:27:22 eulisse Exp $
00003 //
00004 // ConversionTools
00005 //
00006 // Utility to match electrons/photons/tracks to conversions and perform various conversion
00007 // selection criteria.
00008 //
00009 // Matching to photons is by geometrical match with the SuperCluster (defined by angle between
00010 // conversion momentum and vector joining conversion vertex to SuperCluster position)
00011 //
00012 // Matching to tracks and electrons is by reference.
00013 //
00014 // Also implemented here is a "conversion-safe electron veto" for photons through the
00015 // matchedPromptElectron and hasMatchedPromptElectron functions
00016 // 
00017 //
00018 // Authors: J.Bendavid
00019 //--------------------------------------------------------------------------------------------------
00020 
00021 #ifndef EgammaTools_ConversionTools_h
00022 #define EgammaTools_ConversionTools_h
00023 
00024 #include "DataFormats/TrackReco/interface/Track.h"
00025 #include "DataFormats/Math/interface/Point3D.h"
00026 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
00027 #include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
00028 #include "DataFormats/EgammaCandidates/interface/Photon.h"
00029 #include "DataFormats/EgammaCandidates/interface/ConversionFwd.h"
00030 #include "DataFormats/TrackReco/interface/Track.h"
00031 #include "DataFormats/TrackReco/interface/TrackExtra.h"
00032 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00033 #include "DataFormats/Math/interface/Point3D.h"
00034 #include "MagneticField/Engine/interface/MagneticField.h"
00035 #include "DataFormats/GsfTrackReco/interface/GsfTrack.h"
00036 #include "DataFormats/GsfTrackReco/interface/GsfTrackFwd.h"
00037 class ConversionTools
00038 {
00039   public:
00040     ConversionTools() {}
00041                                                       
00042                                                 
00043     static bool                        isGoodConversion(const reco::Conversion &conv, const math::XYZPoint &beamspot, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=1);
00044     
00045     static bool                        matchesConversion(const reco::GsfElectron &ele, const reco::Conversion &conv, bool allowCkfMatch=true);
00046     static bool                        matchesConversion(const reco::SuperCluster &sc, const reco::Conversion &conv, float dRMax = 0.1, float dEtaMax = 999., float dPhiMax = 999.);
00047     static bool                        matchesConversion(const edm::RefToBase<reco::Track> &trk, const reco::Conversion &conv);
00048     static bool                        matchesConversion(const reco::TrackRef &trk, const reco::Conversion &conv);
00049     static bool                        matchesConversion(const reco::GsfTrackRef &trk, const reco::Conversion &conv);
00050 
00051 
00052     static bool                        hasMatchedConversion(const reco::GsfElectron &ele,
00053                                                   const edm::Handle<reco::ConversionCollection> &convCol, const math::XYZPoint &beamspot, bool allowCkfMatch=true, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=0);
00054 
00055     static bool                        hasMatchedConversion(const reco::TrackRef &trk,
00056                                                   const edm::Handle<reco::ConversionCollection> &convCol, const math::XYZPoint &beamspot, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=1);
00057 
00058     static bool                        hasMatchedConversion(const reco::SuperCluster &sc,
00059                                                   const edm::Handle<reco::ConversionCollection> &convCol, const math::XYZPoint &beamspot, float dRMax = 0.1, float dEtaMax = 999., float dPhiMax = 999., float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=1);
00060 
00061 
00062     static reco::ConversionRef         matchedConversion(const reco::GsfElectron &ele,
00063                                                   const edm::Handle<reco::ConversionCollection> &convCol, const math::XYZPoint &beamspot, bool allowCkfMatch=true, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=0);
00064 
00065     static reco::ConversionRef         matchedConversion(const reco::TrackRef &trk,
00066                                                   const edm::Handle<reco::ConversionCollection> &convCol, const math::XYZPoint &beamspot, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=1);
00067 
00068     static reco::ConversionRef         matchedConversion(const reco::SuperCluster &sc,
00069                                                   const edm::Handle<reco::ConversionCollection> &convCol, const math::XYZPoint &beamspot, float dRMax = 0.1, float dEtaMax = 999., float dPhiMax = 999., float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=1);
00070 
00071     static bool                        hasMatchedPromptElectron(const reco::SuperClusterRef &sc, const edm::Handle<reco::GsfElectronCollection> &eleCol,
00072                                                   const edm::Handle<reco::ConversionCollection> &convCol, const math::XYZPoint &beamspot, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=0);
00073 
00074 
00075     static reco::GsfElectronRef        matchedPromptElectron(const reco::SuperClusterRef &sc, const edm::Handle<reco::GsfElectronCollection> &eleCol,
00076                                                   const edm::Handle<reco::ConversionCollection> &convCol, const math::XYZPoint &beamspot, float lxyMin=2.0, float probMin=1e-6, unsigned int nHitsBeforeVtxMax=0);
00077 
00078 };
00079 #endif