-
Notifications
You must be signed in to change notification settings - Fork 613
[PWGDQ] Adding the code for the energy correlators analysis #13572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
O2 linter results: ❌ 501 errors, |
PWGDQ/Core/MCSignalLibrary.cxx
Outdated
| if (!nameStr.compare("eeFrompromptJpsi")) { | ||
| MCProng prong(2, {11, 443}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}, false, {503}, {true}); | ||
| prong.SetSourceBit(0, MCProng::kPhysicalPrimary); | ||
| signal = new MCSignal(name, "ee pairs from prompt j/psi decays", {prong, prong}, {1, 1}); // signal at pair level | ||
| return signal; | ||
| } | ||
|
|
||
| if (!nameStr.compare("eeFromnonpromptJpsi")) { | ||
| MCProng prong(3, {11, 443, 503}, {true, true, true}, {false, false, false}, {0, 0, 0}, {0, 0, 0}, {false, false, false}); | ||
| prong.SetSourceBit(0, MCProng::kPhysicalPrimary); | ||
| signal = new MCSignal(name, "ee pairs from nonprompt j/psi decays", {prong, prong}, {2, 2}); // signal at pair level | ||
| return signal; | ||
| } | ||
|
|
||
| ////// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need these two signals. You can use the ones already existing: eePrimaryFromPromptJPsi and eePrimaryFromNonPromptJPsi. Also, I think that the non-prompt signal is also wrong, since I suppose you want to have the jpsi common mother, not the B hadron, so it should be {1,1} not {2,2}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I don't notice this, I will remove these lines.
PWGDQ/Core/MCSignalLibrary.cxx
Outdated
| // if (!nameStr.compare("eeFromNonPromptJpsiAnyPrimary")) { | ||
| // MCProng pronge(2, {11, 443}, {true, true}, {false, false}, {0, 0}, {0, 0}, {false, false}, false, {503}, {false}); | ||
| // pronge.SetSourceBit(0, MCProng::kPhysicalPrimary); | ||
| // MCProng prongPrimary(1); | ||
| // prongPrimary.SetSourceBit(0, MCProng::kPhysicalPrimary); | ||
| // signal = new MCSignal(name, "anyprimary and electron pair from non-prompt jpsi", {pronge, pronge, prongPrimary}, {-1, -1, -1}); | ||
| // return signal; | ||
| //} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented out code
PWGDQ/Core/VarManager.h
Outdated
| if (fgUsedVars[kCosChi] || fgUsedVars[kECWeight] || fgUsedVars[kCosTheta] || fgUsedVars[kEWeight_before] || fgUsedVars[kPtDau] || fgUsedVars[kPhiDau] || fgUsedVars[kEtaDau]) { | ||
| values[VarManager::kCosTheta] = LorentzTransformJpsihadroncosChi("costheta", v12, v3); | ||
| values[VarManager::kEWeight_before] = v3.Pt() / v12.M(); | ||
| values[VarManager::kPtDau] = v3.Pt(); | ||
| values[VarManager::kEtaDau] = v3.Eta(); | ||
| values[VarManager::kPhiDau] = v3.Phi(); | ||
| float E_boost = LorentzTransformJpsihadroncosChi("weight_boost", v12, v3); | ||
| values[VarManager::kCosChi] = LorentzTransformJpsihadroncosChi("coschi", v12, v3); | ||
| values[VarManager::kECWeight] = E_boost / v12.M(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you adding code in the muon propagation function ?
| // apply kinematic cuts for signal | ||
| if (fConfigUseMCGenpTcut && (track_raw.pt() < fConfigDileptonLowpTCut || track_raw.pt() > fConfigDileptonHighpTCut)) | ||
| continue; | ||
| if (fConfigUseMCRapcut && abs(track_raw.y()) > fConfigDileptonRapCutAbs) | ||
| continue; | ||
| VarManager::FillTrackMC(mcTracks, track_raw, fValuesSignal); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is loop over the single particles which are the "mother" particle of the triplet (dilepton + track). So here it is supposed to be the B meson for B analysis. In your case, for EEC, this is not defined, you do not have a specified common mother. So these cuts make no sense for you. Please remove them, or maybe explain what is the use for this and we can see where these ave to be implemented.
| for (auto& sig : fGenMCSignals) { | ||
| if (sig->CheckSignal(true, track_raw)) { | ||
| fHistMan->FillHistClass(Form("MCTruthGenSel_%s", sig->GetName()), VarManager::fgValues); | ||
| fHistMan->FillHistClass(Form("MCTruthGenSel_%s", sig->GetName()), fValuesSignal); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change this back
| if (!fConfigCaculateEC) | ||
| continue; | ||
| for (auto& mctrack1 : groupedMCTracks) { | ||
| if (TMath::Abs(mctrack1.pdgCode()) == 443 || TMath::Abs(mctrack1.pdgCode()) == 11 || TMath::Abs(mctrack1.pdgCode()) == 22) | ||
| continue; | ||
| if (mctrack1.pt() < fConfigMCGenHadronPtMin.value || std::abs(mctrack1.eta()) > fConfigMCGenHadronEtaAbs.value) | ||
| continue; | ||
| if (mctrack1.getGenStatusCode() <= 0) | ||
| continue; | ||
| for (auto& sig : fGenMCSignals) { | ||
| VarManager::FillEnergyCorrelators(track_raw, mctrack1, fValuesEC); | ||
| if (sig->CheckSignal(true, track_raw)) { | ||
| fHistMan->FillHistClass(Form("MCTruthGenSel_%s", sig->GetName()), fValuesEC); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont understand this part of the code. You have many hardcoded checks for PDG codes, status codes and so on. What do you want to do here?
| if (!fConfigCaculateRE) | ||
| continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
|
|
||
| if (classStr.Contains("MCTruthGen")) { | ||
| dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "mctruth_track"); | ||
| dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "energy_correlator_gen"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these histograms should be added only if needed
|
@YazhenLin Please do not add a PR title prefix tag if you cannot do it properly. As you can see, the correct tag is added automatically. Fix the duplication. |
Thank you, I fix this now. |
|
Error while checking build/O2Physics/o2 for 6d1f085 at 2025-11-07 12:55: Full log here. |
| hm->AddHistogram(histClass, "Mass_Assoc", "", false, 500, 0.0, 1.0, VarManager::kMassDau); | ||
| hm->AddHistogram(histClass, "Mass_Dilepton_Mass_Assoc", "", false, 500, 0.0, 5.0, VarManager::kPairMassDau, 500, 0.0, 5.0, VarManager::kMassDau); | ||
| hm->AddHistogram(histClass, "Pt_Dilepton", "", false, 2000, 0.0, 30.0, VarManager::kPairPtDau); | ||
| hm->AddHistogram(histClass, "Pt_Assoc", "", false, 500, 0.0, 10.0, VarManager::kPt); | ||
| hm->AddHistogram(histClass, "Mass_DileptonAssoc", "", false, 4500, 0.0, 30.0, VarManager::kPairMass); | ||
| hm->AddHistogram(histClass, "Pt_DileptonAssoc", "", false, 2000, 0.0, 30.0, VarManager::kPairPt); | ||
| hm->AddHistogram(histClass, "Mass_Pt_DileptonAssoc", "", false, 500, 0.0, 30.0, VarManager::kPairMass, 200, 0.0, 30.0, VarManager::kPairPt); | ||
| hm->AddHistogram(histClass, "Pt_Rap_DileptonAssoc", "", false, 5120, 0.0, 30.0, VarManager::kPairPt, 1000, -5.0, 5.0, VarManager::kRap); | ||
| hm->AddHistogram(histClass, "DeltaMass", "", false, 1500, 0.0, 5.5, VarManager::kDeltaMass); | ||
| hm->AddHistogram(histClass, "DeltaMass_ptdileptonassoc", "", false, 1000, 0.0, 1.0, VarManager::kDeltaMass, 3000, 0.0, 30.0, VarManager::kPairPt); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you remove some histograms. Were these your histograms and decided to remove them? If not, please let them there. You probably need to rebase.
| hm->AddHistogram(histClass, "Mass_Pt", "", false, 500, 0.0, 15.0, VarManager::kMCMass, 40, 0.0, 20.0, VarManager::kMCPt); | ||
| hm->AddHistogram(histClass, "Pt", "", false, 200, 0.0, 20.0, VarManager::kMCPt); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as above
| hm->AddHistogram(histClass, "Mass", "", false, 500, 0.0, 15.0, VarManager::kMCMass); | ||
| hm->AddHistogram(histClass, "Rapidity", "", false, 100, -5.0, 5.0, VarManager::kMCY); | ||
| hm->AddHistogram(histClass, "Eta_Pt", "", false, 40, -2.0, 2.0, VarManager::kMCEta, 200, 0.0, 20.0, VarManager::kMCPt); | ||
| hm->AddHistogram(histClass, "Phi_Eta", "#phi vs #eta distribution", false, 200, -5.0, 5.0, VarManager::kMCEta, 200, -2. * o2::constants::math::PI, 2. * o2::constants::math::PI, VarManager::kMCPhi); | ||
| if (subGroupStr.Contains("polarization")) { | ||
| int varspTHE[4] = {VarManager::kMCPt, VarManager::kMCCosThetaHE, VarManager::kMCPhiHE, VarManager::kMCPhiTildeHE}; | ||
| int varspTCS[4] = {VarManager::kMCPt, VarManager::kMCCosThetaCS, VarManager::kMCPhiCS, VarManager::kMCPhiTildeCS}; | ||
| int bins[4] = {20, 20, 20, 20}; | ||
| double xmin[4] = {0., -1., 0., 0.}; | ||
| double xmax[4] = {20., 1., 2. * o2::constants::math::PI, 2. * o2::constants::math::PI}; | ||
| hm->AddHistogram(histClass, "Pt_cosThetaHE_phiHE_phiTildeHE", "", 4, varspTHE, bins, xmin, xmax, 0, -1, kFALSE); | ||
| hm->AddHistogram(histClass, "Pt_cosThetaCS_phiCS_phiTildeCS", "", 4, varspTCS, bins, xmin, xmax, 0, -1, kFALSE); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as above. You seem to remove the polarizaiton histograms for some reason.
PWGDQ/Core/VarManager.h
Outdated
| template <int pairType, typename T1, typename T2> | ||
| static float calculatePhiV(const T1& t1, const T2& t2); | ||
| template <typename T1, typename T2> | ||
| // static float LorentzTransformJpsihadroncosChi(const T1& t1, const T2& t2 ,float hadronMass); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the comment
| values[kMCEventTime] = event.t(); | ||
| values[kMCEventWeight] = event.weight(); | ||
| values[kMCEventImpParam] = event.impactParameter(); | ||
| values[kMCEventCentrFT0C] = event.centFT0C(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you remove this line ? Probably you need to rebase your O2Physics.
| if constexpr (candidateType == kBtoJpsiEEK) { | ||
| float m1 = o2::constants::physics::MassElectron; | ||
| float m2 = o2::constants::physics::MassElectron; | ||
| float m3 = o2::constants::physics::MassKaonCharged; | ||
| float m4 = o2::constants::physics::MassJPsi; | ||
| ROOT::Math::PtEtaPhiMVector v1(t1.pt(), t1.eta(), t1.phi(), m1); | ||
| ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), m2); | ||
| ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; | ||
| ROOT::Math::PtEtaPhiMVector v3(t3.pt(), t3.eta(), t3.phi(), m3); | ||
| ROOT::Math::PtEtaPhiMVector v123 = v12 + v3; | ||
| values[kPairMass] = v123.M(); | ||
| values[kPairPt] = v123.Pt(); | ||
| values[kPairEta] = v123.Eta(); | ||
| values[kPhi] = v123.Phi(); | ||
| values[kMCY] = -v123.Rapidity(); | ||
| values[kPairMassDau] = v12.M(); | ||
| values[kPairPtDau] = v12.Pt(); | ||
| values[kRap] = -v123.Rapidity(); | ||
| values[kMassDau] = m3; | ||
| values[VarManager::kDeltaMass] = v123.M() - v12.M(); | ||
| values[VarManager::kDeltaMass_jpsi] = v123.M() - v12.M() + m4; | ||
| values[kPt] = t3.pt(); | ||
| values[kEta] = t3.eta(); | ||
| values[kEta1] = t1.eta(); | ||
| values[kEta2] = t2.eta(); | ||
| values[kDeltaEta] = v12.Eta(); | ||
| values[kPt1] = t1.pt(); | ||
| values[kPt2] = t2.pt(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to rebase, otherwise this would remove other people's code.
PWGDQ/Core/VarManager.h
Outdated
| kNMaxCandidateTypes, | ||
| kJpsiHadronMass, // using the real hadron mass | ||
| kJpsiPionMass // treat the hadron as pion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The kNMaxCandidateTypes has to be the last element of the enumeration, so please add your new elements before this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Thank you.
PWGDQ/Core/VarManager.h
Outdated
| static float RotationDeltaPhi(float deltaphi) | ||
| { | ||
| if (deltaphi > 3.0 / 2.0 * TMath::Pi()) { | ||
| deltaphi -= 2.0 * TMath::Pi(); | ||
| } | ||
| if (deltaphi < -0.5 * TMath::Pi()) { | ||
| deltaphi += 2.0 * TMath::Pi(); | ||
| } | ||
| return deltaphi; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a small comment to say what this function does and what is used for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iarsene It's the 42nd (wrong) reinvention of RecoDecay::constrainAngle in that file, as reported by the O2 linter. 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vkucera Thank you for reminding me that this function already exists. I already changed that.
I change the O2Physics/PWGDQ/Core/CutsLibrary.cxx for adding the cut which I need, and change the/Users/cape/alice/O2Physics/PWGDQ/Core/HistogramsLibrary.cxx for the histogram, and change the /Users/cape/alice/O2Physics/PWGDQ/Core/MCSignalLibrary.cxx to get the signals which I interested with, and change the /Users/cape/alice/O2Physics/PWGDQ/Core/VarManager.cxx and /Users/cape/alice/O2Physics/PWGDQ/Core/VarManager.h to get my variables, and change the /Users/cape/alice/O2Physics/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx for my analysis.