Skip to content

Commit ed1d3a6

Browse files
authored
Merge branch 'master' into myDevs
2 parents 7734590 + f99aa41 commit ed1d3a6

Some content is hidden

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

43 files changed

+2924
-1824
lines changed

Common/Core/EventPlaneHelper.cxx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,10 @@ float EventPlaneHelper::GetEventPlane(const float qx, const float qy, int nmode)
204204
return (1. / nmode) * (TMath::ATan2(qy, qx));
205205
}
206206

207-
float EventPlaneHelper::GetResolution(const float RefA, const float RefB, const float sig, int nmode)
207+
float EventPlaneHelper::GetResolution(const float RefA, const float RefB, int nmode)
208208
{
209-
if (std::abs(std::cos((RefA - RefB) * nmode)) > 1e-8) {
210-
return std::sqrt(std::cos((sig - RefA) * nmode) * std::cos((sig - RefB) * nmode) / std::cos((RefA - RefB) * nmode));
211-
} else {
212-
return -1;
209+
if (std::cos((RefA - RefB) * nmode) > 0) {
210+
return std::sqrt(std::cos((RefA - RefB) * nmode));
213211
}
212+
return -999.;
214213
}

Common/Core/EventPlaneHelper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class EventPlaneHelper
9393
float GetEventPlane(const float qx, const float qy, int nmode = 2);
9494

9595
// Method to calculate the resolution R2 for the provided profile.
96-
float GetResolution(const float RefA, const float RefB, const float sig, int nmode = 2);
96+
float GetResolution(const float RefA, const float RefB, int nmode = 2);
9797

9898
private:
9999
double mOffsetFT0AX = 0.; // X-coordinate of the offset of FT0-A.

Common/TableProducer/fwdtrackextension.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ struct FwdTrackExtension {
4343
float dcaX = -999;
4444
float dcaY = -999;
4545
if (track.has_collision()) {
46-
if (track.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack || track.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalForwardTrack) {
46+
if (track.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack || track.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalForwardTrack || track.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack) {
4747

4848
auto const& collision = track.collision();
4949
double chi2 = track.chi2();

Common/Tasks/qVectorsCorrection.cxx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ struct qVectorsCorrection {
148148
histosQA.add("Centrality_0-5/histEvtPlRefBTwist", "", {HistType::kTH1F, {axisEvtPl}});
149149
histosQA.add("Centrality_0-5/histEvtPlRefBFinal", "", {HistType::kTH1F, {axisEvtPl}});
150150

151-
histosQA.add("Centrality_0-5/histEvtPlResolution", "", {HistType::kTH1F, {axisEvtPl}});
151+
histosQA.add("Centrality_0-5/histEvtPlRes_SigRefA", "", {HistType::kTH1F, {axisEvtPl}});
152+
histosQA.add("Centrality_0-5/histEvtPlRes_SigRefB", "", {HistType::kTH1F, {axisEvtPl}});
153+
histosQA.add("Centrality_0-5/histEvtPlRes_RefARefB", "", {HistType::kTH1F, {axisEvtPl}});
152154

153155
for (int iBin = 1; iBin < 8; iBin++) {
154156
histosQA.addClone("Centrality_0-5/", qV::centClasses[iBin].data());
@@ -199,10 +201,9 @@ struct qVectorsCorrection {
199201
}
200202

201203
if (vec.qvecAmp()[DetId] > 1e-8 && vec.qvecAmp()[RefAId] > 1e-8 && vec.qvecAmp()[RefBId] > 1e-8) {
202-
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlResolution"), helperEP.GetResolution(
203-
helperEP.GetEventPlane(vec.qvecRe()[RefAId * 4 + 3], vec.qvecIm()[RefAId * 4 + 3], cfgnMod),
204-
helperEP.GetEventPlane(vec.qvecRe()[RefBId * 4 + 3], vec.qvecIm()[RefBId * 4 + 3], cfgnMod),
205-
helperEP.GetEventPlane(vec.qvecRe()[DetId * 4 + 3], vec.qvecIm()[DetId * 4 + 3], cfgnMod), cfgnMod));
204+
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRes_SigRefA"), helperEP.GetResolution(helperEP.GetEventPlane(vec.qvecRe()[DetId * 4 + 3], vec.qvecIm()[DetId * 4 + 3], cfgnMod), helperEP.GetEventPlane(vec.qvecRe()[RefAId * 4 + 3], vec.qvecIm()[RefAId * 4 + 3], cfgnMod), cfgnMod));
205+
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRes_SigRefB"), helperEP.GetEventPlane(helperEP.GetEventPlane(vec.qvecRe()[DetId * 4 + 3], vec.qvecIm()[DetId * 4 + 3], cfgnMod), helperEP.GetEventPlane(vec.qvecRe()[RefBId * 4 + 3], vec.qvecIm()[RefBId * 4 + 3], cfgnMod), cfgnMod));
206+
histosQA.fill(HIST(qV::centClasses[cBin]) + HIST("histEvtPlRes_RefARefB"), helperEP.GetEventPlane(helperEP.GetEventPlane(vec.qvecRe()[RefAId * 4 + 3], vec.qvecIm()[RefAId * 4 + 3], cfgnMod), helperEP.GetEventPlane(vec.qvecRe()[RefBId * 4 + 3], vec.qvecIm()[RefBId * 4 + 3], cfgnMod), cfgnMod));
206207
}
207208
}
208209

DPG/Tasks/AOTEvent/eventSelectionQa.cxx

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ struct EventSelectionQaTask {
3838
Configurable<int> nOrbitsConf{"nOrbits", 10000, "number of orbits"};
3939
Configurable<int> refBC{"refBC", 1238, "reference bc"};
4040
Configurable<bool> isLowFlux{"isLowFlux", 1, "1 - low flux (pp, pPb), 0 - high flux (PbPb)"};
41+
Configurable<bool> flagMonitorBcInTF{"flagMonitorBcInTF", 1, "0 - no, 1 - yes"};
4142

4243
uint64_t minGlobalBC = 0;
4344
Service<o2::ccdb::BasicCCDBManager> ccdb;
@@ -47,6 +48,8 @@ struct EventSelectionQaTask {
4748
int lastRunNumber = -1;
4849
int nOrbits = nOrbitsConf;
4950
double minOrbit = minOrbitConf;
51+
int64_t bcSOR = -1; // global bc of the start of the first orbit
52+
int64_t nBCsPerTF = -1; // duration of TF in bcs, should be 128*3564 or 32*3564
5053
std::bitset<o2::constants::lhc::LHCMaxBunches> beamPatternA;
5154
std::bitset<o2::constants::lhc::LHCMaxBunches> beamPatternC;
5255
std::bitset<o2::constants::lhc::LHCMaxBunches> bcPatternA;
@@ -260,6 +263,12 @@ struct EventSelectionQaTask {
260263
histos.add("hMultT0MVsNcontribAcc", "", kTH2F, {axisMultT0M, axisNcontrib}); // before ITS RO Frame border cut
261264
histos.add("hMultT0MVsNcontribCut", "", kTH2F, {axisMultT0M, axisNcontrib}); // after ITS RO Frame border cut
262265

266+
if (flagMonitorBcInTF) {
267+
AxisSpec axisBCinTF{128 * nBCsPerOrbit + 1 + 10, -0.5, 128 * nBCsPerOrbit + 0.5 + 10, "bc in TF"};
268+
histos.add("hNcontribVsBcInTF", ";bc in TF; n vertex contributors", kTH1F, {axisBCinTF});
269+
histos.add("hNcontribAfterCutsVsBcInTF", ";bc in TF; n vertex contributors", kTH1F, {axisBCinTF});
270+
}
271+
263272
// MC histograms
264273
histos.add("hGlobalBcColMC", "", kTH1F, {axisGlobalBCs});
265274
histos.add("hBcColMC", "", kTH1F, {axisBCs});
@@ -494,6 +503,7 @@ struct EventSelectionQaTask {
494503
aod::FDDs const& fdds)
495504
{
496505
int runNumber = bcs.iteratorAt(0).runNumber();
506+
uint32_t nOrbitsPerTF = 128; // 128 in 2022, 32 in 2023
497507
if (runNumber != lastRunNumber) {
498508
lastRunNumber = runNumber; // do it only once
499509
int64_t tsSOR = 0;
@@ -528,39 +538,44 @@ struct EventSelectionQaTask {
528538
LOGP(info, "tsOrbitReset={} us", tsOrbitReset);
529539

530540
// access TF duration, start-of-run and end-of-run timestamps from ECS GRP
531-
// std::map<std::string, std::string> metadata;
532-
// metadata["runNumber"] = Form("%d", runNumber);
533-
// auto grpecs = ccdb->getSpecific<o2::parameters::GRPECSObject>("GLO/Config/GRPECS", ts, metadata);
534-
// uint32_t nOrbitsPerTF = grpecs->getNHBFPerTF(); // assuming 1 orbit = 1 HBF
535-
// tsSOR = grpecs->getTimeStart(); // ms
536-
// tsEOR = grpecs->getTimeEnd(); // ms
541+
std::map<std::string, std::string> metadata;
542+
metadata["runNumber"] = Form("%d", runNumber);
543+
auto grpecs = ccdb->getSpecific<o2::parameters::GRPECSObject>("GLO/Config/GRPECS", ts, metadata);
544+
nOrbitsPerTF = grpecs->getNHBFPerTF(); // assuming 1 orbit = 1 HBF
545+
tsSOR = grpecs->getTimeStart(); // ms
546+
tsEOR = grpecs->getTimeEnd(); // ms
537547

538548
// Temporary workaround for 22q (due to ZDC bc shifts)
539-
o2::ccdb::CcdbApi ccdb_api;
540-
ccdb_api.init("http://alice-ccdb.cern.ch");
541-
std::map<string, string> metadataRCT, headers;
542-
headers = ccdb_api.retrieveHeaders(Form("RCT/Info/RunInformation/%i", runNumber), metadataRCT, -1);
543-
tsSOR = atol(headers["SOR"].c_str());
544-
tsEOR = atol(headers["EOR"].c_str());
545-
uint32_t nOrbitsPerTF = 128;
549+
// o2::ccdb::CcdbApi ccdb_api;
550+
// ccdb_api.init("http://alice-ccdb.cern.ch");
551+
// std::map<string, string> metadataRCT, headers;
552+
// headers = ccdb_api.retrieveHeaders(Form("RCT/Info/RunInformation/%i", runNumber), metadataRCT, -1);
553+
// tsSOR = atol(headers["SOR"].c_str());
554+
// tsEOR = atol(headers["EOR"].c_str());
555+
// uint32_t nOrbitsPerTF = 128;
546556
LOGP(info, "nOrbitsPerTF={} tsSOR={} ms tsEOR={} ms", nOrbitsPerTF, tsSOR, tsEOR);
547557

548558
// calculate SOR and EOR orbits
549559
int64_t orbitSOR = (tsSOR * 1000 - tsOrbitReset) / o2::constants::lhc::LHCOrbitMUS;
550560
int64_t orbitEOR = (tsEOR * 1000 - tsOrbitReset) / o2::constants::lhc::LHCOrbitMUS;
551561

552562
// adjust to the nearest TF edge
553-
orbitSOR = orbitSOR / nOrbitsPerTF * nOrbitsPerTF - 1;
554-
orbitEOR = orbitEOR / nOrbitsPerTF * nOrbitsPerTF - 1;
563+
orbitSOR = orbitSOR / nOrbitsPerTF * nOrbitsPerTF; // was with - 1;
564+
orbitEOR = orbitEOR / nOrbitsPerTF * nOrbitsPerTF; // was with - 1;
555565

556566
// set nOrbits and minOrbit used for orbit-axis binning
557567
nOrbits = orbitEOR - orbitSOR;
558568
minOrbit = orbitSOR;
569+
570+
// first bc of the first orbit (should coincide with TF start)
571+
bcSOR = orbitSOR * nBCsPerOrbit;
572+
// duration of TF in bcs
573+
nBCsPerTF = nOrbitsPerTF * nBCsPerOrbit;
559574
}
560575

561576
// create orbit-axis histograms on the fly with binning based on info from GRP if GRP is available
562577
// otherwise default minOrbit and nOrbits will be used
563-
const AxisSpec axisOrbits{nOrbits / 128, 0., static_cast<double>(nOrbits), ""};
578+
const AxisSpec axisOrbits{nOrbits / static_cast<int>(nOrbitsPerTF) /*128*/, 0., static_cast<double>(nOrbits), ""};
564579
histos.add("hOrbitAll", "", kTH1F, {axisOrbits});
565580
histos.add("hOrbitCol", "", kTH1F, {axisOrbits});
566581
histos.add("hOrbitAcc", "", kTH1F, {axisOrbits});
@@ -946,11 +961,17 @@ struct EventSelectionQaTask {
946961
}
947962
}
948963

964+
int nContributorsAfterEtaTPCCuts = 0;
965+
949966
// fill track time histograms
950967
for (auto& track : tracksGrouped) {
951968
if (!track.isPVContributor()) {
952969
continue;
953970
}
971+
972+
if (fabs(track.eta()) < 0.8 && track.tpcNClsFound() > 80 && track.tpcNClsCrossedRows() > 100)
973+
nContributorsAfterEtaTPCCuts++;
974+
954975
if (track.hasTOF())
955976
continue;
956977
if (track.hasTRD())
@@ -971,6 +992,13 @@ struct EventSelectionQaTask {
971992

972993
histos.fill(HIST("hNcontribCol"), nContributors);
973994

995+
// monitor nContributors vs bc in timeframe:
996+
if (flagMonitorBcInTF) {
997+
int64_t bcInTF = (globalBC - bcSOR) % nBCsPerTF;
998+
histos.fill(HIST("hNcontribVsBcInTF"), bcInTF, nContributors);
999+
histos.fill(HIST("hNcontribAfterCutsVsBcInTF"), bcInTF, nContributorsAfterEtaTPCCuts);
1000+
}
1001+
9741002
const auto& foundBC = col.foundBC_as<BCsRun3>();
9751003

9761004
float timeZNA = foundBC.has_zdc() ? foundBC.zdc().timeZNA() : -999.f;

0 commit comments

Comments
 (0)