Skip to content
Snippets Groups Projects
Commit e018028a authored by David Richard Shope's avatar David Richard Shope Committed by Graeme Stewart
Browse files

Reimplement methods using xAOD::Vertex in TwoTrackVerticesInJet (VxJetVertex-00-04-07)

2016-06-17 David Shope <david.richard.shope@cern.ch>
	* Reimplemented the following methods inside TwoTrackVertices after
		EDM migration to xAOD::Vertex
		- copy constructor / assignment operator
		- setter methods
		- getter method for NeutralTrackOfVertices
	* tag as VxJetVertex-00-04-07

2016-06-03 Michael Ughetto <Michael.Ughetto@cern.ch>
	* Bugfix for the TwoTrackVertices getter
	* tag as VxJetVertex-00-04-06
2016-05-30 Michael Ughetto <Michael.Ughetto@cern.ch>
	* Migration from VxCandidate to xAOD::Vertex
	* tag as VxJetVertex-00-04-04
2015-03-09 Guennadi Borissov <Gennady.Borisov@cern.ch>
parent 1919aedf
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,7 @@ atlas_depends_on_subdirs( PUBLIC
Tracking/TrkEvent/TrkTrack
Tracking/TrkEvent/TrkTrackLink
Tracking/TrkEvent/VxVertex
Event/xAOD/xAODTracking
PRIVATE
Control/DataModel )
......@@ -34,3 +35,4 @@ atlas_add_dictionary( VxJetVertexDict
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} EventPrimitives GaudiKernel TrkEventPrimitives TrkParticleBase TrkTrack VxVertex DataModel VxJetVertex )
......@@ -30,13 +30,14 @@
#include <vector>
#include <map>
#include "xAODTracking/Vertex.h"
namespace Trk
{
class TrackParticleBase;
class VxCandidate;
}
namespace Trk
{
......@@ -64,7 +65,7 @@ namespace Trk
* (every neutral track in the second vector MUST correspond to a two track vertex
* in the first vector)
*/
TwoTrackVerticesInJet(const std::vector<const VxCandidate*> & twoTrackVertices,
TwoTrackVerticesInJet(const std::vector<const xAOD::Vertex*> & twoTrackVertices,
const std::vector<const TrackParticleBase*> & neutralTrackOfVertex);
/**
......@@ -76,7 +77,7 @@ namespace Trk
/**
* Set the two track vertices (takes ownership of pointers)
*/
void setTwoTrackVertices(std::vector<const VxCandidate*> & twoTrackVertices);
void setTwoTrackVertices(std::vector<const xAOD::Vertex*> & twoTrackVertices);
/**
......@@ -87,7 +88,7 @@ namespace Trk
/**
* Get the two track vertices (please do not delete the pointers)
*/
const std::vector<const VxCandidate*> & getTwoTrackVertice() const ;
const std::vector<const xAOD::Vertex *> & getTwoTrackVertice() const ;
/**
......@@ -98,9 +99,9 @@ namespace Trk
private:
void deleteAll(std::vector<const TrackParticleBase*> & neutralTrackOfVertex);
void deleteAll(std::vector<const VxCandidate*> & twoTrackVertices);
void deleteAll(std::vector<const xAOD::Vertex*> & twoTrackVertices);
std::vector<const VxCandidate*> m_twoTrackVertices;
std::vector<const xAOD::Vertex*> m_twoTrackVertices;
std::vector<const TrackParticleBase*> m_neutralTrackOfVertex;
};
......
......@@ -13,10 +13,12 @@ use VxVertex VxVertex-* Tracking/TrkEvent
use TrkTrackLink TrkTrackLink-* Tracking/TrkEvent
use TrkParticleBase TrkParticleBase-* Tracking/TrkEvent
use EventPrimitives EventPrimitives-* Event
use xAODTracking xAODTracking-* Event/xAOD
library VxJetVertex *.cxx
apply_pattern installed_library
private
# persistency
use DataModel DataModel-* Control
......
......@@ -21,17 +21,15 @@
#include "VxJetVertex/TwoTrackVerticesInJet.h"
#include "VxVertex/VxCandidate.h"
#include "TrkParticleBase/TrackParticleBase.h"
#include "TrkParticleBase/TrackParticleBase.h"
namespace Trk
{
TwoTrackVerticesInJet::TwoTrackVerticesInJet() {}
TwoTrackVerticesInJet::TwoTrackVerticesInJet(const std::vector<const VxCandidate*> & twoTrackVertices,
TwoTrackVerticesInJet::TwoTrackVerticesInJet(const std::vector<const xAOD::Vertex*> & twoTrackVertices,
const std::vector<const TrackParticleBase*> & neutralTrackOfVertex)
:
m_twoTrackVertices(twoTrackVertices),
......@@ -48,23 +46,23 @@ namespace Trk
TwoTrackVerticesInJet::TwoTrackVerticesInJet(const TwoTrackVerticesInJet& rhs)
{
std::vector<const VxCandidate*>::const_iterator vxBegin=rhs.m_twoTrackVertices.begin();
std::vector<const VxCandidate*>::const_iterator vxEnd=rhs.m_twoTrackVertices.end();
std::vector<const xAOD::Vertex*>::const_iterator vxBegin=rhs.m_twoTrackVertices.begin();
std::vector<const xAOD::Vertex*>::const_iterator vxEnd=rhs.m_twoTrackVertices.end();
std::vector<const TrackParticleBase*>::const_iterator neuBegin=rhs.m_neutralTrackOfVertex.begin();
std::vector<const TrackParticleBase*>::const_iterator neuEnd=rhs.m_neutralTrackOfVertex.end();
for (std::vector<const VxCandidate*>::const_iterator vxIter=vxBegin;
for (std::vector<const xAOD::Vertex*>::const_iterator vxIter=vxBegin;
vxIter!=vxEnd;++vxIter)
{
if (*vxIter!=0)
{
const VxCandidate* thisPtr=*vxIter;
const VxCandidate* newVxCandidate=thisPtr->clone();
m_twoTrackVertices.push_back(newVxCandidate);
const xAOD::Vertex* thisPtr=*vxIter;
//const xAOD::Vertex* newVertex=thisPtr->clone();
const xAOD::Vertex* newVertex = new xAOD::Vertex(*thisPtr);
m_twoTrackVertices.push_back(newVertex);
}
}
......@@ -88,21 +86,22 @@ namespace Trk
m_twoTrackVertices.clear();
m_neutralTrackOfVertex.clear();
std::vector<const VxCandidate*>::const_iterator vxBegin=rhs.m_twoTrackVertices.begin();
std::vector<const VxCandidate*>::const_iterator vxEnd=rhs.m_twoTrackVertices.end();
std::vector<const xAOD::Vertex*>::const_iterator vxBegin=rhs.m_twoTrackVertices.begin();
std::vector<const xAOD::Vertex*>::const_iterator vxEnd=rhs.m_twoTrackVertices.end();
std::vector<const TrackParticleBase*>::const_iterator neuBegin=rhs.m_neutralTrackOfVertex.begin();
std::vector<const TrackParticleBase*>::const_iterator neuEnd=rhs.m_neutralTrackOfVertex.end();
for (std::vector<const VxCandidate*>::const_iterator vxIter=vxBegin;
for (std::vector<const xAOD::Vertex*>::const_iterator vxIter=vxBegin;
vxIter!=vxEnd;++vxIter)
{
if (*vxIter!=0)
{
const VxCandidate* thisPtr=*vxIter;
const VxCandidate* newVxCandidate=thisPtr->clone();
m_twoTrackVertices.push_back(newVxCandidate);
const xAOD::Vertex* thisPtr=*vxIter;
//const xAOD::Vertex* newVertex=thisPtr->clone();
const xAOD::Vertex* newVertex = new xAOD::Vertex(*thisPtr);
m_twoTrackVertices.push_back(newVertex);
}
}
......@@ -121,7 +120,7 @@ namespace Trk
}
void TwoTrackVerticesInJet::setTwoTrackVertices(std::vector<const VxCandidate*> & twoTrackVertices)
void TwoTrackVerticesInJet::setTwoTrackVertices(std::vector<const xAOD::Vertex*> & twoTrackVertices)
{
deleteAll(m_twoTrackVertices);
m_twoTrackVertices=twoTrackVertices;
......@@ -133,7 +132,7 @@ namespace Trk
m_neutralTrackOfVertex=neutralTrackOfVertex;
}
const std::vector<const VxCandidate*> & TwoTrackVerticesInJet::getTwoTrackVertice() const {
const std::vector<const xAOD::Vertex*> & TwoTrackVerticesInJet::getTwoTrackVertice() const {
return m_twoTrackVertices;
}
......@@ -143,12 +142,12 @@ namespace Trk
}
void TwoTrackVerticesInJet::deleteAll(std::vector<const VxCandidate*> & twoTrackVertices)
void TwoTrackVerticesInJet::deleteAll(std::vector<const xAOD::Vertex*> & twoTrackVertices)
{
std::vector<const VxCandidate*>::iterator vxBegin=twoTrackVertices.begin();
std::vector<const VxCandidate*>::iterator vxEnd=twoTrackVertices.end();
for (std::vector<const VxCandidate*>::iterator vxIter=vxBegin;
std::vector<const xAOD::Vertex*>::iterator vxBegin=twoTrackVertices.begin();
std::vector<const xAOD::Vertex*>::iterator vxEnd=twoTrackVertices.end();
for (std::vector<const xAOD::Vertex*>::iterator vxIter=vxBegin;
vxIter!=vxEnd;++vxIter)
{
if (*vxIter!=0)
......@@ -161,10 +160,10 @@ namespace Trk
void TwoTrackVerticesInJet::deleteAll(std::vector<const TrackParticleBase*> & neutralTrackOfVertex)
{
std::vector<const TrackParticleBase*>::iterator mapBegin=neutralTrackOfVertex.begin();
std::vector<const TrackParticleBase*>::iterator mapEnd=neutralTrackOfVertex.end();
for (std::vector<const TrackParticleBase*>::iterator mapIter=mapBegin;
mapIter!=mapEnd;
mapIter++)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment