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
maxt@ihep.ac.cn
CEPCSW
Commits
0c898bbc
Commit
0c898bbc
authored
5 years ago
by
zoujh@ihep.ac.cn
Browse files
Options
Downloads
Patches
Plain Diff
support reading a file list in LCIODataSvc
parent
9274d3cb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
FWCore/FWCore/LCIODataSvc.h
+2
-0
2 additions, 0 deletions
FWCore/FWCore/LCIODataSvc.h
FWCore/src/components/LCIODataSvc.cpp
+17
-8
17 additions, 8 deletions
FWCore/src/components/LCIODataSvc.cpp
with
19 additions
and
8 deletions
FWCore/FWCore/LCIODataSvc.h
+
2
−
0
View file @
0c898bbc
...
...
@@ -80,6 +80,8 @@ private:
int
m_eventNum
{
0
};
/// Number of events in the file / to process
int
m_eventMax
{
-
1
};
/// the current file index in the m_filenames vector
int
m_fileIndex
{
0
};
SmartIF
<
IConversionSvc
>
m_cnvSvc
;
...
...
This diff is collapsed.
Click to expand it.
FWCore/src/components/LCIODataSvc.cpp
+
17
−
8
View file @
0c898bbc
...
...
@@ -34,11 +34,10 @@ StatusCode LCIODataSvc::initialize() {
}
if
(
m_filenames
.
size
()
>
0
)
{
if
(
m_filenames
[
0
]
!=
""
)
{
m_reader
->
open
(
m_filenames
);
m_eventMax
=
m_reader
->
getNumberOfEvents
();
}
m_reader
->
open
(
m_filenames
[
0
]);
m_eventMax
=
m_reader
->
getNumberOfEvents
();
}
return
status
;
}
/// Service reinitialisation
...
...
@@ -48,6 +47,9 @@ StatusCode LCIODataSvc::reinitialize() {
}
/// Service finalization
StatusCode
LCIODataSvc
::
finalize
()
{
m_reader
->
close
();
delete
m_reader
;
m_reader
=
nullptr
;
m_cnvSvc
=
0
;
// release
DataSvc
::
finalize
().
ignore
();
return
StatusCode
::
SUCCESS
;
...
...
@@ -75,10 +77,17 @@ void LCIODataSvc::endOfRead() {
// m_provider.clearCaches();
// m_reader.endOfEvent();
if
(
++
m_eventNum
>=
m_eventMax
)
{
info
()
<<
"Reached end of file with event "
<<
m_eventMax
<<
endmsg
;
IEventProcessor
*
eventProcessor
;
service
(
"ApplicationMgr"
,
eventProcessor
);
eventProcessor
->
stopRun
();
if
(
++
m_fileIndex
<
m_filenames
.
size
()
)
{
// move to next file
m_reader
->
close
();
m_reader
->
open
(
m_filenames
[
m_fileIndex
]
);
m_eventMax
+=
m_reader
->
getNumberOfEvents
();
}
else
{
// reach to the end of the file list
info
()
<<
"Reached end of file with event "
<<
m_eventMax
<<
endmsg
;
IEventProcessor
*
eventProcessor
;
service
(
"ApplicationMgr"
,
eventProcessor
);
eventProcessor
->
stopRun
();
}
}
}
evt
=
nullptr
;
...
...
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