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
Show more breadcrumbs
np
nptool
Commits
94dc0140
Commit
94dc0140
authored
3 years ago
by
Adrien Matta
Browse files
Options
Downloads
Patches
Plain Diff
* Optimisation of SamuraiFieldMap
parent
3b5f1d04
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#121760
passed
3 years ago
Stage: build-NPLib
Stage: build-NPSimulation
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
NPLib/Detectors/Samurai/SamuraiFieldMap.cxx
+3
-10
3 additions, 10 deletions
NPLib/Detectors/Samurai/SamuraiFieldMap.cxx
with
3 additions
and
10 deletions
NPLib/Detectors/Samurai/SamuraiFieldMap.cxx
+
3
−
10
View file @
94dc0140
...
...
@@ -50,12 +50,8 @@ double SamuraiFieldMap::Delta(const double* parameter){
// Move the fdc2 pos from lab frame to fdc2 frame
pos
.
back
().
RotateY
(
-
m_fdc2angle
+
m_angle
);
// cout << parameter[0] << " " << pos.back().X()-m_FitPosFDC2.X() << endl;
// m_FitPosFDC2.Print();
// pos.back().Print();
double
d
=
(
pos
.
back
().
X
()
-
m_FitPosFDC2
.
X
())
*
(
pos
.
back
().
X
()
-
m_FitPosFDC2
.
X
());
//diff = pos.back()-m_FitPosFDC2;
//diff.Print();
return
d
;
//return diff.Mag2();
}
...
...
@@ -74,13 +70,10 @@ double SamuraiFieldMap::FindBrho(TVector3 p_fdc0,TVector3 d_fdc0,TVector3 p_fdc2
double
b0
[
1
]
=
{
m_BrhoScan
->
Eval
(
p_fdc2
.
X
())};
m_min
->
Clear
();
m_min
->
SetPrecision
(
1e-
5
);
m_min
->
SetPrecision
(
1e-
6
);
m_min
->
SetMaxFunctionCalls
(
1000
);
m_min
->
SetLimitedVariable
(
0
,
"B"
,
b0
[
0
],
1
,
1
,
10
);
m_min
->
SetLimitedVariable
(
0
,
"B"
,
b0
[
0
],
0.
1
,
1
,
10
);
m_min
->
Minimize
();
//cout << Delta(m_min->X()) << endl;
// exit(1);
//cout << m_min->NCalls() << endl;
return
m_min
->
X
()[
0
];
}
...
...
@@ -173,7 +166,7 @@ std::vector< TVector3 > SamuraiFieldMap::Propagate(double Brho, TVector3 pos, TV
double
py
=
P
*
dir
.
Y
();
//py
double
pz
=
P
*
dir
.
Z
();
//pz
TVector3
imp
=
P
*
dir
;
double
h
=
0.
1
*
nanosecond
;
// typical step length ~1mm at beta 0.6
double
h
=
1
*
nanosecond
;
while
(
r
<=
m_Rmax
&&
count
<
limit
){
func
(
N
,
pos
,
imp
,
xk1
,
pk1
);
func
(
N
,
pos
+
xk1
*
(
h
/
2.
),
imp
+
pk1
*
(
h
/
2.
)
,
xk2
,
pk2
);
...
...
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