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
48 changes: 39 additions & 9 deletions PWGEM/Dilepton/Core/DileptonHadronMPC.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ using namespace o2::aod::pwgem::dilepton::utils;
using namespace o2::aod::pwgem::dilepton::utils::emtrackutil;
using namespace o2::aod::pwgem::dilepton::utils::pairutil;

using MyCollisions = soa::Join<aod::EMEvents, aod::EMEventsMult, aod::EMEventsCent>;
using MyCollisions = soa::Join<aod::EMEvents, aod::EMEventsMult, aod::EMEventsCent, aod::EMEventsQvec2>;
using MyCollision = MyCollisions::iterator;

using MyElectrons = soa::Join<aod::EMPrimaryElectrons, aod::EMPrimaryElectronEMEventIds, aod::EMAmbiguousElectronSelfIds, aod::EMPrimaryElectronsPrefilterBit, aod::EMPrimaryElectronsPrefilterBitDerived>;
Expand Down Expand Up @@ -96,6 +96,7 @@ struct DileptonHadronMPC {
Configurable<float> d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"};

Configurable<int> cfgAnalysisType{"cfgAnalysisType", static_cast<int>(o2::aod::pwgem::dilepton::utils::pairutil::DileptonHadronAnalysisType::kAzimuthalCorrelation), "kAzimuthalCorrelation:0, kCumulant:1"};
Configurable<int> cfgEP2Estimator_for_Mix{"cfgEP2Estimator_for_Mix", 3, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5, FV0A:6"};
Configurable<int> cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"};
Configurable<int> cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"};
Configurable<bool> cfgDoMix{"cfgDoMix", true, "flag for event mixing"};
Expand All @@ -104,6 +105,7 @@ struct DileptonHadronMPC {
Configurable<uint64_t> ndiff_bc_mix{"ndiff_bc_mix", 594, "difference in global BC required in mixed events"};
ConfigurableAxis ConfVtxBins{"ConfVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"};
ConfigurableAxis ConfCentBins{"ConfCentBins", {VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.f, 999.f}, "Mixing bins - centrality"};
ConfigurableAxis ConfEPBins{"ConfEPBins", {16, -M_PI / 2, +M_PI / 2}, "Mixing bins - event plane angle"};
ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"};
Configurable<std::string> cfg_swt_name{"cfg_swt_name", "fHighTrackMult", "desired software trigger name"}; // 1 trigger name per 1 task. fHighTrackMult, fHighFt0Mult
// Configurable<int> cfgNtracksPV08Min{"cfgNtracksPV08Min", -1, "min. multNTracksPV"};
Expand All @@ -115,9 +117,7 @@ struct DileptonHadronMPC {
ConfigurableAxis ConfPtllBins{"ConfPtllBins", {VARIABLE_WIDTH, 0.00, 0.15, 0.50, 1.00, 1.50, 2.00, 2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00}, "pTll bins for output histograms"};
ConfigurableAxis ConfDCAllBins{"ConfDCAllBins", {VARIABLE_WIDTH, 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}, "DCAll bins for output histograms"};

// ConfigurableAxis ConfMmumuBins{"ConfMmumuBins", {VARIABLE_WIDTH, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.40, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.50, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.60, 0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69, 0.70, 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79, 0.80, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89, 0.90, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1.00, 1.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.10, 1.11,1.12,1.13,1.14,1.15,1.16,1.17,1.18,1.19, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.10, 2.20, 2.30, 2.40, 2.50, 2.60, 2.70, 2.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.05, 3.10, 3.15, 3.20, 3.25, 3.30, 3.35, 3.40, 3.45, 3.50, 3.55, 3.60, 3.65, 3.70, 3.75, 3.80, 3.85, 3.90, 3.95, 4.00, 4.10, 4.20, 4.30, 4.40, 4.50, 4.60, 4.70, 4.80, 4.90, 5.00, 5.10, 5.20, 5.30, 5.40, 5.50, 5.60, 5.70, 5.80, 5.90, 6.00, 6.10, 6.20, 6.30, 6.40, 6.50, 6.60, 6.70, 6.80, 6.90, 7.00, 7.10, 7.20, 7.30, 7.40, 7.50, 7.60, 7.70, 7.80, 7.90, 8.00, 8.10, 8.20, 8.30, 8.40, 8.50, 8.60, 8.70, 8.80, 8.90, 9.00, 9.10, 9.20, 9.30, 9.40, 9.50, 9.60, 9.70, 9.80, 9.90, 10.00, 10.10, 10.20, 10.30, 10.40, 10.50, 10.60, 10.70, 10.80, 10.90, 11.00, 11.50, 12.00}, "mmumu bins for output histograms"}; // for dimuon. one can copy bins here to hyperloop page.

ConfigurableAxis ConfPtHadronBins{"ConfPtHadronBins", {VARIABLE_WIDTH, 0.00, 0.15, 0.2, 0.3, 0.4, 0.50, 1.00, 2.00, 3.00, 4.00, 5.00}, "pT,h bins for output histograms"};
ConfigurableAxis ConfPtHadronBins{"ConfPtHadronBins", {50, 0, 5}, "pT,h bins for output histograms"};
ConfigurableAxis ConfYllBins{"ConfYllBins", {1, -1.f, 1.f}, "yll bins for output histograms"}; // pair rapidity
ConfigurableAxis ConfDEtaBins{"ConfDEtaBins", {120, -6, 6}, "deta bins for output histograms"};
Configurable<int> cfgNbinsDPhi{"cfgNbinsDPhi", 36, "nbins in dphi for output histograms"};
Expand Down Expand Up @@ -314,10 +314,8 @@ struct DileptonHadronMPC {

std::vector<float> cent_bin_edges;
std::vector<float> zvtx_bin_edges;
std::vector<float> ep_bin_edges;
std::vector<float> occ_bin_edges;
int nmod = -1; // this is for flow analysis
int subdet2 = -1; // this is for flow analysis
int subdet3 = -1; // this is for flow analysis
float leptonM1 = 0.f;
float leptonM2 = 0.f;

Expand Down Expand Up @@ -366,6 +364,23 @@ struct DileptonHadronMPC {
}
}

if (ConfEPBins.value[0] == VARIABLE_WIDTH) {
ep_bin_edges = std::vector<float>(ConfEPBins.value.begin(), ConfEPBins.value.end());
ep_bin_edges.erase(ep_bin_edges.begin());
for (const auto& edge : ep_bin_edges) {
LOGF(info, "VARIABLE_WIDTH: ep_bin_edges = %f", edge);
}
} else {
int nbins = static_cast<int>(ConfEPBins.value[0]);
float xmin = static_cast<float>(ConfEPBins.value[1]);
float xmax = static_cast<float>(ConfEPBins.value[2]);
ep_bin_edges.resize(nbins + 1);
for (int i = 0; i < nbins + 1; i++) {
ep_bin_edges[i] = (xmax - xmin) / (nbins)*i + xmin;
LOGF(info, "FIXED_WIDTH: ep_bin_edges[%d] = %f", i, ep_bin_edges[i]);
}
}

LOGF(info, "cfgOccupancyEstimator = %d", cfgOccupancyEstimator.value);
if (ConfOccupancyBins.value[0] == VARIABLE_WIDTH) {
occ_bin_edges = std::vector<float>(ConfOccupancyBins.value.begin(), ConfOccupancyBins.value.end());
Expand Down Expand Up @@ -478,6 +493,7 @@ struct DileptonHadronMPC {

void addhistograms()
{
static constexpr std::string_view qvec_det_names[7] = {"FT0M", "FT0A", "FT0C", "BTot", "BPos", "BNeg", "FV0A"};
// event info
o2::aod::pwgem::dilepton::utils::eventhistogram::addEventHistograms<-1>(&fRegistry);

Expand Down Expand Up @@ -522,7 +538,7 @@ struct DileptonHadronMPC {
const AxisSpec axis_deta{ConfDEtaBins, deta_axis_title};

// hadron-hadron info
const AxisSpec axis_deta_hh{60, -3, +3, "#Delta#eta = #eta_{h}^{ref1} - #eta_{h}^{ref2}"};
const AxisSpec axis_deta_hh{40, -2, +2, "#Delta#eta = #eta_{h}^{ref1} - #eta_{h}^{ref2}"};

const AxisSpec axis_pt_trg{ConfPtHadronBins, "p_{T,h} (GeV/c)"};
const AxisSpec axis_eta_trg{40, -2, +2, "#eta_{h}"};
Expand Down Expand Up @@ -562,6 +578,9 @@ struct DileptonHadronMPC {
fRegistry.add("HadronHadron/same/hDEtaCosNDPhi", "hadron-hadron 2PC", kTH2D, {axis_cosndphi_hh, axis_deta_hh}, true);
}
fRegistry.add("Dilepton/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", kTH1D, {{10001, -0.5, 10000.5}}, true);

fRegistry.add("Event/before/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false);
fRegistry.add("Event/after/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false);
}

void DefineEMEventCut()
Expand Down Expand Up @@ -1032,8 +1051,13 @@ struct DileptonHadronMPC {
continue;
}

const float eventplanes_2_for_mix[7] = {collision.ep2ft0m(), collision.ep2ft0a(), collision.ep2ft0c(), collision.ep2btot(), collision.ep2bpos(), collision.ep2bneg(), collision.ep2fv0a()};
float ep2 = eventplanes_2_for_mix[cfgEP2Estimator_for_Mix];

o2::aod::pwgem::dilepton::utils::eventhistogram::fillEventInfo<0, -1>(&fRegistry, collision);

fRegistry.fill(HIST("Event/before/hEP2_CentFT0C_forMix"), collision.centFT0C(), ep2);

if (!fEMEventCut.IsSelected(collision)) {
continue;
}
Expand All @@ -1050,6 +1074,7 @@ struct DileptonHadronMPC {
o2::aod::pwgem::dilepton::utils::eventhistogram::fillEventInfo<1, -1>(&fRegistry, collision);
fRegistry.fill(HIST("Event/before/hCollisionCounter"), o2::aod::pwgem::dilepton::utils::eventhistogram::nbin_ev); // accepted
fRegistry.fill(HIST("Event/after/hCollisionCounter"), o2::aod::pwgem::dilepton::utils::eventhistogram::nbin_ev); // accepted
fRegistry.fill(HIST("Event/after/hEP2_CentFT0C_forMix"), collision.centFT0C(), ep2);

auto refTracks_per_coll = refTracks.sliceBy(perCollision_track, collision.globalIndex());

Expand Down Expand Up @@ -1127,7 +1152,12 @@ struct DileptonHadronMPC {
centbin = static_cast<int>(cent_bin_edges.size()) - 2;
}

int epbin = 0;
int epbin = lower_bound(ep_bin_edges.begin(), ep_bin_edges.end(), ep2) - ep_bin_edges.begin() - 1;
if (epbin < 0) {
epbin = 0;
} else if (static_cast<int>(ep_bin_edges.size()) - 2 < epbin) {
epbin = static_cast<int>(ep_bin_edges.size()) - 2;
}

int occbin = -1;
if (cfgOccupancyEstimator == 0) {
Expand Down
78 changes: 5 additions & 73 deletions PWGEM/Dilepton/Core/EMTrackCut.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,8 @@

#include "Framework/Logger.h"

#include <set>
#include <utility>

ClassImp(EMTrackCut);

const std::pair<int8_t, std::set<uint8_t>> EMTrackCut::its_ib_any_Requirement = {1, {0, 1, 2}}; // hits on any ITS ib layers.
const std::pair<int8_t, std::set<uint8_t>> EMTrackCut::its_ib_1st_Requirement = {1, {0}}; // hit on 1st ITS ib layers.

void EMTrackCut::SetTrackPtRange(float minPt, float maxPt)
{
mMinTrackPt = minPt;
Expand All @@ -43,74 +37,12 @@ void EMTrackCut::SetTrackPhiRange(float minPhi, float maxPhi)
mMaxTrackPhi = maxPhi;
LOG(info) << "EMTrack Cut, set track phi range (rad.): " << mMinTrackPhi << " - " << mMaxTrackPhi;
}
void EMTrackCut::SetMinNClustersTPC(int minNClustersTPC)
{
mMinNClustersTPC = minNClustersTPC;
LOG(info) << "EMTrack Cut, set min N clusters TPC: " << mMinNClustersTPC;
}
void EMTrackCut::SetMinNCrossedRowsTPC(int minNCrossedRowsTPC)
{
mMinNCrossedRowsTPC = minNCrossedRowsTPC;
LOG(info) << "EMTrack Cut, set min N crossed rows TPC: " << mMinNCrossedRowsTPC;
}
void EMTrackCut::SetMinNCrossedRowsOverFindableClustersTPC(float minNCrossedRowsOverFindableClustersTPC)
{
mMinNCrossedRowsOverFindableClustersTPC = minNCrossedRowsOverFindableClustersTPC;
LOG(info) << "EMTrack Cut, set min N crossed rows over findable clusters TPC: " << mMinNCrossedRowsOverFindableClustersTPC;
}
void EMTrackCut::SetMaxFracSharedClustersTPC(float max)
{
mMaxFracSharedClustersTPC = max;
LOG(info) << "EMTrack Cut, set max fraction of shared clusters in TPC: " << mMaxFracSharedClustersTPC;
}
void EMTrackCut::SetChi2PerClusterTPC(float min, float max)
{
mMinChi2PerClusterTPC = min;
mMaxChi2PerClusterTPC = max;
LOG(info) << "EMTrack Cut, set chi2 per cluster TPC range: " << mMinChi2PerClusterTPC << " - " << mMaxChi2PerClusterTPC;
}

void EMTrackCut::SetNClustersITS(int min, int max)
{
mMinNClustersITS = min;
mMaxNClustersITS = max;
LOG(info) << "EMTrack Cut, set N clusters ITS range: " << mMinNClustersITS << " - " << mMaxNClustersITS;
}
void EMTrackCut::SetChi2PerClusterITS(float min, float max)
{
mMinChi2PerClusterITS = min;
mMaxChi2PerClusterITS = max;
LOG(info) << "EMTrack Cut, set chi2 per cluster ITS range: " << mMinChi2PerClusterITS << " - " << mMaxChi2PerClusterITS;
}

void EMTrackCut::SetTrackMaxDcaXY(float maxDcaXY)
{
mMaxDcaXY = maxDcaXY;
LOG(info) << "EMTrack Cut, set max DCA xy: " << mMaxDcaXY;
}
void EMTrackCut::SetTrackMaxDcaZ(float maxDcaZ)
{
mMaxDcaZ = maxDcaZ;
LOG(info) << "EMTrack Cut, set max DCA z: " << mMaxDcaZ;
}

void EMTrackCut::SetTrackMaxDcaXYPtDep(std::function<float(float)> ptDepCut)
{
mMaxDcaXYPtDep = ptDepCut;
LOG(info) << "EMTrack Cut, set max DCA xy pt dep: " << mMaxDcaXYPtDep(1.0);
}

void EMTrackCut::RequireITSibAny(bool flag)
{
mRequireITSibAny = flag;
LOG(info) << "EMTrack Cut, require ITS ib any: " << mRequireITSibAny;
}

void EMTrackCut::RequireITSib1st(bool flag)
{
mRequireITSib1st = flag;
LOG(info) << "EMTrack Cut, require ITS ib 1st: " << mRequireITSib1st;
}
// void EMTrackCut::SetTrackMaxDcaXYPtDep(std::function<float(float)> ptDepCut)
// {
// mMaxDcaXYPtDep = ptDepCut;
// LOG(info) << "EMTrack Cut, set max DCA xy pt dep: " << mMaxDcaXYPtDep(1.0);
// }

void EMTrackCut::SetTrackBit(uint16_t bit)
{
Expand Down
Loading
Loading