R3BROOT
R3B analysis software
Toggle main menu visibility
Loading...
Searching...
No Matches
R3BNeulandPrimaryClusterFinder.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 "
R3BNeulandPrimaryClusterFinder.h
"
15
#include "
R3BNeulandCluster.h
"
16
#include "
R3BNeulandHit.h
"
17
#include <FairTask.h>
18
#include <RtypesCore.h>
19
#include <string_view>
20
#include <vector>
21
22
namespace
23
{
24
auto
IsPrimaryCluster(
const
R3BNeulandCluster
& cluster,
const
std::vector<R3BNeulandHit>& primaryHits) ->
bool
25
{
26
for
(
const
auto
& primary_hit : primaryHits)
27
{
28
for
(
const
auto
& hit : cluster.GetHits())
29
{
30
if
(hit == primary_hit)
31
{
32
return
true
;
33
}
34
}
35
}
36
return
false
;
37
}
38
39
}
// namespace
40
41
// NOLINTNEXTLINE: bugprone-easily-swappable-parameters
42
R3BNeulandPrimaryClusterFinder::R3BNeulandPrimaryClusterFinder
(std::string_view primaryHits,
43
std::string_view clusters,
44
std::string_view primaryClusters,
45
std::string_view secondaryClusters)
46
:
fPrimaryHits
{ primaryHits }
47
,
fClusters
{ clusters }
48
,
fPrimaryClusters
{ primaryClusters }
49
,
fSecondaryClusters
{ secondaryClusters }
50
{
51
}
52
53
auto
R3BNeulandPrimaryClusterFinder::Init
() -> InitStatus
54
{
55
fPrimaryHits
.init();
56
fClusters
.init();
57
fPrimaryClusters
.init();
58
fSecondaryClusters
.init();
59
60
return
kSUCCESS;
61
}
62
63
void
R3BNeulandPrimaryClusterFinder::Exec
(Option_t*
/*option*/
)
64
{
65
const
auto
& primaryHits =
fPrimaryHits
.get();
66
const
auto
& clusters =
fClusters
.get();
67
fPrimaryClusters
.clear();
68
fSecondaryClusters
.clear();
69
70
for
(
const
auto
& cluster : clusters)
71
{
72
if
(IsPrimaryCluster(cluster, primaryHits))
73
{
74
fPrimaryClusters
.get().push_back(cluster);
75
}
76
else
77
{
78
fSecondaryClusters
.get().push_back(cluster);
79
}
80
}
81
}
R3BNeulandCluster.h
R3BNeulandHit.h
R3BNeulandPrimaryClusterFinder.h
R3BNeulandCluster
Definition
R3BNeulandCluster.h:28
R3BNeulandPrimaryClusterFinder::fPrimaryHits
R3B::InputVectorConnector< R3BNeulandHit > fPrimaryHits
Definition
R3BNeulandPrimaryClusterFinder.h:39
R3BNeulandPrimaryClusterFinder::fSecondaryClusters
R3B::OutputVectorConnector< R3BNeulandCluster > fSecondaryClusters
Definition
R3BNeulandPrimaryClusterFinder.h:43
R3BNeulandPrimaryClusterFinder::fClusters
R3B::InputVectorConnector< R3BNeulandCluster > fClusters
Definition
R3BNeulandPrimaryClusterFinder.h:40
R3BNeulandPrimaryClusterFinder::fPrimaryClusters
R3B::OutputVectorConnector< R3BNeulandCluster > fPrimaryClusters
Definition
R3BNeulandPrimaryClusterFinder.h:42
R3BNeulandPrimaryClusterFinder::Init
auto Init() -> InitStatus override
Definition
R3BNeulandPrimaryClusterFinder.cxx:53
R3BNeulandPrimaryClusterFinder::Exec
void Exec(Option_t *) override
Definition
R3BNeulandPrimaryClusterFinder.cxx:63
R3BNeulandPrimaryClusterFinder::R3BNeulandPrimaryClusterFinder
R3BNeulandPrimaryClusterFinder(std::string_view primaryHits="NeulandPrimaryHits", std::string_view clusters="NeulandClusters", std::string_view primaryClusters="NeulandPrimaryClusters", std::string_view secondaryClusters="NeulandSecondaryClusters")
Definition
R3BNeulandPrimaryClusterFinder.cxx:42
neuland
simulation
R3BNeulandPrimaryClusterFinder.cxx
Generated by
1.18.0