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
FU Chengdong
CEPCSW
Commits
cb27f4f4
Commit
cb27f4f4
authored
3 years ago
by
lintao@ihep.ac.cn
Browse files
Options
Downloads
Patches
Plain Diff
implement the rotation.
parent
fe3b8e8a
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
+26
-4
26 additions, 4 deletions
Generator/src/GtBeamBackgroundTool.cpp
Generator/src/GtBeamBackgroundTool.h
+6
-0
6 additions, 0 deletions
Generator/src/GtBeamBackgroundTool.h
with
32 additions
and
4 deletions
Generator/src/GtBeamBackgroundTool.cpp
+
26
−
4
View file @
cb27f4f4
#include
"GtBeamBackgroundTool.h"
#include
"GtBeamBackgroundTool.h"
#include
"IBeamBackgroundFileParser.h"
#include
"IBeamBackgroundFileParser.h"
#include
"BeamBackgroundFileParserV0.h"
#include
"BeamBackgroundFileParserV0.h"
#include
"TVector3.h"
// for rotation
DECLARE_COMPONENT
(
GtBeamBackgroundTool
)
DECLARE_COMPONENT
(
GtBeamBackgroundTool
)
StatusCode
GtBeamBackgroundTool
::
initialize
()
{
StatusCode
GtBeamBackgroundTool
::
initialize
()
{
...
@@ -9,8 +11,17 @@ StatusCode GtBeamBackgroundTool::initialize() {
...
@@ -9,8 +11,17 @@ StatusCode GtBeamBackgroundTool::initialize() {
// create the instances of the background parsers
// create the instances of the background parsers
for
(
auto
&
[
label
,
inputfn
]
:
m_inputmaps
)
{
for
(
auto
&
[
label
,
inputfn
]
:
m_inputmaps
)
{
double
beamE
=
120.
;
m_beaminputs
[
label
]
=
std
::
make_shared
<
BeamBackgroundFileParserV0
>
(
inputfn
,
11
,
125.
);
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
);
}
}
// check the size
// check the size
...
@@ -43,6 +54,17 @@ bool GtBeamBackgroundTool::mutate(MyHepMC::GenEvent& event) {
...
@@ -43,6 +54,17 @@ bool GtBeamBackgroundTool::mutate(MyHepMC::GenEvent& event) {
// fill the value
// fill the value
float
charge
=
beamdata
.
pdgid
==
11
?
-
1
:
1
;
float
charge
=
beamdata
.
pdgid
==
11
?
-
1
:
1
;
TVector3
pos
(
beamdata
.
x
,
beamdata
.
y
,
beamdata
.
z
);
TVector3
mom
(
beamdata
.
px
,
beamdata
.
py
,
beamdata
.
pz
);
auto
itrot
=
m_rotYmaps
.
find
(
label
);
if
(
itrot
!=
m_rotYmaps
.
end
()
)
{
info
()
<<
"Apply rotation along Y "
<<
itrot
->
second
<<
endmsg
;
pos
.
RotateY
(
itrot
->
second
);
mom
.
RotateY
(
itrot
->
second
);
}
// create the MC particle
// create the MC particle
edm4hep
::
MCParticle
mcp
=
event
.
m_mc_vec
.
create
();
edm4hep
::
MCParticle
mcp
=
event
.
m_mc_vec
.
create
();
mcp
.
setPDG
(
beamdata
.
pdgid
);
mcp
.
setPDG
(
beamdata
.
pdgid
);
...
@@ -51,8 +73,8 @@ bool GtBeamBackgroundTool::mutate(MyHepMC::GenEvent& event) {
...
@@ -51,8 +73,8 @@ bool GtBeamBackgroundTool::mutate(MyHepMC::GenEvent& event) {
mcp
.
setCharge
(
static_cast
<
float
>
(
charge
));
mcp
.
setCharge
(
static_cast
<
float
>
(
charge
));
mcp
.
setTime
(
beamdata
.
t
);
mcp
.
setTime
(
beamdata
.
t
);
mcp
.
setMass
(
beamdata
.
mass
);
mcp
.
setMass
(
beamdata
.
mass
);
mcp
.
setVertex
(
edm4hep
::
Vector3d
(
beamdata
.
x
,
beamdata
.
y
,
beamdata
.
z
));
mcp
.
setVertex
(
edm4hep
::
Vector3d
(
pos
.
X
(),
pos
.
Y
(),
pos
.
Z
()
));
mcp
.
setMomentum
(
edm4hep
::
Vector3f
(
beamdata
.
px
,
beamdata
.
py
,
beamdata
.
pz
));
mcp
.
setMomentum
(
edm4hep
::
Vector3f
(
mom
.
X
(),
mom
.
Y
(),
mom
.
Z
()
));
}
}
...
...
This diff is collapsed.
Click to expand it.
Generator/src/GtBeamBackgroundTool.h
+
6
−
0
View file @
cb27f4f4
...
@@ -51,6 +51,12 @@ private:
...
@@ -51,6 +51,12 @@ private:
Gaudi
::
Property
<
std
::
map
<
std
::
string
,
std
::
string
>>
m_fomatmaps
{
this
,
"InputFormatMap"
};
Gaudi
::
Property
<
std
::
map
<
std
::
string
,
std
::
string
>>
m_fomatmaps
{
this
,
"InputFormatMap"
};
Gaudi
::
Property
<
std
::
map
<
std
::
string
,
double
>>
m_ratemaps
{
this
,
"InputRateMap"
};
Gaudi
::
Property
<
std
::
map
<
std
::
string
,
double
>>
m_ratemaps
{
this
,
"InputRateMap"
};
// unit of beam energy: GeV
Gaudi
::
Property
<
std
::
map
<
std
::
string
,
double
>>
m_Ebeammaps
{
this
,
"InputBeamEnergyMap"
};
// unit of the rotation along Y: rad
Gaudi
::
Property
<
std
::
map
<
std
::
string
,
double
>>
m_rotYmaps
{
this
,
"RotationAlongYMap"
};
private
:
private
:
std
::
map
<
std
::
string
,
std
::
shared_ptr
<
IBeamBackgroundFileParser
>>
m_beaminputs
;
std
::
map
<
std
::
string
,
std
::
shared_ptr
<
IBeamBackgroundFileParser
>>
m_beaminputs
;
...
...
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