Skip to content
Merged
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
74 changes: 36 additions & 38 deletions PWGUD/TableProducer/UPCCandidateProducer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
return false;
if (upcCuts.getCheckMaxDcaXY()) {
float dca = track.dcaXY();
float maxDCA = 0.0105f + 0.0350f / pow(track.pt(), 1.1f);

Check warning on line 230 in PWGUD/TableProducer/UPCCandidateProducer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
if (dca > maxDCA)
return false;
}
Expand Down Expand Up @@ -326,7 +326,7 @@
// collecting new mother IDs
if (mcPart.has_mothers()) {
const auto& motherIDs = mcPart.mothersIds();
for (auto motherID : motherIDs) {

Check warning on line 329 in PWGUD/TableProducer/UPCCandidateProducer.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 (motherID >= nMCParticles) {
continue;
}
Expand Down Expand Up @@ -377,7 +377,7 @@
uint64_t globalBC, uint64_t closestBcMCH,
const o2::aod::McFwdTrackLabels* mcTrackLabels)
{
for (auto trackID : trackIDs) {

Check warning on line 380 in PWGUD/TableProducer/UPCCandidateProducer.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.
const auto& track = tracks.iteratorAt(trackID);
double trTime = track.trackTime();
double mchmidChi2 = track.chi2MatchMCHMID();
Expand Down Expand Up @@ -414,9 +414,9 @@
clustersPerTrack[cls.fwdtrackId()].push_back(cls.globalIndex());
}
int newId = 0;
for (auto trackId : trackIds) {

Check warning on line 417 in PWGUD/TableProducer/UPCCandidateProducer.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.
const auto& clusters = clustersPerTrack.at(trackId);
for (auto clsId : clusters) {

Check warning on line 419 in PWGUD/TableProducer/UPCCandidateProducer.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.
const auto& clsInfo = fwdTrkCls.iteratorAt(clsId);
udFwdTrkClusters(newId, clsInfo.x(), clsInfo.y(), clsInfo.z(), clsInfo.clInfo());
}
Expand All @@ -432,7 +432,7 @@
const o2::aod::McTrackLabels* mcTrackLabels,
std::unordered_map<int64_t, uint64_t>& /*ambBarrelTrBCs*/)
{
for (auto trackID : trackIDs) {

Check warning on line 435 in PWGUD/TableProducer/UPCCandidateProducer.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.
const auto& track = tracks.iteratorAt(trackID);
double trTime = track.trackTime() - std::round(track.trackTime() / o2::constants::lhc::LHCBunchSpacingNS) * o2::constants::lhc::LHCBunchSpacingNS;
int64_t colId = track.collisionId() >= 0 ? track.collisionId() : -1;
Expand Down Expand Up @@ -507,10 +507,10 @@
const auto& ampsA = ft0.amplitudeA();
const auto& ampsC = ft0.amplitudeC();
fitInfo.ampFT0A = 0.;
for (auto amp : ampsA)

Check warning on line 510 in PWGUD/TableProducer/UPCCandidateProducer.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.
fitInfo.ampFT0A += amp;
fitInfo.ampFT0C = 0.;
for (auto amp : ampsC)

Check warning on line 513 in PWGUD/TableProducer/UPCCandidateProducer.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.
fitInfo.ampFT0C += amp;
fitInfo.triggerMaskFT0 = ft0.triggerMask();
}
Expand All @@ -519,7 +519,7 @@
fitInfo.timeFV0A = fv0a.time();
const auto& amps = fv0a.amplitude();
fitInfo.ampFV0A = 0.;
for (auto amp : amps)

Check warning on line 522 in PWGUD/TableProducer/UPCCandidateProducer.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.
fitInfo.ampFV0A += amp;
fitInfo.triggerMaskFV0A = fv0a.triggerMask();
}
Expand All @@ -530,7 +530,7 @@
const auto& ampsA = fdd.chargeA();
const auto& ampsC = fdd.chargeC();
fitInfo.ampFDDA = 0.;
for (auto amp : ampsA) {

Check warning on line 533 in PWGUD/TableProducer/UPCCandidateProducer.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.
fitInfo.ampFDDA += amp;
}
fitInfo.ampFDDC = 0.;
Expand Down Expand Up @@ -697,47 +697,45 @@
}
}


