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
f42cba7c
Commit
f42cba7c
authored
8 years ago
by
Stephen A. Wood
Committed by
Stephen A. Wood
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Make raster derived position/angles, with offsets available to Beamline
parent
d1fe1812
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/THcRaster.cxx
+30
-3
30 additions, 3 deletions
src/THcRaster.cxx
src/THcRaster.h
+9
-2
9 additions, 2 deletions
src/THcRaster.h
with
39 additions
and
5 deletions
src/THcRaster.cxx
+
30
−
3
View file @
f42cba7c
...
...
@@ -8,6 +8,8 @@
\author Buddhini Waidyawansa
*/
#include
"TMath.h"
#include
"THcRaster.h"
#include
"THaEvData.h"
#include
"THaDetMap.h"
...
...
@@ -17,7 +19,6 @@
#include
"THcGlobals.h"
#include
"THaGlobals.h"
//#include "THcHitList.h"
#include
<cstring>
...
...
@@ -84,11 +85,24 @@ Int_t THcRaster::ReadDatabase( const TDatime& date )
{
"frx_adcpercm"
,
&
fFrXADCperCM
,
kDouble
},
{
"fry_adcpercm"
,
&
fFrYADCperCM
,
kDouble
},
{
"pbeam"
,
&
fgpbeam
,
kDouble
},
{
"frx_dist"
,
&
fgfrx_dist
,
kDouble
},
{
"fry_dist"
,
&
fgfry_dist
,
kDouble
},
{
"beam_x"
,
&
fgbeam_xoff
,
kDouble
,
0
,
1
},
{
"beam_xp"
,
&
fgbeam_xpoff
,
kDouble
,
0
,
1
},
{
"beam_y"
,
&
fgbeam_yoff
,
kDouble
,
0
,
1
},
{
"beam_yp"
,
&
fgbeam_ypoff
,
kDouble
,
0
,
1
},
{
"usefr"
,
&
fgusefr
,
kInt
,
0
,
1
},
{
0
}
};
// Default offsets to zero
fgbeam_xoff
=
0.0
;
fgbeam_xpoff
=
0.0
;
fgbeam_yoff
=
0.0
;
fgbeam_ypoff
=
0.0
;
fgusefr
=
0
;
// get the calibration factors from gbeam.param file
gHcParms
->
LoadParmValues
((
DBRequest
*
)
&
list
,
prefix
);
gHcParms
->
LoadParmValues
((
DBRequest
*
)
&
list
,
prefix
);
return
kOK
;
...
...
@@ -298,8 +312,21 @@ Int_t THcRaster::Process( ){
// std::cout<<" X = "<<fXpos<<" Y = "<<fYpos<<std::endl;
fDirection
.
SetXYZ
(
0.0
,
0.0
,
1.0
);
// Set arbitrarily to avoid run time warnings
Double_t
tt
;
Double_t
tp
;
if
(
fgusefr
!=
0
)
{
fPosition
[
1
].
SetXYZ
(
fXpos
+
fgbeam_xoff
,
fYpos
+
fgbeam_yoff
,
0.0
);
tt
=
fXpos
/
fgfrx_dist
+
fgbeam_xpoff
;
tp
=
fYpos
/
fgfry_dist
+
fgbeam_ypoff
;
}
else
{
// Just use fixed beam position and angle
fPosition
[
0
].
SetXYZ
(
fgbeam_xoff
,
fgbeam_yoff
,
0.0
);
tt
=
fgbeam_xpoff
;
tp
=
fgbeam_ypoff
;
}
fDirection
.
SetXYZ
(
tt
,
tp
,
1.0
);
// Set arbitrarily to avoid run time warnings
fDirection
*=
1.0
/
TMath
::
Sqrt
(
1.0
+
tt
*
tt
+
tp
*
tp
);
return
0
;
}
...
...
This diff is collapsed.
Click to expand it.
src/THcRaster.h
+
9
−
2
View file @
f42cba7c
...
...
@@ -28,8 +28,8 @@ class THcRaster : public THaBeamDet, public THcHitList {
Int_t
Process
();
// TVector3 GetPosition() const { return fPosition[2]; }
TVector3
GetPosition
()
const
{
return
fPosition
[
0
];
}
TVector3
GetDirection
()
const
{
return
fDirection
;
}
// Hall C we don't use raster direction yet.
TVector3
GetPosition
()
const
{
return
fPosition
[
1
];
}
TVector3
GetDirection
()
const
{
return
fDirection
;
}
Double_t
GetCurrentX
()
{
return
fRawPos
[
0
];
}
Double_t
GetCurrentY
()
{
return
fRawPos
[
1
];
}
...
...
@@ -41,6 +41,13 @@ class THcRaster : public THaBeamDet, public THcHitList {
Int_t
DefineVariables
(
EMode
mode
);
Double_t
fgpbeam
;
//beam momentum
Double_t
fgfrx_dist
;
//Distance of raster to target
Double_t
fgfry_dist
;
Double_t
fgbeam_xoff
;
// Beam offsets
Double_t
fgbeam_xpoff
;
// Beam offsets
Double_t
fgbeam_yoff
;
// Beam offsets
Double_t
fgbeam_ypoff
;
// Beam offsets
Int_t
fgusefr
;
/* Use Raster for beam position */
Double_t
fRawXADC
;
// X raw ADC
Double_t
fRawYADC
;
// Y raw ADC
...
...
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