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
27#include "MFTBase/GeometryTGeo.h"
31#include "TPCFastTransform.h"
36
37namespace o2::itsmft
38{
39class TopologyDictionary;
40}
41
42namespace o2::mft
43{
44class GeometryTGeo;
45}
46
47namespace o2::its
48{
49class GeometryTGeo;
50}
51
52namespace o2::phos
53{
54class Geometry;
55}
56
57namespace o2::emcal
58{
59class Geometry;
60class CellRecalibrator;
61} // namespace o2::emcal
62
64{
66using PNT = std::array<float, 3>;
67
68struct TracksSet {
69 std::vector<GID> trackGID;
70 std::vector<float> trackTime;
71};
72
74{
75 struct PropagationRange {
76 float minR;
77 float maxR;
78 float minZ;
79 float maxZ;
80 };
81
82 static constexpr EveWorkflowHelper::PropagationRange prITS = {1.f, 40.f, -74.f, 74.f};
83 static constexpr EveWorkflowHelper::PropagationRange prTPC = {85.f, 240.f, -260.f, 260.f};
84 static constexpr EveWorkflowHelper::PropagationRange prTRD = {-1.f, 372.f, -375.f, 375.f};
85 static constexpr EveWorkflowHelper::PropagationRange prTOF = {-1.f, 405.f, -375.f, 375.f};
86
87 static const std::unordered_map<GID::Source, PropagationRange> propagationRanges;
88
89 std::unique_ptr<gpu::TPCFastTransform> mTPCFastTransform;
90
91 static constexpr int TIME_OFFSET = 23000; // max TF time
92 static constexpr int MAXBCDiffErrCount = 5;
93
94 static constexpr std::array<const double, 4> mftZPositions = {-40., -45., -65., -85.};
95
96 static constexpr std::array<const double, 20> mchZPositions = {
97 -526.1599731445312,
98 -526.1599731445312,
99 -545.239990234375,
100 -545.239990234375,
101 -676.4,
102 -676.4,
103 -695.4,
104 -695.4,
105 -959.75,
106 -975.25,
107 -990.75,
108 -1006.25,
109 -1259.75,
110 -1284.25,
111 -1299.75,
112 -1315.25,
113 -1398.85,
114 -1414.35,
115 -1429.85,
116 -1445.35};
117
118 static constexpr std::array<const double, 4> midZPositions = o2::mid::geoparams::DefaultChamberZ;
119
120 public:
123
124 using AODForwardTracks = aod::FwdTracks;
125 using AODForwardTrack = AODForwardTracks::iterator;
126
128 using AODMFTTrack = AODMFTTracks::iterator;
130
132 static std::vector<PNT> getTrackPoints(const o2::track::TrackPar& trc, float minR, float maxR, float maxStep, float minZ = -25000, float maxZ = 25000);
134 void selectTracks(const CalibObjectsConst* calib, GID::mask_t maskCl, GID::mask_t maskTrk, GID::mask_t maskMatch);
135 void selectTowers();
136 void setITSROFs();
137 void addTrackToEvent(const o2::track::TrackPar& tr, GID gid, float trackTime, float dz, GID::Source source = GID::NSources, float maxStep = 4.f);
138 void draw(std::size_t primaryVertexIdx, bool sortTracks);
139 void drawTPC(GID gid, float trackTime, float dz = 0.f);
140 void drawITS(GID gid, float trackTime);
141 void drawMFT(GID gid, float trackTime);
142 void drawMCH(GID gid, float trackTime);
143 void drawMID(GID gid, float trackTime);
144 void drawMFTMCH(GID gid, float trackTime);
145 void drawITSTPC(GID gid, float trackTime, GID::Source source = GID::ITSTPC);
146 void drawITSTPCTOF(GID gid, float trackTime, GID::Source source = GID::ITSTPCTOF);
147 void drawITSTPCTRD(GID gid, float trackTime, GID::Source source = GID::ITSTPCTRD);
148 void drawITSTPCTRDTOF(GID gid, float trackTime);
149 void drawTPCTRDTOF(GID gid, float trackTime);
150 void drawMFTMCHMID(GID gid, float trackTime);
151 void drawTPCTRD(GID gid, float trackTime, GID::Source source = GID::TPCTRD);
152 void drawTPCTOF(GID gid, float trackTime);
153 void drawMCHMID(GID gid, float trackTime);
154 void drawPHS(GID gid);
155 void drawEMC(GID gid);
156 void drawHMP(GID gid);
157
158 void drawAODBarrel(AODBarrelTrack const& track, float trackTime);
159 void drawAODMFT(AODMFTTrack const& track, float trackTime);
160 void drawAODFwd(AODForwardTrack const& track, float trackTime);
161
162 void drawMFTTrack(GID gid, o2::track::TrackParFwd track, float trackTime);
163 void drawForwardTrack(GID gid, mch::TrackParam track, float startZ, float endZ, float trackTime);
164 void drawITSClusters(GID gid);
165 void drawTPCClusters(GID gid, float trackTimeTB = -2.e9); // if trackTimeTB<-1.e9, then use tpcTrack.getTime0()
166 void drawMFTClusters(GID gid);
167 void drawMCHClusters(GID gid);
168 void drawMIDClusters(GID gid);
169 void drawTRDClusters(const o2::trd::TrackTRD& trc);
170 void drawTOFClusters(GID gid);
171 void drawPoint(const float xyz[]) { mEvent.addCluster(xyz); }
172 void drawGlobalPoint(const TVector3& xyx, GID gid, float time) { mEvent.addGlobalCluster(xyx, gid, time); }
173 void prepareITSClusters(const o2::itsmft::TopologyDictionary* dict); // fills mITSClustersArray
174 void prepareMFTClusters(const o2::itsmft::TopologyDictionary* dict); // fills mMFTClustersArray
175 void clear() { mEvent.clear(); }
176
179 float findLastMIDClusterPosition(const o2::mid::Track& track);
182 bool isInsideITSROF(const Bracket& br);
183 bool isInsideTimeBracket(const Bracket& br);
184 bool isInsideITSROF(float t);
185 bool isInsideTimeBracket(float t);
186
187 void save(const std::string& jsonPath, const std::string& ext, int numberOfFiles, const std::string& receiverHostname, int receiverPort, int receiverTimeout, bool useOnlyFiles, bool useOnlySockets);
188
189 bool mUseTimeBracket = false;
190 bool mUseEtaBracketTPC = false;
199 std::unordered_map<GID, std::size_t> mTotalDataTypes;
200 std::unordered_set<GID> mTotalAcceptedDataTypes;
201 std::unordered_map<std::size_t, std::vector<GID>> mPrimaryVertexTrackGIDs;
202 std::unordered_map<std::size_t, std::vector<GID>> mPrimaryVertexTriggerGIDs;
203 std::unordered_map<GID, unsigned int> mGIDTrackTime;
204 std::vector<Bracket> mItsROFBrackets;
205 o2::itsmft::ClustersPerLayer<o2::BaseCluster<float>> mITSClustersArray; // addressed by the composed (layer,index) ID
206 std::vector<o2::BaseCluster<float>> mMFTClustersArray;
213 float mMUS2TPCTimeBins = 5.0098627f;
214 float mTPCTimeBins2MUS = 0.199606f;
217 float mTPCBin2MUS = 0;
218 static int BCDiffErrCount;
220};
221} // namespace o2::event_visualisation
222
223#endif // ALICE_O2_EVENTVISUALISATION_WORKFLOW_EVEWORKFLOWHELPER_H
Container of the ITS/MFT clusters addressed by the composed (layer,index) ID.
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:42
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, const std::string &receiverHostname, int receiverPort, int receiverTimeout, bool useOnlyFiles, bool useOnlySockets)
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)
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)
o2::itsmft::ClustersPerLayer< o2::BaseCluster< float > > mITSClustersArray
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:3452
o2::InteractionRecord ir(0, 0)