Skip to content

Commit cf24950

Browse files
author
Prottay Das
committed
updated existing kstarflow code with spin alignment
1 parent fb507dc commit cf24950

File tree

1 file changed

+113
-57
lines changed

1 file changed

+113
-57
lines changed

PWGLF/Tasks/Resonances/kstarpbpb.cxx

Lines changed: 113 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111
// sourav.kundu@cern.ch , sarjeeta.gami@cern.ch
12+
// prottay.das@cern.ch (spin alignment)
1213

1314
#include <TH1F.h>
1415
#include <TDirectory.h>
@@ -20,7 +21,6 @@
2021
#include <TH2F.h>
2122
#include <TLorentzVector.h>
2223
#include <TPDGCode.h>
23-
#include <TDatabasePDG.h>
2424
#include <cmath>
2525
#include <array>
2626
#include <cstdlib>
@@ -39,7 +39,6 @@
3939
#include "Framework/AnalysisDataModel.h"
4040
#include "Framework/HistogramRegistry.h"
4141
#include "Framework/StepTHn.h"
42-
#include "Framework/O2DatabasePDGPlugin.h"
4342
#include "Common/DataModel/PIDResponse.h"
4443
#include "Common/DataModel/Multiplicity.h"
4544
#include "Common/DataModel/Centrality.h"
@@ -63,10 +62,6 @@ using namespace o2::framework::expressions;
6362
using std::array;
6463
struct kstarpbpb {
6564

66-
int mRunNumber;
67-
int multEstimator;
68-
float d_bz;
69-
7065
struct : ConfigurableGroup {
7166
Configurable<std::string> cfgURL{"cfgURL", "http://alice-ccdb.cern.ch", "Address of the CCDB to browse"};
7267
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 +70,7 @@ struct kstarpbpb {
7570
// Enable access to the CCDB for the offset and correction constants and save them in dedicated variables.
7671
Service<o2::ccdb::BasicCCDBManager> ccdb;
7772
o2::ccdb::CcdbApi ccdbApi;
78-
Service<o2::framework::O2DatabasePDG> pdg;
73+
// Service<o2::framework::O2DatabasePDG> pdg;
7974

8075
// CCDB options
8176
// Configurable<std::string> ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
@@ -107,9 +102,9 @@ struct kstarpbpb {
107102
ConfigurableAxis configThnAxisInvMass{"configThnAxisInvMass", {180, 0.6, 1.5}, "#it{M} (GeV/#it{c}^{2})"};
108103
ConfigurableAxis configThnAxisPt{"configThnAxisPt", {100, 0.0, 10.}, "#it{p}_{T} (GeV/#it{c})"};
109104
ConfigurableAxis configThnAxisCentrality{"configThnAxisCentrality", {8, 0., 80}, "Centrality"};
105+
ConfigurableAxis configrapAxis{"configrapAxis", {VARIABLE_WIDTH, -0.8, -0.4, 0.4, 0.8}, "Rapidity"};
110106
Configurable<bool> removefaketrak{"removefaketrack", true, "Remove fake track from momentum difference"};
111107
Configurable<float> ConfFakeKaonCut{"ConfFakeKaonCut", 0.1, "Cut based on track from momentum difference"};
112-
ConfigurableAxis configThnAxisPhiminusPsi{"configThnAxisPhiminusPsi", {6, 0.0, TMath::Pi()}, "#phi - #psi"};
113108
ConfigurableAxis configThnAxisV2{"configThnAxisV2", {400, -16, 16}, "V2"};
114109
Configurable<bool> additionalEvsel{"additionalEvsel", false, "Additional event selcection"};
115110
Configurable<bool> timFrameEvsel{"timFrameEvsel", false, "TPC Time frame boundary cut"};
@@ -127,6 +122,7 @@ struct kstarpbpb {
127122
Configurable<bool> fillRotation{"fillRotation", true, "fill rotation"};
128123
Configurable<bool> same{"same", true, "same event"};
129124
Configurable<bool> like{"like", false, "like-sign"};
125+
Configurable<bool> fillSA{"fillSA", true, "same event SA"};
130126
Configurable<bool> fillOccupancy{"fillOccupancy", false, "fill Occupancy"};
131127
Configurable<int> cfgOccupancyCut{"cfgOccupancyCut", 500, "Occupancy cut"};
132128
Configurable<bool> useWeight{"useWeight", false, "use EP dep effi weight"};
@@ -168,46 +164,53 @@ struct kstarpbpb {
168164
void init(o2::framework::InitContext&)
169165
{
170166
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"};
176167
AxisSpec phiAxis = {500, -6.28, 6.28, "phi"};
177168
AxisSpec resAxis = {6000, -30, 30, "Res"};
178169
AxisSpec centAxis = {8, 0, 80, "V0M (%)"};
179170
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});
171+
if (!fillSA) {
172+
if (same) {
173+
histos.add("hSparseV2SASameEvent_V2", "hSparseV2SASameEvent_V2", HistType::kTHnSparseF, {configThnAxisInvMass, configThnAxisPt, configThnAxisV2, configThnAxisCentrality});
174+
}
175+
if (like) {
176+
histos.add("hSparseV2SAlikeEventNN_V2", "hSparseV2SAlikeEventNN_V2", HistType::kTHnSparseF, {configThnAxisInvMass, configThnAxisPt, configThnAxisV2, configThnAxisCentrality});
177+
histos.add("hSparseV2SAlikeEventPP_V2", "hSparseV2SAlikeEventPP_V2", HistType::kTHnSparseF, {configThnAxisInvMass, configThnAxisPt, configThnAxisV2, configThnAxisCentrality});
178+
}
186179
}
187180
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});
181+
if (!fillSA) {
182+
histos.add("hRotation", "hRotation", kTH1F, {{360, 0.0, 2.0 * TMath::Pi()}});
183+
histos.add("hSparseV2SASameEventRotational_V2", "hSparseV2SASameEventRotational_V2", HistType::kTHnSparseF, {configThnAxisInvMass, configThnAxisPt, configThnAxisV2, configThnAxisCentrality});
184+
}
190185
}
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}});
210186

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

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

