R3BROOT
R3B analysis software
Toggle main menu visibility
Loading...
Searching...
No Matches
R3BNeulandTacquilaMapped2CalPar.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
#include "
R3BNeulandTacquilaMapped2CalPar.h
"
15
#include "FairLogger.h"
16
#include "FairRootManager.h"
17
#include "FairRtdbRun.h"
18
#include "FairRunIdGenerator.h"
19
#include "FairRuntimeDb.h"
20
#include "
R3BEventHeader.h
"
21
#include "
R3BNeulandTacquilaMappedData.h
"
22
#include "R3BTCalEngine.h"
23
#include "R3BTCalPar.h"
24
#include "TClonesArray.h"
25
#include "TF1.h"
26
#include "TH1F.h"
27
#include <stdlib.h>
28
29
R3BNeulandTacquilaMapped2CalPar::R3BNeulandTacquilaMapped2CalPar
()
30
:
fUpdateRate
(1000000)
31
,
fMinStats
(100000)
32
,
fTrigger
(-1)
33
,
fNofPMTs
(0)
34
,
fNEvents
(0)
35
,
fCal_Par
(NULL)
36
{
37
}
38
39
R3BNeulandTacquilaMapped2CalPar::R3BNeulandTacquilaMapped2CalPar
(
const
char
* name, Int_t iVerbose)
40
: FairTask(name, iVerbose)
41
,
fUpdateRate
(1000000)
42
,
fMinStats
(100000)
43
,
fTrigger
(-1)
44
,
fNofPMTs
(0)
45
,
fNEvents
(0)
46
,
fCal_Par
(NULL)
47
{
48
}
49
50
R3BNeulandTacquilaMapped2CalPar::~R3BNeulandTacquilaMapped2CalPar
()
51
{
52
if
(
fCal_Par
)
53
{
54
delete
fCal_Par
;
55
}
56
if
(
fEngine
)
57
{
58
delete
fEngine
;
59
}
60
}
61
62
InitStatus
R3BNeulandTacquilaMapped2CalPar::Init
()
63
{
64
FairRootManager* rm = FairRootManager::Instance();
65
if
(!rm)
66
{
67
return
kFATAL;
68
}
69
header
=
dynamic_cast<
R3BEventHeader
*
>
(rm->GetObject(
"EventHeader."
));
70
if
(!
header
)
71
{
72
return
kFATAL;
73
}
74
fHits
=
dynamic_cast<
TClonesArray*
>
(rm->GetObject(
"NeulandTacquilaMappedData"
));
75
if
(!
fHits
)
76
{
77
return
kFATAL;
78
}
79
80
fCal_Par
=
dynamic_cast<
R3BTCalPar*
>
(FairRuntimeDb::instance()->getContainer(
"LandTCalPar"
));
81
fCal_Par
->setChanged();
82
83
fEngine
=
new
R3BTCalEngine(
fCal_Par
,
fMinStats
);
84
85
return
kSUCCESS;
86
}
87
88
void
R3BNeulandTacquilaMapped2CalPar::Exec
(Option_t* option)
89
{
90
if
(
fTrigger
>= 0)
91
{
92
if
(
header
->
GetTrigger
() !=
fTrigger
)
93
{
94
return
;
95
}
96
}
97
98
Int_t nHits =
fHits
->GetEntries();
99
if
(nHits > (
fNofPMTs
/ 2))
100
{
101
return
;
102
}
103
104
R3BNeulandTacquilaMappedData
* hit;
105
Int_t iPlane;
106
Int_t iPaddle;
107
Int_t iSide;
108
109
// Loop over mapped hits
110
for
(Int_t i = 0; i < nHits; i++)
111
{
112
hit =
dynamic_cast<
R3BNeulandTacquilaMappedData
*
>
(
fHits
->At(i));
113
if
(!hit)
114
{
115
continue
;
116
}
117
118
// Check bar ID
119
iPlane = hit->
GetPlane
();
120
iPaddle = hit->
GetPaddle
();
121
iSide = hit->
GetSide
();
122
123
// Fill TAC histogram
124
fEngine
->Fill(iPlane, iPaddle, iSide, hit->
GetTacData
());
125
fEngine
->Fill(iPlane, iPaddle, iSide + 2, hit->
GetStopT
());
126
}
127
128
// Increment events
129
fNEvents
+= 1;
130
}
131
132
void
R3BNeulandTacquilaMapped2CalPar::FinishEvent
() {}
133
134
void
R3BNeulandTacquilaMapped2CalPar::FinishTask
() {
fEngine
->CalculateParamTacquila(); }
135
136
ClassImp
(
R3BNeulandTacquilaMapped2CalPar
)
R3BEventHeader.h
ClassImp
ClassImp(R3B::Neuland::Cal2HitPar)
R3BNeulandTacquilaMapped2CalPar.h
R3BNeulandTacquilaMappedData.h
R3BEventHeader
Definition
R3BEventHeader.h:23
R3BEventHeader::GetTrigger
int GetTrigger() const
Definition
R3BEventHeader.h:42
R3BNeulandTacquilaMapped2CalPar
An analysis task for TCAL calibration of NeuLAND data.
Definition
R3BNeulandTacquilaMapped2CalPar.h:33
R3BNeulandTacquilaMapped2CalPar::FinishEvent
virtual void FinishEvent()
A method for finish of processing of an event.
Definition
R3BNeulandTacquilaMapped2CalPar.cxx:132
R3BNeulandTacquilaMapped2CalPar::fNofPMTs
Int_t fNofPMTs
Number of NeuLAND modules.
Definition
R3BNeulandTacquilaMapped2CalPar.h:116
R3BNeulandTacquilaMapped2CalPar::Exec
virtual void Exec(Option_t *option)
Method for event loop implementation.
Definition
R3BNeulandTacquilaMapped2CalPar.cxx:88
R3BNeulandTacquilaMapped2CalPar::fCal_Par
R3BTCalPar * fCal_Par
Parameter container.
Definition
R3BNeulandTacquilaMapped2CalPar.h:119
R3BNeulandTacquilaMapped2CalPar::R3BNeulandTacquilaMapped2CalPar
R3BNeulandTacquilaMapped2CalPar()
Default constructor.
Definition
R3BNeulandTacquilaMapped2CalPar.cxx:29
R3BNeulandTacquilaMapped2CalPar::fHits
TClonesArray * fHits
Array with NeuLAND hits - input data.
Definition
R3BNeulandTacquilaMapped2CalPar.h:120
R3BNeulandTacquilaMapped2CalPar::fTrigger
Int_t fTrigger
Trigger value.
Definition
R3BNeulandTacquilaMapped2CalPar.h:114
R3BNeulandTacquilaMapped2CalPar::~R3BNeulandTacquilaMapped2CalPar
virtual ~R3BNeulandTacquilaMapped2CalPar()
Destructor.
Definition
R3BNeulandTacquilaMapped2CalPar.cxx:50
R3BNeulandTacquilaMapped2CalPar::fUpdateRate
Int_t fUpdateRate
An update rate.
Definition
R3BNeulandTacquilaMapped2CalPar.h:112
R3BNeulandTacquilaMapped2CalPar::FinishTask
virtual void FinishTask()
Method for finish of the task execution.
Definition
R3BNeulandTacquilaMapped2CalPar.cxx:134
R3BNeulandTacquilaMapped2CalPar::header
R3BEventHeader * header
Event header - input data.
Definition
R3BNeulandTacquilaMapped2CalPar.h:121
R3BNeulandTacquilaMapped2CalPar::Init
virtual InitStatus Init()
Method for task initialization.
Definition
R3BNeulandTacquilaMapped2CalPar.cxx:62
R3BNeulandTacquilaMapped2CalPar::fNEvents
Int_t fNEvents
Event counter.
Definition
R3BNeulandTacquilaMapped2CalPar.h:118
R3BNeulandTacquilaMapped2CalPar::fEngine
R3BTCalEngine * fEngine
Instance of the TCAL engine.
Definition
R3BNeulandTacquilaMapped2CalPar.h:123
R3BNeulandTacquilaMapped2CalPar::fMinStats
Int_t fMinStats
Minimum statistics required per module.
Definition
R3BNeulandTacquilaMapped2CalPar.h:113
R3BNeulandTacquilaMappedData
Definition
R3BNeulandTacquilaMappedData.h:21
R3BNeulandTacquilaMappedData::GetSide
Int_t GetSide() const
Definition
R3BNeulandTacquilaMappedData.h:38
R3BNeulandTacquilaMappedData::GetPlane
Int_t GetPlane() const
Definition
R3BNeulandTacquilaMappedData.h:36
R3BNeulandTacquilaMappedData::GetStopT
UShort_t GetStopT() const
Definition
R3BNeulandTacquilaMappedData.h:34
R3BNeulandTacquilaMappedData::GetTacData
UShort_t GetTacData() const
Definition
R3BNeulandTacquilaMappedData.h:33
R3BNeulandTacquilaMappedData::GetPaddle
Int_t GetPaddle() const
Definition
R3BNeulandTacquilaMappedData.h:37
neuland
calibration
legacy
R3BNeulandTacquilaMapped2CalPar.cxx
Generated by
1.18.0