Skip to content

Commit 290fdc6

Browse files
committed
from master
Merge branch 'master' of https://github.com/AliceO2Group/O2Physics
2 parents 8b48079 + 9515bbb commit 290fdc6

39 files changed

Lines changed: 1687 additions & 909 deletions

CODEOWNERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
/EventFiltering/PWGCF @alibuild @lauraser
2626
/EventFiltering/PWGMM @alibuild @aortizve
2727
/EventFiltering/PWGJE @alibuild @fkrizek
28-
/PWGCF @alibuild @jgrosseo @saganatt @victor-gonzalez
29-
/PWGDQ @alibuild @iarsene @dsekihat
30-
/PWGEM @alibuild @mikesas @rbailhac
28+
/PWGCF @alibuild @jgrosseo @saganatt @victor-gonzalez @zchochul
29+
/PWGDQ @alibuild @iarsene @dsekihat @feisenhu
30+
/PWGEM @alibuild @mikesas @rbailhac @feisenhu
3131
/PWGEM/Dilepton @alibuild @mikesas @rbailhac @dsekihat @ivorobye
3232
/PWGEM/PhotonMeson @alibuild @mikesas @rbailhac @m-c-danisch @novitzky
3333
/PWGHF @alibuild @ginnocen @vkucera @fcolamar @cterrevo

Common/CCDB/macros/upload_event_selection_params.C

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -255,28 +255,28 @@ void upload_event_selection_params()
255255
ccdb.storeAsTFileAny(par[i], "EventSelection/EventSelectionParams", metadata, sor, eor);
256256
}
257257

258-
if (0) { // Default Run 3 object
258+
if (1) { // Default Run 3 object
259259
ULong64_t sorRun3 = 1543767116001;
260260
ULong64_t eorRun3 = 1893445200000;
261261
metadata["period"] = "Default Run 3";
262262
n++;
263263
par[n] = new EventSelectionParams();
264-
par[n]->fV0ABBlower = -4.0; // ns
265-
par[n]->fV0ABBupper = +4.0; // ns
266-
par[n]->fV0ABGlower = 32.7; // ns
267-
par[n]->fV0ABGupper = 32.8; // ns
268-
par[n]->fFDABBlower = -4.0; // ns
269-
par[n]->fFDABBupper = +4.0; // ns
270-
par[n]->fFDABGlower = 32.7; // ns
271-
par[n]->fFDABGupper = 32.8; // ns
272-
par[n]->fFDCBBlower = -4.0; // ns
273-
par[n]->fFDCBBupper = +4.0; // ns
274-
par[n]->fFDCBGlower = 32.7; // ns
275-
par[n]->fFDCBGupper = 32.8; // ns
276-
par[n]->fT0ABBlower = -1.0; // ns
277-
par[n]->fT0ABBupper = +1.0; // ns
278-
par[n]->fT0CBBlower = -1.0; // ns
279-
par[n]->fT0CBBupper = +1.0; // ns
264+
par[n]->fV0ABBlower = -3.0; // ns
265+
par[n]->fV0ABBupper = +2.0; // ns
266+
par[n]->fV0ABGlower = 2.0; // ns
267+
par[n]->fV0ABGupper = 5.0; // ns
268+
par[n]->fFDABBlower = -3.0; // ns
269+
par[n]->fFDABBupper = +3.0; // ns
270+
par[n]->fFDABGlower = 10.0; // ns
271+
par[n]->fFDABGupper = 13.0; // ns
272+
par[n]->fFDCBBlower = -3.0; // ns
273+
par[n]->fFDCBBupper = +3.0; // ns
274+
par[n]->fFDCBGlower = -10.0; // ns
275+
par[n]->fFDCBGupper = -3.0; // ns
276+
par[n]->fT0ABBlower = -1.0; // ns
277+
par[n]->fT0ABBupper = +1.0; // ns
278+
par[n]->fT0CBBlower = -1.0; // ns
279+
par[n]->fT0CBBupper = +1.0; // ns
280280

281281
ccdb.storeAsTFileAny(par[n], "EventSelection/EventSelectionParams", metadata, sorRun3, eorRun3);
282282
}

Common/Core/TrackSelection.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ class TrackSelection
4646
kNCuts
4747
};
4848

49+
enum GlobalTrackRun3ITSMatching {
50+
Run3ITSibAny,
51+
Run3ITSallAny,
52+
Run3ITSall7Layers
53+
};
54+
4955
static const std::string mCutNames[static_cast<int>(TrackCuts::kNCuts)];
5056

