Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 22 additions & 12 deletions EventVisualisation/Workflow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,28 @@ if(ALIGPU_BUILD_TYPE STREQUAL "O2"
COMPONENT_NAME eve
TARGETVARNAME targetName
SOURCES
src/O2DPLDisplay.cxx
src/FileProducer.cxx
src/O2DPLDisplay.cxx
src/FileProducer.cxx
src/EveWorkflowHelper.cxx
src/EveConfiguration.cxx
PUBLIC_LINK_LIBRARIES
O2::EventVisualisationBase
O2::EventVisualisationDetectors
O2::GPUO2Interface
O2::GPUWorkflowHelper
O2::DataFormatsGlobalTracking
O2::TPCFastTransformation
O2::TRDBase
O2::TOFBase
O2::TPCReconstruction
O2::GlobalTrackingWorkflowHelpers)
O2::DataFormatsGlobalTracking
O2::DetectorsRaw
O2::DetectorsVertexing
O2::EventVisualisationBase
O2::EventVisualisationDetectors
O2::FrameworkFoundation
O2::FT0Workflow
O2::GlobalTrackingWorkflowHelpers
O2::GlobalTrackingWorkflowReaders
O2::ITSMFTWorkflow
O2::MFTWorkflow
O2::TOFBase
O2::TOFWorkflowIO
O2::TPCReconstruction
O2::TPCWorkflow
O2::TRDBase
O2::TRDWorkflowIO
)
target_include_directories(${targetName} PUBLIC "include")
endif()
78 changes: 78 additions & 0 deletions EventVisualisation/Workflow/include/EveWorkflow/EveConfiguration.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,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
/// \author Julian Myrcha

#ifndef ALICE_O2_EVENTVISUALISATION_WORKFLOW_EVECONFIGURATION_H
#define ALICE_O2_EVENTVISUALISATION_WORKFLOW_EVECONFIGURATION_H

#include "DataFormatsTPC/Constants.h"
#include "TRDBase/GeometryFlat.h"
#include "DataFormatsITSMFT/TopologyDictionary.h"

#include <memory>
#include <array>
#include <vector>
#include <functional>
#include <gsl/gsl>

class TH1F;

namespace o2
{
namespace event_visualisation
{
template <class T>
struct DefaultPtr {
typedef T type;
};
template <class T>
struct ConstPtr {
typedef const T type;
};

template <template <typename T> class S>
struct CalibObjectsTemplate {
typename S<o2::trd::GeometryFlat>::type* trdGeometry = nullptr;
typename S<o2::itsmft::TopologyDictionary>::type* itsPatternDict = nullptr;
};

typedef CalibObjectsTemplate<DefaultPtr> CalibObjects; // NOTE: These 2 must have identical layout since they are memcopied
typedef CalibObjectsTemplate<ConstPtr> CalibObjectsConst;

struct SettingsGRP {
// All new members must be sizeof(int) resp. sizeof(float) for alignment reasons!
float solenoidBz = -5.00668; // solenoid field strength
int constBz = 0; // for test-MC events with constant Bz
int homemadeEvents = 0; // Toy-MC events
int continuousMaxTimeBin = 0; // 0 for triggered events, -1 for default of 23ms
int needsClusterer = 0; // Set to true if the data requires the clusterizer
};

struct SettingsProcessing {
bool runMC;
};

struct EveConfiguration {
EveConfiguration() = default;
~EveConfiguration() = default;
EveConfiguration(const EveConfiguration&) = default;
SettingsGRP configGRP;
CalibObjectsConst configCalib;
SettingsProcessing configProcessing;
void ReadConfigurableParam();
};

} // namespace event_visualisation
} // namespace o2

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// 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 EveWorkflowHelper.h
/// \author julian.myrcha@cern.ch

#ifndef ALICE_O2_EVENTVISUALISATION_WORKFLOW_EVEWORKFLOWHELPER_H
#define ALICE_O2_EVENTVISUALISATION_WORKFLOW_EVEWORKFLOWHELPER_H

#include "ReconstructionDataFormats/GlobalTrackID.h"
#include "DataFormatsGlobalTracking/RecoContainer.h"
#include "EveWorkflow/EveConfiguration.h"

namespace o2::event_visualisation
{
class EveWorkflowHelper
{
using GID = o2::dataformats::GlobalTrackID;

public:
struct tmpDataContainer {
std::vector<o2::BaseCluster<float>> ITSClustersArray;
std::vector<int> tpcLinkITS, tpcLinkTRD, tpcLinkTOF;
std::vector<const o2::track::TrackParCov*> globalTracks;
std::vector<float> globalTrackTimes;
};
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);
};
} // namespace o2::event_visualisation

#endif //ALICE_O2_EVENTVISUALISATION_WORKFLOW_EVEWORKFLOWHELPER_H
18 changes: 14 additions & 4 deletions EventVisualisation/Workflow/include/EveWorkflow/FileProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,33 @@
/// \file FileProducer.h
/// \author julian.myrcha@cern.ch

