Skip to content

Commit 153992b

Browse files
JimunLeejimun_lee
andauthored
[PWGJE] Reduced the process of calculation corresponding to the configuration in phiInJets.cxx (#11080)
Co-authored-by: jimun_lee <jimun.lee@cern.ch>
1 parent b7aa1da commit 153992b

File tree

1 file changed

+43
-34
lines changed

1 file changed

+43
-34
lines changed

PWGJE/Tasks/phiInJets.cxx

Lines changed: 43 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -724,26 +724,27 @@ struct phiInJets {
724724
if (std::fabs(originalTrack.eta()) > cfgtrkMaxEta || std::fabs(originalTrack2.eta()) > cfgtrkMaxEta)
725725
continue;
726726

727-
double dPhi = TVector2::Phi_mpi_pi(originalTrack.phi() - originalTrack2.phi());
728-
double dEta = originalTrack.eta() - originalTrack2.eta();
729-
if (cfgMCRecRotationalHists) {
730-
JEhistos.fill(HIST("hMCRec_dPhi_distribution"), dPhi);
731-
JEhistos.fill(HIST("hMCRec_dEta_distribution"), dEta);
732-
}
733-
double dR = TMath::Sqrt(dPhi * dPhi + dEta * dEta);
734-
double dR_rot = 0;
735727
TLorentzVector lDecayDaughter1, lDecayDaughter2, lResonance, lRotationalTrack, lRotationalResonance;
736728
lDecayDaughter1.SetXYZM(originalTrack.px(), originalTrack.py(), originalTrack.pz(), massKa);
737-
//-----------------------------------------------------------------------
738-
TRandom* trand = new TRandom();
739-
double shift = trand->Uniform(TMath::Pi() - TMath::Pi() / 10.0, TMath::Pi() + TMath::Pi() / 10.0);
740-
// double shift = TMath::Pi();
741729

742-
if (!cfgIsKstar) {
743-
lDecayDaughter2.SetXYZM(originalTrack2.px(), originalTrack2.py(), originalTrack2.pz(), massKa);
744-
} else {
745-
lDecayDaughter2.SetXYZM(originalTrack2.px(), originalTrack2.py(), originalTrack2.pz(), massPi);
730+
if (cfgMCRecRotationalHists) {
731+
double dPhi = TVector2::Phi_mpi_pi(originalTrack.phi() - originalTrack2.phi());
732+
double dEta = originalTrack.eta() - originalTrack2.eta();
733+
734+
JEhistos.fill(HIST("hMCRec_dPhi_distribution"), dPhi);
735+
JEhistos.fill(HIST("hMCRec_dEta_distribution"), dEta);
736+
double dR = TMath::Sqrt(dPhi * dPhi + dEta * dEta);
737+
double dR_rot = 0;
746738

739+
//-----------------------------------------------------------------------
740+
TRandom* trand = new TRandom();
741+
double shift = trand->Uniform(TMath::Pi() - TMath::Pi() / 10.0, TMath::Pi() + TMath::Pi() / 10.0);
742+
// double shift = TMath::Pi();
743+
if (!cfgIsKstar) {
744+
lDecayDaughter2.SetXYZM(originalTrack2.px(), originalTrack2.py(), originalTrack2.pz(), massKa);
745+
} else {
746+
lDecayDaughter2.SetXYZM(originalTrack2.px(), originalTrack2.py(), originalTrack2.pz(), massPi);
747+
}
747748
lRotationalTrack = lDecayDaughter2;
748749
lRotationalTrack.RotateZ(shift);
749750

@@ -752,16 +753,28 @@ struct phiInJets {
752753
double dEta_rot_qa = TMath::Abs(lDecayDaughter2.Eta()) - TMath::Abs(lRotationalTrack.Eta());
753754

754755
dR_rot = TMath::Sqrt(dPhi_rot * dPhi_rot + dEta_rot * dEta_rot);
755-
if (cfgMCRecRotationalHists) {
756-
JEhistos.fill(HIST("hMCRec_dPhi_rot_distribution"), dPhi_rot);
757-
JEhistos.fill(HIST("hMCRec_dEta_rot_distribution"), dEta_rot);
758-
JEhistos.fill(HIST("hMCRec_dEta_qa_rot_distribution"), dEta_rot_qa);
756+
JEhistos.fill(HIST("hMCRec_dPhi_rot_distribution"), dPhi_rot);
757+
JEhistos.fill(HIST("hMCRec_dEta_rot_distribution"), dEta_rot);
758+
JEhistos.fill(HIST("hMCRec_dEta_qa_rot_distribution"), dEta_rot_qa);
759+
760+
lResonance = lDecayDaughter1 + lDecayDaughter2;
761+
if (cfgIsKstar)
762+
lRotationalResonance = lDecayDaughter1 + lRotationalTrack;
763+
764+
if (cfgIsKstar) {
765+
JEhistos.fill(HIST("hMCRec_R_distribution"), dR);
766+
JEhistos.fill(HIST("hMCRec_hUSS_Rotational"), 1.0, lRotationalResonance.Pt(), lResonance.M());
767+
JEhistos.fill(HIST("hMCRec_R_Rotation_distribution"), dR_rot);
759768
}
760769
}
761770
//-----------------------------------------------------------------------
771+
if (!cfgIsKstar) {
772+
lDecayDaughter2.SetXYZM(originalTrack2.px(), originalTrack2.py(), originalTrack2.pz(), massKa);
773+
} else {
774+
lDecayDaughter2.SetXYZM(originalTrack2.px(), originalTrack2.py(), originalTrack2.pz(), massPi);
775+
}
762776
lResonance = lDecayDaughter1 + lDecayDaughter2;
763-
if (cfgIsKstar)
764-
lRotationalResonance = lDecayDaughter1 + lRotationalTrack;
777+
765778
if (std::fabs(lResonance.Eta()) > cfgtrkMaxEta)
766779
continue;
767780

@@ -776,11 +789,6 @@ struct phiInJets {
776789
if (originalTrack.sign() * originalTrack2.sign() < 0) {
777790
JEhistos.fill(HIST("hMCRec_hUSS"), 1.0, lResonance.Pt(), lResonance.M());
778791

779-
if (cfgMCRecRotationalHists && cfgIsKstar) {
780-
JEhistos.fill(HIST("hMCRec_R_distribution"), dR);
781-
JEhistos.fill(HIST("hMCRec_hUSS_Rotational"), 1.0, lRotationalResonance.Pt(), lResonance.M());
782-
JEhistos.fill(HIST("hMCRec_R_Rotation_distribution"), dR_rot);
783-
}
784792
} else if (originalTrack.sign() * originalTrack2.sign() > 0) {
785793
JEhistos.fill(HIST("hMCRec_hLSS"), 1.0, lResonance.Pt(), lResonance.M());
786794
}
@@ -804,14 +812,15 @@ struct phiInJets {
804812
double etadiff = mcd_eta[i] - lResonance.Eta();
805813
double R = TMath::Sqrt((etadiff * etadiff) + (phidiff * phidiff));
806814

807-
double phidiff_K1 = TVector2::Phi_mpi_pi(mcd_phi[i] - lDecayDaughter1.Phi());
808-
double etadiff_K1 = mcd_eta[i] - lDecayDaughter1.Eta();
809-
double R_K1 = TMath::Sqrt((etadiff_K1 * etadiff_K1) + (phidiff_K1 * phidiff_K1));
810-
811-
double phidiff_K2 = TVector2::Phi_mpi_pi(mcd_phi[i] - lDecayDaughter2.Phi());
812-
double etadiff_K2 = mcd_eta[i] - lDecayDaughter2.Eta();
813-
double R_K2 = TMath::Sqrt((etadiff_K2 * etadiff_K2) + (phidiff_K2 * phidiff_K2));
814815
if (cfgDaughterQAHists && R < cfgjetR) {
816+
double phidiff_K1 = TVector2::Phi_mpi_pi(mcd_phi[i] - lDecayDaughter1.Phi());
817+
double etadiff_K1 = mcd_eta[i] - lDecayDaughter1.Eta();
818+
double R_K1 = TMath::Sqrt((etadiff_K1 * etadiff_K1) + (phidiff_K1 * phidiff_K1));
819+
820+
double phidiff_K2 = TVector2::Phi_mpi_pi(mcd_phi[i] - lDecayDaughter2.Phi());
821+
double etadiff_K2 = mcd_eta[i] - lDecayDaughter2.Eta();
822+
double R_K2 = TMath::Sqrt((etadiff_K2 * etadiff_K2) + (phidiff_K2 * phidiff_K2));
823+
815824
JEhistos.fill(HIST("hMCRec_nonmatch_hUSS_Kangle_v_pt"), R_K1, lResonance.Pt());
816825
JEhistos.fill(HIST("hMCRec_nonmatch_hUSS_Kangle_v_pt"), R_K2, lResonance.Pt());
817826
}

0 commit comments

Comments
 (0)