Skip to content

Commit c95fff1

Browse files
authored
Add track writer workflow for ITS (#13057)
1 parent d08d21a commit c95fff1

File tree

4 files changed

+105
-0
lines changed

4 files changed

+105
-0
lines changed

Detectors/ITSMFT/ITS/workflow/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ o2_add_library(ITSWorkflow
2929
src/DCSAdaposParserSpec.cxx
3030
src/DCSDataGeneratorWorkflow.cxx
3131
src/DCSGeneratorSpec.cxx
32+
src/TrackWriterWorkflow.cxx
3233
PUBLIC_LINK_LIBRARIES O2::Framework
3334
O2::SimConfig
3435
O2::DetectorsDCS
@@ -58,6 +59,11 @@ o2_add_executable(cluster-writer-workflow
5859
COMPONENT_NAME its
5960
PUBLIC_LINK_LIBRARIES O2::ITSWorkflow)
6061

62+
o2_add_executable(track-writer-workflow
63+
SOURCES src/its-track-writer-workflow.cxx
64+
COMPONENT_NAME its
65+
PUBLIC_LINK_LIBRARIES O2::ITSWorkflow)
66+
6167
o2_add_executable(cluster-reader-workflow
6268
SOURCES src/its-cluster-reader-workflow.cxx
6369
COMPONENT_NAME its
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
#ifndef O2_ITS_TRACK_WRITER_WORKFLOW_H
13+
#define O2_ITS_TRACK_WRITER_WORKFLOW_H
14+
15+
#include "Framework/WorkflowSpec.h"
16+
17+
namespace o2
18+
{
19+
namespace its
20+
{
21+
22+
namespace track_writer_workflow
23+
{
24+
framework::WorkflowSpec getWorkflow(bool useMC);
25+
}
26+
27+
} // namespace its
28+
} // namespace o2
29+
#endif
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
#include "ITSWorkflow/TrackWriterWorkflow.h"
13+
#include "ITSWorkflow/TrackWriterSpec.h"
14+
15+
namespace o2
16+
{
17+
namespace its
18+
{
19+
20+
namespace track_writer_workflow
21+
{
22+
23+
framework::WorkflowSpec getWorkflow(bool useMC)
24+
{
25+
framework::WorkflowSpec specs;
26+
27+
specs.emplace_back(o2::its::getTrackWriterSpec(useMC));
28+
29+
return specs;
30+
}
31+
32+
} // namespace track_writer_workflow
33+
} // namespace its
34+
} // namespace o2
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
#include "ITSWorkflow/TrackWriterWorkflow.h"
13+
#include "Framework/ConfigParamSpec.h"
14+
#include "Framework/CompletionPolicyHelpers.h"
15+
16+
using namespace o2::framework;
17+
18+
void customize(std::vector<o2::framework::CompletionPolicy>& policies)
19+
{
20+
// ordered policies for the writers
21+
policies.push_back(CompletionPolicyHelpers::consumeWhenAllOrdered(".*(?:ITS|its).*[W,w]riter.*"));
22+
}
23+
24+
void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
25+
{
26+
workflowOptions.push_back(ConfigParamSpec{"disable-mc", o2::framework::VariantType::Bool, false, {"disable MC propagation even if available"}});
27+
}
28+
29+
#include "Framework/runDataProcessing.h"
30+
#include "Framework/Logger.h"
31+
32+
WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
33+
{
34+
auto useMC = !configcontext.options().get<bool>("disable-mc");
35+
return std::move(o2::its::track_writer_workflow::getWorkflow(useMC));
36+
}

0 commit comments

Comments
 (0)