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
5d858f20
Commit
5d858f20
authored
1 month ago
by
audrey.chatillon
Browse files
Options
Downloads
Patches
Plain Diff
[Epic] adjust the energy loss per fix bin length
parent
61774eaa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#385197
passed
1 month ago
Stage: build-NPLib
Stage: build-NPSimulation
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
NPSimulation/Detectors/Epic/Epic.cc
+2
-14
2 additions, 14 deletions
NPSimulation/Detectors/Epic/Epic.cc
with
2 additions
and
14 deletions
NPSimulation/Detectors/Epic/Epic.cc
+
2
−
14
View file @
5d858f20
...
@@ -571,7 +571,6 @@ void Epic::ReadSensitive(const G4Event* ){
...
@@ -571,7 +571,6 @@ void Epic::ReadSensitive(const G4Event* ){
vector
<
double
>
de
;
vector
<
double
>
de
;
vector
<
double
>
dt
;
vector
<
double
>
dt
;
bool
end_of_new_trackID
=
false
;
bool
end_of_new_trackID
=
false
;
//cout << "step_name.size() = " << step_name.size() << endl;
for
(
int
j
=
0
;
j
<
step_name
.
size
();
j
++
){
for
(
int
j
=
0
;
j
<
step_name
.
size
();
j
++
){
if
(
step_trackID
.
at
(
j
)
!=
previous_trackID
){
if
(
step_trackID
.
at
(
j
)
!=
previous_trackID
){
...
@@ -587,8 +586,6 @@ void Epic::ReadSensitive(const G4Event* ){
...
@@ -587,8 +586,6 @@ void Epic::ReadSensitive(const G4Event* ){
if
(
end_of_new_trackID
==
true
||
j
==
step_name
.
size
()
-
1
)
{
if
(
end_of_new_trackID
==
true
||
j
==
step_name
.
size
()
-
1
)
{
if
(
name_pertrackID
!=
"e-"
&&
name_pertrackID
!=
"anti_nu_e"
){
if
(
name_pertrackID
!=
"e-"
&&
name_pertrackID
!=
"anti_nu_e"
){
//cout << "================================================" << endl;
//cout << "TrackID " << trackID << " time_pertrackID = " << time_pertrackID << endl;
int
num_bins
=
(
int
)(
std
::
ceil
(
(
m_Distance_AK
-
dz
.
at
(
dz
.
size
()
-
1
))
/
(
25.
*
um
)
))
;
int
num_bins
=
(
int
)(
std
::
ceil
(
(
m_Distance_AK
-
dz
.
at
(
dz
.
size
()
-
1
))
/
(
25.
*
um
)
))
;
vector
<
double
>
rebinned_dz
;
rebinned_dz
.
resize
(
num_bins
);
vector
<
double
>
rebinned_dz
;
rebinned_dz
.
resize
(
num_bins
);
vector
<
double
>
rebinned_de
;
rebinned_de
.
assign
(
num_bins
,
0.0
);
vector
<
double
>
rebinned_de
;
rebinned_de
.
assign
(
num_bins
,
0.0
);
...
@@ -596,11 +593,7 @@ void Epic::ReadSensitive(const G4Event* ){
...
@@ -596,11 +593,7 @@ void Epic::ReadSensitive(const G4Event* ){
double
bin_Limits
[
num_bins
+
1
];
double
bin_Limits
[
num_bins
+
1
];
for
(
int
bin
=
0
;
bin
<=
num_bins
;
bin
++
)
bin_Limits
[
bin
]
=
m_Distance_AK
*
mm
-
bin
*
(
25.
*
um
);
for
(
int
bin
=
0
;
bin
<=
num_bins
;
bin
++
)
bin_Limits
[
bin
]
=
m_Distance_AK
*
mm
-
bin
*
(
25.
*
um
);
// FIRST STEP
//cout << " step #0" << " de = " << de.at(0) << " dz = " << dz.at(0) << endl;
rebinned_de
[
0
]
=
de
.
at
(
0
);
rebinned_de
[
0
]
=
de
.
at
(
0
);
// INERMEDIATE STEP
int
bin_current
=
0
;
int
bin_current
=
0
;
for
(
int
step
=
1
;
step
<
dz
.
size
()
-
1
;
step
++
){
for
(
int
step
=
1
;
step
<
dz
.
size
()
-
1
;
step
++
){
double
dzmax
=
0.5
*
(
dz
.
at
(
step
-
1
)
+
dz
.
at
(
step
));
double
dzmax
=
0.5
*
(
dz
.
at
(
step
-
1
)
+
dz
.
at
(
step
));
...
@@ -609,30 +602,25 @@ void Epic::ReadSensitive(const G4Event* ){
...
@@ -609,30 +602,25 @@ void Epic::ReadSensitive(const G4Event* ){
if
(
bin_Limits
[
bin
]
>=
dzmax
&&
dzmax
>
bin_Limits
[
bin
+
1
]
&&
bin_Limits
[
bin
]
>
dzmin
&&
dzmin
>=
bin_Limits
[
bin
+
1
]){
if
(
bin_Limits
[
bin
]
>=
dzmax
&&
dzmax
>
bin_Limits
[
bin
+
1
]
&&
bin_Limits
[
bin
]
>
dzmin
&&
dzmin
>=
bin_Limits
[
bin
+
1
]){
bin_current
=
bin
;
bin_current
=
bin
;
rebinned_de
[
bin
]
+=
de
.
at
(
step
);
rebinned_de
[
bin
]
+=
de
.
at
(
step
);
//cout << "full step is in the bin" << bin << endl;
break
;
break
;
}
}
else
if
(
bin
<
num_bins
-
1
&&
bin_Limits
[
bin
]
>=
dzmax
&&
dzmax
>
bin_Limits
[
bin
+
1
]
&&
bin_Limits
[
bin
+
1
]
>
dzmin
&&
dzmin
>=
bin_Limits
[
bin
+
2
]){
else
if
(
bin
<
num_bins
-
1
&&
bin_Limits
[
bin
]
>=
dzmax
&&
dzmax
>
bin_Limits
[
bin
+
1
]
&&
bin_Limits
[
bin
+
1
]
>
dzmin
&&
dzmin
>=
bin_Limits
[
bin
+
2
]){
bin_current
=
bin
;
bin_current
=
bin
;
// to do calculate the weight
double
weight
=
(
dzmax
-
bin_Limits
[
bin
+
1
])
/
(
dzmax
-
dzmin
);
double
weight
=
0
;
rebinned_de
[
bin
]
+=
weight
*
de
.
at
(
step
);
rebinned_de
[
bin
]
+=
weight
*
de
.
at
(
step
);
rebinned_de
[
bin
+
1
]
+=
(
1
-
weight
)
*
de
.
at
(
step
);
rebinned_de
[
bin
+
1
]
+=
(
1
-
weight
)
*
de
.
at
(
step
);
//cout << "step is share over two bin " << bin << " and bin " << bin+1 << endl;
break
;
break
;
}
}
}
}
}
}
// FIXME : LAST BIN
rebinned_de
[
num_bins
-
1
]
+=
de
.
at
(
dz
.
at
(
dz
.
size
()
-
1
));
//for(int i = 0 ; i< num_bins; i++) cout << "rebinned_de[" << i << "] = " << rebinned_de.at(i) << endl;
m_Event
->
Set
(
trackID
,
m_Event
->
Set
(
trackID
,
name_pertrackID
,
name_pertrackID
,
m_mapping_A
[
Anode
],
// set anode number
m_mapping_A
[
Anode
],
// set anode number
influence_pertrackID
,
// set Q1 FF or alpha only
influence_pertrackID
,
// set Q1 FF or alpha only
time_pertrackID
,
// set Time
time_pertrackID
,
// set Time
dz
,
rebinned_de
,
dt
);
dz
,
rebinned_de
,
dt
);
// rebinned_dz, rebinned_de, rebinned_dt);
}
}
trackID
=
step_trackID
.
at
(
j
);
trackID
=
step_trackID
.
at
(
j
);
name_pertrackID
=
step_name
.
at
(
j
);
name_pertrackID
=
step_name
.
at
(
j
);
...
...
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