Skip to content

Commit

Permalink
Integrate data table
Browse files Browse the repository at this point in the history
  • Loading branch information
BongHwi committed Dec 11, 2024
1 parent a2fd229 commit c0f6a62
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 172 deletions.
63 changes: 63 additions & 0 deletions PWGLF/DataModel/LFResonanceTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
/// Inspired by StrangenessTables.h, FemtoDerived.h
///
/// \author Bong-Hwi Lim <[email protected]>
/// \author Nasir Mehdi Malik <[email protected]>
///

#ifndef PWGLF_DATAMODEL_LFRESONANCETABLES_H_
#define PWGLF_DATAMODEL_LFRESONANCETABLES_H_
Expand Down Expand Up @@ -113,6 +115,25 @@ DECLARE_SOA_TABLE(ResoEvtPlCollisions, "AOD", "RESOEVTPLCOLL",
resocollision::EvtPlResBC);
using ResoEvtPlCollision = ResoEvtPlCollisions::iterator;

// For DF mixing study
DECLARE_SOA_TABLE(ResoCollisionDFs, "AOD", "RESOCOLLISIONDF",
o2::soa::Index<>,
resocollision::CollisionId,
o2::aod::mult::MultNTracksPV,
collision::PosX,
collision::PosY,
collision::PosZ,
resocollision::Cent,
resocollision::Spherocity,
resocollision::EvtPl,
resocollision::EvtPlResAB,
resocollision::EvtPlResAC,
resocollision::EvtPlResBC,
resocollision::BMagField,
timestamp::Timestamp,
evsel::NumTracksInTimeRange);
using ResoCollisionDF = ResoCollisionDFs::iterator;

// Resonance Daughters
// inspired from PWGCF/DataModel/FemtoDerived.h
namespace resodaughter
Expand Down Expand Up @@ -230,6 +251,48 @@ DECLARE_SOA_TABLE(ResoTracks, "AOD", "RESOTRACKS",
o2::aod::track::TPCChi2NCl);
using ResoTrack = ResoTracks::iterator;

// For DF mixing study
DECLARE_SOA_TABLE(ResoTrackDFs, "AOD", "RESOTRACKDFs",
o2::soa::Index<>,
resodaughter::ResoCollisionId,
resodaughter::TrackId,
resodaughter::Pt,
resodaughter::Px,
resodaughter::Py,
resodaughter::Pz,
resodaughter::Eta,
resodaughter::Phi,
resodaughter::Sign,
resodaughter::TPCNClsCrossedRows,
resodaughter::TPCNClsFound,
resodaughter::ITSNCls,
o2::aod::track::DcaXY,
o2::aod::track::DcaZ,
o2::aod::track::X,
o2::aod::track::Alpha,
resodaughter::HasITS,
resodaughter::HasTPC,
resodaughter::HasTOF,
o2::aod::pidtpc::TPCNSigmaPi,
o2::aod::pidtpc::TPCNSigmaKa,
o2::aod::pidtpc::TPCNSigmaPr,
o2::aod::pidtpc::TPCNSigmaEl,
o2::aod::pidtof::TOFNSigmaPi,
o2::aod::pidtof::TOFNSigmaKa,
o2::aod::pidtof::TOFNSigmaPr,
o2::aod::pidtof::TOFNSigmaEl,
o2::aod::track::TPCSignal,
o2::aod::track::PassedITSRefit,
o2::aod::track::PassedTPCRefit,
resodaughter::IsGlobalTrackWoDCA,
resodaughter::IsGlobalTrack,
resodaughter::IsPrimaryTrack,
resodaughter::IsPVContributor,
resodaughter::TPCCrossedRowsOverFindableCls,
o2::aod::track::ITSChi2NCl,
o2::aod::track::TPCChi2NCl);
using ResoTrackDF = ResoTrackDFs::iterator;

