BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
CbmParTest.cxx
Go to the documentation of this file.
1
2#include "CbmParTest.h"
3
4#include "FairParamList.h"
5
6#include <iomanip>
7#include <iostream>
8
9CbmParTest::CbmParTest(const char* name, const char* title, const char* context)
10 : FairParGenericSet(name, title, context)
11{
12 clear();
13 histo1 = new TH1F("h1", "test histogram", 100, -3, 3);
14 histo1->SetDirectory(0);
15}
16
18
20{
21 p1 = 0.F;
22 for (Int_t i = 0; i < 5000; i++) {
23 ai[i] = 0;
24 }
25 if (histo1)
26 histo1->Reset();
27}
28
29void CbmParTest::putParams(FairParamList* l)
30{
31 if (!l)
32 return;
33 l->add("p1", p1);
34 l->addObject("ai", ai, 5000);
35 l->addObject("histo1", histo1);
36}
37
39{
40 if (!l)
41 return kFALSE;
42 if (!l->fill("p1", &p1))
43 return kFALSE;
44 if (!l->fillObject("ai", ai, 5000))
45 return kFALSE;
46 if (!l->fillObject("histo1", histo1))
47 return kFALSE;
48 histo1->SetDirectory(0);
49 return kTRUE;
50}
int i
Definition P4_F32vec4.h:22
bool Bool_t
int Int_t
constexpr Bool_t kFALSE
constexpr Bool_t kTRUE
~CbmParTest(void)
Float_t p1
Definition CbmParTest.h:10
Bool_t getParams(FairParamList *)
CbmParTest(const char *name="CbmParTest", const char *title="Test class for parameter io", const char *context="TestDefaultContext")
Definition CbmParTest.cxx:9
void putParams(FairParamList *)
TH1F * histo1
Definition CbmParTest.h:12
void clear(void)
Int_t ai[5000]
Definition CbmParTest.h:11