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:
35 virtual StatusCode initialize() override;
36 virtual StatusCode execute () override;
38
39 private:
41 mutable std::mutex m_writeMutex;
43 Gaudi::Property<std::string> m_outStream{this, "OutStream", "ACTSMATERIALWRITER", "The output file name"};
45 Gaudi::Property<std::string> m_treeName{this, "TreeName", "materialTracks", "The output tree name"};
47 Gaudi::Property<bool> m_storeSurface{this, "StoreSurface", false, "Write the surface to which the material step correpond"};
49 Gaudi::Property<bool> m_storeVolume{this, "StoreVolume", false, "Write the volume to which the material step correpond"};
51 Gaudi::Property<bool> m_prePostStep{this, "PrePostStep", false, "Write out pre and post step (for G4), otherwise central step position"};
53 Gaudi::Property<bool> m_recalculateTotals{this, "RecalculateTotals", false, "Re-calculate total values from individual steps (for cross-checks)"};
54
56 SG::ReadHandleKey<RecordedMaterialTrackCollection> m_materialTrackCollectionKey {this, "MaterialTrackCollectionKey", "OutputMaterialTracks", "Name of the RecordedMaterialTrackCollection"};
57
58 Gaudi::Property<bool> m_useTrackingGeo{this, "useTrackingGeometry", false,
59 "Use the tracking geometry to retrieve the geometry context"};
60
61 PublicToolHandle<ActsTrk::ITrackingGeometryTool> m_trackingGeometryTool{this, "TrackingGeometryTool",
62 "", "The ACTS geometry service for the geometry context"};
63 using Config_t = ActsPlugins::RootMaterialTrackIo::Config;
65 ActsPlugins::RootMaterialTrackIo m_accessor{Config_t{}};
67
68 TTree* m_outputTree{};
69
70 };
71}
72
73#endif
Property holding a SG store/key/clid from which a ReadHandle is made.
Writes out RecordedMaterialTrackCollection to a root file.
Gaudi::Property< std::string > m_outStream
The output file name.
virtual StatusCode initialize() override
PublicToolHandle< ActsTrk::ITrackingGeometryTool > m_trackingGeometryTool
The tracking geometry service to retrive the geometry context.
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)
Gaudi::Property< bool > m_useTrackingGeo
SG::ReadHandleKey< RecordedMaterialTrackCollection > m_materialTrackCollectionKey
The RecordedMaterialTrackCollection to read.
virtual StatusCode execute() override
ActsPlugins::RootMaterialTrackIo::Config Config_t
Gaudi::Property< bool > m_storeVolume
Write the volume to which the material step correpond.
ActsPlugins::RootMaterialTrackIo m_accessor
The read - write payload.
Gaudi::Property< bool > m_storeSurface
Write the surface to which the material step correpond.
TTree * m_outputTree
The output file and tree.
std::mutex m_writeMutex
mutex used to protect multi-threaded writes
AthHistogramAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Property< bool > m_prePostStep
Write out pre and post step (for G4), otherwise central step position.
AthHistogramAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
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...