R3BROOT
R3B analysis software
Toggle main menu visibility
Loading...
Searching...
No Matches
R3BNeulandTcalFill.cxx
Go to the documentation of this file.
1
/******************************************************************************
2
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3
* Copyright (C) 2019-2025 Members of R3B Collaboration *
4
* *
5
* This software is distributed under the terms of the *
6
* GNU General Public Licence (GPL) version 3, *
7
* copied verbatim in the file "LICENSE". *
8
* *
9
* In applying this license GSI does not waive the privileges and immunities *
10
* granted to it by virtue of its status as an Intergovernmental Organization *
11
* or submit itself to any jurisdiction. *
12
******************************************************************************/
13
14
// ----------------------------------------------------------------
15
// ----- R3BNeulandTcalFill -----
16
// ----- Created 27-01-2015 by M.Heil -----
17
// ----------------------------------------------------------------
18
19
#include "
R3BNeulandTcalFill.h
"
20
#include "FairLogger.h"
21
#include "FairRootManager.h"
22
#include "FairRtdbRun.h"
23
#include "FairRunIdGenerator.h"
24
#include "FairRuntimeDb.h"
25
#include "
R3BEventHeader.h
"
26
#include "
R3BPaddleTamexMappedData.h
"
27
#include "R3BTCalEngine.h"
28
#include "R3BTCalPar.h"
29
#include "TClonesArray.h"
30
#include "TF1.h"
31
#include "TH1F.h"
32
#include <stdlib.h>
33
34
R3BNeulandTcalFill::R3BNeulandTcalFill
()
35
: FairTask(
"R3BNeulandTCalFill"
, 1)
36
,
fUpdateRate
(1000000)
37
,
fMinStats
(100000)
38
,
fTrigger
(-1)
39
,
fNofPlanes
(0)
40
,
fNofBars
(0)
41
,
fNof17
(0)
42
,
fNEvents
(0)
43
,
fCal_Par
(NULL)
44
{
45
}
46
47
R3BNeulandTcalFill::R3BNeulandTcalFill
(
const
char
* name, Int_t iVerbose)
48
: FairTask(name, iVerbose)
49
,
fUpdateRate
(1000000)
50
,
fMinStats
(100000)
51
,
fTrigger
(-1)
52
,
fNofPlanes
(0)
53
,
fNofBars
(0)
54
,
fNof17
(0)
55
,
fNEvents
(0)
56
,
fCal_Par
(NULL)
57
{
58
}
59
60
R3BNeulandTcalFill::~R3BNeulandTcalFill
()
61
{
62
if
(
fCal_Par
)
63
{
64
delete
fCal_Par
;
65
}
66
if
(
fEngine
)
67
{
68
delete
fEngine
;
69
}
70
}
71
72
InitStatus
R3BNeulandTcalFill::Init
()
73
{
74
FairRootManager* rm = FairRootManager::Instance();
75
if
(!rm)
76
{
77
return
kFATAL;
78
}
79
header
=
dynamic_cast<
R3BEventHeader
*
>
(rm->GetObject(
"EventHeader."
));
80
/* if (!header)
81
{
82
return kFATAL;
83
}*/
84
fHits
=
dynamic_cast<
TClonesArray*
>
(rm->GetObject(
"NeulandMappedData"
));
85
if
(!
fHits
)
86
{
87
return
kFATAL;
88
}
89
90
fCal_Par
=
dynamic_cast<
R3BTCalPar*
>
(FairRuntimeDb::instance()->getContainer(
"LandTCalPar"
));
91
fCal_Par
->setChanged();
92
93
fEngine
=
new
R3BTCalEngine(
fCal_Par
,
fMinStats
);
94
95
return
kSUCCESS;
96
}
97
98
void
R3BNeulandTcalFill::Exec
(Option_t*)
99
{
100
/* if (fTrigger >= 0)
101
{
102
if (header->GetTrigger() != fTrigger)
103
{
104
return;
105
}
106
}*/
107
108
Int_t nHits =
fHits
->GetEntries();
109
// LOG(info) << "number of hits:" << nHits << " " ;
110
111
/*
112
if (nHits > (fNofPMTs / 2))
113
{
114
return;
115
}
116
*/
117
118
R3BPaddleTamexMappedData
* hit;
119
Int_t iPlane;
120
Int_t iBar;
121
122
// Loop over mapped hits
123
for
(Int_t i = 0; i < nHits; i++)
124
{
125
hit =
dynamic_cast<
R3BPaddleTamexMappedData
*
>
(
fHits
->At(i));
126
if
(!hit)
127
{
128
continue
;
129
}
130
131
iPlane = hit->
GetPlaneId
();
132
iBar = hit->
GetBarId
();
133
134
if
(iPlane >
fNofPlanes
)
135
{
136
LOG(error) <<
"R3BNeulandTcalFill::Exec() : more planes then expected! Plane: "
<< iPlane;
137
continue
;
138
}
139
if
(iBar >
fNofBars
)
140
{
141
LOG(error) <<
"R3BNeulandTcalFill::Exec() : more bars then expected! Plane: "
<< iBar;
142
continue
;
143
}
144
145
// if (hit->Is17())
146
// {
147
// 17-th channel
148
// MH channel = fNofPMTs + hit->GetGtb() * 20 + hit->GetTacAddr();
149
// }
150
// else
151
// {
152
// PMT signal
153
// iSide = hit->GetSide();
154
155
// LOG(info) << "Plane: " << iPlane << " Bar: " << iBar << " Side: " << iSide << " Cal channel: " <<
156
// channel << " " ;
157
158
// }
159
160
// Fill TAC histogram
161
fEngine
->Fill(iPlane, iBar, 0, hit->
GetFineTime1LE
());
162
fEngine
->Fill(iPlane, iBar, 0 + 2, hit->
GetFineTime1TE
());
163
164
fEngine
->Fill(iPlane, iBar, 1, hit->
GetFineTime2LE
());
165
fEngine
->Fill(iPlane, iBar, 1 + 2, hit->
GetFineTime2TE
());
166
}
167
168
// Increment events
169
fNEvents
+= 1;
170
}
171
172
void
R3BNeulandTcalFill::FinishEvent
() {}
173
174
void
R3BNeulandTcalFill::FinishTask
() {
fEngine
->CalculateParamVFTX(); }
175
176
ClassImp
(
R3BNeulandTcalFill
)
R3BEventHeader.h
ClassImp
ClassImp(R3B::Neuland::Cal2HitPar)
R3BNeulandTcalFill.h
R3BPaddleTamexMappedData.h
R3BEventHeader
Definition
R3BEventHeader.h:23
R3BNeulandTcalFill
An analysis task for TCAL calibration of NeuLAND Tamex data.
Definition
R3BNeulandTcalFill.h:40
R3BNeulandTcalFill::fNofBars
Int_t fNofBars
Number of NeuLAND bars per plane.
Definition
R3BNeulandTcalFill.h:131
R3BNeulandTcalFill::~R3BNeulandTcalFill
~R3BNeulandTcalFill() override
Destructor.
Definition
R3BNeulandTcalFill.cxx:60
R3BNeulandTcalFill::fCal_Par
R3BTCalPar * fCal_Par
Parameter container.
Definition
R3BNeulandTcalFill.h:135
R3BNeulandTcalFill::fNof17
Int_t fNof17
Number of channels with stop signal.
Definition
R3BNeulandTcalFill.h:132
R3BNeulandTcalFill::fNEvents
Int_t fNEvents
Event counter.
Definition
R3BNeulandTcalFill.h:134
R3BNeulandTcalFill::fMinStats
Int_t fMinStats
Minimum statistics required per module.
Definition
R3BNeulandTcalFill.h:127
R3BNeulandTcalFill::R3BNeulandTcalFill
R3BNeulandTcalFill()
Default constructor.
Definition
R3BNeulandTcalFill.cxx:34
R3BNeulandTcalFill::Init
auto Init() -> InitStatus override
Method for task initialization.
Definition
R3BNeulandTcalFill.cxx:72
R3BNeulandTcalFill::fTrigger
Int_t fTrigger
Trigger value.
Definition
R3BNeulandTcalFill.h:128
R3BNeulandTcalFill::header
R3BEventHeader * header
Event header - input data.
Definition
R3BNeulandTcalFill.h:137
R3BNeulandTcalFill::Exec
void Exec(Option_t *option) override
Method for event loop implementation.
Definition
R3BNeulandTcalFill.cxx:98
R3BNeulandTcalFill::fHits
TClonesArray * fHits
Array with NeuLAND hits - input data.
Definition
R3BNeulandTcalFill.h:136
R3BNeulandTcalFill::fUpdateRate
Int_t fUpdateRate
An update rate.
Definition
R3BNeulandTcalFill.h:126
R3BNeulandTcalFill::FinishEvent
void FinishEvent() override
A method for finish of processing of an event.
Definition
R3BNeulandTcalFill.cxx:172
R3BNeulandTcalFill::fEngine
R3BTCalEngine * fEngine
Instance of the TCAL engine.
Definition
R3BNeulandTcalFill.h:139
R3BNeulandTcalFill::FinishTask
void FinishTask() override
Method for finish of the task execution.
Definition
R3BNeulandTcalFill.cxx:174
R3BNeulandTcalFill::fNofPlanes
Int_t fNofPlanes
Number of NeuLAND planes.
Definition
R3BNeulandTcalFill.h:130
R3BPaddleTamexMappedData
Definition
R3BPaddleTamexMappedData.h:20
R3BPaddleTamexMappedData::GetPlaneId
const Int_t & GetPlaneId() const
Definition
R3BPaddleTamexMappedData.h:26
R3BPaddleTamexMappedData::GetFineTime2LE
const Int_t & GetFineTime2LE() const
Definition
R3BPaddleTamexMappedData.h:37
R3BPaddleTamexMappedData::GetBarId
const Int_t & GetBarId() const
Definition
R3BPaddleTamexMappedData.h:27
R3BPaddleTamexMappedData::GetFineTime1LE
const Int_t & GetFineTime1LE() const
Definition
R3BPaddleTamexMappedData.h:32
R3BPaddleTamexMappedData::GetFineTime2TE
const Int_t & GetFineTime2TE() const
Definition
R3BPaddleTamexMappedData.h:39
R3BPaddleTamexMappedData::GetFineTime1TE
const Int_t & GetFineTime1TE() const
Definition
R3BPaddleTamexMappedData.h:34
neuland
unpack
R3BNeulandTcalFill.cxx
Generated by
1.18.0