Analysis Software
Documentation for sPHENIX simulation software
 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>
5 
7 #include <fun4all/SubsysReco.h>
8 
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 //____________________________________________________________________________..
19  : SubsysReco(name)
20 {
21 }
22 
23 //____________________________________________________________________________..
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  {
38  flgsv->PutFlagsBack(rc, false);
39  }
41 }
42 
43 //____________________________________________________________________________..
45 {
46  FlagSave *flagsave = findNode::getClass<FlagSave>(topNode, "Flags");
47  if (flagsave)
48  {
50  flagsave->FillFromPHFlag(rc, true);
51  flagsave->identify();
52  }
54 }
55 
56 //____________________________________________________________________________..
57 void FlagHandler::Print(const std::string & /* what */) const
58 {
60  rc->Print();
61 }