Skip to content

Commit 8911e66

Browse files
authored
Merge branch 'AliceO2Group:dev' into new-detector4
2 parents e2b6b28 + 28d9c76 commit 8911e66

File tree

65 files changed

+3860
-546
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+3860
-546
lines changed

Common/SimConfig/include/SimConfig/SimConfig.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ enum class SimFieldMode {
3737
enum class VertexMode {
3838
kNoVertex = 0, // no vertexing should be applied in the generator
3939
kDiamondParam = 1, // Diamond param will influence vertexing
40-
kCCDB = 2 // vertex should be taken from CCDB (Calib/MeanVertex object)
40+
kCCDB = 2, // vertex should be taken from CCDB (Calib/MeanVertex object)
41+
kCollCxt = 3 // vertex should be taken from collision context
4142
};
4243

4344
enum class TimeStampMode {

Common/SimConfig/src/SimConfig.cxx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,11 @@ bool SimConfig::parseVertexModeString(std::string const& vertexstring, VertexMod
394394
} else if (vertexstring == "kCCDB") {
395395
mode = VertexMode::kCCDB;
396396
return true;
397+
} else if (vertexstring == "kCollContext") {
398+
mode = VertexMode::kCollCxt;
399+
return true;
397400
}
398-
LOG(error) << "Vertex mode must be one of kNoVertex, kDiamondParam, kCCDB";
401+
LOG(error) << "Vertex mode must be one of kNoVertex, kDiamondParam, kCCDB, kCollContext";
399402
return false;
400403
}
401404

DataFormats/Detectors/TPC/include/DataFormatsTPC/CalibdEdxCorrection.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ class CalibdEdxCorrection
9191

9292
void clear();
9393

94-
void writeToFile(std::string_view fileName, std::string_view objName = "CalibdEdxCorrection") const;
95-
void loadFromFile(std::string_view fileName, std::string_view objName = "CalibdEdxCorrection");
94+
void writeToFile(std::string_view fileName, std::string_view objName = "ccdb_object") const;
95+
void loadFromFile(std::string_view fileName, std::string_view objName = "ccdb_object");
9696

9797
/// \param outFileName name of the output file
9898
void dumpToTree(const char* outFileName = "calib_dedx.root") const;

DataFormats/Detectors/TPC/src/CalibdEdxCorrection.cxx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <string_view>
1616

1717
// o2 includes
18+
#include "Framework/Logger.h"
1819
#include "DataFormatsTPC/Defs.h"
1920
#include "CommonUtils/TreeStreamRedirector.h"
2021

@@ -39,15 +40,27 @@ void CalibdEdxCorrection::clear()
3940
void CalibdEdxCorrection::writeToFile(std::string_view fileName, std::string_view objName) const
4041
{
4142
std::unique_ptr<TFile> file(TFile::Open(fileName.data(), "recreate"));
43+
if (!file) {
44+
LOGP(error, "Failed to open file {} for writing", fileName.data());
45+
return;
46+
}
47+
4248
file->WriteObject(this, objName.data());
4349
}
4450

4551
void CalibdEdxCorrection::loadFromFile(std::string_view fileName, std::string_view objName)
4652
{
4753
std::unique_ptr<TFile> file(TFile::Open(fileName.data()));
54+
if (!file || file->IsZombie()) {
55+
LOGP(error, "Failed to open file {}", fileName.data());
56+
return;
57+
}
58+
4859
auto tmp = file->Get<CalibdEdxCorrection>(objName.data());
4960
if (tmp != nullptr) {
5061
*this = *tmp;
62+
} else {
63+
LOGP(error, "Failed to load object with name {} from file {}", objName.data(), fileName.data());
5164
}
5265
}
5366

Detectors/GLOQC/src/MatchITSTPCQC.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,11 +386,11 @@ bool MatchITSTPCQC::init()
386386
mPhiPhysPrimDen[i]->Sumw2();
387387
mFractionITSTPCmatchPhysPrim[i] = new TEfficiency(Form("mFractionITSTPCmatchPhysPrim_%s", title[i].c_str()), Form("Fraction of ITSTPC matched tracks vs Pt (physical primary), wrt %s tracks %s; Pt [GeV/c]; Eff", title[i].c_str(), etaSel[i].c_str()), nbinsPt, xbinsPt);
388388

389-
m1OverPtPhysPrimNum[i] = new TH1D(Form("m1OverPtPhysPrimNum_%s", title[i].c_str()), Form("1/Pt distribution of matched tracks (physical primary), wrt %s tracks %s; 1/Pt [c/GeV]; dNd1/Pt", title[i].c_str(), etaSel[i].c_str()), 2 * mPtBins, -1. / mPtCut, 1. / mPtCut);
389+
m1OverPtPhysPrimNum[i] = new TH1D(Form("m1OverPtPhysPrimNum_%s", title[i].c_str()), Form("1/Pt distribution of matched tracks (physical primary), wrt %s tracks %s; 1/Pt [c/GeV]; dNd1/Pt", title[i].c_str(), etaSel[i].c_str()), 2 * mPtBins, -20., 20.);
390390
m1OverPtPhysPrimNum[i]->Sumw2();
391-
m1OverPtPhysPrimDen[i] = new TH1D(Form("m1OverPtPhysPrimDen_%s", title[i].c_str()), Form("1/PtPt distribution of %s tracks (physical primary) %s; 1/Pt [c/GeV]; dNd1/Pt", title[i].c_str(), etaSel[i].c_str()), 2 * mPtBins, -1. / mPtCut, 1. / mPtCut);
391+
m1OverPtPhysPrimDen[i] = new TH1D(Form("m1OverPtPhysPrimDen_%s", title[i].c_str()), Form("1/PtPt distribution of %s tracks (physical primary) %s; 1/Pt [c/GeV]; dNd1/Pt", title[i].c_str(), etaSel[i].c_str()), 2 * mPtBins, -20., 20.);
392392
m1OverPtPhysPrimDen[i]->Sumw2();
393-
mFractionITSTPCmatchPhysPrim1OverPt[i] = new TEfficiency(Form("mFractionITSTPCmatchPhysPrim1OverPt_%s", title[i].c_str()), Form("Fraction of ITSTPC matched tracks vs 1/Pt (physical primary), wrt %s tracks %s; 1/Pt [c/GeV]; Eff", title[i].c_str(), etaSel[i].c_str()), 2 * mPtBins, -1. / mPtCut, 1. / mPtCut);
393+
mFractionITSTPCmatchPhysPrim1OverPt[i] = new TEfficiency(Form("mFractionITSTPCmatchPhysPrim1OverPt_%s", title[i].c_str()), Form("Fraction of ITSTPC matched tracks vs 1/Pt (physical primary), wrt %s tracks %s; 1/Pt [c/GeV]; Eff", title[i].c_str(), etaSel[i].c_str()), 2 * mPtBins, -20., 20.);
394394
}
395395
}
396396

Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ class MatchGlobalFwd
339339
o2::itsmft::ChipMappingMFT mMFTMapping;
340340
bool mMCTruthON = false; ///< Flag availability of MC truth
341341
bool mUseMIDMCHMatch = false; ///< Flag for using MCHMID matches (TrackMCHMID)
342+
bool mUseTrackTime = false; ///< Flag for using the MCH or MCHMID track time information to select the MFT ROF(s)
342343
int mSaveMode = 0; ///< Output mode [0 = SaveBestMatch; 1 = SaveAllMatches; 2 = SaveTrainingData; 3 = SaveNCandidates]
343344
int mNCandidates = 5; ///< Numbers of matching candidates to save in savemode=3
344345
MatchingType mMatchingType = MATCHINGUNDEFINED;

