Project
Loading...
Searching...
No Matches
MagFieldContFact.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
15
16#include <cstring> // for strcmp, NULL
17#include <fairlogger/Logger.h> // for FairLogger
18#include "FairRuntimeDb.h" // for FairRuntimeD
19#include "FairParSet.h"
20#include "Field/MagFieldParam.h" // for FairConstPar
22
23using namespace o2::field;
24
25ClassImp(MagFieldContFact) static MagFieldContFact gMagFieldContFact;
26
28{
29 // Constructor (called when the library is loaded)
30 fName = "MagFieldContFact";
31 fTitle = "Factory for MagField parameter container";
32 setAllContainers();
33 FairRuntimeDb::instance()->addContFactory(this);
34}
35
36void MagFieldContFact::setAllContainers()
37{
38 // Creates the Container objects and adds it to the list of containers
39
40 auto* p = new FairContainer("MagFieldParam", "Mag. Field Parameters", "Default Field");
41 containers->Add(p);
42}
43
44FairParSet* MagFieldContFact::createContainer(FairContainer* c)
45{
46 // calls the constructor of the corresponding parameter container.
47 const char* name = c->GetName();
48 LOG(info) << "MagFieldContFact::createContainer: Creating mag.field container " << name;
49 FairParSet* p = nullptr;
50 if (strcmp(name, "MagFieldParam") == 0) {
51 p = new MagFieldParam(c->getConcatName().Data(), c->GetTitle(), c->getContext());
52 }
53 return p;
54}
ClassImp(MagFieldContFact) static MagFieldContFact gMagFieldContFact
Definition of the MagFieldContFact: factory for ALICE mag. field.
Definition of the MagFieldParam: container for ALICE mag. field parameters.
uint32_t c
Definition RawData.h:2
FairParSet * createContainer(FairContainer *) override
GLuint const GLchar * name
Definition glcorearb.h:781
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"