1313// / \brief Analysis task for the Phi and K0S rapidity correlations analysis
1414// / \author Stefano Cannito (stefano.cannito@cern.ch)
1515
16- #include < cstdlib>
17-
18- #include < cmath>
19- #include < array>
20- #include < vector>
21- #include < algorithm>
22- #include < string>
23- #include < utility>
24-
2516#include < TH1F.h>
2617#include < TH2F.h>
2718#include < THn.h>
3526#include < TPDGCode.h>
3627#include < Math/Vector4D.h>
3728
29+ #include < cstdlib>
30+ #include < cmath>
31+ #include < array>
32+ #include < vector>
33+ #include < algorithm>
34+ #include < string>
35+ #include < utility>
36+
3837#include " Framework/runDataProcessing.h"
3938#include " Framework/AnalysisTask.h"
4039#include " Common/DataModel/EventSelection.h"
@@ -85,7 +84,7 @@ struct Phik0shortanalysis {
8584
8685 // Configurables for track selection (not necessarily common for trigger and the two associated particles)
8786 struct : ConfigurableGroup {
88- Configurable<float > cfgCutCharge{" cfgCutCharge" , 0.0 , " Cut on charge" };
87+ Configurable<float > cfgCutCharge{" cfgCutCharge" , 0 .0f , " Cut on charge" };
8988 Configurable<bool > cfgPrimaryTrack{" cfgPrimaryTrack" , false , " Primary track selection" };
9089 Configurable<bool > cfgGlobalWoDCATrack{" cfgGlobalWoDCATrack" , true , " Global track selection without DCA" };
9190 Configurable<bool > cfgPVContributor{" cfgPVContributor" , true , " PV contributor track selection" };
@@ -97,10 +96,10 @@ struct Phik0shortanalysis {
9796 Configurable<float > etaMax{" etaMax" , 0 .8f , " eta max" };
9897
9998 Configurable<bool > isNoTOF{" isNoTOF" , false , " isNoTOF" };
100- Configurable<float > nSigmaCutTPCKa{" nSigmaCutTPCKa" , 3.0 , " Value of the TPC Nsigma cut for Kaons" };
101- Configurable<float > nSigmaCutCombinedKa{" nSigmaCutCombinedKa" , 3.0 , " Value of the TOF Nsigma cut for Kaons" };
99+ Configurable<float > nSigmaCutTPCKa{" nSigmaCutTPCKa" , 3 .0f , " Value of the TPC Nsigma cut for Kaons" };
100+ Configurable<float > nSigmaCutCombinedKa{" nSigmaCutCombinedKa" , 3 .0f , " Value of the TOF Nsigma cut for Kaons" };
102101
103- Configurable<float > nSigmaCutTPCPion{" nSigmaCutTPCPion" , 4.0 , " Value of the TPC Nsigma cut for Pions" };
102+ Configurable<float > nSigmaCutTPCPion{" nSigmaCutTPCPion" , 4 .0f , " Value of the TPC Nsigma cut for Pions" };
104103 Configurable<float > cMinPionPtcut{" cMinPionPtcut" , 0 .3f , " Track minimum pt cut" };
105104 Configurable<int > minTPCnClsFound{" minTPCnClsFound" , 70 , " min number of found TPC clusters" };
106105 Configurable<int > minNCrossedRowsTPC{" minNCrossedRowsTPC" , 80 , " min number of TPC crossed rows" };
@@ -111,31 +110,33 @@ struct Phik0shortanalysis {
111110
112111 // Configurables on phi pT bins
113112 Configurable<std::vector<double >> binspTPhi{" binspTPhi" , {0.4 , 0.8 , 1.4 , 2.0 , 2.8 , 4.0 , 6.0 , 10.0 }, " pT bin limits for Phi" };
113+ Configurable<float > minPhiPt{" minPhiPt" , 0 .4f , " Minimum pT for Phi" };
114114
115115 // Configurables on phi mass
116116 Configurable<int > nBinsMPhi{" nBinsMPhi" , 13 , " N bins in cfgmassPhiaxis" };
117- Configurable<float > lowMPhi{" lowMPhi" , 1.0095 , " Upper limits on Phi mass for signal extraction" };
118- Configurable<float > upMPhi{" upMPhi" , 1.029 , " Upper limits on Phi mass for signal extraction" };
117+ Configurable<float > lowMPhi{" lowMPhi" , 1 .0095f , " Upper limits on Phi mass for signal extraction" };
118+ Configurable<float > upMPhi{" upMPhi" , 1 .029f , " Upper limits on Phi mass for signal extraction" };
119119
120120 // Configurables for V0 selection
121121 struct : ConfigurableGroup {
122- Configurable<float > v0SettingCosPA{" v0SettingCosPA" , 0.98 , " V0 CosPA" };
123- Configurable<float > v0SettingRadius{" v0SettingRadius" , 0.5 , " v0radius" };
124- Configurable<float > v0SettingDCAV0Dau{" v0SettingDCAV0Dau" , 1 , " DCA V0 Daughters" };
125- Configurable<float > v0SettingDCAPosToPV{" v0SettingDCAPosToPV" , 0.06 , " DCA Pos To PV" };
126- Configurable<float > v0SettingDCANegToPV{" v0SettingDCANegToPV" , 0.06 , " DCA Neg To PV" };
122+ Configurable<float > v0SettingCosPA{" v0SettingCosPA" , 0 .98f , " V0 CosPA" };
123+ Configurable<float > v0SettingRadius{" v0SettingRadius" , 0 .5f , " v0radius" };
124+ Configurable<float > v0SettingDCAV0Dau{" v0SettingDCAV0Dau" , 1 .0f , " DCA V0 Daughters" };
125+ Configurable<float > v0SettingDCAPosToPV{" v0SettingDCAPosToPV" , 0 .06f , " DCA Pos To PV" };
126+ Configurable<float > v0SettingDCANegToPV{" v0SettingDCANegToPV" , 0 .06f , " DCA Neg To PV" };
127+ Configurable<float > v0SettingMinPt{" v0SettingMinPt" , 0 .1f , " V0 min pt" };
127128
128129 Configurable<bool > cfgisV0ForData{" cfgisV0ForData" , true , " isV0ForData" };
129130
130131 Configurable<bool > cfgFurtherV0Selection{" cfgFurtherV0Selection" , false , " Further V0 selection" };
131132 Configurable<float > ctauK0s{" ctauK0s" , 20 .0f , " C tau K0s(cm)" };
132- Configurable<float > paramArmenterosCut{" paramArmenterosCut" , 0.2 , " parameter Armenteros Cut" };
133- Configurable<float > v0rejK0s{" v0rejK0s" , 0.005 , " V0 rej K0s" };
133+ Configurable<float > paramArmenterosCut{" paramArmenterosCut" , 0 .2f , " parameter Armenteros Cut" };
134+ Configurable<float > v0rejK0s{" v0rejK0s" , 0 .005f , " V0 rej K0s" };
134135 } v0Configs;
135136
136137 // Configurables on K0S mass
137- Configurable<float > lowMK0S{" lowMK0S" , 0.48 , " Lower limit on K0Short mass" };
138- Configurable<float > upMK0S{" upMK0S" , 0.52 , " Upper limit on K0Short mass" };
138+ Configurable<float > lowMK0S{" lowMK0S" , 0 .48f , " Lower limit on K0Short mass" };
139+ Configurable<float > upMK0S{" upMK0S" , 0 .52f , " Upper limit on K0Short mass" };
139140
140141 // Configurable on K0S pT bins
141142 Configurable<std::vector<double >> binspTK0S{" binspTK0S" , {0.1 , 0.8 , 1.2 , 1.6 , 2.0 , 2.5 , 3.0 , 4.0 , 6.0 }, " pT bin limits for K0S" };
@@ -159,7 +160,6 @@ struct Phik0shortanalysis {
159160 Configurable<bool > cfgisGenMCForClosure{" cfgisGenMCForClosure" , false , " GenMC for Closure" };
160161
161162 // Configurables to choose the filling method
162- Configurable<bool > doLoadPurities{" doLoadPurities" , false , " Load purities" };
163163 Configurable<bool > fillMethodMultipleWeights{" fillMethodMultipleWeights" , true , " Fill method Multiple Weights" };
164164 Configurable<bool > fillMethodSingleWeight{" fillMethodSingleWeight" , false , " Fill method Single Weight" };
165165
@@ -215,7 +215,7 @@ struct Phik0shortanalysis {
215215 Service<o2::ccdb::BasicCCDBManager> ccdb;
216216
217217 // Set of functions for phi purity
218- std::vector<std::vector<TF1*>> phiPurityFunctions;
218+ std::vector<std::vector<TF1*>> phiPurityFunctions = std::vector<std::vector<TF1*>>( 10 , std::vector<TF1*>( 7 , nullptr )) ;
219219
220220 void init (InitContext&)
221221 {
@@ -236,28 +236,30 @@ struct Phik0shortanalysis {
236236
237237 // Histograms
238238 // Number of events per selection
239- dataEventHist.add (" hEventSelection" , " hEventSelection" , kTH1F , {{5 , -0 .5f , 4 .5f }});
239+ dataEventHist.add (" hEventSelection" , " hEventSelection" , kTH1F , {{6 , -0 .5f , 5 .5f }});
240240 dataEventHist.get <TH1>(HIST (" hEventSelection" ))->GetXaxis ()->SetBinLabel (1 , " All collisions" );
241241 dataEventHist.get <TH1>(HIST (" hEventSelection" ))->GetXaxis ()->SetBinLabel (2 , " sel8 cut" );
242242 dataEventHist.get <TH1>(HIST (" hEventSelection" ))->GetXaxis ()->SetBinLabel (3 , " posZ cut" );
243243 dataEventHist.get <TH1>(HIST (" hEventSelection" ))->GetXaxis ()->SetBinLabel (4 , " INEL>0 cut" );
244244 dataEventHist.get <TH1>(HIST (" hEventSelection" ))->GetXaxis ()->SetBinLabel (5 , " With at least a #phi cand" );
245+ dataEventHist.get <TH1>(HIST (" hEventSelection" ))->GetXaxis ()->SetBinLabel (6 , " With at least a #phi" );
245246
246247 // Event information
247248 dataEventHist.add (" hVertexZ" , " hVertexZ" , kTH1F , {vertexZAxis});
248249 dataEventHist.add (" hMultiplicityPercent" , " Multiplicity Percentile" , kTH1F , {multAxis});
249250 dataEventHist.add (" hMultiplicityPercentWithPhi" , " Multiplicity Percentile in Events with a Phi Candidate" , kTH1F , {multAxis});
250251
251252 // Number of MC events per selection for Rec and Gen
252- mcEventHist.add (" hRecMCEventSelection" , " hRecMCEventSelection" , kTH1F , {{8 , -0 .5f , 7 .5f }});
253+ mcEventHist.add (" hRecMCEventSelection" , " hRecMCEventSelection" , kTH1F , {{9 , -0 .5f , 8 .5f }});
253254 mcEventHist.get <TH1>(HIST (" hRecMCEventSelection" ))->GetXaxis ()->SetBinLabel (1 , " All collisions" );
254255 mcEventHist.get <TH1>(HIST (" hRecMCEventSelection" ))->GetXaxis ()->SetBinLabel (2 , " kIsTriggerTVX" );
255256 mcEventHist.get <TH1>(HIST (" hRecMCEventSelection" ))->GetXaxis ()->SetBinLabel (3 , " kNoTimeFrameBorder" );
256257 mcEventHist.get <TH1>(HIST (" hRecMCEventSelection" ))->GetXaxis ()->SetBinLabel (4 , " kNoITSROFrameBorder" );
257258 mcEventHist.get <TH1>(HIST (" hRecMCEventSelection" ))->GetXaxis ()->SetBinLabel (5 , " posZ cut" );
258259 mcEventHist.get <TH1>(HIST (" hRecMCEventSelection" ))->GetXaxis ()->SetBinLabel (6 , " INEL>0 cut" );
259260 mcEventHist.get <TH1>(HIST (" hRecMCEventSelection" ))->GetXaxis ()->SetBinLabel (7 , " With at least a gen coll" );
260- mcEventHist.get <TH1>(HIST (" hRecMCEventSelection" ))->GetXaxis ()->SetBinLabel (8 , " With at least a #phi" );
261+ mcEventHist.get <TH1>(HIST (" hRecMCEventSelection" ))->GetXaxis ()->SetBinLabel (8 , " With at least a #phi cand" );
262+ mcEventHist.get <TH1>(HIST (" hRecMCEventSelection" ))->GetXaxis ()->SetBinLabel (9 , " With at least a #phi" );
261263
262264 mcEventHist.add (" hGenMCEventSelection" , " hGenMCEventSelection" , kTH1F , {{5 , -0 .5f , 4 .5f }});
263265 mcEventHist.get <TH1>(HIST (" hGenMCEventSelection" ))->GetXaxis ()->SetBinLabel (1 , " All collisions" );
@@ -473,7 +475,7 @@ struct Phik0shortanalysis {
473475 mcPionHist.add (" h3PiRapidityGenMC" , " Rapidity for Pion for GenMC" , kTH3F , {binnedmultAxis, binnedptPiAxis, yAxis});
474476
475477 // Initialize CCDB only if purity is requested in the task
476- if (doLoadPurities ) {
478+ if (fillMethodSingleWeight ) {
477479 ccdb->setURL (ccdbUrl);
478480 ccdb->setCaching (true );
479481 ccdb->setLocalObjectValidityChecking ();
@@ -563,6 +565,8 @@ struct Phik0shortanalysis {
563565 return false ;
564566 if (v0.v0radius () < v0Configs.v0SettingRadius )
565567 return false ;
568+ if (v0.pt () < v0Configs.v0SettingMinPt )
569+ return false ;
566570
567571 if (v0Configs.cfgisV0ForData ) {
568572 if (std::abs (daughter1.tpcNSigmaPi ()) > trackConfigs.nSigmaCutTPCPion )
@@ -871,6 +875,8 @@ struct Phik0shortanalysis {
871875 continue ; // condition to avoid double counting of pair
872876
873877 ROOT::Math::PxPyPzMVector recPhi = recMother (track1, track2, massKa, massKa);
878+ if (recPhi.Pt () < minPhiPt)
879+ continue ;
874880 if (std::abs (recPhi.Rapidity ()) > cfgYAcceptance)
875881 continue ;
876882
@@ -1010,10 +1016,10 @@ struct Phik0shortanalysis {
10101016 continue ; // condition to avoid double counting of pair
10111017
10121018 ROOT::Math::PxPyPzMVector recPhi = recMother (track1, track2, massKa, massKa);
1013-
1019+ if (recPhi.Pt () < minPhiPt)
1020+ continue ;
10141021 if (recPhi.M () < lowMPhi || recPhi.M () > upMPhi)
10151022 continue ;
1016-
10171023 if (std::abs (recPhi.Rapidity ()) > cfgYAcceptance)
10181024 continue ;
10191025
@@ -1099,10 +1105,10 @@ struct Phik0shortanalysis {
10991105 continue ; // condition to avoid double counting of pair
11001106
11011107 ROOT::Math::PxPyPzMVector recPhi = recMother (track1, track2, massKa, massKa);
1102-
1108+ if (recPhi.Pt () < minPhiPt)
1109+ continue ;
11031110 if (recPhi.M () < lowMPhi || recPhi.M () > upMPhi)
11041111 continue ;
1105-
11061112 if (std::abs (recPhi.Rapidity ()) > cfgYAcceptance)
11071113 continue ;
11081114
@@ -1207,6 +1213,8 @@ struct Phik0shortanalysis {
12071213 continue ;
12081214
12091215 ROOT::Math::PxPyPzMVector recPhi = recMother (track1, track2, massKa, massKa);
1216+ if (recPhi.Pt () < minPhiPt)
1217+ continue ;
12101218
12111219 mcPhiHist.fill (HIST (" h3PhiRapiditySmearing" ), genmultiplicity, recPhi.Rapidity (), mcMotherPhi.y ());
12121220
@@ -1521,6 +1529,8 @@ struct Phik0shortanalysis {
15211529 continue ; // condition to avoid double counting of pair
15221530
15231531 ROOT::Math::PxPyPzMVector recPhi = recMother (track1, track2, massKa, massKa);
1532+ if (recPhi.Pt () < minPhiPt)
1533+ continue ;
15241534 if (std::abs (recPhi.Rapidity ()) > cfgYAcceptance)
15251535 continue ;
15261536
@@ -1699,10 +1709,10 @@ struct Phik0shortanalysis {
16991709 }
17001710
17011711 ROOT::Math::PxPyPzMVector recPhi = recMother (track1, track2, massKa, massKa);
1702-
1712+ if (recPhi.Pt () < minPhiPt)
1713+ continue ;
17031714 if (recPhi.M () < lowMPhi || recPhi.M () > upMPhi)
17041715 continue ;
1705-
17061716 if (std::abs (recPhi.Rapidity ()) > cfgYAcceptance)
17071717 continue ;
17081718
@@ -1823,10 +1833,10 @@ struct Phik0shortanalysis {
18231833 }
18241834
18251835 ROOT::Math::PxPyPzMVector recPhi = recMother (track1, track2, massKa, massKa);
1826-
1836+ if (recPhi.Pt () < minPhiPt)
1837+ continue ;
18271838 if (recPhi.M () < lowMPhi || recPhi.M () > upMPhi)
18281839 continue ;
1829-
18301840 if (std::abs (recPhi.Rapidity ()) > cfgYAcceptance)
18311841 continue ;
18321842
0 commit comments