Skip to content

Commit 5c3b378

Browse files
Julian Myrchashahor02
authored andcommitted
applying required fixes
1 parent a807ee6 commit 5c3b378

File tree

3 files changed

+20
-68
lines changed

3 files changed

+20
-68
lines changed

EventVisualisation/DataConverter/include/EventVisualisationDataConverter/VisualisationEvent.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class VisualisationEvent
109109
const VisualisationCluster& getCluster(int i) const { return mClusters[i]; };
110110
size_t getClusterCount() const { return mClusters.size(); } // Returns number of clusters
111111
void setWorkflowVersion(float workflowVersion) { this->mWorkflowVersion = workflowVersion; }
112-
void setWorkflowParameters(std::string workflowParameters) { this->mWorkflowParameters = workflowParameters; }
112+
void setWorkflowParameters(const std::string& workflowParameters) { this->mWorkflowParameters = workflowParameters; }
113113

114114
private:
115115
float mWorkflowVersion; /// workflow version used to generate this Event

EventVisualisation/Workflow/include/EveWorkflow/EveWorkflowHelper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class EveWorkflowHelper
7676
void selectTracks(const CalibObjectsConst* calib, GID::mask_t maskCl,
7777
GID::mask_t maskTrk, GID::mask_t maskMatch);
7878
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);
79+
void draw(const std::string& jsonPath, int numberOfFiles, int numberOfTracks, o2::dataformats::GlobalTrackID::mask_t trkMask, o2::dataformats::GlobalTrackID::mask_t clMask, float mWorkflowVersion);
8080
void drawTPC(GID gid, float trackTime);
8181
void drawITS(GID gid, float trackTime);
8282
void drawMFT(GID gid, float trackTime);

EventVisualisation/Workflow/src/EveWorkflowHelper.cxx

Lines changed: 18 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void EveWorkflowHelper::selectTracks(const CalibObjectsConst* calib,
4343
this->mRecoCont.createTracksVariadic(creator);
4444
}
4545

