Skip to content

Commit 67421a5

Browse files
prottayCMTProttay Das
andauthored
[PWGLF] added mixed event for polarization as a further cross check (#12138)
Co-authored-by: Prottay Das <prottay@alipap1.cern.ch>
1 parent c0f6781 commit 67421a5

File tree

1 file changed

+157
-27
lines changed

1 file changed

+157
-27
lines changed

PWGLF/Tasks/Strangeness/lambdapolsp.cxx

Lines changed: 157 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ struct lambdapolsp {
8383
Configurable<bool> globalpt{"globalpt", true, "select tracks based on pt global vs tpc"};
8484
Configurable<bool> cqvas{"cqvas", false, "change q vectors after shift correction"};
8585
Configurable<int> useprofile{"useprofile", 3, "flag to select profile vs Sparse"};
86-
Configurable<int> QxyNbins{"QxyNbins", 100, "Number of bins in QxQy histograms"};
87-
Configurable<float> lbinQxy{"lbinQxy", -5.0, "lower bin value in QxQy histograms"};
88-
Configurable<float> hbinQxy{"hbinQxy", 5.0, "higher bin value in QxQy histograms"};
8986
Configurable<int> cfgMaxOccupancy{"cfgMaxOccupancy", 1000, "maximum occupancy of tracks in neighbouring collisions in a given time range"};
9087
Configurable<int> cfgMinOccupancy{"cfgMinOccupancy", 0, "maximum occupancy of tracks in neighbouring collisions in a given time range"};
9188
Configurable<int> sys{"sys", 1, "flag to select systematic source"};
@@ -132,24 +129,26 @@ struct lambdapolsp {
132129
Configurable<std::string> ConfAccPathL{"ConfAccPathL", "Users/p/prottay/My/Object/From379780/Fulldata/NewPbPbpass4_28032025/acccorrL", "Path to acceptance correction for Lambda"};
133130
Configurable<std::string> ConfAccPathAL{"ConfAccPathAL", "Users/p/prottay/My/Object/From379780/Fulldata/NewPbPbpass4_28032025/acccorrAL", "Path to acceptance correction for AntiLambda"};
134131

135-
// Configurable<int> CentNbins{"CentNbins", 16, "Number of bins in cent histograms"};
136-
// Configurable<float> lbinCent{"lbinCent", 0.0, "lower bin value in cent histograms"};
137-
// Configurable<float> hbinCent{"hbinCent", 80.0, "higher bin value in cent histograms"};
138-
Configurable<int> SANbins{"SANbins", 20, "Number of bins in costhetastar"};
139-
Configurable<float> lbinSA{"lbinSA", -1.0, "lower bin value in costhetastar histograms"};
140-
Configurable<float> hbinSA{"hbinSA", 1.0, "higher bin value in costhetastar histograms"};
141-
Configurable<int> PolNbins{"PolNbins", 20, "Number of bins in polarisation"};
142-
Configurable<float> lbinPol{"lbinPol", -1.0, "lower bin value in #phi-#psi histograms"};
143-
Configurable<float> hbinPol{"hbinPol", 1.0, "higher bin value in #phi-#psi histograms"};
144-
Configurable<int> IMNbins{"IMNbins", 100, "Number of bins in invariant mass"};
145-
Configurable<float> lbinIM{"lbinIM", 1.0, "lower bin value in IM histograms"};
146-
Configurable<float> hbinIM{"hbinIM", 1.2, "higher bin value in IM histograms"};
147-
Configurable<int> resNbins{"resNbins", 50, "Number of bins in reso"};
148-
Configurable<float> lbinres{"lbinres", 0.0, "lower bin value in reso histograms"};
149-
Configurable<float> hbinres{"hbinres", 10.0, "higher bin value in reso histograms"};
150-
Configurable<int> spNbins{"spNbins", 2000, "Number of bins in sp"};
151-
Configurable<float> lbinsp{"lbinsp", -1.0, "lower bin value in sp histograms"};
152-
Configurable<float> hbinsp{"hbinsp", 1.0, "higher bin value in sp histograms"};
132+
struct : ConfigurableGroup {
133+
Configurable<int> QxyNbins{"QxyNbins", 100, "Number of bins in QxQy histograms"};
134+
Configurable<float> lbinQxy{"lbinQxy", -5.0, "lower bin value in QxQy histograms"};
135+
Configurable<float> hbinQxy{"hbinQxy", 5.0, "higher bin value in QxQy histograms"};
136+
Configurable<int> PolNbins{"PolNbins", 20, "Number of bins in polarisation"};
137+
Configurable<float> lbinPol{"lbinPol", -1.0, "lower bin value in #phi-#psi histograms"};
138+
Configurable<float> hbinPol{"hbinPol", 1.0, "higher bin value in #phi-#psi histograms"};
139+
Configurable<int> IMNbins{"IMNbins", 100, "Number of bins in invariant mass"};
140+
Configurable<float> lbinIM{"lbinIM", 1.0, "lower bin value in IM histograms"};
141+
Configurable<float> hbinIM{"hbinIM", 1.2, "higher bin value in IM histograms"};
142+
Configurable<int> resNbins{"resNbins", 50, "Number of bins in reso"};
143+
Configurable<float> lbinres{"lbinres", 0.0, "lower bin value in reso histograms"};
144+
Configurable<float> hbinres{"hbinres", 10.0, "higher bin value in reso histograms"};
145+
Configurable<int> spNbins{"spNbins", 2000, "Number of bins in sp"};
146+
Configurable<float> lbinsp{"lbinsp", -1.0, "lower bin value in sp histograms"};
147+
Configurable<float> hbinsp{"hbinsp", 1.0, "higher bin value in sp histograms"};
148+
// Configurable<int> CentNbins{"CentNbins", 16, "Number of bins in cent histograms"};
149+
// Configurable<float> lbinCent{"lbinCent", 0.0, "lower bin value in cent histograms"};
150+
// Configurable<float> hbinCent{"hbinCent", 80.0, "higher bin value in cent histograms"};
151+
} binGrp;
153152
/*
154153
ConfigurableAxis configcentAxis{"configcentAxis", {VARIABLE_WIDTH, 0.0, 10.0, 40.0, 80.0}, "Cent V0M"};
155154
ConfigurableAxis configthnAxispT{"configthnAxisPt", {VARIABLE_WIDTH, 0.2, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 6.5, 8.0, 10.0, 100.0}, "#it{p}_{T} (GeV/#it{c})"};
@@ -171,6 +170,11 @@ struct lambdapolsp {
171170
ConfigurableAxis configthnAxisPol{"configthnAxisPol", {VARIABLE_WIDTH, -1.0, -0.6, -0.2, 0, 0.2, 0.4, 0.8}, "Pol"};
172171
ConfigurableAxis configbinAxis{"configbinAxis", {VARIABLE_WIDTH, -0.8, -0.4, -0.2, 0, 0.2, 0.4, 0.8}, "BA"};
173172
} axisGrp;
173+
struct : ConfigurableGroup {
174+
ConfigurableAxis axisVertex{"axisVertex", {5, -10, 10}, "vertex axis for bin"};
175+
ConfigurableAxis axisMultiplicityClass{"axisMultiplicityClass", {8, 0, 80}, "multiplicity percentile for bin"};
176+
Configurable<int> nMix{"nMix", 5, "number of event mixing"};
177+
} meGrp;
174178

175179
RCTFlagsChecker rctChecker;
176180

@@ -182,12 +186,11 @@ struct lambdapolsp {
182186

183187
rctChecker.init(rctCut.cfgEvtRCTFlagCheckerLabel, rctCut.cfgEvtRCTFlagCheckerZDCCheck, rctCut.cfgEvtRCTFlagCheckerLimitAcceptAsBad);
184188

185-
AxisSpec thnAxisres{resNbins, lbinres, hbinres, "Reso"};
186-
AxisSpec thnAxisInvMass{IMNbins, lbinIM, hbinIM, "#it{M} (GeV/#it{c}^{2})"};
187-
AxisSpec thnAxisCosThetaStar{SANbins, lbinSA, hbinSA, "SA"};
188-
// AxisSpec centAxis = {CentNbins, lbinCent, hbinCent, "V0M (%)"};
189-
AxisSpec spAxis = {spNbins, lbinsp, hbinsp, "Sp"};
190-
AxisSpec qxZDCAxis = {QxyNbins, lbinQxy, hbinQxy, "Qx"};
189+
AxisSpec thnAxisres{binGrp.resNbins, binGrp.lbinres, binGrp.hbinres, "Reso"};
190+
AxisSpec thnAxisInvMass{binGrp.IMNbins, binGrp.lbinIM, binGrp.hbinIM, "#it{M} (GeV/#it{c}^{2})"};
191+
AxisSpec spAxis = {binGrp.spNbins, binGrp.lbinsp, binGrp.hbinsp, "Sp"};
192+
// AxisSpec qxZDCAxis = {binGrp.QxyNbins, binGrp.lbinQxy, binGrp.hbinQxy, "Qx"};
193+
// AxisSpec centAxis = {CentNbins, lbinCent, hbinCent, "V0M (%)"};
191194

192195
std::vector<AxisSpec> runaxes = {thnAxisInvMass, axisGrp.configthnAxispT, axisGrp.configthnAxisPol, axisGrp.configcentAxis};
193196
if (needetaaxis)
@@ -1327,6 +1330,133 @@ struct lambdapolsp {
13271330
// lastRunNumber = currentRunNumber;
13281331
}
13291332
PROCESS_SWITCH(lambdapolsp, processDerivedData, "Process derived data", false);
1333+
1334+
// Processing Event Mixing
1335+
using BinningType = ColumnBinningPolicy<aod::collision::PosZ, aod::cent::CentFT0C>;
1336+
BinningType colBinning{{meGrp.axisVertex, meGrp.axisMultiplicityClass}, true};
1337+
Preslice<v0Candidates> tracksPerCollisionV0Mixed = o2::aod::v0data::straCollisionId; // for derived data only
1338+
1339+
void processDerivedDataMixed(soa::Join<aod::StraCollisions, aod::StraCents, aod::StraEvSels, aod::StraStamps, aod::StraZDCSP> const& collisions, v0Candidates const& V0s, dauTracks const&)
1340+
{
1341+
1342+
for (auto& [collision1, collision2] : selfCombinations(colBinning, meGrp.nMix, -1, collisions, collisions)) {
1343+
1344+
if (collision1.index() == collision2.index()) {
1345+
continue;
1346+
}
1347+
1348+
if (!collision1.sel8()) {
1349+
continue;
1350+
}
1351+
if (!collision2.sel8()) {
1352+
continue;
1353+
}
1354+
1355+
if (!collision1.triggereventsp()) { // provided by StraZDCSP
1356+
continue;
1357+
}
1358+
if (!collision2.triggereventsp()) { // provided by StraZDCSP
1359+
continue;
1360+
}
1361+
1362+
if (rctCut.requireRCTFlagChecker && !rctChecker(collision1)) {
1363+
continue;
1364+
}
1365+
if (rctCut.requireRCTFlagChecker && !rctChecker(collision2)) {
1366+
continue;
1367+
}
1368+
1369+
if (additionalEvSel && (!collision1.selection_bit(aod::evsel::kNoSameBunchPileup) || !collision1.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV))) {
1370+
continue;
1371+
}
1372+
if (additionalEvSel && (!collision2.selection_bit(aod::evsel::kNoSameBunchPileup) || !collision2.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV))) {
1373+
continue;
1374+
}
1375+
if (additionalEvSel2 && (collision1.trackOccupancyInTimeRange() > cfgMaxOccupancy || collision1.trackOccupancyInTimeRange() < cfgMinOccupancy)) {
1376+
continue;
1377+
}
1378+
if (additionalEvSel2 && (collision2.trackOccupancyInTimeRange() > cfgMaxOccupancy || collision2.trackOccupancyInTimeRange() < cfgMinOccupancy)) {
1379+
continue;
1380+
}
1381+
if (additionalEvSel3 && (!collision1.selection_bit(aod::evsel::kNoTimeFrameBorder) || !collision1.selection_bit(aod::evsel::kNoITSROFrameBorder))) {
1382+
continue;
1383+
}
1384+
if (additionalEvSel3 && (!collision2.selection_bit(aod::evsel::kNoTimeFrameBorder) || !collision2.selection_bit(aod::evsel::kNoITSROFrameBorder))) {
1385+
continue;
1386+
}
1387+
if (additionalEvSel4 && !collision1.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) {
1388+
continue;
1389+
}
1390+
if (additionalEvSel4 && !collision2.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) {
1391+
continue;
1392+
}
1393+
1394+
auto centrality = collision1.centFT0C();
1395+
auto qxZDCA = collision2.qxZDCA();
1396+
auto qxZDCC = collision2.qxZDCC();
1397+
auto qyZDCA = collision2.qyZDCA();
1398+
auto qyZDCC = collision2.qyZDCC();
1399+
auto psiZDCC = collision2.psiZDCC();
1400+
auto psiZDCA = collision2.psiZDCA();
1401+
double modqxZDCA;
1402+
double modqyZDCA;
1403+
double modqxZDCC;
1404+
double modqyZDCC;
1405+
1406+
modqxZDCA = TMath::Sqrt((qxZDCA * qxZDCA) + (qyZDCA * qyZDCA)) * TMath::Cos(psiZDCA);
1407+
modqyZDCA = TMath::Sqrt((qxZDCA * qxZDCA) + (qyZDCA * qyZDCA)) * TMath::Sin(psiZDCA);
1408+
modqxZDCC = TMath::Sqrt((qxZDCC * qxZDCC) + (qyZDCC * qyZDCC)) * TMath::Cos(psiZDCC);
1409+
modqyZDCC = TMath::Sqrt((qxZDCC * qxZDCC) + (qyZDCC * qyZDCC)) * TMath::Sin(psiZDCC);
1410+
1411+
auto psiZDC = TMath::ATan2((modqyZDCC - modqyZDCA), (modqxZDCC - modqxZDCA)); // full event plane from collision 2
1412+
auto groupV0 = V0s.sliceBy(tracksPerCollisionV0Mixed, collision1.index());
1413+
1414+
histos.fill(HIST("hCentrality"), centrality);
1415+
1416+
for (const auto& v0 : groupV0) {
1417+
1418+
bool LambdaTag = isCompatible(v0, 0);
1419+
bool aLambdaTag = isCompatible(v0, 1);
1420+
if (!LambdaTag && !aLambdaTag)
1421+
continue;
1422+
if (!SelectionV0(collision1, v0))
1423+
continue;
1424+
if (LambdaTag) {
1425+
Proton = ROOT::Math::PxPyPzMVector(v0.pxpos(), v0.pypos(), v0.pzpos(), massPr);
1426+
AntiPion = ROOT::Math::PxPyPzMVector(v0.pxneg(), v0.pyneg(), v0.pzneg(), massPi);
1427+
Lambdadummy = Proton + AntiPion;
1428+
}
1429+
if (aLambdaTag) {
1430+
AntiProton = ROOT::Math::PxPyPzMVector(v0.pxneg(), v0.pyneg(), v0.pzneg(), massPr);
1431+
Pion = ROOT::Math::PxPyPzMVector(v0.pxpos(), v0.pypos(), v0.pzpos(), massPi);
1432+
AntiLambdadummy = AntiProton + Pion;
1433+
}
1434+
if (shouldReject(LambdaTag, aLambdaTag, Lambdadummy, AntiLambdadummy)) {
1435+
continue;
1436+
}
1437+
if (TMath::Abs(v0.eta()) > 0.8)
1438+
continue;
1439+
int taga = LambdaTag;
1440+
int tagb = aLambdaTag;
1441+
1442+
if (LambdaTag) {
1443+
Lambda = Proton + AntiPion;
1444+
tagb = 0;
1445+
double acvalue = 1.0;
1446+
fillHistograms(taga, tagb, Lambda, Proton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mLambda(), v0.pt(), v0.eta(), acvalue);
1447+
}
1448+
1449+
tagb = aLambdaTag;
1450+
if (aLambdaTag) {
1451+
AntiLambda = AntiProton + Pion;
1452+
taga = 0;
1453+
double acvalue = 1.0;
1454+
fillHistograms(taga, tagb, AntiLambda, AntiProton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mAntiLambda(), v0.pt(), v0.eta(), acvalue);
1455+
}
1456+
}
1457+
}
1458+
}
1459+
PROCESS_SWITCH(lambdapolsp, processDerivedDataMixed, "Process mixed event using derived data", false);
13301460
};
13311461
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
13321462
{

0 commit comments

Comments
 (0)