template <typename TBCs>
void collectForwardGlobalTracks(std::vector<BCTracksPair>& bcsMatchedTrIds,
int typeFilter,
TBCs const& /*bcs*/,
o2::aod::Collisions const& /*collisions*/,
ForwardTracks const& fwdTracks,
o2::aod::AmbiguousFwdTracks const& /*ambFwdTracks*/,
std::unordered_map<int64_t, uint64_t>& ambFwdTrBCs)
{
for (const auto& trk : fwdTracks) {
if (trk.trackType() != typeFilter)
continue;
if (!applyFwdCuts(trk))
continue;
int64_t trkId = trk.globalIndex();
int32_t nContrib = -1;
uint64_t trackBC = 0;
auto ambIter = ambFwdTrBCs.find(trkId);
if (ambIter == ambFwdTrBCs.end()) {
const auto& col = trk.collision();
nContrib = col.numContrib();
trackBC = col.bc_as<TBCs>().globalBC();
const auto& bc = col.bc_as<TBCs>();
if (fRequireNoTimeFrameBorder && !bc.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) {
continue; // skip this track if the kNoTimeFrameBorder bit is required but not set
}
if (fRequireNoITSROFrameBorder && !bc.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) {
continue; // skip this track if the kNoITSROFrameBorder bit is required but not set
}
} else {
trackBC = ambIter->second;
template <typename TBCs>
void collectForwardGlobalTracks(std::vector<BCTracksPair>& bcsMatchedTrIds,
int typeFilter,
TBCs const& /*bcs*/,
o2::aod::Collisions const& /*collisions*/,
ForwardTracks const& fwdTracks,
o2::aod::AmbiguousFwdTracks const& /*ambFwdTracks*/,
std::unordered_map<int64_t, uint64_t>& ambFwdTrBCs)
{
for (const auto& trk : fwdTracks) {
if (trk.trackType() != typeFilter)
continue;
if (!applyFwdCuts(trk))
continue;
int64_t trkId = trk.globalIndex();
int32_t nContrib = -1;
uint64_t trackBC = 0;
auto ambIter = ambFwdTrBCs.find(trkId);
if (ambIter == ambFwdTrBCs.end()) {
const auto& col = trk.collision();
nContrib = col.numContrib();
trackBC = col.bc_as<TBCs>().globalBC();
const auto& bc = col.bc_as<TBCs>();
if (fRequireNoTimeFrameBorder && !bc.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) {
continue; // skip this track if the kNoTimeFrameBorder bit is required but not set
}
int64_t tint = TMath::FloorNint(trk.trackTime() / o2::constants::lhc::LHCBunchSpacingNS + static_cast<float>(fMuonTrackTShift));
uint64_t bc = trackBC + tint;
if (nContrib > upcCuts.getMaxNContrib())
continue;
addTrack(bcsMatchedTrIds, bc, trkId);
if (fRequireNoITSROFrameBorder && !bc.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) {
continue; // skip this track if the kNoITSROFrameBorder bit is required but not set
}
} else {
trackBC = ambIter->second;
}
int64_t tint = TMath::FloorNint(trk.trackTime() / o2::constants::lhc::LHCBunchSpacingNS + static_cast<float>(fMuonTrackTShift));
uint64_t bc = trackBC + tint;
if (nContrib > upcCuts.getMaxNContrib())
continue;
addTrack(bcsMatchedTrIds, bc, trkId);
}

}

int32_t searchTracks(uint64_t midbc, uint64_t range, uint32_t tracksToFind,
std::vector<int64_t>& tracks,
Expand Down
Loading