CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/RecoEgamma/EgammaPhotonAlgos/interface/ConversionTrackPairFinder.h

Go to the documentation of this file.
00001 #ifndef ConversionTrackPairFinder_H
00002 #define ConversionTrackPairFinder_H
00003 
00014 #include "DataFormats/TrackReco/interface/Track.h"
00015 #include "DataFormats/TrackReco/interface/TrackExtra.h"
00016 #include "DataFormats/GsfTrackReco/interface/GsfTrack.h"
00017 #include "DataFormats/GsfTrackReco/interface/GsfTrackFwd.h"
00018 #include "DataFormats/GsfTrackReco/interface/GsfTrackExtra.h"
00019 
00020 //
00021 #include "FWCore/Framework/interface/ESHandle.h"
00022 #include "FWCore/Framework/interface/EventSetup.h"
00023 #include "FWCore/Framework/interface/Event.h"
00024 #include "DataFormats/Common/interface/Handle.h"
00025 #include "DataFormats/CaloRecHit/interface/CaloClusterFwd.h"
00026 #include "DataFormats/Common/interface/ValueMap.h"
00027 
00028 //
00029 #include "TrackingTools/TransientTrack/interface/TransientTrack.h"
00030 #include "TrackingTools/TransientTrack/interface/TrackTransientTrack.h"
00031 #include "DataFormats/EgammaTrackReco/interface/TrackCaloClusterAssociation.h"
00032 
00033 
00034 struct CompareTwoTracks {  
00035   bool operator() ( const reco::TransientTrack& a, const reco::TransientTrack & b ) const{
00036     return a.impactPointState().globalMomentum().perp() > b.impactPointState().globalMomentum().perp();}
00037 };
00038 
00039 struct CompareTwoTracksVectors {
00040    bool operator() ( const std::vector<reco::TransientTrack> & a, const std::vector<reco::TransientTrack> & b ) const{
00041            return ( a[0].impactPointState().globalMomentum().perp() >
00042                      b[0].impactPointState().globalMomentum().perp() ) ;}
00043    };
00044 
00045 
00046 class ConversionTrackPairFinder {
00047 
00048 public:
00049 
00050   ConversionTrackPairFinder();
00051 
00052 
00053   ~ConversionTrackPairFinder();
00054 
00055 
00056 
00057   std::map<std::vector<reco::TransientTrack>,  reco::CaloClusterPtr, CompareTwoTracksVectors>  run(const std::vector<reco::TransientTrack>& outIn,  
00058                                               const edm::Handle<reco::TrackCollection>&  outInTrkHandle,
00059                                               const edm::Handle<reco::TrackCaloClusterPtrAssociation>&  outInTrackSCAssH, 
00060                                               const std::vector<reco::TransientTrack>& inOut,  
00061                                               const edm::Handle<reco::TrackCollection>& inOutTrkHandle,
00062                                               const edm::Handle<reco::TrackCaloClusterPtrAssociation>& inOutTrackSCAssH  );
00063 
00064 
00065 
00066 
00067  private:
00068 
00069 class ByNumOfHits {
00070  public:
00071   bool operator()(reco::TransientTrack const & a, reco::TransientTrack  const & b) {
00072     if (a.numberOfValidHits()  == b.numberOfValidHits()  ) {
00073       return a.normalizedChi2() < b.normalizedChi2();
00074     } else {
00075       return a.numberOfValidHits()  > b.numberOfValidHits() ;
00076     }
00077   }
00078 };
00079 
00080 
00081 
00082 };
00083 
00084 #endif // ConversionTrackPairFinder_H
00085 
00086