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
06818bae
Commit
06818bae
authored
5 years ago
by
lintao@ihep.ac.cn
Browse files
Options
Downloads
Patches
Plain Diff
WIP: migrate HepMCRdr.
parent
ed5c3d1a
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/HepMCRdr.cpp
+28
-10
28 additions, 10 deletions
Generator/src/HepMCRdr.cpp
Generator/src/HepMCRdr.h
+16
-6
16 additions, 6 deletions
Generator/src/HepMCRdr.h
with
45 additions
and
17 deletions
Generator/CMakeLists.txt
+
1
−
1
View file @
06818bae
...
@@ -10,7 +10,7 @@ set(GenAlgo_srcs
...
@@ -10,7 +10,7 @@ set(GenAlgo_srcs
# src/LCAscHepRdr.cc
# src/LCAscHepRdr.cc
# src/HepevtRdr.cpp
# src/HepevtRdr.cpp
src/SLCIORdr.cpp
src/SLCIORdr.cpp
#
src/HepMCRdr.cpp
src/HepMCRdr.cpp
src/GtGunTool.cpp
src/GtGunTool.cpp
)
)
set
(
GenAlgo_incs src
)
set
(
GenAlgo_incs src
)
...
...
This diff is collapsed.
Click to expand it.
Generator/src/HepMCRdr.cpp
+
28
−
10
View file @
06818bae
...
@@ -24,13 +24,7 @@
...
@@ -24,13 +24,7 @@
using
namespace
plcio
;
using
namespace
plcio
;
using
namespace
std
;
using
namespace
std
;
DECLARE_COMPONENT
(
HepMCRdr
)
HepMCRdr
::
HepMCRdr
(
string
name
){
ascii_in
=
new
HepMC
::
IO_GenEvent
(
name
.
c_str
(),
std
::
ios
::
in
);
m_processed_event
=
0
;
}
HepMCRdr
::~
HepMCRdr
(){
HepMCRdr
::~
HepMCRdr
(){
delete
ascii_in
;
delete
ascii_in
;
...
@@ -104,10 +98,34 @@ bool HepMCRdr::isEnd(){
...
@@ -104,10 +98,34 @@ bool HepMCRdr::isEnd(){
return
false
;
return
false
;
}
}
bool
HepMCRdr
::
configure
(){
bool
HepMCRdr
::
configure_gentool
(){
return
true
;
ascii_in
=
new
HepMC
::
IO_GenEvent
(
m_filename
.
value
().
c_str
(),
std
::
ios
::
in
);
m_processed_event
=
0
;
return
true
;
}
}
bool
HepMCRdr
::
finish
(){
bool
HepMCRdr
::
finish
(){
return
true
;
return
true
;
}
StatusCode
HepMCRdr
::
initialize
()
{
StatusCode
sc
;
if
(
not
configure_gentool
())
{
error
()
<<
"failed to initialize."
<<
endmsg
;
return
StatusCode
::
FAILURE
;
}
return
sc
;
}
StatusCode
HepMCRdr
::
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/HepMCRdr.h
+
16
−
6
View file @
06818bae
#ifndef HepMCRdr_h
#ifndef HepMCRdr_h
#define HepMCRdr_h 1
#define HepMCRdr_h 1
#include
"GaudiKernel/AlgTool.h"
#include
"GenReader.h"
#include
"GenReader.h"
#include
"GenEvent.h"
#include
"GenEvent.h"
...
@@ -8,19 +10,27 @@
...
@@ -8,19 +10,27 @@
#include
"HepMC/GenEvent.h"
#include
"HepMC/GenEvent.h"
class
HepMCRdr
:
public
GenReader
{
class
HepMCRdr
:
public
extends
<
AlgTool
,
GenReader
>
{
public:
public:
HepMCRdr
(
string
name
)
;
using
extends
::
extends
;
~
HepMCRdr
();
~
HepMCRdr
();
bool
configure
();
StatusCode
initialize
()
override
;
StatusCode
finalize
()
override
;
bool
configure_gentool
();
bool
mutate
(
MyHepMC
::
GenEvent
&
event
);
bool
mutate
(
MyHepMC
::
GenEvent
&
event
);
bool
finish
();
bool
finish
();
bool
isEnd
();
bool
isEnd
();
private:
private:
HepMC
::
IO_GenEvent
*
ascii_in
;
HepMC
::
IO_GenEvent
*
ascii_in
{
nullptr
};
long
m_total_event
;
long
m_total_event
{
-
1
};
long
m_processed_event
;
long
m_processed_event
{
-
1
};
// input file name
Gaudi
::
Property
<
std
::
string
>
m_filename
{
this
,
"Input"
};
};
};
#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