Skip to content
Merged
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
61 changes: 44 additions & 17 deletions PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ struct Chargedkstaranalysis {
kAssocReco,
kNSteps
};
enum CollisionSystem : int {
OO = 1,
pp = 2
};

const int nSteps = static_cast<int>(EvtStep::kNSteps);

Expand Down Expand Up @@ -128,7 +132,7 @@ struct Chargedkstaranalysis {
// fixed variables
float rapidityMotherData = 0.5;
float beamEnergy = 13600.0;
double beamMomentum = std::sqrt(beamEnergy * beamEnergy / 4 - o2::constants::physics::MassProton * o2::constants::physics::MassProton); // GeV
float beamEnergyOo = 5360.0;
int noOfDaughters = 2;
} helicityCfgs;

Expand Down Expand Up @@ -225,6 +229,8 @@ struct Chargedkstaranalysis {
Configurable<float> cfgEventCentralityMin{"cfgEventCentralityMin", 0.0f, "Event sel: minimum centrality"};
Configurable<float> cfgEventCentralityMax{"cfgEventCentralityMax", 100.0f, "Event sel: maximum centrality"};
Configurable<int> cfgCentEst{"cfgCentEst", static_cast<int>(CentralityEstimator::FT0C), "Centrality estimator: 1=FT0C, 2=FT0M"};
Configurable<int> cfgColSyst{"cfgColSyst", static_cast<int>(CollisionSystem::pp), "Collision system: 1=OO, 2=pp"};

} eventCutCfgs;

