Skip to content

Commit 4ed4115

Browse files
authored
add parameters to eve workflow (AliceO2Group#6767)
* add parameters to eve workflow * removed dependency from gpu added parameters for maximum number of tracks and host filtering * reformating * reformating * fixed fullCl warning
1 parent d6dae03 commit 4ed4115

9 files changed

Lines changed: 435 additions & 70 deletions

File tree

EventVisualisation/Workflow/CMakeLists.txt

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,28 @@ if(ALIGPU_BUILD_TYPE STREQUAL "O2"
2121
COMPONENT_NAME eve
2222
TARGETVARNAME targetName
2323
SOURCES
24-
src/O2DPLDisplay.cxx
25-
src/FileProducer.cxx
24+
src/O2DPLDisplay.cxx
25+
src/FileProducer.cxx
26+
src/EveWorkflowHelper.cxx
27+
src/EveConfiguration.cxx
2628
PUBLIC_LINK_LIBRARIES
27-
O2::EventVisualisationBase
28-
O2::EventVisualisationDetectors
29-
O2::GPUO2Interface
30-
O2::GPUWorkflowHelper
31-
O2::DataFormatsGlobalTracking
32-
O2::TPCFastTransformation
33-
O2::TRDBase
34-
O2::TOFBase
35-
O2::TPCReconstruction
36-
O2::GlobalTrackingWorkflowHelpers)
29+
O2::DataFormatsGlobalTracking
30+
O2::DetectorsRaw
31+
O2::DetectorsVertexing
32+
O2::EventVisualisationBase
33+
O2::EventVisualisationDetectors
34+
O2::FrameworkFoundation
35+
O2::FT0Workflow
36+
O2::GlobalTrackingWorkflowHelpers
37+
O2::GlobalTrackingWorkflowReaders
38+
O2::ITSMFTWorkflow
39+
O2::MFTWorkflow
40+
O2::TOFBase
41+
O2::TOFWorkflowIO
42+
O2::TPCReconstruction
43+
O2::TPCWorkflow
44+
O2::TRDBase
45+
O2::TRDWorkflowIO
46+
)
3747
target_include_directories(${targetName} PUBLIC "include")
3848
endif()
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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+
/// \file
13+
/// \author Julian Myrcha
14+
15+
#ifndef ALICE_O2_EVENTVISUALISATION_WORKFLOW_EVECONFIGURATION_H
16+
#define ALICE_O2_EVENTVISUALISATION_WORKFLOW_EVECONFIGURATION_H
17+
18+
#include "DataFormatsTPC/Constants.h"
19+
#include "TRDBase/GeometryFlat.h"
20+
#include "DataFormatsITSMFT/TopologyDictionary.h"
21+
22+
#include <memory>
23+
#include <array>
24+
#include <vector>
25+
#include <functional>
26+
#include <gsl/gsl>
27+
28+
class TH1F;
29+
30+
namespace o2
31+
{
32+
namespace event_visualisation
33+
{
34+
template <class T>
35+
struct DefaultPtr {
36+
typedef T type;
37+
};
38+
template <class T>
39+
struct ConstPtr {
40+
typedef const T type;
41+
};
42+
43+
template <template <typename T> class S>
44+
struct CalibObjectsTemplate {
45+
typename S<o2::trd::GeometryFlat>::type* trdGeometry = nullptr;
46+
typename S<o2::itsmft::TopologyDictionary>::type* itsPatternDict = nullptr;
47+
};
48+
49+
typedef CalibObjectsTemplate<DefaultPtr> CalibObjects; // NOTE: These 2 must have identical layout since they are memcopied
50+
typedef CalibObjectsTemplate<ConstPtr> CalibObjectsConst;
51+
52+
struct SettingsGRP {
53+
// All new members must be sizeof(int) resp. sizeof(float) for alignment reasons!
54+
float solenoidBz = -5.00668; // solenoid field strength
55+
int constBz = 0; // for test-MC events with constant Bz
56+
int homemadeEvents = 0; // Toy-MC events
57+
int continuousMaxTimeBin = 0; // 0 for triggered events, -1 for default of 23ms
58+
int needsClusterer = 0; // Set to true if the data requires the clusterizer
59+
};
60+
61+
struct SettingsProcessing {
62+
bool runMC;
63+
};
64+
65+
struct EveConfiguration {
66+
EveConfiguration() = default;
67+
~EveConfiguration() = default;
68+
EveConfiguration(const EveConfiguration&) = default;
69+
SettingsGRP configGRP;
70+
CalibObjectsConst configCalib;
71+
SettingsProcessing configProcessing;
72+
void ReadConfigurableParam();
73+
};
74+
75+
} // namespace event_visualisation
76+
} // namespace o2
77+
78+
#endif
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
///
13+
/// \file EveWorkflowHelper.h
14+
/// \author julian.myrcha@cern.ch
15+
16+
#ifndef ALICE_O2_EVENTVISUALISATION_WORKFLOW_EVEWORKFLOWHELPER_H
17+
#define ALICE_O2_EVENTVISUALISATION_WORKFLOW_EVEWORKFLOWHELPER_H
18+
19+
#include "ReconstructionDataFormats/GlobalTrackID.h"
20+
#include "DataFormatsGlobalTracking/RecoContainer.h"
21+
#include "EveWorkflow/EveConfiguration.h"
22+
23+
namespace o2::event_visualisation
24+
{
25+
class EveWorkflowHelper
26+
{
27+
using GID = o2::dataformats::GlobalTrackID;
28+
29+
public:
30+
struct tmpDataContainer {
31+
std::vector<o2::BaseCluster<float>> ITSClustersArray;
32+
std::vector<int> tpcLinkITS, tpcLinkTRD, tpcLinkTOF;
33+
std::vector<const o2::track::TrackParCov*> globalTracks;
34+
std::vector<float> globalTrackTimes;
35+
};
36+
static std::shared_ptr<const tmpDataContainer> compute(const o2::globaltracking::RecoContainer& recoCont, const CalibObjectsConst* calib = nullptr, GID::mask_t maskCl = GID::MASK_ALL, GID::mask_t maskTrk = GID::MASK_ALL, GID::mask_t maskMatch = GID::MASK_ALL);
37+
};
38+
} // namespace o2::event_visualisation
39+
40+
#endif //ALICE_O2_EVENTVISUALISATION_WORKFLOW_EVEWORKFLOWHELPER_H

