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
13 changes: 13 additions & 0 deletions PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include <Framework/AnalysisTask.h>
#include <Framework/Configurable.h>
#include <Framework/InitContext.h>
#include <Framework/O2DatabasePDGPlugin.h>
#include <Framework/runDataProcessing.h>
#include <ReconstructionDataFormats/Track.h>

Expand All @@ -63,7 +64,7 @@
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <iostream>

Check failure on line 67 in PWGDQ/Tasks/dqEfficiency_withAssoc_direct.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 @@ -290,7 +291,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 294 in PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

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

Expand Down Expand Up @@ -325,7 +326,7 @@

void init(o2::framework::InitContext& context)
{
cout << "AnalysisEventSelection::init() called" << endl;

Check failure on line 329 in PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
if (context.mOptions.get<bool>("processDummy")) {
return;
}
Expand Down Expand Up @@ -370,13 +371,13 @@
fCCDB->setLocalObjectValidityChecking();
fCCDB->setCreatedNotAfter(fConfigNoLaterThan.value);
fCCDBApi.init(fConfigCcdbUrl.value);
cout << "AnalysisEventSelection::init() completed" << endl;

Check failure on line 374 in PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

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

template <uint32_t TEventFillMap, typename TEvents, typename TEventsMC>
void runEventSelection(TEvents const& events, BCsWithTimestamps const& bcs, TEventsMC const& mcEvents)
{
cout << "AnalysisEventSelection::runEventSelection() called with " << events.size() << " events and " << bcs.size() << " BCs" << endl;

Check failure on line 380 in PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
if (bcs.size() > 0 && bcs.begin().runNumber() != fCurrentRun) {
std::map<std::string, std::string> metadataRCT, header;
header = fCCDBApi.retrieveHeaders(Form("RCT/Info/RunInformation/%i", bcs.begin().runNumber()), metadataRCT, -1);
Expand All @@ -385,7 +386,7 @@
VarManager::SetSORandEOR(sor, eor);
}

cout << "Filling TimeFrame statistics histograms" << endl;

Check failure on line 389 in PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
VarManager::ResetValues(0, VarManager::kNEventWiseVariables);
VarManager::FillTimeFrame(bcs);
VarManager::FillTimeFrame(events);
Expand All @@ -398,7 +399,7 @@
fBCCollMap.clear();
// int iEvent = 0;

cout << "Starting event loop for event selection" << endl;

Check failure on line 402 in PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
for (auto& event : events) {

auto bc = event.template bc_as<BCsWithTimestamps>();
Expand Down Expand Up @@ -446,13 +447,13 @@
}
}

cout << "AnalysisEventSelection::runEventSelection() completed" << endl;

Check failure on line 450 in PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

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

template <uint32_t TEventFillMap, typename TEvents>
void publishSelections(TEvents const& events)
{
cout << "AnalysisEventSelection::publishSelections() called" << endl;

Check failure on line 456 in PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

Use O2 logging (LOG, LOGF, LOGP).
std::map<int64_t, bool> collisionSplittingMap; // key: event global index, value: whether pileup event is a possible splitting

// Reset the fValues array and fill event observables
Expand Down Expand Up @@ -526,7 +527,7 @@
}
eventSel(evSel);
}
cout << "AnalysisEventSelection::publishSelections() completed" << endl;

Check failure on line 530 in PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[logging]

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

void processDirect(MyEvents const& events, BCsWithTimestamps const& bcs, soa::Join<aod::McCollisions, aod::McCollsExtra, aod::MultMCExtras> const& mcEvents)
Expand Down Expand Up @@ -1151,6 +1152,8 @@
} fConfigCCDB;

Service<o2::ccdb::BasicCCDBManager> fCCDB;
// PDG database
Service<o2::framework::O2DatabasePDG> pdgDB;

HistogramManager* fHistMan;

Expand Down Expand Up @@ -2076,6 +2079,16 @@
mcDecision |= (static_cast<uint32_t>(1) << isig);
VarManager::FillPairMC<TPairType>(t1_raw, t2_raw);
// cout << " Filled VarManager for the pair." << endl;
// check if t1_raw and t2_raw have same mother to compute decay length related variables
if (t1_raw.has_mothers() && t2_raw.has_mothers()) {
auto motherMCParticle_t1 = t1_raw.template mothers_first_as<McParticles>();
auto motherMCParticle_t2 = t2_raw.template mothers_first_as<McParticles>();
if (motherMCParticle_t1 == motherMCParticle_t2) {
auto mcEvent = mcEvents.rawIteratorAt(motherMCParticle_t1.mcCollisionId());
std::array<double, 3> collVtxPos = {mcEvent.posX(), mcEvent.posY(), mcEvent.posZ()};
VarManager::FillTrackCollisionMC<TPairType>(motherMCParticle_t1, collVtxPos, pdgDB->Mass(motherMCParticle_t1.pdgCode()));
}
}
if (fUseMCGenAccCut) {
if (!fMCGenAccCut.IsSelected(VarManager::fgValues)) {
continue;
Expand Down
Loading