ATLAS Offline Software
Loading...
Searching...
No Matches
MaterialTrackWriter.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ACTSMATERIAL_MATERIALTRACKWRITER_H
6#define ACTSMATERIAL_MATERIALTRACKWRITER_H
7
9#include "GaudiKernel/ServiceHandle.h"
11
14
15#include <ActsPlugins/Root/RootMaterialTrackIo.hpp>
16
17#include "TTree.h"
18#include "TFile.h"
19
20#include <mutex>
21
22
23namespace ActsTrk {
24
31
33 public:
34 MaterialTrackWriter(const std::string &name, ISvcLocator *pSvcLocator);
35 virtual StatusCode initialize() override;
36 virtual StatusCode execute (const EventContext& ctx) const override;
37 virtual StatusCode finalize() override;
38 virtual ~MaterialTrackWriter();
39
40 private:
42 mutable std::mutex m_writeMutex;
44 Gaudi::Property<std::string> m_fileName{this, "FileName", "MaterialTracks.root", "The output file name"};
46 Gaudi::Property<std::string> m_treeName{this, "TreeName", "material-tracks", "The output tree name"};
48 Gaudi::Property<bool> m_storeSurface{this, "StoreSurface", false, "Write the surface to which the material step correpond"};
50 Gaudi::Property<bool> m_storeVolume{this, "StoreVolume", false, "Write the volume to which the material step correpond"};
52 Gaudi::Property<bool> m_prePostStep{this, "PrePostStep", false, "Write out pre and post step (for G4), otherwise central step position"};
54 Gaudi::Property<bool> m_recalculateTotals{this, "RecalculateTotals", false, "Re-calculate total values from individual steps (for cross-checks)"};
55
57 SG::ReadHandleKey<RecordedMaterialTrackCollection> m_materialTrackCollectionKey {this, "MaterialTrackCollectionKey", "OutputMaterialTracks", "Name of the RecordedMaterialTrackCollection"};
58
60 ServiceHandle<ActsTrk::ITrackingGeometrySvc> m_trackingGeometrySvc{this, "TrackingGeometrySvc","ActsTrackingGeometrySvc", "The ACTS geometry service for the geometry context"};
62 mutable ActsPlugins::RootMaterialTrackIo m_accessor ATLAS_THREAD_SAFE;
64 TFile* m_outputFile{};
65 mutable TTree* m_outputTree ATLAS_THREAD_SAFE = {};
66
67 };
68}
69
70#endif
Property holding a SG store/key/clid from which a ReadHandle is made.
virtual StatusCode initialize() override
Gaudi::Property< std::string > m_treeName
The output file name.
Gaudi::Property< bool > m_recalculateTotals
Re-calculate total values from individual steps (for cross-checks)
TFile * m_outputFile
The output file and tree.
SG::ReadHandleKey< RecordedMaterialTrackCollection > m_materialTrackCollectionKey
The RecordedMaterialTrackCollection to read.
Gaudi::Property< bool > m_storeVolume
Write the volume to which the material step correpond.
virtual StatusCode finalize() override
Gaudi::Property< bool > m_storeSurface
Write the surface to which the material step correpond.
std::mutex m_writeMutex
mutex used to protect multi-threaded writes
ActsPlugins::RootMaterialTrackIo m_accessor ATLAS_THREAD_SAFE
The read - write payload.
ServiceHandle< ActsTrk::ITrackingGeometrySvc > m_trackingGeometrySvc
The tracking geometry service to retrive the geometry context.
MaterialTrackWriter(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode execute(const EventContext &ctx) const override
Gaudi::Property< std::string > m_fileName
The output file name.
Gaudi::Property< bool > m_prePostStep
Write out pre and post step (for G4), otherwise central step position.
An algorithm that can be simultaneously executed in multiple threads.
Property holding a SG store/key/clid from which a ReadHandle is made.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...