Skip to content

Commit

Permalink
PWGEM/PhotonMeson: quick fix for MC histograms (AliceO2Group#4547)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsekihat authored Feb 1, 2024
1 parent 64d6097 commit 152b7af
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 16 deletions.
8 changes: 4 additions & 4 deletions PWGEM/PhotonMeson/Core/HistogramsLibrary.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char*
list->Add(new TH1F("hNclsITS", "number of ITS clusters", 8, -0.5, 7.5));
list->Add(new TH1F("hChi2ITS", "chi2/number of ITS clusters", 100, 0, 10));
list->Add(new TH1F("hITSClusterMap", "ITS cluster map", 128, -0.5, 127.5));
list->Add(new TH1F("hMeanClusterSizeITS", "mean cluster size ITS;<cluster size> on ITS", 34, -0.5, 16.5));
list->Add(new TH1F("hMeanClusterSizeITS", "mean cluster size ITS;<cluster size> on ITS #times cos(#lambda)", 160, 0, 16));
list->Add(new TH2F("hXY", "X vs. Y;X (cm);Y (cm)", 100, 0, 100, 100, -50, 50));
list->Add(new TH2F("hZX", "Z vs. X;Z (cm);X (cm)", 200, -100, 100, 100, 0, 100));
list->Add(new TH2F("hZY", "Z vs. Y;Z (cm);Y (cm)", 200, -100, 100, 100, -50, 50));
Expand Down Expand Up @@ -229,7 +229,7 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char*
list->Add(hs_dilepton_lsmm_dca_mix);
}

