Skip to content
Closed
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
32 changes: 18 additions & 14 deletions PWGDQ/Tasks/dqEfficiency_withAssoc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <iostream>

Check failure on line 62 in PWGDQ/Tasks/dqEfficiency_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[include-iostream]

Do not include iostream. Use O2 logging instead.
#include <iterator>
#include <map>
#include <memory>
Expand Down Expand Up @@ -279,7 +279,7 @@
void PrintBitMap(TMap map, int nbits)
{
for (int i = 0; i < nbits; i++) {
cout << ((map & (TMap(1) << i)) > 0 ? "1" : "0");

Check failure on line 282 in PWGDQ/Tasks/dqEfficiency_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
}
}

Expand Down Expand Up @@ -2005,22 +2005,24 @@
uint32_t mcDecision = static_cast<uint32_t>(0);
bool isCorrectAssoc_leg1 = false;
bool isCorrectAssoc_leg2 = false;
dielectronList.reserve(1);
dimuonList.reserve(1);
dielectronsExtraList.reserve(1);
dimuonsExtraList.reserve(1);
dielectronInfoList.reserve(1);
dileptonInfoList.reserve(1);

auto nAssocs = assocs.size();
dielectronList.reserve(nAssocs);
dimuonList.reserve(nAssocs);
dielectronsExtraList.reserve(nAssocs);
dimuonsExtraList.reserve(nAssocs);
dielectronInfoList.reserve(nAssocs);
dileptonInfoList.reserve(nAssocs);
if (fConfigOptions.flatTables.value) {
dielectronAllList.reserve(1);
dimuonAllList.reserve(1);
dielectronAllList.reserve(nAssocs);
dimuonAllList.reserve(nAssocs);
}
if (useMiniTree.fConfigMiniTree) {
dileptonMiniTreeGen.reserve(1);
dileptonMiniTreeRec.reserve(1);
dileptonMiniTreeGen.reserve(nAssocs);
dileptonMiniTreeRec.reserve(nAssocs);
}
if (fConfigOptions.polarTables.value) {
dileptonPolarList.reserve(1);
dileptonPolarList.reserve(nAssocs);
}
constexpr bool eventHasQvector = ((TEventFillMap & VarManager::ObjTypes::ReducedEventQvector) > 0);
constexpr bool trackHasCov = ((TTrackFillMap & VarManager::ObjTypes::ReducedTrackBarrelCov) > 0);
Expand Down Expand Up @@ -3567,7 +3569,7 @@

// Template function to run same event pairing with asymmetric pairs (e.g. kaon-pion)
template <bool TTwoProngFitter, int TPairType, uint32_t TEventFillMap, uint32_t TTrackFillMap, typename TEvents, typename TTrackAssocs, typename TTracks>
void runAsymmetricPairing(TEvents const& events, Preslice<TTrackAssocs>& preslice, TTrackAssocs const& /*assocs*/, TTracks const& /*tracks*/, ReducedMCEvents const& /*mcEvents*/, ReducedMCTracks const& /*mcTracks*/)
void runAsymmetricPairing(TEvents const& events, Preslice<TTrackAssocs>& preslice, TTrackAssocs const& assocs, TTracks const& /*tracks*/, ReducedMCEvents const& /*mcEvents*/, ReducedMCTracks const& /*mcTracks*/)
{
fPairCount.clear();

Expand All @@ -3581,8 +3583,10 @@
int sign1 = 0;
int sign2 = 0;
uint32_t mcDecision = 0;
ditrackList.reserve(1);
ditrackExtraList.reserve(1);

auto nAssocs = assocs.size();
ditrackList.reserve(nAssocs);
ditrackExtraList.reserve(nAssocs);

constexpr bool trackHasCov = ((TTrackFillMap & VarManager::ObjTypes::TrackCov) > 0 || (TTrackFillMap & VarManager::ObjTypes::ReducedTrackBarrelCov) > 0);

Expand Down Expand Up @@ -4543,7 +4547,7 @@
}
// dilepton rap cut
float rap = dilepton.rap();
if (fConfigUseMCRapcut && abs(rap) > fConfigDileptonRapCutAbs)

