|
ATLAS Offline Software
|
Go to the documentation of this file.
39 ATH_MSG_ERROR(
"JetTrackSumMomentsTool needs to have its input jet container configured!");
40 return StatusCode::FAILURE;
48 return StatusCode::SUCCESS;
57 if (!handle_v.isValid()){
60 return StatusCode::FAILURE;
63 const auto *vertexContainer = handle_v.cptr();
67 if (!handle_tva.isValid()){
68 ATH_MSG_ERROR(
"Could not retrieve the TrackVertexAssociation: "
70 return StatusCode::FAILURE;
73 const auto *tva = handle_tva.cptr();
80 std::vector<const xAOD::TrackParticle*> tracks;
86 if (vertexContainer->empty() ) {
88 return StatusCode::FAILURE;
99 ATH_MSG_ERROR(
"OriginVertex was requested, but the jet does not contain an OriginVertex");
100 return StatusCode::FAILURE;
105 const std::pair<float,float> tracksums =
getJetTrackSums(HSvertex, tracks, tva);
107 trackSumPtHandle(*
jet) = tracksums.first;
108 trackSumMassHandle(*
jet) = tracksums.second;
111 <<
": TrackSumPt=" << tracksums.first
112 <<
", TrackSumMass=" << tracksums.second );
114 return StatusCode::SUCCESS;
121 for (
size_t iVertex = 0; iVertex < vertices->
size(); ++iVertex ) {
124 ATH_MSG_VERBOSE(
"JetVertexTaggerTool " <<
name() <<
" Found HS vertex at index: "<< iVertex);
125 return vertices->
at(iVertex);
128 ATH_MSG_VERBOSE(
"There is no vertex of type PriVx. Taking default vertex.");
129 return vertices->
at(0);
135 const std::vector<const xAOD::TrackParticle*>& tracks,
139 unsigned int nkeep = 0;
140 unsigned int nskip = 0;
142 for (
size_t iTrack = 0; iTrack < tracks.size(); ++iTrack) {
156 <<
": nsel=" << nkeep
157 <<
", nrej=" <<
nskip );
159 return std::make_pair(tracksum.Pt(),tracksum.M());
IParticle::FourMom_t FourMom_t
Definition of the 4-momentum type.
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
::StatusCode StatusCode
StatusCode definition for legacy code.
Class to hold N-to-one aassociations between tracks and vertices.
Handle class for adding a decoration to an object.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
size_t index() const
Return the index of this element within its container.
const xAOD::Vertex * associatedVertex(const xAOD::TrackParticle *trk) const
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Class describing a Vertex.
#define ATH_MSG_WARNING(x)
Class describing a TrackParticle.
const T * at(size_type n) const
Access an element, as an rvalue.
size_type size() const noexcept
Returns the number of elements in the collection.