ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
ECCE @ EIC Software
Deprecated List
Modules
Namespaces
Classes
Files
File List
acts
analysis
coresoftware
blob
master
calibrations
generators
offline
simulation
g4simulation
EICPhysicsList
g4bbc
g4calo
g4centrality
g4decayer
g4detectors
g4epd
g4eval
g4gdml
g4histos
g4intt
g4jets
g4main
EicEventHeader.cc
EicEventHeader.h
EicEventHeaderLinkDef.h
EicEventHeaderv1.cc
EicEventHeaderv1.h
EicEventHeaderv1LinkDef.h
Fun4AllDstPileupInputManager.cc
Fun4AllDstPileupInputManager.h
Fun4AllDstPileupMerger.cc
Fun4AllDstPileupMerger.h
Fun4AllMessenger.cc
Fun4AllMessenger.h
Fun4AllSingleDstPileupInputManager.cc
Fun4AllSingleDstPileupInputManager.h
G4TBFieldMessenger.cc
G4TBFieldMessenger.hh
G4TBMagneticFieldSetup.cc
G4TBMagneticFieldSetup.hh
HepMCCompress.cc
HepMCCompress.h
HepMCNodeReader.cc
HepMCNodeReader.h
PHBBox.h
PHG4ColorDefs.h
PHG4ConsistencyCheck.cc
PHG4ConsistencyCheck.h
PHG4Detector.cc
PHG4Detector.h
PHG4DisplayAction.cc
PHG4DisplayAction.h
PHG4EtaParameterization.cc
PHG4EtaParameterization.h
PHG4EtaPhiParameterization.cc
PHG4EtaPhiParameterization.h
PHG4EventAction.h
PHG4EventHeader.h
PHG4EventHeaderLinkDef.h
PHG4EventHeaderv1.cc
PHG4EventHeaderv1.h
PHG4EventHeaderv1LinkDef.h
PHG4HeadReco.cc
PHG4HeadReco.h
PHG4Hit.cc
PHG4Hit.h
PHG4HitContainer.cc
PHG4HitContainer.h
PHG4HitContainerLinkDef.h
PHG4HitDefs.cc
PHG4HitDefs.h
PHG4HitEval.cc
PHG4HitEval.h
PHG4HitEvalLinkDef.h
PHG4HitLinkDef.h
PHG4HitReadBack.cc
PHG4HitReadBack.h
PHG4Hitv1.cc
PHG4Hitv1.h
PHG4Hitv1LinkDef.h
PHG4InEvent.cc
PHG4InEvent.h
PHG4InEventCompress.cc
PHG4InEventCompress.h
PHG4InEventLinkDef.h
PHG4InEventReadBack.cc
PHG4InEventReadBack.h
PHG4InputFilter.cc
PHG4InputFilter.h
PHG4IonGun.cc
PHG4IonGun.h
PHG4MagneticField.cc
PHG4MagneticField.h
PHG4Particle.cc
PHG4Particle.h
PHG4ParticleGenerator.cc
PHG4ParticleGenerator.h
PHG4ParticleGeneratorBase.cc
PHG4ParticleGeneratorBase.h
PHG4ParticleGeneratorD0.cc
PHG4ParticleGeneratorD0.h
PHG4ParticleGeneratorVectorMeson.cc
PHG4ParticleGeneratorVectorMeson.h
PHG4ParticleGun.cc
PHG4ParticleGun.h
PHG4ParticleLinkDef.h
PHG4Particlev1.cc
PHG4Particlev1.h
PHG4Particlev1LinkDef.h
PHG4Particlev2.cc
PHG4Particlev2.h
PHG4Particlev2LinkDef.h
PHG4Particlev3.cc
PHG4Particlev3.h
PHG4Particlev3LinkDef.h
PHG4PhenixDetector.cc
PHG4PhenixDetector.h
PHG4PhenixDisplayAction.cc
PHG4PhenixDisplayAction.h
PHG4PhenixEventAction.cc
PHG4PhenixEventAction.h
PHG4PhenixStackingAction.cc
PHG4PhenixStackingAction.h
PHG4PhenixSteppingAction.cc
PHG4PhenixSteppingAction.h
PHG4PhenixTrackingAction.cc
PHG4PhenixTrackingAction.h
PHG4PileupGenerator.cc
PHG4PileupGenerator.h
PHG4PrimaryGeneratorAction.cc
PHG4PrimaryGeneratorAction.h
PHG4Reco.cc
PHG4Reco.h
PHG4RegionInformation.cc
PHG4RegionInformation.h
PHG4ScoringManager.cc
PHG4ScoringManager.h
PHG4Shower.cc
PHG4Shower.h
PHG4ShowerLinkDef.h
PHG4Showerv1.cc
PHG4Showerv1.h
PHG4Showerv1LinkDef.h
PHG4SimpleEventGenerator.cc
PHG4SimpleEventGenerator.h
PHG4StackingAction.cc
PHG4StackingAction.h
PHG4SteppingAction.cc
PHG4SteppingAction.h
PHG4Subsystem.cc
PHG4Subsystem.h
PHG4TrackingAction.h
PHG4TrackUserInfoV1.cc
PHG4TrackUserInfoV1.h
PHG4TruthEventAction.cc
PHG4TruthEventAction.h
PHG4TruthInfoContainer.cc
PHG4TruthInfoContainer.h
PHG4TruthInfoContainerLinkDef.h
PHG4TruthSubsystem.cc
PHG4TruthSubsystem.h
PHG4TruthTrackingAction.cc
PHG4TruthTrackingAction.h
PHG4UIsession.cc
PHG4UIsession.h
PHG4Units.h
PHG4UserPrimaryParticleInformation.h
PHG4Utils.cc
PHG4Utils.h
PHG4VertexSelection.cc
PHG4VertexSelection.h
PHG4VtxPoint.cc
PHG4VtxPoint.h
PHG4VtxPointLinkDef.h
PHG4VtxPointv1.cc
PHG4VtxPointv1.h
PHG4VtxPointv1LinkDef.h
ReadEICFiles.cc
ReadEICFiles.h
g4micromegas
g4mvtx
g4tpc
g4trackfastsim
g4vertex
tpcresponse
Doxygen_Assist
ecce-detectors
fun4all_eicdetectors
geant4
macros
online_distribution
tutorials
doxygen_mainpage.h
File Members
External Links
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
PHG4InEventReadBack.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHG4InEventReadBack.cc
1
#include "
PHG4InEventReadBack.h
"
2
#include "
PHG4InEvent.h
"
3
#include "
PHG4Particle.h
"
// for PHG4Particle
4
#include "
PHG4Particlev1.h
"
5
#include "
PHG4VtxPointv1.h
"
6
7
#include <
vararray/VariableArray.h
>
8
#include <
vararray/VariableArrayUtils.h
>
9
10
#include <
fun4all/Fun4AllReturnCodes.h
>
11
12
#include <
phool/getClass.h
>
13
#include <
phool/PHCompositeNode.h
>
14
#include <
phool/PHIODataNode.h
>
15
#include <
phool/PHNode.h
>
// for PHNode
16
#include <
phool/PHNodeIterator.h
>
// for PHNodeIterator
17
#include <
phool/PHObject.h
>
// for PHObject
18
19
#include <iostream>
20
21
using namespace
std;
22
23
PHG4InEventReadBack::PHG4InEventReadBack
(
const
std::string &
name
):
SubsysReco
(name)
24
{}
25
26
int
27
PHG4InEventReadBack::InitRun
(
PHCompositeNode
*topNode)
28
{
29
PHG4InEvent
*ineve = findNode::getClass<PHG4InEvent>(topNode,
"PHG4INEVENT"
);
30
if
(!ineve)
31
{
32
PHNodeIterator
iter( topNode );
33
PHCompositeNode
*dstNode;
34
dstNode =
dynamic_cast<
PHCompositeNode
*
>
(iter.
findFirst
(
"PHCompositeNode"
,
"DST"
));
35
36
ineve =
new
PHG4InEvent
();
37
PHIODataNode<PHObject>
*newNode =
new
PHIODataNode<PHObject>
(ineve,
"PHG4INEVENT"
,
"PHObject"
);
38
dstNode->
addNode
(newNode);
39
}
40
41
return
Fun4AllReturnCodes::EVENT_OK
;
42
}
43
44
int
45
PHG4InEventReadBack::process_event
(
PHCompositeNode
*topNode)
46
{
47
PHG4InEvent
*inEvent = findNode::getClass<PHG4InEvent>(topNode,
"PHG4INEVENT"
);
48
if
(!inEvent)
49
{
50
cout <<
"no PHG4INEVENT node found"
<< endl;
51
return
Fun4AllReturnCodes::EVENT_OK
;
52
}
53
VariableArray
*vtxarray = findNode::getClass<VariableArray>(topNode,
"PHG4Vtx_VarArray"
);
54
if
(!vtxarray)
55
{
56
cout <<
"no PHG4Vtx_VarArray node found"
<< endl;
57
return
Fun4AllReturnCodes::EVENT_OK
;
58
}
59
60
VariableArray
*particlearray = findNode::getClass<VariableArray>(topNode,
"PHG4Particle_VarArray"
);
61
if
(!particlearray)
62
{
63
cout <<
"no PHG4Particle_VarArray node found"
<< endl;
64
return
Fun4AllReturnCodes::EVENT_OK
;
65
}
66
inEvent->
Reset
();
67
unsigned
int
size = vtxarray->
get_array_size
();
68
const
short
int
*sval = vtxarray->
get_array
();
69
PHG4VtxPointv1
vtx;
70
while
(size > 0)
71
{
72
int
vtxid = *sval++;
73
size --;
74
vtx.
set_x
(
VariableArrayUtils::ShortBitsToFloat
(*sval++));
75
size --;
76
vtx.
set_y
(
VariableArrayUtils::ShortBitsToFloat
(*sval++));
77
size --;
78
vtx.
set_z
(
VariableArrayUtils::ShortBitsToFloat
(*sval++));
79
size--;
80
vtx.
set_t
(
VariableArrayUtils::ShortBitsToFloat
(*sval++));
81
size--;
82
inEvent->
AddVtx
(vtxid,vtx);
83
}
84
85
size = particlearray->
get_array_size
();
86
sval = particlearray->
get_array
();
87
while
(size > 0)
88
{
89
PHG4Particle
*
particle
=
new
PHG4Particlev1
();
90
int
vtxid = *sval++;
91
size --;
92
particle->
set_pid
(*sval++);
93
size --;
94
particle->
set_px
(
VariableArrayUtils::ShortBitsToFloat
(*sval++));
95
size --;
96
particle->
set_py
(
VariableArrayUtils::ShortBitsToFloat
(*sval++));
97
size --;
98
particle->
set_pz
(
VariableArrayUtils::ShortBitsToFloat
(*sval++));
99
size --;
100
inEvent->
AddParticle
(vtxid, particle);
101
}
102
// inEvent->identify();
103
return
Fun4AllReturnCodes::EVENT_OK
;
104
}
105
106
int
107
PHG4InEventReadBack::End
(
PHCompositeNode
*
/*topNode*/
)
108
{
109
return
Fun4AllReturnCodes::EVENT_OK
;
110
}
coresoftware
blob
master
simulation
g4simulation
g4main
PHG4InEventReadBack.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:44
using
1.8.2 with
ECCE GitHub integration