Check failure on line 4550 in PWGDQ/Tasks/dqEfficiency_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
continue;

// Correct association
Expand Down Expand Up @@ -4868,12 +4872,12 @@
mctrack.mcReducedFlags() > 0) {
/*cout << ">>>>>>>>>>>>>>>>>>>>>>> track idx / pdg / selections: " << mctrack.globalIndex() << " / " << mctrack.pdgCode() << " / ";
PrintBitMap(mctrack.mcReducedFlags(), 16);
cout << endl;

Check failure on line 4875 in PWGDQ/Tasks/dqEfficiency_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
if (mctrack.has_mothers()) {
for (auto& m : mctrack.mothersIds()) {
if (m < mcTracks.size()) { // protect against bad mother indices
auto aMother = mcTracks.rawIteratorAt(m);
cout << "<<<<<< mother idx / pdg: " << m << " / " << aMother.pdgCode() << endl;

Check failure on line 4880 in PWGDQ/Tasks/dqEfficiency_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
}
}
}
Expand All @@ -4882,7 +4886,7 @@
for (int d = mctrack.daughtersIds()[0]; d <= mctrack.daughtersIds()[1]; ++d) {
if (d < mcTracks.size()) { // protect against bad daughter indices
auto aDaughter = mcTracks.rawIteratorAt(d);
cout << "<<<<<< daughter idx / pdg: " << d << " / " << aDaughter.pdgCode() << endl;

Check failure on line 4889 in PWGDQ/Tasks/dqEfficiency_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
}
}
}*/
Expand Down Expand Up @@ -4984,12 +4988,12 @@
// apply kinematic cuts for signal
if ((t1_raw.pt() < fConfigDileptonLowpTCut || t1_raw.pt() > fConfigDileptonHighpTCut))
continue;
if (abs(t1_raw.y()) > fConfigDileptonRapCutAbs)

Check failure on line 4991 in PWGDQ/Tasks/dqEfficiency_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
continue;
// for the energy correlators
for (auto& t2 : groupedMCTracks) {
auto t2_raw = groupedMCTracks.rawIteratorAt(t2.globalIndex());
if (TMath::Abs(t2_raw.pdgCode()) == 443 || TMath::Abs(t2_raw.pdgCode()) == 11 || TMath::Abs(t2_raw.pdgCode()) == 22)

Check failure on line 4996 in PWGDQ/Tasks/dqEfficiency_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
continue;
if (t2_raw.pt() < fConfigMCGenHadronPtMin.value || std::abs(t2_raw.eta()) > fConfigMCGenHadronEtaAbs.value)
continue;
Expand Down Expand Up @@ -5052,12 +5056,12 @@
// apply kinematic cuts for signal
if ((t1_raw.pt() < fConfigDileptonLowpTCut || t1_raw.pt() > fConfigDileptonHighpTCut))
continue;
if (abs(t1_raw.y()) > fConfigDileptonRapCutAbs)

Check failure on line 5059 in PWGDQ/Tasks/dqEfficiency_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
continue;
// for the energy correlators
for (auto& t2 : groupedMCTracks2) {
auto t2_raw = groupedMCTracks2.rawIteratorAt(t2.globalIndex());
if (TMath::Abs(t2_raw.pdgCode()) == 443 || TMath::Abs(t2_raw.pdgCode()) == 11 || TMath::Abs(t2_raw.pdgCode()) == 22)

Check failure on line 5064 in PWGDQ/Tasks/dqEfficiency_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
continue;
if (t2_raw.pt() < fConfigMCGenHadronPtMin.value || std::abs(t2_raw.eta()) > fConfigMCGenHadronEtaAbs.value)
continue;
Expand Down
Loading