Skip to content

Commit 95bbd3f

Browse files
shahor02ehellbar
authored andcommitted
Simplify eve options, shift TPC tracks by PV time and apply dca cuts
1 parent 3b67095 commit 95bbd3f

File tree

9 files changed

+250
-200
lines changed

9 files changed

+250
-200
lines changed

EventVisualisation/Base/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ o2_add_library(EventVisualisationBase
1717
src/GeometryManager.cxx
1818
src/FileWatcher.cxx
1919
src/DirectoryLoader.cxx
20-
20+
src/EveConfParam.cxx
2121
PUBLIC_LINK_LIBRARIES ROOT::Eve
2222
O2::CCDB
2323
O2::EventVisualisationDataConverter
2424
O2::DetectorsBase
2525
)
26+
27+
o2_target_root_dictionary(EventVisualisationBase
28+
HEADERS include/EventVisualisationBase/EveConfParam.h)
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
12+
#ifndef ALICE_O2_EVENTVISUALISATION_CONFIG_H
13+
#define ALICE_O2_EVENTVISUALISATION_CONFIG_H
14+
#include "CommonUtils/ConfigurableParam.h"
15+
#include "CommonUtils/ConfigurableParamHelper.h"
16+
17+
namespace o2::event_visualisation
18+
{
19+
struct EveConfParam : o2::conf::ConfigurableParamHelper<EveConfParam> {
20+
float EMCCellTimeMax = 100.f; // Max. EMCAL cell time (in ns)
21+
float EMCCellEnergyMin = 0.3f; // Min. EMCAL cell energy (in GeV)
22+
23+
float timeMinMax[2] = {-999.f, -999.f}; // if min<max (microseconds), show only track in this range of every TF
24+
25+
int maxFiles = 150; // maximum number of json files in folder
26+
int maxTracks = -1; // maximum number of track stored in json file (-1 means no limit)
27+
int maxBytes = 3000000; // number of bytes stored in time interval which stops producing new data file (-1 means no limit)
28+
29+
int maxPVs = -1; // if > 0: enable PV mode and limit max number of vertices
30+
int minTracks = -1; // don't create file if less than the specified number of all tracks is present
31+
int minITSTracks = -1; // don't create file if less than the specified number of ITS tracks is present
32+
int onlyNthEvent = -1; // process only every nth event (if > 1)
33+
float PVXYZMin[3] = {-999.f, -999.f, -999.f}; // primary vertex min x,y,z
34+
float PVXYZMax[3] = {999.f, 999.f, 999.f}; // primary vertex max x,y,z
35+
float TPCOnlyMaxDCARZ[2] = {-999.f, -999.f}; // max DCA r,z (if positive) for TPC only tracks in the primary vertex mode
36+
float TPCEtaAbsMax = -1.f; // if positive, show TPC tracks only below this abs eta
37+
38+
bool PVMode = false; // produce jsons with individual primary vertices, not total time frame data
39+
bool PVTriggersMode = false; // instead of drawing vertices with tracks (and maybe calorimeter triggers), draw vertices with calorimeter triggers (and maybe tracks)"
40+
bool trackSorting = false; // sort track by track time before applying filters
41+
bool filterITSROF = false; // don't display tracks outside ITS readout frame
42+
bool calibrateEMC = true; // apply on-the-fly EMCAL calibration
43+
44+
O2ParamDef(EveConfParam, "eveconf");
45+
};
46+
} // namespace o2::event_visualisation
47+
48+
#endif
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
12+
#include "EventVisualisationBase/EveConfParam.h"
13+
14+
O2ParamImpl(o2::event_visualisation::EveConfParam);
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
12+
#ifdef __CLING__
13+
14+
#pragma link off all globals;
15+
#pragma link off all classes;
16+
#pragma link off all functions;
17+
18+
#pragma link C++ class o2::event_visualisation::EveConfParam + ;
19+
20+
#pragma link C++ class o2::conf::ConfigurableParamHelper < o2::event_visualisation::EveConfParam> + ;
21+
22+
#endif

