ATLAS Offline Software
Loading...
Searching...
No Matches
ActsExCellWriterSvc.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ACTSGEOMETRY_ACTSEXCELLWRITERSVC_H
6#define ACTSGEOMETRY_ACTSEXCELLWRITERSVC_H
7
9#include "GaudiKernel/IInterface.h"
10#include "Gaudi/Property.h" /*no forward decl: typedef*/
11
13
14#include "Acts/EventData/TrackParameters.hpp"
15
16#include <vector>
17#include <deque>
18#include <mutex>
19#include <thread>
20#include <atomic>
21
22template <typename T>
24
25
26namespace Acts {
27
28template <class>
30
31}
32
33
34class ActsExCellWriterSvc : public extends<AthService, IActsExCellWriterSvc> {
35public:
36
37 virtual StatusCode initialize() override;
38 virtual StatusCode finalize() override;
39
40 ActsExCellWriterSvc( const std::string& name, ISvcLocator* svc );
41
42 void
43 store(std::vector<Acts::ExtrapolationCell<Acts::TrackParameters>>& ecells) override;
44
45private:
47
48 using queue_item_t = std::pair<size_t, ExCellCharged>;
49
50 std::shared_ptr<RootExCellWriter<Acts::TrackParameters>> m_rootEccWriter;
51 std::deque<queue_item_t> m_queue;
52 std::mutex m_chargedMutex;
53 std::thread m_writeThread;
54 std::atomic<bool> m_doEnd;
55
56 void doWrite();
57
58 // jobOptions properties
59 Gaudi::Property<std::string> m_filePath{this, "FilePath", "excells_charged.root", "Output root file for charged particle"};
60 Gaudi::Property<std::string> m_treeName{this, "TreeName", "extrapolation_charged", ""};
61 Gaudi::Property<bool> m_writeBoundary{this, "WriteBoundary", true, ""};
62 Gaudi::Property<bool> m_writeMaterial{this, "WriteMaterial", true, ""};
63 Gaudi::Property<bool> m_writeSensitive{this, "WriteSensitive", true, ""};
64 Gaudi::Property<bool> m_writePassive{this, "WritePassive", true, ""};
65
66
67};
68
69
70#endif
std::deque< queue_item_t > m_queue
void store(std::vector< Acts::ExtrapolationCell< Acts::TrackParameters > > &ecells) override
virtual StatusCode initialize() override
Gaudi::Property< bool > m_writeMaterial
Gaudi::Property< bool > m_writeBoundary
Acts::ExtrapolationCell< Acts::TrackParameters > ExCellCharged
std::shared_ptr< RootExCellWriter< Acts::TrackParameters > > m_rootEccWriter
std::atomic< bool > m_doEnd
Gaudi::Property< std::string > m_treeName
Gaudi::Property< bool > m_writeSensitive
ActsExCellWriterSvc(const std::string &name, ISvcLocator *svc)
Gaudi::Property< bool > m_writePassive
Gaudi::Property< std::string > m_filePath
virtual StatusCode finalize() override
std::pair< size_t, ExCellCharged > queue_item_t