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
19 changes: 5 additions & 14 deletions PWGDQ/Core/VarManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@
#include <cmath>
#include <complex>
#include <cstdint>
#include <iostream>

Check failure on line 68 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[include-iostream]

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

using std::complex;

Check failure on line 73 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[import-std-name]

Do not import names from the std namespace in headers.
using std::cout;

Check failure on line 74 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[import-std-name]

Do not import names from the std namespace in headers.
using std::endl;

Check failure on line 75 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[import-std-name]

Do not import names from the std namespace in headers.

using SMatrix55 = ROOT::Math::SMatrix<double, 5, 5, ROOT::Math::MatRepSym<double, 5>>;
using SMatrix5 = ROOT::Math::SVector<double, 5>;
Expand Down Expand Up @@ -1501,9 +1501,9 @@
}
if constexpr ((fillMap & MuonCov) > 0 || (fillMap & ReducedMuonCov) > 0) {
o2::dataformats::GlobalFwdTrack propmuon = PropagateMuon(muontrack, collision);
double px = propmuon.getP() * sin(M_PI / 2 - atan(mfttrack.tgl())) * cos(mfttrack.phi());

Check failure on line 1504 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
double py = propmuon.getP() * sin(M_PI / 2 - atan(mfttrack.tgl())) * sin(mfttrack.phi());

Check failure on line 1505 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
double pz = propmuon.getP() * cos(M_PI / 2 - atan(mfttrack.tgl()));

Check failure on line 1506 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
double pt = std::sqrt(std::pow(px, 2) + std::pow(py, 2));
values[kX] = mfttrack.x();
values[kY] = mfttrack.y();
Expand Down Expand Up @@ -1668,20 +1668,11 @@
}

