Skip to content

Commit 75ba7e3

Browse files
committed
feat(tofd/pars):Update R3BTofDMapped2CalPar
1 parent 68b23a2 commit 75ba7e3

2 files changed

Lines changed: 32 additions & 42 deletions

File tree

tofd/pars/R3BTofDMapped2CalPar.cxx

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
#include "R3BTofDMapped2CalPar.h"
2020
#include <FairRootManager.h>
2121

22-
#include "TClonesArray.h"
22+
#include <TClonesArray.h>
2323

24-
#include "FairLogger.h"
25-
#include "FairRuntimeDb.h"
24+
#include <FairLogger.h>
25+
#include <FairRuntimeDb.h>
2626

2727
#include "R3BLogger.h"
2828
#include "R3BTCalEngine.h"
@@ -34,17 +34,8 @@ R3BTofDMapped2CalPar::R3BTofDMapped2CalPar()
3434
{
3535
}
3636

37-
R3BTofDMapped2CalPar::R3BTofDMapped2CalPar(const char* name, Int_t iVerbose)
37+
R3BTofDMapped2CalPar::R3BTofDMapped2CalPar(const char* name, int iVerbose)
3838
: FairTask(name, iVerbose)
39-
, fUpdateRate(1000000)
40-
, fMinStats(1)
41-
, fNofPlanes(4)
42-
, fPaddlesPerPlane(44)
43-
, fNofModules(fNofPlanes * fPaddlesPerPlane * 4)
44-
, fCalPar(nullptr)
45-
, fMapped(nullptr)
46-
, fMappedTrigger(nullptr)
47-
, fEngine(nullptr)
4839
{
4940
}
5041

@@ -94,8 +85,8 @@ InitStatus R3BTofDMapped2CalPar::Init()
9485

9586
fEngine = new R3BTCalEngine(fCalPar, fMinStats);
9687

97-
for (UInt_t d = 0; d < 5; d++)
98-
for (UInt_t i = 0; i < 48; i++)
88+
for (UInt_t d = 0; d < fNofPlanes; d++)
89+
for (UInt_t i = 0; i < fPaddlesPerPlane; i++)
9990
for (UInt_t k = 0; k < 4; k++)
10091
{
10192
Icount[d][i][k] = 0;
@@ -104,7 +95,7 @@ InitStatus R3BTofDMapped2CalPar::Init()
10495
return kSUCCESS;
10596
}
10697