EventVisualisation/Workflow/include/EveWorkflow/EveWorkflowHelper.h

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "ITSBase/GeometryTGeo.h"
3030
#include "TPCFastTransform.h"
3131
#include "TPCReconstruction/TPCFastTransformHelperO2.h"
32+
#include "DataFormatsTPC/VDriftCorrFact.h"
3233
#include "Framework/AnalysisDataModel.h"
3334
#include "DetectorsVertexing/PVertexerParams.h"
3435

@@ -124,27 +125,17 @@ class EveWorkflowHelper
124125

125126
using AODMFTTracks = aod::MFTTracks;
126127
using AODMFTTrack = AODMFTTracks::iterator;
127-
128-
enum Filter : uint8_t {
129-
ITSROF,
130-
TimeBracket,
131-
EtaBracket,
132-
TotalNTracks,
133-
NFilters
134-
};
135-
136-
using FilterSet = std::bitset<Filter::NFilters>;
137-
138128
using Bracket = o2::math_utils::Bracketf_t;
139129

140-
EveWorkflowHelper(const FilterSet& enabledFilters = {}, std::size_t maxNTracks = -1, const Bracket& timeBracket = {}, const Bracket& etaBracket = {}, bool primaryVertexMode = false);
130+
EveWorkflowHelper();
141131
static std::vector<PNT> getTrackPoints(const o2::track::TrackPar& trc, float minR, float maxR, float maxStep, float minZ = -25000, float maxZ = 25000);
132+
void setTPCVDrift(const o2::tpc::VDriftCorrFact* v);
142133
void selectTracks(const CalibObjectsConst* calib, GID::mask_t maskCl, GID::mask_t maskTrk, GID::mask_t maskMatch);
143134
void selectTowers();
144135
void setITSROFs();
145136
void addTrackToEvent(const o2::track::TrackPar& tr, GID gid, float trackTime, float dz, GID::Source source = GID::NSources, float maxStep = 4.f);
146137
void draw(std::size_t primaryVertexIdx, bool sortTracks);
147-
void drawTPC(GID gid, float trackTime);
138+
void drawTPC(GID gid, float trackTime, float dz = 0.f);
148139
void drawITS(GID gid, float trackTime);
149140
void drawMFT(GID gid, float trackTime);
150141
void drawMCH(GID gid, float trackTime);
@@ -170,7 +161,7 @@ class EveWorkflowHelper
170161
void drawMFTTrack(GID gid, o2::track::TrackParFwd track, float trackTime);
171162
void drawForwardTrack(GID gid, mch::TrackParam track, float startZ, float endZ, float trackTime);
172163
void drawITSClusters(GID gid);
173-
void drawTPCClusters(GID gid);
164+
void drawTPCClusters(GID gid, float trackTimeTB = -2.e9); // if trackTimeTB<-1.e9, then use tpcTrack.getTime0()
174165
void drawMFTClusters(GID gid);
175166
void drawMCHClusters(GID gid);
176167
void drawMIDClusters(GID gid);
@@ -194,17 +185,14 @@ class EveWorkflowHelper
194185

195186
void save(const std::string& jsonPath, const std::string& ext, int numberOfFiles);
196187

