31 #include "AthLinks/ElementLink.h"
37 m_primaryVertex(nullptr),
39 m_clusteringTable(nullptr) { }
42 const std::vector<Trk::VxTrackAtVertex*>& vxTrackAtVertex):
43 VxCandidate(recVertex,vxTrackAtVertex),
44 m_primaryVertex(nullptr),
46 m_clusteringTable(nullptr) { }
52 m_primaryVertex(nullptr),
54 m_clusteringTable(nullptr) {
56 std::vector<std::pair<const Trk::TrackParticleBase*,const Trk::TrackParticleBaseCollection*> >::const_iterator
57 vTPBegin=vectorOfTrackParticles.begin();
59 std::vector<std::pair<const Trk::TrackParticleBase*,const Trk::TrackParticleBaseCollection*> >::const_iterator
60 vTPEnd=vectorOfTrackParticles.end();
62 for (std::vector<std::pair<const Trk::TrackParticleBase*,const Trk::TrackParticleBaseCollection*> >::const_iterator
63 vTPIter=vTPBegin;vTPIter!=vTPEnd;++vTPIter) {
65 if ((*vTPIter).first!=0) {
71 m_vxTrackAtVertex.push_back(newVxTrack);
72 std::vector<VxTrackAtVertex*> temp_vector_tracksAtVertex;
73 temp_vector_tracksAtVertex.push_back(newVxTrack);
77 std::cout <<
"************************************ ------------- *********************************************" << std::endl;
78 std::cout <<
"ERROR in VxJetCandidate constructor: inconsistency in VxTrackAtVertex tracks. Skipping track..." << std::endl;
79 std::cout <<
"************************************ ------------- *********************************************" << std::endl;
84 VxJetCandidate::VxJetCandidate(
const std::vector<const Trk::TrackParticleBase*> & vectorOfTrackParticles):
86 m_primaryVertex(nullptr),
88 m_clusteringTable(nullptr) {
90 std::vector<const Trk::TrackParticleBase*>::const_iterator vTPBegin=vectorOfTrackParticles.begin();
91 std::vector<const Trk::TrackParticleBase*>::const_iterator vTPEnd=vectorOfTrackParticles.end();
93 for (std::vector<const Trk::TrackParticleBase*>::const_iterator vTPIter=vTPBegin;vTPIter!=vTPEnd;++vTPIter) {
95 if (*vTPIter!=
nullptr) {
101 std::vector<VxTrackAtVertex*> temp_vector_tracksAtVertex;
102 temp_vector_tracksAtVertex.push_back(newVxTrack);
106 std::cout <<
"************************************ ------------- *********************************************" << std::endl;
107 std::cout <<
"ERROR in VxJetCandidate constructor: inconsistency in VxTrackAtVertex tracks. Skipping track..." << std::endl;
108 std::cout <<
"************************************ ------------- *********************************************" << std::endl;
117 m_primaryVertex(nullptr),
118 m_debugInfo(nullptr),
119 m_clusteringTable(nullptr) {
121 std::vector<std::pair<const Trk::Track*,const TrackCollection*> >::const_iterator
122 vTBegin=vectorOfTracks.begin();
124 std::vector<std::pair<const Trk::Track*,const TrackCollection*> >::const_iterator
125 vTEnd=vectorOfTracks.end();
127 for (std::vector<std::pair<const Trk::Track*,const TrackCollection*> >::const_iterator
128 vTIter=vTBegin;vTIter!=vTEnd;++vTIter) {
130 if ((*vTIter).first!=0) {
137 std::vector<VxTrackAtVertex*> temp_vector_tracksAtVertex;
138 temp_vector_tracksAtVertex.push_back(myPointer);
145 std::cout <<
"************************************ ------------- *********************************************" << std::endl;
146 std::cout <<
"ERROR in VxJetCandidate constructor: inconsistency in VxTrackAtVertex tracks. Skipping track..." << std::endl;
147 std::cout <<
"************************************ ------------- *********************************************" << std::endl;
156 m_primaryVertex(nullptr),
157 m_debugInfo(nullptr),
158 m_clusteringTable(nullptr) {
160 std::vector<const Trk::Track*>::const_iterator vTBegin=vectorOfTracks.begin();
161 std::vector<const Trk::Track*>::const_iterator vTEnd=vectorOfTracks.end();
163 for (std::vector<const Trk::Track*>::const_iterator
164 vTIter=vTBegin;vTIter!=vTEnd;++vTIter) {
166 if (*vTIter!=
nullptr) {
172 std::vector<VxTrackAtVertex*> temp_vector_tracksAtVertex;
173 temp_vector_tracksAtVertex.push_back(myPointer);
180 std::cout <<
"************************************ ------------- *********************************************" << std::endl;
181 std::cout <<
"ERROR in VxJetCandidate constructor: inconsistency in VxTrackAtVertex tracks. Skipping track..." << std::endl;
182 std::cout <<
"************************************ ------------- *********************************************" << std::endl;
195 tracksIter!=tracksEnd;++tracksIter) {
197 ITrackLink* IlinkTT=(*tracksIter)->trackOrParticleLink();
198 LinkToTrack* linkTT=
dynamic_cast<LinkToTrack*
>(IlinkTT);
200 linkTT->setStorableObject(*trackTES);
202 (*tracksIter)->setOrigTrack(linkTT);
214 tracksIter!=tracksEnd;++tracksIter) {
216 ITrackLink* IlinkTT=(*tracksIter)->trackOrParticleLink();
217 LinkToTrackParticleBase* linkTT=
dynamic_cast<LinkToTrackParticleBase*
>(IlinkTT);
219 linkTT->setStorableObject(*trackParticleTES);
221 (*tracksIter)->setOrigTrack(linkTT);
229 , m_fittedPositions(rhs.m_fittedPositions)
230 , m_linearizationPositions(rhs.m_linearizationPositions)
231 , m_constraintPositions(rhs.m_constraintPositions)
238 std::map<Trk::VxTrackAtVertex*,Trk::VxTrackAtVertex*> oldToNewPointer;
240 std::vector<Trk::VxTrackAtVertex*>::const_iterator RhsVxTracksEnd=rhs.m_vxTrackAtVertex.end();
241 for (std::vector<Trk::VxTrackAtVertex*>::const_iterator itr = rhs.m_vxTrackAtVertex.begin();
242 itr != RhsVxTracksEnd; ++itr) {
244 std::cout <<
" Pointer of one of the tracks of the object to copy is zero. PROBLEM! Skipping track " << std::endl;
248 oldToNewPointer[*itr]=newVxTrackPointer;
254 if (rhs.m_primaryVertex!=
nullptr) {
255 const std::vector<VxTrackAtVertex*> & primaryVectorTracks=rhs.m_primaryVertex->
getTracksAtVertex();
257 const std::vector<VxTrackAtVertex*>::const_iterator primaryVectorTracksBegin=primaryVectorTracks.begin();
258 const std::vector<VxTrackAtVertex*>::const_iterator primaryVectorTracksEnd=primaryVectorTracks.end();
260 std::vector<VxTrackAtVertex*> primaryVectorNew;
262 for (std::vector<VxTrackAtVertex*>::const_iterator primaryVectorIter=primaryVectorTracksBegin;
263 primaryVectorIter!=primaryVectorTracksEnd;++primaryVectorIter) {
265 if (newTrackPointer!=
nullptr) {
266 primaryVectorNew.push_back(newTrackPointer);
268 std::cout <<
"************************************ ---------------------------- ********************************" << std::endl;
269 std::cout <<
"Not able to copy old pointer to new one when inizializing tracks of primary vertex to new pointers" << std::endl;
270 std::cout <<
"************************************ ---------------------------- ********************************" << std::endl;
277 std::cout <<
"VxJetCandidate EDM class: Warning in COPY: no primary vertex present" << std::endl;
281 std::vector<VxVertexOnJetAxis*>::const_iterator VtxBegin=rhs.m_verticesOnJetAxis.begin();
282 std::vector<VxVertexOnJetAxis*>::const_iterator VtxEnd=rhs.m_verticesOnJetAxis.end();
284 for (std::vector<VxVertexOnJetAxis*>::const_iterator VtxIter=VtxBegin;VtxIter!=VtxEnd;
287 if (*VtxIter!=
nullptr) {
289 VxVertexOnJetAxis* newVertexOnJetAxis=
new VxVertexOnJetAxis(**VtxIter);
293 std::vector<VxTrackAtVertex*> vertexVectorNew;
295 const std::vector<VxTrackAtVertex*> & TracksAtVertex=(*VtxIter)->getTracksAtVertex();
297 const std::vector<VxTrackAtVertex*>::const_iterator TracksBegin=TracksAtVertex.begin();
298 const std::vector<VxTrackAtVertex*>::const_iterator TracksEnd=TracksAtVertex.end();
300 for (std::vector<VxTrackAtVertex*>::const_iterator TrackVectorIter=TracksBegin;
301 TrackVectorIter!=TracksEnd;++TrackVectorIter) {
302 VxTrackAtVertex* newTrackPointer=oldToNewPointer[*TrackVectorIter];
303 if (newTrackPointer!=
nullptr) {
304 vertexVectorNew.push_back(newTrackPointer);
306 std::cout <<
"************************************ ---------------------------- **********************(((((***********" << std::endl;
307 std::cout <<
"Not able to copy old pointer to new one when inizializing tracks of vertices on jet axis to new pointers" << std::endl;
308 std::cout <<
"************************************ ---------------------------- **************************************" << std::endl;
311 newVertexOnJetAxis->setTracksAtVertex(std::move(vertexVectorNew));
315 std::cout <<
"************************************ ------------- *********************************************" << std::endl;
316 std::cout <<
"ERROR in copy constructor of VxJetCandidate: one of the VxVertexOnJetAxis is an empty pointer..." << std::endl;
317 std::cout <<
"************************************ ------------- *********************************************" << std::endl;
321 if (rhs.m_debugInfo!=
nullptr) {
322 m_debugInfo=
new VxJetFitterDebugInfo(*rhs.m_debugInfo);
344 i !=VxTracksEnd ; ++
i) {
357 for (std::vector<VxVertexOnJetAxis*>::const_iterator DelVtxIter=DelVtxBegin;DelVtxIter!=DelVtxEnd;
360 if (*DelVtxIter!=
nullptr) {
363 std::cout <<
"************************************ ---------------------------- ***********************************************" << std::endl;
364 std::cout <<
"ERROR in constructor of VxJetCandidate when deleting: one of the VxVertexOnJetAxis is already an empty pointer..." << std::endl;
365 std::cout <<
"************************************ ---------------------------- ***********************************************" << std::endl;
374 std::map<Trk::VxTrackAtVertex*,Trk::VxTrackAtVertex*> oldToNewPointer;
376 std::vector<Trk::VxTrackAtVertex*>::const_iterator RhsVxTracksEnd=rhs.m_vxTrackAtVertex.end();
377 for (std::vector<Trk::VxTrackAtVertex*>::const_iterator itr = rhs.m_vxTrackAtVertex.begin();
378 itr != RhsVxTracksEnd; ++itr) {
380 std::cout <<
" Pointer of one of the tracks of the object to copy is zero. PROBLEM! Skipping track " << std::endl;
384 oldToNewPointer[*itr]=newVxTrackPointer;
388 m_primaryVertex=(rhs.m_primaryVertex!=
nullptr) ?
new VxVertexOnJetAxis(*rhs.m_primaryVertex) :
nullptr;
390 if (rhs.m_primaryVertex!=
nullptr) {
391 const std::vector<VxTrackAtVertex*> & primaryVectorTracks=rhs.m_primaryVertex->getTracksAtVertex();
393 const std::vector<VxTrackAtVertex*>::const_iterator primaryVectorTracksBegin=primaryVectorTracks.begin();
394 const std::vector<VxTrackAtVertex*>::const_iterator primaryVectorTracksEnd=primaryVectorTracks.end();
396 std::vector<VxTrackAtVertex*> primaryVectorNew;
398 for (std::vector<VxTrackAtVertex*>::const_iterator primaryVectorIter=primaryVectorTracksBegin;
399 primaryVectorIter!=primaryVectorTracksEnd;++primaryVectorIter) {
400 VxTrackAtVertex* newTrackPointer=oldToNewPointer[*primaryVectorIter];
401 if (newTrackPointer!=
nullptr) {
402 primaryVectorNew.push_back(newTrackPointer);
404 std::cout <<
"************************************ ---------------------------- ********************************" << std::endl;
405 std::cout <<
"Not able to copy old pointer to new one when inizializing tracks of primary vertex to new pointers" << std::endl;
406 std::cout <<
"************************************ ---------------------------- ********************************" << std::endl;
413 std::cout <<
"VxJetCandidate EDM class: Warning in COPY: no primary vertex present" << std::endl;
417 std::vector<VxVertexOnJetAxis*>::const_iterator VtxBegin=rhs.m_verticesOnJetAxis.begin();
418 std::vector<VxVertexOnJetAxis*>::const_iterator VtxEnd=rhs.m_verticesOnJetAxis.end();
420 for (std::vector<VxVertexOnJetAxis*>::const_iterator VtxIter=VtxBegin;VtxIter!=VtxEnd;
423 if (*VtxIter!=
nullptr) {
425 VxVertexOnJetAxis* newVertexOnJetAxis=
new VxVertexOnJetAxis(**VtxIter);
429 std::vector<VxTrackAtVertex*> vertexVectorNew;
431 const std::vector<VxTrackAtVertex*> & TracksAtVertex=(*VtxIter)->getTracksAtVertex();
433 const std::vector<VxTrackAtVertex*>::const_iterator TracksBegin=TracksAtVertex.begin();
434 const std::vector<VxTrackAtVertex*>::const_iterator TracksEnd=TracksAtVertex.end();
436 for (std::vector<VxTrackAtVertex*>::const_iterator TrackVectorIter=TracksBegin;
437 TrackVectorIter!=TracksEnd;++TrackVectorIter) {
438 VxTrackAtVertex* newTrackPointer=oldToNewPointer[*TrackVectorIter];
439 if (newTrackPointer!=
nullptr) {
440 vertexVectorNew.push_back(newTrackPointer);
442 std::cout <<
"************************************ ---------------------------- **********************(((((***********" << std::endl;
443 std::cout <<
"Not able to copy old pointer to new one when inizializing tracks of vertices on jet axis to new pointers" << std::endl;
444 std::cout <<
"************************************ ---------------------------- **************************************" << std::endl;
447 newVertexOnJetAxis->setTracksAtVertex(std::move(vertexVectorNew));
451 std::cout <<
"************************************ ------------- *********************************************" << std::endl;
452 std::cout <<
"ERROR in copy constructor of VxJetCandidate: one of the VxVertexOnJetAxis is an empty pointer..." << std::endl;
453 std::cout <<
"************************************ ------------- *********************************************" << std::endl;
457 if (rhs.m_debugInfo!=
nullptr) {
458 m_debugInfo=
new VxJetFitterDebugInfo(*rhs.m_debugInfo);
486 for (std::vector<VxVertexOnJetAxis*>::const_iterator VtxIter=VtxBegin;VtxIter!=VtxEnd;
489 if (*VtxIter!=
nullptr) {
492 std::cout <<
"************************************ ------------- ***********************************************" << std::endl;
493 std::cout <<
"ERROR in destructor of VxJetCandidate: one of the VxVertexOnJetAxis is already an empty pointer..." << std::endl;
494 std::cout <<
"************************************ ------------- ***********************************************" << std::endl;