Skip to content

Commit f386f3b

Browse files
ChristianTackeGSIdennisklein
authored andcommitted
chore(FairRun): Turn Deprecations into C++ Ones
Many methods in FairRun have already been deprecated by runtime warnings (and partly notes in the .h). Turn all of them into C++ `[[deprecated]]` attributes. Also mark them with the doxygen `\deprecated` qualifier and note that they will go away in FairRoot 20.
1 parent fa715e1 commit f386f3b

5 files changed

Lines changed: 29 additions & 37 deletions

File tree

base/steer/FairRun.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ void FairRun::SetUseFairLinks(Bool_t val) { fRootManager->SetUseFairLinks(val);
146146

147147
void FairRun::SetWriteRunInfoFile(Bool_t write)
148148
{
149-
LOG(warn) << "Function FairRun::SetWriteRunInfoFile(Bool_t) is depcrecated and will vanish in future versions of "
149+
LOG(warn) << "Function FairRun::SetWriteRunInfoFile(Bool_t) is deprecated and will vanish in future versions of "
150150
"FairRoot.\n";
151151
LOG(warn) << "Please use FairRun::SetGenerateRunInfo(Bool_t) instead.";
152152

@@ -156,7 +156,7 @@ void FairRun::SetWriteRunInfoFile(Bool_t write)
156156
Bool_t FairRun::GetWriteRunInfoFile()
157157
{
158158
LOG(warn)
159-
<< "Function FairRun::GetWriteRunInfoFile() is depcrecated and will vanish in future versions of FairRoot.\n";
159+
<< "Function FairRun::GetWriteRunInfoFile() is deprecated and will vanish in future versions of FairRoot.\n";
160160
LOG(warn) << "Please use FairRun::IsRunInfoGenerated() instead.";
161161

162162
return fGenerateRunInfo;

base/steer/FairRun.h

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,22 @@ class FairRun : public TNamed
124124
/**Create a new file and save the TGeoManager to it*/
125125
void CreateGeometryFile(const char* geofile);
126126

127-
//** Set if RunInfo file should be written */
128-
void SetWriteRunInfoFile(Bool_t write);
127+
/**
128+
* Set if RunInfo file should be written
129+
* \deprecated Use SetGenerateRunInfo() instead.
130+
* Deprecated pre-v19, will be removed in v20.
131+
*/
132+
[[deprecated]] void SetWriteRunInfoFile(Bool_t write);
129133

130134
//** Set if RunInfo should be generated */
131135
void SetGenerateRunInfo(Bool_t write) { fGenerateRunInfo = write; }
132136

133-
//** Get info if RunInfo file is written */
134-
Bool_t GetWriteRunInfoFile();
137+
/**
138+
* Get info if RunInfo file is written
139+
* \deprecated Use \ref IsRunInfoGenerated() instead.
140+
* Deprecated pre-v19, will be removed in v20.
141+
*/
142+
[[deprecated]] Bool_t GetWriteRunInfoFile();
135143

136144
//** Get info if RunInfo file is written */
137145
Bool_t IsRunInfoGenerated() { return fGenerateRunInfo; }
@@ -151,21 +159,29 @@ class FairRun : public TNamed
151159
//** Set option string */
152160
void SetOptions(const TString& s) { fOptions = s; };
153161

154-
// vvvvvvvvvv depracted functions, replaced by FairSink vvvvvvvvvv
155162
/**
156163
* Set the output file name for analysis or simulation
164+
* \deprecated Use \ref FairSink and \ref SetSink().
165+
* Deprecated pre-v19, will be removed in v20.
157166
*/
158-
virtual void SetOutputFile(const char* fname);
167+
[[deprecated]] virtual void SetOutputFile(const char* fname);
159168
/**
160169
* Set the output file for analysis or simulation
170+
* \deprecated Use \ref FairSink and \ref SetSink().
171+
* Deprecated pre-v19, will be removed in v20.
161172
*/
162-
virtual void SetOutputFile(TFile* f);
173+
[[deprecated]] virtual void SetOutputFile(TFile* f);
163174
/**
164175
* Set the output file name without creating the file
176+
* \deprecated Use \ref FairSink and \ref SetSink().
177+
* Deprecated pre-v19, will be removed in v20.
178+
*/
179+
[[deprecated]] void SetOutputFileName(const TString& name);
180+
/**
181+
* \deprecated Use \ref FairSink and \ref SetSink().
182+
* Deprecated pre-v19, will be removed in v20.
165183
*/
166-
void SetOutputFileName(const TString& name);
167-
TFile* GetOutputFile();
168-
// ^^^^^^^^^^ depracted functions, replaced by FairSink ^^^^^^^^^^
184+
[[deprecated]] TFile* GetOutputFile();
169185

170186
/**
171187
* New functions which allow to postpone creating a new Sink in MT

base/steer/FairRunAnaProof.cxx

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -370,19 +370,4 @@ void FairRunAnaProof::RunOnProof(Int_t NStart, Int_t NStop)
370370
return;
371371
}
372372

373-
// // void FairRunAnaProof::SetOutputFile(const char* fname)
374-
// {
375-
// fOutname=fname;
376-
// }
377-
//
378-
// // void FairRunAnaProof::SetOutputFile(TFile* f)
379-
// {
380-
// if (! fRootManager) return;
381-
382-
// fOutname=f->GetName();
383-
// fRootManager->OpenOutFile(f);
384-
// fOutFile = f;
385-
386-
// }
387-
//
388373
ClassImp(FairRunAnaProof);

base/steer/FairRunAnaProof.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,6 @@ class FairRunAnaProof : public FairRunAna
3434
/** Init containers executed on PROOF, which is part of Init when running locally*/
3535
void InitContainers();
3636

37-
/**
38-
* Set the output file name for analysis or simulation
39-
*/
40-
// virtual void SetOutputFile(const char* fname);
41-
/**
42-
* Set the output file for analysis or simulation
43-
*/
44-
// virtual void SetOutputFile(TFile* f);
45-
4637
/**Run from event number NStart to event number NStop */
4738
void Run(Int_t NStart = 0, Int_t NStop = 0) override;
4839
/**Run for one event, used on PROOF nodes*/

examples/simulation/rutherford/macros/run_rutherford.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void run_rutherford(Int_t nEvents = 10, TString mcEngine = "TGeant4", Bool_t isM
5858
FairRuntimeDb* rtdb = run->GetRuntimeDb();
5959
// ------------------------------------------------------------------------
6060

61-
run->SetWriteRunInfoFile(kFALSE);
61+
run->SetGenerateRunInfo(kFALSE);
6262
// ----- Create media -------------------------------------------------
6363
run->SetMaterials("media.geo"); // Materials
6464
// ------------------------------------------------------------------------

0 commit comments

Comments
 (0)