Project
Loading...
Searching...
No Matches
EveWorkflowHelper.h
Go to the documentation of this file.
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
15
16#ifndef ALICE_O2_EVENTVISUALISATION_WORKFLOW_EVEWORKFLOWHELPER_H
17#define ALICE_O2_EVENTVISUALISATION_WORKFLOW_EVEWORKFLOWHELPER_H
18
26#include "MFTBase/GeometryTGeo.h"
30#include "TPCFastTransform.h"
35
36namespace o2::itsmft
37{
38class TopologyDictionary;
39}
40
41namespace o2::mft
42{
43class GeometryTGeo;
44}
45
46namespace o2::its
47{
48class GeometryTGeo;
49}
50
51namespace o2::phos
52{
53class Geometry;
54}
55
56namespace o2::emcal
57{
58class Geometry;
59class CellRecalibrator;
60} // namespace o2::emcal
61
63{
65using PNT = std::array<float, 3>;
66
67struct TracksSet {
68 std::vector<GID> trackGID;
69 std::vector<float> trackTime;
70};
71
73{
74 struct PropagationRange {
75 float minR;
76 float maxR;
77 float minZ;
78 float maxZ;
79 };
80
81 static constexpr EveWorkflowHelper::PropagationRange prITS = {1.f, 40.f, -74.f, 74.f};
82 static constexpr EveWorkflowHelper::PropagationRange prTPC = {85.f, 240.f, -260.f, 260.f};
83 static constexpr EveWorkflowHelper::PropagationRange prTRD = {-1.f, 372.f, -375.f, 375.f};
84 static constexpr EveWorkflowHelper::PropagationRange prTOF = {-1.f, 405.f, -375.f, 375.f};
85
86 static const std::unordered_map<GID::Source, PropagationRange> propagationRanges;
87
88 std::unique_ptr<gpu::TPCFastTransform> mTPCFastTransform;
89
90 static constexpr int TIME_OFFSET = 23000; // max TF time
91 static constexpr int MAXBCDiffErrCount = 5;
92
93 static constexpr std::array<const double, 4> mftZPositions = {-40., -45., -65., -85.};
94
95 static constexpr std::array<const double, 20> mchZPositions = {
96 -526.1599731445312,
97 -526.1599731445312,
98 -545.239990234375,
99 -545.239990234375,
100 -676.4,
101 -676.4,
102 -695.4,
103 -695.4,
104 -959.75,
105 -975.25,
106 -990.75,
107 -1006.25,
108 -1259.75,
109 -1284.25,
110 -1299.75,
111 -1315.25,
112 -1398.85,
113 -1414.35,
114 -1429.85,
115 -1445.35};
116
117 static constexpr std::array<const double, 4> midZPositions = o2::mid::geoparams::DefaultChamberZ;
118
119 public:
122
123 using AODForwardTracks = aod::FwdTracks;
124 using AODForwardTrack = AODForwardTracks::iterator;
125
127 using AODMFTTrack = AODMFTTracks::iterator;
129
131 static std::vector<PNT> getTrackPoints(const o2::track::TrackPar& trc, float minR, float maxR, float maxStep, float minZ = -25000, float maxZ = 25000);
133 void selectTracks(const CalibObjectsConst* calib, GID::mask_t maskCl, GID::mask_t maskTrk, GID::mask_t maskMatch);
134 void selectTowers();
135 void setITSROFs();
136 void addTrackToEvent(const o2::track::TrackPar& tr, GID gid, float trackTime, float dz, GID::Source source = GID::NSources, float maxStep = 4.f);
137 void draw(std::size_t primaryVertexIdx, bool sortTracks);
138 void drawTPC(GID gid, float trackTime, float dz = 0.f);
139 void drawITS(GID gid, float trackTime);
140 void drawMFT(GID gid, float trackTime);
141 void drawMCH(GID gid, float trackTime);
142 void drawMID(GID gid, float trackTime);
143 void drawMFTMCH(GID gid, float trackTime);
144 void drawITSTPC(GID gid, float trackTime, GID::Source source = GID::ITSTPC);
145 void drawITSTPCTOF(GID gid, float trackTime, GID::Source source = GID::ITSTPCTOF);
146 void drawITSTPCTRD(GID gid, float trackTime, GID::Source source = GID::ITSTPCTRD);
147 void drawITSTPCTRDTOF(GID gid, float trackTime);
148 void drawTPCTRDTOF(GID gid, float trackTime);
149 void drawMFTMCHMID(GID gid, float trackTime);
150 void drawTPCTRD(GID gid, float trackTime, GID::Source source = GID::TPCTRD);
151 void drawTPCTOF(GID gid, float trackTime);
152 void drawMCHMID(GID gid, float trackTime);
153 void drawPHS(GID gid);
154 void drawEMC(GID gid);
155 void drawHMP(GID gid);
156
157 void drawAODBarrel(AODBarrelTrack const& track, float trackTime);
158 void drawAODMFT(AODMFTTrack const& track, float trackTime);
159 void drawAODFwd(AODForwardTrack const& track, float trackTime);
160
161 void drawMFTTrack(GID gid, o2::track::TrackParFwd track, float trackTime);
162 void drawForwardTrack(GID gid, mch::TrackParam track, float startZ, float endZ, float trackTime);
163 void drawITSClusters(GID gid);
164 void drawTPCClusters(GID gid, float trackTimeTB = -2.e9); // if trackTimeTB<-1.e9, then use tpcTrack.getTime0()
165 void drawMFTClusters(GID gid);
166 void drawMCHClusters(GID gid);
167 void drawMIDClusters(GID gid);
168 void drawTRDClusters(const o2::trd::TrackTRD& trc);
169 void drawTOFClusters(GID gid);
170 void drawPoint(const float xyz[]) { mEvent.addCluster(xyz); }
171 void drawGlobalPoint(const TVector3& xyx, GID gid, float time) { mEvent.addGlobalCluster(xyx, gid, time); }
172 void prepareITSClusters(const o2::itsmft::TopologyDictionary* dict); // fills mITSClustersArray
173 void prepareMFTClusters(const o2::itsmft::TopologyDictionary* dict); // fills mMFTClustersArray
174 void clear() { mEvent.clear(); }
175
178 float findLastMIDClusterPosition(const o2::mid::Track& track);
181 bool isInsideITSROF(const Bracket& br);
182 bool isInsideTimeBracket(const Bracket& br);
183 bool isInsideITSROF(float t);
184 bool isInsideTimeBracket(float t);
185
186 void save(const std::string& jsonPath, const std::string& ext, int numberOfFiles);
187
188 bool mUseTimeBracket = false;
189 bool mUseEtaBracketTPC = false;
198 std::unordered_map<GID, std::size_t> mTotalDataTypes;
199 std::unordered_set<GID> mTotalAcceptedDataTypes;
200 std::unordered_map<std::size_t, std::vector<GID>> mPrimaryVertexTrackGIDs;
201 std::unordered_map<std::size_t, std::vector<GID>> mPrimaryVertexTriggerGIDs;
202 std::unordered_map<GID, unsigned int> mGIDTrackTime;
203 std::vector<Bracket> mItsROFBrackets;
204 std::vector<o2::BaseCluster<float>> mITSClustersArray;
205 std::vector<o2::BaseCluster<float>> mMFTClustersArray;
212 float mMUS2TPCTimeBins = 5.0098627f;
213 float mTPCTimeBins2MUS = 0.199606f;
216 float mTPCBin2MUS = 0;
217 static int BCDiffErrCount;
219};
220} // namespace o2::event_visualisation
221
222#endif // ALICE_O2_EVENTVISUALISATION_WORKFLOW_EVEWORKFLOWHELPER_H
Wrapper container for different reconstructed object types.
int16_t time
Definition RawEventData.h:4
Useful geometrical parameters for MID.
Global index for barrel track: provides provenance (detectors combination), index in respective array...
Definition of the GeometryTGeo class.
class to create TPC fast transformation
Definition of TPCFastTransform class.
Base forward track model, params only, w/o covariance.
Definition of the MCH track parameters for internal use.
calibration data from laser track calibration
Tool for recalibration at cell level.
EMCAL geometry definition.
Definition Geometry.h:40
void drawMFTTrack(GID gid, o2::track::TrackParFwd track, float trackTime)
std::unordered_map< std::size_t, std::vector< GID > > mPrimaryVertexTriggerGIDs
o2::mch::TrackParam forwardTrackToMCHTrack(const o2::track::TrackParFwd &track)
void drawTPCTRDTOF(GID gid, float trackTime)
void save(const std::string &jsonPath, const std::string &ext, int numberOfFiles)
o2::event_visualisation::VisualisationEvent mEvent
const o2::tpc::VDriftCorrFact * mTPCVDrift
void drawTPC(GID gid, float trackTime, float dz=0.f)
const o2::globaltracking::RecoContainer * getRecoContainer() const
float findLastMIDClusterPosition(const o2::mid::Track &track)
std::unordered_map< GID, unsigned int > mGIDTrackTime
void setRecoContainer(const o2::globaltracking::RecoContainer *rc)
o2::emcal::CellRecalibrator * mEMCALCalib
float findLastMCHClusterPosition(const o2::mch::TrackMCH &track)
void setTPCVDrift(const o2::tpc::VDriftCorrFact *v)
static std::vector< PNT > getTrackPoints(const o2::track::TrackPar &trc, float minR, float maxR, float maxStep, float minZ=-25000, float maxZ=25000)
void drawTRDClusters(const o2::trd::TrackTRD &trc)
void draw(std::size_t primaryVertexIdx, bool sortTracks)
const o2::globaltracking::RecoContainer * mRecoCont
void drawITSTPCTRD(GID gid, float trackTime, GID::Source source=GID::ITSTPCTRD)
void selectTracks(const CalibObjectsConst *calib, GID::mask_t maskCl, GID::mask_t maskTrk, GID::mask_t maskMatch)
std::vector< o2::BaseCluster< float > > mITSClustersArray
double bcDiffToTFTimeMUS(const o2::InteractionRecord &ir)
void setEMCALCellRecalibrator(o2::emcal::CellRecalibrator *calibrator)
void prepareITSClusters(const o2::itsmft::TopologyDictionary *dict)
void drawMFTMCHMID(GID gid, float trackTime)
void drawAODFwd(AODForwardTrack const &track, float trackTime)
void addTrackToEvent(const o2::track::TrackPar &tr, GID gid, float trackTime, float dz, GID::Source source=GID::NSources, float maxStep=4.f)
void drawForwardTrack(GID gid, mch::TrackParam track, float startZ, float endZ, float trackTime)
void prepareMFTClusters(const o2::itsmft::TopologyDictionary *dict)
void drawAODBarrel(AODBarrelTrack const &track, float trackTime)
void drawITSTPCTOF(GID gid, float trackTime, GID::Source source=GID::ITSTPCTOF)
std::vector< o2::BaseCluster< float > > mMFTClustersArray
void drawTPCClusters(GID gid, float trackTimeTB=-2.e9)
std::unordered_map< std::size_t, std::vector< GID > > mPrimaryVertexTrackGIDs
void drawTPCTRD(GID gid, float trackTime, GID::Source source=GID::TPCTRD)
void drawAODMFT(AODMFTTrack const &track, float trackTime)
const o2::vertexing::PVertexerParams * mPVParams
void drawGlobalPoint(const TVector3 &xyx, GID gid, float time)
void drawITSTPC(GID gid, float trackTime, GID::Source source=GID::ITSTPC)
void drawITSTPCTRDTOF(GID gid, float trackTime)
std::unordered_set< GID > mTotalAcceptedDataTypes
std::unordered_map< GID, std::size_t > mTotalDataTypes
void addGlobalCluster(float *xyz, float time, o2::dataformats::GlobalTrackID gid)
VisualisationCluster & addCluster(const float *xyz)
MCH track external format.
Definition TrackMCH.h:34
track parameters for internal use
Definition TrackParam.h:34
This class defines the MID track.
Definition Track.h:30
const GLdouble * v
Definition glcorearb.h:832
GLsizei GLsizei GLchar * source
Definition glcorearb.h:798
GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat maxZ
Definition glcorearb.h:2910
GLfloat GLfloat minZ
Definition glcorearb.h:2910
MFTTracks_001 MFTTracks
std::array< float, 3 > PNT
detail::Bracket< float > Bracketf_t
Definition Primitive2D.h:40
constexpr std::array< const double, 4 > DefaultChamberZ
Array of default z position of the chamber.
table_t::template iterator_template< DefaultIndexPolicy, self_t, Ts... > iterator
Definition ASoA.h:3162
o2::InteractionRecord ir(0, 0)