|
ATLAS Offline Software
|
Go to the documentation of this file.
18 #include "fastjet/PseudoJet.hh"
22 const std::string&
name,
23 const IInterface *
parent) :
27 m_MaxNTracksSubjet(-1),
28 m_TrackSelectorTool(
"")
30 declareInterface<DiTauToolBase > (
this);
46 return StatusCode::SUCCESS;
51 const EventContext& ctx)
const
57 if (pDiTau ==
nullptr) {
59 return StatusCode::FAILURE;
65 std::vector<const xAOD::TrackParticle*> tauTracks;
66 std::vector<const xAOD::TrackParticle*> isoTracks;
67 std::vector<const xAOD::TrackParticle*> otherTracks;
87 std::vector<fastjet::PseudoJet> vSubjets =
data->subjets;
89 for (
auto subjet_itr = vSubjets.begin(); subjet_itr != vSubjets.end(); ) {
92 TLorentzVector temp_p4;
93 temp_p4.SetPtEtaPhiM(subjet_itr->pt(), subjet_itr->eta(), subjet_itr->phi_std(), subjet_itr->m());
95 for (
const auto&
track : tauTracks) {
103 subjet_itr = vSubjets.erase(subjet_itr);
105 ATH_MSG_DEBUG(
"number of tracks greater than MaxNTracksSubjet threshold. Drop subjet");
106 subjet_itr = vSubjets.erase(subjet_itr);
114 if (vSubjets.size()<=1) {
115 ATH_MSG_DEBUG(
"Found less than 2 subjets. Reject ditau candidate");
116 return StatusCode::FAILURE;
119 data->subjets = vSubjets;
120 ATH_MSG_DEBUG(
"number of subjets after track association: " <<
data->subjets.size());
125 for (
const auto&
track : tauTracks ) {
131 for (
const auto&
track : isoTracks ) {
137 for (
const auto&
track : otherTracks ) {
142 return StatusCode::SUCCESS;
149 std::vector<const xAOD::TrackParticle*> &tauTracks,
150 std::vector<const xAOD::TrackParticle*> &isoTracks,
151 std::vector<const xAOD::TrackParticle*> &otherTracks)
const {
153 for (
const auto *
const track : *pTrackParticleCont ) {
157 tauTracks.push_back(
track);
159 isoTracks.push_back(
track);
161 otherTracks.push_back(
track);
164 std::sort(tauTracks.begin(), tauTracks.end(),
TrackSort());
165 std::sort(isoTracks.begin(), isoTracks.end(),
TrackSort());
166 std::sort(otherTracks.begin(), otherTracks.end(),
TrackSort());
184 std::vector<fastjet::PseudoJet> vSubjets =
data->subjets;
185 for (
const auto &
subjet : vSubjets) {
187 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.