Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CEPCSW
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
Li Zhihao
CEPCSW
Commits
5212a942
Commit
5212a942
authored
2 years ago
by
lintao@ihep.ac.cn
Browse files
Options
Downloads
Patches
Plain Diff
register Guinea-Pig parser in GtBeamBackgroundTool.
parent
18d2a302
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Generator/src/GtBeamBackgroundTool.cpp
+41
-10
41 additions, 10 deletions
Generator/src/GtBeamBackgroundTool.cpp
Generator/src/GtBeamBackgroundTool.h
+6
-1
6 additions, 1 deletion
Generator/src/GtBeamBackgroundTool.h
with
47 additions
and
11 deletions
Generator/src/GtBeamBackgroundTool.cpp
+
41
−
10
View file @
5212a942
#include
"GtBeamBackgroundTool.h"
#include
"IBeamBackgroundFileParser.h"
#include
"BeamBackgroundFileParserV0.h"
#include
"GuineaPigPairsFileParser.h"
#include
"TVector3.h"
// for rotation
DECLARE_COMPONENT
(
GtBeamBackgroundTool
)
...
...
@@ -11,17 +13,21 @@ StatusCode GtBeamBackgroundTool::initialize() {
// create the instances of the background parsers
for
(
auto
&
[
label
,
inputfn
]
:
m_inputmaps
)
{
double
beamE
=
120.
;
auto
itBeamE
=
m_Ebeammaps
.
find
(
label
);
if
(
itBeamE
!=
m_Ebeammaps
.
end
())
{
beamE
=
itBeamE
->
second
;
std
::
string
format
=
"BeamBackgroundFileParserV0"
;
auto
itFormat
=
m_formatmaps
.
find
(
label
);
if
(
itFormat
!=
m_formatmaps
.
end
())
{
format
=
itFormat
->
second
;
}
if
(
format
==
"BeamBackgroundFileParserV0"
)
{
init_BeamBackgroundFileParserV0
(
label
,
inputfn
);
}
else
if
(
format
==
"GuineaPigPairsFileParser"
)
{
init_GuineaPigPairsFileParser
(
label
,
inputfn
);
}
else
{
init_BeamBackgroundFileParserV0
(
label
,
inputfn
);
}
info
()
<<
"Initializing beam background ... "
<<
label
<<
" "
<<
beamE
<<
" "
<<
inputfn
<<
endmsg
;
m_beaminputs
[
label
]
=
std
::
make_shared
<
BeamBackgroundFileParserV0
>
(
inputfn
,
11
,
beamE
);
}
// check the size
...
...
@@ -89,3 +95,28 @@ bool GtBeamBackgroundTool::configure_gentool() {
return
true
;
}
bool
GtBeamBackgroundTool
::
init_BeamBackgroundFileParserV0
(
const
std
::
string
&
label
,
const
std
::
string
&
inputfn
)
{
double
beamE
=
120.
;
auto
itBeamE
=
m_Ebeammaps
.
find
(
label
);
if
(
itBeamE
!=
m_Ebeammaps
.
end
())
{
beamE
=
itBeamE
->
second
;
}
info
()
<<
"Initializing beam background ... "
<<
label
<<
" "
<<
beamE
<<
" "
<<
inputfn
<<
endmsg
;
m_beaminputs
[
label
]
=
std
::
make_shared
<
BeamBackgroundFileParserV0
>
(
inputfn
,
11
,
beamE
);
return
true
;
}
bool
GtBeamBackgroundTool
::
init_GuineaPigPairsFileParser
(
const
std
::
string
&
label
,
const
std
::
string
&
inputfn
)
{
m_beaminputs
[
label
]
=
std
::
make_shared
<
GuineaPigPairsFileParser
>
(
inputfn
);
return
true
;
}
This diff is collapsed.
Click to expand it.
Generator/src/GtBeamBackgroundTool.h
+
6
−
1
View file @
5212a942
...
...
@@ -46,9 +46,14 @@ public:
bool
finish
()
override
;
bool
configure_gentool
()
override
;
private:
bool
init_BeamBackgroundFileParserV0
(
const
std
::
string
&
label
,
const
std
::
string
&
inputfn
);
bool
init_GuineaPigPairsFileParser
(
const
std
::
string
&
label
,
const
std
::
string
&
inputfn
);
private:
Gaudi
::
Property
<
std
::
map
<
std
::
string
,
std
::
string
>>
m_inputmaps
{
this
,
"InputFileMap"
};
Gaudi
::
Property
<
std
::
map
<
std
::
string
,
std
::
string
>>
m_fomatmaps
{
this
,
"InputFormatMap"
};
Gaudi
::
Property
<
std
::
map
<
std
::
string
,
std
::
string
>>
m_fo
r
matmaps
{
this
,
"InputFormatMap"
};
Gaudi
::
Property
<
std
::
map
<
std
::
string
,
double
>>
m_ratemaps
{
this
,
"InputRateMap"
};
// unit of beam energy: GeV
...
...
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