EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PndSensorNameContFact.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PndSensorNameContFact.cxx
1 
2 //
3 // PndSensorNameContFact
4 //
5 // Factory for the parameter containers in libPndMvd
6 //
8 
9 //using namespace std;
10 #include "PndSensorNameContFact.h"
11 #include "FairRuntimeDb.h"
12 #include "PndSensorNamePar.h"
13 #include "FairParRootFileIo.h"
14 #include "FairParAsciiFileIo.h"
15 #include "TList.h"
16 #include "TObjString.h"
17 #include <iostream>
18 #include <iomanip>
19 
21 
23 
24 PndSensorNameContFact::PndSensorNameContFact(): fSensorParNames(), fContainerNames() {
25  // Constructor (called when the library is loaded)
26  fName="PndSensorNameContFact";
27  fTitle="Factory for parameter containers of the PndGeoHandler";
28  fSensorParNames = new TList();
29  fContainerNames.push_back("PndSensorNamePar");
32 }
34  if(0!=fSensorParNames)
35  {
36  fSensorParNames->Delete();
37  delete fSensorParNames;
38  }
39 }
40 
41 
45  for (unsigned int i = 0; i < fContainerNames.size(); i++){
46  std::string description = "Match between GeoManager path and SensorId";
47  FairContainer* p = new FairContainer(fContainerNames[i].c_str(), description.c_str(), "TestDefaultContext");
48  fSensorParNames->Add(new TObjString(p->getConcatName()));
49  containers->Add(p);
50  }
51 }
52 
57  const char* name=c->GetName();
58  FairParSet* p=NULL;
59 
60  for (unsigned int i = 0; i < fContainerNames.size(); i++){
61  if (strcmp(name,fContainerNames[i].c_str())==0) {
62  p=new PndSensorNamePar(c->getConcatName().Data(),c->GetTitle(),c->getContext());
63  return p;
64  }
65  }
66  return p;
67 }