CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/RecoJets/JetAssociationAlgorithms/interface/JetSignalVertexCompatibilityAlgo.h

Go to the documentation of this file.
00001 #ifndef JetSignalVertexCompatibilityAlgo_h
00002 #define JetSignalVertexCompatibilityAlgo_h
00003 
00004 #include <functional>
00005 #include <vector>
00006 #include <map>
00007 
00008 #include "DataFormats/Common/interface/RefToBase.h"
00009 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00010 #include "DataFormats/VertexReco/interface/VertexFwd.h"
00011 
00012 #include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h"
00013 
00014 namespace reco {
00015 
00016 class JetSignalVertexCompatibilityAlgo {
00017     public:
00018         JetSignalVertexCompatibilityAlgo(double cut, double temperature);
00019         ~JetSignalVertexCompatibilityAlgo();
00020 
00021         std::vector<float> compatibility(
00022                                 const reco::VertexCollection &vertices,
00023                                 const reco::TrackRefVector &tracks) const;
00024 
00025         void resetEvent(const TransientTrackBuilder *trackBuilder);
00026 
00027     private:
00028         template<typename T>
00029         struct RefToBaseLess : public std::binary_function<edm::RefToBase<T>,
00030                                                            edm::RefToBase<T>,
00031                                                            bool> {
00032                 bool operator()(const edm::RefToBase<T> &r1,
00033                                 const edm::RefToBase<T> &r2) const;
00034         };
00035 
00036         typedef std::map<reco::TrackBaseRef, reco::TransientTrack,
00037                          RefToBaseLess<reco::Track> > TransientTrackMap;
00038 
00039         const TransientTrack &convert(const reco::TrackBaseRef &track) const;
00040         double activation(double compat) const;
00041 
00042         static double trackVertexCompat(const reco::Vertex &vtx,
00043                                         const TransientTrack &track);
00044 
00045         mutable TransientTrackMap       trackMap;
00046         const TransientTrackBuilder     *trackBuilder;
00047 
00048         const double                    cut;
00049         const double                    temperature;
00050 };
00051 
00052 } // namespace reco
00053 
00054 #endif // JetSignalVertexCompatibilityAlgo_h