ATTPCROOT  0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
AtTpcContFact.cxx
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence version 3 (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 #include "AtTpcContFact.h"
9 
10 #include "AtTpcGeoPar.h"
11 
12 #include <FairContFact.h>
13 #include <FairRuntimeDb.h>
14 
15 #include <TList.h>
16 #include <TString.h>
17 
18 #include <cstring>
19 
20 class FairParSet;
21 
23 
24  static AtTpcContFact gAtTpcContFact;
25 
26 AtTpcContFact::AtTpcContFact() : FairContFact()
27 {
29  fName = "AtTpcContFact";
30  fTitle = "Factory for parameter containers in libAtTpc";
31  setAllContainers();
32  FairRuntimeDb::instance()->addContFactory(this);
33 }
34 
35 void AtTpcContFact::setAllContainers()
36 {
41  // NOLINTNEXTLINE I think FairRoot owns this memory
42  auto *p = new FairContainer("AtTpcGeoPar", "AtTpc Geometry Parameters", "TestDefaultContext");
43  p->addContext("TestNonDefaultContext");
44 
45  containers->Add(p);
46 }
47 
48 FairParSet *AtTpcContFact::createContainer(FairContainer *c)
49 {
55  const char *name = c->GetName();
56  FairParSet *p = nullptr;
57  if (strcmp(name, "AtTpcGeoPar") == 0) {
58  p = new AtTpcGeoPar(c->getConcatName().Data(), c->GetTitle(), c->getContext());
59  }
60  return p;
61 }
ClassImp
ClassImp(AtTpcContFact) static AtTpcContFact gAtTpcContFact
AtTpcContFact::AtTpcContFact
AtTpcContFact()
Definition: AtTpcContFact.cxx:26
AtTpcGeoPar
Definition: AtTpcGeoPar.h:21
AtTpcContFact.h
AtTpcGeoPar.h
AtTpcContFact
Definition: AtTpcContFact.h:20
AtTpcContFact::createContainer
FairParSet * createContainer(FairContainer *)
Definition: AtTpcContFact.cxx:48
c
constexpr auto c
Definition: AtRadialChargeModel.cxx:20