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
e9c7163a
Commit
e9c7163a
authored
8 years ago
by
Stephen A. Wood
Browse files
Options
Downloads
Patches
Plain Diff
Improve Doxygen comments in THcDetectorMap
parent
53a4457e
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
+50
-36
50 additions, 36 deletions
src/THcDetectorMap.cxx
with
50 additions
and
36 deletions
src/THcDetectorMap.cxx
+
50
−
36
View file @
e9c7163a
...
@@ -51,9 +51,13 @@ struct Functor
...
@@ -51,9 +51,13 @@ struct Functor
//_____________________________________________________________________________
//_____________________________________________________________________________
Int_t
THcDetectorMap
::
FillMap
(
THaDetMap
*
detmap
,
const
char
*
detectorname
)
Int_t
THcDetectorMap
::
FillMap
(
THaDetMap
*
detmap
,
const
char
*
detectorname
)
{
{
// Build a DAQ hardware to detector element map for detector detectorname
/**
// Reads through the entire list of mappings, adding one element to
\param detmap destination of DAQ hardware to detector element map
// detmap for each electronics channel that maps to detectorname.
\param name of the detector
Called be each detector object to build a DAQ hardware to detector
element map for the detector.
*/
list
<
ModChanList
>::
iterator
imod
;
list
<
ModChanList
>::
iterator
imod
;
list
<
ChaninMod
>::
iterator
ichan
;
list
<
ChaninMod
>::
iterator
ichan
;
...
@@ -142,15 +146,15 @@ Int_t THcDetectorMap::FillMap(THaDetMap *detmap, const char *detectorname)
...
@@ -142,15 +146,15 @@ Int_t THcDetectorMap::FillMap(THaDetMap *detmap, const char *detectorname)
Int_t
this_signal
=
(
*
ichan
).
signal
;
Int_t
this_signal
=
(
*
ichan
).
signal
;
Int_t
this_plane
=
(
*
ichan
).
plane
;
Int_t
this_plane
=
(
*
ichan
).
plane
;
Int_t
this_refchan
=
(
*
ichan
).
refchan
;
Int_t
this_refchan
=
(
*
ichan
).
refchan
;
if
(
last_chan
+
1
!=
this_chan
||
last_counter
+
1
!=
this_counter
if
(
last_chan
+
1
!=
this_chan
||
last_counter
+
1
!=
this_counter
||
last_plane
!=
this_plane
||
last_signal
!=
this_signal
||
last_plane
!=
this_plane
||
last_signal
!=
this_signal
||
last_refchan
!=
this_refchan
)
{
||
last_refchan
!=
this_refchan
)
{
if
(
last_chan
>=
0
)
{
if
(
last_chan
>=
0
)
{
if
(
ichan
!=
clistp
->
begin
())
{
if
(
ichan
!=
clistp
->
begin
())
{
// cout << "AddModule " << slot << " " << first_chan <<
// cout << "AddModule " << slot << " " << first_chan <<
// " " << last_chan << " " << first_counter << endl;
// " " << last_chan << " " << first_counter << endl;
detmap
->
AddModule
((
UShort_t
)
roc
,
(
UShort_t
)
slot
,
detmap
->
AddModule
((
UShort_t
)
roc
,
(
UShort_t
)
slot
,
(
UShort_t
)
first_chan
,
(
UShort_t
)
last_chan
,
(
UShort_t
)
first_chan
,
(
UShort_t
)
last_chan
,
(
UInt_t
)
first_counter
,
model
,
(
Int_t
)
-
1
,
(
UInt_t
)
first_counter
,
model
,
(
Int_t
)
-
1
,
(
Int_t
)
last_refchan
,
(
UInt_t
)
last_plane
,
(
UInt_t
)
last_signal
);
(
Int_t
)
last_refchan
,
(
UInt_t
)
last_plane
,
(
UInt_t
)
last_signal
);
}
}
...
@@ -167,42 +171,53 @@ Int_t THcDetectorMap::FillMap(THaDetMap *detmap, const char *detectorname)
...
@@ -167,42 +171,53 @@ Int_t THcDetectorMap::FillMap(THaDetMap *detmap, const char *detectorname)
// (*ichan).plane << " " << (*ichan).counter << endl;
// (*ichan).plane << " " << (*ichan).counter << endl;
}
}
detmap
->
AddModule
((
UShort_t
)
roc
,
(
UShort_t
)
slot
,
detmap
->
AddModule
((
UShort_t
)
roc
,
(
UShort_t
)
slot
,
(
UShort_t
)
first_chan
,
(
UShort_t
)
last_chan
,
(
UShort_t
)
first_chan
,
(
UShort_t
)
last_chan
,
(
UInt_t
)
first_counter
,
model
,
(
Int_t
)
0
,
(
UInt_t
)
first_counter
,
model
,
(
Int_t
)
0
,
(
Int_t
)
-
1
,
(
UInt_t
)
last_plane
,
(
UInt_t
)
last_signal
);
(
Int_t
)
-
1
,
(
UInt_t
)
last_plane
,
(
UInt_t
)
last_signal
);
}
}
return
(
0
);
return
(
0
);
}
}
//_____________________________________________________________________________
//_____________________________________________________________________________
void
THcDetectorMap
::
Load
(
const
char
*
fname
)
void
THcDetectorMap
::
Load
(
const
char
*
fname
)
{
{
// Load a Hall C ENGINE style detector map file. The map file maps
/**
// a given roc, slot/module, and channel # into a given detector id#, plane
\param fname name of file containing ENGINE style detector map
// number, counter number and signal type. The mapping between detector
// names and ids is found in the comments at the begging of the map file.
Load a Hall C ENGINE style detector map file. The map file maps
// This method looks for those comments, of the form:
a given roc, slot/module, and channel # into a given detector id#, plane
// XXX_ID = n
number, counter number and signal type. The mapping between detector
// to establish that mapping between detector name and detector ID.
names and ids is found in the comments at the begging of the map file.
//
This method looks for those comments, of the form:
// Lines of the form
* XXX_ID = n
// DETECTOR = n
to establish that mapping between detector name and detector ID.
// ROC = n
// SLOT = n
Lines of the form
// are used to establish the module (roc and slot) and the detector
~~~~
// for the mapping lines that follow.
DETECTOR = n
// The actual mappings are of the form
ROC = n
// subadd, plane, counter [, signal]
SLOT = n
// Each of these lines, combined with the detector, roc, slot values
~~~~
// establish the roc, slot, subadess -> detector, plane, counter#, sigtype map
are used to establish the module (roc and slot) and the detector
// Other lines that may be in the map file are
for the mapping lines that follow.
// NSUBADD = n
// BSUB = n
The actual mappings are of the form
// MASK = hex value
~~~~
// These define characteristics of the electronics module (# channels,
subadd, plane, counter [, signal]
// The bit number specifying the location of the subaddress in a data word
~~~~
// and hex mask that the data word is anded with to retrieve data)
Each of these lines, combined with the detector, roc, slot values
establish the roc, slot, subadess -> detector, plane, counter#, sigtype map
Other lines that may be in the map file are
~~~~
NSUBADD = n
BSUB = n
MASK = hex value
~~~~
These define characteristics of the electronics module (# channels,
The bit number specifying the location of the subaddress in a data word
and hex mask that the data word is anded with to retrieve data)
*/
static
const
char
*
const
whtspc
=
"
\t
"
;
static
const
char
*
const
whtspc
=
"
\t
"
;
...
@@ -279,7 +294,7 @@ void THcDetectorMap::Load(const char *fname)
...
@@ -279,7 +294,7 @@ void THcDetectorMap::Load(const char *fname)
// Decide if line is ROC/NSUBADD/MASK/BSUB/DETECTOR/SLOT = something
// Decide if line is ROC/NSUBADD/MASK/BSUB/DETECTOR/SLOT = something
// or chan, plane, counter[, signal]
// or chan, plane, counter[, signal]
if
((
pos
=
line
.
find_first_of
(
"="
))
!=
string
::
npos
)
{
// Setting parameter
if
((
pos
=
line
.
find_first_of
(
"="
))
!=
string
::
npos
)
{
// Setting parameter
strcpy
(
varname
,
(
line
.
substr
(
0
,
pos
)).
c_str
());
strcpy
(
varname
,
(
line
.
substr
(
0
,
pos
)).
c_str
());
Int_t
valuestartpos
=
pos
+
1
;
Int_t
valuestartpos
=
pos
+
1
;
...
@@ -291,7 +306,7 @@ void THcDetectorMap::Load(const char *fname)
...
@@ -291,7 +306,7 @@ void THcDetectorMap::Load(const char *fname)
// << line.substr(commapos+1) << "|" << endl;
// << line.substr(commapos+1) << "|" << endl;
value
=
atoi
(
line
.
substr
(
valuestartpos
,
commapos
-
valuestartpos
).
c_str
());
value
=
atoi
(
line
.
substr
(
valuestartpos
,
commapos
-
valuestartpos
).
c_str
());
value2
=
atoi
(
line
.
substr
(
commapos
+
1
).
c_str
());
value2
=
atoi
(
line
.
substr
(
commapos
+
1
).
c_str
());
}
else
{
}
else
{
value
=
atoi
(
line
.
substr
(
valuestartpos
).
c_str
());
value
=
atoi
(
line
.
substr
(
valuestartpos
).
c_str
());
}
}
// Some if statements
// Some if statements
...
@@ -362,4 +377,3 @@ void THcDetectorMap::Load(const char *fname)
...
@@ -362,4 +377,3 @@ void THcDetectorMap::Load(const char *fname)
cout
<<
endl
;
cout
<<
endl
;
}
}
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