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
0ab46de3
Commit
0ab46de3
authored
13 years ago
by
Stephen A. Wood
Browse files
Options
Downloads
Patches
Plain Diff
Checkin of days work. Starting to convert Hall C to Hall A detector map.
parent
0e623d16
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/HallC_LinkDef.h
+1
-0
1 addition, 0 deletions
src/HallC_LinkDef.h
src/THcDetectorMap.cxx
+76
-6
76 additions, 6 deletions
src/THcDetectorMap.cxx
src/THcDetectorMap.h
+34
-11
34 additions, 11 deletions
src/THcDetectorMap.h
src/THcHodoscope.cxx
+1
-0
1 addition, 0 deletions
src/THcHodoscope.cxx
with
112 additions
and
17 deletions
src/HallC_LinkDef.h
+
1
−
0
View file @
0ab46de3
...
...
@@ -5,6 +5,7 @@
#pragma link off all functions;
#pragma link C++ global gHcParms;
#pragma link C++ global gHcDetectorMap;
#pragma link C++ class THcInterface+;
#pragma link C++ class THcParmList+;
...
...
This diff is collapsed.
Click to expand it.
src/THcDetectorMap.cxx
+
76
−
6
View file @
0ab46de3
...
...
@@ -32,11 +32,70 @@ inline static bool IsComment( const string& s, string::size_type pos )
(
s
[
pos
]
==
'!'
)
);
}
virtual
Int_t
THcDetectorMap
::
FillMap
(
THaDetMap
*
detmap
,
string
*
detectorname
)
{
Int_t
detectorid
=
3
;
// Get this from detectorname
// Loop through the list looking for all hardware channels that
// are detectorid. Sort and try to minimize AddModule calls
//_____________________________________________________________________________
THcDetectorMap
::
THcDetectorMap
()
:
fNchans
(
0
)
{
}
//_____________________________________________________________________________
THcDetectorMap
::~
THcDetectorMap
()
{
}
//bool THcDetectorMap::compare(const ChaninMod *first, const ChaninMod *second) {
// return((first->channel < second->channel)? true: false);
//}
struct
Functor
{
bool
operator
()
(
const
THcDetectorMap
::
ChaninMod
&
first
,
const
THcDetectorMap
::
ChaninMod
&
second
)
{
return
((
first
.
channel
<
second
.
channel
)
?
true
:
false
);}
};
//_____________________________________________________________________________
Int_t
THcDetectorMap
::
FillMap
(
THaDetMap
*
detmap
,
const
char
*
detectorname
)
// Should probably return a status
{
list
<
ModChanList
>::
iterator
imod
;
ChaninMod
Achan
;
ModChanList
Amod
;
// Need one array of uniq crate/slot combos
// Translate detector name into and ID
Int_t
did
=
3
;
// Get this from detectorname
mlist
.
clear
();
for
(
Int_t
ich
=
0
;
ich
<
fNchans
;
ich
++
)
{
if
(
fTable
[
ich
].
did
==
did
)
{
Int_t
roc
=
fTable
[
ich
].
roc
;
Int_t
slot
=
fTable
[
ich
].
slot
;
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
)
{
(
*
imod
).
clist
.
push_back
(
Achan
);
}
}
if
(
imod
==
mlist
.
end
())
{
Amod
.
roc
=
roc
;
Amod
.
slot
=
slot
;
Amod
.
clist
.
clear
();
Amod
.
clist
.
push_back
(
Achan
);
mlist
.
push_back
(
Amod
);
}
}
}
if
(
mlist
.
size
()
<=
0
)
{
return
(
-
1
);
}
Functor
f
;
for
(
imod
=
mlist
.
begin
();
imod
!=
mlist
.
end
();
++
imod
)
{
list
<
ChaninMod
>
*
clistp
=
&
((
*
imod
).
clist
);
clistp
->
sort
(
f
);
//Sort by channel
}
return
(
0
);
}
void
THcDetectorMap
::
Load
(
const
char
*
fname
)
...
...
@@ -60,6 +119,8 @@ void THcDetectorMap::Load(const char *fname)
Int_t
detector
=
0
;
Int_t
slot
=
0
;
fNchans
=
0
;
string
::
size_type
start
,
pos
=
0
;
char
varname
[
100
];
...
...
@@ -126,7 +187,16 @@ void THcDetectorMap::Load(const char *fname)
signal
=
((
TObjString
*
)
vararr
->
At
(
3
))
->
GetString
().
Atoi
();
}
cout
<<
channel
<<
" "
<<
plane
<<
" "
<<
counter
<<
" "
<<
signal
<<
endl
;
fTable
[
fNchans
].
roc
=
roc
;
fTable
[
fNchans
].
roc
=
slot
;
fTable
[
fNchans
].
channel
=
channel
;
fTable
[
fNchans
].
did
=
detector
;
fTable
[
fNchans
].
plane
=
plane
;
fTable
[
fNchans
].
counter
=
counter
;
fTable
[
fNchans
].
signal
=
signal
;
fNchans
++
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/THcDetectorMap.h
+
34
−
11
View file @
0ab46de3
...
...
@@ -8,23 +8,46 @@
//////////////////////////////////////////////////////////////////////////
#include
"TObject.h"
#include
"THaDetMap.h"
#include
<list>
class
THcDetectorMap
:
public
TObject
{
public:
THcDetectorMap
()
{}
virtual
~
THcDetectorMap
()
{}
THcDetectorMap
()
;
virtual
~
THcDetectorMap
()
;
virtual
void
Load
(
const
char
*
fname
);
// Member variables needed
// List of detector IDs.
// Hardware to logical detector mapping for each detector
// Mapping between detector names and numbers
// Hardwire, but later configure
struct
Detector
{
UInt_t
did
;
// Numberical Detector ID
TList
*
virtual
Int_t
FillMap
(
THaDetMap
*
detmap
,
const
char
*
detectorname
);
Int_t
fNchans
;
// Number of hardware channels
struct
Channel
{
// Mapping for one hardware channel
Int_t
roc
;
Int_t
slot
;
Int_t
channel
;
Int_t
did
;
Int_t
plane
;
Int_t
counter
;
Int_t
signal
;
};
Channel
fTable
[
10000
];
// Big ugly cache of the map file
struct
ChaninMod
{
Int_t
channel
;
Int_t
plane
;
Int_t
counter
;
Int_t
signal
;
};
struct
ModChanList
{
Int_t
roc
;
Int_t
slot
;
std
::
list
<
ChaninMod
>
clist
;
};
std
::
list
<
ModChanList
>
mlist
;
bool
compare
(
const
ChaninMod
*
first
,
const
ChaninMod
*
second
);
protected
:
...
...
This diff is collapsed.
Click to expand it.
src/THcHodoscope.cxx
+
1
−
0
View file @
0ab46de3
...
...
@@ -53,6 +53,7 @@ THcHodoscope::THcHodoscope( ) :
//_____________________________________________________________________________
THaAnalysisObject
::
EStatus
THcHodoscope
::
Init
(
const
TDatime
&
date
)
{
static
const
char
*
const
here
=
"Init()"
;
// Extra initialization for scintillators: set up DataDest map
if
(
THaNonTrackingDetector
::
Init
(
date
)
)
...
...
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