#ifndef FILEPRODUCER_FILEPRODUCER_H
#define FILEPRODUCER_FILEPRODUCER_H
#ifndef ALICE_O2_EVENTVISUALISATION_WORKFLOW_FILEPRODUCER_H
#define ALICE_O2_EVENTVISUALISATION_WORKFLOW_FILEPRODUCER_H

#include <string>
#include <deque>

namespace o2
{
namespace event_visualisation
{
class FileProducer
{
private:
static std::deque<std::string> load(const std::string& path);

size_t mFilesInFolder;
std::string mPath;
std::string mName;

public:
explicit FileProducer(const std::string& path, const std::string& name = "tracks{}.json", int filesInFolder = 10);
explicit FileProducer(const std::string& path, int filesInFolder = 10,
const std::string& name = "tracks{}.json");

[[nodiscard]] std::string newFileName() const;
};

#endif //FILEPRODUCER_FILEPRODUCER_H
} // namespace event_visualisation
} // namespace o2

#endif //ALICE_O2_EVENTVISUALISATION_WORKFLOW_FILEPRODUCER_H
41 changes: 29 additions & 12 deletions EventVisualisation/Workflow/include/EveWorkflow/O2DPLDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,53 +9,70 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#ifndef O2_GPU_DPL_DISPLAY_H
#define O2_GPU_DPL_DISPLAY_H
///
/// \file EveWorkflowHelper.h
/// \author julian.myrcha@cern.ch

#ifndef ALICE_O2_EVENTVISUALISATION_WORKFLOW_O2DPLDISPLAY_H
#define ALICE_O2_EVENTVISUALISATION_WORKFLOW_O2DPLDISPLAY_H

#include "ReconstructionDataFormats/GlobalTrackID.h"
#include "EveWorkflow/EveConfiguration.h"
#include "Framework/Task.h"
#include <memory>

namespace o2::trd
{
class GeometryFlat;
}

namespace o2::globaltracking
{
struct DataRequest;
}

namespace o2::itsmft
{
class TopologyDictionary;
}

namespace o2::gpu
namespace o2::event_visualisation
{
class GPUO2InterfaceDisplay;
struct GPUO2InterfaceConfiguration;
class TPCFastTransform;

class O2GPUDPLDisplaySpec : public o2::framework::Task
class O2DPLDisplaySpec : public o2::framework::Task
{
public:
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) {}
~O2GPUDPLDisplaySpec() override = default;
O2DPLDisplaySpec(bool useMC, o2::dataformats::GlobalTrackID::mask_t trkMask,
o2::dataformats::GlobalTrackID::mask_t clMask,
std::shared_ptr<o2::globaltracking::DataRequest> dataRequest, std::string jsonPath,
std::chrono::milliseconds timeInterval, int numberOfFiles, int numberOfTracks, bool eveHostNameMatch)
: mUseMC(useMC), mTrkMask(trkMask), mClMask(clMask), mDataRequest(dataRequest), mJsonPath(jsonPath), mTimeInteval(timeInterval), mNumberOfFiles(numberOfFiles), mNumberOfTracks(numberOfTracks), mEveHostNameMatch(eveHostNameMatch)
{
this->mTimeStamp = std::chrono::high_resolution_clock::now() - timeInterval; // first run meets condition
}
~O2DPLDisplaySpec() 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;
bool mEveHostNameMatch; // empty or correct hostname
std::string mJsonPath; // folder where files are stored
std::chrono::milliseconds mTimeInteval; // minimal interval between files in miliseconds
int mNumberOfFiles; // maximun number of files in folder - newer replaces older
int mNumberOfTracks; // maximun number of track in single file (0 means no limit)
std::chrono::time_point<std::chrono::high_resolution_clock> mTimeStamp;

o2::dataformats::GlobalTrackID::mask_t mTrkMask;
o2::dataformats::GlobalTrackID::mask_t mClMask;
//std::unique_ptr<GPUO2InterfaceDisplay> mDisplay;
std::unique_ptr<GPUO2InterfaceConfiguration> mConfig;
std::unique_ptr<TPCFastTransform> mFastTransform;
std::unique_ptr<EveConfiguration> mConfig;
std::unique_ptr<o2::trd::GeometryFlat> mTrdGeo;
std::unique_ptr<o2::itsmft::TopologyDictionary> mITSDict;
std::shared_ptr<o2::globaltracking::DataRequest> mDataRequest;
};

} // namespace o2::gpu
} // namespace o2::event_visualisation

#endif
21 changes: 21 additions & 0 deletions EventVisualisation/Workflow/src/EveConfiguration.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// 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 EveConfiguration.cxx
/// \author julian.myrcha@cern.ch

#include "EveWorkflow/EveConfiguration.h"

using namespace o2::event_visualisation;

void EveConfiguration::ReadConfigurableParam()
{
}
Loading