3636#include < Framework/runDataProcessing.h>
3737#include < ReconstructionDataFormats/PID.h>
3838
39- #include " TDatabasePDG.h"
4039#include < TComplex.h>
4140#include < TF1.h>
4241#include < TH2.h>
@@ -71,6 +70,7 @@ struct V0ptHadPiKaProt {
7170 o2::aod::ITSResponse itsResponse;
7271 // Connect to ccdb
7372 Service<ccdb::BasicCCDBManager> ccdb;
73+
7474 Configurable<int64_t > ccdbNoLaterThan{" ccdbNoLaterThan" , std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now ().time_since_epoch ()).count (), " latest acceptable timestamp of creation for the object" };
7575 Configurable<std::string> ccdbUrl{" ccdbUrl" , " https://alice-ccdb.cern.ch" , " url of the ccdb repository" };
7676 Configurable<std::string> ccdbPath{" ccdbPath" , " Users/s/swati/PhiWeight" , " CCDB path to ccdb object containing phi weight in a 3D histogram" };
@@ -114,7 +114,7 @@ struct V0ptHadPiKaProt {
114114 Configurable<float > cfgnSigmaOtherParticles{" cfgnSigmaOtherParticles" , 3 .0f , " PID nSigma cut to remove other particles (default:3)" };
115115 Configurable<float > cfgnSigmaCutTPC{" cfgnSigmaCutTPC" , 2 .0f , " PID nSigma cut for TPC" };
116116 Configurable<float > cfgnSigmaCutTOF{" cfgnSigmaCutTOF" , 2 .0f , " PID nSigma cut for TOF" };
117- Configurable<bool > cfgUseNewSeperationPid{" cfgUseNewSeperationPid" , true , " Use seperation based PID cuts (NEW)" };
117+ Configurable<bool > cfgUseNewSeperationPid{" cfgUseNewSeperationPid" , false , " Use seperation based PID cuts (NEW)" };
118118 Configurable<float > cfgnSigmaCutTPCHigherPt{" cfgnSigmaCutTPCHigherPt" , 2 .0f , " PID nSigma cut for TPC at higher pt" };
119119 Configurable<float > cfgnSigmaCutTOFHigherPt{" cfgnSigmaCutTOFHigherPt" , 2 .0f , " PID nSigma cut for TOF at higher pt" };
120120 Configurable<float > cfgnSigmaSeperationCut{" cfgnSigmaSeperationCut" , 3 .5f , " PID nSigma of other species must be greater than the vale" };
@@ -209,7 +209,7 @@ struct V0ptHadPiKaProt {
209209 HistogramRegistry histosAnalysis{" Histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
210210 std::vector<std::vector<std::shared_ptr<TProfile2D>>> subSample;
211211 std::vector<std::vector<std::shared_ptr<TProfile2D>>> subSampleV02;
212- std::vector<std::vector<std::shared_ptr<TProfile2D>>> subSampleV02_weighted ;
212+ std::vector<std::vector<std::shared_ptr<TProfile2D>>> subSampleV02weighted ;
213213 TRandom3* funRndm = new TRandom3(0 );
214214
215215 // Phi weight histograms initialization
@@ -418,11 +418,11 @@ struct V0ptHadPiKaProt {
418418 // initial array
419419 subSample.resize (cfgNSubsample);
420420 subSampleV02.resize (cfgNSubsample);
421- subSampleV02_weighted .resize (cfgNSubsample);
421+ subSampleV02weighted .resize (cfgNSubsample);
422422 for (int i = 0 ; i < cfgNSubsample; i++) {
423423 subSample[i].resize (20 );
424424 subSampleV02[i].resize (9 );
425- subSampleV02_weighted [i].resize (9 );
425+ subSampleV02weighted [i].resize (9 );
426426 }
427427 for (int i = 0 ; i < cfgNSubsample; i++) {
428428 subSample[i][0 ] = std::get<std::shared_ptr<TProfile2D>>(histos.add (Form (" subSample_%d/Prof_A_had" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
@@ -460,15 +460,15 @@ struct V0ptHadPiKaProt {
460460 subSampleV02[i][8 ] = std::get<std::shared_ptr<TProfile2D>>(histosAnalysis.add (Form (" subSampleV02_%d/Prof_Z_prot" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
461461
462462 if (cfgV02WeightedFill) {
463- subSampleV02_weighted [i][0 ] = std::get<std::shared_ptr<TProfile2D>>(histosAnalysis.add (Form (" subSampleV02_weighted_ %d/Prof_XY_weighted" , i), " " , {HistType::kTProfile2D , {centAxis, noAxis}}));
464- subSampleV02_weighted [i][1 ] = std::get<std::shared_ptr<TProfile2D>>(histosAnalysis.add (Form (" subSampleV02_weighted_ %d/Prof_XYZ_weighted_had" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
465- subSampleV02_weighted [i][2 ] = std::get<std::shared_ptr<TProfile2D>>(histosAnalysis.add (Form (" subSampleV02_weighted_ %d/Prof_Z_weighted_had" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
466- subSampleV02_weighted [i][3 ] = std::get<std::shared_ptr<TProfile2D>>(histosAnalysis.add (Form (" subSampleV02_weighted_ %d/Prof_XYZ_weighted_pi" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
467- subSampleV02_weighted [i][4 ] = std::get<std::shared_ptr<TProfile2D>>(histosAnalysis.add (Form (" subSampleV02_weighted_ %d/Prof_Z_weighted_pi" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
468- subSampleV02_weighted [i][5 ] = std::get<std::shared_ptr<TProfile2D>>(histosAnalysis.add (Form (" subSampleV02_weighted_ %d/Prof_XYZ_weighted_ka" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
469- subSampleV02_weighted [i][6 ] = std::get<std::shared_ptr<TProfile2D>>(histosAnalysis.add (Form (" subSampleV02_weighted_ %d/Prof_Z_weighted_ka" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
470- subSampleV02_weighted [i][7 ] = std::get<std::shared_ptr<TProfile2D>>(histosAnalysis.add (Form (" subSampleV02_weighted_ %d/Prof_XYZ_weighted_prot" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
471- subSampleV02_weighted [i][8 ] = std::get<std::shared_ptr<TProfile2D>>(histosAnalysis.add (Form (" subSampleV02_weighted_ %d/Prof_Z_weighted_prot" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
463+ subSampleV02weighted [i][0 ] = std::get<std::shared_ptr<TProfile2D>>(histosAnalysis.add (Form (" subSampleV02weighted_ %d/Prof_XY_weighted" , i), " " , {HistType::kTProfile2D , {centAxis, noAxis}}));
464+ subSampleV02weighted [i][1 ] = std::get<std::shared_ptr<TProfile2D>>(histosAnalysis.add (Form (" subSampleV02weighted_ %d/Prof_XYZ_weighted_had" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
465+ subSampleV02weighted [i][2 ] = std::get<std::shared_ptr<TProfile2D>>(histosAnalysis.add (Form (" subSampleV02weighted_ %d/Prof_Z_weighted_had" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
466+ subSampleV02weighted [i][3 ] = std::get<std::shared_ptr<TProfile2D>>(histosAnalysis.add (Form (" subSampleV02weighted_ %d/Prof_XYZ_weighted_pi" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
467+ subSampleV02weighted [i][4 ] = std::get<std::shared_ptr<TProfile2D>>(histosAnalysis.add (Form (" subSampleV02weighted_ %d/Prof_Z_weighted_pi" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
468+ subSampleV02weighted [i][5 ] = std::get<std::shared_ptr<TProfile2D>>(histosAnalysis.add (Form (" subSampleV02weighted_ %d/Prof_XYZ_weighted_ka" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
469+ subSampleV02weighted [i][6 ] = std::get<std::shared_ptr<TProfile2D>>(histosAnalysis.add (Form (" subSampleV02weighted_ %d/Prof_Z_weighted_ka" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
470+ subSampleV02weighted [i][7 ] = std::get<std::shared_ptr<TProfile2D>>(histosAnalysis.add (Form (" subSampleV02weighted_ %d/Prof_XYZ_weighted_prot" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
471+ subSampleV02weighted [i][8 ] = std::get<std::shared_ptr<TProfile2D>>(histosAnalysis.add (Form (" subSampleV02weighted_ %d/Prof_Z_weighted_prot" , i), " " , {HistType::kTProfile2D , {centAxis, ptAxis}}));
472472 }
473473 }
474474
@@ -509,6 +509,7 @@ struct V0ptHadPiKaProt {
509509 if (cfgIsMC) {
510510 // MC event counts
511511 histos.add (" MCGenerated/hMC" , " MC Event statistics" , kTH1F , {{10 , 0 .0f , 10 .0f }});
512+ histos.add (" MCGenerated/hCentgen" , " MC generated centrality" , kTH1F , {centAxis});
512513 histos.add (" MCGenerated/hPtEtaPhiCharged" , " MC charged particles' pt, eta, phi" , kTH3D , {ptAxis, {100 , 0 ., o2::constants::math::TwoPI}, {100 , -2.01 , 2.01 }});
513514 histos.add (" MCGenerated/hPtEtaPhiPion" , " MC charged pions' pt, eta, phi" , kTH3D , {ptAxis, {100 , 0 ., o2::constants::math::TwoPI}, {100 , -2.01 , 2.01 }});
514515 histos.add (" MCGenerated/hPtEtaPhiKaon" , " MC charged kaons' pt, eta, phi" , kTH3D , {ptAxis, {100 , 0 ., o2::constants::math::TwoPI}, {100 , -2.01 , 2.01 }});
@@ -1017,19 +1018,19 @@ struct V0ptHadPiKaProt {
10171018 if (!mcParticle.has_mcCollision ())
10181019 continue ;
10191020
1020- // charged check
1021- auto pdgEntry = TDatabasePDG::Instance ()->GetParticle (mcParticle.pdgCode ());
1022- if (!pdgEntry)
1023- continue ;
1024- if (pdgEntry->Charge () == 0 )
1025- continue ;
1021+ auto pdgcode = std::abs (mcParticle.pdgCode ());
1022+ if (!(pdgcode == PDG_t::kPiPlus ||
1023+ pdgcode == PDG_t::kKPlus ||
1024+ pdgcode == PDG_t::kProton ||
1025+ pdgcode == PDG_t::kElectron ||
1026+ pdgcode == PDG_t::kMuonMinus )) {
1027+ continue ; // skip this track
1028+ }
10261029
10271030 if (mcParticle.isPhysicalPrimary ()) {
10281031 if ((mcParticle.pt () > cfgCutPtLower) && (mcParticle.pt () < cfgCutPtUpper) && (std::abs (mcParticle.eta ()) < cfgCutEta)) {
10291032 histos.fill (HIST (" MCGenerated/hPtEtaPhiCharged_gen" ), mcParticle.pt (), mcParticle.eta (), mcParticle.phi ());
10301033
1031- auto pdgcode = std::abs (mcParticle.pdgCode ());
1032-
10331034 if (pdgcode == PDG_t::kPiPlus )
10341035 histos.fill (HIST (" MCGenerated/hPtEtaPhiPion_gen" ), mcParticle.pt (), mcParticle.eta (), mcParticle.phi ());
10351036
@@ -1096,19 +1097,19 @@ struct V0ptHadPiKaProt {
10961097 if (!mcParticle.has_mcCollision ())
10971098 continue ;
10981099
1099- // charged check
1100- auto pdgEntry = TDatabasePDG::Instance ()->GetParticle (mcParticle.pdgCode ());
1101- if (!pdgEntry)
1102- continue ;
1103- if (pdgEntry->Charge () == 0 )
1104- continue ;
1100+ auto pdgcode = std::abs (mcParticle.pdgCode ());
1101+ if (!(pdgcode == PDG_t::kPiPlus ||
1102+ pdgcode == PDG_t::kKPlus ||
1103+ pdgcode == PDG_t::kProton ||
1104+ pdgcode == PDG_t::kElectron ||
1105+ pdgcode == PDG_t::kMuonMinus )) {
1106+ continue ; // skip this track
1107+ }
11051108
11061109 if (mcParticle.isPhysicalPrimary ()) {
11071110 if ((mcParticle.pt () > cfgCutPtLower) && (mcParticle.pt () < cfgCutPtUpper) && (std::abs (mcParticle.eta ()) < cfgCutEta)) {
11081111 histos.fill (HIST (" MCGenerated/hPtEtaPhiCharged" ), mcParticle.pt (), mcParticle.eta (), mcParticle.phi ());
11091112
1110- auto pdgcode = std::abs (mcParticle.pdgCode ());
1111-
11121113 if (pdgcode == PDG_t::kPiPlus )
11131114 histos.fill (HIST (" MCGenerated/hPtEtaPhiPion" ), mcParticle.pt (), mcParticle.eta (), mcParticle.phi ());
11141115
@@ -1552,7 +1553,7 @@ struct V0ptHadPiKaProt {
15521553
15531554 if (cfgV02WeightedFill) {
15541555 histos.get <TProfile2D>(HIST (" Prof_XY_weighted" ))->Fill (cent, 0.5 , twoParCorr, (nSumInWinA * nSumInWinC));
1555- subSampleV02_weighted [sampleIndex][0 ]->Fill (cent, 0.5 , twoParCorr, (nSumInWinA * nSumInWinC));
1556+ subSampleV02weighted [sampleIndex][0 ]->Fill (cent, 0.5 , twoParCorr, (nSumInWinA * nSumInWinC));
15561557 }
15571558 // hadrons
15581559 for (int i = 0 ; i < cfgNbinsV02pt; i++) {
@@ -1567,8 +1568,8 @@ struct V0ptHadPiKaProt {
15671568 if (cfgV02WeightedFill) {
15681569 histos.get <TProfile2D>(HIST (" Prof_XYZ_weighted_had" ))->Fill (cent, fPtProfileHadInWinB ->GetBinCenter (i + 1 ), threeParCorrHad, (nSumInWinA * nSumInWinC));
15691570 histos.get <TProfile2D>(HIST (" Prof_Z_weighted_had" ))->Fill (cent, fPtProfileHadInWinB ->GetBinCenter (i + 1 ), (fPtProfileHadInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
1570- subSampleV02_weighted [sampleIndex][1 ]->Fill (cent, fPtProfileHadInWinB ->GetBinCenter (i + 1 ), threeParCorrHad, (nSumInWinA * nSumInWinC));
1571- subSampleV02_weighted [sampleIndex][2 ]->Fill (cent, fPtProfileHadInWinB ->GetBinCenter (i + 1 ), (fPtProfileHadInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
1571+ subSampleV02weighted [sampleIndex][1 ]->Fill (cent, fPtProfileHadInWinB ->GetBinCenter (i + 1 ), threeParCorrHad, (nSumInWinA * nSumInWinC));
1572+ subSampleV02weighted [sampleIndex][2 ]->Fill (cent, fPtProfileHadInWinB ->GetBinCenter (i + 1 ), (fPtProfileHadInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
15721573 }
15731574 }
15741575
@@ -1585,8 +1586,8 @@ struct V0ptHadPiKaProt {
15851586 if (cfgV02WeightedFill) {
15861587 histos.get <TProfile2D>(HIST (" Prof_XYZ_weighted_pi" ))->Fill (cent, fPtProfilePiInWinB ->GetBinCenter (i + 1 ), threeParCorrPi, (nSumInWinA * nSumInWinC));
15871588 histos.get <TProfile2D>(HIST (" Prof_Z_weighted_pi" ))->Fill (cent, fPtProfilePiInWinB ->GetBinCenter (i + 1 ), (fPtProfilePiInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
1588- subSampleV02_weighted [sampleIndex][3 ]->Fill (cent, fPtProfilePiInWinB ->GetBinCenter (i + 1 ), threeParCorrPi, (nSumInWinA * nSumInWinC));
1589- subSampleV02_weighted [sampleIndex][4 ]->Fill (cent, fPtProfilePiInWinB ->GetBinCenter (i + 1 ), (fPtProfilePiInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
1589+ subSampleV02weighted [sampleIndex][3 ]->Fill (cent, fPtProfilePiInWinB ->GetBinCenter (i + 1 ), threeParCorrPi, (nSumInWinA * nSumInWinC));
1590+ subSampleV02weighted [sampleIndex][4 ]->Fill (cent, fPtProfilePiInWinB ->GetBinCenter (i + 1 ), (fPtProfilePiInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
15901591 }
15911592 }
15921593
@@ -1603,8 +1604,8 @@ struct V0ptHadPiKaProt {
16031604 if (cfgV02WeightedFill) {
16041605 histos.get <TProfile2D>(HIST (" Prof_XYZ_weighted_ka" ))->Fill (cent, fPtProfileKaInWinB ->GetBinCenter (i + 1 ), threeParCorrKa, (nSumInWinA * nSumInWinC));
16051606 histos.get <TProfile2D>(HIST (" Prof_Z_weighted_ka" ))->Fill (cent, fPtProfileKaInWinB ->GetBinCenter (i + 1 ), (fPtProfileKaInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
1606- subSampleV02_weighted [sampleIndex][5 ]->Fill (cent, fPtProfileKaInWinB ->GetBinCenter (i + 1 ), threeParCorrKa, (nSumInWinA * nSumInWinC));
1607- subSampleV02_weighted [sampleIndex][6 ]->Fill (cent, fPtProfileKaInWinB ->GetBinCenter (i + 1 ), (fPtProfileKaInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
1607+ subSampleV02weighted [sampleIndex][5 ]->Fill (cent, fPtProfileKaInWinB ->GetBinCenter (i + 1 ), threeParCorrKa, (nSumInWinA * nSumInWinC));
1608+ subSampleV02weighted [sampleIndex][6 ]->Fill (cent, fPtProfileKaInWinB ->GetBinCenter (i + 1 ), (fPtProfileKaInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
16081609 }
16091610 }
16101611
@@ -1621,8 +1622,8 @@ struct V0ptHadPiKaProt {
16211622 if (cfgV02WeightedFill) {
16221623 histos.get <TProfile2D>(HIST (" Prof_XYZ_weighted_prot" ))->Fill (cent, fPtProfileProtInWinB ->GetBinCenter (i + 1 ), threeParCorrProt, (nSumInWinA * nSumInWinC));
16231624 histos.get <TProfile2D>(HIST (" Prof_Z_weighted_prot" ))->Fill (cent, fPtProfileProtInWinB ->GetBinCenter (i + 1 ), (fPtProfileProtInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
1624- subSampleV02_weighted [sampleIndex][7 ]->Fill (cent, fPtProfileProtInWinB ->GetBinCenter (i + 1 ), threeParCorrProt, (nSumInWinA * nSumInWinC));
1625- subSampleV02_weighted [sampleIndex][8 ]->Fill (cent, fPtProfileProtInWinB ->GetBinCenter (i + 1 ), (fPtProfileProtInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
1625+ subSampleV02weighted [sampleIndex][7 ]->Fill (cent, fPtProfileProtInWinB ->GetBinCenter (i + 1 ), threeParCorrProt, (nSumInWinA * nSumInWinC));
1626+ subSampleV02weighted [sampleIndex][8 ]->Fill (cent, fPtProfileProtInWinB ->GetBinCenter (i + 1 ), (fPtProfileProtInWinB ->GetBinContent (i + 1 ) / nSumInWinB));
16261627 }
16271628 }
16281629 }
0 commit comments