00001
00002 #ifndef TRIGGERMATCHINGTOOL_MATCHINGTOOL_H
00003 #define TRIGGERMATCHINGTOOL_MATCHINGTOOL_H
00004
00005
00006 #include "AsgTools/AsgTool.h"
00007 #include "AsgTools/ToolHandle.h"
00008
00009 #include "TriggerMatchingTool/IMatchingTool.h"
00010 #include "TriggerMatchingTool/TypeMap.h"
00011 #include "TriggerMatchingTool/IMatchingTool.h"
00012 #include "TrigDecisionTool/Combination.h"
00013 #include "TrigDecisionTool/TrigDecisionTool.h"
00014
00015 namespace Trig {
00016
00017 class MatchingTool : public asg::AsgTool,
00018 virtual public Trig::IMatchingTool {
00019 ASG_TOOL_CLASS(MatchingTool,IMatchingTool)
00020
00021 public:
00022 friend class MatchingImplementation;
00023 MatchingTool(const std::string& name);
00024 ~MatchingTool();
00025 StatusCode initialize();
00026
00027 bool match(const std::vector<const xAOD::IParticle*>& recoObjects, const std::string& chain);
00028 bool match(const std::vector<const xAOD::IParticle*>& recoObjects, const std::string& chain, double matchTreshold);
00029 bool match(const xAOD::IParticle& recoObjects, const std::string& chain, double matchTreshold);
00030
00031 protected:
00032 MatchingImplementation* impl();
00033
00034 bool matchSingleType(const std::vector<const xAOD::IParticle*>& subRecoObjects, Trig::Combination& comb);
00035
00036 bool matchCombination(const std::vector<const xAOD::IParticle*>& recoObjects, Trig::Combination& comb);
00037
00038
00039 #ifndef XAOD_STANDALONE
00040 void updateOutputLevel(Property& p);
00041 void updateThreshold(Property& p);
00042 #endif
00043
00044 private:
00045
00046 double IParticleMetric(const xAOD::IParticle* lhs, const xAOD::IParticle* rhs);
00047 std::vector<std::vector<double> > distanceMatrix(const std::vector<const xAOD::IParticle*>& reco,
00048 const std::vector<const xAOD::IParticle*>& trigger);
00049
00050
00051 MatchingImplementation* m_impl;
00052 TypeMap m_typeMap;
00053 ToolHandle<Trig::TrigDecisionTool> m_trigDecTool;
00054 double m_matchingThreshold;
00055 };
00056
00057 }
00058
00059 #endif