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
1a375c42
Commit
1a375c42
authored
5 years ago
by
lintao@ihep.ac.cn
Browse files
Options
Downloads
Patches
Plain Diff
WIP: migrate GenPrinter.
parent
69c55ed8
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Generator/CMakeLists.txt
+1
-1
1 addition, 1 deletion
Generator/CMakeLists.txt
Generator/src/GenPrinter.cpp
+32
-14
32 additions, 14 deletions
Generator/src/GenPrinter.cpp
Generator/src/GenPrinter.h
+12
-7
12 additions, 7 deletions
Generator/src/GenPrinter.h
with
45 additions
and
22 deletions
Generator/CMakeLists.txt
+
1
−
1
View file @
1a375c42
...
@@ -6,7 +6,7 @@ set(GenAlgo_srcs
...
@@ -6,7 +6,7 @@ set(GenAlgo_srcs
src/GenEvent.cpp
src/GenEvent.cpp
src/GenReader.cpp
src/GenReader.cpp
src/StdHepRdr.cpp
src/StdHepRdr.cpp
#
src/GenPrinter.cpp
src/GenPrinter.cpp
# src/LCAscHepRdr.cc
# src/LCAscHepRdr.cc
# src/HepevtRdr.cpp
# src/HepevtRdr.cpp
# src/SLCIORdr.cpp
# src/SLCIORdr.cpp
...
...
This diff is collapsed.
Click to expand it.
Generator/src/GenPrinter.cpp
+
32
−
14
View file @
1a375c42
#include
"GenPrinter.h"
#include
"GenPrinter.h"
#include
"GenEvent.h"
#include
"GenEvent.h"
GenPrinter
::
GenPrinter
(
string
name
){}
DECLARE_COMPONENT
(
GenPrinter
)
GenPrinter
::~
GenPrinter
(){
}
bool
GenPrinter
::
mutate
(
MyHepMC
::
GenEvent
&
event
){
bool
GenPrinter
::
mutate
(
MyHepMC
::
GenEvent
&
event
){
std
::
cout
<<
"print mc info for event "
<<
event
.
getID
()
<<
", mc size ="
<<
event
.
m_mc_vec
.
size
()
<<
std
::
endl
;
std
::
cout
<<
"print mc info for event "
<<
event
.
getID
()
<<
", mc size ="
<<
event
.
m_mc_vec
.
size
()
<<
std
::
endl
;
...
@@ -19,12 +15,12 @@ bool GenPrinter::mutate(MyHepMC::GenEvent& event){
...
@@ -19,12 +15,12 @@ bool GenPrinter::mutate(MyHepMC::GenEvent& event){
<<
"Charge :"
<<
p
.
getCharge
()
<<
std
::
endl
<<
"Charge :"
<<
p
.
getCharge
()
<<
std
::
endl
<<
"Time :"
<<
p
.
getTime
()
<<
std
::
endl
<<
"Time :"
<<
p
.
getTime
()
<<
std
::
endl
<<
"Mass :"
<<
p
.
getMass
()
<<
std
::
endl
<<
"Mass :"
<<
p
.
getMass
()
<<
std
::
endl
<<
"Vertex :"
<<
p
.
getVertex
()
[
0
]
<<
std
::
endl
<<
"Vertex :"
<<
p
.
getVertex
()
<<
std
::
endl
<<
"Endpoint :"
<<
p
.
getEndpoint
()
[
1
]
<<
std
::
endl
<<
"Endpoint :"
<<
p
.
getEndpoint
()
<<
std
::
endl
<<
"Momentum :"
<<
p
.
getMomentum
()
[
2
]
<<
std
::
endl
<<
"Momentum :"
<<
p
.
getMomentum
()
<<
std
::
endl
<<
"MomentumAtEndpoint:"
<<
p
.
getMomentumAtEndpoint
()
[
0
]
<<
std
::
endl
<<
"MomentumAtEndpoint:"
<<
p
.
getMomentumAtEndpoint
()
<<
std
::
endl
<<
"Spin :"
<<
p
.
getSpin
()
[
1
]
<<
std
::
endl
<<
"Spin :"
<<
p
.
getSpin
()
<<
std
::
endl
<<
"ColorFlow :"
<<
p
.
getColorFlow
()
[
1
]
<<
std
::
endl
<<
"ColorFlow :"
<<
p
.
getColorFlow
()
<<
std
::
endl
<<
"Parent size :"
<<
p
.
parents_size
()
<<
std
::
endl
<<
"Parent size :"
<<
p
.
parents_size
()
<<
std
::
endl
<<
"Daughter size :"
<<
p
.
daughters_size
()
<<
std
::
endl
;
<<
"Daughter size :"
<<
p
.
daughters_size
()
<<
std
::
endl
;
//for(unsigned int j=0; j<p.parents_size(); j++) std::cout << " for parent: "<< j << ",PDG="<< p.getParents(j).getPDG() << ",id=:"<< p.getParents(j).id()<<std::endl;
//for(unsigned int j=0; j<p.parents_size(); j++) std::cout << " for parent: "<< j << ",PDG="<< p.getParents(j).getPDG() << ",id=:"<< p.getParents(j).id()<<std::endl;
...
@@ -33,10 +29,32 @@ bool GenPrinter::mutate(MyHepMC::GenEvent& event){
...
@@ -33,10 +29,32 @@ bool GenPrinter::mutate(MyHepMC::GenEvent& event){
return
true
;
return
true
;
}
}
bool
GenPrinter
::
configure
(){
bool
GenPrinter
::
configure
_gentool
(){
return
true
;
return
true
;
}
}
bool
GenPrinter
::
finish
(){
bool
GenPrinter
::
finish
(){
return
true
;
return
true
;
}
}
StatusCode
GenPrinter
::
initialize
()
{
StatusCode
sc
;
if
(
not
configure_gentool
())
{
error
()
<<
"failed to initialize."
<<
endmsg
;
return
StatusCode
::
FAILURE
;
}
return
sc
;
}
StatusCode
GenPrinter
::
finalize
()
{
StatusCode
sc
;
if
(
not
finish
())
{
error
()
<<
"Failed to finalize."
<<
endmsg
;
return
StatusCode
::
FAILURE
;
}
return
sc
;
}
This diff is collapsed.
Click to expand it.
Generator/src/GenPrinter.h
+
12
−
7
View file @
1a375c42
#ifndef GenPrinter_h
#ifndef GenPrinter_h
#define GenPrinter_h 1
#define GenPrinter_h 1
#include
<GaudiKernel/AlgTool.h>
#include
"GenEvent.h"
#include
"GenEvent.h"
#include
"IGenTool.h"
#include
"IGenTool.h"
using
namespace
std
;
using
namespace
std
;
class
GenPrinter
:
public
IGenTool
{
class
GenPrinter
:
public
extends
<
AlgTool
,
IGenTool
>
{
public:
using
extends
::
extends
;
public:
// Overriding initialize and finalize
GenPrinter
(
string
name
);
StatusCode
initialize
()
override
;
~
GenPrinter
();
StatusCode
finalize
()
override
;
bool
configure
()
override
;
bool
mutate
(
MyHepMC
::
GenEvent
&
event
)
override
;
public:
bool
finish
()
override
;
bool
configure_gentool
()
override
;
bool
mutate
(
MyHepMC
::
GenEvent
&
event
)
override
;
bool
finish
()
override
;
};
};
#endif
#endif
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