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
23 changes: 11 additions & 12 deletions PWGUD/Core/SGTrackSelector.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 PWGUD/Core/SGTrackSelector.h

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 PWGUD/Core/SGTrackSelector.h

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 PWGUD/Core/SGTrackSelector.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.
// \Single Gap Event Analyzer
// \author Sasha Bylinkin, alexander.bylinkin@gmail.com
// \since April 2023
Expand All @@ -16,27 +16,26 @@
#ifndef PWGUD_CORE_SGTRACKSELECTOR_H_
#define PWGUD_CORE_SGTRACKSELECTOR_H_

#include <vector>
#include "Framework/runDataProcessing.h"
#include "Framework/AnalysisTask.h"
#include "PWGUD/Core/SGSelector.h"
#include "PWGUD/DataModel/UDTables.h"

#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "Framework/O2DatabasePDGPlugin.h"
#include <iostream>
#include "PWGUD/DataModel/UDTables.h"
#include "PWGUD/Core/SGSelector.h"
#include <TString.h>
#include "Framework/runDataProcessing.h"

#include "TVector3.h"
using namespace std;
using namespace o2;
using namespace o2::aod;
using namespace o2::framework;
using namespace o2::framework::expressions;
#include <TString.h>

#include <iostream>

Check failure on line 30 in PWGUD/Core/SGTrackSelector.h

View workflow job for this annotation

GitHub Actions / O2 linter

[include-iostream]

Do not include iostream. Use O2 logging instead.
#include <vector>