107-
void R3BTofDMapped2CalPar::Exec(Option_t* option)
98+
void R3BTofDMapped2CalPar::Exec(Option_t*)
10899
{
109100
Int_t nHits = fMapped->GetEntriesFast();
110101
// Loop over mapped hits
@@ -156,12 +147,11 @@ void R3BTofDMapped2CalPar::FinishTask()
156147
{
157148
fEngine->CalculateParamVFTX();
158149
fCalPar->setChanged();
159-
fCalPar->printParams();
160150

161151
R3BLOG(info, "Calibration of TofD detector");
162-
for (Int_t p = 0; p < 5; p++)
163-
for (Int_t i = 0; i < 48; i++)
164-
for (Int_t k = 0; k < 4; k++)
152+
for (size_t p = 0; p < fNofPlanes; p++)
153+
for (size_t i = 0; i < fPaddlesPerPlane; i++)
154+
for (size_t k = 0; k < 4; k++)
165155
if (Icount[p][i][k] > fMinStats)
166156
{
167157
if (p < 4)
@@ -175,9 +165,9 @@ void R3BTofDMapped2CalPar::FinishTask()
175165
}
176166
}
177167

178-
void R3BTofDMapped2CalPar::SetUpdateRate(Int_t rate) { fUpdateRate = rate; }
168+
void R3BTofDMapped2CalPar::SetUpdateRate(UInt_t rate) { fUpdateRate = rate; }
179169

180-
void R3BTofDMapped2CalPar::SetMinStats(Int_t minStats) { fMinStats = minStats; }
170+
void R3BTofDMapped2CalPar::SetMinStats(UInt_t minStats) { fMinStats = minStats; }
181171

182172
void R3BTofDMapped2CalPar::SetNofModules(Int_t nDets, Int_t nCh)
183173
{
@@ -186,4 +176,4 @@ void R3BTofDMapped2CalPar::SetNofModules(Int_t nDets, Int_t nCh)
186176
fNofModules = nDets * nCh * 4;
187177
}
188178

189-
ClassImp(R3BTofDMapped2CalPar);
179+
ClassImp(R3BTofDMapped2CalPar)

tofd/pars/R3BTofDMapped2CalPar.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#pragma once
2020

21-
#include "FairTask.h"
21+
#include <FairTask.h>
2222

2323
class R3BTCalPar;
2424
class TClonesArray;
@@ -40,7 +40,7 @@ class R3BTofDMapped2CalPar : public FairTask
4040
* @param name a name of the task.
4141
* @param iVerbose a verbosity level.
4242
*/
43-
R3BTofDMapped2CalPar(const char*, Int_t = 1);
43+
explicit R3BTofDMapped2CalPar(const char*, int = 1);
4444

4545
/**
4646
* Destructor.
@@ -54,26 +54,26 @@ class R3BTofDMapped2CalPar : public FairTask
5454
* the event loop.
5555
* @return Initialization status. kSUCCESS, kERROR or kFATAL.
5656
*/
57-
InitStatus Init();
57+
InitStatus Init() override;
5858

5959
/**
6060
* Method for event loop implementation.
6161
* Is called by the framework every time a new event is read.
6262
* @param option an execution option.
6363
*/
64-
void Exec(Option_t*);
64+
void Exec(Option_t*) override;
6565

6666
/**
6767
* Method for finish of the task execution.
6868
* Is called by the framework after processing the event loop.
6969
*/
70-
void FinishTask();
70+
void FinishTask() override;
7171

7272
/**
7373
* Method for setting the update rate for control histograms
7474
* @param rate an update rate value (events).
7575
*/
76-
void SetUpdateRate(Int_t);
76+
inline void SetUpdateRate(UInt_t);
7777

7878
/**
7979
* Method for setting minimum required statistics per module.
@@ -82,28 +82,28 @@ class R3BTofDMapped2CalPar : public FairTask
8282
* calibrated.
8383
* @param minStats a value of minimum statistics required.
8484
*/
85-
void SetMinStats(Int_t);
85+
inline void SetMinStats(UInt_t);
8686

8787
/**
8888
* Method for setting number of TofD detectors and paddles.
8989
*/
90-
void SetNofModules(Int_t, Int_t);
90+
inline void SetNofModules(Int_t, Int_t);
9191

9292
private:
93-
Int_t fUpdateRate; /**< An update rate. */
94-
Int_t fMinStats; /**< Minimum statistics required per module. */
95-
Int_t Icount[5][48][4];
93+
UInt_t fUpdateRate = 1000000; // An update rate
94+
UInt_t fMinStats = 100; // Minimum statistics required per module
95+
UInt_t Icount[5][48][4]; // NOLINT
9696

97-
UInt_t fNofPlanes; /**< Number of planes. */
98-
UInt_t fPaddlesPerPlane; /**< Number of bars per plane. */
99-
UInt_t fNofModules; /**< Total number of modules (=edges) to calibrate */
97+
UInt_t fNofPlanes = 5;
98+
UInt_t fPaddlesPerPlane = 48;
99+
UInt_t fNofModules = fNofPlanes * fPaddlesPerPlane * 4;
100100

101-
R3BTCalPar* fCalPar; /**< Parameter container. */
102-
TClonesArray* fMapped; /**< Array with mapped data - input data. */
103-
TClonesArray* fMappedTrigger; /**< Array with mapped trigger data - input data. */
101+
R3BTCalPar* fCalPar = nullptr;
102+
TClonesArray* fMapped = nullptr;
103+
TClonesArray* fMappedTrigger = nullptr;
104104

105-
R3BTCalEngine* fEngine; /**< Instance of the TCAL engine. */
105+
R3BTCalEngine* fEngine = nullptr;
106106

107107
public:
108-
ClassDef(R3BTofDMapped2CalPar, 1)
108+
ClassDefOverride(R3BTofDMapped2CalPar, 1); // NOLINT
109109
};

0 commit comments

Comments
 (0)