Skip to content

Commit d899d32

Browse files
TobiasStockmannsMohammadAlTurany
authored andcommitted
Improving compatibility with legacy code
1 parent 457e406 commit d899d32

File tree

6 files changed

+49
-22
lines changed

6 files changed

+49
-22
lines changed

eventdisplay/FairBoxSetDraw.cxx

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,20 @@ Double_t fX, fY, fZ;
3232
FairBoxSetDraw::FairBoxSetDraw()
3333
: FairTask("FairBoxSetDraw", 0)
3434
, fVerbose(0)
35-
, fEventManager(nullptr)
36-
, fq(nullptr)
37-
, fX(0.3)
38-
, fY(0.3)
39-
, fZ(0.3)
40-
, fTimeWindowPlus(0.)
41-
, fTimeWindowMinus(0.)
4235
{}
4336

4437
FairBoxSetDraw::FairBoxSetDraw(const char* name, FairDataSourceI* dataSource, Int_t iVerbose)
4538
: FairTask(name, iVerbose)
4639
, fVerbose(iVerbose)
47-
, fEventManager(nullptr)
48-
, fq(nullptr)
49-
, fX(0.3)
50-
, fY(0.3)
51-
, fZ(0.3)
52-
, fTimeWindowPlus(0.)
53-
, fTimeWindowMinus(0.)
5440
, fDataSource(dataSource)
5541
{}
5642

43+
FairBoxSetDraw::FairBoxSetDraw(const char* name, Int_t iVerbose)
44+
: FairTask(name, iVerbose)
45+
, fVerbose(iVerbose)
46+
, fDataSource(nullptr)
47+
{}
48+
5749
InitStatus FairBoxSetDraw::Init()
5850
{
5951
LOG(debug) << "FairBoxSetDraw::Init()";

eventdisplay/FairBoxSetDraw.h

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,18 @@ class FairBoxSetDraw : public FairTask
4545

4646
/** Standard constructor
4747
*@param name Name of task
48+
*@param dataSource Input source of the data to be displayed
4849
*@param iVerbose Verbosity level
4950
**/
5051
FairBoxSetDraw(const char* name, FairDataSourceI* dataSource, Int_t iVerbose = 1);
5152

53+
/** Legacy constructor
54+
* Sets the input dataSource to nullptr which sets it to read in TClonesArray
55+
*@param name Name of task
56+
*@param iVerbose Verbosity level
57+
**/
58+
FairBoxSetDraw(const char* name, Int_t iVerbose = 1);
59+
5260
/** Destructor **/
5361
virtual ~FairBoxSetDraw();
5462

@@ -87,12 +95,14 @@ class FairBoxSetDraw : public FairTask
8795
virtual Int_t GetValue(TObject* obj, Int_t i);
8896
virtual void AddBoxes(FairBoxSet* set, TObject* obj, Int_t i = 0);
8997

90-
FairEventManager* fEventManager; //!
91-
FairBoxSet* fq; //!
92-
Double_t fX, fY, fZ;
98+
FairEventManager* fEventManager = nullptr; //!
99+
FairBoxSet* fq = nullptr; //!
100+
Double_t fX{0.3};
101+
Double_t fY{0.3};
102+
Double_t fZ{0.3};
93103

94-
Double_t fTimeWindowPlus;
95-
Double_t fTimeWindowMinus;
104+
Double_t fTimeWindowPlus{0.};
105+
Double_t fTimeWindowMinus{0.};
96106
FairDataSourceI* fDataSource = nullptr;
97107

98108
private:

eventdisplay/FairHitDraw.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ FairHitDraw::FairHitDraw(const char* name, FairDataSourceI* dataSource, Int_t iV
2424
: FairBoxSetDraw(name, dataSource, iVerbose)
2525
{}
2626

27+
FairHitDraw::FairHitDraw(const char* name, Int_t iVerbose)
28+
: FairBoxSetDraw(name, iVerbose)
29+
{}
30+
2731
TVector3 FairHitDraw::GetVector(TObject* obj)
2832
{
2933
FairHit* hit = static_cast<FairHit*>(obj);

eventdisplay/FairHitDraw.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,17 @@ class FairHitDraw : public FairBoxSetDraw
3131

3232
/** Standard constructor
3333
*@param name Name of task
34+
*@param dataSource Input container for data to be displayed
3435
*@param iVerbose Verbosity level
3536
**/
36-
FairHitDraw(const char* name, FairDataSourceI* dataSource = nullptr, Int_t iVerbose = 1);
37+
FairHitDraw(const char* name, FairDataSourceI* dataSource, Int_t iVerbose = 1);
38+
39+
/** Legacy constructor
40+
*@param name Name of task
41+
*@param dataSource Input container for data to be displayed
42+
*@param iVerbose Verbosity level
43+
**/
44+
FairHitDraw(const char* name, Int_t iVerbose = 1);
3745

3846
protected:
3947
TVector3 GetVector(TObject* obj);

eventdisplay/FairHitPointSetDraw.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#ifndef FAIRHITPOINTSETDRAW_H_
1616
#define FAIRHITPOINTSETDRAW_H_
1717

18+
#include "FairDataSourceI.h"
1819
#include "FairPointSetDraw.h" // for FairPointSetDraw
1920

2021
#include <Rtypes.h> // for FairHitPointSetDraw::Class, etc

eventdisplay/FairPointSetDraw.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,23 @@ class FairPointSetDraw : public FairTask
3737

3838
/** Standard constructor
3939
*@param name Name of task
40+
*@param dataSource Input data container for data to be displayed
41+
*@param color Color of points
42+
*@param mstyle Style of points
4043
*@param iVerbose Verbosity level
4144
**/
42-
FairPointSetDraw(const char* name, Color_t color, Style_t mstyle, Int_t iVerbose = 1);
4345
FairPointSetDraw(const char* name, FairDataSourceI* dataSource, Color_t color, Style_t mstyle, Int_t iVerbose = 1);
4446

47+
/** Legacy constructor
48+
* Input data source will be set to nullptr which implicitly activates the read in via TClonesArray branch
49+
*@param name Name of task
50+
*@param color Color of points
51+
*@param mstyle Style of points
52+
*@param iVerbose Verbosity level
53+
**/
54+
55+
FairPointSetDraw(const char* name, Color_t color, Style_t mstyle, Int_t iVerbose = 1);
56+
4557
/** Destructor **/
4658
virtual ~FairPointSetDraw();
4759

@@ -64,7 +76,7 @@ class FairPointSetDraw : public FairTask
6476
virtual InitStatus Init();
6577
/** Action after each event**/
6678
virtual void Finish();
67-
TEvePointSet* fq; //!
79+
TEvePointSet* fq = nullptr; //!
6880
Color_t fColor; //!
6981
Style_t fStyle; //!
7082
Bool_t fUseTimeOffset = kTRUE; //!

0 commit comments

Comments
 (0)