JetTrackSelectionTool.h 1.25 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Dear emacs, this is -*- c++ -*-

/*
  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/

#ifndef JETRECTOOLS_JETTRACKSELECTIONTOOL_H
#define JETRECTOOLS_JETTRACKSELECTIONTOOL_H

#include "AsgTools/AsgTool.h"
#include "JetInterface/IJetExecuteTool.h"

#include "xAODTracking/TrackParticleContainer.h"
#include "TrkToolInterfaces/ITrackSelectorTool.h"

#include "GaudiKernel/ToolHandle.h"
#include "AthContainers/ConstDataVector.h"

class JetTrackSelectionTool
  : public asg::AsgTool,
    virtual public IJetExecuteTool {
  ASG_TOOL_CLASS(JetTrackSelectionTool, IJetExecuteTool)
  
  public:
  JetTrackSelectionTool(const std::string &name);

  virtual StatusCode initialize() ;
  
  virtual int execute() const ;

  void selectTracks(const xAOD::TrackParticleContainer& inCont, ConstDataVector<xAOD::TrackParticleContainer>& outCont) const;
  void selectTracks(const xAOD::TrackParticleContainer& inCont, std::vector<const xAOD::TrackParticle*> outCont) const;
  
protected:
  template<class T>
  void selectionLoop(const xAOD::TrackParticleContainer& inCont, T& outCont) const;

  ToolHandle<Trk::ITrackSelectorTool> m_selector;
  float m_ptMin;
  float m_etaMin, m_etaMax;

  std::string m_inputContainer;
  std::string m_outputContainer;

};

#endif