485491
int currentRunNumber = -999;
486492
int lastRunNumber = -999;
@@ -613,13 +619,33 @@ struct kstarpbpb {
613619
histos.fill(HIST("ResTrackSPFT0CFT0A"), centrality, occupancy, QFT0C * QFT0A * TMath::Cos(2.0 * (psiFT0C - psiFT0A)));
614620
histos.fill(HIST("ResTrackSPFT0ATPC"), centrality, occupancy, QTPC * QFT0A * TMath::Cos(2.0 * (psiTPC - psiFT0A)));
615621
}
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);
622+
if (!fillSA) {
623+
if (same) {
624+
if (useWeight) {
625+
histos.fill(HIST("hSparseV2SASameEvent_V2"), KstarMother.M(), KstarMother.Pt(), v2, centrality, 1 / totalweight);
626+
} else {
627+
histos.fill(HIST("hSparseV2SASameEvent_V2"), KstarMother.M(), KstarMother.Pt(), v2, centrality);
628+
}
621629
}
622630
}
631+
int track1Sign = track1.sign();
632+
int track2Sign = track2.sign();
633+
634+
if (fillSA) {
635+
ROOT::Math::Boost boost{KstarMother.BoostToCM()};
636+
fourVecDauCM = boost(daughter1);
637+
threeVecDauCM = fourVecDauCM.Vect();
638+
threeVecDauCMXY = ROOT::Math::XYZVector(threeVecDauCM.X(), threeVecDauCM.Y(), 0.);
639+
eventplaneVec = ROOT::Math::XYZVector(std::cos(2.0 * psiFT0C), std::sin(2.0 * psiFT0C), 0);
640+
auto cosPhistarminuspsi = GetPhiInRange(fourVecDauCM.Phi() - psiFT0C);
641+
auto SA = TMath::Cos(2.0 * cosPhistarminuspsi);
642+
643+
if (track1Sign * track2Sign < 0)
644+
histos.fill(HIST("hSparseSAvsrapsameunlike"), KstarMother.M(), KstarMother.Pt(), SA, KstarMother.Rapidity(), centrality);
645+
else if (track1Sign * track2Sign > 0)
646+
histos.fill(HIST("hSparseSAvsrapsamelike"), KstarMother.M(), KstarMother.Pt(), SA, KstarMother.Rapidity(), centrality);
647+
}
648+
623649
if (fillRotation) {
624650
for (int nrotbkg = 0; nrotbkg < nBkgRotations; nrotbkg++) {
625651
auto anglestart = confMinRot;
@@ -642,15 +668,29 @@ struct kstarpbpb {
642668
if (!useSP) {
643669
v2Rot = TMath::Cos(2.0 * phiminuspsiRot);
644670
}
645-
histos.fill(HIST("hSparseV2SASameEventRotational_V2"), kstarrot.M(), kstarrot.Pt(), v2Rot, centrality);
671+
if (!fillSA)
672+
histos.fill(HIST("hSparseV2SASameEventRotational_V2"), kstarrot.M(), kstarrot.Pt(), v2Rot, centrality);
673+
674+
if (fillSA) {
675+
if (track1Sign * track2Sign < 0) {
676+
ROOT::Math::Boost boost{kstarrot.BoostToCM()};
677+
fourVecDauCMrot = boost(kaonrot);
678+
threeVecDauCMrot = fourVecDauCMrot.Vect();
679+
threeVecDauCMXYrot = ROOT::Math::XYZVector(threeVecDauCMrot.X(), threeVecDauCMrot.Y(), 0.);
680+
auto cosPhistarminuspsirot = GetPhiInRange(fourVecDauCMrot.Phi() - psiFT0C);
681+
auto SArot = TMath::Cos(2.0 * cosPhistarminuspsirot);
682+
683+
histos.fill(HIST("hSparseSAvsraprot"), kstarrot.M(), kstarrot.Pt(), SArot, kstarrot.Rapidity(), centrality);
684+
}
685+
}
646686
}
647687
}
648688
}
649689
}
650690
}
651691
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&)
692+
/*
693+
void processSameEvent(EventCandidates::iterator const& collision, TrackCandidates const& , aod::BCsWithTimestamps const&)
654694
{
655695
if (!collision.sel8()) {
656696
return;
@@ -878,6 +918,7 @@ struct kstarpbpb {
878918
}
879919
}
880920
PROCESS_SWITCH(kstarpbpb, processSameEvent, "Process Same event", false);
921+
881922
void processlikeEvent(EventCandidates::iterator const& collision, TrackCandidates const& tracks, aod::BCs const&)
882923
{
883924
if (!collision.sel8()) {
@@ -1037,6 +1078,8 @@ struct kstarpbpb {
10371078
}
10381079
10391080
PROCESS_SWITCH(kstarpbpb, processlikeEvent, "Process like event", false);
1081+
*/
1082+
10401083
void processMixedEvent(EventCandidates const& collisions, TrackCandidates const& tracks)
10411084
{
10421085

@@ -1102,22 +1145,35 @@ struct kstarpbpb {
11021145
if (isTOFOnly && !selectionPID2(track2, 1)) {
11031146
continue;
11041147
}
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-
}
1148+
// if (track1.sign() > 0 && track2.sign() < 0) {
1149+
daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa);
1150+
daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi);
1151+
/*} else if (track1.sign() < 0 && track2.sign() > 0) {
1152+
daughter2 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa);
1153+
daughter1 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi);
1154+
}*/
11121155
KstarMother = daughter1 + daughter2;
11131156
if (TMath::Abs(KstarMother.Rapidity()) > confRapidity) {
11141157
continue;
11151158
}
11161159
auto phiminuspsi = GetPhiInRange(KstarMother.Phi() - psiFT0C);
11171160

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

1120-
histos.fill(HIST("hSparseV2SAMixedEvent_V2"), KstarMother.M(), KstarMother.Pt(), v2, centrality);
1175+
histos.fill(HIST("hSparseSAvsrapmix"), KstarMother.M(), KstarMother.Pt(), SA, KstarMother.Rapidity(), centrality);
1176+
}
11211177
}
11221178
}
11231179
}

0 commit comments

Comments
 (0)