|
9 | 9 | // granted to it by virtue of its status as an Intergovernmental Organization |
10 | 10 | // or submit itself to any jurisdiction. |
11 | 11 |
|
| 12 | +#include <algorithm> |
| 13 | + |
12 | 14 | #include "Framework/runDataProcessing.h" |
13 | 15 | #include "Framework/AnalysisTask.h" |
| 16 | +#include "CCDB/BasicCCDBManager.h" |
14 | 17 | #include "Common/DataModel/Centrality.h" |
15 | 18 | #include "Common/DataModel/PIDResponse.h" |
16 | 19 | #include "PWGLF/DataModel/LFStrangenessTables.h" |
17 | 20 |
|
18 | 21 | #include "TPDGCode.h" |
19 | | -#include "TLorentzVector.h" |
| 22 | +#include "RecoDecay.h" |
20 | 23 |
|
21 | 24 | using namespace o2; |
22 | 25 | using namespace o2::framework; |
23 | 26 | using namespace o2::framework::expressions; |
24 | 27 |
|
25 | 28 | struct ThreePartCorr { |
| 29 | + Service<o2::ccdb::BasicCCDBManager> CCDB; |
26 | 30 |
|
27 | 31 | // Histogram registry |
28 | 32 | HistogramRegistry MECorrRegistry{"MECorrRegistry", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; |
@@ -79,6 +83,11 @@ struct ThreePartCorr { |
79 | 83 | Double_t massLambda = o2::constants::physics::MassLambda0; |
80 | 84 | Double_t DGaussSigma = 0.0021; |
81 | 85 |
|
| 86 | + // Efficiency histograms |
| 87 | + TH1D** hEffPions = new TH1D*[2]; |
| 88 | + TH1D** hEffKaons = new TH1D*[2]; |
| 89 | + TH1D** hEffProtons = new TH1D*[2]; |
| 90 | + |
82 | 91 | // Correlation variables |
83 | 92 | Int_t T_Sign; |
84 | 93 | Double_t CandMass; |
@@ -146,6 +155,16 @@ struct ThreePartCorr { |
146 | 155 | MECorrRegistry.add("hMixLambdaKaon_SB", "Mixed-event #Lambda - K correlator (SB region)", {HistType::kTHnSparseD, {{PhiAxis}, {EtaAxis}, {CentralityAxis}, {ZvtxAxis}, {2, -2, 2}, {2, -2, 2}}}); |
147 | 156 | MECorrRegistry.add("hMixLambdaProton_SGNL", "Mixed-event #Lambda - p correlator (SGNL region)", {HistType::kTHnSparseD, {{PhiAxis}, {EtaAxis}, {CentralityAxis}, {ZvtxAxis}, {2, -2, 2}, {2, -2, 2}}}); |
148 | 157 | MECorrRegistry.add("hMixLambdaProton_SB", "Mixed-event #Lambda - p correlator (SB region)", {HistType::kTHnSparseD, {{PhiAxis}, {EtaAxis}, {CentralityAxis}, {ZvtxAxis}, {2, -2, 2}, {2, -2, 2}}}); |
| 158 | + |
| 159 | + CCDB->setURL("http://alice-ccdb.cern.ch"); |
| 160 | + CCDB->setCaching(true); |
| 161 | + TList* EfficiencyList = CCDB->getForTimeStamp<TList>("Users/j/jstaa/Efficiency/ChargedParticles", 1); |
| 162 | + hEffPions[0] = static_cast<TH1D*>(EfficiencyList->FindObject("hEfficiencyPionP")); |
| 163 | + hEffPions[1] = static_cast<TH1D*>(EfficiencyList->FindObject("hEfficiencyPionN")); |
| 164 | + hEffKaons[0] = static_cast<TH1D*>(EfficiencyList->FindObject("hEfficiencyKaonP")); |
| 165 | + hEffKaons[1] = static_cast<TH1D*>(EfficiencyList->FindObject("hEfficiencyKaonN")); |
| 166 | + hEffProtons[0] = static_cast<TH1D*>(EfficiencyList->FindObject("hEfficiencyProtonP")); |
| 167 | + hEffProtons[1] = static_cast<TH1D*>(EfficiencyList->FindObject("hEfficiencyProtonN")); |
149 | 168 | } |
150 | 169 |
|
151 | 170 | //================================================================================================================================================================================================================ |
@@ -205,19 +224,19 @@ struct ThreePartCorr { |
205 | 224 |
|
206 | 225 | if (CandMass >= massLambda - 4 * DGaussSigma && CandMass <= massLambda + 4 * DGaussSigma) { |
207 | 226 | if (A_PID[0] == 0.0) { // Pions |
208 | | - SECorrRegistry.fill(HIST("hSameLambdaPion_SGNL"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign()); |
| 227 | + SECorrRegistry.fill(HIST("hSameLambdaPion_SGNL"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign(), 1. / TrackEff(hEffPions, associate.sign(), associate.pt())); |
209 | 228 | } else if (A_PID[0] == 1.0) { // Kaons |
210 | | - SECorrRegistry.fill(HIST("hSameLambdaKaon_SGNL"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign()); |
| 229 | + SECorrRegistry.fill(HIST("hSameLambdaKaon_SGNL"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign(), 1. / TrackEff(hEffKaons, associate.sign(), associate.pt())); |
211 | 230 | } else if (A_PID[0] == 2.0) { // Protons |
212 | | - SECorrRegistry.fill(HIST("hSameLambdaProton_SGNL"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign()); |
| 231 | + SECorrRegistry.fill(HIST("hSameLambdaProton_SGNL"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign(), 1. / TrackEff(hEffProtons, associate.sign(), associate.pt())); |
213 | 232 | } |
214 | 233 | } else if (CandMass >= massLambda - 8 * DGaussSigma && CandMass <= massLambda + 8 * DGaussSigma) { |
215 | 234 | if (A_PID[0] == 0.0) { // Pions |
216 | | - SECorrRegistry.fill(HIST("hSameLambdaPion_SB"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign()); |
| 235 | + SECorrRegistry.fill(HIST("hSameLambdaPion_SB"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign(), 1. / TrackEff(hEffPions, associate.sign(), associate.pt())); |
217 | 236 | } else if (A_PID[0] == 1.0) { // Kaons |
218 | | - SECorrRegistry.fill(HIST("hSameLambdaKaon_SB"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign()); |
| 237 | + SECorrRegistry.fill(HIST("hSameLambdaKaon_SB"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign(), 1. / TrackEff(hEffKaons, associate.sign(), associate.pt())); |
219 | 238 | } else if (A_PID[0] == 2.0) { // Protons |
220 | | - SECorrRegistry.fill(HIST("hSameLambdaProton_SB"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign()); |
| 239 | + SECorrRegistry.fill(HIST("hSameLambdaProton_SB"), DeltaPhi, DeltaEta, collision.centFT0C(), collision.posZ(), T_Sign, associate.sign(), 1. / TrackEff(hEffProtons, associate.sign(), associate.pt())); |
221 | 240 | } |
222 | 241 | } |
223 | 242 | } |
@@ -250,19 +269,19 @@ struct ThreePartCorr { |
250 | 269 |
|
251 | 270 | if (CandMass >= massLambda - 4 * DGaussSigma && CandMass <= massLambda + 4 * DGaussSigma) { |
252 | 271 | if (A_PID[0] == 0.0) { // Pions |
253 | | - MECorrRegistry.fill(HIST("hMixLambdaPion_SGNL"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign()); |
| 272 | + MECorrRegistry.fill(HIST("hMixLambdaPion_SGNL"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign(), 1. / TrackEff(hEffPions, associate.sign(), associate.pt())); |
254 | 273 | } else if (A_PID[0] == 1.0) { // Kaons |
255 | | - MECorrRegistry.fill(HIST("hMixLambdaKaon_SGNL"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign()); |
| 274 | + MECorrRegistry.fill(HIST("hMixLambdaKaon_SGNL"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign(), 1. / TrackEff(hEffKaons, associate.sign(), associate.pt())); |
256 | 275 | } else if (A_PID[0] == 2.0) { // Protons |
257 | | - MECorrRegistry.fill(HIST("hMixLambdaProton_SGNL"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign()); |
| 276 | + MECorrRegistry.fill(HIST("hMixLambdaProton_SGNL"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign(), 1. / TrackEff(hEffProtons, associate.sign(), associate.pt())); |
258 | 277 | } |
259 | 278 | } else if (CandMass >= massLambda - 8 * DGaussSigma && CandMass <= massLambda + 8 * DGaussSigma) { |
260 | 279 | if (A_PID[0] == 0.0) { // Pions |
261 | | - MECorrRegistry.fill(HIST("hMixLambdaPion_SB"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign()); |
| 280 | + MECorrRegistry.fill(HIST("hMixLambdaPion_SB"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign(), 1. / TrackEff(hEffPions, associate.sign(), associate.pt())); |
262 | 281 | } else if (A_PID[0] == 1.0) { // Kaons |
263 | | - MECorrRegistry.fill(HIST("hMixLambdaKaon_SB"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign()); |
| 282 | + MECorrRegistry.fill(HIST("hMixLambdaKaon_SB"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign(), 1. / TrackEff(hEffKaons, associate.sign(), associate.pt())); |
264 | 283 | } else if (A_PID[0] == 2.0) { // Protons |
265 | | - MECorrRegistry.fill(HIST("hMixLambdaProton_SB"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign()); |
| 284 | + MECorrRegistry.fill(HIST("hMixLambdaProton_SB"), DeltaPhi, DeltaEta, coll_1.centFT0C(), coll_1.posZ(), T_Sign, associate.sign(), 1. / TrackEff(hEffProtons, associate.sign(), associate.pt())); |
266 | 285 | } |
267 | 286 | } |
268 | 287 | } |
@@ -352,6 +371,32 @@ struct ThreePartCorr { |
352 | 371 | return dPhi; |
353 | 372 | } |
354 | 373 |
|
| 374 | + Double_t TrackEff(TH1D** Efficiencies, Int_t Sign, Double_t pT) |
| 375 | + { |
| 376 | + |
| 377 | + Int_t Index = -999; |
| 378 | + if (Sign > 0) { |
| 379 | + Index = 0; |
| 380 | + } else if (Sign < 0) { |
| 381 | + Index = 1; |
| 382 | + } |
| 383 | + |
| 384 | + return Efficiencies[Index]->GetBinContent(Efficiencies[Index]->FindBin(pT)); |
| 385 | + } |
| 386 | + |
| 387 | + template <class V0Cand> |
| 388 | + Int_t V0Sign(const V0Cand& V0) |
| 389 | + { |
| 390 | + |
| 391 | + if (TMath::Abs(V0.mLambda() - massLambda) <= TMath::Abs(V0.mAntiLambda() - massLambda)) { |
| 392 | + return 1; |
| 393 | + } else if (TMath::Abs(V0.mLambda() - massLambda) > TMath::Abs(V0.mAntiLambda() - massLambda)) { |
| 394 | + return -1; |
| 395 | + } |
| 396 | + |
| 397 | + return 0; |
| 398 | + } |
| 399 | + |
355 | 400 | template <class TrackCand> |
356 | 401 | Double_t* TrackPID(const TrackCand& Track) |
357 | 402 | { |
@@ -387,19 +432,6 @@ struct ThreePartCorr { |
387 | 432 | return ID; |
388 | 433 | } |
389 | 434 |
|
390 | | - template <class V0Cand> |
391 | | - Int_t V0Sign(const V0Cand& V0) |
392 | | - { |
393 | | - |
394 | | - if (TMath::Abs(V0.mLambda() - massLambda) <= TMath::Abs(V0.mAntiLambda() - massLambda)) { |
395 | | - return 1; |
396 | | - } else if (TMath::Abs(V0.mLambda() - massLambda) > TMath::Abs(V0.mAntiLambda() - massLambda)) { |
397 | | - return -1; |
398 | | - } |
399 | | - |
400 | | - return 0; |
401 | | - } |
402 | | - |
403 | 435 | template <class V0Cand> |
404 | 436 | Bool_t V0Filters(const V0Cand& V0) |
405 | 437 | { |
@@ -439,28 +471,37 @@ struct ThreePartCorr { |
439 | 471 |
|
440 | 472 | if (ConfFilterSwitch) { |
441 | 473 |
|
442 | | - TLorentzVector Daughter, Associate; |
443 | 474 | if (TrackPID(Track)[0] == 1.0) { // Kaons |
444 | 475 | return kTRUE; |
445 | | - } else if (V0Sign(V0) == 1 && TrackPID(Track)[0] == 0.0 && Track.sign() == -1) { // Lambda - Pi_min |
446 | | - const auto& dTrack = V0.template posTrack_as<MyFilteredTracks>(); |
447 | | - Daughter.SetPtEtaPhiM(dTrack.pt(), dTrack.eta(), dTrack.phi(), o2::constants::physics::MassProton); |
448 | | - Associate.SetPtEtaPhiM(Track.pt(), Track.eta(), Track.phi(), o2::constants::physics::MassPionCharged); |
449 | | - } else if (V0Sign(V0) == -1 && TrackPID(Track)[0] == 0.0 && Track.sign() == 1) { // Antilambda - Pi_plus |
450 | | - const auto& dTrack = V0.template negTrack_as<MyFilteredTracks>(); |
451 | | - Daughter.SetPtEtaPhiM(dTrack.pt(), dTrack.eta(), dTrack.phi(), o2::constants::physics::MassProton); |
452 | | - Associate.SetPtEtaPhiM(Track.pt(), Track.eta(), Track.phi(), o2::constants::physics::MassPionCharged); |
453 | | - } else if (V0Sign(V0) == 1 && TrackPID(Track)[0] == 2.0 && Track.sign() == 1) { // Lambda - Proton |
454 | | - const auto& dTrack = V0.template negTrack_as<MyFilteredTracks>(); |
455 | | - Daughter.SetPtEtaPhiM(dTrack.pt(), dTrack.eta(), dTrack.phi(), o2::constants::physics::MassPionCharged); |
456 | | - Associate.SetPtEtaPhiM(Track.pt(), Track.eta(), Track.phi(), o2::constants::physics::MassProton); |
457 | | - } else if (V0Sign(V0) == -1 && TrackPID(Track)[0] == 2.0 && Track.sign() == -1) { // Antilambda - Antiproton |
458 | | - const auto& dTrack = V0.template posTrack_as<MyFilteredTracks>(); |
459 | | - Daughter.SetPtEtaPhiM(dTrack.pt(), dTrack.eta(), dTrack.phi(), o2::constants::physics::MassPionCharged); |
460 | | - Associate.SetPtEtaPhiM(Track.pt(), Track.eta(), Track.phi(), o2::constants::physics::MassProton); |
461 | 476 | } |
462 | 477 |
|
463 | | - if ((Daughter + Associate).M() >= massLambda - 4 * DGaussSigma && (Daughter + Associate).M() <= massLambda + 4 * DGaussSigma) { |
| 478 | + std::array<float, 2> MassArray; |
| 479 | + std::array<float, 3> DMomArray; |
| 480 | + std::array<float, 3> AMomArray = Track.pVector(); |
| 481 | + if (TrackPID(Track)[0] == 0.0) { |
| 482 | + MassArray = {o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged}; |
| 483 | + |
| 484 | + if (V0Sign(V0) == 1 && Track.sign() == -1) { // Lambda - Pi_min |
| 485 | + const auto& dTrack = V0.template posTrack_as<MyFilteredTracks>(); |
| 486 | + DMomArray = dTrack.pVector(); |
| 487 | + } else if (V0Sign(V0) == -1 && Track.sign() == 1) { // Antilambda - Pi_plus |
| 488 | + const auto& dTrack = V0.template negTrack_as<MyFilteredTracks>(); |
| 489 | + DMomArray = dTrack.pVector(); |
| 490 | + } |
| 491 | + } else if (TrackPID(Track)[0] == 2.0) { |
| 492 | + MassArray = {o2::constants::physics::MassPionCharged, o2::constants::physics::MassProton}; |
| 493 | + |
| 494 | + if (V0Sign(V0) == 1 && Track.sign() == 1) { // Lambda - Proton |
| 495 | + const auto& dTrack = V0.template negTrack_as<MyFilteredTracks>(); |
| 496 | + DMomArray = dTrack.pVector(); |
| 497 | + } else if (V0Sign(V0) == -1 && Track.sign() == -1) { // Antilambda - Antiproton |
| 498 | + const auto& dTrack = V0.template posTrack_as<MyFilteredTracks>(); |
| 499 | + DMomArray = dTrack.pVector(); |
| 500 | + } |
| 501 | + } |
| 502 | + |
| 503 | + Double_t M = RecoDecay::m(std::array{DMomArray, AMomArray}, MassArray); |
| 504 | + if (M >= massLambda - 4 * DGaussSigma && M <= massLambda + 4 * DGaussSigma) { |
464 | 505 | return kFALSE; |
465 | 506 | } |
466 | 507 | } |
|
0 commit comments