template <typename T>
int trackselector(const T& track, const std::vector<float>& params)
{
// Ensure the params vector contains all the necessary parameters

if (params.size() < 8) {

Check failure on line 38 in PWGUD/Core/SGTrackSelector.h

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.
throw std::runtime_error("Insufficient parameters provided");
}
TVector3 a;
Expand All @@ -46,7 +45,7 @@
if (std::abs(track.dcaZ()) > params[1])
return 0;
if (!params[2]) {
if (std::abs(track.dcaXY()) > .0105 + .035 / pow(a.Pt(), 1.1))

Check failure on line 48 in PWGUD/Core/SGTrackSelector.h

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.

Check failure on line 48 in PWGUD/Core/SGTrackSelector.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
return 0;
} else {
if (std::abs(track.dcaXY()) > params[2])
Expand Down Expand Up @@ -83,11 +82,11 @@
tpi = std::abs(track.tofNSigmaPi());
tka = std::abs(track.tofNSigmaKa());
tpr = std::abs(track.tofNSigmaPr());
if (std::sqrt(pi * pi + tpi * tpi) < 2 && std::sqrt(pi * pi + tpi * tpi) < std::sqrt(ka * ka + tka * tka) && std::sqrt(pi * pi + tpi * tpi) < std::sqrt(pr * pr + tpr * tpr))

Check failure on line 85 in PWGUD/Core/SGTrackSelector.h

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.
pid = 1;
else if (std::sqrt(ka * ka + tka * tka) < 2 && std::sqrt(pi * pi + tpi * tpi) > std::sqrt(ka * ka + tka * tka) && std::sqrt(ka * ka + tka * tka) < std::sqrt(pr * pr + tpr * tpr))

Check failure on line 87 in PWGUD/Core/SGTrackSelector.h

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.
pid = 2;
else if (std::sqrt(pr * pr + tpr * tpr) < 2 && std::sqrt(pr * pr + tpr * tpr) < std::sqrt(ka * ka + tka * tka) && std::sqrt(pi * pi + tpi * tpi) > std::sqrt(pr * pr + tpr * tpr))

Check failure on line 89 in PWGUD/Core/SGTrackSelector.h

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.
pid = 3;
}
return pid;
Expand Down
36 changes: 18 additions & 18 deletions PWGUD/Core/UDHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@
#ifndef PWGUD_CORE_UDHELPERS_H_
#define PWGUD_CORE_UDHELPERS_H_

#include <vector>
#include <bitset>
#include "PWGUD/Core/DGCutparHolder.h"
#include "PWGUD/Core/UPCHelpers.h"

#include "TLorentzVector.h"
#include "Framework/Logger.h"
#include "DataFormatsFT0/Digit.h"
#include "DataFormatsFIT/Triggers.h"
#include "CommonConstants/LHCConstants.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "Common/DataModel/PIDResponse.h"
#include "PWGUD/Core/UPCHelpers.h"
#include "PWGUD/Core/DGCutparHolder.h"
#include "Common/DataModel/TrackSelectionTables.h"

using namespace o2;
using namespace o2::framework;
#include "CommonConstants/LHCConstants.h"
#include "DataFormatsFIT/Triggers.h"
#include "DataFormatsFT0/Digit.h"
#include "Framework/Logger.h"

#include "TLorentzVector.h"

#include <bitset>
#include <vector>

// namespace with helpers for UD framework
namespace udhelpers
Expand Down Expand Up @@ -674,7 +674,7 @@ void fillBGBBFlags(upchelpers::FITInfo& info, uint64_t const& minbc, BCR const&
// -----------------------------------------------------------------------------
// extract FIT information
template <typename BC, typename BCS>
void getFITinfo(upchelpers::FITInfo& info, BC& bc, BCS const& bcs, aod::FT0s const& ft0s, aod::FV0As const& fv0as, aod::FDDs const& fdds)
void getFITinfo(upchelpers::FITInfo& info, BC& bc, BCS const& bcs, o2::aod::FT0s const& ft0s, o2::aod::FV0As const& fv0as, o2::aod::FDDs const& fdds)
{
// FV0A
if (bc.has_foundFV0()) {
Expand Down Expand Up @@ -713,24 +713,24 @@ void getFITinfo(upchelpers::FITInfo& info, BC& bc, BCS const& bcs, aod::FT0s con

// -----------------------------------------------------------------------------
template <typename T>
bool cleanZDC(T const& bc, aod::Zdcs& zdcs, std::vector<float>& /*lims*/, SliceCache& cache)
bool cleanZDC(T const& bc, o2::aod::Zdcs& zdcs, std::vector<float>& /*lims*/, o2::framework::SliceCache& cache)
{
const auto& ZdcBC = zdcs.sliceByCached(aod::zdc::bcId, bc.globalIndex(), cache);
const auto& ZdcBC = zdcs.sliceByCached(o2::aod::zdc::bcId, bc.globalIndex(), cache);
return (ZdcBC.size() == 0);
}

// -----------------------------------------------------------------------------
template <typename T>
bool cleanCalo(T const& bc, aod::Calos& calos, std::vector<float>& /*lims*/, SliceCache& cache)
bool cleanCalo(T const& bc, o2::aod::Calos& calos, std::vector<float>& /*lims*/, o2::framework::SliceCache& cache)
{
const auto& CaloBC = calos.sliceByCached(aod::calo::bcId, bc.globalIndex(), cache);
const auto& CaloBC = calos.sliceByCached(o2::aod::calo::bcId, bc.globalIndex(), cache);
return (CaloBC.size() == 0);
}

// -----------------------------------------------------------------------------
// check if all tracks come from same MCCollision
template <typename T>
int64_t sameMCCollision(T tracks, aod::McCollisions, aod::McParticles)
int64_t sameMCCollision(T tracks, o2::aod::McCollisions, o2::aod::McParticles)
{
int64_t colID = -1;
for (auto const& track : tracks) {
Expand Down
15 changes: 8 additions & 7 deletions PWGUD/Core/UPCHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@
#ifndef PWGUD_CORE_UPCHELPERS_H_
#define PWGUD_CORE_UPCHELPERS_H_

#include "Framework/AnalysisDataModel.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/CCDB/EventSelectionParams.h"
#include "CommonConstants/LHCConstants.h"
#include "TLorentzVector.h"
#include "UPCCutparHolder.h"

#include "PWGUD/DataModel/UDTables.h"

using namespace o2::framework;
using namespace o2::framework::expressions;
#include "Common/CCDB/EventSelectionParams.h"
#include "Common/DataModel/EventSelection.h"

#include "CommonConstants/LHCConstants.h"
#include "Framework/AnalysisDataModel.h"

#include "TLorentzVector.h"

using BCsWithBcSels = o2::soa::Join<o2::aod::BCs, o2::aod::BcSels>;

Expand Down
10 changes: 3 additions & 7 deletions PWGUD/Core/UPCJpsiCentralBarrelCorrHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,11 @@
#ifndef PWGUD_CORE_UPCJPSICENTRALBARRELCORRHELPER_H_
#define PWGUD_CORE_UPCJPSICENTRALBARRELCORRHELPER_H_

#include <vector>
#include <algorithm>
#include "CommonConstants/MathConstants.h"
#include <random>

using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;
using namespace std;
#include <algorithm>
#include <random>
#include <vector>

/*enum ParticleType {
P_ELECTRON = 0,
Expand Down
48 changes: 22 additions & 26 deletions PWGUD/Core/UPCPairCuts.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,14 @@
#ifndef PWGUD_CORE_UPCPAIRCUTS_H_
#define PWGUD_CORE_UPCPAIRCUTS_H_

#include <cmath>
#include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h"

#include "Framework/Logger.h"
#include "Framework/HistogramRegistry.h"
#include "CommonConstants/MathConstants.h"
#include "CommonConstants/PhysicsConstants.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/Logger.h"

#include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h"

using namespace o2;
using namespace o2::framework;
using namespace constants::math;
#include <cmath>

class UPCPairCuts
{
Expand All @@ -39,14 +35,14 @@ class UPCPairCuts
Rho,
ParticlesLastEntry };

void setHistogramRegistry(HistogramRegistry* registry) { histogramRegistry = registry; }
void setHistogramRegistry(o2::framework::HistogramRegistry* registry) { histogramRegistry = registry; }

void setPairCut(Particle particle, float cut)
{
LOGF(info, "Enabled pair cut for %d with value %f", static_cast<int>(particle), cut);
mCuts[particle] = cut;
if (histogramRegistry != nullptr && histogramRegistry->contains(HIST("ControlConvResonances")) == false) {
histogramRegistry->add("ControlConvResonances", "", {HistType::kTH2F, {{6, -0.5, 5.5, "id"}, {500, -0.5, 0.5, "delta mass"}}});
histogramRegistry->add("ControlConvResonances", "", {o2::framework::HistType::kTH2F, {{6, -0.5, 5.5, "id"}, {500, -0.5, 0.5, "delta mass"}}});
}
}

Expand All @@ -57,7 +53,7 @@ class UPCPairCuts
mTwoTrackRadius = radius;

if (histogramRegistry != nullptr && histogramRegistry->contains(HIST("TwoTrackDistancePt_0")) == false) {
histogramRegistry->add("TwoTrackDistancePt_0", "", {HistType::kTH3F, {{100, -0.15, 0.15, "#Delta#eta"}, {100, -0.05, 0.05, "#Delta#varphi^{*}_{min}"}, {20, 0, 10, "#Delta p_{T}"}}});
histogramRegistry->add("TwoTrackDistancePt_0", "", {o2::framework::HistType::kTH3F, {{100, -0.15, 0.15, "#Delta#eta"}, {100, -0.05, 0.05, "#Delta#varphi^{*}_{min}"}, {20, 0, 10, "#Delta p_{T}"}}});
histogramRegistry->addClone("TwoTrackDistancePt_0", "TwoTrackDistancePt_1");
}
}
Expand All @@ -74,7 +70,7 @@ class UPCPairCuts
float mTwoTrackRadius = 0.8f; // radius at which the two track cuts are applied
int magField = 5; // magField: B field in kG

HistogramRegistry* histogramRegistry = nullptr; // if set, control histograms are stored here
o2::framework::HistogramRegistry* histogramRegistry = nullptr; // if set, control histograms are stored here

template <typename T>
bool conversionCut(T const& track1, T const& track2, Particle conv, double cut);
Expand Down Expand Up @@ -290,20 +286,20 @@ double UPCPairCuts::getInvMassSquaredFast(T const& track1, double m0_1, T const&

// fold onto 0...pi
float deltaPhi = std::fabs(phi1 - phi2);
while (deltaPhi > TwoPI) {
deltaPhi -= TwoPI;
while (deltaPhi > o2::constants::math::TwoPI) {
deltaPhi -= o2::constants::math::TwoPI;
}
if (deltaPhi > PI) {
deltaPhi = TwoPI - deltaPhi;
if (deltaPhi > o2::constants::math::PI) {
deltaPhi = o2::constants::math::TwoPI - deltaPhi;
}

float cosDeltaPhi = 0;
if (deltaPhi < PI / 3.0f) {
if (deltaPhi < o2::constants::math::PI / 3.0f) {
cosDeltaPhi = 1.0 - deltaPhi * deltaPhi / 2 + deltaPhi * deltaPhi * deltaPhi * deltaPhi / 24;
} else if (deltaPhi < 2.0f * PI / 3.0f) {
cosDeltaPhi = -(deltaPhi - PI / 2) + 1.0 / 6 * std::pow((deltaPhi - PI / 2), 3);
} else if (deltaPhi < 2.0f * o2::constants::math::PI / 3.0f) {
cosDeltaPhi = -(deltaPhi - o2::constants::math::PI / 2) + 1.0 / 6 * std::pow((deltaPhi - o2::constants::math::PI / 2), 3);
} else {
cosDeltaPhi = -1.0f + 1.0f / 2.0f * (deltaPhi - PI) * (deltaPhi - PI) - 1.0f / 24.0f * std::pow(deltaPhi - PI, 4.0f);
cosDeltaPhi = -1.0f + 1.0f / 2.0f * (deltaPhi - o2::constants::math::PI) * (deltaPhi - o2::constants::math::PI) - 1.0f / 24.0f * std::pow(deltaPhi - o2::constants::math::PI, 4.0f);
}

double mass2 = m0_1 * m0_1 + m0_2 * m0_2 + 2.0f * (std::sqrt(e1squ * e2squ) - (pt1 * pt2 * (cosDeltaPhi + 1.0f / tantheta1 / tantheta2)));
Expand All @@ -330,14 +326,14 @@ float UPCPairCuts::getDPhiStar(T const& track1, T const& track2, float radius, i

float dphistar = phi1 - phi2 - charge1 * std::asin(0.015 * magField * radius / pt1) + charge2 * std::asin(0.015 * magField * radius / pt2);

if (dphistar > PI) {
dphistar = TwoPI - dphistar;
if (dphistar > o2::constants::math::PI) {
dphistar = o2::constants::math::TwoPI - dphistar;
}
if (dphistar < -PI) {
dphistar = -TwoPI - dphistar;
if (dphistar < -o2::constants::math::PI) {
dphistar = -o2::constants::math::TwoPI - dphistar;
}
if (dphistar > PI) { // might look funny but is needed
dphistar = TwoPI - dphistar;
if (dphistar > o2::constants::math::PI) { // might look funny but is needed
dphistar = o2::constants::math::TwoPI - dphistar;
}

return dphistar;
Expand Down
11 changes: 6 additions & 5 deletions PWGUD/Core/decayTree.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#include <utility>
#include "decayTree.h"

#include <rapidjson/document.h>
#include <rapidjson/filereadstream.h>

#include <cstdio>
#include <map>
#include <string>
#include <utility>
#include <vector>

#include "rapidjson/document.h"
#include "rapidjson/filereadstream.h"
#include "decayTree.h"

using namespace rapidjson;

// -----------------------------------------------------------------------------
Expand Down
Loading
Loading