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
25 changes: 23 additions & 2 deletions PWGUD/Core/UPCTauCentralBarrelHelperRL.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
// 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.
///
/// \brief

/// \file UPCTauCentralBarrelHelperRL.h
/// \brief Personal helper file to analyze tau events from UPC collisions
/// \author Roman Lavicka, roman.lavicka@cern.ch
/// \since 27.10.2022
///

#ifndef PWGUD_CORE_UPCTAUCENTRALBARRELHELPERRL_H_
#define PWGUD_CORE_UPCTAUCENTRALBARRELHELPERRL_H_
Expand Down Expand Up @@ -73,7 +75,7 @@
nSigmaTPC[P_PROTON] = std::abs(trackPIDinfo.tpcNSigmaPr());
// Correction if TPC tuneOnData is wrong
if (isMC) {
for (int i = 0; i < 5; i++)

Check failure on line 78 in PWGUD/Core/UPCTauCentralBarrelHelperRL.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.
nSigmaTPC[i] -= nSigmaShift;
}
int enumChoiceTPC = std::distance(std::begin(nSigmaTPC),
Expand Down Expand Up @@ -140,15 +142,15 @@
int enumMyParticle(int valuePDG)
// reads pdg value and returns particle number as in enumMyParticle
{
if (std::abs(valuePDG) == 11) {

Check failure on line 145 in PWGUD/Core/UPCTauCentralBarrelHelperRL.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 145 in PWGUD/Core/UPCTauCentralBarrelHelperRL.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
return P_ELECTRON;
} else if (std::abs(valuePDG) == 13) {

Check failure on line 147 in PWGUD/Core/UPCTauCentralBarrelHelperRL.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 147 in PWGUD/Core/UPCTauCentralBarrelHelperRL.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
return P_MUON;
} else if (std::abs(valuePDG) == 211) {

Check failure on line 149 in PWGUD/Core/UPCTauCentralBarrelHelperRL.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 149 in PWGUD/Core/UPCTauCentralBarrelHelperRL.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
return P_PION;
} else if (std::abs(valuePDG) == 321) {

Check failure on line 151 in PWGUD/Core/UPCTauCentralBarrelHelperRL.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 151 in PWGUD/Core/UPCTauCentralBarrelHelperRL.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
return P_KAON;
} else if (std::abs(valuePDG) == 2212) {

Check failure on line 153 in PWGUD/Core/UPCTauCentralBarrelHelperRL.h

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
return P_PROTON;
} else {
printDebugMessage("PDG value not found in enumMyParticle. Returning -1.");
Expand All @@ -156,6 +158,25 @@
}
}

int trackPDGfromEnum(int trackEnum)
// reads pdg value and returns particle number as in enumMyParticle
{
if (trackEnum == P_ELECTRON) {
return 11;
} else if (trackEnum == P_MUON) {
return 13;
} else if (trackEnum == P_PION) {
return 211;
} else if (trackEnum == P_KAON) {
return 321;
} else if (trackEnum == P_PROTON) {
return 2212;
} else {
printDebugMessage("PDG value not found in enumMyParticle. Returning -1.");
return -1.;
}
}

float pt(float px, float py)
// Just a simple function to return pt
{
Expand Down
226 changes: 226 additions & 0 deletions PWGUD/DataModel/TwoTracksEventTables.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// 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.

///
/// \file TwoTracksEventTables.h
/// \author Roman Lavička
/// \since 2025-06-20
/// \brief A table to store information about events preselected to have exactly two tracks.
/// \brief Good for UPC gammagamma (->elel,mumu,tautau) and gammalead (vector mesons)
/// \brief If MC, careful with filling the mother
///

#ifndef PWGUD_DATAMODEL_TWOTRACKSEVENTTABLES_H_
#define PWGUD_DATAMODEL_TWOTRACKSEVENTTABLES_H_

#include "Framework/AnalysisDataModel.h"

namespace o2::aod
{
namespace two_tracks_tree
{
// event info
DECLARE_SOA_COLUMN(RunNumber, runNumber, int32_t);
DECLARE_SOA_COLUMN(Bc, bc, int);
DECLARE_SOA_COLUMN(TotalTracks, totalTracks, int);
DECLARE_SOA_COLUMN(NumContrib, numContrib, int);
DECLARE_SOA_COLUMN(GlobalNonPVtracks, globalNonPVtracks, int);
DECLARE_SOA_COLUMN(PosX, posX, float);
DECLARE_SOA_COLUMN(PosY, posY, float);
DECLARE_SOA_COLUMN(PosZ, posZ, float);
DECLARE_SOA_COLUMN(RecoMode, recoMode, int);
DECLARE_SOA_COLUMN(OccupancyInTime, occupancyInTime, int);
DECLARE_SOA_COLUMN(HadronicRate, hadronicRate, double);
DECLARE_SOA_COLUMN(Trs, trs, int);
DECLARE_SOA_COLUMN(Trofs, trofs, int);
DECLARE_SOA_COLUMN(Hmpr, hmpr, int);
DECLARE_SOA_COLUMN(Tfb, tfb, int);
DECLARE_SOA_COLUMN(ItsRofb, itsRofb, int);
DECLARE_SOA_COLUMN(Sbp, sbp, int);
DECLARE_SOA_COLUMN(ZvtxFT0vsPv, zvtxFT0vsPv, int);
DECLARE_SOA_COLUMN(VtxITSTPC, vtxITSTPC, int);
// FIT info
DECLARE_SOA_COLUMN(TotalFT0AmplitudeA, totalFT0AmplitudeA, float);
DECLARE_SOA_COLUMN(TotalFT0AmplitudeC, totalFT0AmplitudeC, float);
DECLARE_SOA_COLUMN(TotalFV0AmplitudeA, totalFV0AmplitudeA, float);
DECLARE_SOA_COLUMN(EnergyCommonZNA, energyCommonZNA, float);
DECLARE_SOA_COLUMN(EnergyCommonZNC, energyCommonZNC, float);
DECLARE_SOA_COLUMN(TimeFT0A, timeFT0A, float);
DECLARE_SOA_COLUMN(TimeFT0C, timeFT0C, float);
DECLARE_SOA_COLUMN(TimeFV0A, timeFV0A, float);
DECLARE_SOA_COLUMN(TimeZNA, timeZNA, float);
DECLARE_SOA_COLUMN(TimeZNC, timeZNC, float);
// tracks
DECLARE_SOA_COLUMN(TrkPx, trkPx, float[2]);
DECLARE_SOA_COLUMN(TrkPy, trkPy, float[2]);
DECLARE_SOA_COLUMN(TrkPz, trkPz, float[2]);
DECLARE_SOA_COLUMN(TrkSign, trkSign, int[2]);
DECLARE_SOA_COLUMN(TrkDCAxy, trkDCAxy, float[2]);
DECLARE_SOA_COLUMN(TrkDCAz, trkDCAz, float[2]);
DECLARE_SOA_COLUMN(TrkTimeRes, trkTimeRes, float[2]);
DECLARE_SOA_COLUMN(Trk1ITSclusterSizes, trk1ITSclusterSizes, uint32_t);
DECLARE_SOA_COLUMN(Trk2ITSclusterSizes, trk2ITSclusterSizes, uint32_t);
DECLARE_SOA_COLUMN(TrkTPCsignal, trkTPCsignal, float[2]);
DECLARE_SOA_COLUMN(TrkTPCnSigmaEl, trkTPCnSigmaEl, float[2]);
DECLARE_SOA_COLUMN(TrkTPCnSigmaMu, trkTPCnSigmaMu, float[2]);
DECLARE_SOA_COLUMN(TrkTPCnSigmaPi, trkTPCnSigmaPi, float[2]);
DECLARE_SOA_COLUMN(TrkTPCnSigmaKa, trkTPCnSigmaKa, float[2]);
DECLARE_SOA_COLUMN(TrkTPCnSigmaPr, trkTPCnSigmaPr, float[2]);
DECLARE_SOA_COLUMN(TrkTPCinnerParam, trkTPCinnerParam, float[2]);
DECLARE_SOA_COLUMN(TrkTOFsignal, trkTOFsignal, float[2]);
DECLARE_SOA_COLUMN(TrkTOFnSigmaEl, trkTOFnSigmaEl, float[2]);
DECLARE_SOA_COLUMN(TrkTOFnSigmaMu, trkTOFnSigmaMu, float[2]);
DECLARE_SOA_COLUMN(TrkTOFnSigmaPi, trkTOFnSigmaPi, float[2]);
DECLARE_SOA_COLUMN(TrkTOFnSigmaKa, trkTOFnSigmaKa, float[2]);
DECLARE_SOA_COLUMN(TrkTOFnSigmaPr, trkTOFnSigmaPr, float[2]);
DECLARE_SOA_COLUMN(TrkTOFexpMom, trkTOFexpMom, float[2]);
// truth event
DECLARE_SOA_COLUMN(TrueChannel, trueChannel, int);
DECLARE_SOA_COLUMN(TrueHasRecoColl, trueHasRecoColl, bool);
DECLARE_SOA_COLUMN(TruePosX, truePosX, float);
DECLARE_SOA_COLUMN(TruePosY, truePosY, float);
DECLARE_SOA_COLUMN(TruePosZ, truePosZ, float);
// truth particles
DECLARE_SOA_COLUMN(TrueMotherPx, trueMotherPx, float[2]);
DECLARE_SOA_COLUMN(TrueMotherPy, trueMotherPy, float[2]);
DECLARE_SOA_COLUMN(TrueMotherPz, trueMotherPz, float[2]);
DECLARE_SOA_COLUMN(TrueDaugPx, trueDaugPx, float[2]);
DECLARE_SOA_COLUMN(TrueDaugPy, trueDaugPy, float[2]);
DECLARE_SOA_COLUMN(TrueDaugPz, trueDaugPz, float[2]);
DECLARE_SOA_COLUMN(TrueDaugPdgCode, trueDaugPdgCode, int[2]);
// additional info
DECLARE_SOA_COLUMN(ProblematicEvent, problematicEvent, bool);

} // namespace two_tracks_tree
DECLARE_SOA_TABLE(TwoTracks, "AOD", "TWOTRACK",
two_tracks_tree::RunNumber,
two_tracks_tree::Bc,
two_tracks_tree::TotalTracks,
two_tracks_tree::NumContrib,
two_tracks_tree::GlobalNonPVtracks,
two_tracks_tree::PosX,
two_tracks_tree::PosY,
two_tracks_tree::PosZ,
two_tracks_tree::RecoMode,
two_tracks_tree::OccupancyInTime,
two_tracks_tree::HadronicRate,
two_tracks_tree::Trs,
two_tracks_tree::Trofs,
two_tracks_tree::Hmpr,
two_tracks_tree::Tfb,
two_tracks_tree::ItsRofb,
two_tracks_tree::Sbp,
two_tracks_tree::ZvtxFT0vsPv,
two_tracks_tree::VtxITSTPC,
two_tracks_tree::TotalFT0AmplitudeA,
two_tracks_tree::TotalFT0AmplitudeC,
two_tracks_tree::TotalFV0AmplitudeA,
two_tracks_tree::EnergyCommonZNA,
two_tracks_tree::EnergyCommonZNC,
two_tracks_tree::TimeFT0A,
two_tracks_tree::TimeFT0C,
two_tracks_tree::TimeFV0A,
two_tracks_tree::TimeZNA,
two_tracks_tree::TimeZNC,
two_tracks_tree::TrkPx,
two_tracks_tree::TrkPy,
two_tracks_tree::TrkPz,
two_tracks_tree::TrkSign,
two_tracks_tree::TrkDCAxy,
two_tracks_tree::TrkDCAz,
two_tracks_tree::TrkTimeRes,
two_tracks_tree::Trk1ITSclusterSizes,
two_tracks_tree::Trk2ITSclusterSizes,
two_tracks_tree::TrkTPCsignal,
two_tracks_tree::TrkTPCnSigmaEl,
two_tracks_tree::TrkTPCnSigmaMu,
two_tracks_tree::TrkTPCnSigmaPi,
two_tracks_tree::TrkTPCnSigmaKa,
two_tracks_tree::TrkTPCnSigmaPr,
two_tracks_tree::TrkTPCinnerParam,
two_tracks_tree::TrkTOFsignal,
two_tracks_tree::TrkTOFnSigmaEl,
two_tracks_tree::TrkTOFnSigmaMu,
two_tracks_tree::TrkTOFnSigmaPi,
two_tracks_tree::TrkTOFnSigmaKa,
two_tracks_tree::TrkTOFnSigmaPr,
two_tracks_tree::TrkTOFexpMom);

DECLARE_SOA_TABLE(TrueTwoTracks, "AOD", "TRUETWOTRACK",
two_tracks_tree::RunNumber,
two_tracks_tree::Bc,
two_tracks_tree::TotalTracks,
two_tracks_tree::NumContrib,
two_tracks_tree::GlobalNonPVtracks,
two_tracks_tree::PosX,
two_tracks_tree::PosY,
two_tracks_tree::PosZ,
two_tracks_tree::RecoMode,
two_tracks_tree::OccupancyInTime,
two_tracks_tree::HadronicRate,
two_tracks_tree::Trs,
two_tracks_tree::Trofs,
two_tracks_tree::Hmpr,
two_tracks_tree::Tfb,
two_tracks_tree::ItsRofb,
two_tracks_tree::Sbp,
two_tracks_tree::ZvtxFT0vsPv,
two_tracks_tree::VtxITSTPC,
two_tracks_tree::TotalFT0AmplitudeA,
two_tracks_tree::TotalFT0AmplitudeC,
two_tracks_tree::TotalFV0AmplitudeA,
two_tracks_tree::EnergyCommonZNA,
two_tracks_tree::EnergyCommonZNC,
two_tracks_tree::TimeFT0A,
two_tracks_tree::TimeFT0C,
two_tracks_tree::TimeFV0A,
two_tracks_tree::TimeZNA,
two_tracks_tree::TimeZNC,
two_tracks_tree::TrkPx,
two_tracks_tree::TrkPy,
two_tracks_tree::TrkPz,
two_tracks_tree::TrkSign,
two_tracks_tree::TrkDCAxy,
two_tracks_tree::TrkDCAz,
two_tracks_tree::TrkTimeRes,
two_tracks_tree::Trk1ITSclusterSizes,
two_tracks_tree::Trk2ITSclusterSizes,
two_tracks_tree::TrkTPCsignal,
two_tracks_tree::TrkTPCnSigmaEl,
two_tracks_tree::TrkTPCnSigmaMu,
two_tracks_tree::TrkTPCnSigmaPi,
two_tracks_tree::TrkTPCnSigmaKa,
two_tracks_tree::TrkTPCnSigmaPr,
two_tracks_tree::TrkTPCinnerParam,
two_tracks_tree::TrkTOFsignal,
two_tracks_tree::TrkTOFnSigmaEl,
two_tracks_tree::TrkTOFnSigmaMu,
two_tracks_tree::TrkTOFnSigmaPi,
two_tracks_tree::TrkTOFnSigmaKa,
two_tracks_tree::TrkTOFnSigmaPr,
two_tracks_tree::TrkTOFexpMom,
two_tracks_tree::TrueChannel,
two_tracks_tree::TrueHasRecoColl,
two_tracks_tree::TruePosX,
two_tracks_tree::TruePosY,
two_tracks_tree::TruePosZ,
two_tracks_tree::TrueMotherPx,
two_tracks_tree::TrueMotherPy,
two_tracks_tree::TrueMotherPz,
two_tracks_tree::TrueDaugPx,
two_tracks_tree::TrueDaugPy,
two_tracks_tree::TrueDaugPz,
two_tracks_tree::TrueDaugPdgCode,
two_tracks_tree::ProblematicEvent);

} // namespace o2::aod

#endif // PWGUD_DATAMODEL_TWOTRACKSEVENTTABLES_H_
5 changes: 5 additions & 0 deletions PWGUD/TableProducer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ o2physics_add_dpl_workflow(tau-event-table-producer
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(two-tracks-event-table-producer
SOURCES twoTracksEventTableProducer.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(fwdtrack-propagation
SOURCES fwdTrackPropagation.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::GlobalTracking
Expand Down
29 changes: 25 additions & 4 deletions PWGUD/TableProducer/tauEventTableProducer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@
#include "PWGUD/DataModel/TauEventTables.h"
#include "PWGUD/Core/SGSelector.h"

// ROOT headers
#include "TLorentzVector.h"
#include "TPDGCode.h"

using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;
Expand Down Expand Up @@ -77,6 +73,11 @@ struct TauEventTableProducer {
Configurable<float> cutTrueGapSideFT0C{"cutTrueGapSideFT0C", 50., "FT0C threshold for SG selector"};
Configurable<float> cutTrueGapSideZDC{"cutTrueGapSideZDC", 10000., "ZDC threshold for SG selector. 0 is <1n, 4.2 is <2n, 6.7 is <3n, 9.5 is <4n, 12.5 is <5n"};
Configurable<float> cutFITtime{"cutFITtime", 40., "Maximum FIT time allowed. Default is 40ns"};
Configurable<bool> cutEvTFb{"cutEvTFb", true, {"Event selection bit kNoTimeFrameBorder"}};
Configurable<bool> cutEvITSROFb{"cutEvITSROFb", true, {"Event selection bit kNoITSROFrameBorder"}};
Configurable<bool> cutEvSbp{"cutEvSbp", true, {"Event selection bit kNoSameBunchPileup"}};
Configurable<bool> cutEvZvtxFT0vPV{"cutEvZvtxFT0vPV", false, {"Event selection bit kIsGoodZvtxFT0vsPV"}};
Configurable<bool> cutEvVtxITSTPC{"cutEvVtxITSTPC", true, {"Event selection bit kIsVertexITSTPC"}};
Configurable<float> cutEvOccupancy{"cutEvOccupancy", 100000., "Maximum allowed occupancy"};
Configurable<bool> cutEvTrs{"cutEvTrs", false, {"Event selection bit kNoCollInTimeRangeStandard"}};
Configurable<bool> cutEvTrofs{"cutEvTrofs", false, {"Event selection bit kNoCollInRofStandard"}};
Expand Down Expand Up @@ -156,6 +157,26 @@ struct TauEventTableProducer {
bool isGoodROFtime(C const& coll)
{

// kNoTimeFrameBorder
if (cutSample.cutEvTFb && !coll.tfb())
return false;

// kNoITSROFrameBorder
if (cutSample.cutEvITSROFb && !coll.itsROFb())
return false;

// kNoSameBunchPileup
if (cutSample.cutEvSbp && !coll.sbp())
return false;

// kIsGoodZvtxFT0vsPV
if (cutSample.cutEvZvtxFT0vPV && !coll.zVtxFT0vPV())
return false;

// kIsVertexITSTPC
if (cutSample.cutEvVtxITSTPC && !coll.vtxITSTPC())
return false;

// Occupancy
if (coll.occupancyInTime() > cutSample.cutEvOccupancy)
return false;
Expand Down
Loading
Loading