00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef JetIsolationTool_H
00010 #define JetIsolationTool_H
00011
00068
00069 #include "AsgTools/AsgTool.h"
00070 #include "AsgTools/ToolHandle.h"
00071 #include "JetRec/JetModifierBase.h"
00072 #include "JetUtils/TiledEtaPhiMap.h"
00073 #include "JetInterface/IPseudoJetGetter.h"
00074 #include "fastjet/PseudoJet.hh"
00075 #include "JetEDM/IConstituentUserInfo.h"
00076
00077 namespace jet {
00078
00079 namespace JetIsolation {
00080 class IsolationCalculator;
00081 }
00082
00086 struct ParticlePosition {
00087 ParticlePosition(const fastjet::PseudoJet* p)
00088 : m_eta(p->eta()), m_phi(p->phi()), m_part(p) { };
00089 ParticlePosition(const xAOD::IParticle* p)
00090 : m_eta(p->eta()), m_phi(p->phi()), m_part(nullptr) { };
00091 ParticlePosition(double x=0, double y=0)
00092 : m_eta(x), m_phi(y), m_part(nullptr) { }
00093 double x() const {return m_eta;}
00094 double y() const {return m_phi;}
00095 double px() const { return m_part->px(); }
00096 double py() const { return m_part->py(); }
00097 double pz() const { return m_part->pz(); }
00098 double e() const { return m_part->e(); }
00099 double pt() const { return m_part->perp(); }
00100 void setX(double x){m_eta=x;}
00101 void setY(double x){m_phi=x;}
00102
00103 const fastjet::PseudoJet* particle() const {return m_part;}
00104
00105 struct DR2 {
00106 double operator()(const ParticlePosition &p1,const ParticlePosition &p2) const {
00107 return JetTiledMap::utils::DR2(p1.x(),p1.y(), p2.x(), p2.y() );
00108 }
00109 };
00110
00111 protected:
00112 double m_eta,m_phi;
00113 const fastjet::PseudoJet* m_part ;
00114 };
00115
00116 }
00117
00118
00119
00120 class JetIsolationTool : public JetModifierBase {
00121 ASG_TOOL_CLASS0(JetIsolationTool)
00122
00123 public:
00124
00125 friend class jet::JetIsolation::IsolationCalculator;
00126
00128 JetIsolationTool(const std::string &myname);
00129
00131 ~JetIsolationTool();
00132
00133
00134 StatusCode initialize();
00135 StatusCode finalize();
00136
00137
00138 int modify(xAOD::JetContainer& jets) const;
00139 int modifyJet(xAOD::Jet& ) const{return 0;};
00140
00141 private:
00142
00143 std::vector<std::string> m_isolationCodes;
00144 ToolHandle<IPseudoJetGetter> m_hpjg;
00145
00148
00149 std::vector<jet::JetIsolation::IsolationCalculator*> m_isoCalculators;
00150
00151 };
00152
00153 #endif