Skip to content

Commit ad9e095

Browse files
prottayCMTProttay Das
andauthored
[PWGLF] updated existing flow code for spin alignment study (#10851)
Co-authored-by: Prottay Das <prottay@alipap1.cern.ch>
1 parent 4653bdb commit ad9e095

File tree

1 file changed

+112
-57
lines changed

1 file changed

+112
-57
lines changed

PWGLF/Tasks/Resonances/kstarpbpb.cxx

Lines changed: 112 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <TH2F.h>
2121
#include <TLorentzVector.h>
2222
#include <TPDGCode.h>
23-
#include <TDatabasePDG.h>
2423
#include <cmath>
2524
#include <array>
2625
#include <cstdlib>
@@ -39,7 +38,6 @@
3938
#include "Framework/AnalysisDataModel.h"
4039
#include "Framework/HistogramRegistry.h"
4140
#include "Framework/StepTHn.h"
42-
#include "Framework/O2DatabasePDGPlugin.h"
4341
#include "Common/DataModel/PIDResponse.h"
4442
#include "Common/DataModel/Multiplicity.h"
4543
#include "Common/DataModel/Centrality.h"
@@ -63,10 +61,6 @@ using namespace o2::framework::expressions;
6361
using std::array;
6462
struct kstarpbpb {
6563

66-
int mRunNumber;
67-
int multEstimator;
68-
float d_bz;
69-
7064
struct : ConfigurableGroup {
7165
Configurable<std::string> cfgURL{"cfgURL", "http://alice-ccdb.cern.ch", "Address of the CCDB to browse"};
7266
Configurable<int64_t> nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count(), "Latest acceptable timestamp of creation for the object"};
@@ -75,7 +69,7 @@ struct kstarpbpb {
7569
// Enable access to the CCDB for the offset and correction constants and save them in dedicated variables.
7670
Service<o2::ccdb::BasicCCDBManager> ccdb;
7771
o2::ccdb::CcdbApi ccdbApi;
78-
Service<o2::framework::O2DatabasePDG> pdg;
72+
// Service<o2::framework::O2DatabasePDG> pdg;
7973

8074
// CCDB options
8175
// Configurable<std::string> ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
@@ -107,9 +101,9 @@ struct kstarpbpb {
107101
ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {180, 0.6, 1.5}, "#it{M} (GeV/#it{c}^{2})"};
108102
ConfigurableAxis configThnAxisPt{"configThnAxisPt", {100, 0.0, 10.}, "#it{p}_{T} (GeV/#it{c})"};
109103
ConfigurableAxis configThnAxisCentrality{"configThnAxisCentrality", {8, 0., 80}, "Centrality"};
104+
ConfigurableAxis configrapAxis{"configrapAxis", {VARIABLE_WIDTH, -0.8, -0.4, 0.4, 0.8}, "Rapidity"};
110105
Configurable<bool> removefaketrak{"removefaketrack", true, "Remove fake track from momentum difference"};
111106
Configurable<float> ConfFakeKaonCut{"ConfFakeKaonCut", 0.1, "Cut based on track from momentum difference"};
112-
ConfigurableAxis configThnAxisPhiminusPsi{"configThnAxisPhiminusPsi", {6, 0.0, TMath::Pi()}, "#phi - #psi"};
113107
ConfigurableAxis configThnAxisV2{"configThnAxisV2", {400, -16, 16}, "V2"};
114108
Configurable<bool> additionalEvsel{"additionalEvsel", false, "Additional event selcection"};
115109
Configurable<bool> timFrameEvsel{"timFrameEvsel", false, "TPC Time frame boundary cut"};
@@ -127,6 +121,7 @@ struct kstarpbpb {
127121
Configurable<bool> fillRotation{"fillRotation", true, "fill rotation"};
128122
Configurable<bool> same{"same", true, "same event"};
129123
Configurable<bool> like{"like", false, "like-sign"};
124+
Configurable<bool> fillSA{"fillSA", true, "same event SA"};
130125
Configurable<bool> fillOccupancy{"fillOccupancy", false, "fill Occupancy"};
131126
Configurable<int> cfgOccupancyCut{"cfgOccupancyCut", 500, "Occupancy cut"};
132127
Configurable<bool> useWeight{"useWeight", false, "use EP dep effi weight"};
@@ -168,46 +163,53 @@ struct kstarpbpb {
168163
void init(o2::framework::InitContext&)
169164
{
170165
std::vector<double> occupancyBinning = {0.0, 500.0, 1000.0, 1500.0, 2000.0, 3000.0, 4000.0, 5000.0, 50000.0};
171-
const AxisSpec thnAxisInvMass{configThnAxisInvMass, "#it{M} (GeV/#it{c}^{2})"};
172-
const AxisSpec thnAxisPt{configThnAxisPt, "#it{p}_{T} (GeV/#it{c})"};
173-
const AxisSpec thnAxisPhiminusPsi{configThnAxisPhiminusPsi, "#phi - #psi"};
174-
const AxisSpec thnAxisCentrality{configThnAxisCentrality, "Centrality (%)"};
175-
const AxisSpec thnAxisV2{configThnAxisV2, "V2"};
176166
AxisSpec phiAxis = {500, -6.28, 6.28, "phi"};
177167
AxisSpec resAxis = {6000, -30, 30, "Res"};
178168
AxisSpec centAxis = {8, 0, 80, "V0M (%)"};
179169
AxisSpec occupancyAxis = {occupancyBinning, "Occupancy"};
180-
if (same) {
181-
histos.add("hSparseV2SASameEvent_V2", "hSparseV2SASameEvent_V2", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality});
182-
}
183-
if (like) {
184-
histos.add("hSparseV2SAlikeEventNN_V2", "hSparseV2SAlikeEventNN_V2", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality});
185-
histos.add("hSparseV2SAlikeEventPP_V2", "hSparseV2SAlikeEventPP_V2", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality});
170+
if (!fillSA) {
171+
if (same) {
172+
histos.add("hSparseV2SASameEvent_V2", "hSparseV2SASameEvent_V2", HistType::kTHnSparseF, {configThnAxisInvMass, configThnAxisPt, configThnAxisV2, configThnAxisCentrality});
173+
}
174+
if (like) {
175+
histos.add("hSparseV2SAlikeEventNN_V2", "hSparseV2SAlikeEventNN_V2", HistType::kTHnSparseF, {configThnAxisInvMass, configThnAxisPt, configThnAxisV2, configThnAxisCentrality});
176+
histos.add("hSparseV2SAlikeEventPP_V2", "hSparseV2SAlikeEventPP_V2", HistType::kTHnSparseF, {configThnAxisInvMass, configThnAxisPt, configThnAxisV2, configThnAxisCentrality});
177+
}
186178
}
187179
if (fillRotation) {
188-
histos.add("hRotation", "hRotation", kTH1F, {{360, 0.0, 2.0 * TMath::Pi()}});
189-
histos.add("hSparseV2SASameEventRotational_V2", "hSparseV2SASameEventRotational_V2", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality});
180+
if (!fillSA) {
181+
histos.add("hRotation", "hRotation", kTH1F, {{360, 0.0, 2.0 * TMath::Pi()}});
182+
histos.add("hSparseV2SASameEventRotational_V2", "hSparseV2SASameEventRotational_V2", HistType::kTHnSparseF, {configThnAxisInvMass, configThnAxisPt, configThnAxisV2, configThnAxisCentrality});
183+
}
190184
}
191-
histos.add("hSparseV2SAGen_V2", "hSparseV2SAGen_V2", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality});
192-
histos.add("hSparseV2SARec_V2", "hSparseV2SARec_V2", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality});
193-
histos.add("hpt", "hpt", kTH1F, {thnAxisPt});
194-
histos.add("hMC", "MC Event statistics", kTH1F, {{10, 0.0f, 10.0f}});
195-
histos.add("h1PhiRecsplit", "Phi meson Rec split", kTH1F, {{100, 0.0f, 10.0f}});
196-
histos.add("CentPercentileMCRecHist", "MC Centrality", kTH1F, {{100, 0.0f, 100.0f}});
197-
histos.add("hSparseV2SAMixedEvent_V2", "hSparseV2SAMixedEvent_V2", HistType::kTHnSparseF, {thnAxisInvMass, thnAxisPt, thnAxisV2, thnAxisCentrality});
198-
histos.add("h2PhiGen2", "Phi meson gen", kTH2F, {thnAxisPt, thnAxisCentrality});
199-
histos.add("h2PhiRec2", "Phi meson Rec", kTH2F, {thnAxisPt, thnAxisCentrality});
200-
histos.add("hImpactParameter", "Impact parameter", kTH1F, {{200, 0.0f, 20.0f}});
201-
histos.add("hEventPlaneAngle", "hEventPlaneAngle", kTH1F, {{200, -2.0f * TMath::Pi(), 2.0f * TMath::Pi()}});
202-
histos.add("hSparseKstarMCGenWeight", "hSparseKstarMCGenWeight", HistType::kTHnSparseD, {thnAxisCentrality, {36, 0.0f, TMath::Pi()}, {400, 0.0f, 1}, thnAxisPt, {8, -0.8, 0.8}});
203-
histos.add("hSparseKstarMCRecWeight", "hSparseKstarMCRecWeight", HistType::kTHnSparseD, {thnAxisCentrality, {36, 0.0f, TMath::Pi()}, {400, 0.0f, 1}, thnAxisPt, {8, -0.8, 0.8}});
204-
histos.add("hSparseKstarMCGenKaonWeight", "hSparseKstarMCGenKaonWeight", HistType::kTHnSparseD, {thnAxisCentrality, {36, 0.0f, TMath::Pi()}, {400, 0.0f, 1}, axisPtKaonWeight, {8, -0.8, 0.8}});
205-
histos.add("hSparseKstarMCRecKaonWeight", "hSparseKstarMCRecKaonWeight", HistType::kTHnSparseD, {thnAxisCentrality, {36, 0.0f, TMath::Pi()}, {400, 0.0f, 1}, axisPtKaonWeight, {8, -0.8, 0.8}});
206-
histos.add("hSparseKstarMCRecKaonMissMatchWeight", "hSparseKstarMCRecKaonMissMatchWeight", HistType::kTHnSparseD, {thnAxisCentrality, {36, 0.0f, TMath::Pi()}, {400, 0.0f, 1}, axisPtKaonWeight, {8, -0.8, 0.8}});
207-
histos.add("hSparseKstarMCGenPionWeight", "hSparseKstarMCGenPionWeight", HistType::kTHnSparseD, {thnAxisCentrality, {36, 0.0f, TMath::Pi()}, {400, 0.0f, 1}, axisPtKaonWeight, {8, -0.8, 0.8}});
208-
histos.add("hSparseKstarMCRecPionWeight", "hSparseKstarMCRecPionWeight", HistType::kTHnSparseD, {thnAxisCentrality, {36, 0.0f, TMath::Pi()}, {400, 0.0f, 1}, axisPtKaonWeight, {8, -0.8, 0.8}});
209-
histos.add("hSparseKstarMCRecPionMissMatchWeight", "hSparseKstarMCRecPionMissMatchWeight", HistType::kTHnSparseD, {thnAxisCentrality, {36, 0.0f, TMath::Pi()}, {400, 0.0f, 1}, axisPtKaonWeight, {8, -0.8, 0.8}});
210185

186+
if (fillSA) {
187+
histos.add("hSparseSAvsrapsameunlike", "hSparseSAvsrapsameunlike", HistType::kTHnSparseF, {configThnAxisInvMass, configThnAxisPt, configThnAxisV2, configrapAxis, configThnAxisCentrality}, true);
188+
histos.add("hSparseSAvsrapsamelike", "hSparseSAvsrapsamelike", HistType::kTHnSparseF, {configThnAxisInvMass, configThnAxisPt, configThnAxisV2, configrapAxis, configThnAxisCentrality}, true);
189+
histos.add("hSparseSAvsraprot", "hSparseSAvsraprot", HistType::kTHnSparseF, {configThnAxisInvMass, configThnAxisPt, configThnAxisV2, configrapAxis, configThnAxisCentrality}, true);
190+
histos.add("hSparseSAvsrapmix", "hSparseSAvsrapmix", HistType::kTHnSparseF, {configThnAxisInvMass, configThnAxisPt, configThnAxisV2, configrapAxis, configThnAxisCentrality}, true);
191+
}
192+
if (!fillSA) {
193+
histos.add("hSparseV2SAGen_V2", "hSparseV2SAGen_V2", HistType::kTHnSparseF, {configThnAxisInvMass, configThnAxisPt, configThnAxisV2, configThnAxisCentrality});
194+
histos.add("hSparseV2SARec_V2", "hSparseV2SARec_V2", HistType::kTHnSparseF, {configThnAxisInvMass, configThnAxisPt, configThnAxisV2, configThnAxisCentrality});
195+
histos.add("hpt", "hpt", kTH1F, {configThnAxisPt});
196+
histos.add("hMC", "MC Event statistics", kTH1F, {{10, 0.0f, 10.0f}});
197+
histos.add("h1PhiRecsplit", "Phi meson Rec split", kTH1F, {{100, 0.0f, 10.0f}});
198+
histos.add("CentPercentileMCRecHist", "MC Centrality", kTH1F, {{100, 0.0f, 100.0f}});
199+
histos.add("hSparseV2SAMixedEvent_V2", "hSparseV2SAMixedEvent_V2", HistType::kTHnSparseF, {configThnAxisInvMass, configThnAxisPt, configThnAxisV2, configThnAxisCentrality});
200+
histos.add("h2PhiGen2", "Phi meson gen", kTH2F, {configThnAxisPt, configThnAxisCentrality});
201+
histos.add("h2PhiRec2", "Phi meson Rec", kTH2F, {configThnAxisPt, configThnAxisCentrality});
202+
histos.add("hImpactParameter", "Impact parameter", kTH1F, {{200, 0.0f, 20.0f}});
203+
histos.add("hEventPlaneAngle", "hEventPlaneAngle", kTH1F, {{200, -2.0f * TMath::Pi(), 2.0f * TMath::Pi()}});
204+
histos.add("hSparseKstarMCGenWeight", "hSparseKstarMCGenWeight", HistType::kTHnSparseD, {configThnAxisCentrality, {36, 0.0f, TMath::Pi()}, {400, 0.0f, 1}, configThnAxisPt, {8, -0.8, 0.8}});
205+
histos.add("hSparseKstarMCRecWeight", "hSparseKstarMCRecWeight", HistType::kTHnSparseD, {configThnAxisCentrality, {36, 0.0f, TMath::Pi()}, {400, 0.0f, 1}, configThnAxisPt, {8, -0.8, 0.8}});
206+
histos.add("hSparseKstarMCGenKaonWeight", "hSparseKstarMCGenKaonWeight", HistType::kTHnSparseD, {configThnAxisCentrality, {36, 0.0f, TMath::Pi()}, {400, 0.0f, 1}, axisPtKaonWeight, {8, -0.8, 0.8}});
207+
histos.add("hSparseKstarMCRecKaonWeight", "hSparseKstarMCRecKaonWeight", HistType::kTHnSparseD, {configThnAxisCentrality, {36, 0.0f, TMath::Pi()}, {400, 0.0f, 1}, axisPtKaonWeight, {8, -0.8, 0.8}});
208+
histos.add("hSparseKstarMCRecKaonMissMatchWeight", "hSparseKstarMCRecKaonMissMatchWeight", HistType::kTHnSparseD, {configThnAxisCentrality, {36, 0.0f, TMath::Pi()}, {400, 0.0f, 1}, axisPtKaonWeight, {8, -0.8, 0.8}});
209+
histos.add("hSparseKstarMCGenPionWeight", "hSparseKstarMCGenPionWeight", HistType::kTHnSparseD, {configThnAxisCentrality, {36, 0.0f, TMath::Pi()}, {400, 0.0f, 1}, axisPtKaonWeight, {8, -0.8, 0.8}});
210+
histos.add("hSparseKstarMCRecPionWeight", "hSparseKstarMCRecPionWeight", HistType::kTHnSparseD, {configThnAxisCentrality, {36, 0.0f, TMath::Pi()}, {400, 0.0f, 1}, axisPtKaonWeight, {8, -0.8, 0.8}});
211+
histos.add("hSparseKstarMCRecPionMissMatchWeight", "hSparseKstarMCRecPionMissMatchWeight", HistType::kTHnSparseD, {configThnAxisCentrality, {36, 0.0f, TMath::Pi()}, {400, 0.0f, 1}, axisPtKaonWeight, {8, -0.8, 0.8}});
212+
}
211213
if (additionalQAplots1) {
212214
histos.add("hFTOCvsTPCSelected", "Mult correlation FT0C vs. TPC after selection", kTH2F, {{80, 0.0f, 80.0f}, {100, -0.5f, 5999.5f}});
213215
histos.add("hCentrality", "Centrality distribution", kTH1F, {{200, 0.0, 200.0}});
@@ -480,7 +482,10 @@ struct kstarpbpb {
480482
double v2, v2Rot;
481483

482484
using BinningTypeVertexContributor = ColumnBinningPolicy<aod::collision::PosZ, aod::cent::CentFT0C, aod::epcalibrationtable::PsiFT0C>;
483-
ROOT::Math::PxPyPzMVector KstarMother, daughter1, daughter2, kaonrot, kstarrot, KaonPlus, PionMinus;
485+
ROOT::Math::PxPyPzMVector KstarMother, fourVecDauCM, daughter1, daughter2, kaonrot, kstarrot, KaonPlus, PionMinus;
486+
ROOT::Math::XYZVector threeVecDauCM, threeVecDauCMXY, eventplaneVec, eventplaneVecNorm;
487+
ROOT::Math::PxPyPzMVector daughter2rot, fourVecDauCMrot;
488+
ROOT::Math::XYZVector threeVecDauCMrot, threeVecDauCMXYrot;
484489

485490
int currentRunNumber = -999;
486491
int lastRunNumber = -999;
@@ -613,13 +618,33 @@ struct kstarpbpb {
613618
histos.fill(HIST("ResTrackSPFT0CFT0A"), centrality, occupancy, QFT0C * QFT0A * TMath::Cos(2.0 * (psiFT0C - psiFT0A)));
614619
histos.fill(HIST("ResTrackSPFT0ATPC"), centrality, occupancy, QTPC * QFT0A * TMath::Cos(2.0 * (psiTPC - psiFT0A)));
615620
}
616-
if (same) {
617-
if (useWeight) {
618-
histos.fill(HIST("hSparseV2SASameEvent_V2"), KstarMother.M(), KstarMother.Pt(), v2, centrality, 1 / totalweight);
619-
} else {
620-
histos.fill(HIST("hSparseV2SASameEvent_V2"), KstarMother.M(), KstarMother.Pt(), v2, centrality);
621+
if (!fillSA) {
622+
if (same) {
623+
if (useWeight) {
624+
histos.fill(HIST("hSparseV2SASameEvent_V2"), KstarMother.M(), KstarMother.Pt(), v2, centrality, 1 / totalweight);
625+
} else {
626+
histos.fill(HIST("hSparseV2SASameEvent_V2"), KstarMother.M(), KstarMother.Pt(), v2, centrality);
627+
}
621628
}
622629
}
630+
int track1Sign = track1.sign();
631+
int track2Sign = track2.sign();
632+
633+
if (fillSA) {
634+
ROOT::Math::Boost boost{KstarMother.BoostToCM()};
635+
fourVecDauCM = boost(daughter1);
636+
threeVecDauCM = fourVecDauCM.Vect();
637+
threeVecDauCMXY = ROOT::Math::XYZVector(threeVecDauCM.X(), threeVecDauCM.Y(), 0.);
638+
eventplaneVec = ROOT::Math::XYZVector(std::cos(2.0 * psiFT0C), std::sin(2.0 * psiFT0C), 0);
639+
auto cosPhistarminuspsi = GetPhiInRange(fourVecDauCM.Phi() - psiFT0C);
640+
auto SA = TMath::Cos(2.0 * cosPhistarminuspsi);
641+
642+
if (track1Sign * track2Sign < 0)
643+
histos.fill(HIST("hSparseSAvsrapsameunlike"), KstarMother.M(), KstarMother.Pt(), SA, KstarMother.Rapidity(), centrality);
644+
else if (track1Sign * track2Sign > 0)
645+
histos.fill(HIST("hSparseSAvsrapsamelike"), KstarMother.M(), KstarMother.Pt(), SA, KstarMother.Rapidity(), centrality);
646+
}
647+
623648
if (fillRotation) {
624649
for (int nrotbkg = 0; nrotbkg < nBkgRotations; nrotbkg++) {
625650
auto anglestart = confMinRot;
@@ -642,15 +667,29 @@ struct kstarpbpb {
642667
if (!useSP) {
643668
v2Rot = TMath::Cos(2.0 * phiminuspsiRot);
644669
}
645-
histos.fill(HIST("hSparseV2SASameEventRotational_V2"), kstarrot.M(), kstarrot.Pt(), v2Rot, centrality);
670+
if (!fillSA)
671+
histos.fill(HIST("hSparseV2SASameEventRotational_V2"), kstarrot.M(), kstarrot.Pt(), v2Rot, centrality);
672+
673+
if (fillSA) {
674+
if (track1Sign * track2Sign < 0) {
675+
ROOT::Math::Boost boost{kstarrot.BoostToCM()};
676+
fourVecDauCMrot = boost(kaonrot);
677+
threeVecDauCMrot = fourVecDauCMrot.Vect();
678+
threeVecDauCMXYrot = ROOT::Math::XYZVector(threeVecDauCMrot.X(), threeVecDauCMrot.Y(), 0.);
679+
auto cosPhistarminuspsirot = GetPhiInRange(fourVecDauCMrot.Phi() - psiFT0C);
680+
auto SArot = TMath::Cos(2.0 * cosPhistarminuspsirot);
681+
682+
histos.fill(HIST("hSparseSAvsraprot"), kstarrot.M(), kstarrot.Pt(), SArot, kstarrot.Rapidity(), centrality);
683+
}
684+
}
646685
}
647686
}
648687
}
649688
}
650689
}
651690
PROCESS_SWITCH(kstarpbpb, processSE, "Process Same event latest", true);
652-
653-
void processSameEvent(EventCandidates::iterator const& collision, TrackCandidates const& /*tracks, aod::BCs const&*/, aod::BCsWithTimestamps const&)
691+
/*
692+
void processSameEvent(EventCandidates::iterator const& collision, TrackCandidates const& , aod::BCsWithTimestamps const&)
654693
{
655694
if (!collision.sel8()) {
656695
return;
@@ -878,6 +917,7 @@ struct kstarpbpb {
878917
}
879918
}
880919
PROCESS_SWITCH(kstarpbpb, processSameEvent, "Process Same event", false);
920+
881921
void processlikeEvent(EventCandidates::iterator const& collision, TrackCandidates const& tracks, aod::BCs const&)
882922
{
883923
if (!collision.sel8()) {
@@ -1037,6 +1077,8 @@ struct kstarpbpb {
10371077
}
10381078
10391079
PROCESS_SWITCH(kstarpbpb, processlikeEvent, "Process like event", false);
1080+
*/
1081+
10401082
void processMixedEvent(EventCandidates const& collisions, TrackCandidates const& tracks)
10411083
{
10421084

@@ -1102,22 +1144,35 @@ struct kstarpbpb {
11021144
if (isTOFOnly && !selectionPID2(track2, 1)) {
11031145
continue;
11041146
}
1105-
if (track1.sign() > 0 && track2.sign() < 0) {
1106-
daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa);
1107-
daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi);
1108-
} else if (track1.sign() < 0 && track2.sign() > 0) {
1109-
daughter2 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa);
1110-
daughter1 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi);
1111-
}
1147+
// if (track1.sign() > 0 && track2.sign() < 0) {
1148+
daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa);
1149+
daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi);
1150+
/*} else if (track1.sign() < 0 && track2.sign() > 0) {
1151+
daughter2 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa);
1152+
daughter1 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi);
1153+
}*/
11121154
KstarMother = daughter1 + daughter2;
11131155
if (TMath::Abs(KstarMother.Rapidity()) > confRapidity) {
11141156
continue;
11151157
}
11161158
auto phiminuspsi = GetPhiInRange(KstarMother.Phi() - psiFT0C);
11171159

