Skip to content

Commit da2bb7c

Browse files
authored
[PWGLF] Fix bugs for hypertriton 3body mc analysis (#10021)
1 parent 987576d commit da2bb7c

File tree

2 files changed

+60
-67
lines changed

2 files changed

+60
-67
lines changed

PWGLF/Tasks/Nuspex/hypertriton3bodyMcqa.cxx

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ struct Hypertriton3bodyMcqa {
238238
registry.get<TH1>(HIST("hDauDeuteronMatchCounter"))->GetXaxis()->SetBinLabel(3, "hasTOF");
239239
registry.get<TH1>(HIST("hDauDeuteronMatchCounter"))->GetXaxis()->SetBinLabel(4, "hasTOF & correct collsion");
240240

241-
registry.get<TH1>(HIST("hDauDeuteronTOFPIDCounter"))->GetXaxis()->SetBinLabel(1, "Origin |n#sigma| >= 6");
241+
registry.get<TH1>(HIST("hDauDeuteronTOFPIDCounter"))->GetXaxis()->SetBinLabel(1, "Origin |n#sigma| >= 5");
242242
registry.get<TH1>(HIST("hDauDeuteronTOFPIDCounter"))->GetXaxis()->SetBinLabel(2, "BothBC work");
243243
registry.get<TH1>(HIST("hDauDeuteronTOFPIDCounter"))->GetXaxis()->SetBinLabel(3, "Only BCAO2D work");
244244
registry.get<TH1>(HIST("hDauDeuteronTOFPIDCounter"))->GetXaxis()->SetBinLabel(4, "Only BCEvSel work");
@@ -361,7 +361,7 @@ struct Hypertriton3bodyMcqa {
361361
continue;
362362
}
363363
registry.fill(HIST("hEventCounter"), 1.5);
364-
if (event_posZ_selection && abs(collision.posZ()) > 10.f) { // 10cm
364+
if (event_posZ_selection && std::abs(collision.posZ()) > 10.f) { // 10cm
365365
continue;
366366
}
367367
registry.fill(HIST("hEventCounter"), 2.5);
@@ -489,8 +489,8 @@ struct Hypertriton3bodyMcqa {
489489
// float bachExpTime = track.length() * sqrt((o2::constants::physics::MassDeuteron * o2::constants::physics::MassDeuteron) + (track.tofExpMom() * track.tofExpMom())) / (kCSPEED * track.tofExpMom()); // L*E/(p*c) = L/v
490490

491491
float mMassHyp = o2::track::pid_constants::sMasses2Z[track.pidForTracking()];
492-
float bachExpTime = track.length() * sqrt((mMassHyp * mMassHyp) + (track.tofExpMom() * track.tofExpMom())) / (kCSPEED * track.tofExpMom()); // L*E/(p*c) = L/v
493-
float tofsignal = track.trackTime() * 1000 + bachExpTime; // in ps
492+
float bachExpTime = track.length() * std::sqrt((mMassHyp * mMassHyp) + (track.tofExpMom() * track.tofExpMom())) / (kCSPEED * track.tofExpMom()); // L*E/(p*c) = L/v
493+
float tofsignal = track.trackTime() * 1000 + bachExpTime; // in ps
494494

495495
float expSigma = responseDe.GetExpectedSigma(mRespParamsV2, track, tofsignal, track.tofEvTimeErr());
496496
// tofNsigmaDe = (track.tofSignal() - track.tofEvTime() - responseDe.GetCorrectedExpectedSignal(mRespParamsV2, track)) / expSigma;
@@ -581,7 +581,7 @@ struct Hypertriton3bodyMcqa {
581581
if (isPairedH3LDaughters<aod::McParticles>(mctrack0, mctrack1, mctrack2)) {
582582
registry.fill(HIST("hPairedH3LDaughers"), 0);
583583
// MC mass cut, to check if the daughters are from materials
584-
double hypertritonMCMass = RecoDecay::m(array{array{mctrack0.px(), mctrack0.py(), mctrack0.pz()}, array{mctrack1.px(), mctrack1.py(), mctrack1.pz()}, array{mctrack2.px(), mctrack2.py(), mctrack2.pz()}}, array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged, o2::constants::physics::MassDeuteron});
584+
double hypertritonMCMass = RecoDecay::m(std::array{std::array{mctrack0.px(), mctrack0.py(), mctrack0.pz()}, std::array{mctrack1.px(), mctrack1.py(), mctrack1.pz()}, std::array{mctrack2.px(), mctrack2.py(), mctrack2.pz()}}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged, o2::constants::physics::MassDeuteron});
585585
registry.fill(HIST("hPairedH3LDaughersInvMass"), hypertritonMCMass);
586586
if (hypertritonMCMass < 2.990 || hypertritonMCMass > 2.993)
587587
continue;
@@ -641,7 +641,7 @@ struct Hypertriton3bodyMcqa {
641641
/*auto responseDe = o2::pid::tof::ExpTimes<MCLabeledTracksIU::iterator, o2::track::PID::Deuteron>();
642642
//float bachExpTime = track.length() * sqrt((o2::constants::physics::MassDeuteron * o2::constants::physics::MassDeuteron) + (track.tofExpMom() * track.tofExpMom())) / (kCSPEED * track.tofExpMom()); // L*E/(p*c) = L/v
643643
float mMassHyp = o2::track::pid_constants::sMasses2Z[track.pidForTracking()];
644-
float bachExpTime = track.length() * sqrt((mMassHyp * mMassHyp) + (track.tofExpMom() * track.tofExpMom())) / (kCSPEED * track.tofExpMom()); // L*E/(p*c) = L/v
644+
float bachExpTime = track.length() * std::sqrt((mMassHyp * mMassHyp) + (track.tofExpMom() * track.tofExpMom())) / (kCSPEED * track.tofExpMom()); // L*E/(p*c) = L/v
645645
*/
646646

647647
tofNsigmaDeAO2D = bachelorTOFPID.GetTOFNSigma(o2::track::PID::Deuteron, track, originalcollision, collision);
@@ -663,26 +663,26 @@ struct Hypertriton3bodyMcqa {
663663
registry.fill(HIST("hDauDeuteronTOFNSigmaVsColTimeRes_v2_AO2D"), originalcollision.collisionTimeRes(), tofNsigmaDeAO2D);
664664
registry.fill(HIST("hDauDeuteronTOFNSigmaVsColTimeRes_v2_EvSel"), originalcollision.collisionTimeRes(), tofNsigmaDeEvSel);
665665

666-
if (std::abs(track.tofNSigmaDe()) >= 6) {
666+
if (std::abs(track.tofNSigmaDe()) >= 5) {
667667
registry.fill(HIST("hDauDeuteronTOFPIDCounter"), 0.5);
668-
if (std::abs(tofNsigmaDeAO2D) < 6 && std::abs(tofNsigmaDeEvSel) < 6) {
668+
if (std::abs(tofNsigmaDeAO2D) < 5 && std::abs(tofNsigmaDeEvSel) < 5) {
669669
registry.fill(HIST("hDauDeuteronTOFPIDCounter"), 1.5);
670-
} else if (std::abs(tofNsigmaDeAO2D) < 6 && std::abs(tofNsigmaDeEvSel) >= 6) {
670+
} else if (std::abs(tofNsigmaDeAO2D) < 5 && std::abs(tofNsigmaDeEvSel) >= 5) {
671671
registry.fill(HIST("hDauDeuteronTOFPIDCounter"), 2.5);
672-
} else if (std::abs(tofNsigmaDeAO2D) >= 6 && std::abs(tofNsigmaDeEvSel) < 6) {
672+
} else if (std::abs(tofNsigmaDeAO2D) >= 5 && std::abs(tofNsigmaDeEvSel) < 5) {
673673
registry.fill(HIST("hDauDeuteronTOFPIDCounter"), 3.5);
674-
} else if (std::abs(tofNsigmaDeAO2D) >= 6 && std::abs(tofNsigmaDeEvSel) >= 6) {
674+
} else if (std::abs(tofNsigmaDeAO2D) >= 5 && std::abs(tofNsigmaDeEvSel) >= 5) {
675675
registry.fill(HIST("hDauDeuteronTOFPIDCounter"), 4.5);
676676
}
677-
} else if (std::abs(track.tofNSigmaDe()) < 6) {
677+
} else if (std::abs(track.tofNSigmaDe()) < 5) {
678678
registry.fill(HIST("hDauDeuteronTOFPIDCounter_CloseBC"), 0.5);
679-
if (std::abs(tofNsigmaDeAO2D) < 6 && std::abs(tofNsigmaDeEvSel) < 6) {
679+
if (std::abs(tofNsigmaDeAO2D) < 5 && std::abs(tofNsigmaDeEvSel) < 5) {
680680
registry.fill(HIST("hDauDeuteronTOFPIDCounter_CloseBC"), 1.5);
681-
} else if (std::abs(tofNsigmaDeAO2D) < 6 && std::abs(tofNsigmaDeEvSel) >= 6) {
681+
} else if (std::abs(tofNsigmaDeAO2D) < 5 && std::abs(tofNsigmaDeEvSel) >= 5) {
682682
registry.fill(HIST("hDauDeuteronTOFPIDCounter_CloseBC"), 2.5);
683-
} else if (std::abs(tofNsigmaDeAO2D) >= 6 && std::abs(tofNsigmaDeEvSel) < 6) {
683+
} else if (std::abs(tofNsigmaDeAO2D) >= 5 && std::abs(tofNsigmaDeEvSel) < 5) {
684684
registry.fill(HIST("hDauDeuteronTOFPIDCounter_CloseBC"), 3.5);
685-
} else if (std::abs(tofNsigmaDeAO2D) >= 6 && std::abs(tofNsigmaDeEvSel) >= 6) {
685+
} else if (std::abs(tofNsigmaDeAO2D) >= 5 && std::abs(tofNsigmaDeEvSel) >= 5) {
686686
registry.fill(HIST("hDauDeuteronTOFPIDCounter_CloseBC"), 4.5);
687687
}
688688
}
@@ -723,7 +723,7 @@ struct Hypertriton3bodyMcParticleCheck {
723723
void init(InitContext&)
724724
{
725725
registry.get<TH1>(HIST("hMcCollCounter"))->GetXaxis()->SetBinLabel(1, "Total Counter");
726-
registry.get<TH1>(HIST("hMcCollCounter"))->GetXaxis()->SetBinLabel(2, "Recoonstructed");
726+
registry.get<TH1>(HIST("hMcCollCounter"))->GetXaxis()->SetBinLabel(2, "Reconstructed");
727727

728728
registry.get<TH1>(HIST("hMcHypertritonCounter"))->GetXaxis()->SetBinLabel(1, "Hypertriton All");
729729
registry.get<TH1>(HIST("hMcHypertritonCounter"))->GetXaxis()->SetBinLabel(2, "Matter All");
@@ -736,7 +736,6 @@ struct Hypertriton3bodyMcParticleCheck {
736736
registry.get<TH1>(HIST("hMcHypertritonCounter"))->GetXaxis()->SetBinLabel(9, "PtCut");
737737
}
738738

739-
Configurable<float> rapidityMCcut{"rapidityMCcut", 1, "rapidity cut MC count"};
740739
Configurable<bool> mc_event_selection{"mc_event_selection", true, "mc event selection count post kIsTriggerTVX and kNoTimeFrameBorder"};
741740
Configurable<bool> event_posZ_selection{"event_posZ_selection", true, "event selection count post poZ cut"};
742741

@@ -770,7 +769,7 @@ struct Hypertriton3bodyMcParticleCheck {
770769
}
771770
}
772771

773-
void process(aod::McCollisions const& mcCollisions, aod::McParticles const& particlesMC, const soa::SmallGroups<o2::soa::Join<o2::aod::Collisions, o2::aod::McCollisionLabels, o2::aod::EvSels>>& collisions, MCLabeledTracksIU const& tracks)
772+
void process(aod::McCollisions const& mcCollisions, aod::McParticles const& particlesMC, const o2::soa::Join<o2::aod::Collisions, o2::aod::McCollisionLabels, o2::aod::EvSels>& collisions, MCLabeledTracksIU const& tracks)
774773
{
775774
SetTrackIDForMC(particlesMC, tracks);
776775
std::vector<int64_t> SelectedEvents(collisions.size());
@@ -779,7 +778,7 @@ struct Hypertriton3bodyMcParticleCheck {
779778
if (mc_event_selection && (!collision.selection_bit(aod::evsel::kIsTriggerTVX) || !collision.selection_bit(aod::evsel::kNoTimeFrameBorder))) {
780779
continue;
781780
}
782-
if (event_posZ_selection && abs(collision.posZ()) > 10.f) { // 10cm
781+
if (event_posZ_selection && std::abs(collision.posZ()) > 10.f) { // 10cm
783782
continue;
784783
}
785784
SelectedEvents[nevts++] = collision.mcCollision_as<aod::McCollisions>().globalIndex();
@@ -866,7 +865,7 @@ struct Hypertriton3bodyMcParticleCheck {
866865
registry.fill(HIST("hMcHypertritonCounter"), 3.5);
867866
registry.fill(HIST("hMcHypertritonCounter"), 5.5);
868867
}
869-
double hypertritonMCMass = RecoDecay::m(array{array{dauProtonMom[0], dauProtonMom[1], dauProtonMom[2]}, array{dauPionMom[0], dauPionMom[1], dauPionMom[2]}, array{dauDeuteronMom[0], dauDeuteronMom[1], dauDeuteronMom[2]}}, array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged, o2::constants::physics::MassDeuteron});
868+
double hypertritonMCMass = RecoDecay::m(std::array{std::array{dauProtonMom[0], dauProtonMom[1], dauProtonMom[2]}, std::array{dauPionMom[0], dauPionMom[1], dauPionMom[2]}, std::array{dauDeuteronMom[0], dauDeuteronMom[1], dauDeuteronMom[2]}}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged, o2::constants::physics::MassDeuteron});
870869
registry.fill(HIST("hMcRecoInvMass"), hypertritonMCMass);
871870

872871
if (hypertritonMCMass > 2.990 && hypertritonMCMass < 2.993) {

0 commit comments

Comments
 (0)