FairRoot/PandaRoot
PndSttContFact.cxx
Go to the documentation of this file.
1 //*-- AUTHOR : Denis Bertini
2 //*-- Created : 20/06/2005
3 
5 //
6 // PndSttContFact
7 //
8 // Factory for the parameter containers in libStt
9 //
11 
12 #include "PndSttContFact.h"
13 #include "FairRuntimeDb.h"
14 #include "PndGeoSttPar.h"
15 #include "PndSttDigiPar.h"
16 #include "FairParRootFileIo.h"
17 #include "FairParAsciiFileIo.h"
18 #include "PndSttParRootFileIo.h"
19 #include "PndSttParAsciiFileIo.h"
20 #include <iostream>
21 #include <iomanip>
22 
24 
26 
28 {
29  // Constructor (called when the library is loaded)
30  fName="PndSttContFact";
31  fTitle="Factory for parameter containers in libStt";
32  setAllContainers();
33  FairRuntimeDb::instance()->addContFactory(this);
34 }
35 
37 {
40  FairContainer* p2= new FairContainer("PndGeoSttPar",
41  "Stt Geometry Parameters",
42  "TestDefaultContext");
43  p2->addContext("TestNonDefaultContext");
44 
45  containers->Add(p2);
46 }
47 
48 FairParSet* PndSttContFact::createContainer(FairContainer* c)
49 {
53  const char* name=c->GetName();
54  std::cout << " -I container name " << name << std::endl;
55  FairParSet* p=0;
56 
57  if (strcmp(name,"PndGeoSttPar")==0) {
58  p=new PndGeoSttPar(c->getConcatName().Data(),c->GetTitle(),c->getContext());
59  }
60  return p;
61 }
62 /*
63 void PndSttContFact::activateParIo(FairParIo* io) {
64  // activates the input/output class for the parameters
65  // needed by the Stt
66  if (strcmp(io->IsA()->GetName(),"FairParRootFileIo")==0) {
67  PndSttParRootFileIo* p=new PndSttParRootFileIo(((FairParRootFileIo*)io)->getParRootFile());
68  io->setDetParIo(p);
69  }
70  if (strcmp(io->IsA()->GetName(),"FairParAsciiFileIo")==0) {
71  PndSttParAsciiFileIo* p=new PndSttParAsciiFileIo(((FairParAsciiFileIo*)io)->getFile());
72  io->setDetParIo(p);
73  }
74 }
75 
76 */
Double_t p
Definition: anasim.C:58
static PndSttContFact gPndSttContFact
TString name
TPad * p2
Definition: hist-t7.C:117
ClassImp(PndAnaContFact)
FairParSet * createContainer(FairContainer *)