Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Guillaume Baulieu
agapro
Commits
098576b3
Commit
098576b3
authored
Feb 07, 2020
by
J. Dudouet
Browse files
Clean the code using clang-tidy and clazy
parent
afc65a10
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
134 additions
and
155 deletions
+134
-155
common/commonDefs.h
common/commonDefs.h
+1
-1
consumers/TreeBuilder/AGAPRO_TB_AGATA.cpp
consumers/TreeBuilder/AGAPRO_TB_AGATA.cpp
+96
-109
consumers/TreeBuilder/AGAPRO_TB_AGATA.h
consumers/TreeBuilder/AGAPRO_TB_AGATA.h
+7
-2
consumers/TreeBuilder/AGAPRO_TreeBuilder.cpp
consumers/TreeBuilder/AGAPRO_TreeBuilder.cpp
+26
-39
consumers/TreeBuilder/AGAPRO_TreeBuilder.h
consumers/TreeBuilder/AGAPRO_TreeBuilder.h
+4
-4
No files found.
common/commonDefs.h
View file @
098576b3
...
...
@@ -47,7 +47,7 @@
#endif
#if defined(OS_TYPE)
#if !(OS_TYPE == OS_LINUX) && !(OS_TYPE == OS_WINDOWS) && !(OS_TYPE == OS_CYGWIN)
#if !(OS_TYPE == OS_LINUX) && !(OS_TYPE == OS_WINDOWS) && !(OS_TYPE == OS_CYGWIN)
&& !(OS_TYPE == OS_APPLE)
#error OS_TYPE should be either OS_LINUX or OS_WINDOWS or OS_CYGWIN or OS_APPLE
#endif
#else
...
...
consumers/TreeBuilder/AGAPRO_TB_AGATA.cpp
View file @
098576b3
...
...
@@ -22,6 +22,7 @@
#include "AGAPRO_TB_AGATA.h"
#endif
#include <utility>
#include <algorithm>
#include "TrackedFrame.h"
...
...
@@ -32,14 +33,12 @@ using namespace AGAPRO;
/// ****** CRYSTAL ******///
TB_AGATA_CRYSTAL
::
TB_AGATA_CRYSTAL
(
TString
name
,
TString
ADFKey
)
:
TB_Detector
(
name
,
ADFKey
)
TB_AGATA_CRYSTAL
::
TB_AGATA_CRYSTAL
(
TString
name
,
TString
ADFKey
)
:
TB_Detector
(
move
(
name
),
move
(
ADFKey
)
)
{
gActualClass
=
"TB_AGATA_CRYSTAL"
;
}
TB_AGATA_CRYSTAL
::~
TB_AGATA_CRYSTAL
()
{
}
TB_AGATA_CRYSTAL
::~
TB_AGATA_CRYSTAL
()
=
default
;
void
TB_AGATA_CRYSTAL
::
Init
()
{
...
...
@@ -112,9 +111,9 @@ void TB_AGATA_CRYSTAL::Process(Int_t idet)
fSFrame
=
fTrigger
->
GetInputSharedFP
();
fSFrame
->
GetFrame
()
->
Read
();
CrystalInterface
*
data
=
GetDataPointer
<
CrystalInterface
>
(
fSFrame
);
auto
*
data
=
GetDataPointer
<
CrystalInterface
>
(
fSFrame
);
crystalTS
=
(
(
AgataKey
*
)
fSFrame
->
GetFrame
()
->
GetKey
())
->
GetTimeStamp
();
crystalTS
=
(
dynamic_cast
<
AgataKey
*
>
(
fSFrame
->
GetFrame
()
->
GetKey
())
)
->
GetTimeStamp
();
crystalId
=
data
->
GetUID
();
if
(
!
WarnedDone
&&
data
&&
data
->
GetCore
(
0
)
->
GetSignal
()
->
GetLength
()
!=
fTraceLenght
)
{
...
...
@@ -143,14 +142,12 @@ void TB_AGATA_CRYSTAL::Process(Int_t idet)
/// ****** PSA ******///
TB_AGATA_PSA
::
TB_AGATA_PSA
(
TString
name
,
TString
ADFKey
)
:
TB_Detector
(
name
,
ADFKey
)
TB_AGATA_PSA
::
TB_AGATA_PSA
(
TString
name
,
TString
ADFKey
)
:
TB_Detector
(
move
(
name
),
move
(
ADFKey
)
)
{
gActualClass
=
"TB_AGATA_PSA"
;
}
TB_AGATA_PSA
::~
TB_AGATA_PSA
()
{
}
TB_AGATA_PSA
::~
TB_AGATA_PSA
()
=
default
;
void
TB_AGATA_PSA
::
Init
()
{
...
...
@@ -211,7 +208,7 @@ void TB_AGATA_PSA::Process(Int_t idet)
fSFrame
=
fTrigger
->
GetInputSharedFP
();
fSFrame
->
GetFrame
()
->
Read
();
PSAInterface
*
data
=
GetDataPointer
<
PSAInterface
>
(
fSFrame
);
auto
*
data
=
GetDataPointer
<
PSAInterface
>
(
fSFrame
);
nbHits
=
data
->
GetNbHits
();
...
...
@@ -227,13 +224,11 @@ void TB_AGATA_PSA::Process(Int_t idet)
coreE1
=
data
->
GetE
(
1
);
coreT0
=
data
->
GetT
(
0
);
coreT1
=
data
->
GetT
(
1
);
coreTS
=
((
AgataKey
*
)
fSFrame
->
GetFrame
()
->
GetKey
())
->
GetTimeStamp
();
coreTS
=
((
AgataKey
*
)
fSFrame
->
GetFrame
()
->
GetKey
())
->
GetTimeStamp
();
coreTS
=
dynamic_cast
<
AgataKey
*>
(
fSFrame
->
GetFrame
()
->
GetKey
())
->
GetTimeStamp
();
// Loop on the hits
for
(
Int_t
j
=
0
;
j
<
nbHits
;
++
j
)
{
const
PSAHit
*
pHit
=
(
PSAHit
*
)
data
->
GetHit
(
j
);
const
PSAHit
*
pHit
=
dynamic_cast
<
PSAHit
*>
(
data
->
GetHit
(
j
)
)
;
hitE
[
j
]
=
pHit
->
GetE
();
hitX
[
j
]
=
pHit
->
GetX
();
...
...
@@ -256,14 +251,12 @@ void TB_AGATA_PSA::Process(Int_t idet)
/// ****** Builder CRYSTAL ******///
TB_AGATA_Builder_CRYSTAL
::
TB_AGATA_Builder_CRYSTAL
(
TString
name
,
TString
ADFKey
)
:
TB_Detector
(
name
,
ADFKey
)
TB_AGATA_Builder_CRYSTAL
::
TB_AGATA_Builder_CRYSTAL
(
TString
name
,
TString
ADFKey
)
:
TB_Detector
(
move
(
name
),
move
(
ADFKey
)
)
{
gActualClass
=
"TB_AGATA_Builder_CRYSTAL"
;
}
TB_AGATA_Builder_CRYSTAL
::~
TB_AGATA_Builder_CRYSTAL
()
{
}
TB_AGATA_Builder_CRYSTAL
::~
TB_AGATA_Builder_CRYSTAL
()
=
default
;
void
TB_AGATA_Builder_CRYSTAL
::
Init
()
{
...
...
@@ -339,13 +332,13 @@ void TB_AGATA_Builder_CRYSTAL::Process(Int_t idet)
Log
.
SetProcessMethod
(
Form
(
"Process(%d)"
,
idet
));
if
(
!
fMergerMode
)
fCompFrame
=
(
AgataCompositeFrame
*
)
fTrigger
->
GetInputSharedFP
()
->
GetFrame
();
fCompFrame
=
dynamic_cast
<
AgataCompositeFrame
*
>
(
fTrigger
->
GetInputSharedFP
()
->
GetFrame
()
)
;
else
fCompFrame
=
(
AgataCompositeFrame
*
)
fTrigger
->
GetInputSharedFP
(
idet
+
1
)
->
GetFrame
();
fCompFrame
=
dynamic_cast
<
AgataCompositeFrame
*
>
(
fTrigger
->
GetInputSharedFP
(
idet
+
1
)
->
GetFrame
()
)
;
fCompFrame
->
Scan
();
EvtCrystalTS
=
((
AgataKey
*
)
fCompFrame
->
GetKey
())
->
GetTimeStamp
();
EvtCrystalTS
=
dynamic_cast
<
AgataKey
*>
(
fCompFrame
->
GetKey
())
->
GetTimeStamp
();
nbCrystals
=
fCompFrame
->
GetNbSubFrame
();
...
...
@@ -359,14 +352,14 @@ void TB_AGATA_Builder_CRYSTAL::Process(Int_t idet)
fCompFrame
->
LinkSubFrame
(
i
,
fSFrame
->
GetFrame
());
fSFrame
->
GetFrame
()
->
Read
();
CrystalInterface
*
data
=
GetDataPointer
<
CrystalInterface
>
(
fSFrame
);
auto
*
data
=
GetDataPointer
<
CrystalInterface
>
(
fSFrame
);
if
(
!
WarnedDone
&&
data
&&
data
->
GetCore
(
0
)
->
GetSignal
()
->
GetLength
()
!=
fTraceLenght
)
{
Log
<<
error
<<
" Signal length: "
<<
data
->
GetCore
(
0
)
->
GetSignal
()
->
GetLength
()
<<
" ; Stored length in tree: "
<<
fTraceLenght
<<
nline
;
WarnedDone
=
true
;
}
crystalTS
[
i
]
=
((
AgataKey
*
)
fSFrame
->
GetFrame
()
->
GetKey
())
->
GetTimeStamp
();
crystalTS
[
i
]
=
dynamic_cast
<
AgataKey
*>
(
fSFrame
->
GetFrame
()
->
GetKey
())
->
GetTimeStamp
();
crystalId
[
i
]
=
data
->
GetUID
();
for
(
Int_t
j
=
0
;
j
<
kNCC
;
j
++
)
{
...
...
@@ -391,14 +384,12 @@ void TB_AGATA_Builder_CRYSTAL::Process(Int_t idet)
/// ****** Builder PSA ******///
TB_AGATA_Builder_PSA
::
TB_AGATA_Builder_PSA
(
TString
name
,
TString
ADFKey
)
:
TB_Detector
(
name
,
ADFKey
)
TB_AGATA_Builder_PSA
::
TB_AGATA_Builder_PSA
(
TString
name
,
TString
ADFKey
)
:
TB_Detector
(
move
(
name
),
move
(
ADFKey
)
)
{
gActualClass
=
"TB_AGATA_Builder_PSA"
;
}
TB_AGATA_Builder_PSA
::~
TB_AGATA_Builder_PSA
()
{
}
TB_AGATA_Builder_PSA
::~
TB_AGATA_Builder_PSA
()
=
default
;
void
TB_AGATA_Builder_PSA
::
Init
()
{
...
...
@@ -459,54 +450,56 @@ void TB_AGATA_Builder_PSA::InitTree()
fTree
->
Branch
(
"TSHit"
,
&
TSHit
,
"TSHit/l"
);
TString
temparray
[
45
];
temparray
[
0
]
=
"1 2 13 12 3"
;
temparray
[
1
]
=
"2 0 3 5 22 20"
;
temparray
[
2
]
=
"0 1 20 17 16 13"
;
temparray
[
3
]
=
"0 6 4 5 1 "
;
temparray
[
4
]
=
"3 5 26 28 8 6 "
;
temparray
[
5
]
=
"1 3 4 26 23 22"
;
temparray
[
6
]
=
"3 4 8 7 9"
;
temparray
[
7
]
=
"6 9 11 34 32 8 "
;
temparray
[
8
]
=
"4 6 7 32 29 28"
;
temparray
[
9
]
=
"12 10 11 7 6"
;
temparray
[
10
]
=
"9 12 14 40 38 11"
;
temparray
[
11
]
=
"7 9 10 38 35 34"
;
temparray
[
12
]
=
"9 10 14 13 0"
;
temparray
[
13
]
=
"0 2 16 44 14 12"
;
temparray
[
14
]
=
"10 12 13 44 41 40"
;
temparray
[
15
]
=
"17 16 42"
;
temparray
[
16
]
=
"2 17 15 42 44 13"
;
temparray
[
17
]
=
"15 16 2 20 19"
;
temparray
[
18
]
=
"19 20 22 21"
;
temparray
[
19
]
=
"17 20 18"
;
temparray
[
20
]
=
"1 22 18 19 17 2 "
;
temparray
[
21
]
=
"18 22 23"
;
temparray
[
22
]
=
"1 5 23 21 18 20"
;
temparray
[
23
]
=
"21 22 5 26 25"
;
temparray
[
24
]
=
"25 26 28 27"
;
temparray
[
25
]
=
"23 26 24"
;
temparray
[
26
]
=
"5 4 28 24 25 23"
;
temparray
[
27
]
=
"24 28 29"
;
temparray
[
28
]
=
"24 26 4 8 29 27"
;
temparray
[
29
]
=
"27 28 8 32 31"
;
temparray
[
30
]
=
"31 32 34 33"
;
temparray
[
31
]
=
"29 32 30"
;
temparray
[
32
]
=
"31 29 8 7 34 30"
;
temparray
[
33
]
=
"30 34 35"
;
temparray
[
34
]
=
"30 32 7 11 35 33"
;
temparray
[
35
]
=
"33 34 11 38 37"
;
temparray
[
36
]
=
"37 38 40 39"
;
temparray
[
37
]
=
"35 38 36"
;
temparray
[
38
]
=
"11 10 40 36 37 35"
;
temparray
[
39
]
=
"36 40 41"
;
temparray
[
40
]
=
"10 14 41 39 36 38"
;
temparray
[
41
]
=
"39 40 14 44 43"
;
temparray
[
42
]
=
"43 44 16 15"
;
temparray
[
43
]
=
"41 44 42"
;
temparray
[
44
]
=
"13 16 42 43 41 14"
;
for
(
int
i
=
0
;
i
<
45
;
i
++
)
{
const
auto
NCrystals
=
45
;
auto
it
=
0
;
array
<
TString
,
NCrystals
>
temparray
;
temparray
[
it
++
]
=
"1 2 13 12 3"
;
temparray
[
it
++
]
=
"2 0 3 5 22 20"
;
temparray
[
it
++
]
=
"0 1 20 17 16 13"
;
temparray
[
it
++
]
=
"0 6 4 5 1 "
;
temparray
[
it
++
]
=
"3 5 26 28 8 6 "
;
temparray
[
it
++
]
=
"1 3 4 26 23 22"
;
temparray
[
it
++
]
=
"3 4 8 7 9"
;
temparray
[
it
++
]
=
"6 9 11 34 32 8 "
;
temparray
[
it
++
]
=
"4 6 7 32 29 28"
;
temparray
[
it
++
]
=
"12 10 11 7 6"
;
temparray
[
it
++
]
=
"9 12 14 40 38 11"
;
temparray
[
it
++
]
=
"7 9 10 38 35 34"
;
temparray
[
it
++
]
=
"9 10 14 13 0"
;
temparray
[
it
++
]
=
"0 2 16 44 14 12"
;
temparray
[
it
++
]
=
"10 12 13 44 41 40"
;
temparray
[
it
++
]
=
"17 16 42"
;
temparray
[
it
++
]
=
"2 17 15 42 44 13"
;
temparray
[
it
++
]
=
"15 16 2 20 19"
;
temparray
[
it
++
]
=
"19 20 22 21"
;
temparray
[
it
++
]
=
"17 20 18"
;
temparray
[
it
++
]
=
"1 22 18 19 17 2 "
;
temparray
[
it
++
]
=
"18 22 23"
;
temparray
[
it
++
]
=
"1 5 23 21 18 20"
;
temparray
[
it
++
]
=
"21 22 5 26 25"
;
temparray
[
it
++
]
=
"25 26 28 27"
;
temparray
[
it
++
]
=
"23 26 24"
;
temparray
[
it
++
]
=
"5 4 28 24 25 23"
;
temparray
[
it
++
]
=
"24 28 29"
;
temparray
[
it
++
]
=
"24 26 4 8 29 27"
;
temparray
[
it
++
]
=
"27 28 8 32 31"
;
temparray
[
it
++
]
=
"31 32 34 33"
;
temparray
[
it
++
]
=
"29 32 30"
;
temparray
[
it
++
]
=
"31 29 8 7 34 30"
;
temparray
[
it
++
]
=
"30 34 35"
;
temparray
[
it
++
]
=
"30 32 7 11 35 33"
;
temparray
[
it
++
]
=
"33 34 11 38 37"
;
temparray
[
it
++
]
=
"37 38 40 39"
;
temparray
[
it
++
]
=
"35 38 36"
;
temparray
[
it
++
]
=
"11 10 40 36 37 35"
;
temparray
[
it
++
]
=
"36 40 41"
;
temparray
[
it
++
]
=
"10 14 41 39 36 38"
;
temparray
[
it
++
]
=
"39 40 14 44 43"
;
temparray
[
it
++
]
=
"43 44 16 15"
;
temparray
[
it
++
]
=
"41 44 42"
;
temparray
[
it
++
]
=
"13 16 42 43 41 14"
;
for
(
int
i
=
0
;
i
<
NCrystals
;
i
++
)
{
TObjArray
*
arr
=
temparray
[
i
].
ReplaceAll
(
"
\t
"
,
" "
).
Tokenize
(
" "
);
for
(
int
j
=
0
;
j
<
arr
->
GetEntries
()
;
j
++
)
{
Int_t
det
=
((
TString
)
arr
->
At
(
j
)
->
GetName
()).
Atoi
();
...
...
@@ -524,33 +517,30 @@ void TB_AGATA_Builder_PSA::Process(Int_t idet)
Log
.
SetProcessMethod
(
Form
(
"Process(%d)"
,
idet
));
if
(
!
fMergerMode
)
fCompFrame
=
(
AgataCompositeFrame
*
)
fTrigger
->
GetInputSharedFP
()
->
GetFrame
();
fCompFrame
=
dynamic_cast
<
AgataCompositeFrame
*
>
(
fTrigger
->
GetInputSharedFP
()
->
GetFrame
()
)
;
else
fCompFrame
=
(
AgataCompositeFrame
*
)
fTrigger
->
GetInputSharedFP
(
idet
+
1
)
->
GetFrame
();
fCompFrame
=
dynamic_cast
<
AgataCompositeFrame
*
>
(
fTrigger
->
GetInputSharedFP
(
idet
+
1
)
->
GetFrame
()
)
;
fCompFrame
->
Scan
();
TSHit
=
((
AgataKey
*
)
fCompFrame
->
GetKey
())
->
GetTimeStamp
();
TSHit
=
dynamic_cast
<
AgataKey
*>
(
fCompFrame
->
GetKey
())
->
GetTimeStamp
();
Double_t
xLocal
,
yLocal
,
zLocal
,
xGlobal
,
yGlobal
,
zGlobal
;
nbCores
=
fCompFrame
->
GetNbSubFrame
();
Float_t
MaxE
[
nbCores
];
Float_t
coreX
[
nbCores
];
Float_t
coreY
[
nbCores
];
Float_t
coreZ
[
nbCores
];
memset
(
MaxE
,
0.
,
sizeof
(
MaxE
));
memset
(
coreX
,
0.
,
sizeof
(
coreX
));
memset
(
coreY
,
0.
,
sizeof
(
coreY
));
memset
(
coreZ
,
0.
,
sizeof
(
coreZ
));
for
(
auto
i
=
0
;
i
<
nbCores
;
i
++
)
{
MaxESeg
.
at
(
i
)
=
0
;
MaxCoreX
.
at
(
i
)
=
0
;
MaxCoreY
.
at
(
i
)
=
0
;
MaxCoreZ
.
at
(
i
)
=
0
;
}
for
(
Int_t
i
=
0
;
i
<
nbCores
;
i
++
)
{
fCompFrame
->
LinkSubFrame
(
i
,
fSFrame
->
GetFrame
());
fSFrame
->
GetFrame
()
->
Read
();
PSAInterface
*
data
=
GetDataPointer
<
PSAInterface
>
(
fSFrame
);
auto
*
data
=
GetDataPointer
<
PSAInterface
>
(
fSFrame
);
nbHitsperCry
[
i
]
=
data
->
GetNbHits
();
...
...
@@ -566,11 +556,11 @@ void TB_AGATA_Builder_PSA::Process(Int_t idet)
coreE0
[
i
]
=
data
->
GetE
(
0
);
coreE1
[
i
]
=
data
->
GetE
(
1
);
coreT0
[
i
]
=
data
->
GetT
(
0
);
coreTS
[
i
]
=
((
AgataKey
*
)
fSFrame
->
GetFrame
()
->
GetKey
())
->
GetTimeStamp
();
coreTS
[
i
]
=
dynamic_cast
<
AgataKey
*>
(
fSFrame
->
GetFrame
()
->
GetKey
())
->
GetTimeStamp
();
// Loop on the hit to get over the hits with the max of the energy
for
(
Int_t
j
=
0
;
j
<
nbHitsperCry
[
i
];
++
j
)
{
const
PSAHit
*
pHit
=
(
PSAHit
*
)
data
->
GetHit
(
j
);
const
PSAHit
*
pHit
=
dynamic_cast
<
PSAHit
*
>
(
data
->
GetHit
(
j
)
)
;
hitE
[
nbHits
+
j
]
=
pHit
->
GetE
();
hitX
[
nbHits
+
j
]
=
pHit
->
GetX
();
...
...
@@ -584,11 +574,11 @@ void TB_AGATA_Builder_PSA::Process(Int_t idet)
//To the AGATA global ref
Local2Global
(
data
->
GetUID
(),
xLocal
,
yLocal
,
zLocal
,
xGlobal
,
yGlobal
,
zGlobal
);
if
(
pHit
->
GetE
()
>
MaxE
[
i
]
)
{
MaxE
[
i
]
=
pHit
->
GetE
();
coreX
[
i
]
=
xGlobal
;
coreY
[
i
]
=
yGlobal
;
coreZ
[
i
]
=
zGlobal
;
if
(
pHit
->
GetE
()
>
MaxE
Seg
.
at
(
i
)
)
{
MaxE
Seg
.
at
(
i
)
=
pHit
->
GetE
();
MaxCoreX
.
at
(
i
)
=
xGlobal
;
MaxCoreY
.
at
(
i
)
=
yGlobal
;
MaxCoreZ
.
at
(
i
)
=
zGlobal
;
}
// Set the Position of the hit in global ref
...
...
@@ -603,13 +593,13 @@ void TB_AGATA_Builder_PSA::Process(Int_t idet)
//Addback calcluation
std
::
vector
<
core_property
>
corelist
;
for
(
int
i
=
0
;
i
<
nbCores
;
i
++
)
{
core_property
acore
;
core_property
acore
{}
;
acore
.
E
=
coreE0
[
i
];
acore
.
Id
=
coreId
[
i
];
acore
.
HighHitE
=
MaxE
[
i
]
;
acore
.
HighHitX
=
coreX
[
i
]
;
acore
.
HighHitY
=
coreY
[
i
]
;
acore
.
HighHitZ
=
coreZ
[
i
]
;
acore
.
HighHitE
=
MaxE
Seg
.
at
(
i
)
;
acore
.
HighHitX
=
MaxCoreX
.
at
(
i
)
;
acore
.
HighHitY
=
MaxCoreY
.
at
(
i
)
;
acore
.
HighHitZ
=
MaxCoreZ
.
at
(
i
)
;
acore
.
HighHitTS
=
coreTS
[
i
];
acore
.
HighHitId
=
coreId
[
i
];
...
...
@@ -656,15 +646,12 @@ void TB_AGATA_Builder_PSA::Process(Int_t idet)
/// ****** Tracking ******///
TB_AGATA_Tracking
::
TB_AGATA_Tracking
(
TString
name
,
TString
ADFKey
)
:
TB_Detector
(
name
,
ADFKey
)
TB_AGATA_Tracking
::
TB_AGATA_Tracking
(
TString
name
,
TString
ADFKey
)
:
TB_Detector
(
move
(
name
),
move
(
ADFKey
)
)
{
gActualClass
=
"TB_AGATA_Tracking"
;
}
TB_AGATA_Tracking
::~
TB_AGATA_Tracking
()
{
}
TB_AGATA_Tracking
::~
TB_AGATA_Tracking
()
=
default
;
void
TB_AGATA_Tracking
::
Init
()
{
...
...
@@ -721,7 +708,7 @@ void TB_AGATA_Tracking::Process(Int_t idet)
fSFrame
->
GetFrame
()
->
Read
();
// to get the data part of the frame
const
GammaTrackedInterface
*
data
=
GetCstDataPointer
<
GammaTrackedInterface
>
(
fSFrame
);
const
auto
*
data
=
GetCstDataPointer
<
GammaTrackedInterface
>
(
fSFrame
);
if
(
data
==
nullptr
)
return
;
...
...
@@ -735,9 +722,9 @@ void TB_AGATA_Tracking::Process(Int_t idet)
}
//! get time stamp
TSTrack
=
((
AgataKey
*
)
fSFrame
->
GetFrame
()
->
GetKey
())
->
GetTimeStamp
();
TSTrack
=
dynamic_cast
<
AgataKey
*>
(
fSFrame
->
GetFrame
()
->
GetKey
())
->
GetTimeStamp
();
for
(
UShort_t
i
=
0
u
;
i
<
nbTrack
;
i
++
)
{
for
(
auto
i
=
0
;
i
<
nbTrack
;
i
++
)
{
const
TrackedHit
*
gamma1
=
data
->
GetGamma
(
i
);
const
Hit
*
hit1
=
gamma1
->
GetHit
();
...
...
consumers/TreeBuilder/AGAPRO_TB_AGATA.h
View file @
098576b3
...
...
@@ -52,7 +52,7 @@ protected:
ULong64_t
crystalId
;
ULong64_t
crystalTS
;
Int_t
fTraceLenght
;
U
Int_t
fTraceLenght
;
bool
WarnedDone
=
false
;
...
...
@@ -138,7 +138,7 @@ protected:
ULong64_t
EvtCrystalTS
;
Int_t
fTraceLenght
;
U
Int_t
fTraceLenght
;
bool
WarnedDone
=
false
;
...
...
@@ -192,6 +192,11 @@ protected:
Float_t
coreE1
[
MaxCore
];
// Core energy, low gain
Float_t
coreT0
[
MaxCore
];
// Core time, high gain
array
<
Float_t
,
MaxCore
>
MaxESeg
;
// Maximum segment energy in the core
array
<
Float_t
,
MaxCore
>
MaxCoreX
;
// X position of the max segment energy
array
<
Float_t
,
MaxCore
>
MaxCoreY
;
// Y position of the max segment energy
array
<
Float_t
,
MaxCore
>
MaxCoreZ
;
// Z position of the max segment energy
Int_t
nbAdd
;
// Addback multiplicity
Int_t
AddId
[
MaxCore
];
// Addback crystal Id of the hit with highest energy
Float_t
AddE
[
MaxCore
];
// Addback energy
...
...
consumers/TreeBuilder/AGAPRO_TreeBuilder.cpp
View file @
098576b3
...
...
@@ -47,11 +47,7 @@ using namespace AGAPRO;
string
TreeBuilder
::
gMotherClass
=
"TreeBuilder"
;
string
TreeBuilder
::
gActualClass
;
TreeBuilder
::
TreeBuilder
()
:
NarvalConsumer
()
{
}
TreeBuilder
::
TreeBuilder
()
=
default
;
TreeBuilder
::~
TreeBuilder
()
{
...
...
@@ -67,11 +63,10 @@ TreeBuilder::~TreeBuilder()
fFile
->
Close
();
// in principle not needed ... just in case reset it has not been called by narval
UInt_t
error
=
0
u
;
process_reset
(
&
error
)
;
UInt_t
error
=
0
;
process_reset
(
&
error
)
;
}
for
(
int
idet
=
0
;
idet
<
fListOfDets
.
size
()
;
idet
++
){
TB_Detector
*
det
=
fListOfDets
[
idet
];
for
(
auto
det
:
fListOfDets
){
delete
det
;
}
}
...
...
@@ -129,11 +124,7 @@ void TreeBuilder::process_initialise (UInt_t *error_code)
cServer
.
Start
(
gActualClass
);
for
(
int
idet
=
0
;
idet
<
fListOfDets
.
size
()
;
idet
++
)
{
TB_Detector
*
det
=
fListOfDets
[
idet
];
det
->
Init
();
}
for
(
auto
det
:
fListOfDets
)
det
->
Init
();
NewTree
();
...
...
@@ -173,7 +164,7 @@ Int_t TreeBuilder::SetInput()
if
(
fMergerMode
)
{
fAgataComposite
=
dynamic_cast
<
AgataCompositeFrame
*>
(
fTrigger
->
GetInputFrame
()
);
fAgataComposite
->
Scan
();
timestamp
=
((
AgataKey
*
)
fAgataComposite
->
GetKey
())
->
GetTimeStamp
();
timestamp
=
dynamic_cast
<
AgataKey
*
>
(
fAgataComposite
->
GetKey
())
->
GetTimeStamp
();
}
// cout<<AgataKeyFactory::theFactory()->GetMessage(((AgataKey*)fAgataComposite->GetKey())->GetMessage())<<endl;
...
...
@@ -185,7 +176,7 @@ Int_t TreeBuilder::SetInput()
// cout<<endl;
for
(
in
t
idet
=
0
;
idet
<
fListOfDets
.
size
()
;
idet
++
)
{
for
(
size_
t
idet
=
0
;
idet
<
fListOfDets
.
size
()
;
idet
++
)
{
TB_Detector
*
det
=
fListOfDets
[
idet
];
det
->
InitValues
();
...
...
@@ -202,7 +193,7 @@ Int_t TreeBuilder::SetInput()
UInt_t
TreeBuilder
::
ProcessBlock
(
ADF
::
FrameBlock
&
inBlock
)
{
// attach the input/output buffer to the FrameIO system
fFrameIO
.
Attach
(
&
inBlock
,
0x0
);
fFrameIO
.
Attach
(
&
inBlock
,
nullptr
);
// start the processing
UInt_t
error_code
=
0
;
...
...
@@ -221,20 +212,19 @@ UInt_t TreeBuilder::ProcessBlock(ADF::FrameBlock &inBlock)
Log
<<
error
<<
" During : SetInput()"
<<
dolog
;
break
;
}
else
{
bool
has_triggered
=
false
;
for
(
int
idet
=
0
;
idet
<
fListOfDets
.
size
()
;
idet
++
)
{
TB_Detector
*
det
=
fListOfDets
[
idet
];
if
(
det
->
IsTriggered
())
{
has_triggered
=
true
;
det
->
Process
(
idet
);
}
}
if
(
has_triggered
)
fTree
->
Fill
();
bool
has_triggered
=
false
;
for
(
size_t
idet
=
0
;
idet
<
fListOfDets
.
size
()
;
idet
++
)
{
TB_Detector
*
det
=
fListOfDets
[
idet
];
if
(
det
->
IsTriggered
())
{
has_triggered
=
true
;
det
->
Process
(
idet
);
}
}
if
(
has_triggered
)
fTree
->
Fill
();
nevs
++
;
fReadEvts
++
;
...
...
@@ -243,7 +233,7 @@ UInt_t TreeBuilder::ProcessBlock(ADF::FrameBlock &inBlock)
}
}
fFrameIO
.
Detach
(
&
inBlock
,
0x0
);
fFrameIO
.
Detach
(
&
inBlock
,
nullptr
);
cServer
.
Exec
(
timestamp
,
nevs
);
...
...
@@ -271,9 +261,9 @@ void TreeBuilder::NewTree()
if
(
fTree
==
nullptr
)
{
fTree
=
new
TTree
(
fTreeName
.
data
(),
fTreeName
.
data
());
for
(
int
idet
=
0
;
idet
<
fListOfDets
.
size
()
;
idet
++
)
{
fListOfDets
[
idet
]
->
SetTree
(
fTree
);
fListOfDets
[
idet
]
->
InitTree
();
for
(
auto
&
fListOfDets
:
fListOfDets
)
{
fListOfDets
->
SetTree
(
fTree
);
fListOfDets
->
InitTree
();
}
}
else
{
...
...
@@ -338,7 +328,7 @@ UInt_t TreeBuilder::GetParameters(const std::string& confFile, Bool_t doList)
}
}
if
(
fListOfDets
.
size
()
==
0
)
{
if
(
fListOfDets
.
empty
()
)
{
Log
<<
error
<<
" No detector added in the Tree"
<<
dolog
;
rv
=
201
;
}
...
...
@@ -351,7 +341,7 @@ UInt_t TreeBuilder::GetParameters(const std::string& confFile, Bool_t doList)
return
rv
;
}
void
TreeBuilder
::
AddDetector
(
TString
Name
,
TString
ADFKey
,
Int_t
MandatoryMode
)
void
TreeBuilder
::
AddDetector
(
const
TString
&
Name
,
TString
ADFKey
,
Int_t
MandatoryMode
)
{
Log
.
ClearMessage
();
Log
.
GetProcessName
()
=
gMotherClass
;
...
...
@@ -440,18 +430,15 @@ Int_t TreeBuilder::BuildTrigger()
else
fTriggerName
=
"event:data "
;
for
(
int
idet
=
0
;
idet
<
fListOfDets
.
size
()
;
idet
++
)
fTriggerName
+=
fListOfDets
[
idet
]
->
GetTriggerName
()
+
" "
;
for
(
auto
&
fListOfDets
:
fListOfDets
)
fTriggerName
+=
fListOfDets
->
GetTriggerName
()
+
" "
;
fTriggerName
.
Remove
(
fTriggerName
.
Length
()
-
1
);
// remove the last empty space
fTrigger
=
AgataFrameTrigger
::
Build
(
"Event"
,
fTriggerName
.
Data
());
if
(
fTrigger
)
{
for
(
int
idet
=
0
;
idet
<
fListOfDets
.
size
()
;
idet
++
)
{
TB_Detector
*
det
=
fListOfDets
[
idet
];
det
->
SetTrigger
(
fTrigger
);
}
for
(
auto
det
:
fListOfDets
)
det
->
SetTrigger
(
fTrigger
);
}
else
return
1
;
...
...
consumers/TreeBuilder/AGAPRO_TreeBuilder.h
View file @
098576b3
...
...
@@ -82,9 +82,9 @@ protected:
protected:
TString
fTriggerName
=
""
;
ADF
::
SharedFP
*
fFrameEvent
;
//! input and ouput frames
ADF
::
AgataCompositeFrame
*
fAgataComposite
;
ADF
::
AgataFrameTrigger
*
fTrigger
;
//! Trigger for the input frame
ADF
::
SharedFP
*
fFrameEvent
=
{}
;
//! input and ouput frames
ADF
::
AgataCompositeFrame
*
fAgataComposite
=
{}
;
ADF
::
AgataFrameTrigger
*
fTrigger
=
{}
;
//! Trigger for the input frame
public:
TreeBuilder
();
...
...
@@ -107,7 +107,7 @@ public:
virtual
UInt_t
GetParameters
(
const
std
::
string
&
confFile
,
Bool_t
doList
=
false
);
protected:
void
AddDetector
(
TString
Name
,
TString
ADFKey
,
Int_t
MandatoryMode
);
void
AddDetector
(
const
TString
&
Name
,
TString
ADFKey
,
Int_t
MandatoryMode
);
Int_t
BuildTrigger
();
};
}
...
...
Write
Preview