197-
FilterSet mEnabledFilters;
198-
std::size_t mMaxNTracks;
199-
Bracket mTimeBracket;
200-
Bracket mEtaBracket;
201-
bool mPrimaryVertexMode;
188+
bool mUseTimeBracket = false;
189+
bool mUseEtaBracketTPC = false;
190+
Bracket mTimeBracket{};
191+
Bracket mEtaBracketTPC;
202192
const o2::globaltracking::RecoContainer* mRecoCont = nullptr;
203193
const o2::globaltracking::RecoContainer* getRecoContainer() const { return mRecoCont; }
204194
void setRecoContainer(const o2::globaltracking::RecoContainer* rc) { mRecoCont = rc; }
205195
void setEMCALCellRecalibrator(o2::emcal::CellRecalibrator* calibrator) { mEMCALCalib = calibrator; }
206-
void setMaxEMCALCellTime(float maxtime) { mEMCALMaxCellTime = maxtime; }
207-
void setMinEMCALCellEnergy(float minenergy) { mEMCALMinCellEnergy = minenergy; }
208196
TracksSet mTrackSet;
209197
o2::event_visualisation::VisualisationEvent mEvent;
210198
std::unordered_map<GID, std::size_t> mTotalDataTypes;
@@ -220,13 +208,12 @@ class EveWorkflowHelper
220208
o2::phos::Geometry* mPHOSGeom;
221209
o2::emcal::Geometry* mEMCALGeom;
222210
o2::emcal::CellRecalibrator* mEMCALCalib = nullptr;
223-
224-
float mMUS2TPCTimeBins = 5.0098627;
211+
const o2::tpc::VDriftCorrFact* mTPCVDrift = nullptr;
212+
float mMUS2TPCTimeBins = 5.0098627f;
213+
float mTPCTimeBins2MUS = 0.199606f;
225214
float mITSROFrameLengthMUS = 0; ///< ITS RO frame in mus
226215
float mMFTROFrameLengthMUS = 0; ///< MFT RO frame in mus
227216
float mTPCBin2MUS = 0;
228-
float mEMCALMaxCellTime = 100.; ///< EMCAL cell time cut (in ns)
229-
float mEMCALMinCellEnergy = 0.3; ///< EMCAL cell energy cut (in GeV)
230217
static int BCDiffErrCount;
231218
const o2::vertexing::PVertexerParams* mPVParams = nullptr;
232219
};

EventVisualisation/Workflow/include/EveWorkflow/O2DPLDisplay.h

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include "ReconstructionDataFormats/GlobalTrackID.h"
2020
#include "DataFormatsGlobalTracking/RecoContainer.h"
21+
#include "TPCCalibration/VDriftHelper.h"
2122
#include "DetectorsBase/GRPGeomHelper.h"
2223
#include "EMCALCalib/CellRecalibrator.h"
2324
#include "EMCALWorkflow/CalibLoader.h"
@@ -58,14 +59,9 @@ class O2DPLDisplaySpec : public o2::framework::Task
5859
std::shared_ptr<o2::base::GRPGeomRequest> gr,
5960
std::shared_ptr<o2::emcal::CalibLoader> emcCalibLoader,
6061
const std::string& jsonPath, const std::string& ext,
61-
std::chrono::milliseconds timeInterval, int numberOfFiles, int numberOfTracks, int numberOfBytes,
62-
bool eveHostNameMatch, int minITSTracks, int minTracks, bool filterITSROF, bool filterTime,
63-
const EveWorkflowHelper::Bracket& timeBracket, bool removeTPCEta,
64-
const EveWorkflowHelper::Bracket& etaBracket, bool trackSorting, int onlyNthEvent,
65-
bool primaryVertex, int maxPrimaryVertices, bool primaryVertexTriggers,
66-
float primaryVertexMinZ, float primaryVertexMaxZ, float primaryVertexMinX, float primaryVertexMaxX, float primaryVertexMinY, float primaryVertexMaxY,
67-
float maxEMCALCellTime, float minEMCALCellEnergy)
68-
: mDisableWrite(disableWrite), mUseMC(useMC), mTrkMask(trkMask), mClMask(clMask), mDataRequest(dataRequest), mGGCCDBRequest(gr), mEMCALCalibLoader(emcCalibLoader), mJsonPath(jsonPath), mExt(ext), mTimeInterval(timeInterval), mNumberOfFiles(numberOfFiles), mNumberOfTracks(numberOfTracks), mNumberOfBytes(numberOfBytes), mEveHostNameMatch(eveHostNameMatch), mMinITSTracks(minITSTracks), mMinTracks(minTracks), mFilterITSROF(filterITSROF), mFilterTime(filterTime), mTimeBracket(timeBracket), mRemoveTPCEta(removeTPCEta), mEtaBracket(etaBracket), mTrackSorting(trackSorting), mOnlyNthEvent(onlyNthEvent), mPrimaryVertexMode(primaryVertex), mMaxPrimaryVertices(maxPrimaryVertices), mPrimaryVertexTriggers(primaryVertexTriggers), mPrimaryVertexMinZ(primaryVertexMinZ), mPrimaryVertexMaxZ(primaryVertexMaxZ), mPrimaryVertexMinX(primaryVertexMinX), mPrimaryVertexMaxX(primaryVertexMaxX), mPrimaryVertexMinY(primaryVertexMinY), mPrimaryVertexMaxY(primaryVertexMaxY), mEMCALMaxCellTime(maxEMCALCellTime), mEMCALMinCellEnergy(minEMCALCellEnergy), mRunType(o2::parameters::GRPECS::NONE)
62+
std::chrono::milliseconds timeInterval,
63+
bool eveHostNameMatch)
64+
: mDisableWrite(disableWrite), mUseMC(useMC), mTrkMask(trkMask), mClMask(clMask), mDataRequest(dataRequest), mGGCCDBRequest(gr), mEMCALCalibLoader(emcCalibLoader), mJsonPath(jsonPath), mExt(ext), mTimeInterval(timeInterval), mEveHostNameMatch(eveHostNameMatch), mRunType(o2::parameters::GRPECS::NONE)
6965

