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
DSTTrackInfoReader.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file DSTTrackInfoReader.cc
1
6
#include "
DSTTrackInfoReader.h
"
7
#include <
fun4all/Fun4AllReturnCodes.h
>
8
#include <
g4main/PHG4Hit.h
>
9
#include <
g4main/PHG4HitContainer.h
>
10
#include <
g4main/PHG4Particle.h
>
11
#include <
g4main/PHG4TruthInfoContainer.h
>
12
#include <
intt/InttClusterizer.h
>
13
#include <
micromegas/MicromegasDefs.h
>
14
#include <
phool/PHCompositeNode.h
>
15
#include <
phool/PHNodeIterator.h
>
16
#include <
phool/getClass.h
>
17
#include <
trackbase/InttDefs.h
>
18
#include <
trackbase/MvtxDefs.h
>
19
#include <
trackbase/TpcDefs.h
>
20
#include <
trackbase/TrkrDefs.h
>
21
#include <
trackbase/TrkrClusterContainer.h
>
22
#include <
trackbase/TrkrClusterContainerv4.h
>
23
#include <
trackbase/TrkrClusterHitAssoc.h
>
24
#include <
trackbase/TrkrClusterv4.h
>
25
#include <
trackbase/TrkrHit.h
>
26
#include <
trackbase/TrkrHitSet.h
>
27
#include <
trackbase/TrkrHitSetContainer.h
>
28
#include <
trackbase/TrkrHitTruthAssoc.h
>
29
#include <
trackbase_historic/SvtxTrack.h
>
30
#include <
trackbase_historic/SvtxTrackMap.h
>
31
#include <
trackbase_historic/SvtxTrackMap_v2.h
>
32
#include <
trackbase_historic/SvtxTrackState_v1.h
>
33
#include <
trackbase_historic/SvtxTrack_v4.h
>
34
#include <
trackbase_historic/TrackSeedContainer_v1.h
>
35
36
37
#include <algorithm>
38
#include <bitset>
39
#include <cassert>
40
#include <iostream>
41
#include <numeric>
42
43
//_____________________________________________________________________
44
45
//_____________________________________________________________________
46
DSTTrackInfoReader::DSTTrackInfoReader
(
const
std::string
&
name
)
47
:
SubsysReco
(name)
48
{
49
}
50
51
//_____________________________________________________________________
52
int
DSTTrackInfoReader::InitRun
(
PHCompositeNode
* topNode)
53
{
54
// make a clusterContainer node and a trackmap node
55
// assume writing macro removed them
56
// evalNode->addNode(newNode);
57
58
// auto newNode = new PHIODataNode<PHObject>( new DSTContainerv3, "DSTContainer","PHObject");
59
// evalNode->addNode(newNode);
60
61
// TrackInfo container
62
m_track_info_container
= findNode::getClass<TrackInfoContainer_v1>(topNode,
"TrackInfoContainer"
);
63
64
// m_container = findNode::getClass<DSTContainer>(topNode, "DSTContainer");
65
66
// svtxtrackmap constructer is protected
67
// auto svtxNode = dynamic_cast<PHCompositeNode*>(iter.findFirst("PHCompositeNode", "SVTX"));
68
// auto newNode = new PHIODataNode<PHObject>( new SvtxTrackMap, "SvtxTrackMap_2","PHObject");
69
// svtxNode->addNode(newNode);
70
71
return
Fun4AllReturnCodes::EVENT_OK
;
72
}
73
74
//_____________________________________________________________________
75
int
DSTTrackInfoReader::process_event
(
PHCompositeNode
* topNode)
76
{
77
// Init(topNode);
78
// load nodes
79
auto
res =
load_nodes
(topNode);
80
// std::cout <<"This is before I fill cluster map" << std::endl;
81
// m_cluster_map->identify();
82
if
(res !=
Fun4AllReturnCodes::EVENT_OK
)
83
{
84
return
res;
85
}
86
evaluate_track_info
();
87
88
m_track_info_container
->
Reset
();
89
90
return
Fun4AllReturnCodes::EVENT_OK
;
91
}
92
93
//_____________________________________________________________________
94
int
DSTTrackInfoReader::load_nodes
(
PHCompositeNode
* topNode)
95
{
96
// get necessary nodes
97
// m_track_map = findNode::getClass<SvtxTrackMap>(topNode, "SvtxTrackMap");
98
99
m_track_info_container
= findNode::getClass<TrackInfoContainer_v1>(topNode,
"TrackInfoContainer"
);
100
101
return
Fun4AllReturnCodes::EVENT_OK
;
102
}
103
104
void
DSTTrackInfoReader::evaluate_track_info
()
105
{
106
if
(
Verbosity
() > 1)
107
{
108
for
(
int
iTrk = 0; iTrk < (int)
m_track_info_container
->
size
(); iTrk++)
109
{
110
std::cout <<
"size: "
<<
m_track_info_container
->
size
() << std::endl;
111
std::cout <<
"hitbitmap: "
<< (
m_track_info_container
->
get_trackinfo
(iTrk))->get_hitbitmap() << std::endl;
112
std::cout <<
"crossing: "
<< (
m_track_info_container
->
get_trackinfo
(iTrk))->get_crossing() << std::endl;
113
std::cout <<
"chi^2: "
<< (
m_track_info_container
->
get_trackinfo
(iTrk))->get_chisq() << std::endl;
114
std::cout <<
"NDF: "
<< unsigned((
m_track_info_container
->
get_trackinfo
(iTrk))->get_ndf()) << std::endl;
115
}
116
}
117
}
coresoftware
blob
master
simulation
g4simulation
g4eval
DSTTrackInfoReader.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:13
using
1.8.2 with
sPHENIX GitHub integration