Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cbmroot
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computing
cbmroot
Commits
b085b17d
Commit
b085b17d
authored
1 year ago
by
Dominik Smith
Committed by
Felix Weiglhofer
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
cbm::algo::Clusterizer: Optimized double loop in AddNextChan().
parent
a0a09e98
No related branches found
No related tags found
1 merge request
!1391
Online-capable TOF hitfinder.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
algo/detectors/tof/Clusterizer.cxx
+12
-7
12 additions, 7 deletions
algo/detectors/tof/Clusterizer.cxx
with
12 additions
and
7 deletions
algo/detectors/tof/Clusterizer.cxx
+
12
−
7
View file @
b085b17d
...
...
@@ -20,8 +20,8 @@ namespace cbm::algo::tof
{
//std::vector<inputType> input = calibrateDigis(digisIn);
std
::
vector
<
inputType
>
input
=
chanSortDigis
(
digisIn
);
//
return buildClusters(input);
return
buildClustersIter
(
input
);
//Iterator based implementation
return
buildClusters
(
input
);
//
return buildClustersIter(input); //Iterator based implementation
}
std
::
vector
<
Clusterizer
::
inputType
>
Clusterizer
::
chanSortDigis
(
inputType
&
digisIn
)
...
...
@@ -153,7 +153,6 @@ namespace cbm::algo::tof
offset++;
}
*/
storDigi
.
erase
(
storDigi
.
begin
()
+
offset
);
if
(
2
>
storDigi
.
size
())
{
break
;
}
}
// same condition side end
...
...
@@ -276,13 +275,18 @@ namespace cbm::algo::tof
for
(
auto
i1
=
storDigi
.
begin
();
i1
<
storDigi
.
end
()
-
1
;
i1
++
)
{
const
CbmTofDigi
*
xDigiA
=
i1
->
first
;
const
double
timeMax
=
xDigiA
->
GetTime
()
+
fParams
.
fChanPar
[
chan
].
cell
.
sizeY
*
fParams
.
fPosYMaxScal
/
fParams
.
fSigVel
;
if
(
timeMax
<
cluster
.
weightedTime
/
cluster
.
weightsSum
-
fParams
.
fdMaxTimeDist
)
{
continue
;
}
auto
i2
=
i1
;
//D.Smith 7.9.23: Do we really need to loop through all remaining digis?
//Maybe break at i2 == i1 + 2 ?
//D.Smith 8.9.23: Adding the break condition below probably makes this redundant.
while
(
++
i2
<
storDigi
.
end
())
{
const
CbmTofDigi
*
xDigiA
=
i1
->
first
;
const
CbmTofDigi
*
xDigiB
=
i2
->
first
;
if
(
xDigiA
->
GetSide
()
==
xDigiB
->
GetSide
())
{
continue
;
}
...
...
@@ -292,12 +296,12 @@ namespace cbm::algo::tof
// The optimization relies on time-order.
//if (std::abs(time - cluster.weightedTime / cluster.weightsSum) >= fParams.fdMaxTimeDist) { continue; }
//Break if digis are in the future of cluster time
if
(
time
-
cluster
.
weightedTime
/
cluster
.
weightsSum
>=
fParams
.
fdMaxTimeDist
)
{
break
;
}
//Continue if digis are in the past of cluster time
if
(
cluster
.
weightedTime
/
cluster
.
weightsSum
-
time
>=
fParams
.
fdMaxTimeDist
)
{
continue
;
}
//Break if digis are in the future of cluster time
if
(
time
-
cluster
.
weightedTime
/
cluster
.
weightsSum
>=
fParams
.
fdMaxTimeDist
)
{
break
;
}
const
double
timeDif
=
xDigiA
->
GetTime
()
-
xDigiB
->
GetTime
();
double
posY
=
fParams
.
fSigVel
*
timeDif
*
0.5
;
if
(
1
!=
xDigiA
->
GetSide
())
{
posY
*=
-
1.
;
}
...
...
@@ -319,6 +323,7 @@ namespace cbm::algo::tof
return
true
;
// signal hit was already added
}
i1
=
storDigi
.
end
();
// jump to end of outer loop
break
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment