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
FlagHandler.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file FlagHandler.cc
1
#include "
FlagHandler.h
"
2
3
#include <
ffaobjects/FlagSave.h
>
4
#include <
ffaobjects/FlagSavev1.h
>
5
6
#include <
fun4all/Fun4AllReturnCodes.h
>
7
#include <
fun4all/SubsysReco.h
>
8
9
#include <
phool/PHCompositeNode.h
>
10
#include <
phool/PHIODataNode.h
>
// for PHIODataNode
11
#include <
phool/PHNode.h
>
// for PHNode
12
#include <
phool/PHNodeIterator.h
>
// for PHNodeIterator
13
#include <
phool/PHObject.h
>
// for PHObject
14
#include <
phool/getClass.h
>
15
#include <
phool/recoConsts.h
>
16
17
//____________________________________________________________________________..
18
FlagHandler::FlagHandler
(
const
std::string
&
name
)
19
:
SubsysReco
(name)
20
{
21
}
22
23
//____________________________________________________________________________..
24
int
FlagHandler::InitRun
(
PHCompositeNode
*topNode)
25
{
26
PHNodeIterator
iter(topNode);
27
PHCompositeNode
*runNode =
dynamic_cast<
PHCompositeNode
*
>
(iter.
findFirst
(
"PHCompositeNode"
,
"RUN"
));
28
FlagSave
*flgsv = findNode::getClass<FlagSave>(runNode,
"Flags"
);
29
if
(!flgsv)
30
{
31
flgsv =
new
FlagSavev1
();
32
PHIODataNode<PHObject>
*newNode =
new
PHIODataNode<PHObject>
(flgsv,
"Flags"
,
"PHObject"
);
33
runNode->addNode(newNode);
34
}
35
else
36
{
37
recoConsts
*rc =
recoConsts::instance
();
38
flgsv->
PutFlagsBack
(rc,
false
);
39
}
40
return
Fun4AllReturnCodes::EVENT_OK
;
41
}
42
43
//____________________________________________________________________________..
44
int
FlagHandler::End
(
PHCompositeNode
*topNode)
45
{
46
FlagSave
*flagsave = findNode::getClass<FlagSave>(topNode,
"Flags"
);
47
if
(flagsave)
48
{
49
recoConsts
*rc =
recoConsts::instance
();
50
flagsave->
FillFromPHFlag
(rc,
true
);
51
flagsave->
identify
();
52
}
53
return
Fun4AllReturnCodes::EVENT_OK
;
54
}
55
56
//____________________________________________________________________________..
57
void
FlagHandler::Print
(
const
std::string
&
/* what */
)
const
58
{
59
recoConsts
*rc =
recoConsts::instance
();
60
rc->
Print
();
61
}
coresoftware
blob
master
offline
framework
ffamodules
FlagHandler.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:04
using
1.8.2 with
sPHENIX GitHub integration