5157
// Temporary function to check if track passes selection criteria. To be replaced by framework filters.

Common/Core/TrackSelectionDefaults.h

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#define TrackSelectionDefaults_H
2020

2121
#include "Framework/DataTypes.h"
22+
#include "Common/Core/TrackSelection.h"
2223

2324
// Default track selection requiring one hit in the SPD
2425
TrackSelection getGlobalTrackSelection()
@@ -40,6 +41,43 @@ TrackSelection getGlobalTrackSelection()
4041
return selectedTracks;
4142
}
4243

44+
// Default track selection requiring a particular Run 3 ITS matching
45+
TrackSelection getGlobalTrackSelectionITSMatch(int matching)
46+
{
47+
std::pair<int8_t, std::set<unsigned char>> itsMatching;
48+
switch (matching) {
49+
case TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSibAny:
50+
itsMatching = std::make_pair((int8_t)1, (std::set<unsigned char>){0, 1, 2});
51+
break;
52+
case TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSallAny:
53+
itsMatching = std::make_pair((int8_t)1, (std::set<unsigned char>){0, 1, 2, 3, 4, 5, 6});
54+
break;
55+
case TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSall7Layers:
56+
itsMatching = std::make_pair((int8_t)7, (std::set<unsigned char>){0, 1, 2, 3, 4, 5, 6});
57+
break;
58+
59+
default:
60+
LOG(fatal) << "getGlobalTrackSelectionITSMatch with undefined ITS matching";
61+
break;
62+
}
63+
64+
TrackSelection selectedTracks;
65+
selectedTracks.SetTrackType(o2::aod::track::Run2Track);
66+
selectedTracks.SetPtRange(0.1f, 1e10f);
67+
selectedTracks.SetEtaRange(-0.8f, 0.8f);
68+
selectedTracks.SetRequireITSRefit(true);
69+
selectedTracks.SetRequireTPCRefit(true);
70+
selectedTracks.SetRequireGoldenChi2(true);
71+
selectedTracks.SetMinNCrossedRowsTPC(70);
72+
selectedTracks.SetMinNCrossedRowsOverFindableClustersTPC(0.8f);
73+
selectedTracks.SetMaxChi2PerClusterTPC(4.f);
74+
selectedTracks.SetRequireHitsInITSLayers(itsMatching.first, itsMatching.second);
75+
selectedTracks.SetMaxChi2PerClusterITS(36.f);
76+
selectedTracks.SetMaxDcaXYPtDep([](float pt) { return 0.0105f + 0.0350f / pow(pt, 1.1f); });
77+
selectedTracks.SetMaxDcaZ(2.f);
78+
return selectedTracks;
79+
}
80+
4381
// Default track selection requiring no hit in the SPD and one in the innermost
4482
// SDD -> complementary tracks to global selection
4583
TrackSelection getGlobalTrackSelectionSDD()

Common/Core/aodMerger.cxx

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ int main(int argc, char* argv[])
9898
printf("AO2D merging tool. Options: \n");
9999
printf(" --input <inputfile.txt> Contains path to files to be merged. Default: %s\n", inputCollection.c_str());
100100
printf(" --output <outputfile.root> Target output ROOT file. Default: %s\n", outputFileName.c_str());
101-
printf(" --max-size <size in Bytes> Target directory size. Default: %ld\n", maxDirSize);
101+
printf(" --max-size <size in Bytes> Target directory size. Default: %ld. Set to 0 if file is not self-contained.\n", maxDirSize);
102102
printf(" --skip-non-existing-files Flag to allow skipping of non-existing files in the input list.\n");
103103
return -1;
104104
} else {
@@ -127,6 +127,7 @@ int main(int argc, char* argv[])
127127
TString line;
128128
bool connectedToAliEn = false;
129129
TMap* metaData = nullptr;
130+
TMap* parentFiles = nullptr;
130131
int totalMergedDFs = 0;
131132
int mergedDFs = 0;
132133
while (in.good() && exitCode == 0) {
@@ -183,6 +184,17 @@ int main(int argc, char* argv[])
183184
}
184185
}
185186