DECLARE_SOA_TABLE(ResoV0s, "AOD", "RESOV0S",
o2::soa::Index<>,
resodaughter::ResoCollisionId,
Expand Down
158 changes: 0 additions & 158 deletions PWGLF/DataModel/LFResonanceTablesMergeDF.h

This file was deleted.

18 changes: 10 additions & 8 deletions PWGLF/TableProducer/Resonances/LFResonanceMergeDF.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
#include "Framework/runDataProcessing.h"
#include "Framework/O2DatabasePDGPlugin.h"
#include "PWGLF/DataModel/LFStrangenessTables.h"
#include "PWGLF/DataModel/LFResonanceTablesMergeDF.h"
#include "PWGLF/DataModel/LFResonanceTables.h"
#include "PWGLF/Utils/collisionCuts.h"
#include "ReconstructionDataFormats/Track.h"
Expand Down Expand Up @@ -89,8 +88,8 @@ struct reso2dfmerged {
Produces<aod::ResoTrackDFs> reso2trksdf;
int df = 0;

std::vector<std::tuple<float, float, float, float, float, float>> vecOfTuples;
std::vector<std::vector<std::tuple<float, float, float, float,
std::vector<std::tuple<int, float, float, float, float, float, float>> vecOfTuples;
std::vector<std::vector<std::tuple<int, float, float, float, float,
float, float, signed char, unsigned char, unsigned char, unsigned char,
float, float, float, float,
bool, bool, bool, float, float, float,
Expand All @@ -102,8 +101,8 @@ struct reso2dfmerged {
{

int nCollisions = nDF;
vecOfTuples.push_back(std::make_tuple(collision.posX(), collision.posY(), collision.posZ(), collision.cent(), collision.spherocity(), collision.evtPl()));
std::vector<std::tuple<float, float, float, float,
vecOfTuples.push_back(std::make_tuple(collision.globalIndex(), collision.posX(), collision.posY(), collision.posZ(), collision.cent(), collision.spherocity(), collision.evtPl()));
std::vector<std::tuple<int, float, float, float, float,
float, float, signed char, unsigned char, unsigned char, unsigned char,
float, float, float, float,
bool, bool, bool, float, float, float,
Expand Down Expand Up @@ -135,6 +134,7 @@ struct reso2dfmerged {
}

innerVector.push_back(std::make_tuple(
track.globalIndex(),
track.pt(),
track.px(),
track.py(),
Expand Down Expand Up @@ -184,7 +184,7 @@ struct reso2dfmerged {
const auto& innerVector = vecOfVecOfTuples[i];

histos.fill(HIST("Event/h1d_ft0_mult_percentile"), std::get<3>(tuple));
resoCollisionsdf(0, std::get<0>(tuple), std::get<1>(tuple), std::get<2>(tuple), std::get<3>(tuple), std::get<4>(tuple), std::get<5>(tuple), 0., 0., 0., 0., 0, collision.trackOccupancyInTimeRange());
resoCollisionsdf(std::get<0>(tuple), 0, std::get<1>(tuple), std::get<2>(tuple), std::get<3>(tuple), std::get<4>(tuple), std::get<5>(tuple), std::get<6>(tuple), 0., 0., 0., 0., 0, collision.trackOccupancyInTimeRange());
// LOGF(info, "collisions: Index = %d ) %f - %f - %f %f %d -- %d", std::get<0>(tuple).globalIndex(),std::get<1>(tuple),std::get<2>(tuple), std::get<3>(tuple), std::get<4>(tuple), std::get<5>(tuple).size(),resoCollisionsdf.lastIndex());

for (const auto& tuple : innerVector) {
Expand Down Expand Up @@ -223,7 +223,8 @@ struct reso2dfmerged {
std::get<31>(tuple),
std::get<32>(tuple),
std::get<33>(tuple),
std::get<34>(tuple));
std::get<34>(tuple),
std::get<35>(tuple));
}
}

Expand All @@ -242,7 +243,7 @@ struct reso2dfmerged {

histos.fill(HIST("Event/h1d_ft0_mult_percentile"), collision.cent());

resoCollisionsdf(0, collision.posX(), collision.posY(), collision.posZ(), collision.cent(), collision.spherocity(), collision.evtPl(), 0., 0., 0., 0., 0, collision.trackOccupancyInTimeRange());
resoCollisionsdf(collision.globalIndex(), 0, collision.posX(), collision.posY(), collision.posZ(), collision.cent(), collision.spherocity(), collision.evtPl(), 0., 0., 0., 0., 0, collision.trackOccupancyInTimeRange());

for (auto& track : tracks) {
if (isPrimary && !track.isPrimaryTrack())
Expand Down Expand Up @@ -270,6 +271,7 @@ struct reso2dfmerged {
continue;

reso2trksdf(resoCollisionsdf.lastIndex(),
track.globalIndex(),
track.pt(),
track.px(),
track.py(),
Expand Down
11 changes: 5 additions & 6 deletions PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/// /// Invariant Mass Reconstruction of Lambda(1520) Resonance.
///
/// \author Yash Patley <[email protected]>
/// \author Nasir Mehdi Malik
/// \author Nasir Mehdi Malik

#include <Framework/ASoA.h>
#include <Framework/AnalysisDataModel.h>
Expand All @@ -30,7 +30,6 @@
#include "Framework/ASoAHelpers.h"
#include "Framework/runDataProcessing.h"
#include "PWGLF/DataModel/LFResonanceTables.h"
#include "PWGLF/DataModel/LFResonanceTablesMergeDF.h"
#include "CommonConstants/PhysicsConstants.h"

using namespace o2;
Expand Down Expand Up @@ -654,9 +653,9 @@ struct lambdaAnalysis_pb {

PROCESS_SWITCH(lambdaAnalysis_pb, processMix, "Process for Mixed Events", false);

Preslice<aod::ResoTrackDFs> perRColdf = aod::resodaughterdf::resoCollisiondfId;
Preslice<aod::ResoTrackDFs> perRColdf = aod::resodaughter::resoCollisionId;

using resoColDFs = aod::ResoCollisionDFs;
using resoColDFs = aod::ResoCollisions;
using resoTrackDFs = aod::ResoTrackDFs;

void processDatadf(resoColDFs::iterator const& collision, resoTrackDFs const& tracks)
Expand All @@ -673,7 +672,7 @@ struct lambdaAnalysis_pb {

PROCESS_SWITCH(lambdaAnalysis_pb, processDatadf, "Process for data merged DF", false);

using BinningTypeDF = ColumnBinningPolicy<aod::collision::PosZ, aod::resocollisiondf::Cent>;
using BinningTypeDF = ColumnBinningPolicy<aod::collision::PosZ, aod::resocollision::Cent>;
void processMixDF(resoColDFs& collisions, resoTrackDFs const& tracks)
{
if (doprocessMix)
Expand All @@ -696,7 +695,7 @@ struct lambdaAnalysis_pb {

PROCESS_SWITCH(lambdaAnalysis_pb, processMixDF, "Process for merged DF Mixed Events", false);

using BinningTypeEP = ColumnBinningPolicy<aod::collision::PosZ, aod::resocollisiondf::Cent, aod::resocollisiondf::EvtPl>;
using BinningTypeEP = ColumnBinningPolicy<aod::collision::PosZ, aod::resocollision::Cent, aod::resocollision::EvtPl>;
void processMixepDF(resoColDFs& collisions, resoTrackDFs const& tracks)
{
if (doprocessMix || doprocessMixDF)
Expand Down

0 comments on commit c0f6a62

Please sign in to comment.