forked from mcoquet642/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphos-reco-workflow.cxx
More file actions
78 lines (68 loc) · 3.84 KB
/
phos-reco-workflow.cxx
File metadata and controls
78 lines (68 loc) · 3.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
/// @file phos-reco-workflow.cxx
/// @author Dmitri Peresunko after Markus Fasel
/// @since 2019-12-14
/// @brief Basic DPL workflow for PHOS reconstruction starting from digits
#include "Framework/WorkflowSpec.h"
#include "Framework/ConfigParamSpec.h"
#include "PHOSWorkflow/RecoWorkflow.h"
#include "Algorithm/RangeTokenizer.h"
#include "CommonUtils/ConfigurableParam.h"
#include "DetectorsRaw/HBFUtilsInitializer.h"
#include <string>
#include <stdexcept>
#include <unordered_map>
// add workflow options, note that customization needs to be declared before
// including Framework/runDataProcessing
void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
{
std::vector<o2::framework::ConfigParamSpec> options{
{"input-type", o2::framework::VariantType::String, "digits", {"hits, digits, raw, clusters"}},
{"output-type", o2::framework::VariantType::String, "cells", {"digits, raw, clusters, cells"}},
{"disable-mc", o2::framework::VariantType::Bool, false, {"disable sending of MC information"}},
{"disable-root-input", o2::framework::VariantType::Bool, false, {"disable root-files input reader"}},
{"disable-root-output", o2::framework::VariantType::Bool, false, {"disable root-files output writer"}},
{"fullclu-output", o2::framework::VariantType::Bool, false, {"compact of full (with contr. digits) clusters output"}},
{"flpId", o2::framework::VariantType::Int, 0, {"FLP identification: 0,1,..."}},
{"configKeyValues", o2::framework::VariantType::String, "", {"Semicolon separated key=value strings ..."}}};
o2::raw::HBFUtilsInitializer::addConfigOption(options);
std::swap(workflowOptions, options);
}
#include "Framework/runDataProcessing.h" // the main driver
/// The workflow executable for the stand alone PHOS reconstruction workflow
/// The basic workflow for PHOS reconstruction is defined in RecoWorkflow.cxx
/// and contains the following default processors
/// - digit reader
/// - clusterer
///
/// The default workflow can be customized by specifying input and output types
/// e.g. digits, raw, tracks.
///
/// MC info is processed by default, disabled by using command line option `--disable-mc`
///
/// This function hooks up the the workflow specifications into the DPL driver.
o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& cfgc)
{
//
// Update the (declared) parameters if changed from the command line
o2::conf::ConfigurableParam::updateFromString(cfgc.options().get<std::string>("configKeyValues"));
auto wf = o2::phos::reco_workflow::getWorkflow(cfgc.options().get<bool>("disable-root-input"),
cfgc.options().get<bool>("disable-root-output"),
!cfgc.options().get<bool>("disable-mc"),
cfgc.options().get<std::string>("input-type"),
cfgc.options().get<std::string>("output-type"),
cfgc.options().get<bool>("fullclu-output"),
cfgc.options().get<int>("flpId"));
// configure dpl timer to inject correct firstTFOrbit: start from the 1st orbit of TF containing 1st sampled orbit
o2::raw::HBFUtilsInitializer hbfIni(cfgc, wf);
return std::move(wf);
}