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
659b4773
Commit
659b4773
authored
10 years ago
by
Stephen A. Wood
Browse files
Options
Downloads
Patches
Plain Diff
Convert Reconstruction coefs/exps to vector of structures
parent
b99f35d0
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
src/THcHallCSpectrometer.cxx
+14
-24
14 additions, 24 deletions
src/THcHallCSpectrometer.cxx
src/THcHallCSpectrometer.h
+15
-5
15 additions, 5 deletions
src/THcHallCSpectrometer.h
with
29 additions
and
29 deletions
src/THcHallCSpectrometer.cxx
+
14
−
24
View file @
659b4773
...
@@ -147,14 +147,7 @@ Bool_t THcHallCSpectrometer::GetTrSorting() const
...
@@ -147,14 +147,7 @@ Bool_t THcHallCSpectrometer::GetTrSorting() const
void
THcHallCSpectrometer
::
InitializeReconstruction
()
void
THcHallCSpectrometer
::
InitializeReconstruction
()
{
{
fNReconTerms
=
0
;
fNReconTerms
=
0
;
for
(
Int_t
i
=
0
;
i
<
fMaxReconElements
;
i
++
)
{
fReconTerms
.
clear
();
for
(
Int_t
j
=
0
;
j
<
4
;
j
++
)
{
fReconCoeff
[
i
][
j
]
=
0.0
;
}
for
(
Int_t
j
=
0
;
j
<
5
;
j
++
)
{
fReconExponents
[
i
][
j
]
=
0
;
}
}
fAngSlope_x
=
0.0
;
fAngSlope_x
=
0.0
;
fAngSlope_y
=
0.0
;
fAngSlope_y
=
0.0
;
fAngOffset_x
=
0.0
;
fAngOffset_x
=
0.0
;
...
@@ -301,22 +294,19 @@ Int_t THcHallCSpectrometer::ReadDatabase( const TDatime& date )
...
@@ -301,22 +294,19 @@ Int_t THcHallCSpectrometer::ReadDatabase( const TDatime& date )
good
=
getline
(
ifile
,
line
).
good
();
good
=
getline
(
ifile
,
line
).
good
();
// cout << line << endl;
// cout << line << endl;
fNReconTerms
=
0
;
fNReconTerms
=
0
;
fReconTerms
.
clear
();
fReconTerms
.
reserve
(
500
);
//cout << "Reading matrix elements" << endl;
//cout << "Reading matrix elements" << endl;
while
(
good
&&
line
.
compare
(
0
,
4
,
" ---"
)
!=
0
)
{
while
(
good
&&
line
.
compare
(
0
,
4
,
" ---"
)
!=
0
)
{
if
(
fNReconTerms
>=
fMaxReconElements
)
{
fReconTerms
.
push_back
(
reconTerm
());
Error
(
here
,
"too much data in reconstruction coefficient file %s"
,
reconCoeffFilename
.
c_str
());
return
kInitError
;
// Is this the right return code?
}
sscanf
(
line
.
c_str
(),
" %le %le %le %le %1d%1d%1d%1d%1d"
sscanf
(
line
.
c_str
(),
" %le %le %le %le %1d%1d%1d%1d%1d"
,
&
fReconCoeff
[
fNReconTerms
][
0
],
&
fReconCoeff
[
fNReconTerms
][
1
]
,
&
fReconTerms
[
fNReconTerms
].
Coeff
[
0
],
&
fReconTerms
[
fNReconTerms
].
Coeff
[
1
]
,
&
fReconCoeff
[
fNReconTerms
][
2
],
&
fReconCoeff
[
fNReconTerms
][
3
]
,
&
fReconTerms
[
fNReconTerms
].
Coeff
[
2
],
&
fReconTerms
[
fNReconTerms
].
Coeff
[
3
]
,
&
fReconExponents
[
fNReconTerms
][
0
]
,
&
fReconTerms
[
fNReconTerms
].
Exp
[
0
]
,
&
fReconExponents
[
fNReconTerms
][
1
]
,
&
fReconTerms
[
fNReconTerms
].
Exp
[
1
]
,
&
fReconExponents
[
fNReconTerms
][
2
]
,
&
fReconTerms
[
fNReconTerms
].
Exp
[
2
]
,
&
fReconExponents
[
fNReconTerms
][
3
]
,
&
fReconTerms
[
fNReconTerms
].
Exp
[
3
]
,
&
fReconExponents
[
fNReconTerms
][
4
]);
,
&
fReconTerms
[
fNReconTerms
].
Exp
[
4
]);
// Parse line into fReconCoeff[fNReconTerms][0 - 3] and
// fReconExponents[fNReconTerms][0 - 5]
fNReconTerms
++
;
fNReconTerms
++
;
good
=
getline
(
ifile
,
line
).
good
();
good
=
getline
(
ifile
,
line
).
good
();
}
}
...
@@ -372,12 +362,12 @@ Int_t THcHallCSpectrometer::FindVertices( TClonesArray& tracks )
...
@@ -372,12 +362,12 @@ Int_t THcHallCSpectrometer::FindVertices( TClonesArray& tracks )
for
(
Int_t
iterm
=
0
;
iterm
<
fNReconTerms
;
iterm
++
)
{
for
(
Int_t
iterm
=
0
;
iterm
<
fNReconTerms
;
iterm
++
)
{
Double_t
term
=
1.0
;
Double_t
term
=
1.0
;
for
(
Int_t
j
=
0
;
j
<
5
;
j
++
)
{
for
(
Int_t
j
=
0
;
j
<
5
;
j
++
)
{
if
(
fRecon
Exponent
s
[
iterm
][
j
]
!=
0
)
{
if
(
fRecon
Term
s
[
iterm
]
.
Exp
[
j
]
!=
0
)
{
term
*=
pow
(
hut_rot
[
j
],
fRecon
Exponent
s
[
iterm
][
j
]);
term
*=
pow
(
hut_rot
[
j
],
fRecon
Term
s
[
iterm
]
.
Exp
[
j
]);
}
}
}
}
for
(
Int_t
k
=
0
;
k
<
4
;
k
++
)
{
for
(
Int_t
k
=
0
;
k
<
4
;
k
++
)
{
sum
[
k
]
+=
term
*
fRecon
Coeff
[
iterm
][
k
];
sum
[
k
]
+=
term
*
fRecon
Terms
[
iterm
]
.
Coeff
[
k
];
}
}
}
}
// Transfer results to track
// Transfer results to track
...
...
This diff is collapsed.
Click to expand it.
src/THcHallCSpectrometer.h
+
15
−
5
View file @
659b4773
...
@@ -94,12 +94,22 @@ protected:
...
@@ -94,12 +94,22 @@ protected:
THcShower
*
fShower
;
THcShower
*
fShower
;
THcHodoscope
*
fHodo
;
THcHodoscope
*
fHodo
;
// Should look at the ThaMatrixElement class in THaVDC.h for better way
// to store matrix element data
#define fMaxReconElements 1000
Int_t
fNReconTerms
;
Int_t
fNReconTerms
;
Double_t
fReconCoeff
[
fMaxReconElements
][
4
];
struct
reconTerm
{
Int_t
fReconExponents
[
fMaxReconElements
][
5
];
Double_t
Coeff
[
4
];
Int_t
Exp
[
5
];
reconTerm
()
{
for
(
Int_t
i
=
0
;
i
<
4
;
i
++
)
{
Coeff
[
i
]
=
0.0
;
}
for
(
Int_t
i
=
0
;
i
<
5
;
i
++
)
{
Exp
[
i
]
=
0
;
}
}
};
std
::
vector
<
reconTerm
>
fReconTerms
;
// Double_t fReconCoeff[fMaxReconElements][4];
// Int_t fReconExponents[fMaxReconElements][5];
Double_t
fAngSlope_x
;
Double_t
fAngSlope_x
;
Double_t
fAngSlope_y
;
Double_t
fAngSlope_y
;
Double_t
fAngOffset_x
;
Double_t
fAngOffset_x
;
...
...
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