Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
imager
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
NML
imager
Commits
e7b4f0c9
Commit
e7b4f0c9
authored
3 years ago
by
mingf2
Browse files
Options
Downloads
Patches
Plain Diff
update image in parallel
parent
0feaa065
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CMakeLists.txt
+1
-0
1 addition, 0 deletions
CMakeLists.txt
Sources/CMakeLists.txt
+1
-1
1 addition, 1 deletion
Sources/CMakeLists.txt
Sources/gui.cpp
+5
-4
5 additions, 4 deletions
Sources/gui.cpp
Sources/main.cpp
+1
-1
1 addition, 1 deletion
Sources/main.cpp
with
8 additions
and
6 deletions
CMakeLists.txt
+
1
−
0
View file @
e7b4f0c9
...
@@ -7,6 +7,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
...
@@ -7,6 +7,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# find_package(ROOT 6.22 CONFIG REQUIRED)
# find_package(ROOT 6.22 CONFIG REQUIRED)
find_package
(
ROOT 6.22 CONFIG REQUIRED COMPONENTS Gui
)
find_package
(
ROOT 6.22 CONFIG REQUIRED COMPONENTS Gui
)
find_package
(
OpenMP REQUIRED
)
include_directories
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/Headers
)
include_directories
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/Headers
)
...
...
This diff is collapsed.
Click to expand it.
Sources/CMakeLists.txt
+
1
−
1
View file @
e7b4f0c9
...
@@ -11,7 +11,7 @@ add_library(gui SHARED gui.cpp)
...
@@ -11,7 +11,7 @@ add_library(gui SHARED gui.cpp)
ROOT_GENERATE_DICTIONARY
(
G__gui ../Headers/gui.h
ROOT_GENERATE_DICTIONARY
(
G__gui ../Headers/gui.h
LINKDEF ../Headers/guiLinkDef.h
LINKDEF ../Headers/guiLinkDef.h
MODULE gui
)
MODULE gui
)
target_link_libraries
(
gui PUBLIC setup ROOT::Gpad ROOT::Gui
)
target_link_libraries
(
gui PUBLIC setup ROOT::Gpad ROOT::Gui
OpenMP::OpenMP_CXX
)
add_executable
(
main main.cpp
)
add_executable
(
main main.cpp
)
target_link_libraries
(
main PUBLIC setup simulation gui ROOT::Gpad ROOT::Gui
)
target_link_libraries
(
main PUBLIC setup simulation gui ROOT::Gpad ROOT::Gui
)
...
...
This diff is collapsed.
Click to expand it.
Sources/gui.cpp
+
5
−
4
View file @
e7b4f0c9
...
@@ -189,18 +189,19 @@ void MyMainFrame::addCone(const std::vector<Cone> cones){
...
@@ -189,18 +189,19 @@ void MyMainFrame::addCone(const std::vector<Cone> cones){
// std::cout << "Projecting cones onto the designated spherical surface..."<<std::endl;
// std::cout << "Projecting cones onto the designated spherical surface..."<<std::endl;
double
alpha
(
0
);
double
alpha
(
0
);
double
beta
(
0
);
double
beta
(
0
);
for
(
const
Cone
&
event
:
cones
)
// for (const Cone& event : cones)
for
(
int
k
=
0
;
k
<
cones
.
size
();
k
++
)
{
{
// update the image
// update the image
//TODO: add the uncertainty
//TODO: add the uncertainty
alpha
=
event
.
cosHalfAngle
;
alpha
=
cones
[
k
].
cosHalfAngle
;
#pragma omp parallel for
for
(
int
i
=
0
;
i
<
config
->
thetaBins
;
i
++
)
for
(
int
i
=
0
;
i
<
config
->
thetaBins
;
i
++
)
{
{
for
(
int
j
=
0
;
j
<
config
->
phiBins
;
j
++
)
for
(
int
j
=
0
;
j
<
config
->
phiBins
;
j
++
)
{
{
beta
=
getCosAngle
(
event
.
apex
-
config
->
xbs
[
i
][
j
],
event
.
axis
);
double
beta
=
getCosAngle
(
cones
[
k
]
.
apex
-
config
->
xbs
[
i
][
j
],
cones
[
k
]
.
axis
);
histo
->
SetBinContent
(
j
+
1
,
i
+
1
,
histo
->
GetBinContent
(
j
+
1
,
i
+
1
)
+
std
::
exp
(
-
(
beta
-
alpha
)
*
(
beta
-
alpha
)
/
0.002
));
histo
->
SetBinContent
(
j
+
1
,
i
+
1
,
histo
->
GetBinContent
(
j
+
1
,
i
+
1
)
+
std
::
exp
(
-
(
beta
-
alpha
)
*
(
beta
-
alpha
)
/
0.002
));
// histo->SetBinContent(j+1, i+1, std::exp(-(beta-alpha)*(beta-alpha) / 0.002));
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Sources/main.cpp
+
1
−
1
View file @
e7b4f0c9
...
@@ -35,7 +35,7 @@ int main(int argc, char** argv) {
...
@@ -35,7 +35,7 @@ int main(int argc, char** argv) {
// update image
// update image
myMainFrame
->
addCone
(
cones
);
myMainFrame
->
addCone
(
cones
);
myMainFrame
->
counts
+=
config
->
chuckSize
;
myMainFrame
->
counts
+=
config
->
chuckSize
;
std
::
cout
<<
"Total counts: "
<<
myMainFrame
->
counts
<<
".
"
<<
coneQueue
->
size_approx
()
<<
" events left in queue."
<<
'
\n
'
;
std
::
cout
<<
"Total counts: "
<<
myMainFrame
->
counts
<<
".
\n
"
;
}
}
// gSystem->Sleep(100);
// gSystem->Sleep(100);
...
...
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