Skip to content

Commit

Permalink
Add possibility to run TPC track interpolation as DPL workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
martenole authored and shahor02 committed Apr 22, 2020
1 parent a196f3c commit 421507c
Show file tree
Hide file tree
Showing 11 changed files with 664 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Detectors/GlobalTrackingWorkflow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ o2_add_executable(match-workflow
PUBLIC_LINK_LIBRARIES O2::GlobalTrackingWorkflow )

add_subdirectory(tofworkflow)

add_subdirectory(tpcinterpolationworkflow)
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright CERN and copyright holders of ALICE O2. This software is distributed
# under the terms of the GNU General Public License v3 (GPL Version 3), copied
# verbatim in the file "COPYING".
#
# See http://alice-o2.web.cern.ch/license for full licensing information.
#
# 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.

#TODO Does the O2::GlobalTracking library need to be linked?
o2_add_library(TPCInterpolationWorkflow
SOURCES src/TPCInterpolationSpec.cxx
src/TPCResidualWriterSpec.cxx
src/TrackInterpolationReaderSpec.cxx
src/TrackInterpolationWorkflow.cxx
PUBLIC_LINK_LIBRARIES O2::GlobalTracking
O2::ITSWorkflow
O2::SpacePoints
O2::GlobalTrackingWorkflow
O2::TOFWorkflow
O2::Framework
)

o2_add_executable(scdcalib-interpolation-workflow
COMPONENT_NAME tpc
SOURCES src/tpc-interpolation-workflow.cxx
PUBLIC_LINK_LIBRARIES O2::TPCInterpolationWorkflow)
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// 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.

#ifndef O2_TPC_INTERPOLATION_SPEC_H
#define O2_TPC_INTERPOLATION_SPEC_H

/// @file TPCInterpolationSpec.h

#include "DataFormatsTPC/Constants.h"
#include "SpacePoints/TrackInterpolation.h"
#include "Framework/DataProcessorSpec.h"
#include "Framework/Task.h"

using namespace o2::framework;

namespace o2
{
namespace tpc
{
class TPCInterpolationDPL : public Task
{
public:
TPCInterpolationDPL(bool useMC, const std::vector<int>& tpcClusLanes) : mUseMC(useMC), mTPCClusLanes(tpcClusLanes) {}
~TPCInterpolationDPL() override = default;
void init(InitContext& ic) final;
void run(ProcessingContext& pc) final;

private:
o2::tpc::TrackInterpolation mInterpolation; // track interpolation engine
std::vector<int> mTPCClusLanes;
std::array<std::vector<char>, o2::tpc::Constants::MAXSECTOR> mBufferedTPCClusters;

bool mUseMC{false}; ///< MC flag
};

/// create a processor spec
framework::DataProcessorSpec getTPCInterpolationSpec(bool useMC, const std::vector<int>& tpcClusLanes);

} // namespace tpc
} // namespace o2

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// 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.

#ifndef O2_TPC_RESIDUAL_WRITER_H
#define O2_TPC_RESIDUAL_WRITER_H

/// @file TPCResidualWriterSpec.h

#include "TFile.h"
#include "TTree.h"

#include "Framework/DataProcessorSpec.h"
#include "Framework/Task.h"
#include <string>

namespace o2
{
namespace tpc
{

class ResidualWriterTPC : public o2::framework::Task
{
public:
ResidualWriterTPC(bool useMC = false) : mUseMC(useMC) {}
~ResidualWriterTPC() override = default;
void init(o2::framework::InitContext& ic) final;
void run(o2::framework::ProcessingContext& pc) final;
void endOfStream(o2::framework::EndOfStreamContext& ec) final;

private:
bool mUseMC = false; ///< MC flag
std::string mOutFileName = "o2residuals_tpc.root"; ///< name of output file
std::string mTreeName = "residualsTPC"; ///< name of tree containing output
std::string mOutTracksBranchName = "tracks"; ///< name of branch containing output used tracks
std::string mOutResidualsBranchName = "residuals"; ///< name of branch containing output used residuals
std::unique_ptr<TFile> mFile = nullptr;
std::unique_ptr<TTree> mTree = nullptr;
};

/// create a processor spec
framework::DataProcessorSpec getTPCResidualWriterSpec(bool useMC);

} // namespace tpc
} // namespace o2

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// 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.

#ifndef O2_TPC_INTERPOLATION_READER_H
#define O2_TPC_INTERPOLATION_READER_H

/// @file TrackInterpolationReaderSpec.h

namespace o2
{
namespace tpc
{

// TODO add specification for reading TPC cluster residuals and reference tracks

} // namespace tpc
} // namespace o2

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// 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.

#ifndef O2_TPC_INTERPOLATION_WORKFLOW_H
#define O2_TPC_INTERPOLATION_WORKFLOW_H

/// @file TrackInterpolationWorkflow.h

#include "Framework/WorkflowSpec.h"

namespace o2
{
namespace tpc
{

framework::WorkflowSpec getTPCInterpolationWorkflow(bool useMC);

} // namespace tpc
} // namespace o2

#endif
Loading

0 comments on commit 421507c

Please sign in to comment.