Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 6 additions & 2 deletions EventFiltering/Zorro.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in EventFiltering/Zorro.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)

Check failure on line 1 in EventFiltering/Zorro.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Provide mandatory file documentation.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -8,7 +8,7 @@
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
//

Check failure on line 11 in EventFiltering/Zorro.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \author is missing, incorrect or misplaced.

Check failure on line 11 in EventFiltering/Zorro.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \brief is missing, incorrect or misplaced.

Check failure on line 11 in EventFiltering/Zorro.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.

#include "Zorro.h"

Expand Down Expand Up @@ -185,7 +185,7 @@
mCCDB = ccdb;
mRunNumber = runNumber;
mBCtolerance = bcRange;
auto ctp = ccdb->getForRun<std::vector<Long64_t>>("CTP/Calib/OrbitReset", runNumber, false);

Check failure on line 188 in EventFiltering/Zorro.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
mOrbitResetTimestamp = (*ctp)[0];
mScalers = mCCDB->getForRun<TH1D>(mBaseCCDBPath + "FilterCounters", runNumber, true);
mSelections = mCCDB->getForRun<TH1D>(mBaseCCDBPath + "SelectionCounters", runNumber, true);
Expand All @@ -202,6 +202,7 @@
mTOIidx.push_back(bin);
}
mTOIcounts.resize(mTOIs.size(), 0);
mATcounts.resize(mSelections->GetNbinsX() - 2, 0);
LOGF(info, "Zorro initialized for run %d, triggers of interest:", runNumber);
for (size_t i{0}; i < mTOIs.size(); ++i) {
LOGF(info, ">>> %s : %i", mTOIs[i].data(), mTOIidx[i]);
Expand Down Expand Up @@ -231,12 +232,15 @@
mLastBCglobalId = bcGlobalId;
for (size_t i = mLastSelectedIdx; i < mBCranges.size(); i++) {
if (!mBCranges[i].isOutside(bcFrame)) {
for (int iMask{0}; iMask < 2; ++iMask) {

Check failure on line 235 in EventFiltering/Zorro.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.
for (int iTOI{0}; iTOI < 64; ++iTOI) {

Check failure on line 236 in EventFiltering/Zorro.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.
if (mZorroHelpers->at(i).selMask[iMask] & (1ull << iTOI)) {
mLastResult.set(iMask * 64 + iTOI, 1);
if (mAnalysedTriggers && !mAccountedBCranges[i]) {
mAnalysedTriggers->Fill(iMask * 64 + iTOI);
if (!mAccountedBCranges[i]) {
mATcounts[iMask * 64 + iTOI]++;
if (mAnalysedTriggers) {
mAnalysedTriggers->Fill(iMask * 64 + iTOI);
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions EventFiltering/Zorro.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class Zorro
TH1D* getInspectedTVX() const { return mInspectedTVX; }
std::bitset<128> getLastResult() const { return mLastResult; }
std::vector<int> getTOIcounters() const { return mTOIcounts; }
std::vector<int> getATcounters() const { return mATcounts; }
std::vector<bool> getTriggerOfInterestResults(uint64_t bcGlobalId, uint64_t tolerance = 100);
std::vector<bool> getTriggerOfInterestResults() const;
int getNTOIs() const { return mTOIs.size(); }
Expand Down Expand Up @@ -98,6 +99,7 @@ class Zorro
std::vector<std::string> mTOIs;
std::vector<int> mTOIidx;
std::vector<int> mTOIcounts;
std::vector<int> mATcounts;
o2::ccdb::BasicCCDBManager* mCCDB = nullptr;
};

Expand Down
43 changes: 30 additions & 13 deletions PWGEM/Dilepton/Core/Dilepton.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
#include <utility>
#include <vector>

using namespace o2;

Check failure on line 63 in PWGEM/Dilepton/Core/Dilepton.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.
using namespace o2::aod;

Check failure on line 64 in PWGEM/Dilepton/Core/Dilepton.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.
using namespace o2::framework;
using namespace o2::framework::expressions;
using namespace o2::soa;
Expand All @@ -72,7 +72,7 @@
using MyCollisions = soa::Join<aod::EMEvents, aod::EMEventsMult, aod::EMEventsCent, aod::EMEventsQvec>;
using MyCollision = MyCollisions::iterator;

using MyCollisionsWithSWT = soa::Join<aod::EMEvents, aod::EMEventsMult, aod::EMEventsCent, aod::EMEventsQvec, aod::EMSWTriggerInfos>;
using MyCollisionsWithSWT = soa::Join<aod::EMEvents, aod::EMEventsMult, aod::EMEventsCent, aod::EMEventsQvec, aod::EMSWTriggerBits>;
using MyCollisionWithSWT = MyCollisionsWithSWT::iterator;

using MyElectrons = soa::Join<aod::EMPrimaryElectrons, aod::EMPrimaryElectronEMEventIds, aod::EMAmbiguousElectronSelfIds, aod::EMPrimaryElectronsPrefilterBit, aod::EMPrimaryElectronsPrefilterBitDerived>;
Expand Down Expand Up @@ -427,7 +427,13 @@
fRegistry.addClone("Event/before/hCollisionCounter", "Event/norm/hCollisionCounter");
}
if (doprocessTriggerAnalysis) {
fRegistry.add("Event/hNInspectedTVX", "N inspected TVX;run number;N_{TVX}", kTProfile, {{80000, 520000.5, 600000.5}}, true);
LOGF(info, "Trigger analysis is enabled. Desired trigger name = %s", cfg_swt_name.value);
fRegistry.add("NormTrigger/hInspectedTVX", "inspected TVX;run number;N_{TVX}", kTProfile, {{80000, 520000.5, 600000.5}}, true);
fRegistry.add("NormTrigger/hScalers", "trigger counter before DS;run number;counter", kTProfile, {{80000, 520000.5, 600000.5}}, true);
fRegistry.add("NormTrigger/hSelections", "trigger counter after DS;run number;counter", kTProfile, {{80000, 520000.5, 600000.5}}, true);
auto hTriggerCounter = fRegistry.add<TH2>("NormTrigger/hTriggerCounter", Form("trigger counter of %s;run number;", cfg_swt_name.value.data()), kTH2D, {{80000, 520000.5, 600000.5}, {2, -0.5, 1.5}}, false);
hTriggerCounter->GetYaxis()->SetBinLabel(1, "Analyzed Trigger");
hTriggerCounter->GetYaxis()->SetBinLabel(2, "Analyzed TOI");
}
if (doprocessBC) {
auto hTVXCounter = fRegistry.add<TH1>("BC/hTVXCounter", "TVX counter", kTH1D, {{6, -0.5f, 5.5f}});
Expand All @@ -440,7 +446,7 @@
}
}

template <bool isTriggerAnalysis, typename TCollision>
template <typename TCollision>
void initCCDB(TCollision const& collision)
{
if (mRunNumber == collision.runNumber()) {
Expand Down Expand Up @@ -494,12 +500,6 @@
beamP2 = std::sqrt(std::pow(beamE2, 2) - std::pow(beamM2, 2));
LOGF(info, "beamZ1 = %d, beamZ2 = %d, beamA1 = %d, beamA2 = %d, beamE1 = %f (GeV), beamE2 = %f (GeV), beamM1 = %f (GeV), beamM2 = %f (GeV), beamP1 = %f (GeV), beamP2 = %f (GeV)", beamZ1, beamZ2, beamA1, beamA2, beamE1, beamE2, beamM1, beamM2, beamP1, beamP2);

if constexpr (isTriggerAnalysis) {
LOGF(info, "Trigger analysis is enabled. Desired trigger name = %s", cfg_swt_name.value);
LOGF(info, "total inspected TVX events = %d in run number %d", collision.nInspectedTVX(), collision.runNumber());
fRegistry.fill(HIST("Event/hNInspectedTVX"), collision.runNumber(), collision.nInspectedTVX());
}

if (cfgApplySPresolution) {
auto list = ccdb->getForTimeStamp<TList>(spresoPath, collision.timestamp());
h2sp_resolution = reinterpret_cast<TH2D*>(list->FindObject(spresoHistName.value.data()));
Expand Down Expand Up @@ -1164,7 +1164,7 @@
void runPairing(TCollisions const& collisions, TLeptons const& posTracks, TLeptons const& negTracks, TPresilce const& perCollision, TCut const& cut, TAllTracks const& tracks)
{
for (const auto& collision : collisions) {
initCCDB<isTriggerAnalysis>(collision);
initCCDB(collision);
const float centralities[3] = {collision.centFT0M(), collision.centFT0A(), collision.centFT0C()};
float centrality = centralities[cfgCentEstimator];
if (centralities[cfgCentEstimator] < cfgCentMin || cfgCentMax < centralities[cfgCentEstimator]) {
Expand Down Expand Up @@ -1412,7 +1412,7 @@
passed_pairIds.reserve(posTracks.size() * negTracks.size());

for (const auto& collision : collisions) {
initCCDB<isTriggerAnalysis>(collision);
initCCDB(collision);
const float centralities[3] = {collision.centFT0M(), collision.centFT0A(), collision.centFT0C()};
if (centralities[cfgCentEstimator] < cfgCentMin || cfgCentMax < centralities[cfgCentEstimator]) {
continue;
Expand Down Expand Up @@ -1531,8 +1531,8 @@
}
PROCESS_SWITCH(Dilepton, processAnalysis, "run dilepton analysis", true);

// using FilteredMyCollisionsWithSWT = soa::Filtered<MyCollisionsWithSWT>;
void processTriggerAnalysis(MyCollisionsWithSWT const& collisions, Types const&... args)
using FilteredMyCollisionsWithSWT = soa::Filtered<MyCollisionsWithSWT>;
void processTriggerAnalysis(FilteredMyCollisionsWithSWT const& collisions, aod::EMSWTriggerInfos const& cefpinfos, aod::EMSWTriggerCounters const& counters, Types const&... args)
{
if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) {
auto electrons = std::get<0>(std::tie(args...));
Expand All @@ -1549,6 +1549,23 @@
}
map_weight.clear();
ndf++;

// for nomalization
int emswtId = o2::aod::pwgem::dilepton::swt::aliasLabels.at(cfg_swt_name.value);
for (const auto& counter : counters) {
if (counter.isAnalyzed_bit(emswtId)) {
fRegistry.fill(HIST("NormTrigger/hTriggerCounter"), mRunNumber, 0);
}
if (counter.isAnalyzedToI_bit(emswtId)) {
fRegistry.fill(HIST("NormTrigger/hTriggerCounter"), mRunNumber, 1);
}
}

for (const auto& info : cefpinfos) {
fRegistry.fill(HIST("NormTrigger/hInspectedTVX"), info.runNumber(), info.nInspectedTVX());
fRegistry.fill(HIST("NormTrigger/hScalers"), info.runNumber(), info.nScalers()[emswtId]);
fRegistry.fill(HIST("NormTrigger/hSelections"), info.runNumber(), info.nSelections()[emswtId]);
}
}
PROCESS_SWITCH(Dilepton, processTriggerAnalysis, "run dilepton analysis on triggered data", false);

Expand Down
35 changes: 29 additions & 6 deletions PWGEM/Dilepton/Core/DileptonHadronMPC.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ using namespace o2::aod::pwgem::dilepton::utils::pairutil;
using MyCollisions = soa::Join<aod::EMEvents, aod::EMEventsMult, aod::EMEventsCent>;
using MyCollision = MyCollisions::iterator;

using MyCollisionsWithSWT = soa::Join<aod::EMEvents, aod::EMEventsMult, aod::EMEventsCent, aod::EMSWTriggerInfos>;
using MyCollisionsWithSWT = soa::Join<aod::EMEvents, aod::EMEventsMult, aod::EMEventsCent, aod::EMSWTriggerBits>;
using MyCollisionWithSWT = MyCollisionsWithSWT::iterator;

using MyElectrons = soa::Join<aod::EMPrimaryElectrons, aod::EMPrimaryElectronEMEventIds, aod::EMAmbiguousElectronSelfIds, aod::EMPrimaryElectronsPrefilterBit, aod::EMPrimaryElectronsPrefilterBitDerived>;
Expand Down Expand Up @@ -390,7 +390,13 @@ struct DileptonHadronMPC {
}

if (doprocessTriggerAnalysis) {
fRegistry.add("Event/hNInspectedTVX", "N inspected TVX;run number;N_{TVX}", kTProfile, {{80000, 520000.5, 600000.5}}, true);
LOGF(info, "Trigger analysis is enabled. Desired trigger name = %s", cfg_swt_name.value);
fRegistry.add("NormTrigger/hInspectedTVX", "inspected TVX;run number;N_{TVX}", kTProfile, {{80000, 520000.5, 600000.5}}, true);
fRegistry.add("NormTrigger/hScalers", "trigger counter before DS;run number;counter", kTProfile, {{80000, 520000.5, 600000.5}}, true);
fRegistry.add("NormTrigger/hSelections", "trigger counter after DS;run number;counter", kTProfile, {{80000, 520000.5, 600000.5}}, true);
auto hTriggerCounter = fRegistry.add<TH2>("NormTrigger/hTriggerCounter", Form("trigger counter of %s;run number;", cfg_swt_name.value.data()), kTH2D, {{80000, 520000.5, 600000.5}, {2, -0.5, 1.5}}, false);
hTriggerCounter->GetYaxis()->SetBinLabel(1, "Analyzed Trigger");
hTriggerCounter->GetYaxis()->SetBinLabel(2, "Analyzed TOI");
}
}

Expand Down Expand Up @@ -437,8 +443,8 @@ struct DileptonHadronMPC {

if constexpr (isTriggerAnalysis) {
LOGF(info, "Trigger analysis is enabled. Desired trigger name = %s", cfg_swt_name.value);
LOGF(info, "total inspected TVX events = %d in run number %d", collision.nInspectedTVX(), collision.runNumber());
fRegistry.fill(HIST("Event/hNInspectedTVX"), collision.runNumber(), collision.nInspectedTVX());
// LOGF(info, "total inspected TVX events = %d in run number %d", collision.nInspectedTVX(), collision.runNumber());
// fRegistry.fill(HIST("Event/hNInspectedTVX"), collision.runNumber(), collision.nInspectedTVX());
}
}

Expand Down Expand Up @@ -1431,8 +1437,8 @@ struct DileptonHadronMPC {
}
PROCESS_SWITCH(DileptonHadronMPC, processAnalysis, "run dilepton analysis", true);

// using FilteredMyCollisionsWithSWT = soa::Filtered<MyCollisionsWithSWT>;
void processTriggerAnalysis(MyCollisionsWithSWT const& collisions, FilteredRefTracks const& refTracks, Types const&... args)
using FilteredMyCollisionsWithSWT = soa::Filtered<MyCollisionsWithSWT>;
void processTriggerAnalysis(FilteredMyCollisionsWithSWT const& collisions, FilteredRefTracks const& refTracks, aod::EMSWTriggerInfos const& cefpinfos, aod::EMSWTriggerCounters const& counters, Types const&... args)
{
if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) {
auto electrons = std::get<0>(std::tie(args...));
Expand All @@ -1449,6 +1455,23 @@ struct DileptonHadronMPC {
}
map_weight.clear();
ndf++;

// for nomalization
int emswtId = o2::aod::pwgem::dilepton::swt::aliasLabels.at(cfg_swt_name.value);
for (const auto& counter : counters) {
if (counter.isAnalyzed_bit(emswtId)) {
fRegistry.fill(HIST("NormTrigger/hTriggerCounter"), mRunNumber, 0);
}
if (counter.isAnalyzedToI_bit(emswtId)) {
fRegistry.fill(HIST("NormTrigger/hTriggerCounter"), mRunNumber, 1);
}
}

for (const auto& info : cefpinfos) {
fRegistry.fill(HIST("NormTrigger/hInspectedTVX"), info.runNumber(), info.nInspectedTVX());
fRegistry.fill(HIST("NormTrigger/hScalers"), info.runNumber(), info.nScalers()[emswtId]);
fRegistry.fill(HIST("NormTrigger/hSelections"), info.runNumber(), info.nSelections()[emswtId]);
}
}
PROCESS_SWITCH(DileptonHadronMPC, processTriggerAnalysis, "run dilepton analysis on triggered data", false);

Expand Down
33 changes: 28 additions & 5 deletions PWGEM/Dilepton/Core/PhotonHBT.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ using namespace o2::aod::pwgem::dilepton::core::photonhbt;
using MyCollisions = soa::Join<aod::EMEvents, aod::EMEventsMult, aod::EMEventsCent, aod::EMEventsQvec>;
using MyCollision = MyCollisions::iterator;

using MyCollisionsWithSWT = soa::Join<aod::EMEvents, aod::EMEventsMult, aod::EMEventsCent, aod::EMEventsQvec, aod::EMSWTriggerInfos>;
using MyCollisionsWithSWT = soa::Join<aod::EMEvents, aod::EMEventsMult, aod::EMEventsCent, aod::EMEventsQvec, aod::EMSWTriggerBits>;
using MyCollisionWithSWT = MyCollisionsWithSWT::iterator;

using MyV0Photons = soa::Join<aod::V0PhotonsKF, aod::V0KFEMEventIds>;
Expand Down Expand Up @@ -390,7 +390,13 @@ struct PhotonHBT {

fRegistry.add("Pair/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", kTH1D, {{10001, -0.5, 10000.5}}, true);
if (doprocessTriggerAnalysis) {
fRegistry.add("Event/hNInspectedTVX", "N inspected TVX;run number;N_{TVX}", kTProfile, {{80000, 520000.5, 600000.5}}, true);
LOGF(info, "Trigger analysis is enabled. Desired trigger name = %s", cfg_swt_name.value);
fRegistry.add("NormTrigger/hInspectedTVX", "inspected TVX;run number;N_{TVX}", kTProfile, {{80000, 520000.5, 600000.5}}, true);
fRegistry.add("NormTrigger/hScalers", "trigger counter before DS;run number;counter", kTProfile, {{80000, 520000.5, 600000.5}}, true);
fRegistry.add("NormTrigger/hSelections", "trigger counter after DS;run number;counter", kTProfile, {{80000, 520000.5, 600000.5}}, true);
auto hTriggerCounter = fRegistry.add<TH2>("NormTrigger/hTriggerCounter", Form("trigger counter of %s;run number;", cfg_swt_name.value.data()), kTH2D, {{80000, 520000.5, 600000.5}, {2, -0.5, 1.5}}, false);
hTriggerCounter->GetYaxis()->SetBinLabel(1, "Analyzed Trigger");
hTriggerCounter->GetYaxis()->SetBinLabel(2, "Analyzed TOI");
}
}

Expand Down Expand Up @@ -434,8 +440,8 @@ struct PhotonHBT {

if constexpr (isTriggerAnalysis) {
LOGF(info, "Trigger analysis is enabled. Desired trigger name = %s", cfg_swt_name.value);
LOGF(info, "total inspected TVX events = %d in run number %d", collision.nInspectedTVX(), collision.runNumber());
fRegistry.fill(HIST("Event/hNInspectedTVX"), collision.runNumber(), collision.nInspectedTVX());
// LOGF(info, "total inspected TVX events = %d in run number %d", collision.nInspectedTVX(), collision.runNumber());
// fRegistry.fill(HIST("Event/hNInspectedTVX"), collision.runNumber(), collision.nInspectedTVX());
}
}

Expand Down Expand Up @@ -1454,7 +1460,7 @@ struct PhotonHBT {
PROCESS_SWITCH(PhotonHBT, processAnalysis, "pairing for analysis", false);

using FilteredMyCollisionsWithSWT = soa::Filtered<MyCollisionsWithSWT>;
void processTriggerAnalysis(FilteredMyCollisionsWithSWT const& collisions, Types const&... args)
void processTriggerAnalysis(FilteredMyCollisionsWithSWT const& collisions, aod::EMSWTriggerInfos const& cefpinfos, aod::EMSWTriggerCounters const& counters, Types const&... args)
{
if constexpr (pairtype == ggHBTPairType::kPCMPCM) {
auto v0photons = std::get<0>(std::tie(args...));
Expand All @@ -1476,6 +1482,23 @@ struct PhotonHBT {
runPairing<true>(collisions, nullptr, nullptr, emprimaryelectrons, emprimaryelectrons, perCollision_electron, perCollision_electron, fDielectronCut, fDielectronCut);
}
ndf++;

// for nomalization
int emswtId = o2::aod::pwgem::dilepton::swt::aliasLabels.at(cfg_swt_name.value);
for (const auto& counter : counters) {
if (counter.isAnalyzed_bit(emswtId)) {
fRegistry.fill(HIST("NormTrigger/hTriggerCounter"), mRunNumber, 0);
}
if (counter.isAnalyzedToI_bit(emswtId)) {
fRegistry.fill(HIST("NormTrigger/hTriggerCounter"), mRunNumber, 1);
}
}

for (const auto& info : cefpinfos) {
fRegistry.fill(HIST("NormTrigger/hInspectedTVX"), info.runNumber(), info.nInspectedTVX());
fRegistry.fill(HIST("NormTrigger/hScalers"), info.runNumber(), info.nScalers()[emswtId]);
fRegistry.fill(HIST("NormTrigger/hSelections"), info.runNumber(), info.nSelections()[emswtId]);
}
}
PROCESS_SWITCH(PhotonHBT, processTriggerAnalysis, "pairing analysis on trigger data", false);

Expand Down
Loading
Loading