Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nptool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Admin message
Gitlab has been updated. More info
here
.
Show more breadcrumbs
np
nptool
Commits
f775c15e
Commit
f775c15e
authored
3 years ago
by
Adrien Matta
Browse files
Options
Downloads
Plain Diff
Merge branch 'NPTool.2.dev' of gitlab.in2p3.fr:np/nptool into NPTool.2.dev
parents
f1beae6e
de6d02b0
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
Projects/e793s/Analysis.cxx
+1
-1
1 addition, 1 deletion
Projects/e793s/Analysis.cxx
Projects/e793s/macro/BeamSpot/BeamSpot.C
+51
-21
51 additions, 21 deletions
Projects/e793s/macro/BeamSpot/BeamSpot.C
with
52 additions
and
22 deletions
Projects/e793s/Analysis.cxx
+
1
−
1
View file @
f775c15e
...
...
@@ -138,7 +138,7 @@ void Analysis::TreatEvent(){
}
}
TVector3
BeamDirection
(
XBeam
,
YBeam
,
1
);
TVector3
BeamDirection
(
0.
,
0.
,
1
.
);
BeamImpact
=
TVector3
(
XBeam
,
YBeam
,
m_DetectorManager
->
GetTargetZ
());
ParticleMult
=
M2
->
Si_E
.
size
()
+
MG
->
DSSD_E
.
size
();
...
...
This diff is collapsed.
Click to expand it.
Projects/e793s/macro/BeamSpot/BeamSpot.C
+
51
−
21
View file @
f775c15e
...
...
@@ -8,6 +8,8 @@
#include
<fstream>
#include
<vector>
#include
<cmath>
#include
<string>
#include
<sstream>
//Root
#include
<TVector3.h>
//NPTool
...
...
@@ -30,23 +32,23 @@ void BeamSpot(){
vector
<
double
>
Xd
,
Yd
,
Zd
;
//Vector of particle direction. Calculated as Xp-Xb, Yp-Yb...
ifstream
MugastDataFile
;
double
ThetaNormalTarget
;
TVector3
beamDir
{
0
.
0
,
0
.
0
,
1
.
0
};
gErrorIgnoreLevel
=
kWarning
;
// Suppress ".pdf created" lines
/*** ITERATIVE GRID CONTROLS ***/
/***** pos varied as offset ****/
/**/
double
xmin
=
+
0
.
0
2
0
;
/**/
/**/
double
xmax
=
+
0
.
0
8
0
;
/**/
/**/
unsigned
int
xdiv
=
1
2
;
/**/
/**/
double
xmin
=
-
8
.
0
0
0
;
/**/
/**/
double
xmax
=
+
2
.
0
0
0
;
/**/
/**/
unsigned
int
xdiv
=
1
0
;
/**/
/**/
/**/
/**/
double
ymin
=
-
0
.
0
5
0
;
/**/
/**/
double
ymax
=
+
0
.
0
5
0
;
/**/
/**/
double
ymin
=
-
5
.
0
0
0
;
/**/
/**/
double
ymax
=
+
5
.
0
0
0
;
/**/
/**/
unsigned
int
ydiv
=
10
;
/**/
/**/
/**/
/**/
double
zmin
=
-
0
.
0
5
0
;
/**/
/**/
double
zmax
=
+
0
.
0
5
0
;
/**/
/**/
unsigned
int
zdiv
=
2
;
/**/
/**/
double
zmin
=
-
5
.
0
0
0
;
/**/
/**/
double
zmax
=
+
5
.
0
0
0
;
/**/
/**/
unsigned
int
zdiv
=
10
;
/**/
/**/
/**/
/***** thick varied as %ge *****/
/**/
unsigned
int
tmin
=
7
;
/**/
...
...
@@ -56,19 +58,48 @@ void BeamSpot(){
/******* METRIC CONTROLS *******/
/**/
double
peakE
=
0
.
143
;
/**/
/**/
double
sigMultip
=
0
.
1
;
/**/
/**/
double
sigMultip
=
0
.
05
;
/**/
/*******************************/
// File name controls
const
char
*
XYZE_file
=
"XYZE_gammaGated_Full_TestThetaNormalTarget.txt"
;
const
char
*
outputMetric
=
"output_Run63_metrics_ThetaNormal.txt"
;
const
char
*
outputHisto
=
"output_Run63_histograms_ThetaNormal.root"
;
string
tag
;
string
addtag
;
cout
<<
"==================================================="
<<
endl
;
cout
<<
" Enter the version tag "
<<
endl
;
cout
<<
" (i.e. Run63_BeamDirectionCorrection)"
<<
endl
;
cout
<<
" - - - - - - - - - - - - - - - - - - - - - - - - - "
<<
endl
;
getline
(
cin
,
tag
);
cout
<<
" - - - - - - - - - - - - - - - - - - - - - - - - - "
<<
endl
;
cout
<<
" Additional output tagging? Coarse, fine? "
<<
endl
;
cout
<<
" - - - - - - - - - - - - - - - - - - - - - - - - - "
<<
endl
;
getline
(
cin
,
addtag
);
string
XYZE_string
=
"XYZE_"
;
XYZE_string
.
append
(
tag
);
XYZE_string
.
append
(
".txt"
);
string
out_string
=
"output_"
;
out_string
.
append
(
tag
);
out_string
.
append
(
"_"
);
out_string
.
append
(
addtag
);
string
met_string
=
out_string
;
met_string
.
append
(
"_metrics.txt"
);
string
hst_string
=
out_string
;
hst_string
.
append
(
"_histograms.root"
);
const
char
*
XYZE_file
=
XYZE_string
.
c_str
();
const
char
*
outputMetric
=
met_string
.
c_str
();
const
char
*
outputHisto
=
hst_string
.
c_str
();
// Calculate size of iteratve steps
double
xstp
=
(
xmax
-
xmin
)
/
((
double
)
xdiv
);
double
ystp
=
(
ymax
-
ymin
)
/
((
double
)
ydiv
);
double
zstp
=
(
zmax
-
zmin
)
/
((
double
)
zdiv
);
cout
<<
"Xstp = "
<<
xstp
<<
" Ystp = "
<<
ystp
<<
" Zstp = "
<<
zstp
<<
endl
;
cout
<<
"==================================================="
<<
endl
;
cout
<<
" X: "
<<
xmin
<<
" to "
<<
xmax
<<
" in steps of "
<<
xstp
<<
endl
;
cout
<<
" Y: "
<<
ymin
<<
" to "
<<
ymax
<<
" in steps of "
<<
ystp
<<
endl
;
cout
<<
" Z: "
<<
zmin
<<
" to "
<<
zmax
<<
" in steps of "
<<
zstp
<<
endl
;
cout
<<
"==================================================="
<<
endl
;
// Vectors of the normal for each detector. UPDATE WITH NEW POSITIONS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
TVector3
MugastNormal1
{
-
0
.
453915
,
+
0
.
455463
,
-
0
.
765842
};
...
...
@@ -157,7 +188,6 @@ void BeamSpot(){
ThetaNormalTarget
=
tempTheta
=
ELab
=
Ex
=
0
.
0
;
switch
(
DetNum
[
i
]){
case
1
:
tempTheta
=
particleDir
.
Angle
(
MugastNormal1
);
...
...
@@ -182,9 +212,9 @@ void BeamSpot(){
return
;
// Exit code
}
// Change beam
spot
vector to inverse beam direction
vector
beam
Spot
.
SetZ
(
-
1
.
0
);
ThetaNormalTarget
=
particleDir
.
Angle
(
beam
Spot
);
// Change beam
Dir
vector to inverse beam direction
beam
Dir
.
SetZ
(
-
1
.
0
);
ThetaNormalTarget
=
particleDir
.
Angle
(
beam
Dir
);
//micrometer defined in NPSystemOfUnits.h
ELab
=
LightAl
.
EvaluateInitialEnergy
(
...
...
@@ -196,9 +226,9 @@ void BeamSpot(){
0
.
5
*
TargetThickness
,
//pass through half target
ThetaNormalTarget
);
//angle leaving target
// Change beam
spot
vector
to beam
direction
vector
beam
Spot
.
SetZ
(
1
.
0
);
Ex
=
reaction
.
ReconstructRelativistic
(
ELab
,
particleDir
.
Angle
(
beam
Spot
));
// Change beam
Dir
vector
back to forward
direction
beam
Dir
.
SetZ
(
1
.
0
);
Ex
=
reaction
.
ReconstructRelativistic
(
ELab
,
particleDir
.
Angle
(
beam
Dir
));
// Fill Ex histograms
tempHist
->
Fill
(
Ex
);
...
...
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