7066
{
7167
this->mTimeStamp = std::chrono::high_resolution_clock::now() - timeInterval; // first run meets condition
@@ -82,32 +78,10 @@ class O2DPLDisplaySpec : public o2::framework::Task
8278
bool mDisableWrite = false; // skip writing result (for testing performance)
8379
bool mUseMC = false;
8480
bool mEveHostNameMatch; // empty or correct hostname
85-
int mMinITSTracks; // minimum number of ITS tracks to produce a file
86-
int mMinTracks; // minimum number of all tracks to produce a file
87-
bool mFilterITSROF; // don't display tracks outside ITS readout frame
88-
bool mFilterTime; // don't display tracks outside [min, max] range in TF time
89-
bool mRemoveTPCEta; // don't display TPC tracks inside [min, max] eta range
90-
bool mPrimaryVertexMode; // produce files per primary vertex
91-
EveWorkflowHelper::Bracket mTimeBracket; // [min, max] range in TF time for the filter
92-
EveWorkflowHelper::Bracket mEtaBracket; // [min, max] eta range for the TPC tracks removal
9381
std::string mJsonPath; // folder where files are stored
9482
std::string mExt; // extension of created files (".json" or ".root")
9583
std::chrono::milliseconds mTimeInterval; // minimal interval between files in milliseconds
96-
int mNumberOfFiles; // maximum number of files in folder - newer replaces older
97-
int mNumberOfTracks; // maximum number of track in single file (0 means no limit)
98-
int mNumberOfBytes; // number of bytes stored in period which causes stopping saving a new file
99-
bool mTrackSorting; // perform sorting tracks by track time before applying filters
100-
int mOnlyNthEvent; // process only every nth event.
101-
int mMaxPrimaryVertices; // max number of primary vertices to draw per time frame
10284
bool mPrimaryVertexTriggers; // instead of drawing vertices with tracks (and maybe calorimeter triggers), draw vertices with calorimeter triggers (and maybe tracks)
103-
float mPrimaryVertexMinZ; // minimum z position of the primary vertex
104-
float mPrimaryVertexMaxZ; // maximum z position of the primary vertex
105-
float mPrimaryVertexMinX; // minimum x position of the primary vertex
106-
float mPrimaryVertexMaxX; // maximum x position of the primary vertex
107-
float mPrimaryVertexMinY; // minimum y position of the primary vertex
108-
float mPrimaryVertexMaxY; // maximum y position of the primary vertex
109-
float mEMCALMaxCellTime; // max abs EMCAL cell time (in ns)
110-
float mEMCALMinCellEnergy; // min EMCAL cell energy (in GeV)
11185
int mEventCounter = 0;
11286
std::chrono::time_point<std::chrono::high_resolution_clock> mTimeStamp;
11387

@@ -119,6 +93,7 @@ class O2DPLDisplaySpec : public o2::framework::Task
11993
std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
12094
std::shared_ptr<o2::emcal::CalibLoader> mEMCALCalibLoader;
12195
std::unique_ptr<o2::emcal::CellRecalibrator> mEMCALCalibrator;
96+
o2::tpc::VDriftHelper mTPCVDriftHelper{};
12297
};
12398

12499
} // namespace o2::event_visualisation

0 commit comments

Comments
 (0)