ATLAS Offline Software
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 
22 template <typename T>
24 
25 
26 namespace Acts {
27 
28 template <class>
30 
31 }
32 
33 
34 class ActsExCellWriterSvc : public extends<AthService, IActsExCellWriterSvc> {
35 public:
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 
45 private:
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;
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
ActsExCellWriterSvc::m_writeThread
std::thread m_writeThread
Definition: ActsExCellWriterSvc.h:53
ActsExCellWriterSvc::m_writePassive
Gaudi::Property< bool > m_writePassive
Definition: ActsExCellWriterSvc.h:64
ActsExCellWriterSvc::initialize
virtual StatusCode initialize() override
Definition: ActsExCellWriterSvc.cxx:20
ActsExCellWriterSvc::queue_item_t
std::pair< size_t, ExCellCharged > queue_item_t
Definition: ActsExCellWriterSvc.h:48
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
ActsExCellWriterSvc::m_writeSensitive
Gaudi::Property< bool > m_writeSensitive
Definition: ActsExCellWriterSvc.h:63
ActsExCellWriterSvc::m_writeMaterial
Gaudi::Property< bool > m_writeMaterial
Definition: ActsExCellWriterSvc.h:62
ActsExCellWriterSvc::store
void store(std::vector< Acts::ExtrapolationCell< Acts::TrackParameters >> &ecells) override
Definition: ActsExCellWriterSvc.cxx:52
ActsExCellWriterSvc::finalize
virtual StatusCode finalize() override
Definition: ActsExCellWriterSvc.cxx:41
Acts::ExtrapolationCell
Definition: ActsExCellWriterSvc.h:29
ActsExCellWriterSvc::doWrite
void doWrite()
Definition: ActsExCellWriterSvc.cxx:65
Acts
Definition: MultiTrajectory.h:45
ActsExCellWriterSvc::m_doEnd
std::atomic< bool > m_doEnd
Definition: ActsExCellWriterSvc.h:54
IActsExCellWriterSvc.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ActsExCellWriterSvc::m_queue
std::deque< queue_item_t > m_queue
Definition: ActsExCellWriterSvc.h:51
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ActsExCellWriterSvc::m_rootEccWriter
std::shared_ptr< RootExCellWriter< Acts::TrackParameters > > m_rootEccWriter
Definition: ActsExCellWriterSvc.h:50
AthService.h
ActsExCellWriterSvc::m_filePath
Gaudi::Property< std::string > m_filePath
Definition: ActsExCellWriterSvc.h:59
ActsExCellWriterSvc::ActsExCellWriterSvc
ActsExCellWriterSvc(const std::string &name, ISvcLocator *svc)
Definition: ActsExCellWriterSvc.cxx:15
ActsExCellWriterSvc::m_writeBoundary
Gaudi::Property< bool > m_writeBoundary
Definition: ActsExCellWriterSvc.h:61
ActsExCellWriterSvc
Definition: ActsExCellWriterSvc.h:34
RootExCellWriter
Definition: ActsExCellWriterSvc.h:23
ActsExCellWriterSvc::m_chargedMutex
std::mutex m_chargedMutex
Definition: ActsExCellWriterSvc.h:52
ActsExCellWriterSvc::m_treeName
Gaudi::Property< std::string > m_treeName
Definition: ActsExCellWriterSvc.h:60