R3BROOT
R3B analysis software
Toggle main menu visibility
Loading...
Searching...
No Matches
R3BNeulandClusterFinder.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 "
R3BNeulandClusterFinder.h
"
15
#include "
R3BLogger.h
"
16
#include "
R3BNeulandHit.h
"
17
#include <FairTask.h>
18
#include <Rtypes.h>
19
#include <RtypesCore.h>
20
#include <cstdlib>
21
#include <fmt/core.h>
22
#include <string_view>
23
#include <utility>
24
#include <vector>
25
26
R3BNeulandClusterFinder::R3BNeulandClusterFinder
(
const
double
dist_x,
27
const
double
dist_y,
28
const
double
dist_z,
29
const
double
dist_t,
30
const
std::string_view input,
31
const
std::string_view output)
32
: FairTask(
"R3BNeulandClusterFinder"
)
33
,
fDigis
(input)
34
,
fClusters
(output)
35
{
36
fClusteringEngine
.SetClusteringCondition(
37
[=](
const
R3BNeulandHit
& one,
const
R3BNeulandHit
& other)
38
{
39
return
std::abs(one.
GetPosition
().X() - other.
GetPosition
().X()) < dist_x &&
40
std::abs(one.
GetPosition
().Y() - other.
GetPosition
().Y()) < dist_y &&
41
std::abs(one.
GetPosition
().Z() - other.
GetPosition
().Z()) < dist_z &&
42
std::abs(one.
GetT
() - other.
GetT
()) < dist_t;
43
});
44
}
45
46
auto
R3BNeulandClusterFinder::Init
() -> InitStatus
47
{
48
fDigis
.init();
49
fClusters
.init();
50
return
kSUCCESS;
51
}
52
53
void
R3BNeulandClusterFinder::Exec
(Option_t*
/*option*/
)
54
{
55
fClusters
.clear();
56
neuland_hits_buffer_
.clear();
57
clustered_hits_buffer_
.clear();
58
59
neuland_hits_buffer_
=
fDigis
.get();
60
const
auto
nDigis =
neuland_hits_buffer_
.size();
61
62
// Group them using the clustering condition set above: vector of digis -> vector of vector of digis
63
clustered_hits_buffer_
=
fClusteringEngine
.Clusterize(
neuland_hits_buffer_
);
64
const
auto
nClusters =
clustered_hits_buffer_
.size();
65
66
R3BLOG
(debug, fmt::format(
"R3BNeulandClusterFinder - nDigis nCluster: {} {}"
, nDigis, nClusters));
67
68
for
(
auto
& cluster :
clustered_hits_buffer_
)
69
{
70
fClusters
.get().emplace_back(std::move(cluster));
71
}
72
}
73
74
ClassImp
(
R3BNeulandClusterFinder
);
R3BLogger.h
R3BLOG
#define R3BLOG(severity, x)
Definition
R3BLogger.h:33
ClassImp
ClassImp(R3B::Neuland::Cal2HitPar)
R3BNeulandClusterFinder.h
R3BNeulandHit.h
R3BNeulandClusterFinder
Definition
R3BNeulandClusterFinder.h:39
R3BNeulandClusterFinder::neuland_hits_buffer_
std::vector< R3BNeulandHit > neuland_hits_buffer_
Definition
R3BNeulandClusterFinder.h:60
R3BNeulandClusterFinder::fClusters
R3B::OutputVectorConnector< R3BNeulandCluster > fClusters
Definition
R3BNeulandClusterFinder.h:58
R3BNeulandClusterFinder::fDigis
R3B::InputVectorConnector< R3BNeulandHit > fDigis
Definition
R3BNeulandClusterFinder.h:57
R3BNeulandClusterFinder::Exec
void Exec(Option_t *) override
Definition
R3BNeulandClusterFinder.cxx:53
R3BNeulandClusterFinder::R3BNeulandClusterFinder
R3BNeulandClusterFinder(double dist_x=1. *CLUSTER_FINDER_DISTANCE, double dist_y=1. *CLUSTER_FINDER_DISTANCE, double dist_z=2. *CLUSTER_FINDER_DISTANCE, double dist_t=1., std::string_view input="NeulandHits", std::string_view output="NeulandClusters")
Definition
R3BNeulandClusterFinder.cxx:26
R3BNeulandClusterFinder::clustered_hits_buffer_
std::vector< std::vector< R3BNeulandHit > > clustered_hits_buffer_
Definition
R3BNeulandClusterFinder.h:61
R3BNeulandClusterFinder::fClusteringEngine
Neuland::ClusteringEngine< R3BNeulandHit > fClusteringEngine
Definition
R3BNeulandClusterFinder.h:56
R3BNeulandClusterFinder::Init
auto Init() -> InitStatus override
Definition
R3BNeulandClusterFinder.cxx:46
R3BNeulandHit
Definition
R3BNeulandHit.h:30
R3BNeulandHit::GetT
auto GetT() const -> double
Definition
R3BNeulandHit.h:63
R3BNeulandHit::GetPosition
auto GetPosition() const -> const ROOT::Math::XYZVector &
Definition
R3BNeulandHit.h:67
neuland
clustering
R3BNeulandClusterFinder.cxx
Generated by
1.18.0