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
14 changes: 6 additions & 8 deletions PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#include "TList.h"

#include <cstdint>
#include <iostream>

Check failure on line 57 in PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[include-iostream]

Do not include iostream. Use O2 logging instead.
#include <map>
#include <memory>
#include <string>
Expand Down Expand Up @@ -125,7 +125,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 128 in PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

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

Expand Down Expand Up @@ -454,8 +454,7 @@
Preslice<aod::FwdTrackAssoc> fwdtrackIndicesPerCollision = aod::track_association::collisionId;
Preslice<aod::MFTTrackAssoc> mfttrackIndicesPerCollision = aod::track_association::collisionId;

template <uint32_t TEventMcFillMap, typename TEventsMC>
void skimMCCollisions(TEventsMC const& mcCollisions)
void skimMCCollisions(MyEventsMcWithMults const& mcCollisions)
{
// skim MC collisions
// NOTE: So far, all MC collisions are skimmed. In case there will be filtering based on MC collisions,
Expand All @@ -465,7 +464,7 @@
// Loop over MC collisions
for (auto& mcCollision : mcCollisions) {
// Get MC collision information into the VarManager
VarManager::FillEvent<TEventMcFillMap>(mcCollision);
VarManager::FillEvent<gkEventMcFillMapWithCent>(mcCollision);
// Fill histograms
fHistMan->FillHistClass("Event_MCTruth", VarManager::fgValues);
// Create the skimmed table entry for this collision
Expand All @@ -474,8 +473,7 @@
}
}

template <uint32_t TEventMcFillMap, typename TEventsMC>
void skimMCParticles(aod::McParticles const& mcTracks, TEventsMC const&)
void skimMCParticles(aod::McParticles const& mcTracks, MyEventsMcWithMults const&)
{
// Select MC particles which fulfill at least one of the user specified MC signals
// In this function we just fill a map with the labels of selected particles, not creating the tables themselves.
Expand Down Expand Up @@ -511,17 +509,17 @@
/*if ((std::abs(mctrack.pdgCode())>400 && std::abs(mctrack.pdgCode())<599) ||
(std::abs(mctrack.pdgCode())>4000 && std::abs(mctrack.pdgCode())<5999) ||
(mcflags > 0)) {
cout << ">>>>>>>>>>>>>>>>>>>>>>> track idx / pdg / process / status code / HEPMC status / primary : "

Check failure on line 512 in PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
<< mctrack.globalIndex() << " / " << mctrack.pdgCode() << " / "
<< mctrack.getProcess() << " / " << mctrack.getGenStatusCode() << " / " << mctrack.getHepMCStatusCode() << " / " << mctrack.isPhysicalPrimary() << endl;
cout << ">>>>>>>>>>>>>>>>>>>>>>> track bitmap: ";

Check failure on line 515 in PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
PrintBitMap(mcflags, 16);
cout << endl;

Check failure on line 517 in PWGDQ/TableProducer/tableMakerMC_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 522 in PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
}
}
}
Expand All @@ -531,7 +529,7 @@

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 532 in PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
}
}
}
Expand All @@ -553,7 +551,7 @@
if (fConfigHistOutput.fConfigQA) {
VarManager::FillTrackMC(mcTracks, mctrack);
auto mcCollision = mctrack.template mcCollision_as<MyEventsMcWithMults>();
VarManager::FillEvent<TEventMcFillMap>(mcCollision);
VarManager::FillEvent<gkEventMcFillMapWithCent>(mcCollision);
int j = 0;
for (auto signal = fMCSignals.begin(); signal != fMCSignals.end(); signal++, j++) {
if (mcflags & (static_cast<uint16_t>(1) << j)) {
Expand Down Expand Up @@ -1214,11 +1212,11 @@

// skim MC Collisions
eventMC.reserve(mcCollisions.size());
skimMCCollisions<TEventMcFillMap>(mcCollisions);
skimMCCollisions(mcCollisions);

// select MC particles to be written using the specified MC signals
// NOTE: tables are not written at this point, only label maps are being created
skimMCParticles<TEventMcFillMap>(mcParticles, mcCollisions);
skimMCParticles(mcParticles, mcCollisions);

// skim collisions
event.reserve(collisions.size());
Expand Down Expand Up @@ -1322,8 +1320,8 @@
mothers.push_back(fLabelsMap.find(m)->second);
}
} else {
cout << "Mother label (" << m << ") exceeds the McParticles size (" << mcParticles.size() << ")" << endl;

Check failure on line 1323 in PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
cout << " Check the MC generator" << endl;

Check failure on line 1324 in PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
}
}
}
Expand All @@ -1339,7 +1337,7 @@
daughters.push_back(fLabelsMap.find(d)->second);
}
} else {
cout << "Daughter label (" << d << ") exceeds the McParticles size (" << mcParticles.size() << ")" << endl;

Check failure on line 1340 in PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
cout << " Check the MC generator" << endl;
}
}
Expand Down
Loading