// MC configurables
Expand Down Expand Up @@ -313,8 +319,9 @@ struct Chargedkstaranalysis {
// int kPiPlus = kPiPlus;
int kPDGK0 = kK0;
// Variable declaration
ROOT::Math::PxPyPzEVector beam1{0., 0., -helicityCfgs.beamMomentum, 13600. / 2.};
ROOT::Math::PxPyPzEVector beam2{0., 0., helicityCfgs.beamMomentum, 13600. / 2.};

ROOT::Math::PxPyPzEVector beam1{0.0, 0.0, 0.0, 0.0};
ROOT::Math::PxPyPzEVector beam2{0.0, 0.0, 0.0, 0.0};
double fMaxPosPV = 1e-2;
void init(o2::framework::InitContext&)
{
Expand Down Expand Up @@ -512,6 +519,15 @@ struct Chargedkstaranalysis {
}
// MC
if (doprocessMC) {
histos.add("hEvtSelInfoMc", "hEvtSelInfoMc", kTH1F, {{5, 0, 5.0}});
auto hCutFlowMc = histos.get<TH1>(HIST("hEvtSelInfoMc"));
if (hCutFlowMc) {
hCutFlowMc->GetXaxis()->SetBinLabel(1, "All Events");
hCutFlowMc->GetXaxis()->SetBinLabel(2, "coll cuts");
hCutFlowMc->GetXaxis()->SetBinLabel(3, "rctChecker");
hCutFlowMc->GetXaxis()->SetBinLabel(4, "Multiplicity");
hCutFlowMc->GetXaxis()->SetBinLabel(5, "IsINELgt0");
}
if (isQaRequired) {
histos.add("QA/MC/QACent_woCut", "Centrality without cut", HistType::kTH1F, {centAxis});
histos.add("QA/MC/QACent_woCentCut", "Centrality without cent cut", HistType::kTH1F, {centAxis});
Expand Down Expand Up @@ -594,7 +610,15 @@ struct Chargedkstaranalysis {
hstep->GetXaxis()->SetBinLabel(3, "INEL>0");
hstep->GetXaxis()->SetBinLabel(4, "Assoc with reco coll");
}

if (eventCutCfgs.cfgColSyst == static_cast<int>(CollisionSystem::OO)) {
double selectedBeamMomentum = std::sqrt((helicityCfgs.beamEnergyOo * helicityCfgs.beamEnergyOo / 4.0) - (o2::constants::physics::MassProton * o2::constants::physics::MassProton));
beam1.SetPxPyPzE(0., 0., -selectedBeamMomentum, helicityCfgs.beamEnergyOo / 2.);
beam2.SetPxPyPzE(0., 0., selectedBeamMomentum, helicityCfgs.beamEnergyOo / 2.);
} else {
double selectedBeamMomentum = std::sqrt((helicityCfgs.beamEnergy * helicityCfgs.beamEnergy / 4.0) - (o2::constants::physics::MassProton * o2::constants::physics::MassProton));
beam1.SetPxPyPzE(0., 0., -selectedBeamMomentum, helicityCfgs.beamEnergy / 2.);
beam2.SetPxPyPzE(0., 0., selectedBeamMomentum, helicityCfgs.beamEnergy / 2.);
}
ccdb->setURL(cfgURL);
ccdbApi.init("http://alice-ccdb.cern.ch");
ccdb->setCaching(true);
Expand Down Expand Up @@ -1070,8 +1094,8 @@ struct Chargedkstaranalysis {
void fillHistograms(const CollisionType& collision, const TracksType& dTracks1, const TracksTypeK0s& dTracks2)
{
if (!doprocessMC && isQaRequired) {
histos.fill(HIST("QA/before/CentDist"), collision.centFT0M());
histos.fill(HIST("QA/before/CentDist1"), collision.centFT0M());
histos.fill(HIST("QA/before/CentDist"), getCentrality(collision));
histos.fill(HIST("QA/before/CentDist1"), getCentrality(collision));
}

ROOT::Math::PxPyPzMVector lResoSecondary, lDecayDaughter_bach, lResoKstar, chargeKstarrot;
Expand Down Expand Up @@ -1352,7 +1376,7 @@ struct Chargedkstaranalysis {
}
PROCESS_SWITCH(Chargedkstaranalysis, processDataME, "Process Event for data without Partitioning", true);

void processMC(soa::Join<aod::McCollisions, aod::McCentFT0Ms> const& mccolls, aod::McParticles const& mcParticles, soa::Join<EventCandidates, aod::McCollisionLabels> const& events, MCV0Candidates const& v0s, MCTrackCandidates const& tracks)
void processMC(soa::Join<aod::McCollisions, aod::McCentFT0Ms, aod::McCentFT0Cs> const& mccolls, aod::McParticles const& mcParticles, soa::Join<EventCandidates, aod::McCollisionLabels> const& events, MCV0Candidates const& v0s, MCTrackCandidates const& tracks)
{
allowedMcIds.clear();
centTruthByAllowed.clear();
Expand All @@ -1364,11 +1388,11 @@ struct Chargedkstaranalysis {
if (!coll.has_mcCollision()) {
continue;
}

histos.fill(HIST("hEvtSelInfoMc"), 0.5);
const auto mcid = coll.mcCollisionId();

const auto mccoll = coll.template mcCollision_as<soa::Join<aod::McCollisions, aod::McCentFT0Ms>>();
const float lCentrality = mccoll.centFT0M();
const auto mccoll = coll.template mcCollision_as<soa::Join<aod::McCollisions, aod::McCentFT0Ms, aod::McCentFT0Cs>>();
const float lCentrality = getCentrality(mccoll);

if (doprocessMC && isQaRequired) {
histos.fill(HIST("QA/MC/QACent_woCut"), lCentrality);
Expand All @@ -1377,23 +1401,26 @@ struct Chargedkstaranalysis {
if (!colCuts.isSelected(coll)) {
continue;
}
histos.fill(HIST("hEvtSelInfoMc"), 1.5);
if (rctCut.requireRCTFlagChecker && !rctCut.rctChecker(coll)) {
continue;
}
histos.fill(HIST("hEvtSelInfoMc"), 2.5);
if (lCentrality < eventCutCfgs.cfgEventCentralityMin || lCentrality > eventCutCfgs.cfgEventCentralityMax) {
continue;
}
histos.fill(HIST("hEvtSelInfoMc"), 3.5);
if (!coll.isInelGt0()) {
continue;
}
histos.fill(HIST("hEvtSelInfoMc"), 4.5);
colCuts.fillQA(coll);

if (doprocessMC && isQaRequired) {
histos.fill(HIST("QA/MC/QACent_woCentCut"), lCentrality);
histos.fill(HIST("QA/MC/QAvtxz_wVtxzCut"), coll.posZ());
}

if (lCentrality < eventCutCfgs.cfgEventCentralityMin || lCentrality > eventCutCfgs.cfgEventCentralityMax) {
continue;
}

if (doprocessMC && isQaRequired) {
histos.fill(HIST("QA/MC/QACent_wCentCut"), lCentrality);
}
Expand Down Expand Up @@ -1423,7 +1450,7 @@ struct Chargedkstaranalysis {

const auto mcid = coll.globalIndex();
refClassIds.insert(mcid);
const float lCentrality = coll.centFT0M();
const float lCentrality = getCentrality(coll);
refCentByMcId.emplace(mcid, lCentrality);
}

Expand Down Expand Up @@ -1533,8 +1560,8 @@ struct Chargedkstaranalysis {
continue; // To check the event is allowed or not
}

const auto mccoll = coll.template mcCollision_as<soa::Join<aod::McCollisions, aod::McCentFT0Ms>>();
const float lCentrality = mccoll.centFT0M();
const auto mccoll = coll.template mcCollision_as<soa::Join<aod::McCollisions, aod::McCentFT0Ms, aod::McCentFT0Cs>>();
const float lCentrality = getCentrality(mccoll);

if (!secondaryCutsCfgs.cfgByPassDauPIDSelection) {
auto posDauTrack = v0.template posTrack_as<MCTrackCandidates>();
Expand Down
Loading