if constexpr ((fillMap & CollisionMult) > 0 || (fillMap & ReducedEventExtended) > 0) {
if constexpr ((fillMap & RapidityGapFilter) > 0) {
// UPC: Use the FIT signals from the nearest BC with FIT amplitude above threshold
values[kMultFV0A] = event.newBcMultFV0A();
values[kMultFT0A] = event.newBcMultFT0A();
values[kMultFT0C] = event.newBcMultFT0C();
values[kMultFDDA] = event.newBcMultFDDA();
values[kMultFDDC] = event.newBcMultFDDC();
} else {
values[kMultFV0A] = event.multFV0A();
values[kMultFT0A] = event.multFT0A();
values[kMultFT0C] = event.multFT0C();
values[kMultFDDA] = event.multFDDA();
values[kMultFDDC] = event.multFDDC();
}
values[kMultFV0A] = event.multFV0A();
values[kMultFT0A] = event.multFT0A();
values[kMultFT0C] = event.multFT0C();
values[kMultFDDA] = event.multFDDA();
values[kMultFDDC] = event.multFDDC();
values[kMultTPC] = event.multTPC();
values[kMultFV0C] = event.multFV0C();
values[kMultZNA] = event.multZNA();
Expand Down Expand Up @@ -2048,7 +2039,7 @@
trackPar.propagateParamToDCA({collision.posX(), collision.posY(), collision.posZ()}, fgMagField, &dca);

// if it is a displaced track longitudinally, add it to the track vector
if (abs(dca[0]) < 3.0 && abs(dca[1]) > 4.0) {

Check failure on line 2042 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
if (track.tgl() > 0.1) {
tracksP.push_back(track.z());
}
Expand Down Expand Up @@ -3922,10 +3913,10 @@
values[kVertexingLxyErr] = (KFPV.GetCovariance(0) + KFGeoTwoProng.GetCovariance(0)) * dxPair2PV * dxPair2PV + (KFPV.GetCovariance(2) + KFGeoTwoProng.GetCovariance(2)) * dyPair2PV * dyPair2PV + 2 * ((KFPV.GetCovariance(1) + KFGeoTwoProng.GetCovariance(1)) * dxPair2PV * dyPair2PV);
values[kVertexingLzErr] = (KFPV.GetCovariance(5) + KFGeoTwoProng.GetCovariance(5)) * dzPair2PV * dzPair2PV;
values[kVertexingLxyzErr] = (KFPV.GetCovariance(0) + KFGeoTwoProng.GetCovariance(0)) * dxPair2PV * dxPair2PV + (KFPV.GetCovariance(2) + KFGeoTwoProng.GetCovariance(2)) * dyPair2PV * dyPair2PV + (KFPV.GetCovariance(5) + KFGeoTwoProng.GetCovariance(5)) * dzPair2PV * dzPair2PV + 2 * ((KFPV.GetCovariance(1) + KFGeoTwoProng.GetCovariance(1)) * dxPair2PV * dyPair2PV + (KFPV.GetCovariance(3) + KFGeoTwoProng.GetCovariance(3)) * dxPair2PV * dzPair2PV + (KFPV.GetCovariance(4) + KFGeoTwoProng.GetCovariance(4)) * dyPair2PV * dzPair2PV);
if (fabs(values[kVertexingLxy]) < 1.e-8f)

Check failure on line 3916 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
values[kVertexingLxy] = 1.e-8f;
values[kVertexingLxyErr] = values[kVertexingLxyErr] < 0. ? 1.e8f : std::sqrt(values[kVertexingLxyErr]) / values[kVertexingLxy];
if (fabs(values[kVertexingLz]) < 1.e-8f)

Check failure on line 3919 in PWGDQ/Core/VarManager.h

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
values[kVertexingLz] = 1.e-8f;
values[kVertexingLzErr] = values[kVertexingLzErr] < 0. ? 1.e8f : std::sqrt(values[kVertexingLzErr]) / values[kVertexingLz];
if (fabs(values[kVertexingLxyz]) < 1.e-8f)
Expand Down
20 changes: 2 additions & 18 deletions PWGDQ/DataModel/ReducedInfoTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,31 +36,15 @@ namespace o2::aod
namespace dqppfilter
{
DECLARE_SOA_COLUMN(EventFilter, eventFilter, uint64_t); //! Bit-field used for the high level event triggering
DECLARE_SOA_COLUMN(NewBcMultFT0A, newBcMultFT0A, float); //! sum of amplitudes on A side of FT0
DECLARE_SOA_COLUMN(NewBcMultFT0C, newBcMultFT0C, float); //! sum of amplitudes on C side of FT0
DECLARE_SOA_COLUMN(NewBcMultFDDA, newBcMultFDDA, float); //! sum of amplitudes on A side of FDD
DECLARE_SOA_COLUMN(NewBcMultFDDC, newBcMultFDDC, float); //! sum of amplitudes on C side of FDD
DECLARE_SOA_COLUMN(NewBcMultFV0A, newBcMultFV0A, float); //! sum of amplitudes on A side of FDD
DECLARE_SOA_COLUMN(NewBcIndex, newBcIndex, uint64_t); //! globalIndex of the new BC determined in filterPbPb
} // namespace dqppfilter

DECLARE_SOA_TABLE(DQEventFilter, "AOD", "EVENTFILTER", //! Store event-level decisions (DQ high level triggers)
dqppfilter::EventFilter);

DECLARE_SOA_TABLE(DQRapidityGapFilter, "AOD", "RAPIDITYGAPFILTER",
dqppfilter::EventFilter,
dqppfilter::NewBcMultFT0A,
dqppfilter::NewBcMultFT0C,
dqppfilter::NewBcMultFDDA,
dqppfilter::NewBcMultFDDC,
dqppfilter::NewBcMultFV0A,
zdc::EnergyCommonZNA,
zdc::EnergyCommonZNC,
zdc::EnergyCommonZPA,
zdc::EnergyCommonZPC,
zdc::TimeZNA,
zdc::TimeZNC,
zdc::TimeZPA,
zdc::TimeZPC);
dqppfilter::NewBcIndex);

namespace reducedevent
{
Expand Down
26 changes: 5 additions & 21 deletions PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -598,13 +598,6 @@ struct TableMakerMC {
}
(reinterpret_cast<TH2I*>(fStatsList->At(0)))->Fill(1.0, static_cast<float>(o2::aod::evsel::kNsel));

// apply the event filter
if constexpr ((TEventFillMap & VarManager::ObjTypes::RapidityGapFilter) > 0) {
if (!collision.eventFilter()) {
continue;
}
}

auto bc = collision.template bc_as<BCsWithTimestamps>();
// store the selection decisions
uint64_t tag = static_cast<uint64_t>(0);
Expand Down Expand Up @@ -664,20 +657,11 @@ struct TableMakerMC {
multZNC = collision.multZNC();
multTracklets = collision.multTracklets();
multTracksPV = collision.multNTracksPV();
if constexpr ((TEventFillMap & VarManager::ObjTypes::RapidityGapFilter) > 0) {
// Use the FIT signals from the nearest BC with FIT amplitude above threshold
multFV0A = collision.newBcMultFV0A();
multFT0A = collision.newBcMultFT0A();
multFT0C = collision.newBcMultFT0C();
multFDDA = collision.newBcMultFDDA();
multFDDC = collision.newBcMultFDDC();
} else {
multFV0A = collision.multFV0A();
multFT0A = collision.multFT0A();
multFT0C = collision.multFT0C();
multFDDA = collision.multFDDA();
multFDDC = collision.multFDDC();
}
multFV0A = collision.multFV0A();
multFT0A = collision.multFT0A();
multFT0C = collision.multFT0C();
multFDDA = collision.multFDDA();
multFDDC = collision.multFDDC();
}
if constexpr ((TEventFillMap & VarManager::ObjTypes::CollisionCent) > 0) {
centFT0C = collision.centFT0C();
Expand Down
52 changes: 29 additions & 23 deletions PWGDQ/TableProducer/tableMaker_withAssoc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,10 @@ struct TableMaker {
Partition<MyBarrelTracksWithCovNoTOF> tracksPosWithCovNoTOF = (((aod::track::flags & static_cast<uint32_t>(o2::aod::track::PVContributor)) == static_cast<uint32_t>(o2::aod::track::PVContributor)) && (aod::track::tgl > static_cast<float>(0.05)));
Partition<MyBarrelTracksWithCovNoTOF> tracksNegWithCovNoTOF = (((aod::track::flags & static_cast<uint32_t>(o2::aod::track::PVContributor)) == static_cast<uint32_t>(o2::aod::track::PVContributor)) && (aod::track::tgl < static_cast<float>(-0.05)));

Preslice<MyBarrelTracksWithCov> presliceWithCov = aod::track::collisionId;
Partition<MyBarrelTracksWithCov> tracksPosWithCov = (((aod::track::flags & static_cast<uint32_t>(o2::aod::track::PVContributor)) == static_cast<uint32_t>(o2::aod::track::PVContributor)) && (aod::track::tgl > static_cast<float>(0.05)));
Partition<MyBarrelTracksWithCov> tracksNegWithCov = (((aod::track::flags & static_cast<uint32_t>(o2::aod::track::PVContributor)) == static_cast<uint32_t>(o2::aod::track::PVContributor)) && (aod::track::tgl < static_cast<float>(-0.05)));

struct {
std::map<int32_t, float> oMeanTimeShortA;
std::map<int32_t, float> oMeanTimeShortC;
Expand Down Expand Up @@ -788,7 +792,7 @@ struct TableMaker {
}

template <uint32_t TEventFillMap, uint32_t TTrackFillMap, typename TEvents, typename TBCs, typename TZdcs, typename TTrackAssoc, typename TTracks>
void skimCollisions(TEvents const& collisions, TBCs const& /*bcs*/, TZdcs const& /*zdcs*/,
void skimCollisions(TEvents const& collisions, TBCs const& bcs, TZdcs const& /*zdcs*/,
TTrackAssoc const& trackAssocs, TTracks const& tracks)
{
// Skim collisions
Expand Down Expand Up @@ -821,7 +825,7 @@ struct TableMaker {
(reinterpret_cast<TH2D*>(fStatsList->At(kStatsEvent)))->Fill(1.0, static_cast<float>(o2::aod::evsel::kNsel));

// apply the event filter computed by filter-PP
if constexpr ((TEventFillMap & VarManager::ObjTypes::EventFilter) > 0 || (TEventFillMap & VarManager::ObjTypes::RapidityGapFilter) > 0) {
if constexpr ((TEventFillMap & VarManager::ObjTypes::EventFilter) > 0) {
if (!collision.eventFilter()) {
continue;
}
Expand All @@ -836,8 +840,8 @@ struct TableMaker {
if (bcEvSel.globalIndex() != bc.globalIndex()) {
tag |= (static_cast<uint64_t>(1) << 0);
}
// Put the 8 first bits of the event filter in the last 8 bits of the tag
if constexpr ((TEventFillMap & VarManager::ObjTypes::EventFilter) > 0 || (TEventFillMap & VarManager::ObjTypes::RapidityGapFilter) > 0) {
// Put the 8 first bits of the rapidity gap filter in the last 8 bits of the tag
if constexpr ((TEventFillMap & VarManager::ObjTypes::RapidityGapFilter) > 0) {
tag |= (collision.eventFilter() << 56);
}

Expand All @@ -846,8 +850,12 @@ struct TableMaker {
VarManager::FillEvent<TEventFillMap>(collision); // extract event information and place it in the fValues array
if constexpr ((TEventFillMap & VarManager::ObjTypes::Zdc) > 0) {
if constexpr ((TEventFillMap & VarManager::ObjTypes::RapidityGapFilter) > 0) {
// Collision table already has ZDC info
VarManager::FillZDC(collision);
// The DQRapidityGapFilter contains the index of the bc we want to get ZDC info from
auto newbc = bcs.rawIteratorAt(collision.newBcIndex());
if (newbc.has_zdc()) {
auto newbc_zdc = newbc.zdc();
VarManager::FillZDC(newbc_zdc);
}
} else if (bcEvSel.has_zdc()) {
auto bc_zdc = bcEvSel.zdc();
VarManager::FillZDC(bc_zdc);
Expand Down Expand Up @@ -926,20 +934,11 @@ struct TableMaker {
multZNC = collision.multZNC();
multTracklets = collision.multTracklets();
multTracksPV = collision.multNTracksPV();
if constexpr ((TEventFillMap & VarManager::ObjTypes::RapidityGapFilter) > 0) {
// Use the FIT signals from the nearest BC with FIT amplitude above threshold
multFV0A = collision.newBcMultFV0A();
multFT0A = collision.newBcMultFT0A();
multFT0C = collision.newBcMultFT0C();
multFDDA = collision.newBcMultFDDA();
multFDDC = collision.newBcMultFDDC();
} else {
multFV0A = collision.multFV0A();
multFT0A = collision.multFT0A();
multFT0C = collision.multFT0C();
multFDDA = collision.multFDDA();
multFDDC = collision.multFDDC();
}
multFV0A = collision.multFV0A();
multFT0A = collision.multFT0A();
multFT0C = collision.multFT0C();
multFDDA = collision.multFDDA();
multFDDC = collision.multFDDC();
}
if constexpr ((TEventFillMap & VarManager::ObjTypes::CollisionCent) > 0) {
centFT0C = collision.centFT0C();
Expand All @@ -952,9 +951,15 @@ struct TableMaker {
eventInfo(collision.globalIndex());
if constexpr ((TEventFillMap & VarManager::ObjTypes::Zdc) > 0) {
if constexpr ((TEventFillMap & VarManager::ObjTypes::RapidityGapFilter) > 0) {
// ZDC information is already in the DQRapidityGapFilter
zdc(collision.energyCommonZNA(), collision.energyCommonZNC(), collision.energyCommonZPA(), collision.energyCommonZPC(),
collision.timeZNA(), collision.timeZNC(), collision.timeZPA(), collision.timeZPC());
// The DQRapidityGapFilter contains the index of the bc we want to get ZDC info from
auto newbc = bcs.rawIteratorAt(collision.newBcIndex());
if (newbc.has_zdc()) {
auto newbc_zdc = newbc.zdc();
zdc(newbc_zdc.energyCommonZNA(), newbc_zdc.energyCommonZNC(), newbc_zdc.energyCommonZPA(), newbc_zdc.energyCommonZPC(),
newbc_zdc.timeZNA(), newbc_zdc.timeZNC(), newbc_zdc.timeZPA(), newbc_zdc.timeZPC());
} else {
zdc(-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0);
}
} else if (bcEvSel.has_zdc()) {
auto bc_zdc = bcEvSel.zdc();
zdc(bc_zdc.energyCommonZNA(), bc_zdc.energyCommonZNC(), bc_zdc.energyCommonZPA(), bc_zdc.energyCommonZPC(),
Expand Down Expand Up @@ -1650,6 +1655,7 @@ struct TableMaker {
MyBarrelTracksWithCov const& tracksBarrel,
TrackAssoc const& trackAssocs)
{
computeOccupancyEstimators(collisions, tracksPosWithCov, tracksNegWithCov, presliceWithCov, bcs);
fullSkimming<gkEventFillMapWithMultsRapidityGapFilterZdc, gkTrackFillMapWithCov, 0u, 0u>(collisions, bcs, zdcs, tracksBarrel, nullptr, nullptr, trackAssocs, nullptr, nullptr, nullptr);
}

Expand Down
Loading
Loading