ATLAS Offline Software
VxSecVKalVertexInfo.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /****************************************
6 
7  VxSecVertexInfo.h - Description
8  -------------------
9 
10  begin: March 2007
11  authors: CSC vertexing note group members :-)
12  work started by: Giacinto Piacquadio (University of Freiburg)
13  e-mail: giacinto.piacquadio@physik.uni-freiburg.de
14  changes: new!
15 
16  April 2014: Trk::VxCandidate is replaced by xAOD::Vertex
17  xAOD::IParticle is added to interface
18 
19 ********************************************/
20 
22 
23 namespace Trk {
24 
26  VxSecVertexInfo(),
27  m_mass(0.),
28  m_energyFraction(0.),
29  m_energyTrkInJet(0.),
30  m_dstToMatLayer(1000.),
31  m_n2trackvertices(0),
32  m_nBigImpTracks(0),
33  m_pseudoVertex(nullptr){}
34 
35  VxSecVKalVertexInfo::VxSecVKalVertexInfo(const std::vector<xAOD::Vertex*> & vertices,
36  double mass,double energyFraction,int n2trackvertices,double energyTrkInJet,
37  const std::vector<const Trk::TrackParticleBase*> & badTracks):
38  VxSecVertexInfo(vertices),
39  m_mass(mass),
40  m_energyFraction(energyFraction),
41  m_energyTrkInJet(energyTrkInJet),
42  m_dstToMatLayer(1000.),
43  m_n2trackvertices(n2trackvertices),
44  m_nBigImpTracks(0),
45  m_pseudoVertex(nullptr)
46  {
47  std::vector<const Trk::TrackParticleBase*>::const_iterator badTracksBegin=badTracks.begin();
48  std::vector<const Trk::TrackParticleBase*>::const_iterator badTracksEnd=badTracks.end();
49 
50  for (std::vector<const Trk::TrackParticleBase*>::const_iterator badTracksIter=badTracksBegin;
51  badTracksIter!=badTracksEnd;++badTracksIter) {
53  link.setElement(*badTracksIter);
54  m_badTracksTP.push_back(link);
55  }
56  }
57 
58 
59  VxSecVKalVertexInfo::VxSecVKalVertexInfo(const std::vector<xAOD::Vertex*> & vertices,
60  double mass,double energyFraction,int n2trackvertices,double energyTrkInJet,
61  const std::vector<const xAOD::IParticle*> & badTracks):
62  VxSecVertexInfo(vertices),
63  m_mass(mass),
64  m_energyFraction(energyFraction),
65  m_energyTrkInJet(energyTrkInJet),
66  m_dstToMatLayer(1000.),
67  m_n2trackvertices(n2trackvertices),
68  m_nBigImpTracks(0),
69  m_pseudoVertex(nullptr)
70  {
71  std::vector<const xAOD::IParticle*>::const_iterator badTracksBegin=badTracks.begin();
72  std::vector<const xAOD::IParticle*>::const_iterator badTracksEnd=badTracks.end();
73 
74  for (std::vector<const xAOD::IParticle*>::const_iterator badTracksIter=badTracksBegin;
75  badTracksIter!=badTracksEnd;++badTracksIter) {
77  link.setElement(*badTracksIter);
78  m_badTracksIP.push_back(link);
79  }
80 
81  }
82 
84  double mass,double energyFraction,int nBigImpTrk,
85  const std::vector<const xAOD::IParticle*> & badTracks):
86  VxSecVertexInfo(),
87  m_mass(mass),
88  m_energyFraction(energyFraction),
89  m_energyTrkInJet(0.),
90  m_dstToMatLayer(1000.),
91  m_n2trackvertices(0),
92  m_nBigImpTracks(nBigImpTrk),
93  m_pseudoVertex(vertex)
94  {
95  std::vector<const xAOD::IParticle*>::const_iterator badTracksBegin=badTracks.begin();
96  std::vector<const xAOD::IParticle*>::const_iterator badTracksEnd=badTracks.end();
97 
98  for (std::vector<const xAOD::IParticle*>::const_iterator badTracksIter=badTracksBegin;
99  badTracksIter!=badTracksEnd;++badTracksIter) {
101  link.setElement(*badTracksIter);
102  m_badTracksIP.push_back(link);
103  }
104 
105  }
106 
107  VxSecVKalVertexInfo::VxSecVKalVertexInfo(const VxSecVKalVertexInfo & rhs) = default;
108 
109  VxSecVKalVertexInfo & VxSecVKalVertexInfo::operator= (const VxSecVKalVertexInfo & rhs) {
110 
111  if (this!=&rhs) {
112  this->operator=(rhs);
113  m_mass=rhs.m_mass;
114  m_energyFraction=rhs.m_energyFraction;
115  m_energyTrkInJet=rhs.m_energyTrkInJet;
116  m_dstToMatLayer=rhs.m_dstToMatLayer,
117  m_n2trackvertices=rhs.m_n2trackvertices;
118  m_nBigImpTracks=rhs.m_nBigImpTracks;
119  m_badTracksTP=rhs.m_badTracksTP;
120  m_badTracksIP=rhs.m_badTracksIP;
121  m_pseudoVertex=rhs.m_pseudoVertex;
122  }
123  return *this;
124  }
125 
127 }}
128 
129  std::vector<const Trk::TrackParticleBase*> VxSecVKalVertexInfo::badTracksTP() const {
130 
131  std::vector<const Trk::TrackParticleBase*> vectorOfTP;
132 
133  std::vector<ElementLink<Trk::TrackParticleBaseCollection> >::const_iterator badTracksBegin=m_badTracksTP.begin();
134  std::vector<ElementLink<Trk::TrackParticleBaseCollection> >::const_iterator badTracksEnd=m_badTracksTP.end();
135 
136  for (std::vector<ElementLink<Trk::TrackParticleBaseCollection> >::const_iterator badTracksIter=badTracksBegin;
137  badTracksIter!=badTracksEnd;++badTracksIter) {
138  if ((*badTracksIter).isValid()) {
139  if (**badTracksIter!=nullptr) {
140  vectorOfTP.push_back(**badTracksIter);
141  }
142  }
143  }
144 
145  return vectorOfTP;
146  }
147 
148  std::vector<const xAOD::IParticle*> VxSecVKalVertexInfo::badTracksIP() const {
149 
150  std::vector<const xAOD::IParticle*> vectorOfIP;
151 
152  std::vector<ElementLink<xAOD::IParticleContainer> >::const_iterator badTracksBegin=m_badTracksIP.begin();
153  std::vector<ElementLink<xAOD::IParticleContainer> >::const_iterator badTracksEnd=m_badTracksIP.end();
154 
155  for (std::vector<ElementLink<xAOD::IParticleContainer> >::const_iterator badTracksIter=badTracksBegin;
156  badTracksIter!=badTracksEnd;++badTracksIter) {
157  if ((*badTracksIter).isValid()) {
158  if (**badTracksIter!=nullptr) {
159  vectorOfIP.push_back(**badTracksIter);
160  }
161  }
162  }
163 
164  return vectorOfIP;
165  }
166 
168 
169 
170  std::vector<ElementLink<Trk::TrackParticleBaseCollection> >::iterator badTracksBegin=m_badTracksTP.begin();
171  std::vector<ElementLink<Trk::TrackParticleBaseCollection> >::iterator badTracksEnd=m_badTracksTP.end();
172 
173  for (std::vector<ElementLink<Trk::TrackParticleBaseCollection> >::iterator badTracksIter=badTracksBegin;
174  badTracksIter!=badTracksEnd;++badTracksIter) {
175  (*badTracksIter).setStorableObject(*trkpartTES);
176  }
177  }
178 
180 
181 
182  std::vector<ElementLink<xAOD::IParticleContainer> >::iterator badTracksBegin=m_badTracksIP.begin();
183  std::vector<ElementLink<xAOD::IParticleContainer> >::iterator badTracksEnd=m_badTracksIP.end();
184 
185  for (std::vector<ElementLink<xAOD::IParticleContainer> >::iterator badTracksIter=badTracksBegin;
186  badTracksIter!=badTracksEnd;++badTracksIter) {
187  (*badTracksIter).setStorableObject(*ipartTES);
188  }
189 
190  }
191 
192 
193 }//end namespace
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
Trk::VxSecVKalVertexInfo::~VxSecVKalVertexInfo
virtual ~VxSecVKalVertexInfo()
Definition: VxSecVKalVertexInfo.cxx:140
Trk::VxSecVKalVertexInfo::m_badTracksTP
std::vector< ElementLink< Trk::TrackParticleBaseCollection > > m_badTracksTP
Definition: VxSecVKalVertexInfo.h:174
Trk::VxSecVKalVertexInfo::m_energyFraction
double m_energyFraction
Definition: VxSecVKalVertexInfo.h:169
Base_Fragment.mass
mass
Definition: Sherpa_i/share/common/Base_Fragment.py:59
Trk::VxSecVKalVertexInfo::VxSecVKalVertexInfo
VxSecVKalVertexInfo()
Definition: VxSecVKalVertexInfo.cxx:39
Trk::VxSecVertexInfo::m_SVOwnership
bool m_SVOwnership
Definition: VxSecVertexInfo.h:126
Trk::VxSecVKalVertexInfo::badTracksTP
std::vector< const Trk::TrackParticleBase * > badTracksTP() const
Definition: VxSecVKalVertexInfo.cxx:143
Trk::VxSecVKalVertexInfo::setTrackParticleOrigin
void setTrackParticleOrigin(const Trk::TrackParticleBaseCollection *trkpartTES)
Definition: VxSecVKalVertexInfo.cxx:181
Trk::VxSecVKalVertexInfo::m_energyTrkInJet
double m_energyTrkInJet
Definition: VxSecVKalVertexInfo.h:170
Trk::VxSecVKalVertexInfo::m_dstToMatLayer
double m_dstToMatLayer
Definition: VxSecVKalVertexInfo.h:171
Trk::VxSecVKalVertexInfo::m_n2trackvertices
int m_n2trackvertices
Definition: VxSecVKalVertexInfo.h:172
Trk::VxSecVKalVertexInfo::m_badTracksIP
std::vector< ElementLink< xAOD::IParticleContainer > > m_badTracksIP
Definition: VxSecVKalVertexInfo.h:175
Trk::VxSecVKalVertexInfo::m_mass
double m_mass
Definition: VxSecVKalVertexInfo.h:168
Trk::VxSecVKalVertexInfo::operator=
VxSecVKalVertexInfo & operator=(const VxSecVKalVertexInfo &)
Definition: VxSecVKalVertexInfo.cxx:123
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
Trk::VxSecVKalVertexInfo::badTracksIP
std::vector< const xAOD::IParticle * > badTracksIP() const
Definition: VxSecVKalVertexInfo.cxx:162
Trk::VxSecVKalVertexInfo::m_nBigImpTracks
int m_nBigImpTracks
Definition: VxSecVKalVertexInfo.h:173
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::VxSecVKalVertexInfo::m_pseudoVertex
const xAOD::Vertex * m_pseudoVertex
Definition: VxSecVKalVertexInfo.h:177
Trk::VxSecVKalVertexInfo::setIParticleOrigin
void setIParticleOrigin(const xAOD::IParticleContainer *iparticleTES)
Definition: VxSecVKalVertexInfo.cxx:193
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
VxSecVKalVertexInfo.h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42