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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computing
cbmroot
Commits
281b2e85
Commit
281b2e85
authored
2 years ago
by
Dominik Smith
Committed by
Dominik Smith
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
CbmTrdUnpackFaspAlgo: Switched to storage of inverted instead of direct crob map.
parent
3cae2a75
No related branches found
No related tags found
1 merge request
!1137
Understanding the structure of TRD2D.
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
reco/detectors/trd/unpack/CbmTrdUnpackFaspAlgo.cxx
+26
-16
26 additions, 16 deletions
reco/detectors/trd/unpack/CbmTrdUnpackFaspAlgo.cxx
reco/detectors/trd/unpack/CbmTrdUnpackFaspAlgo.h
+2
-2
2 additions, 2 deletions
reco/detectors/trd/unpack/CbmTrdUnpackFaspAlgo.h
with
28 additions
and
18 deletions
reco/detectors/trd/unpack/CbmTrdUnpackFaspAlgo.cxx
+
26
−
16
View file @
281b2e85
...
...
@@ -141,8 +141,20 @@ void CbmTrdUnpackFaspAlgo::SetAsicMapping(const std::map<uint32_t, uint8_t[NFASP
//_________________________________________________________________________________
void
CbmTrdUnpackFaspAlgo
::
SetCrobMapping
(
const
std
::
map
<
uint32_t
,
uint16_t
[
NCROBMOD
]
>&
map
)
{
if
(
fCrobMap
)
delete
fCrobMap
;
fCrobMap
=
new
std
::
map
<
uint32_t
,
uint16_t
[
NCROBMOD
]
>
(
map
);
if
(
fCompMap
)
delete
fCompMap
;
fCompMap
=
new
std
::
map
<
uint16_t
,
std
::
pair
<
uint16_t
,
uint16_t
>>
;
/// map eq_id -> (mod_id, crob_id)
for
(
auto
&
entry
:
map
)
{
uint16_t
mod_id
=
entry
.
first
;
for
(
uint8_t
crob_id
=
0
;
crob_id
<
NCROBMOD
;
crob_id
++
)
{
uint16_t
eq_id
=
entry
.
second
[
crob_id
];
if
(
fCompMap
->
find
(
eq_id
)
!=
fCompMap
->
end
())
{
LOG
(
error
)
<<
GetName
()
<<
"::SetCrobMapping: multiple entries for eq_id "
<<
(
int
)
eq_id
<<
" found."
;
return
;
}
(
*
fCompMap
)[
eq_id
]
=
std
::
make_pair
(
mod_id
,
crob_id
);
}
}
}
//_________________________________________________________________________________
...
...
@@ -366,32 +378,30 @@ bool CbmTrdUnpackFaspAlgo::unpack(const fles::Timeslice* ts, std::uint16_t icomp
if
(
VERBOSE
)
printf
(
"CbmTrdUnpackFaspAlgo::unpack 0x%04x %d
\n
"
,
icomp
,
imslice
);
// LOG(info) << "Component " << icomp << " connected to config CbmTrdUnpackConfig2D. Slice "<<imslice;
uint8_t
crob_id
=
0
;
bool
unpackOk
=
true
;
//Double_t fdMsSizeInNs = 1.28e6;
auto
msdesc
=
ts
->
descriptor
(
icomp
,
imslice
);
// Cast required to silence a warning on macos (there a uint64_t is a llu)
if
(
VERBOSE
)
printf
(
"time start %lu
\n
"
,
static_cast
<
size_t
>
(
msdesc
.
idx
));
// define time wrt start of time slice in TRD/FASP clks [80 MHz]
fTime
=
ULong64_t
((
msdesc
.
idx
-
fTsStartTime
-
fSystemTimeOffset
)
/
12.5
);
// get MOD_id and CROB id from the equipment
// get MOD_id and CROB id from the equipment
, using the comp map: eq_id -> (mod_id, crob_id)
const
uint16_t
eq_id
=
msdesc
.
eq_id
;
bool
mapped
=
false
;
for
(
auto
mod_id
:
fModuleId
)
{
for
(
crob_id
=
0
;
crob_id
<
NCROBMOD
;
crob_id
++
)
{
if
(((
*
fCrobMap
)[
mod_id
])[
crob_id
]
==
eq_id
)
break
;
}
if
(
crob_id
==
NCROBMOD
)
continue
;
fMod
=
mod_id
;
mapped
=
true
;
break
;
}
if
(
!
mapped
)
{
const
auto
it
=
fCompMap
->
find
(
eq_id
);
if
(
it
==
fCompMap
->
end
()
||
std
::
find
(
fModuleId
.
begin
(),
fModuleId
.
end
(),
it
->
second
.
first
)
==
fModuleId
.
end
())
{
LOG
(
error
)
<<
GetName
()
<<
"::unpack - CROB eq_id="
<<
eq_id
<<
" not registered in the unpacker."
;
return
false
;
}
fMod
=
(
*
fCompMap
)[
eq_id
].
first
;
const
uint8_t
crob_id
=
(
*
fCompMap
)[
eq_id
].
second
;
///////// To do: Make fMod a local variable
if
(
fCrob
==
0xffff
)
fCrob
=
icomp
;
// Get the µslice size in bytes to calculate the number of completed words
...
...
This diff is collapsed.
Click to expand it.
reco/detectors/trd/unpack/CbmTrdUnpackFaspAlgo.h
+
2
−
2
View file @
281b2e85
...
...
@@ -203,7 +203,7 @@ protected:
private
:
void
prt_wd
(
uint32_t
w
);
std
::
map
<
uint32_t
,
uint8_t
[
NFASPMOD
]
>*
fFaspMap
=
nullptr
;
///> FASP mapping update wrt the default setting
std
::
map
<
uint
32
_t
,
uint16_t
[
NCROBMOD
]
>*
fC
rob
Map
=
nullptr
;
///>
CRI mapping setting
std
::
map
<
uint
16_t
,
std
::
pair
<
uint16
_t
,
uint16_t
>
>*
fC
omp
Map
=
nullptr
;
///>
Map eq_id -> (mod_id, crob_id)
std
::
array
<
std
::
vector
<
CbmTrdDigi
>
,
NFASPMOD
*
NFASPCH
>
fDigiBuffer
=
{
{}};
///> Buffered digi for each pad in CROB component
/** @brief Potential (online) monitor for the unpacking process */
...
...
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