Detectors/GlobalTracking/include/GlobalTracking/MatchGlobalFwdParam.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ struct GlobalFwdMatchingParam : public o2::conf::ConfigurableParamHelper<GlobalF
3939
bool MCMatching = false; ///< MFT-MCH matching computed from MCLabels
4040
double matchPlaneZ = -77.5; ///< MFT-MCH matching plane z coordinate
4141
bool useMIDMatch = false; ///< Use input from MCH-MID matching
42+
bool useTrackTime = false; ///< Use the MCH or MCHMID track time information to select the MFT ROF(s)
4243
Int_t saveMode = kBestMatch; ///< Global Forward Tracks save mode
4344
float MFTRadLength = 0.042; ///< MFT thickness in radiation length
4445
float alignResidual = 1.; ///< Alignment residual for cluster position uncertainty

Detectors/GlobalTracking/src/MatchGlobalFwd.cxx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ void MatchGlobalFwd::init()
6565
mUseMIDMCHMatch = matchingParam.useMIDMatch;
6666
LOG(info) << "UseMIDMCH Matching = " << (mUseMIDMCHMatch ? "true" : "false");
6767

68+
mUseTrackTime = matchingParam.useTrackTime;
69+
LOG(info) << "Use track time = " << (mUseTrackTime ? "true" : "false");
70+
6871
mSaveMode = matchingParam.saveMode;
6972
LOG(info) << "Save mode MFTMCH candidates = " << mSaveMode;
7073