46-
void EveWorkflowHelper::draw(std::string jsonPath, int numberOfFiles, int numberOfTracks,
46+
void EveWorkflowHelper::draw(const std::string& jsonPath, int numberOfFiles, int numberOfTracks,
4747
o2::dataformats::GlobalTrackID::mask_t trkMask,
4848
o2::dataformats::GlobalTrackID::mask_t clMask, float workflowVersion)
4949
{
@@ -196,108 +196,60 @@ void EveWorkflowHelper::drawITSTPC(GID gid, float trackTime)
196196
// LOG(INFO) << "EveWorkflowHelper::drawITSTPC " << gid;
197197
const auto& track = mRecoCont.getTPCITSTrack(gid);
198198
addTrackToEvent(track, gid, trackTime, 0.);
199-
const auto detRefs = mRecoCont.getSingleDetectorRefs(gid);
200-
if (detRefs[o2::dataformats::GlobalTrackID::Source::ITS].isIndexSet()) {
201-
drawITSClusters(detRefs[o2::dataformats::GlobalTrackID::Source::ITS], trackTime);
202-
}
203-
if (detRefs[o2::dataformats::GlobalTrackID::Source::ITSAB].isIndexSet()) {
204-
drawITSClusters(detRefs[o2::dataformats::GlobalTrackID::Source::ITSAB], trackTime);
205-
}
206-
if (detRefs[o2::dataformats::GlobalTrackID::Source::TPC].isIndexSet()) {
207-
drawTPCClusters(detRefs[o2::dataformats::GlobalTrackID::Source::TPC], trackTime);
208-
}
199+
drawITSClusters(track.getRefITS(), trackTime);
200+
drawTPCClusters(track.getRefTPC(), trackTime);
209201
}
210202

211203
void EveWorkflowHelper::drawITSTPCTOF(GID gid, float trackTime)
212204
{
213205
const auto& track = mRecoCont.getITSTPCTOFTrack(gid);
214206
addTrackToEvent(track, gid, trackTime, 0.);
215-
const auto detRefs = mRecoCont.getSingleDetectorRefs(gid);
216-
if (detRefs[o2::dataformats::GlobalTrackID::Source::ITS].isIndexSet()) {
217-
drawITSClusters(detRefs[o2::dataformats::GlobalTrackID::Source::ITS], trackTime);
218-
}
219-
if (detRefs[o2::dataformats::GlobalTrackID::Source::ITSAB].isIndexSet()) {
220-
drawITSClusters(detRefs[o2::dataformats::GlobalTrackID::Source::ITSAB], trackTime);
221-
}
222-
if (detRefs[o2::dataformats::GlobalTrackID::Source::TPC].isIndexSet()) {
223-
drawTPCClusters(detRefs[o2::dataformats::GlobalTrackID::Source::TPC], trackTime);
224-
}
207+
drawITSClusters(track.getRefITS(), trackTime);
208+
drawTPCClusters(track.getRefTPC(), trackTime);
225209
drawTOFClusters(gid, trackTime);
226210
}
227211

228212
void EveWorkflowHelper::drawTPCTRD(GID gid, float trackTime)
229213
{
230214
//LOG(INFO) << "EveWorkflowHelper::drawTPCTRD " << gid;
231-
232-
const auto detRefs = mRecoCont.getSingleDetectorRefs(gid);
233-
if (detRefs[o2::dataformats::GlobalTrackID::Source::TPC].isIndexSet()) {
234-
const auto& tpcTrack = mRecoCont.getTPCTrack(detRefs[o2::dataformats::GlobalTrackID::Source::TPC]);
235-
addTrackToEvent(tpcTrack, gid, trackTime, 0);
236-
drawTPCClusters(detRefs[o2::dataformats::GlobalTrackID::Source::TPC], trackTime);
237-
}
238215
const auto& tpcTrdTrack = mRecoCont.getTPCTRDTrack<o2::trd::TrackTRD>(gid);
216+
drawTPCClusters(tpcTrdTrack.getRefGlobalTrackId(), trackTime);
239217
drawTRDClusters(tpcTrdTrack, trackTime);
240218
}
241219

242220
void EveWorkflowHelper::drawITSTPCTRD(GID gid, float trackTime)
243221
{
244222
// LOG(INFO) << "EveWorkflowHelper::drawITSTPCTRD " << gid;
245-
const auto& itsTpcTrdTrack = mRecoCont.getTPCTRDTrack<o2::trd::TrackTRD>(gid);
246-
addTrackToEvent(itsTpcTrdTrack, gid, trackTime, 0);
247-
const auto detRefs = mRecoCont.getSingleDetectorRefs(gid);
248-
if (detRefs[o2::dataformats::GlobalTrackID::Source::ITS].isIndexSet()) {
249-
drawITSClusters(detRefs[o2::dataformats::GlobalTrackID::Source::ITS], trackTime);
250-
}
251-
if (detRefs[o2::dataformats::GlobalTrackID::Source::ITSAB].isIndexSet()) {
252-
drawITSClusters(detRefs[o2::dataformats::GlobalTrackID::Source::ITSAB], trackTime);
253-
}
254-
if (detRefs[o2::dataformats::GlobalTrackID::Source::TPC].isIndexSet()) {
255-
drawTPCClusters(detRefs[o2::dataformats::GlobalTrackID::Source::TPC], trackTime);
256-
}
223+
const auto& itsTpcTrdTrack = mRecoCont.getITSTPCTRDTrack<o2::trd::TrackTRD>(gid);
224+
drawITSTPC(itsTpcTrdTrack.getRefGlobalTrackId(), trackTime);
257225
drawTRDClusters(itsTpcTrdTrack, trackTime);
258226
}
259227

260228
void EveWorkflowHelper::drawITSTPCTRDTOF(GID gid, float trackTime)
261229
{
262230
// LOG(INFO) << "EveWorkflowHelper::drawITSTPCTRDTOF " << gid;
263-
const auto& itsTpcTrdTofTrack = mRecoCont.getTPCTRDTrack<o2::trd::TrackTRD>(gid);
264-
addTrackToEvent(itsTpcTrdTofTrack, gid, trackTime, 0);
265-
const auto detRefs = mRecoCont.getSingleDetectorRefs(gid);
266-
if (detRefs[o2::dataformats::GlobalTrackID::Source::ITS].isIndexSet()) {
267-
drawITSClusters(detRefs[o2::dataformats::GlobalTrackID::Source::ITS], trackTime);
268-
}
269-
if (detRefs[o2::dataformats::GlobalTrackID::Source::ITSAB].isIndexSet()) {
270-
drawITSClusters(detRefs[o2::dataformats::GlobalTrackID::Source::ITSAB], trackTime);
271-
}
272-
if (detRefs[o2::dataformats::GlobalTrackID::Source::TPC].isIndexSet()) {
273-
drawTPCClusters(detRefs[o2::dataformats::GlobalTrackID::Source::TPC], trackTime);
274-
}
275-
drawTRDClusters(itsTpcTrdTofTrack, trackTime);
231+
const auto& match = mRecoCont.getITSTPCTRDTOFMatches()[gid.getIndex()];
232+
auto gidITSTPCTRD = match.getTrackRef();
233+
drawITSTPCTRD(gidITSTPCTRD, trackTime);
276234
drawTOFClusters(gid, trackTime);
277235
}
278236

279237
void EveWorkflowHelper::drawTPCTRDTOF(GID gid, float trackTime)
280238
{
281239
// LOG(INFO) << "EveWorkflowHelper::drawTPCTRDTOF " << gid;
282-
const auto& tpcTrdTofTrack = mRecoCont.getTPCTRDTrack<o2::trd::TrackTRD>(gid);
283-
addTrackToEvent(tpcTrdTofTrack, gid, trackTime, 0);
284-
const auto detRefs = mRecoCont.getSingleDetectorRefs(gid);
285-
if (detRefs[o2::dataformats::GlobalTrackID::Source::TPC].isIndexSet()) {
286-
drawTPCClusters(detRefs[o2::dataformats::GlobalTrackID::Source::TPC], trackTime);
287-
}
288-
drawTRDClusters(tpcTrdTofTrack, trackTime);
240+
const auto& match = mRecoCont.getTPCTRDTOFMatches()[gid.getIndex()];
241+
auto gidTPCTRD = match.getTrackRef();
242+
drawTPCTRD(gidTPCTRD, trackTime);
289243
drawTOFClusters(gid, trackTime);
290244
}
291245

292246
void EveWorkflowHelper::drawTPCTOF(GID gid, float trackTime)
293247
{
294248
// LOG(INFO) << "EveWorkflowHelper::drawTPCTRDTOF " << gid;
295-
const auto detRefs = mRecoCont.getSingleDetectorRefs(gid);
296-
if (detRefs[o2::dataformats::GlobalTrackID::Source::TPC].isIndexSet()) {
297-
const auto& tpcTrack = mRecoCont.getTPCTrack(detRefs[o2::dataformats::GlobalTrackID::Source::TPC]);
298-
addTrackToEvent(tpcTrack, gid, trackTime, 0);
299-
drawTPCClusters(detRefs[o2::dataformats::GlobalTrackID::Source::TPC], trackTime);
300-
}
249+
const auto& trTPCTOF = mRecoCont.getTPCTOFTrack(gid);
250+
const auto& match = mRecoCont.getTPCTOFMatch(gid.getIndex());
251+
addTrackToEvent(trTPCTOF, gid, trackTime, 0);
252+
drawTPCClusters(match.getTrackRef(), trackTime);
301253
drawTOFClusters(gid, trackTime);
302254
}
303255

0 commit comments

Comments
 (0)