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
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
SyncReco.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file SyncReco.cc
1
#include "
SyncReco.h
"
2
3
#include <
ffaobjects/SyncDefs.h
>
4
#include <
ffaobjects/SyncObject.h
>
5
#include <
ffaobjects/SyncObjectv1.h
>
6
7
#include <
fun4all/Fun4AllReturnCodes.h
>
8
#include <
fun4all/Fun4AllServer.h
>
9
#include <
fun4all/SubsysReco.h
>
// for SubsysReco
10
11
#include <
phool/PHCompositeNode.h
>
12
#include <
phool/PHIODataNode.h
>
13
#include <
phool/PHNode.h
>
// for PHNode
14
#include <
phool/PHNodeIterator.h
>
// for PHNodeIterator
15
#include <
phool/PHObject.h
>
// for PHObject
16
#include <
phool/getClass.h
>
17
#include <
phool/phool.h
>
// for PHWHERE
18
#include <
phool/recoConsts.h
>
19
20
#include <iostream>
21
22
SyncReco::SyncReco
(
const
std::string &
name
)
23
:
SubsysReco
(name)
24
{
25
return
;
26
}
27
28
int
SyncReco::Init
(
PHCompositeNode
*topNode)
29
{
30
int
iret =
CreateNodeTree
(topNode);
31
return
iret;
32
}
33
34
int
SyncReco::InitRun
(
PHCompositeNode
*topNode)
35
{
36
SyncObject
*syncobject = findNode::getClass<SyncObject>(topNode, syncdefs::SYNCNODENAME);
37
recoConsts
*rc =
recoConsts::instance
();
38
syncobject->
RunNumber
(rc->get_IntFlag(
"RUNNUMBER"
));
39
return
Fun4AllReturnCodes::EVENT_OK
;
40
}
41
42
int
SyncReco::CreateNodeTree
(
PHCompositeNode
*topNode)
43
{
44
PHNodeIterator
iter(topNode);
45
PHCompositeNode
*dstNode;
46
dstNode =
dynamic_cast<
PHCompositeNode
*
>
(iter.
findFirst
(
"PHCompositeNode"
,
"DST"
));
47
if
(!dstNode)
48
{
49
std::cout <<
PHWHERE
<<
" DST Node is missing doing nothing"
<< std::endl;
50
return
Fun4AllReturnCodes::ABORTRUN
;
51
}
52
53
SyncObject
*syncobject = findNode::getClass<SyncObject>(topNode, syncdefs::SYNCNODENAME);
54
if
(!syncobject)
55
{
56
syncobject =
new
SyncObjectv1
();
57
PHIODataNode<PHObject>
*SyncObjectNode =
new
PHIODataNode<PHObject>
(syncobject, syncdefs::SYNCNODENAME,
"PHObject"
);
// contains PHObject
58
dstNode->
addNode
(SyncObjectNode);
59
}
60
61
return
Fun4AllReturnCodes::EVENT_OK
;
62
}
63
64
int
SyncReco::process_event
(
PHCompositeNode
*topNode)
65
{
66
Fun4AllServer
*se =
Fun4AllServer::instance
();
67
SyncObject
*syncobject = findNode::getClass<SyncObject>(topNode, syncdefs::SYNCNODENAME);
68
if
(!syncobject)
69
{
70
std::cout <<
PHWHERE
<<
" No Synchronisation Object, no parallel reading of multiple inputs"
<< std::endl;
71
return
Fun4AllReturnCodes::ABORTEVENT
;
72
}
73
74
syncobject->
EventCounter
(se->
EventCounter
());
75
syncobject->
EventNumber
(se->
EventNumber
());
76
syncobject->
RunNumber
(se->
RunNumber
());
77
syncobject->
SegmentNumber
(se->
SegmentNumber
());
78
79
if
(
Verbosity
() > 0)
80
{
81
syncobject->
identify
();
82
}
83
return
Fun4AllReturnCodes::EVENT_OK
;
84
}
coresoftware
blob
master
offline
framework
ffamodules
SyncReco.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:33
using
1.8.2 with
ECCE GitHub integration