EventVisualisation/Workflow/include/EveWorkflow/FileProducer.h

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,33 @@
1313
/// \file FileProducer.h
1414
/// \author julian.myrcha@cern.ch
1515

16-
#ifndef FILEPRODUCER_FILEPRODUCER_H
17-
#define FILEPRODUCER_FILEPRODUCER_H
16+
#ifndef ALICE_O2_EVENTVISUALISATION_WORKFLOW_FILEPRODUCER_H
17+
#define ALICE_O2_EVENTVISUALISATION_WORKFLOW_FILEPRODUCER_H
1818

1919
#include <string>
2020
#include <deque>
2121

22+
namespace o2
23+
{
24+
namespace event_visualisation
25+
{
2226
class FileProducer
2327
{
2428
private:
2529
static std::deque<std::string> load(const std::string& path);
30+
2631
size_t mFilesInFolder;
2732
std::string mPath;
2833
std::string mName;
2934

3035
public:
31-
explicit FileProducer(const std::string& path, const std::string& name = "tracks{}.json", int filesInFolder = 10);
36+
explicit FileProducer(const std::string& path, int filesInFolder = 10,
37+
const std::string& name = "tracks{}.json");
38+
3239
[[nodiscard]] std::string newFileName() const;
3340
};
3441

35-
#endif //FILEPRODUCER_FILEPRODUCER_H
42+
} // namespace event_visualisation
43+
} // namespace o2
44+
45+
#endif //ALICE_O2_EVENTVISUALISATION_WORKFLOW_FILEPRODUCER_H

EventVisualisation/Workflow/include/EveWorkflow/O2DPLDisplay.h

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,53 +9,70 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111

12-
#ifndef O2_GPU_DPL_DISPLAY_H
13-
#define O2_GPU_DPL_DISPLAY_H
12+
///
13+
/// \file EveWorkflowHelper.h
14+
/// \author julian.myrcha@cern.ch
15+
16+
#ifndef ALICE_O2_EVENTVISUALISATION_WORKFLOW_O2DPLDISPLAY_H
17+
#define ALICE_O2_EVENTVISUALISATION_WORKFLOW_O2DPLDISPLAY_H
1418

