Skip to content

Commit 193d3ac

Browse files
author
Sawan Sawan
committed
added mass correlation cut
1 parent 6dd28c1 commit 193d3ac

File tree

1 file changed

+61
-34
lines changed

1 file changed

+61
-34
lines changed

PWGLF/Tasks/Resonances/higherMassResonances.cxx

Lines changed: 61 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include <TMath.h>
4848
#include <TObjArray.h>
4949
#include <TPDGCode.h>
50+
#include <TVector2.h>
5051

5152
#include <algorithm>
5253
#include <array>
@@ -101,27 +102,28 @@ struct HigherMassResonances {
101102
Configurable<bool> isapplyPairRapidityRec{"isapplyPairRapidityRec", false, "Apply pair rapidity cut on reconstructed mother (after already applying rapidity cut on generated mother)"};
102103
Configurable<bool> isapplyPairRapidityGen{"isapplyPairRapidityGen", false, "Apply pair rapidity cut on generated mother (before applying rapidity cut on reconstructed mother)"};
103104
Configurable<int> cSelectMultEstimator{"cSelectMultEstimator", 0, "Select multiplicity estimator: 0 - FT0M, 1 - FT0A, 2 - FT0C"};
104-
Configurable<int> configOccCut{"configOccCut", 1000, "Occupancy cut"};
105+
// Configurable<int> configOccCut{"configOccCut", 1000, "Occupancy cut"};
105106
Configurable<bool> isVertexTOFMatched{"isVertexTOFMatched", false, "Vertex TOF Matched"};
106107
Configurable<bool> isNoCollInTimeRangeStandard{"isNoCollInTimeRangeStandard", false, "No collision in time range standard"};
107108
Configurable<bool> isSel8{"isSel8", false, "Event Selection 8"};
108109

109110
// Configurables for event selection
110111
// Configurable<bool> isINELgt0{"isINELgt0", true, "INEL>0 selection"};
111112
Configurable<bool> isTriggerTVX{"isTriggerTVX", false, "TriggerTVX"};
112-
Configurable<bool> isGoodZvtxFT0vsPV{"isGoodZvtxFT0vsPV", false, "IsGoodZvtxFT0vsPV"};
113-
Configurable<bool> isApplyOccCut{"isApplyOccCut", true, "Apply occupancy cut"};
113+
// Configurable<bool> isGoodZvtxFT0vsPV{"isGoodZvtxFT0vsPV", false, "IsGoodZvtxFT0vsPV"};
114+
// Configurable<bool> isApplyOccCut{"isApplyOccCut", true, "Apply occupancy cut"};
114115
Configurable<float> cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"};
115116
Configurable<bool> timFrameEvsel{"timFrameEvsel", true, "TPC Time frame boundary cut"};
116-
Configurable<bool> isNoSameBunchPileup{"isNoSameBunchPileup", true, "kNoSameBunchPileup"};
117+
// Configurable<bool> isNoSameBunchPileup{"isNoSameBunchPileup", true, "kNoSameBunchPileup"};
117118
Configurable<bool> isAllLayersGoodITS{"isAllLayersGoodITS", true, "Require all ITS layers to be good"};
118119
Configurable<bool> isNoTimeFrameBorder{"isNoTimeFrameBorder", true, "kNoTimeFrameBorder"};
119120
Configurable<bool> isNoITSROFrameBorder{"isNoITSROFrameBorder", true, "kNoITSROFrameBorder"};
120121

121122
// Configurable parameters for V0 selection
123+
Configurable<float> cMaxDeltaM{"cMaxDeltaM", 0.01f, "Sqrt((m1-mPDG)^2 + (m2-mPDG)^2) < cMaxDeltaM)"};
122124
Configurable<float> confV0DCADaughMax{"confV0DCADaughMax", 1.0f, "DCA b/w V0 daughters"};
123-
Configurable<float> v0settingDcapostopv{"v0settingDcapostopv", 0.06, "DCA Pos To PV"};
124-
Configurable<float> v0settingDcanegtopv{"v0settingDcanegtopv", 0.06, "DCA Neg To PV"};
125+
Configurable<float> v0DCApostoPV{"v0DCApostoPV", 0.06, "DCA Pos To PV"};
126+
Configurable<float> v0DCAnegtoPV{"v0DCAnegtoPV", 0.06, "DCA Neg To PV"};
125127
Configurable<double> cMaxV0DCA{"cMaxV0DCA", 0.5, "DCA V0 to PV"};
126128
Configurable<float> confV0PtMin{"confV0PtMin", 0.f, "Minimum transverse momentum of V0"};
127129
Configurable<float> confV0CPAMin{"confV0CPAMin", 0.97f, "Minimum CPA of V0"};
@@ -137,7 +139,7 @@ struct HigherMassResonances {
137139
Configurable<float> confKsrapidity{"confKsrapidity", 0.5f, "Rapidity cut on K0s"};
138140
Configurable<float> angSepCut{"angSepCut", 0.01f, "Angular separation cut"};
139141
Configurable<bool> isapplyAngSepCut{"isapplyAngSepCut", false, "Apply angular separation cut"};
140-
Configurable<bool> isStandardV0{"isStandardV0", false, "Standard V0 selection"};
142+
// Configurable<bool> isStandardV0{"isStandardV0", false, "Standard V0 selection"};
141143
Configurable<bool> isApplyEtaCutK0s{"isApplyEtaCutK0s", false, "Apply eta cut on K0s daughters"};
142144
Configurable<float> cfgETAcut{"cfgETAcut", 0.8f, "Track ETA cut"};
143145

@@ -147,9 +149,8 @@ struct HigherMassResonances {
147149
ConfigurableAxis binsCent{"binsCent", {VARIABLE_WIDTH, 0., 5., 10., 30., 50., 70., 100., 110., 150.}, "Binning of the centrality axis"};
148150

149151
// Configurable for MC
150-
Configurable<bool> isMC{"isMC", false, "Is MC"};
152+
// Configurable<bool> isMC{"isMC", false, "Is MC"};
151153
Configurable<bool> isallGenCollisions{"isallGenCollisions", true, "To fill all generated collisions for the signal loss calculations"};
152-
Configurable<bool> iscTVXEvsel{"iscTVXEvsel", true, "Triggger selection"};
153154
Configurable<bool> isavoidsplitrackMC{"isavoidsplitrackMC", false, "avoid split track in MC"};
154155
Configurable<bool> isapplyRapidityMC{"isapplyRapidityMC", true, "Apply rapidity cut on generated and reconstructed particles"};
155156
Configurable<int> selectMCparticles{"selectMCparticles", 1, "0: f0(1710), 1: f2(1525), 2: a2(1320), 3: f0(1370), 4: f0(1500), 5: f2(1270)"};
@@ -324,7 +325,7 @@ struct HigherMassResonances {
324325
if (config.qAv0) {
325326
// Invariant Mass
326327
rKzeroShort.add("hMassK0Shortbefore", "hMassK0Shortbefore", kTHnSparseF, {k0ShortMassAxis, ptAxis});
327-
rKzeroShort.add("hMasscorrelationbefore", "hMasscorrelationbefore", kTH2F, {k0ShortMassAxis, k0ShortMassAxis});
328+
rKzeroShort.add("hK0ShortMassCorr", "hK0ShortMassCorr", kTH2F, {k0ShortMassAxis, k0ShortMassAxis});
328329
rKzeroShort.add("hMassK0ShortSelected", "hMassK0ShortSelected", kTHnSparseF, {k0ShortMassAxis, ptAxis});
329330
// Topological histograms (after the selection)
330331
rKzeroShort.add("hDCAV0Daughters", "DCA between v0 daughters", {HistType::kTH1F, {{60, -3.0f, 3.0f}}});
@@ -343,7 +344,7 @@ struct HigherMassResonances {
343344
}
344345

345346
// For MC
346-
if (config.isMC) {
347+
if (doprocessGen || doprocessRec) {
347348
hMChists.add("Genf1710", "Gen f_{0}(1710)", kTHnSparseF, {multiplicityAxis, ptAxis, thnAxisPOL});
348349
hMChists.add("Genf17102", "Gen f_{0}(1710)", kTHnSparseF, {multiplicityAxis, ptAxis, thnAxisPOL});
349350
hMChists.add("Recf1710_pt1", "Rec f_{0}(1710) p_{T}", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL});
@@ -394,8 +395,8 @@ struct HigherMassResonances {
394395
if (fillHist)
395396
rEventSelection.fill(HIST("hEventCut"), 4);
396397

397-
if (config.isNoSameBunchPileup && (!collision.selection_bit(aod::evsel::kNoSameBunchPileup)))
398-
return false;
398+
// if (config.isNoSameBunchPileup && (!collision.selection_bit(aod::evsel::kNoSameBunchPileup)))
399+
// return false;
399400
if (fillHist)
400401
rEventSelection.fill(HIST("hEventCut"), 5);
401402

@@ -407,8 +408,8 @@ struct HigherMassResonances {
407408
// if (config.isNoCollInTimeRangeStandard && (!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)))
408409
// return false;
409410

410-
if (config.isApplyOccCut && (std::abs(collision.trackOccupancyInTimeRange()) > config.configOccCut))
411-
return false;
411+
// if (config.isApplyOccCut && (std::abs(collision.trackOccupancyInTimeRange()) > config.configOccCut))
412+
// return false;
412413
if (fillHist)
413414
rEventSelection.fill(HIST("hEventCut"), 7);
414415

@@ -422,8 +423,8 @@ struct HigherMassResonances {
422423
if (fillHist)
423424
rEventSelection.fill(HIST("hEventCut"), 9);
424425

425-
if (config.isGoodZvtxFT0vsPV && !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV))
426-
return false;
426+
// if (config.isGoodZvtxFT0vsPV && !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV))
427+
// return false;
427428
if (fillHist)
428429
rEventSelection.fill(HIST("hEventCut"), 10);
429430

@@ -526,9 +527,9 @@ struct HigherMassResonances {
526527
rKzeroShort.fill(HIST("hMassK0ShortSelected"), candidate.mK0Short(), candidate.pt());
527528
}
528529

529-
if (config.isStandardV0 && candidate.v0Type() != 1) {
530-
return false; // Only standard V0s are selected
531-
}
530+
// if (config.isStandardV0 && candidate.v0Type() != 1) {
531+
// return false; // Only standard V0s are selected
532+
// }
532533
rEventSelection.fill(HIST("htrackscheck_v0"), 10.5);
533534

534535
if (candidate.mK0Short() < lowmasscutks0 || candidate.mK0Short() > highmasscutks0) {
@@ -604,6 +605,13 @@ struct HigherMassResonances {
604605
return true;
605606
}
606607

608+
double deltaM(double m1, double m2)
609+
{
610+
const double d1 = m1 - o2::constants::physics::MassK0Short;
611+
const double d2 = m2 - o2::constants::physics::MassK0Short;
612+
return std::sqrt(d1 * d1 + d2 * d2);
613+
}
614+
607615
using EventCandidatesDerivedData = soa::Join<aod::StraCollisions, aod::StraCents, aod::StraEvSels, aod::StraStamps>;
608616
using V0CandidatesDerivedData = soa::Join<aod::V0CollRefs, aod::V0Cores, aod::V0Extras, aod::V0TOFPIDs, aod::V0TOFNSigmas>;
609617
// using DauTracks = soa::Join<aod::DauTrackExtras, aod::DauTrackTPCPIDs, aod::DauTrackTOFPIDs>;
@@ -671,7 +679,9 @@ struct HigherMassResonances {
671679
phi1 = candidate1.phi();
672680
phi2 = candidate2.phi();
673681

674-
double angle = std::sqrt(std::pow(eta1 - eta2, 2) + std::pow(phi1 - phi2, 2));
682+
const double dphi = TVector2::Phi_mpi_pi(phi1 - phi2);
683+
const double deta = eta1 - eta2;
684+
double angle = std::sqrt(dphi * dphi + deta * deta);
675685
if (config.qAv0) {
676686
rKzeroShort.fill(HIST("angularSeparation"), angle);
677687
}
@@ -687,7 +697,7 @@ struct HigherMassResonances {
687697
Filter acceptenceFilter = (nabs(aod::track::eta) < config.cfgETAcut && nabs(aod::track::pt) > config.cfgPTcut);
688698

689699
// Filters on V0s
690-
Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > config.v0settingDcapostopv && nabs(aod::v0data::dcanegtopv) > config.v0settingDcanegtopv);
700+
Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > config.v0DCApostoPV && nabs(aod::v0data::dcanegtopv) > config.v0DCAnegtoPV);
691701

692702
// Defining the type of the daughter tracks
693703
using EventCandidates = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::FT0Mults, aod::FV0Mults, aod::MultZeqs, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::CentFV0As, aod::Mults, aod::PVMults>>;
@@ -1002,16 +1012,22 @@ struct HigherMassResonances {
10021012
continue;
10031013
}
10041014

1005-
if (config.qAv0) {
1006-
rKzeroShort.fill(HIST("hMasscorrelationbefore"), v1.mK0Short(), v2.mK0Short());
1007-
}
10081015
allConditionsMet = 1;
10091016
daughter1 = ROOT::Math::PxPyPzMVector(v1.px(), v1.py(), v1.pz(), o2::constants::physics::MassK0Short); // Kshort
10101017
daughter2 = ROOT::Math::PxPyPzMVector(v2.px(), v2.py(), v2.pz(), o2::constants::physics::MassK0Short); // Kshort
10111018

10121019
mother = daughter1 + daughter2; // invariant mass of Kshort pair
10131020
isMix = false;
10141021

1022+
if (config.qAv0) {
1023+
rKzeroShort.fill(HIST("hK0ShortMassCorr"), v1.mK0Short(), v2.mK0Short());
1024+
}
1025+
1026+
const double deltaMass = deltaM(v1.mK0Short(), v2.mK0Short());
1027+
if (deltaMass > config.cMaxDeltaM) {
1028+
continue;
1029+
}
1030+
10151031
if (!config.isselectTWOKsOnly)
10161032
fillInvMass(mother, multiplicity, daughter1, daughter2, isMix);
10171033
}
@@ -1129,9 +1145,9 @@ struct HigherMassResonances {
11291145

11301146
void processGen(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups<EventCandidatesMC>& collisions)
11311147
{
1132-
if (config.isMC == false) {
1133-
return;
1134-
}
1148+
// if (config.isMC == false) {
1149+
// return;
1150+
// }
11351151
hMChists.fill(HIST("events_check"), 0.5);
11361152

11371153
std::vector<int64_t> selectedEvents(collisions.size());
@@ -1240,9 +1256,9 @@ struct HigherMassResonances {
12401256
std::vector<int> gindex1, gindex2;
12411257
void processRec(EventCandidatesMC::iterator const& collision, TrackCandidatesMC const&, V0TrackCandidatesMC const& V0s, aod::McParticles const&, aod::McCollisions const& /*mcCollisions*/)
12421258
{
1243-
if (config.isMC == false) {
1244-
return;
1245-
}
1259+
// if (config.isMC == false) {
1260+
// return;
1261+
// }
12461262

12471263
auto multiplicity = -999.0;
12481264
if (config.cSelectMultEstimator == kFT0M) {
@@ -1392,6 +1408,11 @@ struct HigherMassResonances {
13921408

13931409
auto helicityRec2 = mother1.Vect().Dot(fourVecDauCM1.Vect()) / (std::sqrt(fourVecDauCM1.Vect().Mag2()) * std::sqrt(mother1.Vect().Mag2()));
13941410

1411+
// const double deltaMassRec = deltaM(mctrackv01.mK0Short(), mctrackv02.mK0Short());
1412+
// if (deltaMassRec > config.cMaxDeltaM) {
1413+
// continue;
1414+
// }
1415+
13951416
hMChists.fill(HIST("Recf1710_pt1"), multiplicity, mothertrack1.pt(), mother1.M(), helicityRec2);
13961417
hMChists.fill(HIST("RecRapidity"), mothertrack1.y());
13971418
hMChists.fill(HIST("RecPhi"), mothertrack1.phi());
@@ -1470,16 +1491,22 @@ struct HigherMassResonances {
14701491
continue;
14711492
}
14721493

1473-
if (config.qAv0) {
1474-
rKzeroShort.fill(HIST("hMasscorrelationbefore"), v1.mK0Short(), v2.mK0Short());
1475-
}
14761494
allConditionsMet = 1;
14771495
daughter1 = ROOT::Math::PxPyPzMVector(v1.px(), v1.py(), v1.pz(), o2::constants::physics::MassK0Short); // Kshort
14781496
daughter2 = ROOT::Math::PxPyPzMVector(v2.px(), v2.py(), v2.pz(), o2::constants::physics::MassK0Short); // Kshort
14791497

14801498
mother = daughter1 + daughter2; // invariant mass of Kshort pair
14811499
isMix = false;
14821500

1501+
if (config.qAv0) {
1502+
rKzeroShort.fill(HIST("hK0ShortMassCorr"), v1.mK0Short(), v2.mK0Short());
1503+
}
1504+
1505+
const double deltaMass = deltaM(v1.mK0Short(), v2.mK0Short());
1506+
if (deltaMass > config.cMaxDeltaM) {
1507+
continue;
1508+
}
1509+
14831510
if (!config.isselectTWOKsOnly)
14841511
fillInvMass(mother, multiplicity, daughter1, daughter2, isMix);
14851512
}

0 commit comments

Comments
 (0)