Skip to content

Commit a807ee6

Browse files
Julian Myrchashahor02
authored andcommitted
o2-eve-display: added TRD,TOF,MID
added information fields to *.json file to recognise workflow parameters used to produce this json
1 parent 04c1b4c commit a807ee6

File tree

6 files changed

+277
-55
lines changed

6 files changed

+277
-55
lines changed

EventVisualisation/DataConverter/include/EventVisualisationDataConverter/VisualisationEvent.h

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class VisualisationEvent
4646
std::string toJson();
4747
void fromJson(std::string json);
4848
bool fromFile(std::string fileName);
49-
VisualisationEvent() = default;
49+
VisualisationEvent();
5050
VisualisationEvent(std::string fileName);
5151
VisualisationEvent(const VisualisationEvent& source, EVisualisationGroup filter);
5252
void toFile(std::string fileName);
@@ -106,19 +106,14 @@ class VisualisationEvent
106106
return mTracks.size();
107107
}
108108

109-
// Returns cluster with index i
110-
const VisualisationCluster& getCluster(int i) const
111-
{
112-
return mClusters[i];
113-
};
114-
115-
// Returns number of clusters
116-
size_t getClusterCount() const
117-
{
118-
return mClusters.size();
119-
}
109+
const VisualisationCluster& getCluster(int i) const { return mClusters[i]; };
110+
size_t getClusterCount() const { return mClusters.size(); } // Returns number of clusters
111+
void setWorkflowVersion(float workflowVersion) { this->mWorkflowVersion = workflowVersion; }
112+
void setWorkflowParameters(std::string workflowParameters) { this->mWorkflowParameters = workflowParameters; }
120113

121114
private:
115+
float mWorkflowVersion; /// workflow version used to generate this Event
116+
std::string mWorkflowParameters; /// workflow parameters used to generate this Event
122117
int mEventNumber; /// event number in file
123118
int mRunNumber; /// run number
124119
double mEnergy; /// energy of the collision

EventVisualisation/DataConverter/src/VisualisationEvent.cxx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ std::string VisualisationEvent::toJson()
101101

102102
// compatibility verification
103103
tree.AddMember("fileVersion", rapidjson::Value().SetInt(JSON_FILE_VERSION), allocator);
104+
tree.AddMember("timeStamp", rapidjson::Value().SetFloat(this->mTimeStamp), allocator);
105+
tree.AddMember("workflowVersion", rapidjson::Value().SetFloat(this->mWorkflowVersion), allocator);
106+
tree.AddMember("workflowParameters", rapidjson::Value().SetString(this->mWorkflowParameters.c_str(), this->mWorkflowParameters.size()), allocator);
104107
// Tracks
105108
tree.AddMember("trackCount", rapidjson::Value().SetInt(this->getTrackCount()), allocator);
106109

@@ -164,6 +167,12 @@ void VisualisationEvent::fromJson(std::string json)
164167
rapidjson::Value& fileVersion = tree["fileVersion"];
165168
version = fileVersion.GetInt();
166169
}
170+
auto timeStamp = time(nullptr);
171+
if (tree.HasMember("timeStamp")) {
172+
rapidjson::Value& fileTimeStamp = tree["timeStamp"];
173+
timeStamp = fileTimeStamp.GetFloat();
174+
}
175+
this->mTimeStamp = timeStamp;
167176

168177
rapidjson::Value& trackCount = tree["trackCount"];
169178
this->mTracks.reserve(trackCount.GetInt());
@@ -213,5 +222,10 @@ bool VisualisationEvent::fromFile(std::string fileName)
213222
return true;
214223
}
215224

225+
VisualisationEvent::VisualisationEvent()
226+
{
227+
this->mTimeStamp = time(nullptr); // current time
228+
}
229+
216230
} // namespace event_visualisation
217231
} // namespace o2

EventVisualisation/Workflow/include/EveWorkflow/EveWorkflowHelper.h

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,14 @@
1717
#define ALICE_O2_EVENTVISUALISATION_WORKFLOW_EVEWORKFLOWHELPER_H
1818

1919
#include "ReconstructionDataFormats/GlobalTrackID.h"
20+
#include "DataFormatsTRD/TrackTRD.h"
2021
#include "DataFormatsGlobalTracking/RecoContainer.h"
2122
#include "EveWorkflow/EveConfiguration.h"
2223
#include "EventVisualisationDataConverter/VisualisationEvent.h"
2324
#include "MFTBase/GeometryTGeo.h"
2425
#include "ITSBase/GeometryTGeo.h"
26+
#include "TPCFastTransform.h"
27+
#include "TPCReconstruction/TPCFastTransformHelperO2.h"
2528