187+
if (((TObjString*)key1)->GetString().EqualTo("parentFiles")) {
188+
auto parentFilesCurrentFile = (TMap*)inputFile->Get("parentFiles");
189+
if (parentFiles == nullptr) {
190+
parentFiles = new TMap;
191+
}
192+
for (auto pair : *parentFilesCurrentFile) {
193+
parentFiles->Add(((TPair*)pair)->Key(), ((TPair*)pair)->Value());
194+
}
195+
delete parentFilesCurrentFile;
196+
}
197+
186198
if (!((TObjString*)key1)->GetString().BeginsWith("DF_")) {
187199
continue;
188200
}
@@ -371,7 +383,10 @@ int main(int argc, char* argv[])
371383
// check for not found tables
372384
for (auto& offset : offsets) {
373385
if (offset.second < 0) {
374-
printf("ERROR: Index on %s but no tree found\n", offset.first.c_str());
386+
if (maxDirSize > 0) {
387+
// if maxDirSize is 0 then we do not merge DFs and this error is not an error actually (e.g. for not self-contained derived data)
388+
printf("ERROR: Index on %s but no tree found\n", offset.first.c_str());
389+
}
375390
offset.second = 0;
376391
}
377392
}
@@ -393,6 +408,11 @@ int main(int argc, char* argv[])
393408
inputFile->Close();
394409
}
395410

411+
if (parentFiles) {
412+
outputFile->cd();
413+
parentFiles->Write("parentFiles", TObject::kSingleKey);
414+
}
415+
396416
outputFile->Write();
397417
outputFile->Close();
398418

Common/TableProducer/eventSelection.cxx

