|
ATLAS Offline Software
|
Go to the documentation of this file.
12 const std::string&
name,
13 const IInterface *
parent) :
17 m_MaxNTracksSubjet(-1),
18 m_TrackSelectorTool(
"")
20 declareInterface<DiTauToolBase > (
this);
36 return StatusCode::SUCCESS;
41 const EventContext& ctx)
const
47 if (pDiTau ==
nullptr) {
49 return StatusCode::FAILURE;
55 std::vector<const xAOD::TrackParticle*> tauTracks;
56 std::vector<const xAOD::TrackParticle*> isoTracks;
57 std::vector<const xAOD::TrackParticle*> otherTracks;
77 std::vector<fastjet::PseudoJet> vSubjets =
data->subjets;
79 for (
auto subjet_itr = vSubjets.begin(); subjet_itr != vSubjets.end(); ) {
82 TLorentzVector temp_p4;
83 temp_p4.SetPtEtaPhiM(subjet_itr->pt(), subjet_itr->eta(), subjet_itr->phi_std(), subjet_itr->m());
85 for (
const auto&
track : tauTracks) {
93 subjet_itr = vSubjets.erase(subjet_itr);
95 ATH_MSG_DEBUG(
"number of tracks greater than MaxNTracksSubjet threshold. Drop subjet");
96 subjet_itr = vSubjets.erase(subjet_itr);
104 if (vSubjets.size()<=1) {
105 ATH_MSG_DEBUG(
"Found less than 2 subjets. Reject ditau candidate");
106 return StatusCode::FAILURE;
109 data->subjets = vSubjets;
110 ATH_MSG_DEBUG(
"number of subjets after track association: " <<
data->subjets.size());
115 for (
const auto&
track : tauTracks ) {
121 for (
const auto&
track : isoTracks ) {
127 for (
const auto&
track : otherTracks ) {
132 return StatusCode::SUCCESS;
139 std::vector<const xAOD::TrackParticle*> &tauTracks,
140 std::vector<const xAOD::TrackParticle*> &isoTracks,
141 std::vector<const xAOD::TrackParticle*> &otherTracks)
const {
143 for (
const auto *
const track : *pTrackParticleCont ) {
147 tauTracks.push_back(
track);
149 isoTracks.push_back(
track);
151 otherTracks.push_back(
track);
154 std::sort(tauTracks.begin(), tauTracks.end(),
TrackSort());
155 std::sort(isoTracks.begin(), isoTracks.end(),
TrackSort());
156 std::sort(otherTracks.begin(), otherTracks.end(),
TrackSort());
174 std::vector<fastjet::PseudoJet> vSubjets =
data->subjets;
175 for (
const auto &
subjet : vSubjets) {
177 TLorentzVector temp_p4;
virtual StatusCode execute(DiTauCandidateData *data, const EventContext &ctx) const override
Execute - called for each Ditau candidate.
char data[hepevt_bytes_allocation_ATLAS]
const VertexLink_t & vertexLink() const
virtual FourMom_t p4() const
The full 4-momentum of the particle.
DiTauTrackFinder(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
void clearIsoTrackLinks()
void addOtherTrack(const xAOD::TrackParticleContainer *, const xAOD::TrackParticle *)
void getTracksFromPV(const DiTauCandidateData *, const xAOD::TrackParticleContainer *, const xAOD::Vertex *, std::vector< const xAOD::TrackParticle * > &, std::vector< const xAOD::TrackParticle * > &, std::vector< const xAOD::TrackParticle * > &) const
ToolHandle< Trk::ITrackSelectorTool > m_TrackSelectorTool
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Helper method to sort tracks.
virtual ~DiTauTrackFinder()
Destructor.
void clearOtherTrackLinks()
bool isValid() const
Test to see if the link can be dereferenced.
void addTrack(const xAOD::TrackParticleContainer *, const xAOD::TrackParticle *)
void addIsoTrack(const xAOD::TrackParticleContainer *, const xAOD::TrackParticle *)
::StatusCode StatusCode
StatusCode definition for legacy code.
const_pointer_type get() const
Dereference the pointer, but don't cache anything.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
DiTauTrackType diTauTrackType(const DiTauCandidateData *, const xAOD::TrackParticle *, const xAOD::Vertex *) const
Class describing a Vertex.
#define ATH_MSG_WARNING(x)
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_TrackParticleContainerName
Class describing a TrackParticle.
Handle class for reading from StoreGate.
virtual StatusCode initialize() override
Tool initializer.