forked from R3BRootGroup/R3BRoot
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathR3BSci8Mapped2CalPar.h
146 lines (124 loc) · 4.99 KB
/
R3BSci8Mapped2CalPar.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
/******************************************************************************
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
* Copyright (C) 2019 Members of R3B Collaboration *
* *
* This software is distributed under the terms of the *
* GNU General Public Licence (GPL) version 3, *
* copied verbatim in the file "LICENSE". *
* *
* In applying this license GSI does not waive the privileges and immunities *
* granted to it by virtue of its status as an Intergovernmental Organization *
* or submit itself to any jurisdiction. *
******************************************************************************/
// ----------------------------------------------------------------
// ----- Create time calib parameters for Sci8 via VFTX -----
// ------ Created August 7th by A. Kelic-Heil -----
// ----- Following R3BLosMapped2CalPar -----
// ----------------------------------------------------------------
#ifndef R3BSCI8MAPPED2CALPAR_H
#define R3BSCI8MAPPED2CALPAR_H
#include "FairTask.h"
class R3BTCalPar;
class TClonesArray;
class R3BEventHeader;
class R3BTCalEngine;
/**
* An analysis task for TCAL calibration of NeuLAND Tamex data.
* This class fills TDC distribution for each Photomultiplier
* of the NeuLAND detector and calculates the calibration
* parameters using the R3BTCalEngine.
* @author D. Kresan
* @since September 7, 2015
*/
class R3BSci8Mapped2CalPar : public FairTask
{
public:
/**
* Default constructor.
* Creates an instance of the task with default parameters.
*/
R3BSci8Mapped2CalPar();
/**
* Standard constructor.
* Creates an instance of the task.
* @param name a name of the task.
* @param iVerbose a verbosity level.
*/
R3BSci8Mapped2CalPar(const char* name, Int_t iVerbose = 1);
/**
* Destructor.
* Frees the memory used by the object.
*/
virtual ~R3BSci8Mapped2CalPar();
/**
* Method for task initialization.
* This function is called by the framework before
* the event loop.
* @return Initialization status. kSUCCESS, kERROR or kFATAL.
*/
virtual InitStatus Init();
/**
* Method for event loop implementation.
* Is called by the framework every time a new event is read.
* @param option an execution option.
*/
virtual void Exec(Option_t* option);
/**
* A method for finish of processing of an event.
* Is called by the framework for each event after executing
* the tasks.
*/
virtual void FinishEvent();
/**
* Method for finish of the task execution.
* Is called by the framework after processing the event loop.
*/
virtual void FinishTask();
/**
* Method for setting the update rate for control histograms
* @param rate an update rate value (events).
*/
inline void SetUpdateRate(Int_t rate) { fUpdateRate = rate; }
/**
* Method for setting minimum required statistics per module.
* Only detector modules with number of entries in TDC
* distribution greater than minimum statistics will be
* calibrated.
* @param minStats a value of minimum statistics required.
*/
inline void SetMinStats(Int_t minStats) { fMinStats = minStats; }
/**
* Method for selecting events with certain trigger value.
* @param trigger 1 - onspill, 2 - offspill, -1 - all events.
*/
inline void SetTrigger(Int_t trigger) { fTrigger = trigger; }
/**
* Method for setting number of SCI8 detectors and channels.
* @param nDets number of detectors.
* @param nCh number of channels per detector (4+master trigger?)
*/
inline void SetNofModules(Int_t nDets, Int_t nCh)
{
fNofDetectors = nDets;
fNofChannels = nCh; // = 2
fNofTypes = 3;
fNofModules = nDets * nCh * 3;
}
private:
Int_t fUpdateRate; /**< An update rate. */
Int_t fMinStats; /**< Minimum statistics required per module. */
Int_t fTrigger; /**< Trigger value. */
Int_t Icount[2][3]{};
UInt_t fNofDetectors; /**< Number of detectors. */
UInt_t fNofChannels; /**< Number of channels per detector. */
UInt_t fNofTypes = 3; /**< Number of time-types per channel (VFTX, TAMEX leading/trailing). */
UInt_t fNofModules; /**< Total number of modules (=edges) to calibrate */
Int_t fNEvents; /**< Event counter. */
R3BTCalPar* fCal_Par; /**< Parameter container. */
TClonesArray* fMapped; /**< Array with mapped data - input data. */
R3BEventHeader* header; /**< Event header - input data. */
R3BTCalEngine* fEngine; /**< Instance of the TCAL engine. */
public:
ClassDef(R3BSci8Mapped2CalPar, 1)
};
#endif