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
ed5c3d1a
Commit
ed5c3d1a
authored
5 years ago
by
lintao@ihep.ac.cn
Browse files
Options
Downloads
Patches
Plain Diff
WIP: migrate SLCIORdr.cpp.
parent
1a375c42
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/SLCIORdr.cpp
+30
-9
30 additions, 9 deletions
Generator/src/SLCIORdr.cpp
Generator/src/SLCIORdr.h
+21
-9
21 additions, 9 deletions
Generator/src/SLCIORdr.h
with
52 additions
and
19 deletions
Generator/CMakeLists.txt
+
1
−
1
View file @
ed5c3d1a
...
...
@@ -9,7 +9,7 @@ set(GenAlgo_srcs
src/GenPrinter.cpp
# src/LCAscHepRdr.cc
# src/HepevtRdr.cpp
#
src/SLCIORdr.cpp
src/SLCIORdr.cpp
# src/HepMCRdr.cpp
src/GtGunTool.cpp
)
...
...
This diff is collapsed.
Click to expand it.
Generator/src/SLCIORdr.cpp
+
30
−
9
View file @
ed5c3d1a
...
...
@@ -31,13 +31,7 @@ using namespace IMPL;
using
namespace
plcio
;
using
namespace
std
;
SLCIORdr
::
SLCIORdr
(
string
name
){
m_slcio_rdr
=
IOIMPL
::
LCFactory
::
getInstance
()
->
createLCReader
();
m_slcio_rdr
->
open
(
name
.
c_str
());
m_processed_event
=
0
;
}
DECLARE_COMPONENT
(
SLCIORdr
)
SLCIORdr
::~
SLCIORdr
(){
delete
m_slcio_rdr
;
...
...
@@ -160,10 +154,37 @@ bool SLCIORdr::isEnd(){
return
false
;
}
bool
SLCIORdr
::
configure
(){
return
true
;
bool
SLCIORdr
::
configure_gentool
(){
m_slcio_rdr
=
IOIMPL
::
LCFactory
::
getInstance
()
->
createLCReader
();
m_slcio_rdr
->
open
(
m_filename
.
value
().
c_str
());
m_processed_event
=
0
;
return
true
;
}
bool
SLCIORdr
::
finish
(){
return
true
;
}
StatusCode
SLCIORdr
::
initialize
()
{
StatusCode
sc
;
if
(
not
configure_gentool
())
{
error
()
<<
"failed to initialize."
<<
endmsg
;
return
StatusCode
::
FAILURE
;
}
return
sc
;
}
StatusCode
SLCIORdr
::
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/SLCIORdr.h
+
21
−
9
View file @
ed5c3d1a
#ifndef SLCIORdr_h
#define SLCIORdr_h 1
#include
"GaudiKernel/AlgTool.h"
#include
"GenReader.h"
#include
"GenEvent.h"
...
...
@@ -13,19 +15,29 @@
#include
"IO/LCReader.h"
class
SLCIORdr
:
public
GenReader
{
class
SLCIORdr
:
public
extends
<
AlgTool
,
GenReader
>
{
public:
SLCIORdr
(
string
name
);
using
extends
::
extends
;
~
SLCIORdr
();
bool
configure
();
bool
mutate
(
MyHepMC
::
GenEvent
&
event
);
bool
finish
();
bool
isEnd
();
// Overriding initialize and finalize
StatusCode
initialize
()
override
;
StatusCode
finalize
()
override
;
bool
configure_gentool
()
override
;
bool
mutate
(
MyHepMC
::
GenEvent
&
event
)
override
;
bool
finish
()
override
;
bool
isEnd
()
override
;
private:
IO
::
LCReader
*
m_slcio_rdr
;
long
m_total_event
;
long
m_processed_event
;
IO
::
LCReader
*
m_slcio_rdr
{
nullptr
};
long
m_total_event
{
-
1
};
long
m_processed_event
{
-
1
};
// input file name
Gaudi
::
Property
<
std
::
string
>
m_filename
{
this
,
"Input"
};
};
#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