if (TString(subGroup) == "mc") {
if (TString(subGroup).Contains("mc")) {
// create phiv template
list->Add(new TH2F("hMvsPhiV_Pi0", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", 32, 0, 3.2, 100, 0.0f, 0.1f)); // ee from pi0 dalitz decay
list->Add(new TH2F("hMvsPhiV_Eta", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", 32, 0, 3.2, 100, 0.0f, 0.1f)); // ee from eta dalitz decay
Expand Down Expand Up @@ -257,7 +257,7 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char*
hs_dilepton_lsmm_same->Sumw2();
list->Add(hs_dilepton_lsmm_same);

if (TString(subGroup) == "mix") {
if (TString(subGroup).Contains("mix")) {
THnSparseF* hs_dilepton_uls_mix = reinterpret_cast<THnSparseF*>(hs_dilepton_uls_same->Clone("hs_dilepton_uls_mix"));
THnSparseF* hs_dilepton_lspp_mix = reinterpret_cast<THnSparseF*>(hs_dilepton_lspp_same->Clone("hs_dilepton_lspp_mix"));
THnSparseF* hs_dilepton_lsmm_mix = reinterpret_cast<THnSparseF*>(hs_dilepton_lsmm_same->Clone("hs_dilepton_lsmm_mix"));
Expand Down Expand Up @@ -307,7 +307,7 @@ void o2::aod::emphotonhistograms::DefineHistograms(THashList* list, const char*
list->Add(new TH1F("hNclsITS", "number of ITS clusters", 8, -0.5, 7.5));
list->Add(new TH1F("hChi2ITS", "chi2/number of ITS clusters", 100, 0, 10));
list->Add(new TH1F("hITSClusterMap", "ITS cluster map", 128, -0.5, 127.5));
list->Add(new TH1F("hMeanClusterSizeITS", "mean cluster size ITS;<cluster size> on ITS", 34, -0.5, 16.5));
list->Add(new TH1F("hMeanClusterSizeITS", "mean cluster size ITS;<cluster size> on ITS #times cos(#lambda)", 160, 0, 16));
if (TString(subGroup).Contains("mc")) {
list->Add(new TH2F("hPtGen_DeltaPtOverPtGen", "electron p_{T} resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", 1000, 0, maxP, 400, -1.0f, 1.0f));
list->Add(new TH2F("hPtGen_DeltaEta", "electron #eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", 1000, 0, maxP, 400, -1.0f, 1.0f));
Expand Down
4 changes: 2 additions & 2 deletions PWGEM/PhotonMeson/Core/HistogramsLibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void FillHistClass(THashList* list, const char* subGroup, T const& obj)
reinterpret_cast<TH1F*>(list->FindObject("hChi2TPC"))->Fill(obj.tpcChi2NCl());
reinterpret_cast<TH1F*>(list->FindObject("hChi2ITS"))->Fill(obj.itsChi2NCl());
reinterpret_cast<TH1F*>(list->FindObject("hITSClusterMap"))->Fill(obj.itsClusterMap());
reinterpret_cast<TH1F*>(list->FindObject("hMeanClusterSizeITS"))->Fill(obj.meanClusterSizeITS());
reinterpret_cast<TH1F*>(list->FindObject("hMeanClusterSizeITS"))->Fill(obj.meanClusterSizeITS() * std::cos(std::atan(obj.tgl())));
reinterpret_cast<TH2F*>(list->FindObject("hTPCdEdx"))->Fill(obj.tpcInnerParam(), obj.tpcSignal());
reinterpret_cast<TH2F*>(list->FindObject("hTPCNsigmaEl"))->Fill(obj.tpcInnerParam(), obj.tpcNSigmaEl());
reinterpret_cast<TH2F*>(list->FindObject("hTPCNsigmaPi"))->Fill(obj.tpcInnerParam(), obj.tpcNSigmaPi());
Expand All @@ -121,7 +121,7 @@ void FillHistClass(THashList* list, const char* subGroup, T const& obj)
reinterpret_cast<TH1F*>(list->FindObject("hChi2TPC"))->Fill(obj.tpcChi2NCl());
reinterpret_cast<TH1F*>(list->FindObject("hChi2ITS"))->Fill(obj.itsChi2NCl());
reinterpret_cast<TH1F*>(list->FindObject("hITSClusterMap"))->Fill(obj.itsClusterMap());
reinterpret_cast<TH1F*>(list->FindObject("hMeanClusterSizeITS"))->Fill(obj.meanClusterSizeITS());
reinterpret_cast<TH1F*>(list->FindObject("hMeanClusterSizeITS"))->Fill(obj.meanClusterSizeITS() * std::cos(std::atan(obj.tgl())));
reinterpret_cast<TH2F*>(list->FindObject("hTPCdEdx"))->Fill(obj.tpcInnerParam(), obj.tpcSignal());
reinterpret_cast<TH2F*>(list->FindObject("hTPCNsigmaEl"))->Fill(obj.tpcInnerParam(), obj.tpcNSigmaEl());
reinterpret_cast<TH2F*>(list->FindObject("hTPCNsigmaMu"))->Fill(obj.tpcInnerParam(), obj.tpcNSigmaMu());
Expand Down
4 changes: 2 additions & 2 deletions PWGEM/PhotonMeson/DataModel/gammaTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ DECLARE_SOA_TABLE(EMPrimaryElectrons, "AOD", "EMPRIMARYEL", //!
track::TPCChi2NCl, track::TPCInnerParam,
track::TPCSignal, pidtpc::TPCNSigmaEl, pidtpc::TPCNSigmaMu, pidtpc::TPCNSigmaPi, pidtpc::TPCNSigmaKa, pidtpc::TPCNSigmaPr,
pidtofbeta::Beta, pidtof::TOFNSigmaEl, pidtof::TOFNSigmaMu, pidtof::TOFNSigmaPi, pidtof::TOFNSigmaKa, pidtof::TOFNSigmaPr,
track::ITSClusterSizes, track::ITSChi2NCl, track::DetectorMap, track::Signed1Pt, track::CYY, track::CZZ, track::CZY,
track::ITSClusterSizes, track::ITSChi2NCl, track::DetectorMap, track::Tgl, track::Signed1Pt, track::CYY, track::CZZ, track::CZY,

// dynamic column
track::TPCNClsFound<track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
Expand Down Expand Up @@ -538,7 +538,7 @@ DECLARE_SOA_TABLE(EMPrimaryMuons, "AOD", "EMPRIMARYMU", //!
track::TPCChi2NCl, track::TPCInnerParam,
track::TPCSignal, pidtpc::TPCNSigmaEl, pidtpc::TPCNSigmaMu, pidtpc::TPCNSigmaPi, pidtpc::TPCNSigmaKa, pidtpc::TPCNSigmaPr,
pidtofbeta::Beta, pidtof::TOFNSigmaEl, pidtof::TOFNSigmaMu, pidtof::TOFNSigmaPi, pidtof::TOFNSigmaKa, pidtof::TOFNSigmaPr,
track::ITSClusterSizes, track::ITSChi2NCl, track::DetectorMap, track::Signed1Pt, track::CYY, track::CZZ, track::CZY,
track::ITSClusterSizes, track::ITSChi2NCl, track::DetectorMap, track::Tgl, track::Signed1Pt, track::CYY, track::CZZ, track::CZY,

// dynamic column
track::TPCNClsFound<track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
Expand Down
2 changes: 1 addition & 1 deletion PWGEM/PhotonMeson/TableProducer/skimmerPrimaryElectron.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ struct skimmerPrimaryElectron {
track.tpcChi2NCl(), track.tpcInnerParam(),
track.tpcSignal(), track.tpcNSigmaEl(), track.tpcNSigmaMu(), track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr(),
track.beta(), track.tofNSigmaEl(), track.tofNSigmaMu(), track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr(),
track.itsClusterSizes(), track.itsChi2NCl(), track.detectorMap(), track.signed1Pt(), track.cYY(), track.cZZ(), track.cZY());
track.itsClusterSizes(), track.itsChi2NCl(), track.detectorMap(), track.tgl(), track.signed1Pt(), track.cYY(), track.cZZ(), track.cZY());
fRegistry.fill(HIST("Track/hTPCdEdx_Pin_after"), track.tpcInnerParam(), track.tpcSignal());
fRegistry.fill(HIST("Track/hTOFbeta_Pin_after"), track.tpcInnerParam(), track.beta());
fRegistry.fill(HIST("Track/hTPCNsigmaEl_after"), track.tpcInnerParam(), track.tpcNSigmaEl());
Expand Down
2 changes: 1 addition & 1 deletion PWGEM/PhotonMeson/TableProducer/skimmerPrimaryMuon.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ struct skimmerPrimaryMuon {
track.tpcChi2NCl(), track.tpcInnerParam(),
track.tpcSignal(), track.tpcNSigmaEl(), track.tpcNSigmaMu(), track.tpcNSigmaPi(), track.tpcNSigmaKa(), track.tpcNSigmaPr(),
track.beta(), track.tofNSigmaEl(), track.tofNSigmaMu(), track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr(),
track.itsClusterSizes(), track.itsChi2NCl(), track.detectorMap(), track.signed1Pt(), track.cYY(), track.cZZ(), track.cZY());
track.itsClusterSizes(), track.itsChi2NCl(), track.detectorMap(), track.tgl(), track.signed1Pt(), track.cYY(), track.cZZ(), track.cZY());
fRegistry.fill(HIST("Track/hTPCdEdx_Pin_after"), track.tpcInnerParam(), track.tpcSignal());
fRegistry.fill(HIST("Track/hTOFbeta_Pin_after"), track.tpcInnerParam(), track.beta());
fRegistry.fill(HIST("Track/hTPCNsigmaMu_after"), track.tpcInnerParam(), track.tpcNSigmaMu());
Expand Down
22 changes: 16 additions & 6 deletions PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ struct DalitzEEQCMC {
Configurable<std::string> fConfigDalitzEECuts{"cfgDalitzEECuts", "mee_all_tpchadrejortofreq_lowB,nocut", "Comma separated list of dalitz ee cuts"};
std::vector<DalitzEECut> fDalitzEECuts;

Configurable<bool> cfgDoDCAstudy{"cfgDoDCAstudy", false, "flag to fill histograms for DCA"};

OutputObj<THashList> fOutputEvent{"Event"};
OutputObj<THashList> fOutputTrack{"Track"};
OutputObj<THashList> fOutputDalitzEE{"DalitzEE"};
Expand Down Expand Up @@ -93,7 +95,12 @@ struct DalitzEEQCMC {
for (auto& cut : fDalitzEECuts) {
std::string_view cutname = cut.GetName();
THashList* list = reinterpret_cast<THashList*>(fMainList->FindObject("DalitzEE")->FindObject(cutname.data()));
o2::aod::emphotonhistograms::DefineHistograms(list, "DalitzEE", "mc");
// o2::aod::emphotonhistograms::DefineHistograms(list, "DalitzEE", "mc");
std::string histo_sub_group = "mc,";
if (cfgDoDCAstudy) {
histo_sub_group += "dca";
}
o2::aod::emphotonhistograms::DefineHistograms(list, "DalitzEE", histo_sub_group.data());
}
}

Expand Down Expand Up @@ -206,11 +213,14 @@ struct DalitzEEQCMC {
dca_ele_3d = std::sqrt(std::abs(chi2ele) / 2.);
dca_ee_3d = std::sqrt((dca_pos_3d * dca_pos_3d + dca_ele_3d * dca_ele_3d) / 2.);
}
values_single[0] = uls_pair.mass();
values_single[1] = dca_pos_3d;
values_single[2] = dca_ele_3d;
values_single[3] = dca_ee_3d;
reinterpret_cast<THnSparseF*>(list_dalitzee_cut->FindObject("hs_dilepton_uls_dca_same"))->Fill(values_single);

if (cfgDoDCAstudy) {
values_single[0] = uls_pair.mass();
values_single[1] = dca_pos_3d;
values_single[2] = dca_ele_3d;
values_single[3] = dca_ee_3d;
reinterpret_cast<THnSparseF*>(list_dalitzee_cut->FindObject("hs_dilepton_uls_dca_same"))->Fill(values_single);
}

values[0] = uls_pair.mass();
values[1] = uls_pair.pt();
Expand Down

0 comments on commit 152b7af

Please sign in to comment.