2629
namespace o2::itsmft
2730
{
@@ -43,7 +46,7 @@ class EveWorkflowHelper
4346
static constexpr std::array<std::pair<float, float>, GID::NSources> minmaxR{{
4447
{1., 40.}, // ITS
4548
{85., 240.}, // TPC
46-
{-1, -1}, // TRD
49+
{-1, -1}, // TRD (never alone)
4750
{-1, -1}, // TOF
4851
{-1, -1}, // PHS
4952
{-1, -1}, // CPV
@@ -60,33 +63,40 @@ class EveWorkflowHelper
6063
{85., 430.}, // TPCTOF
6164
{85., 380.}, // TPCTRD
6265
{1., 380.}, // ITSTPCTRD
63-
{-1, -1}, // ITSTPCTOF,
64-
{-1, -1}, // TPCTRDTOF,
65-
{-1, -1}, // ITSTPCTRDTOF, // full barrel track
66+
{1., 430.}, // ITSTPCTOF,
67+
{85., 430.}, // TPCTRDTOF,
68+
{1., 430.}, // ITSTPCTRDTOF, // full barrel track
6669
{-1, -1}, // ITSAB,
6770
}};
71+
std::unique_ptr<gpu::TPCFastTransform> mTPCFastTransform;
6872

6973
public:
7074
EveWorkflowHelper();
7175
static std::vector<PNT> getTrackPoints(const o2::track::TrackPar& trc, float minR, float maxR, float maxStep, float minZ = 25000, float maxZ = 25000);
7276
void selectTracks(const CalibObjectsConst* calib, GID::mask_t maskCl,
7377
GID::mask_t maskTrk, GID::mask_t maskMatch);
74-
template <typename Functor>
75-
void addTrackToEvent(Functor source, GID gid, float trackTime, float z = 0.); // store track in mEvent
76-
void draw(std::string jsonPath, int numberOfFiles, int numberOfTracks = -1);
78+
void addTrackToEvent(const o2::track::TrackParCov& tr, GID gid, float trackTime, float dz);
79+
void draw(std::string jsonPath, int numberOfFiles, int numberOfTracks, o2::dataformats::GlobalTrackID::mask_t trkMask, o2::dataformats::GlobalTrackID::mask_t clMask, float mWorkflowVersion);
7780
void drawTPC(GID gid, float trackTime);
7881
void drawITS(GID gid, float trackTime);
7982
void drawMFT(GID gid, float trackTime);
8083
void drawMCH(GID gid, float trackTime);
84+
void drawMID(GID gid, float trackTime);
8185
void drawITSTPC(GID gid, float trackTime);
8286
void drawITSTPCTOF(GID gid, float trackTime);
87+
void drawITSTPCTRD(GID gid, float trackTime);
88+
void drawITSTPCTRDTOF(GID gid, float trackTime);
89+
void drawTPCTRDTOF(GID gid, float trackTime);
90+
void drawTPCTRD(GID gid, float trackTime);
91+
void drawTPCTOF(GID gid, float trackTime);
8392
void drawITSClusters(GID gid, float trackTime);
8493
void drawTPCClusters(GID gid, float trackTime);
8594
void drawMFTClusters(GID gid, float trackTime);
8695
void drawMCHClusters(GID gid, float trackTime);
96+
void drawMIDClusters(GID gid, float trackTime);
97+
void drawTRDClusters(const o2::trd::TrackTRD& trc, float trackTime);
98+
void drawTOFClusters(GID gid, float trackTime);
8799
void drawPoint(float x, float y, float z, float time) { mEvent.addCluster(x, y, z, time); }
88-
void drawPoint(o2::BaseCluster<float> pnt, float time) { mEvent.addCluster(pnt.getX(), pnt.getY(), pnt.getZ(), time); }
89-
void drawPoint(const float xyz[], float time) { mEvent.addCluster(xyz[0], xyz[1], xyz[2], time); }
90100
void prepareITSClusters(const o2::itsmft::TopologyDictionary& dict); // fills mITSClustersArray
91101
void prepareMFTClusters(const o2::itsmft::TopologyDictionary& dict); // fills mMFTClustersArray
92102

EventVisualisation/Workflow/include/EveWorkflow/O2DPLDisplay.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class TPCFastTransform;
4646
class O2DPLDisplaySpec : public o2::framework::Task
4747
{
4848
public:
49+
static constexpr float mWorkflowVersion = 1.01; // helps recognizing version of workflow which produce data
4950
O2DPLDisplaySpec(bool useMC, o2::dataformats::GlobalTrackID::mask_t trkMask,
5051
o2::dataformats::GlobalTrackID::mask_t clMask,
5152
std::shared_ptr<o2::globaltracking::DataRequest> dataRequest, std::string jsonPath,

0 commit comments

Comments
 (0)