Skip to content

Commit

Permalink
feat: Write event nr in VertexPerformanceWriter (acts-project#2866)
Browse files Browse the repository at this point in the history
  • Loading branch information
andiwand authored and LaraCalic committed Feb 10, 2024
1 parent fee0c72 commit 9bf298c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CI/physmon/vertexing_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,6 @@ extra_histograms:
nbins: 50
min: 0.8
max: 1.2

exclude:
- event_nr
3 changes: 3 additions & 0 deletions CI/physmon/vertexing_ttbar_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,6 @@ extra_histograms:
nbins: 100
min: 0.0
max: 1.2

exclude:
- event_nr
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ ActsExamples::VertexPerformanceWriter::VertexPerformanceWriter(
throw std::bad_alloc();
} else {
// I/O parameters.
m_outputTree->Branch("event_nr", &m_eventNr);

// Branches related to the 4D vertex position
m_outputTree->Branch("truthX", &m_truthX);
m_outputTree->Branch("truthY", &m_truthY);
Expand Down Expand Up @@ -262,6 +264,9 @@ ActsExamples::ProcessCode ActsExamples::VertexPerformanceWriter::writeT(
TrackParametersContainer trackParameters;
std::vector<SimParticle> associatedTruthParticles;

// Get the event number
m_eventNr = ctx.eventNumber;

// The i-th entry in associatedTruthParticles corresponds to the i-th entry in
// trackParameters. If we know the truth particles associated to the track
// parameters a priori:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
// This file is part of the Acts project.
//
// Copyright (C) 2019-2023 CERN for the benefit of the Acts project
// Copyright (C) 2019-2024 CERN for the benefit of the Acts project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#pragma once

#include "Acts/Definitions/TrackParametrization.hpp"
#include "Acts/EventData/TrackParameters.hpp"
#include "Acts/MagneticField/MagneticFieldProvider.hpp"
#include "Acts/Utilities/Logger.hpp"
#include "Acts/Vertexing/Vertex.hpp"
#include "ActsExamples/EventData/Index.hpp"
#include "ActsExamples/EventData/SimParticle.hpp"
#include "ActsExamples/EventData/Track.hpp"
#include "ActsExamples/EventData/Trajectories.hpp"
#include "ActsExamples/Framework/DataHandle.hpp"
#include "ActsExamples/Framework/ProcessCode.hpp"
#include "ActsExamples/Framework/WriterT.hpp"
Expand Down Expand Up @@ -108,6 +106,9 @@ class VertexPerformanceWriter final
TFile* m_outputFile{nullptr}; ///< The output file
TTree* m_outputTree{nullptr}; ///< The output tree

/// The event number
std::uint32_t m_eventNr{0};

// True 4D vertex position
std::vector<double> m_truthX;
std::vector<double> m_truthY;
Expand Down

0 comments on commit 9bf298c

Please sign in to comment.