1519
#include "ReconstructionDataFormats/GlobalTrackID.h"
20+
#include "EveWorkflow/EveConfiguration.h"
1621
#include "Framework/Task.h"
1722
#include <memory>
1823

1924
namespace o2::trd
2025
{
2126
class GeometryFlat;
2227
}
28+
2329
namespace o2::globaltracking
2430
{
2531
struct DataRequest;
2632
}
33+
2734
namespace o2::itsmft
2835
{
2936
class TopologyDictionary;
3037
}
3138

32-
namespace o2::gpu
39+
namespace o2::event_visualisation
3340
{
34-
class GPUO2InterfaceDisplay;
35-
struct GPUO2InterfaceConfiguration;
3641
class TPCFastTransform;
3742

38-
class O2GPUDPLDisplaySpec : public o2::framework::Task
43+
class O2DPLDisplaySpec : public o2::framework::Task
3944
{
4045
public:
41-
O2GPUDPLDisplaySpec(bool useMC, o2::dataformats::GlobalTrackID::mask_t trkMask, o2::dataformats::GlobalTrackID::mask_t clMask, std::shared_ptr<o2::globaltracking::DataRequest> dataRequest) : mUseMC(useMC), mTrkMask(trkMask), mClMask(clMask), mDataRequest(dataRequest) {}
42-
~O2GPUDPLDisplaySpec() override = default;
46+
O2DPLDisplaySpec(bool useMC, o2::dataformats::GlobalTrackID::mask_t trkMask,
47+
o2::dataformats::GlobalTrackID::mask_t clMask,
48+
std::shared_ptr<o2::globaltracking::DataRequest> dataRequest, std::string jsonPath,
49+
std::chrono::milliseconds timeInterval, int numberOfFiles, int numberOfTracks, bool eveHostNameMatch)
50+
: mUseMC(useMC), mTrkMask(trkMask), mClMask(clMask), mDataRequest(dataRequest), mJsonPath(jsonPath), mTimeInteval(timeInterval), mNumberOfFiles(numberOfFiles), mNumberOfTracks(numberOfTracks), mEveHostNameMatch(eveHostNameMatch)
51+
{
52+
this->mTimeStamp = std::chrono::high_resolution_clock::now() - timeInterval; // first run meets condition
53+
}
54+
~O2DPLDisplaySpec() override = default;
4355
void init(o2::framework::InitContext& ic) final;
4456
void run(o2::framework::ProcessingContext& pc) final;
4557
void endOfStream(o2::framework::EndOfStreamContext& ec) final;
4658

4759
private:
4860
bool mUseMC = false;
61+
bool mEveHostNameMatch; // empty or correct hostname
62+
std::string mJsonPath; // folder where files are stored
63+
std::chrono::milliseconds mTimeInteval; // minimal interval between files in miliseconds
64+
int mNumberOfFiles; // maximun number of files in folder - newer replaces older
65+
int mNumberOfTracks; // maximun number of track in single file (0 means no limit)
66+
std::chrono::time_point<std::chrono::high_resolution_clock> mTimeStamp;
67+
4968
o2::dataformats::GlobalTrackID::mask_t mTrkMask;
5069
o2::dataformats::GlobalTrackID::mask_t mClMask;
51-
//std::unique_ptr<GPUO2InterfaceDisplay> mDisplay;
52-
std::unique_ptr<GPUO2InterfaceConfiguration> mConfig;
53-
std::unique_ptr<TPCFastTransform> mFastTransform;
70+
std::unique_ptr<EveConfiguration> mConfig;
5471
std::unique_ptr<o2::trd::GeometryFlat> mTrdGeo;
5572
std::unique_ptr<o2::itsmft::TopologyDictionary> mITSDict;
5673
std::shared_ptr<o2::globaltracking::DataRequest> mDataRequest;
5774
};
5875

59-
} // namespace o2::gpu
76+
} // namespace o2::event_visualisation
6077

6178
#endif
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
/// \file EveConfiguration.cxx
13+
/// \author julian.myrcha@cern.ch
14+
15+
#include "EveWorkflow/EveConfiguration.h"
16+
17+
using namespace o2::event_visualisation;
18+
19+
void EveConfiguration::ReadConfigurableParam()
20+
{
21+
}

0 commit comments

Comments
 (0)