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
0772e1ad
Commit
0772e1ad
authored
12 years ago
by
Stephen A. Wood
Browse files
Options
Downloads
Patches
Plain Diff
Get Drift Chamber plane names from variable in hcana.param instead
of hardwiring them.
parent
97af94f2
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/PARAM/hcana.param
+3
-0
3 additions, 0 deletions
examples/PARAM/hcana.param
src/THcDriftChamber.cxx
+13
-37
13 additions, 37 deletions
src/THcDriftChamber.cxx
with
16 additions
and
37 deletions
examples/PARAM/hcana.param
+
3
−
0
View file @
0772e1ad
...
@@ -8,3 +8,6 @@ hhodo_num_planes = 4
...
@@ -8,3 +8,6 @@ hhodo_num_planes = 4
hshower_num_layers = 4
hshower_num_layers = 4
haero_num_pairs = 8
haero_num_pairs = 8
# Names of planes so that parameter names can be constructed
hdc_plane_names = "1x1 1y1 1u1 1v1 1y2 1x2 2x1 2y1 2u1 2v1 2y2 2x2"
This diff is collapsed.
Click to expand it.
src/THcDriftChamber.cxx
+
13
−
37
View file @
0772e1ad
...
@@ -72,45 +72,21 @@ void THcDriftChamber::Setup(const char* name, const char* description)
...
@@ -72,45 +72,21 @@ void THcDriftChamber::Setup(const char* name, const char* description)
cout
<<
"Drift Chambers: "
<<
fNPlanes
<<
" planes in "
<<
fNChambers
<<
" chambers"
<<
endl
;
cout
<<
"Drift Chambers: "
<<
fNPlanes
<<
" planes in "
<<
fNChambers
<<
" chambers"
<<
endl
;
// Can't put strings in DBRequest yet
string
planelistvarname
=
" dc_plane_names"
;
planelistvarname
[
0
]
=
prefix
[
0
];
vector
<
string
>
plane_names
=
vsplit
(
gHcParms
->
GetString
(
planelistvarname
));
if
(
plane_names
.
size
()
!=
(
UInt_t
)
fNPlanes
)
{
cout
<<
"ERROR: Number of planes "
<<
fNPlanes
<<
" doesn't agree with number of plane names "
<<
plane_names
.
size
()
<<
endl
;
// Should quit. Is there an official way to quit?
}
fPlaneNames
=
new
char
*
[
fNPlanes
];
fPlaneNames
=
new
char
*
[
fNPlanes
];
for
(
Int_t
i
=
0
;
i
<
fNPlanes
;
i
++
)
{
fPlaneNames
[
i
]
=
new
char
[
4
];}
for
(
Int_t
i
=
0
;
i
<
fNPlanes
;
i
++
)
{
fPlaneNames
[
i
]
=
new
char
[
plane_names
[
i
].
length
()];
// Big hack needed because the drift map parameters are in parameters with
strcpy
(
fPlaneNames
[
i
],
plane_names
[
i
].
c_str
());
// names like hwc1x1fract. Need to do some kind of parameter name mapping
// or generate the names from the wire angle (alpha)
if
(
prefix
[
0
]
==
'h'
)
{
strcpy
(
fPlaneNames
[
0
],
"1x1"
);
strcpy
(
fPlaneNames
[
1
],
"1y1"
);
strcpy
(
fPlaneNames
[
2
],
"1u1"
);
strcpy
(
fPlaneNames
[
3
],
"1v1"
);
strcpy
(
fPlaneNames
[
4
],
"1y2"
);
strcpy
(
fPlaneNames
[
5
],
"1x2"
);
strcpy
(
fPlaneNames
[
6
],
"2x1"
);
strcpy
(
fPlaneNames
[
7
],
"2y1"
);
strcpy
(
fPlaneNames
[
8
],
"2u1"
);
strcpy
(
fPlaneNames
[
9
],
"2v1"
);
strcpy
(
fPlaneNames
[
10
],
"2y2"
);
strcpy
(
fPlaneNames
[
11
],
"2x2"
);
}
else
if
(
prefix
[
0
]
==
's'
)
{
strcpy
(
fPlaneNames
[
0
],
"1u1"
);
strcpy
(
fPlaneNames
[
1
],
"1u2"
);
strcpy
(
fPlaneNames
[
2
],
"1x1"
);
strcpy
(
fPlaneNames
[
3
],
"1x2"
);
strcpy
(
fPlaneNames
[
4
],
"1v1"
);
strcpy
(
fPlaneNames
[
5
],
"1v2"
);
strcpy
(
fPlaneNames
[
6
],
"2u1"
);
strcpy
(
fPlaneNames
[
7
],
"2u2"
);
strcpy
(
fPlaneNames
[
8
],
"2x1"
);
strcpy
(
fPlaneNames
[
9
],
"2x2"
);
strcpy
(
fPlaneNames
[
10
],
"2v1"
);
strcpy
(
fPlaneNames
[
11
],
"2v2"
);
}
else
{
cout
<<
"Unknown Spectrometer Prefix '"
<<
prefix
<<
"' Guessing names"
<<
endl
;
for
(
Int_t
i
=
0
;
i
<
fNPlanes
;
i
++
)
{
sprintf
(
fPlaneNames
[
i
],
"%d"
,
i
+
1
);
}
}
}
char
*
desc
=
new
char
[
strlen
(
description
)
+
100
];
char
*
desc
=
new
char
[
strlen
(
description
)
+
100
];
fPlanes
=
new
THcDriftChamberPlane
*
[
fNPlanes
];
fPlanes
=
new
THcDriftChamberPlane
*
[
fNPlanes
];
...
...
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