Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hcana
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
Monitor
Incidents
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
jlab
hallc
analyzer_software
hcana
Commits
c7fb6164
Commit
c7fb6164
authored
12 years ago
by
Stephen A. Wood
Browse files
Options
Downloads
Patches
Plain Diff
Further development of FillMap method
parent
764131f0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/THcDetectorMap.cxx
+67
-8
67 additions, 8 deletions
src/THcDetectorMap.cxx
with
67 additions
and
8 deletions
src/THcDetectorMap.cxx
+
67
−
8
View file @
c7fb6164
...
@@ -55,26 +55,33 @@ Int_t THcDetectorMap::FillMap(THaDetMap *detmap, const char *detectorname)
...
@@ -55,26 +55,33 @@ Int_t THcDetectorMap::FillMap(THaDetMap *detmap, const char *detectorname)
// Should probably return a status
// Should probably return a status
{
{
list
<
ModChanList
>::
iterator
imod
;
list
<
ModChanList
>::
iterator
imod
;
list
<
ChaninMod
>::
iterator
ichan
;
ChaninMod
Achan
;
ChaninMod
Achan
;
ModChanList
Amod
;
ModChanList
Amod
;
// Need one array of uniq crate/slot combos
// Need one array of uniq crate/slot combos
// Translate detector name into and ID
// Translate detector name into and ID
Int_t
did
=
3
;
// Get this from detectorname
Int_t
did
=
1
;
// Get this from detectorname
mlist
.
clear
();
mlist
.
clear
();
cout
<<
"fNchans="
<<
fNchans
<<
endl
;
for
(
Int_t
ich
=
0
;
ich
<
fNchans
;
ich
++
)
{
for
(
Int_t
ich
=
0
;
ich
<
fNchans
;
ich
++
)
{
if
(
fTable
[
ich
].
did
==
did
)
{
if
(
fTable
[
ich
].
did
==
did
)
{
Int_t
roc
=
fTable
[
ich
].
roc
;
Int_t
roc
=
fTable
[
ich
].
roc
;
Int_t
slot
=
fTable
[
ich
].
slot
;
Int_t
slot
=
fTable
[
ich
].
slot
;
cout
<<
"ROC="
<<
fTable
[
ich
].
roc
<<
" SLOT="
<<
fTable
[
ich
].
slot
<<
" CHANNEL="
<<
fTable
[
ich
].
channel
<<
endl
;
Achan
.
channel
=
fTable
[
ich
].
channel
;
Achan
.
plane
=
fTable
[
ich
].
plane
;
Achan
.
counter
=
fTable
[
ich
].
counter
;
Achan
.
signal
=
fTable
[
ich
].
signal
;
for
(
imod
=
mlist
.
begin
();
imod
!=
mlist
.
end
();
++
imod
)
{
for
(
imod
=
mlist
.
begin
();
imod
!=
mlist
.
end
();
++
imod
)
{
Achan
.
channel
=
fTable
[
ich
].
channel
;
Achan
.
plane
=
fTable
[
ich
].
plane
;
Achan
.
counter
=
fTable
[
ich
].
counter
;
Achan
.
signal
=
fTable
[
ich
].
signal
;
if
((
*
imod
).
roc
==
roc
&&
(
*
imod
).
slot
==
slot
)
{
if
((
*
imod
).
roc
==
roc
&&
(
*
imod
).
slot
==
slot
)
{
// cout << "Pushing chan " << Achan.channel << " to " << roc
// << " " << slot << endl;
(
*
imod
).
clist
.
push_back
(
Achan
);
(
*
imod
).
clist
.
push_back
(
Achan
);
break
;
}
}
}
}
if
(
imod
==
mlist
.
end
())
{
if
(
imod
==
mlist
.
end
())
{
...
@@ -83,6 +90,8 @@ Int_t THcDetectorMap::FillMap(THaDetMap *detmap, const char *detectorname)
...
@@ -83,6 +90,8 @@ Int_t THcDetectorMap::FillMap(THaDetMap *detmap, const char *detectorname)
Amod
.
clist
.
clear
();
Amod
.
clist
.
clear
();
Amod
.
clist
.
push_back
(
Achan
);
Amod
.
clist
.
push_back
(
Achan
);
mlist
.
push_back
(
Amod
);
mlist
.
push_back
(
Amod
);
// cout << "New module " << Achan.channel << " to " << roc
// << " " << slot << endl;
}
}
}
}
}
}
...
@@ -91,10 +100,56 @@ Int_t THcDetectorMap::FillMap(THaDetMap *detmap, const char *detectorname)
...
@@ -91,10 +100,56 @@ Int_t THcDetectorMap::FillMap(THaDetMap *detmap, const char *detectorname)
}
}
Functor
f
;
Functor
f
;
for
(
imod
=
mlist
.
begin
();
imod
!=
mlist
.
end
();
++
imod
)
{
for
(
imod
=
mlist
.
begin
();
imod
!=
mlist
.
end
();
++
imod
)
{
cout
<<
"Slot "
<<
(
*
imod
).
slot
<<
endl
;
list
<
ChaninMod
>
*
clistp
=
&
((
*
imod
).
clist
);
list
<
ChaninMod
>
*
clistp
=
&
((
*
imod
).
clist
);
clistp
->
sort
(
f
);
//Sort by channel
clistp
->
sort
(
f
);
//Sort by channel
}
}
// Copy the information to the Hall A style detector map
// grouping consecutive channels that are all the same plane
// and signal type
UInt_t
model
=
0
;
// Need some way to look this up
for
(
imod
=
mlist
.
begin
();
imod
!=
mlist
.
end
();
++
imod
)
{
UShort_t
roc
=
(
*
imod
).
roc
;
UShort_t
slot
=
(
*
imod
).
slot
;
cout
<<
"Slot "
<<
slot
<<
endl
;
list
<
ChaninMod
>
*
clistp
=
&
((
*
imod
).
clist
);
Int_t
first_chan
=
-
1
;
Int_t
last_chan
=
-
1
;
Int_t
last_plane
=
-
1
;
Int_t
last_signal
=
-
1
;
Int_t
first_counter
=
-
1
;
Int_t
last_counter
=
-
1
;
for
(
ichan
=
clistp
->
begin
();
ichan
!=
clistp
->
end
();
++
ichan
)
{
Int_t
this_chan
=
(
*
ichan
).
channel
;
Int_t
this_counter
=
(
*
ichan
).
counter
;
Int_t
this_signal
=
(
*
ichan
).
signal
;
Int_t
this_plane
=
(
*
ichan
).
plane
;
if
(
last_chan
+
1
!=
this_chan
||
last_counter
+
1
!=
this_counter
||
last_plane
!=
this_plane
||
last_signal
!=
this_signal
)
{
if
(
last_chan
>=
0
)
{
if
(
ichan
!=
clistp
->
begin
())
{
detmap
->
AddModule
((
UShort_t
)
roc
,
(
UShort_t
)
slot
,
(
UShort_t
)
first_chan
,
(
UShort_t
)
last_chan
,
(
UInt_t
)
first_counter
,
model
,
(
Int_t
)
0
,
(
Int_t
)
-
1
,
(
UInt_t
)
last_plane
,
(
UInt_t
)
last_signal
);
}
first_chan
=
this_chan
;
first_counter
=
this_counter
;
}
last_chan
=
this_chan
;
last_counter
=
this_counter
;
last_plane
=
this_plane
;
last_signal
=
this_signal
;
}
cout
<<
" Channel "
<<
(
*
ichan
).
channel
<<
" "
<<
(
*
ichan
).
plane
<<
" "
<<
(
*
ichan
).
counter
<<
endl
;
}
detmap
->
AddModule
((
UShort_t
)
roc
,
(
UShort_t
)
slot
,
(
UShort_t
)
first_chan
,
(
UShort_t
)
last_chan
,
(
UInt_t
)
first_counter
,
model
,
(
Int_t
)
0
,
(
Int_t
)
-
1
,
(
UInt_t
)
last_plane
,
(
UInt_t
)
last_signal
);
}
return
(
0
);
return
(
0
);
}
}
...
@@ -186,10 +241,14 @@ void THcDetectorMap::Load(const char *fname)
...
@@ -186,10 +241,14 @@ void THcDetectorMap::Load(const char *fname)
if
(
nvals
==
4
)
{
if
(
nvals
==
4
)
{
signal
=
((
TObjString
*
)
vararr
->
At
(
3
))
->
GetString
().
Atoi
();
signal
=
((
TObjString
*
)
vararr
->
At
(
3
))
->
GetString
().
Atoi
();
}
}
cout
<<
channel
<<
" "
<<
plane
<<
" "
<<
counter
<<
" "
<<
signal
<<
endl
;
if
(
detector
==
2
)
{
cout
<<
detector
<<
" "
<<
roc
<<
" "
<<
slot
<<
" "
<<
channel
<<
" "
<<
plane
<<
" "
<<
counter
<<
" "
<<
signal
<<
endl
;
}
fTable
[
fNchans
].
roc
=
roc
;
fTable
[
fNchans
].
roc
=
roc
;
fTable
[
fNchans
].
roc
=
slot
;
fTable
[
fNchans
].
slot
=
slot
;
fTable
[
fNchans
].
channel
=
channel
;
fTable
[
fNchans
].
channel
=
channel
;
fTable
[
fNchans
].
did
=
detector
;
fTable
[
fNchans
].
did
=
detector
;
fTable
[
fNchans
].
plane
=
plane
;
fTable
[
fNchans
].
plane
=
plane
;
...
...
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