Skip to content

Commit 1756504

Browse files
committed
chore(parbase): Some cleanup of FairParSet
1 parent 4c1531a commit 1756504

2 files changed

Lines changed: 27 additions & 35 deletions

File tree

fairroot/parbase/FairParSet.cxx

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ FairParSet::FairParSet(const char* name, const char* title, const char* context,
3535
, author("")
3636
, description("")
3737
{
38-
for (Int_t i = 0; i < 3; i++) {
38+
for (int i = 0; i < 3; i++) {
3939
versions[i] = -1;
4040
}
4141
}
@@ -50,7 +50,7 @@ Bool_t FairParSet::init()
5050
// FairRunAna* fRun =FairRunAna::Instance();
5151
// cout << "-I- FairParSet::init() " << GetName() << endl;
5252

53-
Bool_t allFound = kFALSE;
53+
bool allFound = false;
5454
FairParIo* io = 0;
5555
if (rtdb) {
5656
io = rtdb->getFirstInput();
@@ -91,44 +91,36 @@ Int_t FairParSet::write()
9191
void FairParSet::print()
9292
{
9393
// prints information about container (versions,status,hasChanged...)
94-
cout << "----- " << GetName() << " -----" << '\n';
94+
LOG(info) << "----- " << GetName() << " -----";
9595
if (!paramContext.IsNull()) {
96-
cout << "Context/Purpose: " << paramContext << '\n';
96+
LOG(info) << "Context/Purpose: " << paramContext;
9797
}
9898
if (!author.IsNull()) {
99-
cout << "Author: " << author << '\n';
99+
LOG(info) << "Author: " << author;
100100
}
101101
if (!description.IsNull()) {
102-
cout << "Description: " << description << '\n';
103-
}
104-
cout << "first input version: " << versions[1] << '\n';
105-
cout << "second input version: " << versions[2] << '\n';
106-
if (changed) {
107-
cout << "has changed" << '\n';
108-
} else {
109-
cout << "has not changed" << '\n';
110-
}
111-
if (status) {
112-
cout << "is static" << '\n';
113-
} else {
114-
cout << "is not static" << '\n';
102+
LOG(info) << "Description: " << description;
115103
}
104+
LOG(info) << "first input version: " << versions[1];
105+
LOG(info) << "second input version: " << versions[2];
106+
LOG(info) << "has" << (changed ? "" : " not") << " changed";
107+
LOG(info) << "is" << (status ? "" : " not") << " static";
116108
}
117109

118110
void FairParSet::clear()
119111
{
120-
status = kFALSE;
112+
status = false;
121113
resetInputVersions();
122114
}
123115

124116
void FairParSet::resetInputVersions()
125117
{
126118
// resets the input versions if the container is not static
127119
if (!status) {
128-
for (Int_t i = 0; i < 3; i++) {
120+
for (int i = 0; i < 3; i++) {
129121
versions[i] = -1;
130122
}
131-
changed = kFALSE;
123+
changed = false;
132124
}
133125
}
134126

@@ -150,7 +142,7 @@ FairParSet::FairParSet(const FairParSet& from)
150142
fTitle = from.fTitle;
151143
detName = from.detName;
152144
*/
153-
for (Int_t i = 0; i < 3; i++)
145+
for (int i = 0; i < 3; i++)
154146
versions[i] = from.versions[i];
155147
/*
156148
status = from.status;

fairroot/parbase/FairParSet.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ class FairParSet : public TObject
2020
TString fName; //
2121
TString fTitle; //
2222
TString detName; //! name of the detector the container belongs to
23-
Int_t versions[3]; //! versions of container in the 2 possible inputs
24-
Bool_t status; //! static flag
25-
Bool_t changed; //! flag is kTRUE if parameters have changed
26-
Bool_t owned; //! if flag is KTRUE FairDB has the par. class ownership
23+
int versions[3]; //! versions of container in the 2 possible inputs
24+
bool status; //! static flag
25+
bool changed; //! flag is kTRUE if parameters have changed
26+
bool owned; //! if flag is KTRUE FairDB has the par. class ownership
2727
TString paramContext; // Context/purpose for parameters and conditions
2828
TString author; // Author of parameters
2929
TString description; // Description of parameters
3030

3131
public:
32-
FairParSet(const char* name = "", const char* title = "", const char* context = "", Bool_t owner = kFALSE);
32+
FairParSet(const char* name = "", const char* title = "", const char* context = "", bool owner = false);
3333
virtual ~FairParSet() {}
3434

3535
const char* GetName() const override { return fName.Data(); }
@@ -45,13 +45,13 @@ class FairParSet : public TObject
4545
const char* getDetectorName() { return detName.Data(); }
4646
void resetInputVersions();
4747

48-
void setInputVersion(Int_t v = -1, Int_t i = 0)
48+
void setInputVersion(int v = -1, int i = 0)
4949
{
5050
if (i >= 0 && i < 3) {
5151
versions[i] = v;
5252
}
5353
}
54-
Int_t getInputVersion(Int_t i)
54+
int getInputVersion(int i)
5555
{
5656
if (i >= 0 && i < 3) {
5757
return versions[i];
@@ -60,14 +60,14 @@ class FairParSet : public TObject
6060
}
6161
}
6262

63-
void setStatic(Bool_t flag = kTRUE) { status = flag; }
64-
Bool_t isStatic() { return status; }
63+
void setStatic(bool flag = kTRUE) { status = flag; }
64+
bool isStatic() { return status; }
6565

66-
void setOwnership(Bool_t flag = kTRUE) { owned = flag; }
67-
Bool_t isOwned() { return owned; }
66+
void setOwnership(bool flag = kTRUE) { owned = flag; }
67+
bool isOwned() { return owned; }
6868

69-
void setChanged(Bool_t flag = kTRUE) { changed = flag; }
70-
Bool_t hasChanged() { return changed; }
69+
void setChanged(bool flag = kTRUE) { changed = flag; }
70+
bool hasChanged() { return changed; }
7171

7272
const char* getParamContext() const { return paramContext.Data(); }
7373

0 commit comments

Comments
 (0)