Skip to content

Commit b3f973a

Browse files
Merge pull request #77 from clementhelsens/master
move to acts v5.0.0
2 parents ec78602 + 9c2ced1 commit b3f973a

File tree

2 files changed

+26
-16
lines changed

2 files changed

+26
-16
lines changed

analyzers/dataframe/VertexFinderActs.cc

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
#include "Acts/Vertexing/ImpactPointEstimator.hpp"
99
#include "Acts/Vertexing/HelicalTrackLinearizer.hpp"
1010
//V5.0
11-
//#include "Acts/Definitions/Algebra.hpp"
12-
//#include "Acts/Definitions/Units.hpp"
11+
#include "Acts/Definitions/Algebra.hpp"
12+
#include "Acts/Definitions/Units.hpp"
1313

1414
#include "Acts/Geometry/GeometryContext.hpp"
1515
#include "Acts/Surfaces/PerigeeSurface.hpp"
@@ -40,7 +40,7 @@ VertexingUtils::FCCAnalysesVertex VertexFinderActs::VertexFinderAMVF(ROOT::VecOp
4040
const auto& magFieldContext = Acts::MagneticFieldContext();
4141

4242
// Set up EigenStepper
43-
Acts::ConstantBField bField(Acts::Vector3D(0., 0., 2_T));
43+
Acts::ConstantBField bField(Acts::Vector3(0., 0., 2_T));
4444
Acts::EigenStepper<Acts::ConstantBField> stepper(bField);
4545

4646
// Set up the propagator
@@ -151,7 +151,7 @@ VertexingUtils::FCCAnalysesVertex VertexFinderActs::VertexFinderAMVF(ROOT::VecOp
151151

152152
// Create track parameters and add to track list
153153
std::shared_ptr<Acts::PerigeeSurface> perigeeSurface;
154-
Acts::Vector3D beamspotPos;
154+
Acts::Vector3 beamspotPos;
155155
beamspotPos << 0.0, 0.0, 0.0;
156156
perigeeSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(beamspotPos);
157157

@@ -173,12 +173,7 @@ VertexingUtils::FCCAnalysesVertex VertexFinderActs::VertexFinderAMVF(ROOT::VecOp
173173
for (const auto& trk : allTracks) {
174174
tracksPtr.push_back(&trk);
175175
}
176-
177-
//std::cout << " --- n trk " << tracksPtr.size() << std::endl;
178-
179-
// find vertices
180-
auto result = finder.find(tracksPtr, finderOpts, state);
181-
176+
182177

183178
VertexingUtils::FCCAnalysesVertex TheVertex;
184179
edm4hep::VertexData edm4hep_vertex;
@@ -196,6 +191,18 @@ VertexingUtils::FCCAnalysesVertex VertexFinderActs::VertexFinderAMVF(ROOT::VecOp
196191
TheVertex.updated_track_momentum_at_vertex = updated_track_momentum_at_vertex;
197192

198193

194+
TheVertex.ntracks = Ntr;
195+
if ( Ntr <= 1) return TheVertex; // can not reconstruct a vertex with only one track...
196+
197+
198+
//std::cout << " --- n trk " << tracksPtr.size() << std::endl;
199+
200+
// find vertices
201+
auto result = finder.find(tracksPtr, finderOpts, state);
202+
203+
204+
205+
199206
//std::cout << "result " << result.ok() << std::endl;
200207
if (not result.ok()) {
201208
//std::cout << "Error in vertex finder: " << result.error().message() << std::endl;

analyzers/dataframe/VertexFitterActs.cc

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@
88
#include "Acts/Propagator/EigenStepper.hpp"
99
#include "Acts/Propagator/Propagator.hpp"
1010
#include "Acts/Surfaces/PerigeeSurface.hpp"
11-
#include "Acts/Utilities/Definitions.hpp"
12-
#include "Acts/Utilities/Units.hpp"
1311
#include "Acts/Vertexing/FullBilloirVertexFitter.hpp"
1412
#include "Acts/Vertexing/HelicalTrackLinearizer.hpp"
1513
#include "Acts/Vertexing/Vertex.hpp"
1614

15+
//V5.0
16+
#include "Acts/Definitions/Algebra.hpp"
17+
#include "Acts/Definitions/Units.hpp"
18+
19+
1720
#include "TMath.h"
1821

1922
using namespace VertexFitterActs;
@@ -35,7 +38,7 @@ VertexingUtils::FCCAnalysesVertex VertexFitterActs::VertexFitterFullBilloir(ROOT
3538
const auto& magFieldContext = Acts::MagneticFieldContext();
3639

3740
// Set up EigenStepper
38-
Acts::ConstantBField bField(Acts::Vector3D(0., 0., 2_T));
41+
Acts::ConstantBField bField(Acts::Vector3(0., 0., 2_T));
3942
Acts::EigenStepper<Acts::ConstantBField> stepper(bField);
4043

4144
// Set up the propagator
@@ -57,13 +60,13 @@ VertexingUtils::FCCAnalysesVertex VertexFitterActs::VertexFitterFullBilloir(ROOT
5760
// Constraint for vertex fit
5861
Acts::Vertex<Acts::BoundTrackParameters> myConstraint;
5962
// Some abitrary values
60-
Acts::SymMatrix4D myCovMat = Acts::SymMatrix4D::Zero();
63+
Acts::SymMatrix4 myCovMat = Acts::SymMatrix4::Zero();
6164
myCovMat(0, 0) = 30.;
6265
myCovMat(1, 1) = 30.;
6366
myCovMat(2, 2) = 30.;
6467
myCovMat(3, 3) = 30.;
6568
myConstraint.setFullCovariance(std::move(myCovMat));
66-
myConstraint.setFullPosition(Acts::Vector4D(0, 0, 0, 0));
69+
myConstraint.setFullPosition(Acts::Vector4(0, 0, 0, 0));
6770

6871

6972
Acts::VertexingOptions<Acts::BoundTrackParameters> vfOptions(geoContext, magFieldContext);
@@ -112,7 +115,7 @@ VertexingUtils::FCCAnalysesVertex VertexFitterActs::VertexFitterFullBilloir(ROOT
112115

113116
// Create track parameters and add to track list
114117
std::shared_ptr<Acts::PerigeeSurface> perigeeSurface;
115-
Acts::Vector3D beamspotPos;
118+
Acts::Vector3 beamspotPos;
116119
beamspotPos << 0.0, 0.0, 0.0;
117120
perigeeSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(beamspotPos);
118121

0 commit comments

Comments
 (0)