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
39 changes: 27 additions & 12 deletions EventFiltering/PWGMM/multFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,23 @@
// 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.
#include <cmath>
#include <string>

#include "Framework/runDataProcessing.h"
#include "Framework/AnalysisTask.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/StaticFor.h"

#include "Common/Core/TrackSelection.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "EventFiltering/filterTables.h"

#include "CCDB/BasicCCDBManager.h"
#include "CCDB/CcdbApi.h"
#include "DataFormatsFT0/Digit.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/StaticFor.h"
#include "Framework/runDataProcessing.h"
#include "ReconstructionDataFormats/Track.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "Common/Core/TrackSelection.h"

#include <cmath>
#include <string>

using namespace o2;
using namespace o2::framework;
Expand Down Expand Up @@ -58,6 +57,9 @@
Configurable<bool> sel8{"sel8", 1, "apply sel8 event selection"};
Configurable<bool> selt0time{"selt0time", 0, "apply 1ns cut T0A and T0C"};
Configurable<bool> selt0vtx{"selt0vtx", 0, "apply T0 vertext trigger"};
Configurable<bool> isTimeFrameBorderCut{"isTimeFrameBorderCut", 1, "apply timeframe border cut"};
Configurable<bool> isSameBunchPileup{"isSameBunchPileup", 1, "apply same bunch pileup cut"};
Configurable<bool> isGoodZvtxFT0vsPV{"isGoodZvtxFT0vsPV", 1, "apply good vtx FT0vsPV cut"};

Configurable<float> avPyT0A{"avPyT0A", 8.16, "nch from pythia T0A"};
Configurable<float> avPyT0C{"avPyT0C", 8.83, "nch from pythia T0C"};
Expand Down Expand Up @@ -149,15 +151,15 @@

// QA global tracks
multiplicity.add("hdNdetaGlobal", "dNdeta", HistType::kTH1F, {{50, -5.0, 5.0, " "}});
multiplicity.add("hPhiGlobal", "Phi", HistType::kTH1F, {{64, 0., 2.0 * M_PI, " "}});

Check failure on line 154 in EventFiltering/PWGMM/multFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pi-multiple-fraction]

Use multiples/fractions of PI defined in o2::constants::math.

Check failure on line 154 in EventFiltering/PWGMM/multFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[external-pi]

Use the PI constant (and its multiples and fractions) defined in o2::constants::math.
multiplicity.add("hDCAxyGlobal", "DCA_{xy}", HistType::kTH1F, {{120, -4.0, 4.0, " "}});

// estimators
for (int i_e = 0; i_e < 7; ++i_e) {

Check failure on line 158 in EventFiltering/PWGMM/multFilter.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.
multiplicity.add(
npEst[i_e].data(), "", HistType::kTProfile, {{nBinsEst[i_e], lowEdgeEst[i_e], upEdgeEst[i_e], tEst[i_e].data()}});
}
for (int i_e = 0; i_e < 7; ++i_e) {

Check failure on line 162 in EventFiltering/PWGMM/multFilter.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.
multiplicity.add(
nhEst_before[i_e].data(), "", HistType::kTH1F, {{nBinsEst[i_e], lowEdgeEst[i_e], upEdgeEst[i_e], tEst[i_e].data()}});
multiplicity.add(
Expand All @@ -168,7 +170,7 @@

auto scalers{std::get<std::shared_ptr<TH1>>(multiplicity.add("fProcessedEvents", "Multiplicity - event filtered;;events", HistType::kTH1F, {{kNtriggersMM + 2, -0.5, kNtriggersMM + 2 - 0.5}}))};
for (size_t iBin = 0; iBin < eventTitles.size() + mmObjectsNames.size(); iBin++) {
if (iBin < 2)

Check failure on line 173 in EventFiltering/PWGMM/multFilter.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.
scalers->GetXaxis()->SetBinLabel(iBin + 1, eventTitles[iBin].data());
else
scalers->GetXaxis()->SetBinLabel(iBin + 1, mmObjectsNames[iBin - 2].data());
Expand All @@ -176,7 +178,7 @@
// overlap with HtrackMult
auto scalerso1{std::get<std::shared_ptr<TH1>>(multiplicity.add("fProcessedEvents_overlap1", "Multiplicity - event filtered;;events", HistType::kTH1F, {{kNtriggersMM + 2, -0.5, kNtriggersMM + 2 - 0.5}}))};
for (size_t iBin = 0; iBin < eventTitles.size() + mmObjectsNames.size(); iBin++) {
if (iBin < 2)

Check failure on line 181 in EventFiltering/PWGMM/multFilter.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.
scalerso1->GetXaxis()->SetBinLabel(iBin + 1, eventTitles[iBin].data());
else
scalerso1->GetXaxis()->SetBinLabel(iBin + 1, mmObjectsNames[iBin - 2].data());
Expand Down Expand Up @@ -240,7 +242,7 @@
sRho_tmp += (1.0 * signals[iCell] - mRho) * (1.0 * signals[iCell] - mRho);
}
sRho_tmp /= (1.0 * entries * entries);
float sRho = sqrt(sRho_tmp);

Check failure on line 245 in EventFiltering/PWGMM/multFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
if (mRho > 0) {
flat = sRho / mRho;
}
Expand Down Expand Up @@ -289,7 +291,7 @@
isOkvtxtrig = triggers[o2::fit::Triggers::bitVertex];
float t0_a = ft0.timeA();
float t0_c = ft0.timeC();
if (abs(t0_a) < 1. && abs(t0_c) < 1.) {

Check failure on line 294 in EventFiltering/PWGMM/multFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
isOkTimeFT0 = true;
}
multiplicity.fill(HIST("hT0C_time"), t0_c);
Expand All @@ -316,7 +318,7 @@

if (collision.has_foundFV0()) {
float RhoLattice[nCells];
for (Int_t iCh = 0; iCh < nCells; iCh++) {

Check failure on line 321 in EventFiltering/PWGMM/multFilter.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
RhoLattice[iCh] = 0;
}

Expand Down Expand Up @@ -358,6 +360,19 @@
return;
}

if (isTimeFrameBorderCut && !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) {
tags(false, false, false, false, false, false, false);
return;
}
if (isSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) {
tags(false, false, false, false, false, false, false);
return;
}
if (isGoodZvtxFT0vsPV && !collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) {
tags(false, false, false, false, false, false, false);
return;
}

multiplicity.fill(HIST("hMultFV0sel"), sumAmpFV0);
multiplicity.fill(HIST("hMultFV01to4Ringsel"), sumAmpFV01to4Ring);
multiplicity.fill(HIST("hMultFV05Ringsel"), sumAmpFV05Ring);
Expand Down Expand Up @@ -413,7 +428,7 @@

// Globaltracks

for (auto& track : tracks) {

Check failure on line 431 in EventFiltering/PWGMM/multFilter.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 (!mTrackSelector.IsSelected(track)) {
continue;
}
Expand Down
Loading