Skip to content

Commit b2ccd01

Browse files
[PWGLF] To add the configurable for system selection (#17581)
Co-authored-by: Navneet <navneet.kumar@cern.ch>
1 parent f2f8950 commit b2ccd01

1 file changed

Lines changed: 44 additions & 17 deletions

File tree

PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx

Lines changed: 44 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ struct Chargedkstaranalysis {
8787
kAssocReco,
8888
kNSteps
8989
};
90+
enum CollisionSystem : int {
91+
OO = 1,
92+
pp = 2
93+
};
9094

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

@@ -128,7 +132,7 @@ struct Chargedkstaranalysis {
128132
// fixed variables
129133
float rapidityMotherData = 0.5;
130134
float beamEnergy = 13600.0;
131-
double beamMomentum = std::sqrt(beamEnergy * beamEnergy / 4 - o2::constants::physics::MassProton * o2::constants::physics::MassProton); // GeV
135+
float beamEnergyOo = 5360.0;
132136
int noOfDaughters = 2;
133137
} helicityCfgs;
134138

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

230236
// MC configurables
@@ -313,8 +319,9 @@ struct Chargedkstaranalysis {
313319
// int kPiPlus = kPiPlus;
314320
int kPDGK0 = kK0;
315321
// Variable declaration
316-
ROOT::Math::PxPyPzEVector beam1{0., 0., -helicityCfgs.beamMomentum, 13600. / 2.};
317-
ROOT::Math::PxPyPzEVector beam2{0., 0., helicityCfgs.beamMomentum, 13600. / 2.};
322+
323+
ROOT::Math::PxPyPzEVector beam1{0.0, 0.0, 0.0, 0.0};
324+
ROOT::Math::PxPyPzEVector beam2{0.0, 0.0, 0.0, 0.0};
318325
double fMaxPosPV = 1e-2;
319326
void init(o2::framework::InitContext&)
320327
{
@@ -512,6 +519,15 @@ struct Chargedkstaranalysis {
512519
}
513520
// MC
514521
if (doprocessMC) {
522+
histos.add("hEvtSelInfoMc", "hEvtSelInfoMc", kTH1F, {{5, 0, 5.0}});
523+
auto hCutFlowMc = histos.get<TH1>(HIST("hEvtSelInfoMc"));
524+
if (hCutFlowMc) {
525+
hCutFlowMc->GetXaxis()->SetBinLabel(1, "All Events");
526+
hCutFlowMc->GetXaxis()->SetBinLabel(2, "coll cuts");
527+
hCutFlowMc->GetXaxis()->SetBinLabel(3, "rctChecker");
528+
hCutFlowMc->GetXaxis()->SetBinLabel(4, "Multiplicity");
529+
hCutFlowMc->GetXaxis()->SetBinLabel(5, "IsINELgt0");
530+
}
515531
if (isQaRequired) {
516532
histos.add("QA/MC/QACent_woCut", "Centrality without cut", HistType::kTH1F, {centAxis});
517533
histos.add("QA/MC/QACent_woCentCut", "Centrality without cent cut", HistType::kTH1F, {centAxis});
@@ -594,7 +610,15 @@ struct Chargedkstaranalysis {
594610
hstep->GetXaxis()->SetBinLabel(3, "INEL>0");
595611
hstep->GetXaxis()->SetBinLabel(4, "Assoc with reco coll");
596612
}
597-
613+
if (eventCutCfgs.cfgColSyst == static_cast<int>(CollisionSystem::OO)) {
614+
double selectedBeamMomentum = std::sqrt((helicityCfgs.beamEnergyOo * helicityCfgs.beamEnergyOo / 4.0) - (o2::constants::physics::MassProton * o2::constants::physics::MassProton));
615+
beam1.SetPxPyPzE(0., 0., -selectedBeamMomentum, helicityCfgs.beamEnergyOo / 2.);
616+
beam2.SetPxPyPzE(0., 0., selectedBeamMomentum, helicityCfgs.beamEnergyOo / 2.);
617+
} else {
618+
double selectedBeamMomentum = std::sqrt((helicityCfgs.beamEnergy * helicityCfgs.beamEnergy / 4.0) - (o2::constants::physics::MassProton * o2::constants::physics::MassProton));
619+
beam1.SetPxPyPzE(0., 0., -selectedBeamMomentum, helicityCfgs.beamEnergy / 2.);
620+
beam2.SetPxPyPzE(0., 0., selectedBeamMomentum, helicityCfgs.beamEnergy / 2.);
621+
}
598622
ccdb->setURL(cfgURL);
599623
ccdbApi.init("http://alice-ccdb.cern.ch");
600624
ccdb->setCaching(true);
@@ -1070,8 +1094,8 @@ struct Chargedkstaranalysis {
10701094
void fillHistograms(const CollisionType& collision, const TracksType& dTracks1, const TracksTypeK0s& dTracks2)
10711095
{
10721096
if (!doprocessMC && isQaRequired) {
1073-
histos.fill(HIST("QA/before/CentDist"), collision.centFT0M());
1074-
histos.fill(HIST("QA/before/CentDist1"), collision.centFT0M());
1097+
histos.fill(HIST("QA/before/CentDist"), getCentrality(collision));
1098+
histos.fill(HIST("QA/before/CentDist1"), getCentrality(collision));
10751099
}
10761100

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

1355-
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)
1379+
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)
13561380
{
13571381
allowedMcIds.clear();
13581382
centTruthByAllowed.clear();
@@ -1364,11 +1388,11 @@ struct Chargedkstaranalysis {
13641388
if (!coll.has_mcCollision()) {
13651389
continue;
13661390
}
1367-
1391+
histos.fill(HIST("hEvtSelInfoMc"), 0.5);
13681392
const auto mcid = coll.mcCollisionId();
13691393

1370-
const auto mccoll = coll.template mcCollision_as<soa::Join<aod::McCollisions, aod::McCentFT0Ms>>();
1371-
const float lCentrality = mccoll.centFT0M();
1394+
const auto mccoll = coll.template mcCollision_as<soa::Join<aod::McCollisions, aod::McCentFT0Ms, aod::McCentFT0Cs>>();
1395+
const float lCentrality = getCentrality(mccoll);
13721396

13731397
if (doprocessMC && isQaRequired) {
13741398
histos.fill(HIST("QA/MC/QACent_woCut"), lCentrality);
@@ -1377,23 +1401,26 @@ struct Chargedkstaranalysis {
13771401
if (!colCuts.isSelected(coll)) {
13781402
continue;
13791403
}
1404+
histos.fill(HIST("hEvtSelInfoMc"), 1.5);
13801405
if (rctCut.requireRCTFlagChecker && !rctCut.rctChecker(coll)) {
13811406
continue;
13821407
}
1408+
histos.fill(HIST("hEvtSelInfoMc"), 2.5);
1409+
if (lCentrality < eventCutCfgs.cfgEventCentralityMin || lCentrality > eventCutCfgs.cfgEventCentralityMax) {
1410+
continue;
1411+
}
1412+
histos.fill(HIST("hEvtSelInfoMc"), 3.5);
13831413
if (!coll.isInelGt0()) {
13841414
continue;
13851415
}
1416+
histos.fill(HIST("hEvtSelInfoMc"), 4.5);
13861417
colCuts.fillQA(coll);
13871418

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

1393-
if (lCentrality < eventCutCfgs.cfgEventCentralityMin || lCentrality > eventCutCfgs.cfgEventCentralityMax) {
1394-
continue;
1395-
}
1396-
13971424
if (doprocessMC && isQaRequired) {
13981425
histos.fill(HIST("QA/MC/QACent_wCentCut"), lCentrality);
13991426
}
@@ -1423,7 +1450,7 @@ struct Chargedkstaranalysis {
14231450

14241451
const auto mcid = coll.globalIndex();
14251452
refClassIds.insert(mcid);
1426-
const float lCentrality = coll.centFT0M();
1453+
const float lCentrality = getCentrality(coll);
14271454
refCentByMcId.emplace(mcid, lCentrality);
14281455
}
14291456

@@ -1533,8 +1560,8 @@ struct Chargedkstaranalysis {
15331560
continue; // To check the event is allowed or not
15341561
}
15351562

1536-
const auto mccoll = coll.template mcCollision_as<soa::Join<aod::McCollisions, aod::McCentFT0Ms>>();
1537-
const float lCentrality = mccoll.centFT0M();
1563+
const auto mccoll = coll.template mcCollision_as<soa::Join<aod::McCollisions, aod::McCentFT0Ms, aod::McCentFT0Cs>>();
1564+
const float lCentrality = getCentrality(mccoll);
15381565

15391566
if (!secondaryCutsCfgs.cfgByPassDauPIDSelection) {
15401567
auto posDauTrack = v0.template posTrack_as<MCTrackCandidates>();

0 commit comments

Comments
 (0)