Lines changed: 66 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -410,42 +410,80 @@ struct EventSelectionTask {
410410
void processRun3(aod::Collision const& col, BCsWithBcSels const& bcs)
411411
{
412412
auto bc = col.bc_as<BCsWithBcSels>();
413-
uint64_t apprBC = bc.globalBC();
414-
int64_t meanBC = apprBC - std::lround(col.collisionTime() / o2::constants::lhc::LHCBunchSpacingNS);
413+
int64_t shift = 0;
414+
415+
// temporary workaround for apass1. Might be included in CCDB in the future
416+
if (bc.runNumber() > 520143) {
417+
shift = col.collisionTimeRes() < 12 ? -2 : -15;
418+
} else if (bc.runNumber() >= 523141) {
419+
shift = col.collisionTimeRes() < 12 ? -2 : 0;
420+
}
421+
422+
int64_t meanBC = bc.globalBC() + shift;
415423
int64_t deltaBC = std::ceil(col.collisionTimeRes() / o2::constants::lhc::LHCBunchSpacingNS * 4);
424+
416425
// use custom delta
417426
if (customDeltaBC > 0) {
418427
deltaBC = customDeltaBC;
419428
}
420429

421-
if (!bc.has_foundFT0()) { // search in +/-4 sigma around meanBC
422-
// search forward
423-
int forwardMoveCount = 0;
424-
int64_t forwardBcDist = deltaBC + 1;
425-
for (; bc != bcs.end() && int64_t(bc.globalBC()) <= meanBC + deltaBC; ++bc, ++forwardMoveCount) {
426-
if (bc.has_foundFT0()) {
427-
forwardBcDist = bc.globalBC() - meanBC;
428-
break;
429-
}
430+
uint64_t minBC = meanBC - deltaBC;
431+
uint64_t maxBC = meanBC + deltaBC;
432+
433+
// temporary workaround for apass1. Might be included in CCDB in the future
434+
if (bc.runNumber() >= 520143 && col.collisionTimeRes() < 12) { // collisions with TOF-matched tracks
435+
minBC = meanBC - 13;
436+
maxBC = meanBC;
437+
} else if (bc.runNumber() >= 523141 && col.collisionTimeRes() < 12) { // collisions with TOF-matched tracks
438+
minBC = meanBC - 2;
439+
maxBC = meanBC + 4;
440+
}
441+
if (bc.runNumber() == 505600) { // pilot run without TOF - using custom delta bc to improve matching
442+
minBC = meanBC - 400;
443+
maxBC = meanBC + 400;
444+
}
445+
446+
int forwardMoveCount = 0, backwardMoveCount = 0;
447+
uint64_t backwardBC = minBC - 1;
448+
uint64_t forwardBC = maxBC + 1;
449+
// search in forward direction starting from the current bc
450+
while (bc != bcs.end() && bc.globalBC() <= maxBC && bc.globalBC() >= minBC) {
451+
if (bc.selection()[kIsBBT0A] || bc.selection()[kIsBBT0C]) {
452+
forwardBC = bc.globalBC();
453+
break;
430454
}
431-
bc.moveByIndex(-forwardMoveCount);
432-
// search backward
433-
int backwardMoveCount = 0;
434-
int64_t backwardBcDist = deltaBC + 1;
435-
for (; int64_t(bc.globalBC()) >= meanBC - deltaBC; --bc, ++backwardMoveCount) {
436-
if (bc.has_foundFT0()) {
437-
backwardBcDist = meanBC - bc.globalBC();
438-
break;
439-
}
440-
if (bc == bcs.begin()) {
441-
break;
442-
}
455+
bc++;
456+
forwardMoveCount++;
457+
}
458+
bc.moveByIndex(-forwardMoveCount);
459+
460+
// search in backward direction
461+
while (bc.globalIndex() > 0 && bc.globalBC() >= minBC) {
462+
bc--;
463+
backwardMoveCount--;
464+
if (bc.globalBC() > maxBC || bc.globalBC() < minBC) {
465+
continue;
466+
}
467+
if (bc.selection()[kIsBBT0A] || bc.selection()[kIsBBT0C]) {
468+
backwardBC = bc.globalBC();
469+
break;
443470
}
444-
if (forwardBcDist > deltaBC && backwardBcDist > deltaBC) {
445-
bc.moveByIndex(backwardMoveCount); // return to nominal bc if neighbouring ft0 is not found
446-
} else if (forwardBcDist < backwardBcDist) {
447-
bc.moveByIndex(backwardMoveCount + forwardMoveCount); // move forward
448-
} // else keep backward bc
471+
}
472+
bc.moveByIndex(-backwardMoveCount);
473+
474+
if (forwardBC <= maxBC && backwardBC >= minBC) {
475+
// if FT0 is found on both sides from meanBC, move to closest one
476+
if (labs(int64_t(forwardBC) - meanBC) < labs(int64_t(backwardBC) - meanBC)) {
477+
bc.moveByIndex(forwardMoveCount);
478+
} else {
479+
bc.moveByIndex(backwardMoveCount);
480+
}
481+
} else if (forwardBC <= maxBC) {
482+
// if FT0 is found only in forward, move forward
483+
bc.moveByIndex(forwardMoveCount);
484+
} else if (backwardBC >= minBC) {
485+
// if FT0 is found only in backward, move backward
486+
bc.moveByIndex(backwardMoveCount);
449487
}
450488

451489
int32_t foundBC = bc.globalIndex();

Common/TableProducer/trackselection.cxx

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ using namespace o2::framework::expressions;
3737
struct TrackSelectionTask {
3838
// FIXME: this will be removed once we can get this via meta data
3939
Configurable<bool> isRun3{"isRun3", false, "temp option to enable run3 mode"};
40+
Configurable<int> itsMatching{"itsMatching", 0, "condition for ITS matching (0: Run2 SPD kAny, 1: Run3ITSibAny, 2: Run3ITSallAny, 3: Run3ITSall7Layers)"};
4041

4142
Produces<aod::TrackSelection> filterTable;
4243

@@ -45,7 +46,34 @@ struct TrackSelectionTask {
4546

4647
void init(InitContext&)
4748
{
48-
globalTracks = getGlobalTrackSelection();
49+
switch (itsMatching) {
50+
case 0:
51+
// Run 2 SPD kAny
52+
globalTracks = getGlobalTrackSelection();
53+
break;
54+
case 1:
55+
// Run 3 kAny on 3 IB layers of ITS
56+
if (isRun3) {
57+
globalTracks = getGlobalTrackSelectionITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSibAny);
58+
}
59+
break;
60+
case 2:
61+
// Run 3 kAny on all 7 layers of ITS
62+
if (isRun3) {
63+
globalTracks = getGlobalTrackSelectionITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSallAny);
64+
}
65+
break;
66+
case 3:
67+
// Run 3 kAll on all 7 layers of ITS
68+
if (isRun3) {
69+
globalTracks = getGlobalTrackSelectionITSMatch(TrackSelection::GlobalTrackRun3ITSMatching::Run3ITSall7Layers);
70+
}
71+
break;
72+
73+
default:
74+
LOG(fatal) << "TrackSelectionTask with undefined cuts. Fix it!";
75+
break;
76+
}
4977
globalTracksSDD = getGlobalTrackSelectionSDD();
5078

5179
if (isRun3) {

0 commit comments

Comments
 (0)