Skip to content

Commit 45948b4

Browse files
authored
Merge 0e15090 into sapling-pr-archive-ktf
2 parents 4c18517 + 0e15090 commit 45948b4

File tree

16 files changed

+310
-210
lines changed

16 files changed

+310
-210
lines changed

DataFormats/Reconstruction/include/ReconstructionDataFormats/MatchInfoTOF.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ class MatchInfoTOF
4141
void setChi2(float chi2) { mChi2 = chi2; }
4242
float getChi2() const { return mChi2; }
4343

44+
void setHitPatternUpDown(bool v) { mHitUpDown = v; }
45+
bool getHitPatternUpDown() const { return mHitUpDown; }
46+
47+
void setHitPatternLeftRight(bool v) { mHitLeftRight = v; }
48+
bool getHitPatternLeftRight() const { return mHitLeftRight; }
49+
4450
o2::track::TrackLTIntegral& getLTIntegralOut() { return mIntLT; }
4551
const o2::track::TrackLTIntegral& getLTIntegralOut() const { return mIntLT; }
4652
void print() const;
@@ -76,8 +82,11 @@ class MatchInfoTOF
7682
double mSignal = 0.0; ///< TOF time in ps
7783
float mVz = 0.0; ///< Vz from TOF match
7884
int mChannel = -1; ///< channel
85+
// Hit pattern information
86+
bool mHitUpDown = false; ///< hit pattern in TOF up-down
87+
bool mHitLeftRight = false; ///< hit pattern in TOF left-right
7988

80-
ClassDefNV(MatchInfoTOF, 6);
89+
ClassDefNV(MatchInfoTOF, 7);
8190
};
8291
} // namespace dataformats
8392
} // namespace o2

Detectors/GlobalTracking/src/MatchTOF.cxx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1556,7 +1556,7 @@ void MatchTOF::BestMatches(std::vector<o2::dataformats::MatchInfoTOFReco>& match
15561556
int i = 0;
15571557

15581558
// then we take discard the pairs if their track or cluster was already matched (since they are ordered in chi2, we will take the best matching)
1559-
for (const o2::dataformats::MatchInfoTOFReco& matchingPair : matchedTracksPairs) {
1559+
for (o2::dataformats::MatchInfoTOFReco& matchingPair : matchedTracksPairs) {
15601560
int trkType = (int)matchingPair.getTrackType();
15611561

15621562
int itrk = matchingPair.getIdLocal();
@@ -1610,6 +1610,24 @@ void MatchTOF::BestMatches(std::vector<o2::dataformats::MatchInfoTOFReco>& match
16101610
matchedTracksIndex[trkType][itrk] = matchedTracks[trkTypeSplitted].size(); // index of the MatchInfoTOF correspoding to this track
16111611
matchedClustersIndex[matchingPair.getTOFClIndex()] = matchedTracksIndex[trkType][itrk]; // index of the track that was matched to this cluster
16121612

1613+
// let's check if cluster has multiple-hits (noferini)
1614+
if (TOFClusWork[matchingPair.getTOFClIndex()].getNumOfContributingChannels() > 1) {
1615+
const auto& tofcl = TOFClusWork[matchingPair.getTOFClIndex()];
1616+
// has an additional hit Up or Down (Z-dir)
1617+
matchingPair.setHitPatternUpDown(tofcl.isAdditionalChannelSet(o2::tof::Cluster::kUp) ||
1618+
tofcl.isAdditionalChannelSet(o2::tof::Cluster::kUpLeft) ||
1619+
tofcl.isAdditionalChannelSet(o2::tof::Cluster::kUpRight) ||
1620+
tofcl.isAdditionalChannelSet(o2::tof::Cluster::kDown) ||
1621+
tofcl.isAdditionalChannelSet(o2::tof::Cluster::kDownLeft) ||
1622+
tofcl.isAdditionalChannelSet(o2::tof::Cluster::kDownRight));
1623+
// has an additional hit Left or Right (X-dir)
1624+
matchingPair.setHitPatternLeftRight(tofcl.isAdditionalChannelSet(o2::tof::Cluster::kLeft) ||
1625+
tofcl.isAdditionalChannelSet(o2::tof::Cluster::kDownLeft) ||
1626+
tofcl.isAdditionalChannelSet(o2::tof::Cluster::kUpLeft) ||
1627+
tofcl.isAdditionalChannelSet(o2::tof::Cluster::kRight) ||
1628+
tofcl.isAdditionalChannelSet(o2::tof::Cluster::kDownRight) ||
1629+
tofcl.isAdditionalChannelSet(o2::tof::Cluster::kUpRight));
1630+
}
16131631
matchedTracks[trkTypeSplitted].push_back(matchingPair); // array of MatchInfoTOF
16141632

16151633
// get fit info

Detectors/GlobalTrackingWorkflow/src/ReaderDriverSpec.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void ReadeDriverSpec::run(ProcessingContext& pc)
7575
LOGP(debug, "OUTVEC {}/{}", v.back().getMin().asString(), v.back().getMax().asString());
7676
}
7777
count++;
78-
if ((HBFINI::LastIRFrameIndex == -1 && count == mNTF) || (v.size() && v.back().isLast())) {
78+
if ((HBFINI::LastIRFrameIndex == -1 && count >= mNTF) || (v.size() && v.back().isLast())) {
7979
pc.services().get<ControlService>().endOfStream();
8080
pc.services().get<ControlService>().readyToQuit(QuitRequest::Me);
8181
}

Detectors/Raw/src/HBFUtilsInitializer.cxx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,15 @@ HBFUtilsInitializer::HBFUtilsInitializer(const o2f::ConfigContext& configcontext
5858
bool helpasked = configcontext.helpOnCommandLine(); // if help is asked, don't take for granted that the ini file is there, don't produce an error if it is not!
5959
auto conf = configcontext.options().isSet(HBFConfOpt) ? configcontext.options().get<std::string>(HBFConfOpt) : "";
6060
if (!conf.empty()) {
61+
int nopts = 0;
6162
auto vopts = o2::utils::Str::tokenize(conf, ',');
6263
for (const auto& optStr : vopts) {
6364
if (optStr == UpstreamOpt) {
6465
upstream = true;
6566
continue;
6667
}
6768
HBFOpt opt = getOptType(optStr);
69+
nopts++;
6870
if ((opt == HBFOpt::INI || opt == HBFOpt::JSON) && !helpasked) {
6971
o2::conf::ConfigurableParam::updateFromFile(optStr, "HBFUtils", true); // update only those values which were not touched yet (provenance == kCODE)
7072
const auto& hbfu = o2::raw::HBFUtils::Instance();
@@ -76,8 +78,13 @@ HBFUtilsInitializer::HBFUtilsInitializer(const o2f::ConfigContext& configcontext
7678
hbfuInput = optStr;
7779
} else if (opt == HBFOpt::ROOT) {
7880
rootFileInput = optStr;
81+
} else {
82+
LOGP(fatal, "uknown hbfutils-config option {}", optStr);
7983
}
8084
}
85+
if (!nopts && !helpasked) {
86+
LOGP(fatal, "No source was provided for timing input of --hbfutils-config");
87+
}
8188
}
8289
done = true;
8390
/* RSS

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
};

0 commit comments

Comments
 (0)