Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
KFParticle
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
pwg-c2f
analysis
KFParticle
Commits
89720111
Commit
89720111
authored
5 years ago
by
Lubynets
Browse files
Options
Downloads
Patches
Plain Diff
fix signum function
parent
2aa9bdc2
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
KFParticle/MFMap.cxx
+13
-13
13 additions, 13 deletions
KFParticle/MFMap.cxx
KFParticle/MFMap.h
+15
-15
15 additions, 15 deletions
KFParticle/MFMap.h
with
28 additions
and
28 deletions
KFParticle/MFMap.cxx
+
13
−
13
View file @
89720111
...
...
@@ -2,7 +2,7 @@
MFMap
*
MFMap
::
instance_
=
new
MFMap
();
float
signum
(
float
x
)
float
MFMap
::
signum
(
float
x
)
const
{
if
(
x
>
0.
)
return
1.
;
...
...
@@ -25,13 +25,13 @@ void MFMap::GetField(const float_v xyz[], float_v B[]) const
float
y
=
xyz
[
1
][
iv
];
float
z
=
xyz
[
2
][
iv
]
-
40.
;
//
float x_l = fabs(x); // CBM
//
float y_l = fabs(y);
//
float z_l = fabs(z);
float
x_l
=
fabs
(
x
);
// CBM
float
y_l
=
fabs
(
y
);
float
z_l
=
fabs
(
z
);
float
x_l
=
xyz
[
0
][
iv
];
float
y_l
=
xyz
[
1
][
iv
];
float
z_l
=
xyz
[
2
][
iv
];
// NA61/SHINE
//
float x_l = xyz[0][iv];
//
float y_l = xyz[1][iv];
//
float z_l = xyz[2][iv]; // NA61/SHINE
B
[
0
][
iv
]
=
0.
;
B
[
1
][
iv
]
=
0.
;
...
...
@@ -40,12 +40,12 @@ void MFMap::GetField(const float_v xyz[], float_v B[]) const
if
(
x_l
<=
hXlow
||
x_l
>=
hXup
||
y_l
<=
hYlow
||
y_l
>=
hYup
||
z_l
<=
hZlow
||
z_l
>=
hZup
)
continue
;
// CBM
if
(
x_l
!=
x_l
||
y_l
!=
y_l
||
z_l
!=
z_l
)
continue
;
// B[0][iv] = 10.*(histoBx_ -> Interpolate(x_l, y_l, z_l)*signum(x)*signum(y)); // CBM
// B[1][iv] = 10.*(histoBy_ -> Interpolate(x_l, y_l, z_l));
// B[2][iv] = 10.*(histoBz_ -> Interpolate(x_l, y_l, z_l)*signum(y)*signum(z));
B
[
0
][
iv
]
=
10.
*
(
histoBx_
->
Interpolate
(
x_l
,
y_l
,
z_l
));
// NA61/SHINE
B
[
0
][
iv
]
=
10.
*
(
histoBx_
->
Interpolate
(
x_l
,
y_l
,
z_l
)
*
signum
(
x
)
*
signum
(
y
));
// CBM
B
[
1
][
iv
]
=
10.
*
(
histoBy_
->
Interpolate
(
x_l
,
y_l
,
z_l
));
B
[
2
][
iv
]
=
10.
*
(
histoBz_
->
Interpolate
(
x_l
,
y_l
,
z_l
));
B
[
2
][
iv
]
=
10.
*
(
histoBz_
->
Interpolate
(
x_l
,
y_l
,
z_l
)
*
signum
(
y
)
*
signum
(
z
));
// B[0][iv] = 10.*(histoBx_ -> Interpolate(x_l, y_l, z_l)); // NA61/SHINE
// B[1][iv] = 10.*(histoBy_ -> Interpolate(x_l, y_l, z_l));
// B[2][iv] = 10.*(histoBz_ -> Interpolate(x_l, y_l, z_l));
}
};
This diff is collapsed.
Click to expand it.
KFParticle/MFMap.h
+
15
−
15
View file @
89720111
...
...
@@ -18,30 +18,30 @@ public:
protected
:
// MFMap() // CBM
// {
// fileMF_ = TFile::Open("/home/user/cbmdir/kfpf/kfpf_analysis_tree_converter/input/field_mapF.root", "read");
// // fileMF_ = TFile::Open("/lustre/cbm/users/lubynets/kfpf/macro/field_mapF.root", "read");
// histoBx_ = (TH3F*)fileMF_->Get("histoBx");
// histoBy_ = (TH3F*)fileMF_->Get("histoBy");
// histoBz_ = (TH3F*)fileMF_->Get("histoBz");
// };
MFMap
()
// NA61/SHINE
MFMap
()
// CBM
{
fileMF_
=
TFile
::
Open
(
"/home/user/cbmdir/kfpf/kfpf_analysis_tree_converter/input/na61mf.root"
,
"read"
);
histoBx_
=
(
TH3F
*
)
fileMF_
->
Get
(
"field_x"
);
histoBy_
=
(
TH3F
*
)
fileMF_
->
Get
(
"field_y"
);
histoBz_
=
(
TH3F
*
)
fileMF_
->
Get
(
"field_z"
);
fileMF_
=
TFile
::
Open
(
"/home/user/cbmdir/kfpf/kfpf_analysis_tree_converter/input/field_mapF.root"
,
"read"
);
// fileMF_ = TFile::Open("/lustre/cbm/users/lubynets/kfpf/macro/field_mapF.root", "read");
histoBx_
=
(
TH3F
*
)
fileMF_
->
Get
(
"histoBx"
);
histoBy_
=
(
TH3F
*
)
fileMF_
->
Get
(
"histoBy"
);
histoBz_
=
(
TH3F
*
)
fileMF_
->
Get
(
"histoBz"
);
};
// MFMap() // NA61/SHINE
// {
// fileMF_ = TFile::Open("/home/user/cbmdir/kfpf/kfpf_analysis_tree_converter/input/na61mf.root", "read");
// histoBx_ = (TH3F*)fileMF_->Get("field_x");
// histoBy_ = (TH3F*)fileMF_->Get("field_y");
// histoBz_ = (TH3F*)fileMF_->Get("field_z");
// };
virtual
~
MFMap
()
=
default
;
private
:
static
MFMap
*
instance_
;
//
float signum(float x)
; //TODO WHY not working in singleton?
float
signum
(
float
x
)
const
;
TFile
*
fileMF_
;
TH3F
*
histoBx_
;
...
...
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