Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
RootTrackParameterWriter.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file RootTrackParameterWriter.hpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2017-2018 CERN for the benefit of the Acts project
4
//
5
// This Source Code Form is subject to the terms of the Mozilla Public
6
// License, v. 2.0. If a copy of the MPL was not distributed with this
7
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
9
#pragma once
10
11
#include "
Acts/Utilities/Logger.hpp
"
12
#include "
ActsExamples/EventData/Index.hpp
"
13
#include "
ActsExamples/EventData/ProtoTrack.hpp
"
14
#include "
ActsExamples/EventData/SimHit.hpp
"
15
#include "
ActsExamples/EventData/SimParticle.hpp
"
16
#include "
ActsExamples/EventData/Track.hpp
"
17
#include "
ActsExamples/Framework/DataHandle.hpp
"
18
#include "
ActsExamples/Framework/ProcessCode.hpp
"
19
#include "
ActsExamples/Framework/WriterT.hpp
"
20
21
#include <mutex>
22
#include <string>
23
24
class
TFile;
25
class
TTree;
26
namespace
ActsFatras {
27
class
Barcode;
28
}
// namespace ActsFatras
29
30
namespace
ActsExamples {
31
struct
AlgorithmContext;
32
33
using
TrackParameterWriter
=
WriterT<TrackParametersContainer>
;
34
40
class
RootTrackParameterWriter
final :
public
TrackParameterWriter
{
41
public
:
42
using
HitParticlesMap
=
IndexMultimap<ActsFatras::Barcode>
;
43
using
HitSimHitsMap
=
IndexMultimap<Index>
;
44
45
struct
Config
{
47
std::string
inputTrackParameters
;
49
std::string
inputProtoTracks
;
51
std::string
inputParticles
;
53
std::string
inputSimHits
;
55
std::string
inputMeasurementParticlesMap
;
57
std::string
inputMeasurementSimHitsMap
;
59
std::string
filePath
=
"estimatedparams.root"
;
61
std::string
treeName
=
"estimatedparams"
;
63
std::string
fileMode
=
"RECREATE"
;
64
};
65
70
RootTrackParameterWriter
(
const
Config
&
config
,
71
Acts::Logging::Level
level
=
Acts::Logging::INFO
);
72
74
~RootTrackParameterWriter
()
override
;
75
77
ProcessCode
finalize
()
override
;
78
80
const
Config
&
config
()
const
{
return
m_cfg
; }
81
82
protected
:
86
ProcessCode
writeT
(
const
AlgorithmContext
& ctx,
87
const
TrackParametersContainer
& trackParams)
override
;
88
89
private
:
90
Config
m_cfg
;
91
92
ReadDataHandle<ProtoTrackContainer>
m_inputProtoTracks
{
this
,
93
"InputProtoTracks"
};
94
ReadDataHandle<SimParticleContainer>
m_inputParticles
{
this
,
"InputParticles"
};
95
ReadDataHandle<SimHitContainer>
m_inputSimHits
{
this
,
"InputSimHits"
};
96
ReadDataHandle<HitParticlesMap>
m_inputMeasurementParticlesMap
{
97
this
,
"InputMeasurementParticlesMap"
};
98
ReadDataHandle<HitSimHitsMap>
m_inputMeasurementSimHitsMap
{
99
this
,
"InputMeasurementSimHitsMap"
};
100
101
std::mutex
m_writeMutex
;
102
TFile*
m_outputFile
{
nullptr
};
103
TTree*
m_outputTree
{
nullptr
};
104
int
m_eventNr
{0};
105
106
float
m_loc0
{
NaNfloat
};
107
float
m_loc1
{
NaNfloat
};
108
float
m_phi
{
NaNfloat
};
109
float
m_theta
{
NaNfloat
};
110
float
m_qop
{
NaNfloat
};
111
float
m_time
{
NaNfloat
};
112
float
m_p
{
NaNfloat
};
113
float
m_pt
{
NaNfloat
};
114
float
m_eta
{
NaNfloat
};
115
116
int
m_t_charge
{0};
117
float
m_t_loc0
{
NaNfloat
};
118
float
m_t_loc1
{
NaNfloat
};
119
float
m_t_phi
{
NaNfloat
};
120
float
m_t_theta
{
NaNfloat
};
121
float
m_t_qop
{
NaNfloat
};
122
float
m_t_time
{
NaNfloat
};
123
bool
m_truthMatched
=
false
;
124
};
125
126
}
// namespace ActsExamples
acts
blob
sPHENIX
Examples
Io
Root
include
ActsExamples
Io
Root
RootTrackParameterWriter.hpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:38
using
1.8.2 with
sPHENIX GitHub integration