Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 6 additions & 23 deletions Common/TableProducer/match-mft-ft0.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@
}

if (bcIt != bcs.end() && maxBCId >= minBCId) {
T slice{{bcs.asArrowTable()->Slice(minBCId, maxBCId - minBCId + 1)}, (uint64_t)minBCId};
auto slice = bcs.rawSlice(minBCId, maxBCId - minBCId + 1);
bcs.copyIndexBindings(slice);
return slice;
} else {
T slice{{bcs.asArrowTable()->Slice(minBCId, maxBCId - minBCId)}, (uint64_t)minBCId};
auto slice = bcs.rawSlice(minBCId, maxBCId - minBCId);
bcs.copyIndexBindings(slice);
return slice;
}
Expand All @@ -141,18 +141,10 @@
// define firstBC and lastBC (globalBC of beginning and end of the range, when no shift is applied)

auto bcIt = collOrig.bc_as<T>();
// auto timstp = bcIt.timestamp();

int64_t firstBC = bcIt.globalBC() + (track.trackTime() - track.trackTimeRes()) / o2::constants::lhc::LHCBunchSpacingNS;
int64_t lastBC = firstBC + 2 * track.trackTimeRes() / o2::constants::lhc::LHCBunchSpacingNS + 1; // to have a delta = 198 BC

// printf(">>>>>>>>>>>>>>>>>>>>>>>>>>> last-first %lld\n", lastBC-firstBC);

// int collTimeResInBC = collOrig.collisionTimeRes()/o2::constants::lhc::LHCBunchSpacingNS;

// int64_t collFirstBC = bcIt.globalBC() + (collOrig.collisionTime() - collOrig.collisionTimeRes())/o2::constants::lhc::LHCBunchSpacingNS;
// int64_t collLastBC = collFirstBC + 2*collOrig.collisionTimeRes()/o2::constants::lhc::LHCBunchSpacingNS +1;

int64_t minBCId = bcIt.globalIndex();

if ((int64_t)bcIt.globalBC() < firstBC + deltaBC) {
Expand Down Expand Up @@ -195,9 +187,7 @@
{
// means that the slice of compatible BCs is empty

T slice{{bcs.asArrowTable()->Slice(0, 0)}, (uint64_t)0};
// bcs.copyIndexBindings(slice); REMOVED IT BECAUSE I DON'T KNOW WHAT IT DOES HERE
return slice; // returns an empty slice
return bcs.emptySlice();
}
}
}
Expand All @@ -209,9 +199,7 @@
if (bcIt != bcs.end() && ((int64_t)bcIt.globalBC() > (int64_t)lastBC + deltaBC)) {
// check the following element

T slice{{bcs.asArrowTable()->Slice(0, 0)}, (uint64_t)0};
// bcs.copyIndexBindings(slice); REMOVED IT BECAUSE I DON'T KNOW WHAT IT DOES HERE
return slice; // returns an empty slice
return bcs.emptySlice();
}
}

Expand All @@ -222,15 +210,10 @@
}

if (maxBCId < minBCId) {
if (bcIt == bcs.end()) {
printf("at the end of the bcs iterator %d\n", 1);
}
T slice{{bcs.asArrowTable()->Slice(0, 0)}, (uint64_t)0};
// bcs.copyIndexBindings(slice); REMOVED IT BECAUSE I DON'T KNOW WHAT IT DOES HERE
return slice; // returns an empty slice
return bcs.emptySlice();
}

T slice{{bcs.asArrowTable()->Slice(minBCId, maxBCId - minBCId + 1)}, (uint64_t)minBCId};
auto slice = bcs.rawSlice(minBCId, maxBCId - minBCId + 1);
bcs.copyIndexBindings(slice);
return slice;
}
Expand Down Expand Up @@ -302,17 +285,17 @@
{
// returns true if the propagated x and y positions are in an active zone of the FT0-C, false if they in a dead zone

if ((abs(x) < 6.365) && (abs(y) < 6.555)) {

Check failure on line 288 in Common/TableProducer/match-mft-ft0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.

Check failure on line 288 in Common/TableProducer/match-mft-ft0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
// track outside the FT0-C acceptance (in the central hole)
return false;
}

if (((x > -12.75) && (x < -11.85)) || ((x > -6.55) && (x < -5.75)) || ((x > -0.35) && (x < 0.45)) || ((x > 5.75) && (x < 6.55)) || ((x > 11.85) && (x < 12.75))) {

Check failure on line 293 in Common/TableProducer/match-mft-ft0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
// track outside the FT0-C acceptance (in the vertical line holes)
return false;
}

if (((y > -12.95) && (y < -11.95)) || ((y > -6.65) && (y < -5.85)) || ((y > -0.55) && (y < 0.45)) || ((y > 5.75) && (y < 6.65)) || ((y > 11.95) && (y < 12.85))) {

Check failure on line 298 in Common/TableProducer/match-mft-ft0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
// track outside the FT0-C acceptance (in the horizontal line holes)
return false;
}
Expand All @@ -332,7 +315,7 @@
double minD;
double globalMinD;

for (auto& track : mfttracks) {

Check failure on line 318 in Common/TableProducer/match-mft-ft0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
filler.BCids.clear();
globalMinD = 999.; // minimum D for all BC
ExtBCs::iterator closestBC; // compatible BC with the D the smallest
Expand Down Expand Up @@ -374,7 +357,7 @@

bool hasft0A = false;
bool hasft0C = false;
for (auto& bc : bcSlice) {

Check failure on line 360 in Common/TableProducer/match-mft-ft0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
hasft0C = false;
hasft0A = false;
// printf("----------bcId %lld\n", bc.globalIndex());
Expand All @@ -396,11 +379,11 @@
if (ft0.channelC().size() > 0) {
hasft0C = true;
}
for (auto channelId : ft0.channelC()) {

Check failure on line 382 in Common/TableProducer/match-mft-ft0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.

std::vector<float> Xc = channelCoord[channelId]; //(xc,yc,zc) coordinates
// D in cm
D = sqrt(pow(Xc[0] * 0.1 - trackPar.getX(), 2) + pow(Xc[1] * 0.1 - trackPar.getY(), 2) + pow(Xc[2] * 0.1 - 1.87 - trackPar.getZ(), 2));

Check failure on line 386 in Common/TableProducer/match-mft-ft0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
// printf("----channelId %u, D %f, n %d\n", channelId, D, n);//should be between 96 and 207
if (D < minD) {
minD = D;
Expand Down Expand Up @@ -500,7 +483,7 @@
aod::McCollisions const&, ExtBCs const&, aod::McParticles const&)
{

for (auto& mfttrack : mfttracks) {

Check failure on line 486 in Common/TableProducer/match-mft-ft0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.

if (!mfttrack.has_bcs()) // mft tracks having a match in FT0-C
{
Expand All @@ -519,7 +502,7 @@
;
bool isTrueBCAmongMatchedOnes = false;

for (auto& bc : mfttrack.bcs_as<ExtBCs>()) { //

Check failure on line 505 in Common/TableProducer/match-mft-ft0.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
int64_t bcDiffTrue = bc.globalBC() - trueMFTBC; // difference between the muon's BC and the MFT track's BC
registryMC.fill(HIST("DiffInBCTrue"), bcDiffTrue);
if (bcDiffTrue == 0) {
Expand Down
Loading