Skip to content

Commit 1cfabfa

Browse files
martenoledavidrohr
authored andcommitted
Add DPL TRD tracking workflow
- added reader for TRD tracklets - added TRD tracking as DPL device - added dummy TRD track writer
1 parent a23a008 commit 1cfabfa

10 files changed

Lines changed: 619 additions & 3 deletions

Detectors/TRD/workflow/CMakeLists.txt

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,21 @@
88
# granted to it by virtue of its status as an Intergovernmental Organization or
99
# submit itself to any jurisdiction.
1010

11-
#add_compile_options(-O0 -pg -fPIC)
11+
#add_compile_options(-O0 -pg -fPIC)
1212

1313
o2_add_library(TRDWorkflow
1414
TARGETVARNAME targetName
1515
SOURCES src/TRDDigitizerSpec.cxx
1616
src/TRDDigitWriterSpec.cxx
1717
src/TRDDigitReaderSpec.cxx
1818
src/TRDTrackletWriterSpec.cxx
19+
src/TRDTrackletReaderSpec.cxx
1920
src/TRDTrapRawWriterSpec.cxx
2021
src/TRDTrapSimulatorSpec.cxx
21-
PUBLIC_LINK_LIBRARIES O2::Framework O2::DPLUtils O2::Steer O2::Algorithm O2::DataFormatsTRD O2::TRDSimulation O2::DetectorsBase O2::SimulationDataFormat O2::TRDBase)
22+
src/TRDGlobalTrackingSpec.cxx
23+
src/TRDTrackWriterSpec.cxx
24+
src/TRDTrackingWorkflow.cxx
25+
PUBLIC_LINK_LIBRARIES O2::Framework O2::DPLUtils O2::Steer O2::Algorithm O2::DataFormatsTRD O2::TRDSimulation O2::DetectorsBase O2::SimulationDataFormat O2::TRDBase O2::GPUTracking O2::GlobalTrackingWorkflow)
2226

2327
#o2_target_root_dictionary(TRDWorkflow
2428
# HEADERS include/TRDWorkflow/TRDTrapSimulatorSpec.h)
@@ -33,8 +37,13 @@ o2_add_executable(trap-sim
3337
O2::DataFormatsTRD
3438
O2::TRDWorkflow)
3539

40+
o2_add_executable(global-tracking
41+
COMPONENT_NAME trd
42+
SOURCES src/trd-tracking-workflow.cxx
43+
PUBLIC_LINK_LIBRARIES O2::TRDWorkflow)
44+
45+
3646
if (OpenMP_CXX_FOUND)
3747
target_compile_definitions(${targetName} PRIVATE WITH_OPENMP)
3848
target_link_libraries(${targetName} PRIVATE OpenMP::OpenMP_CXX)
3949
endif()
40-
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
11+
/// @file TRDGlobalTrackingSpec.h
12+
13+
#ifndef O2_TRD_GLOBALTRACKING
14+
#define O2_TRD_GLOBALTRACKING
15+
16+
#include "Framework/DataProcessorSpec.h"
17+
#include "Framework/Task.h"
18+
#include "TStopwatch.h"
19+
20+
#include "GPUO2Interface.h"
21+
#include "GPUTRDTracker.h"
22+
23+
namespace o2
24+
{
25+
namespace trd
26+
{
27+
28+
class TRDGlobalTracking : public o2::framework::Task
29+
{
30+
public:
31+
TRDGlobalTracking(bool useMC) : mUseMC(useMC) {}
32+
~TRDGlobalTracking() override = default;
33+
void init(o2::framework::InitContext& ic) final;
34+
void run(o2::framework::ProcessingContext& pc) final;
35+
void endOfStream(o2::framework::EndOfStreamContext& ec) final;
36+
37+
private:
38+
o2::gpu::GPUTRDTracker* mTracker{nullptr}; ///< TRD tracking engine
39+
o2::gpu::GPUReconstruction* mRec{nullptr}; ///< GPU reconstruction pointer, handles memory for the tracker
40+
o2::gpu::GPUChainTracking* mChainTracking{nullptr}; ///< TRD tracker is run in the tracking chain
41+
bool mUseMC{false}; ///< MC flag
42+
TStopwatch mTimer;
43+
};
44+
45+
/// create a processor spec
46+
framework::DataProcessorSpec getTRDGlobalTrackingSpec(bool useMC);
47+
48+
} // namespace trd
49+
} // namespace o2
50+
51+
#endif /* O2_TRD_TRACKLETREADER */
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
11+
#ifndef O2_TRD_TRACK_WRITER_H
12+
#define O2_TRD_TRACK_WRITER_H
13+
14+
/// @file TRDTrackWriterSpec.h
15+
16+
#include "Framework/DataProcessorSpec.h"
17+
18+
namespace o2
19+
{
20+
namespace trd
21+
{
22+
23+
/// create a processor spec
24+
framework::DataProcessorSpec getTRDTrackWriterSpec(bool useMC);
25+
26+
} // namespace trd
27+
} // namespace o2
28+
29+
#endif
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
11+
#ifndef O2_TRD_TRACKING_WORKFLOW_H
12+
#define O2_TRD_TRACKING_WORKFLOW_H
13+
14+
/// @file TRDTrackingWorkflow.h
15+
16+
#include "Framework/WorkflowSpec.h"
17+
18+
namespace o2
19+
{
20+
namespace trd
21+
{
22+
23+
framework::WorkflowSpec getTRDTrackingWorkflow(bool disableRootInp, bool disableRootOut);
24+
25+
} // namespace trd
26+
} // namespace o2
27+
28+
#endif
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
11+
/// @file TRDTrackletReaderSpec.h
12+
13+
#ifndef O2_TRD_TRACKLETREADER
14+
#define O2_TRD_TRACKLETREADER
15+
16+
#include "TFile.h"
17+
#include "TTree.h"
18+
19+
#include "Framework/DataProcessorSpec.h"
20+
#include "Framework/Task.h"
21+
#include "DataFormatsTRD/Tracklet64.h"
22+
#include "DataFormatsTRD/TriggerRecord.h"
23+
#include "SimulationDataFormat/MCCompLabel.h"
24+
25+
namespace o2
26+
{
27+
namespace trd
28+
{
29+
30+
class TRDTrackletReader : public o2::framework::Task
31+
{
32+
public:
33+
TRDTrackletReader(bool useMC) : mUseMC(useMC) {}
34+
~TRDTrackletReader() override = default;
35+
void init(o2::framework::InitContext& ic) final;
36+
void run(o2::framework::ProcessingContext& pc) final;
37+
38+
private:
39+
void connectTree(const std::string& filename);
40+
bool mUseMC{false};
41+
std::unique_ptr<TFile> mFile;
42+
std::unique_ptr<TTree> mTree;
43+
std::string mInFileName{"trdtracklets.root"};
44+
std::string mInTreeName{"o2sim"};
45+
std::vector<o2::trd::Tracklet64> mTracklets, *mTrackletsPtr = &mTracklets;
46+
std::vector<o2::trd::TriggerRecord> mTriggerRecords, *mTriggerRecordsPtr = &mTriggerRecords;
47+
std::vector<o2::MCCompLabel> mLabels, *mLabelsPtr = &mLabels;
48+
};
49+
50+
/// create a processor spec
51+
/// read TRD tracklets from a root file
52+
framework::DataProcessorSpec getTRDTrackletReaderSpec(bool useMC);
53+
54+
} // namespace trd
55+
} // namespace o2
56+
57+
#endif /* O2_TRD_TRACKLETREADER */

0 commit comments

Comments
 (0)