R3BROOT
R3B analysis software
Toggle main menu visibility
Loading...
Searching...
No Matches
R3BNeulandMappingPar.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
// ----- R3BTofDMappingPar source file -----
16
// ----- Created 18/03/22 by J.L. Rodriguez-Sanchez -----
17
// -------------------------------------------------------------
18
19
#include "
R3BNeulandMappingPar.h
"
20
21
#include "FairParamList.h"
22
#include "
R3BLogger.h
"
23
24
#include "TMath.h"
25
#include "TString.h"
26
27
// ---- Standard Constructor ---------------------------------------------------
28
R3BNeulandMappingPar::R3BNeulandMappingPar
(
const
TString& name,
const
TString& title,
const
TString& context)
29
: FairParGenericSet(name, title, context)
30
,
fNumPlanes
(60)
31
,
fNumPaddles
(50)
32
,
fNumPmts
(2)
33
{
34
for
(Int_t p = 0; p <
fNumPmts
; p++)
35
{
36
fTrigmap
[p].resize(
fNumPlanes
);
37
}
38
for
(Int_t plane = 0; plane <
fNumPlanes
; plane++)
39
for
(Int_t p = 0; p <
fNumPmts
; p++)
40
{
41
fTrigmap
[p][plane] =
new
TArrayI(
fNumPaddles
);
42
for
(Int_t paddle = 0; paddle <
fNumPaddles
; paddle++)
43
fTrigmap
[p][plane]->AddAt(0, paddle);
44
}
45
}
46
47
// ---- Destructor ------------------------------------------------------------
48
R3BNeulandMappingPar::~R3BNeulandMappingPar
()
49
{
50
clear
();
51
for
(Int_t plane = 0; plane <
fNumPlanes
; plane++)
52
for
(Int_t p = 0; p <
fNumPmts
; p++)
53
{
54
if
(
fTrigmap
[p][plane])
55
delete
fTrigmap
[p][plane];
56
}
57
}
58
59
// ---- Method clear ----------------------------------------------------------
60
void
R3BNeulandMappingPar::clear
()
61
{
62
status = kFALSE;
63
resetInputVersions();
64
}
65
66
// ---- Method putParams ------------------------------------------------------
67
void
R3BNeulandMappingPar::putParams
(FairParamList* list)
68
{
69
R3BLOG
(info,
"called"
);
70
if
(!list)
71
{
72
R3BLOG
(fatal,
"FairParamList not found"
);
73
return
;
74
}
75
list->add(
"neulandPlanesPar"
,
fNumPlanes
);
76
list->add(
"neulandPaddlesPar"
,
fNumPaddles
);
77
78
R3BLOG
(info,
"Nb of planes: "
<<
fNumPlanes
);
79
R3BLOG
(info,
"Nb of paddles: "
<<
fNumPaddles
);
80
81
for
(Int_t p = 0; p <
fNumPmts
; p++)
82
{
83
fTrigmap
[p].resize(
fNumPlanes
);
84
}
85
char
name[300];
86
for
(Int_t plane = 0; plane <
fNumPlanes
; plane++)
87
for
(Int_t p = 0; p <
fNumPmts
; p++)
88
{
89
fTrigmap
[p][plane]->Set(
fNumPaddles
);
90
sprintf(name,
"neulandplane%dPmt%dPar"
, plane + 1, p + 1);
91
list->add(name, *
fTrigmap
[p][plane]);
92
}
93
}
94
95
// ---- Method getParams ------------------------------------------------------
96
Bool_t
R3BNeulandMappingPar::getParams
(FairParamList* list)
97
{
98
R3BLOG
(info,
"called"
);
99
if
(!list)
100
{
101
R3BLOG
(fatal,
"FairParamList not found"
);
102
return
kFALSE;
103
}
104
if
(!list->fill(
"neulandPlanesPar"
, &
fNumPlanes
))
105
{
106
R3BLOG
(info,
"Could not initialize neulandPlanesPar"
);
107
return
kFALSE;
108
}
109
if
(!list->fill(
"neulandPaddlesPar"
, &
fNumPaddles
))
110
{
111
R3BLOG
(info,
"Could not initialize neulandPaddlesPar"
);
112
return
kFALSE;
113
}
114
115
for
(Int_t p = 0; p <
fNumPmts
; p++)
116
{
117
fTrigmap
[p].resize(
fNumPlanes
);
118
}
119
char
name[300];
120
for
(Int_t plane = 0; plane <
fNumPlanes
; plane++)
121
for
(Int_t p = 0; p <
fNumPmts
; p++)
122
{
123
fTrigmap
[p][plane]->Set(
fNumPaddles
);
124
sprintf(name,
"neulandplane%dPmt%dPar"
, plane + 1, p + 1);
125
126
if
(!(list->fill(name,
fTrigmap
[p][plane])))
127
{
128
R3BLOG
(error,
"Could not initialize "
<< name);
129
return
kFALSE;
130
}
131
}
132
133
return
kTRUE;
134
}
135
136
// ---- Method print ----------------------------------------------------------
137
void
R3BNeulandMappingPar::print
() {
printParams
(); }
138
139
// ---- Method printParams ----------------------------------------------------
140
void
R3BNeulandMappingPar::printParams
()
141
{
142
R3BLOG
(info,
"Mapping params for Neuland: Num of planes: "
<<
fNumPlanes
<<
" and paddles: "
<<
fNumPaddles
);
143
144
for
(Int_t plane = 0; plane <
fNumPlanes
; plane++)
145
for
(Int_t p = 0; p <
fNumPmts
; p++)
146
for
(Int_t paddle = 0; paddle <
fNumPaddles
; paddle++)
147
{
148
R3BLOG
(info,
149
"Plane: "
<< plane + 1 <<
", pmt: "
<< p + 1 <<
", paddle: "
<< paddle + 1
150
<<
", value: "
<<
fTrigmap
[p][plane]->GetAt(paddle));
151
}
152
}
153
154
ClassImp
(
R3BNeulandMappingPar
);
R3BLogger.h
R3BLOG
#define R3BLOG(severity, x)
Definition
R3BLogger.h:33
ClassImp
ClassImp(R3B::Neuland::Cal2HitPar)
R3BNeulandMappingPar.h
R3BNeulandMappingPar
Definition
R3BNeulandMappingPar.h:33
R3BNeulandMappingPar::fTrigmap
std::vector< TArrayI * > fTrigmap[2]
Definition
R3BNeulandMappingPar.h:77
R3BNeulandMappingPar::~R3BNeulandMappingPar
virtual ~R3BNeulandMappingPar()
Destructor.
Definition
R3BNeulandMappingPar.cxx:48
R3BNeulandMappingPar::fNumPlanes
Int_t fNumPlanes
Definition
R3BNeulandMappingPar.h:74
R3BNeulandMappingPar::fNumPmts
Int_t fNumPmts
Definition
R3BNeulandMappingPar.h:76
R3BNeulandMappingPar::fNumPaddles
Int_t fNumPaddles
Definition
R3BNeulandMappingPar.h:75
R3BNeulandMappingPar::putParams
virtual void putParams(FairParamList *list)
Store all parameters using FairRuntimeDB.
Definition
R3BNeulandMappingPar.cxx:67
R3BNeulandMappingPar::printParams
void printParams()
Definition
R3BNeulandMappingPar.cxx:140
R3BNeulandMappingPar::getParams
Bool_t getParams(FairParamList *list)
Retrieve all parameters using FairRuntimeDB.
Definition
R3BNeulandMappingPar.cxx:96
R3BNeulandMappingPar::print
virtual void print()
Print values of parameters to the standard output.
Definition
R3BNeulandMappingPar.cxx:137
R3BNeulandMappingPar::clear
virtual void clear()
Reset all parameters.
Definition
R3BNeulandMappingPar.cxx:60
R3BNeulandMappingPar::R3BNeulandMappingPar
R3BNeulandMappingPar(const TString &name="neulandMappingPar", const TString &title="Neuland Mapping parameters", const TString &context="neulandMappingContext")
Standard constructor.
Definition
R3BNeulandMappingPar.cxx:28
neuland
calibration
legacy
R3BNeulandMappingPar.cxx
Generated by
1.18.0