@@ -216,8 +219,8 @@ bool MatchGlobalFwd::processMCHMIDMatches()
216219
LOG(debug) << " MCHId: " << MCHId << " --> mMCHID2Work[MCHId]:" << mMCHID2Work[MCHId];
217220
const auto& IR = MIDMatch.getIR();
218221
int nBC = IR.differenceInBC(mStartIR);
219-
float tMin = nBC * o2::constants::lhc::LHCBunchSpacingMUS;
220-
float tMax = (nBC + 1) * o2::constants::lhc::LHCBunchSpacingMUS;
222+
float tMin = (nBC - 1) * o2::constants::lhc::LHCBunchSpacingMUS;
223+
float tMax = (nBC + 2) * o2::constants::lhc::LHCBunchSpacingMUS;
221224
thisMuonTrack.setMIDTrackID(MIDId);
222225
thisMuonTrack.setTimeMUS(MIDMatch.getTimeMUS(mStartIR).first);
223226
thisMuonTrack.tBracket.set(tMin, tMax);
@@ -435,6 +438,7 @@ void MatchGlobalFwd::ROFMatch(int MFTROFId, int firstMCHROFId, int lastMCHROFId)
435438
{
436439
/// Matches MFT tracks on a given ROF with MCH tracks in a range of ROFs
437440
const auto& thisMFTROF = mMFTTrackROFRec[MFTROFId];
441+
const auto& thisMFTBracket = mMFTROFTimes[MFTROFId];
438442
const auto& firstMCHROF = mMCHTrackROFRec[firstMCHROFId];
439443
const auto& lastMCHROF = mMCHTrackROFRec[lastMCHROFId];
440444
int nFakes = 0, nTrue = 0;
@@ -464,6 +468,12 @@ void MatchGlobalFwd::ROFMatch(int MFTROFId, int firstMCHROFId, int lastMCHROFId)
464468
// loop over all MCH tracks
465469
for (auto MCHId = firstMCHTrackID; MCHId <= lastMCHTrackID; MCHId++) {
466470
auto& thisMCHTrack = mMCHWork[MCHId];
471+
472+
// If enabled, use the muon track time to check if the track is correlated with the MFT ROF
473+
if (mUseTrackTime && (thisMFTBracket.isOutside(thisMCHTrack.tBracket))) {
474+
continue;
475+
}
476+
467477
o2::MCCompLabel matchLabel;
468478
for (auto MFTId = firstMFTTrackID; MFTId <= lastMFTTrackID; MFTId++) {
469479
auto& thisMFTTrack = mMFTWork[MFTId];

Detectors/GlobalTrackingWorkflow/study/src/SVStudy.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ void SVStudySpec::updateTimeDependentParams(ProcessingContext& pc)
194194
// for occupancy estimator
195195
mParam = o2::gpu::GPUO2InterfaceUtils::getFullParamShared(0.f, mNHBPerTF);
196196
}
197+
auto& elParam = o2::tpc::ParameterElectronics::Instance();
198+
mTPCTBinMUSInv = 1. / elParam.ZbinWidth; // 1./TPC bin in microseconds
197199
}
198200
mBz = o2::base::Propagator::Instance()->getNominalBz();
199201
mFitterV0.setBz(mBz);
@@ -353,8 +355,8 @@ void SVStudySpec::process(o2::globaltracking::RecoContainer& recoData)
353355
<< "pv=" << pv
354356
<< "\n";
355357
}
356-
tfID++;
357358
}
359+
tfID++;
358360
}
359361

360362
bool SVStudySpec::refitV0(const V0ID& id, o2::dataformats::V0& v0, o2::globaltracking::RecoContainer& recoData)

Detectors/MUON/MCH/Status/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ o2_add_executable(
4747
O2::DataFormatsMCH
4848
O2::Framework
4949
O2::MCHGlobalMapping
50+
O2::MCHMappingImpl4
5051
O2::MCHStatus
5152
)
5253

0 commit comments

Comments
 (0)