Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cbmroot
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Computing
cbmroot
Commits
dfab995d
Commit
dfab995d
authored
3 years ago
by
Volker Friese
Committed by
David Emschermann
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Removed C++17 features; added handling of a list of sources, following PAL's suggestions.
parent
134aa473
No related branches found
No related tags found
1 merge request
!768
Execution of reconstruction from timeslice with steering class and minimal run macro. Refs #2275.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
reco/steer/CbmReco.cxx
+46
-18
46 additions, 18 deletions
reco/steer/CbmReco.cxx
reco/steer/CbmReco.h
+23
-7
23 additions, 7 deletions
reco/steer/CbmReco.h
with
69 additions
and
25 deletions
reco/steer/CbmReco.cxx
+
46
−
18
View file @
dfab995d
...
...
@@ -16,15 +16,16 @@
#include
<iostream>
#include
<memory>
#include
<string>
using
std
::
cout
;
using
std
::
endl
;
using
std
::
make_unique
;
using
std
::
string
;
// ----- Constructor
-------------------
-----------------------------------
CbmReco
::
CbmReco
(
TS
tring
source
,
TString
outFile
,
int32_t
numTs
,
const
CbmRecoConfig
&
config
)
:
f
InputFil
eName
(
source
)
// ----- Constructor
from single source
-----------------------------------
CbmReco
::
CbmReco
(
s
tring
source
,
TString
outFile
,
int32_t
numTs
,
const
CbmRecoConfig
&
config
)
:
f
Sourc
eName
s
{
source
}
,
fOutputFileName
(
outFile
)
,
fNumTs
(
numTs
)
,
fConfig
(
config
)
...
...
@@ -33,6 +34,30 @@ CbmReco::CbmReco(TString source, TString outFile, int32_t numTs, const CbmRecoCo
// ----------------------------------------------------------------------------
// ----- Constructor from multiple sources --------------------------------
CbmReco
::
CbmReco
(
std
::
vector
<
string
>
sources
,
TString
outFile
,
int32_t
numTs
,
const
CbmRecoConfig
&
config
)
:
fSourceNames
(
sources
)
,
fOutputFileName
(
outFile
)
,
fNumTs
(
numTs
)
,
fConfig
(
config
)
{
}
// ----------------------------------------------------------------------------
// ----- List of source names ---------------------------------------------
std
::
string
CbmReco
::
ListSources
()
const
{
std
::
string
result
=
"{"
;
for
(
auto
&
source
:
fSourceNames
)
{
result
+=
source
+
", "
;
}
result
+=
"}"
;
return
result
;
}
// ----------------------------------------------------------------------------
// ----- Configure and execute run ----------------------------------------
int32_t
CbmReco
::
Run
()
{
...
...
@@ -41,16 +66,19 @@ int32_t CbmReco::Run()
TStopwatch
timer
;
timer
.
Start
();
// TODO: I cannot yet use unique pointers for the objects to be passed to FairRunline.
// Ownership, however, is passed to FairRunOnline, which takes care of deleting the objects.
// --- Input source
auto
source
=
make_unique
<
CbmSourceTs
>
(
f
InputFileName
.
Data
()
);
if
(
source
)
LOG
(
info
)
<<
"Reco: Using source "
<<
fInputFileName
.
Data
();
auto
source
=
new
CbmSourceTs
(
f
SourceNames
);
if
(
source
)
LOG
(
info
)
<<
"Reco: Using source
s
"
<<
ListSources
();
else
{
LOG
(
error
)
<<
"Reco: Could not open source "
<<
fInputFileName
.
Data
()
<<
"; aborting."
;
LOG
(
error
)
<<
"Reco: Could not open source
s
"
<<
ListSources
()
<<
"; aborting."
;
return
-
1
;
}
// --- Output file
auto
sink
=
make_unique
<
FairRootFileSink
>
(
fOutputFileName
.
Data
());
auto
sink
=
new
FairRootFileSink
(
fOutputFileName
.
Data
());
if
(
sink
)
LOG
(
info
)
<<
"Reco: Using output file "
<<
fOutputFileName
.
Data
();
else
{
LOG
(
error
)
<<
"Reco: Could not open output "
<<
fOutputFileName
.
Data
()
<<
"; aborting."
;
...
...
@@ -58,31 +86,31 @@ int32_t CbmReco::Run()
}
// --- Event header
auto
header
=
make_unique
<
CbmTsEventHeader
>
();
auto
header
=
new
CbmTsEventHeader
();
// --- Unpacking
auto
unpack
=
make_unique
<
CbmTaskUnpack
>
();
auto
unpack
=
new
CbmTaskUnpack
();
unpack
->
SetOutputBranchPersistent
(
"DigiTimeslice."
,
fConfig
.
fStoreTimeslice
);
// --- Digi trigger
auto
trigger
=
make_unique
<
CbmTaskTriggerDigi
>
();
auto
trigger
=
new
CbmTaskTriggerDigi
();
trigger
->
AddSystem
(
fConfig
.
fTriggerDet
);
trigger
->
SetAlgoParams
(
fConfig
.
fTriggerWin
,
fConfig
.
fTriggerThreshold
,
fConfig
.
fTriggerDeadTime
);
trigger
->
SetOutputBranchPersistent
(
"Trigger"
,
fConfig
.
fStoreTrigger
);
// --- Event building
auto
evtBuild
=
make_unique
<
CbmTaskBuildEvents
>
();
auto
evtBuild
=
new
CbmTaskBuildEvents
();
for
(
auto
&
entry
:
fConfig
.
fEvtbuildWindows
)
evtBuild
->
SetEventWindow
(
entry
.
first
,
entry
.
second
.
first
,
entry
.
second
.
second
);
evtBuild
->
SetOutputBranchPersistent
(
"DigiEvent"
,
fConfig
.
fStoreEvents
);
// --- Run configuration
FairRunOnline
run
(
source
.
release
()
);
run
.
SetSink
(
sink
.
release
()
);
run
.
SetEventHeader
(
header
.
release
()
);
run
.
AddTask
(
unpack
.
release
()
);
run
.
AddTask
(
trigger
.
release
()
);
run
.
AddTask
(
evtBuild
.
release
()
);
FairRunOnline
run
(
source
);
run
.
SetSink
(
sink
);
run
.
SetEventHeader
(
header
);
run
.
AddTask
(
unpack
);
run
.
AddTask
(
trigger
);
run
.
AddTask
(
evtBuild
);
// --- Initialise and start run
timer
.
Stop
();
...
...
This diff is collapsed.
Click to expand it.
reco/steer/CbmReco.h
+
23
−
7
View file @
dfab995d
...
...
@@ -10,6 +10,7 @@
#include
<TString.h>
#include
<map>
#include
<string>
#include
<utility>
...
...
@@ -58,19 +59,34 @@ public:
CbmReco
()
{};
/** @brief Standard constructor
** @param source Name of input file or
input source
/** @brief Standard constructor
for a single source
** @param source Name of input file or
stream
** @param outFile Name of output file
** @param numTs Number of timeslices to process. If negative, all available will be used.
** @param config Configuration
**/
CbmReco
(
TString
source
,
TString
outFile
,
int32_t
numTs
,
const
CbmRecoConfig
&
config
);
CbmReco
(
std
::
string
source
,
TString
outFile
,
int32_t
numTs
,
const
CbmRecoConfig
&
config
);
/** @brief Standard constructor for list of sources
** @param source Vector of names of input files or input sources
** @param outFile Name of output file
** @param numTs Number of timeslices to process. If negative, all available will be used.
** @param config Configuration
**/
CbmReco
(
std
::
vector
<
std
::
string
>
sources
,
TString
outFile
,
int32_t
numTs
,
const
CbmRecoConfig
&
config
);
/** @brief Destructor **/
virtual
~
CbmReco
()
{};
/** @brief List all entries in the input vector
** @return String concatenating the sources names
**/
std
::
string
ListSources
()
const
;
/** @brief Configure and execute run
** @return Number of processed timeslices. -1 if error encountered.
**/
...
...
@@ -78,10 +94,10 @@ public:
private
:
TS
tring
f
InputFil
eName
=
""
;
TString
fOutputFileName
=
""
;
int32_t
fNumTs
=
-
1
;
CbmRecoConfig
fConfig
=
{};
std
::
vector
<
std
::
s
tring
>
f
Sourc
eName
s
=
{};
///< Sources (input files or stream)
TString
fOutputFileName
=
""
;
int32_t
fNumTs
=
-
1
;
CbmRecoConfig
fConfig
=
{};
ClassDef
(
CbmReco
,
1
);
};
...
...
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