00001 #ifndef TAUREC_TAUTRACKFINDER_H
00002 #define TAUREC_TAUTRACKFINDER_H
00003
00004 #include "tauRecTools/TauRecToolBase.h"
00005 #include "GaudiKernel/ToolHandle.h"
00006 #include "ITrackToVertex/ITrackToVertex.h"
00007
00008 #include "xAODTracking/Vertex.h"
00009 #include "xAODTracking/TrackParticle.h"
00010 #include "xAODTracking/TrackParticleContainer.h"
00011
00012 #include "VxVertex/RecVertex.h"
00013
00014 namespace Trk {
00015 class ITrackSelectorTool;
00016 class IParticleCaloExtensionTool;
00017 }
00018
00020
00031 class TauTrackFinder : virtual public TauRecToolBase {
00032 public:
00033
00035
00036 TauTrackFinder(const std::string& name);
00037 ASG_TOOL_CLASS2(TauTrackFinder, TauRecToolBase, ITauToolBase);
00038 ~TauTrackFinder();
00039
00040
00042
00043 enum TauTrackType
00044 {
00045 TauTrackCore = 0,
00046 TauTrackWide = 1,
00047 TauTrackOther = 2,
00048 NotTauTrack = 3
00049 };
00050
00051
00053
00054 virtual StatusCode initialize();
00055 virtual StatusCode eventInitialize();
00056 virtual StatusCode execute(xAOD::TauJet& pTau);
00057 virtual StatusCode eventFinalize();
00058 virtual StatusCode finalize();
00059
00060 virtual void print() const { }
00061
00062
00064
00065 StatusCode extrapolateToCaloSurface(xAOD::TauJet& pTau);
00066
00067 TauTrackType tauTrackType( const xAOD::TauJet& tauJet,
00068 const xAOD::TrackParticle& trackParticle,
00069 const xAOD::Vertex* primaryVertex);
00070
00071 void getTauTracksFromPV( const xAOD::TauJet& tauJet,
00072 const xAOD::TrackParticleContainer& trackParticleCont,
00073 const xAOD::Vertex* primaryVertex,
00074 std::vector<const xAOD::TrackParticle*> &tauTracks,
00075 std::vector<const xAOD::TrackParticle*> &wideTracks,
00076 std::vector<const xAOD::TrackParticle*> &otherTracks);
00077
00078
00079 void removeOffsideTracksWrtLeadTrk(std::vector<const Rec::TrackParticle*> &tauTracks,
00080 std::vector<const Rec::TrackParticle*> &wideTracks,
00081 std::vector<const Rec::TrackParticle*> &otherTracks,
00082 const Trk::RecVertex* tauOrigin,
00083 double maxDeltaZ0);
00084
00085
00086 void removeOffsideTracksWrtLeadTrk(std::vector<const xAOD::TrackParticle*> &tauTracks,
00087 std::vector<const xAOD::TrackParticle*> &wideTracks,
00088 std::vector<const xAOD::TrackParticle*> &otherTracks,
00089 const xAOD::Vertex* tauOrigin,
00090 double maxDeltaZ0);
00091
00092 void getDeltaZ0Values(std::vector<float>& vDeltaZ0coreTrks, std::vector<float>& vDeltaZ0wideTrks);
00093 void resetDeltaZ0Cache();
00094
00095 private:
00096
00098
00099 float getZ0(const Rec::TrackParticle* track, const Trk::RecVertex* vertex);
00100 float getZ0(const xAOD::TrackParticle* track, const xAOD::Vertex* vertex);
00101
00102 private:
00103
00105
00106 std::string m_inputTauJetContainerName;
00107 std::string m_inputTrackParticleContainerName;
00108 std::string m_inputPrimaryVertexContainerName;
00109
00110
00112
00113 ToolHandle< Trk::IParticleCaloExtensionTool > m_caloExtensionTool;
00114 ToolHandle<Trk::ITrackSelectorTool> m_trackSelectorTool_tau;
00115 ToolHandle<Reco::ITrackToVertex> m_trackToVertexTool;
00116
00117
00119
00120 double m_maxJetDr_tau;
00121 double m_maxJetDr_wide;
00122
00123
00124
00125
00126 float m_z0maxDelta;
00127 bool m_applyZ0cut;
00128 bool m_storeInOtherTrks;
00129 std::vector<float> m_vDeltaZ0coreTrks;
00130 std::vector<float> m_vDeltaZ0wideTrks;
00131
00132
00133
00134
00135
00136 bool m_bypassSelector;
00137 bool m_bypassExtrapolator;
00138
00139
00141
00142 template <class T>
00143 bool openContainer(T* &container, std::string containerName, bool printFATAL=false);
00144
00145 template <class T>
00146 bool retrieveTool(T &tool);
00147
00148 };
00149
00150 #endif