11181160
v2 = TMath::Cos(2.0 * phiminuspsi) * QFT0C;
1161+
if (!fillSA) {
1162+
if (track1.sign() * track2.sign() < 0)
1163+
histos.fill(HIST("hSparseV2SAMixedEvent_V2"), KstarMother.M(), KstarMother.Pt(), v2, centrality);
1164+
}
1165+
if (fillSA) {
1166+
ROOT::Math::Boost boost{KstarMother.BoostToCM()};
1167+
fourVecDauCM = boost(daughter1);
1168+
threeVecDauCM = fourVecDauCM.Vect();
1169+
threeVecDauCMXY = ROOT::Math::XYZVector(threeVecDauCM.X(), threeVecDauCM.Y(), 0.);
1170+
eventplaneVec = ROOT::Math::XYZVector(std::cos(2.0 * psiFT0C), std::sin(2.0 * psiFT0C), 0);
1171+
auto cosPhistarminuspsi = GetPhiInRange(fourVecDauCM.Phi() - psiFT0C);
1172+
auto SA = TMath::Cos(2.0 * cosPhistarminuspsi);
11191173

1120-
histos.fill(HIST("hSparseV2SAMixedEvent_V2"), KstarMother.M(), KstarMother.Pt(), v2, centrality);
1174+
histos.fill(HIST("hSparseSAvsrapmix"), KstarMother.M(), KstarMother.Pt(), SA, KstarMother.Rapidity(), centrality);
1175+
}
11211176
}
11221177
}
11231178
}

0 commit comments

Comments
 (0)