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
18ea1a19
Commit
18ea1a19
authored
1 year ago
by
Dominik Smith
Committed by
Felix Weiglhofer
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
cbm::algo::tof:Clusterizer: Performance optimizations.
parent
6e641866
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
+13
-2
13 additions, 2 deletions
algo/detectors/tof/Clusterizer.cxx
with
13 additions
and
2 deletions
algo/detectors/tof/Clusterizer.cxx
+
13
−
2
View file @
18ea1a19
...
@@ -144,6 +144,7 @@ namespace cbm::algo::tof
...
@@ -144,6 +144,7 @@ namespace cbm::algo::tof
uint8_t
offset
=
0
;
uint8_t
offset
=
0
;
/* D.Smith 14.8.23: This condition is never needed due to time-sorted input (check with PAL and VF)
/* D.Smith 14.8.23: This condition is never needed due to time-sorted input (check with PAL and VF)
//D. Smith 8.9.23: Theoretically, this could matter for two digis with identical time stamp but different TOT. Can this even happen?
// use digi that is closer to the last one
// use digi that is closer to the last one
if (storDigi.size() > 2 && storDigi[2].first->GetSide() != storDigi[0].first->GetSide()
if (storDigi.size() > 2 && storDigi[2].first->GetSide() != storDigi[0].first->GetSide()
&& storDigi[2].first->GetTime() - storDigi[0].first->GetTime()
&& storDigi[2].first->GetTime() - storDigi[0].first->GetTime()
...
@@ -151,6 +152,7 @@ namespace cbm::algo::tof
...
@@ -151,6 +152,7 @@ namespace cbm::algo::tof
offset++;
offset++;
}
}
*/
*/
storDigi
.
erase
(
storDigi
.
begin
()
+
offset
);
storDigi
.
erase
(
storDigi
.
begin
()
+
offset
);
if
(
2
>
storDigi
.
size
())
{
break
;
}
if
(
2
>
storDigi
.
size
())
{
break
;
}
}
// same condition side end
}
// same condition side end
...
@@ -258,7 +260,7 @@ namespace cbm::algo::tof
...
@@ -258,7 +260,7 @@ namespace cbm::algo::tof
{
{
//D.Smith 25.8.23: Why are "C" digis (position "2") not considered here?
//D.Smith 25.8.23: Why are "C" digis (position "2") not considered here?
//const int32_t iDetId = CbmTofAddress::GetUniqueAddress(iSm, iRpc, 0, 0, iSmType);
//const int32_t iDetId = CbmTofAddress::GetUniqueAddress(iSm, iRpc, 0, 0, iSmType);
//Kept for reference
size_t
numChan
=
fParams
.
fChanPar
.
size
();
size_t
numChan
=
fParams
.
fChanPar
.
size
();
int32_t
chan
=
lastChan
+
1
;
int32_t
chan
=
lastChan
+
1
;
...
@@ -276,6 +278,7 @@ namespace cbm::algo::tof
...
@@ -276,6 +278,7 @@ namespace cbm::algo::tof
auto
i2
=
i1
;
auto
i2
=
i1
;
//D.Smith 7.9.23: Do we really need to loop through all remaining digis?
//D.Smith 7.9.23: Do we really need to loop through all remaining digis?
//Maybe break at i2 == i1 + 2 ?
//Maybe break at i2 == i1 + 2 ?
//D.Smith 8.9.23: Adding the break condition below probably makes this redundant.
while
(
++
i2
<
storDigi
.
end
())
{
while
(
++
i2
<
storDigi
.
end
())
{
const
CbmTofDigi
*
xDigiA
=
i1
->
first
;
const
CbmTofDigi
*
xDigiA
=
i1
->
first
;
...
@@ -284,7 +287,15 @@ namespace cbm::algo::tof
...
@@ -284,7 +287,15 @@ namespace cbm::algo::tof
const
double
time
=
0.5
*
(
xDigiA
->
GetTime
()
+
xDigiB
->
GetTime
());
const
double
time
=
0.5
*
(
xDigiA
->
GetTime
()
+
xDigiB
->
GetTime
());
if
(
std
::
abs
(
time
-
cluster
.
weightedTime
/
cluster
.
weightsSum
)
>=
fParams
.
fdMaxTimeDist
)
{
continue
;
}
//D.Smith 8.9.23: Original continue statement, in general much slower (replaced by the conditions below).
// 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
;
}
const
double
timeDif
=
xDigiA
->
GetTime
()
-
xDigiB
->
GetTime
();
const
double
timeDif
=
xDigiA
->
GetTime
()
-
xDigiB
->
GetTime
();
double
posY
=
fParams
.
fSigVel
*
timeDif
*
0.5
;
double
posY
=
fParams
.
fSigVel
*
timeDif
*
0.5
;
...
...
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