EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairParGenericSet.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FairParGenericSet.cxx
1 //*-- AUTHOR : Ilse Koenig
2 //*-- Created : 28/01/2009
3 
4 //_HADES_CLASS_DESCRIPTION
6 //
7 // FairParGenericSet
8 //
9 // Base class for all condition-stype parameter containers
10 //
11 // The following functions must be implemented by the derived class:
12 //
13 // void putParams(FairParamList*) Fills all persistent data members into
14 // the list for write.
15 //
16 // Bool_t getParams(FairParamList*) Fills all persistent data members from
17 // the list after reading. The function
18 // returns false, when a data member is
19 // not in the list.
20 //
22 
23 #include "FairParGenericSet.h"
24 #include "FairParamList.h"
25 #include <iostream>
26 #include <iomanip>
27 #include "FairDetParIo.h"
28 #include "FairParIo.h"
30 
31 
32 
33 Bool_t FairParGenericSet::init(FairParIo* inp)
34 {
35  // intitializes the container from an input
36  FairDetParIo* input=inp->getDetParIo("FairGenericParIo");
37  if (input) { return (input->init(this)); }
38  return kFALSE;
39 }
40 
42 {
43  // writes the container to an output
44  FairDetParIo* out=output->getDetParIo("FairGenericParIo");
45  if (out) { return out->write(this); }
46  return -1;
47 }
48 
50 {
51  // prints information about the container
52  std::cout<<"\n---------------------------------------------\n";
53  std::cout<<"----- "<<GetName()<<" -----\n";
54  if (!paramContext.IsNull()) { std::cout<<"-- Context/Purpose: "<<paramContext<<'\n'; }
55  if (!author.IsNull()) { std::cout<<"-- Author: "<<author<<'\n'; }
56  if (!description.IsNull()) { std::cout<<"-- Description: "<<description<<'\n'; }
57  std::cout<<"---------------------------------------------\n";
58  FairParamList* condList = new FairParamList;
59  putParams(condList);
60  condList->print();
61  std::cout<<"---------------------------------------------\n\n";
62  delete condList;
63 }
64