Skip to content

Commit 7b0036f

Browse files
authored
PWGEM/PhotonMeson: reduce skimmed data size (#5219)
1 parent ea4bd18 commit 7b0036f

2 files changed

Lines changed: 30 additions & 18 deletions

File tree

PWGEM/PhotonMeson/Core/HistogramsLibrary.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -490,9 +490,9 @@ void o2::aod::pwgem::photon::histogram::DefineHistograms(THashList* list, const
490490
list->Add(new TH1F("hPt_ConvertedPhoton", "converted photon pT;p_{T} (GeV/c)", 2000, 0.0f, 20));
491491
list->Add(new TH1F("hY_ConvertedPhoton", "converted photon y;rapidity y", 40, -2.0f, 2.0f));
492492
list->Add(new TH1F("hPhi_ConvertedPhoton", "converted photon #varphi;#varphi (rad.)", 180, 0, 2 * M_PI));
493-
list->Add(new TH2F("hPhotonRxy", "conversion point in XY MC;V_{x} (cm);V_{y} (cm)", 2000, -100.0f, 100.0f, 2000, -100.0f, 100.0f));
494-
list->Add(new TH2F("hPhotonRZ", "conversion point in RZ MC;V_{z} (cm);R_{xy} (cm)", 2000, -100.0f, 100.0f, 1000, 0.f, 100.0f));
495-
list->Add(new TH2F("hPhotonPhivsRxy", "conversion point of #varphi vs. R_{xy} MC;#varphi (rad.);R_{xy} (cm);N_{e}", 360, 0.0f, 2 * M_PI, 100, 0, 100));
493+
list->Add(new TH2F("hPhotonRxy", "conversion point in XY MC;V_{x} (cm);V_{y} (cm)", 800, -100.0f, 100.0f, 800, -100.0f, 100.0f));
494+
list->Add(new TH2F("hPhotonRZ", "conversion point in RZ MC;V_{z} (cm);R_{xy} (cm)", 1000, -100.0f, 100.0f, 400, 0.f, 100.0f));
495+
list->Add(new TH2F("hPhotonPhivsRxy", "conversion point of #varphi vs. R_{xy} MC;#varphi (rad.);R_{xy} (cm);N_{e}", 360, 0.0f, 2 * M_PI, 400, 0, 100));
496496
}
497497

498498
if (TString(subGroup) == "Pi0Eta") {
@@ -507,7 +507,7 @@ void o2::aod::pwgem::photon::histogram::DefineHistograms(THashList* list, const
507507
}
508508
}
509509
if (TString(subGroup) == "dielectron") {
510-
TH2F* hMvsPt = new TH2F("hMvsPt", "m_{ee} vs. p_{T,ee};m_{ee} (GeV/c^{2});p_{T,ee} (GeV/c)", 110, 0, 1.1f, 1000, 0, 10.f);
510+
TH2F* hMvsPt = new TH2F("hMvsPt", "m_{ee} vs. p_{T,ee};m_{ee} (GeV/c^{2});p_{T,ee} (GeV/c)", 400, 0, 4.0f, 1000, 0, 10.f);
511511
hMvsPt->Sumw2();
512512
list->Add(hMvsPt);
513513
} else if (TString(subGroup) == "dimuon") {

PWGEM/PhotonMeson/TableProducer/associateMCinfo.cxx

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ struct AssociateMCInfo {
4848
Produces<o2::aod::EMPrimaryMuonMCLabels> emprimarymuonmclabels;
4949

5050
Configurable<float> max_rxy_gen{"max_rxy_gen", 100, "max rxy to store generated information"};
51-
Configurable<float> max_Y_gen{"max_Y_gen", 1.5, "max rapidity Y to store generated information"};
51+
Configurable<float> max_Y_gen{"max_Y_gen", 0.9, "max rapidity Y to store generated information"};
5252
Configurable<float> margin_z_gen{"margin_z_gen", 15.f, "margin for Z of true photon conversion point to store generated information"};
5353

5454
HistogramRegistry registry{"EMMCEvent"};
@@ -58,6 +58,8 @@ struct AssociateMCInfo {
5858
auto hEventCounter = registry.add<TH1>("hEventCounter", "hEventCounter", kTH1I, {{6, 0.5f, 6.5f}});
5959
hEventCounter->GetXaxis()->SetBinLabel(1, "all");
6060
hEventCounter->GetXaxis()->SetBinLabel(2, "has mc collision");
61+
registry.add<TH2>("PCM/hXY", "hRxy;X (cm);Y (cm)", kTH2F, {{400, -100, +100}, {400, -100, +100}});
62+
registry.add<TH2>("PCM/hRZ", "hRxy;R (cm);Z (cm)", kTH2F, {{400, -100, +100}, {200, 0, +100}});
6163
}
6264

6365
Preslice<aod::McParticles> perMcCollision = aod::mcparticle::mcCollisionId;
@@ -92,7 +94,6 @@ struct AssociateMCInfo {
9294
// make an entry for this MC event only if it was not already added to the table
9395
if (!(fEventLabels.find(mcCollision.globalIndex()) != fEventLabels.end())) {
9496
mcevents(mcCollision.globalIndex(), mcCollision.generatorsID(), mcCollision.posX(), mcCollision.posY(), mcCollision.posZ(), mcCollision.t(), mcCollision.impactParameter());
95-
// mcevents(mcCollision.generatorsID(), mcCollision.posX(), mcCollision.posY(), mcCollision.posZ(), mcCollision.t(), mcCollision.impactParameter());
9697
fEventLabels[mcCollision.globalIndex()] = fCounters[1];
9798
fCounters[1]++;
9899
}
@@ -103,7 +104,7 @@ struct AssociateMCInfo {
103104
auto groupedMcTracks = mcTracks.sliceBy(perMcCollision, mcCollision.globalIndex());
104105

105106
for (auto& mctrack : groupedMcTracks) { // store necessary information for denominator of efficiency
106-
if (mctrack.pt() < 1e-3 || abs(mctrack.y()) > max_Y_gen || abs(mctrack.vz()) > 250 || sqrt(pow(mctrack.vx(), 2) + pow(mctrack.vy(), 2)) > max_rxy_gen) {
107+
if (mctrack.pt() < 1e-3 || abs(mctrack.vz()) > 250 || sqrt(pow(mctrack.vx(), 2) + pow(mctrack.vy(), 2)) > max_rxy_gen) {
107108
continue;
108109
}
109110
int pdg = mctrack.pdgCode();
@@ -138,14 +139,30 @@ struct AssociateMCInfo {
138139
}
139140
// LOGF(info,"index = %d , mc track pdg = %d , producedByGenerator = %d , isPhysicalPrimary = %d", mctrack.index(), mctrack.pdgCode(), mctrack.producedByGenerator(), mctrack.isPhysicalPrimary());
140141

141-
if (abs(pdg) == 11) { // electrons // extra check of production vertex for secondary electrons to reduce data size.
142-
if (!mctrack.isPhysicalPrimary() && !mctrack.producedByGenerator() && sqrt(pow(mctrack.vx(), 2) + pow(mctrack.vy(), 2)) < abs(mctrack.vz()) * std::tan(2 * std::atan(std::exp(-max_Y_gen))) - margin_z_gen) {
143-
continue;
144-
}
145-
} else {
146-
if (!mctrack.isPhysicalPrimary() && !mctrack.producedByGenerator()) {
142+
if (!(mctrack.isPhysicalPrimary() || mctrack.producedByGenerator())) { // neither physical primary nor producedByGenerator
143+
if (abs(pdg) == 11) { // one more check for secondary electrons. i.e. gamma->ee
144+
145+
if (sqrt(pow(mctrack.vx(), 2) + pow(mctrack.vy(), 2)) < abs(mctrack.vz()) * std::tan(2 * std::atan(std::exp(-max_Y_gen))) - margin_z_gen) {
146+
continue;
147+
}
148+
149+
if (mctrack.has_mothers()) {
150+
auto mp = mctrack.template mothers_first_as<aod::McParticles>(); // mother particle of electron
151+
int pdg_mother = mp.pdgCode();
152+
if (pdg_mother != 22 || !(mp.isPhysicalPrimary() || mp.producedByGenerator())) { // mother of electron is not photon, or not physical primary, or not producedByGenerator
153+
continue;
154+
}
155+
}
156+
} else { // not physical primary, not producedByGenerator, not electrons
147157
continue;
148158
}
159+
} else if (abs(mctrack.y()) > max_Y_gen) { // physical primary or producedByGenerator, but outside of acceptance.
160+
continue;
161+
}
162+
163+
if (abs(pdg) == 11 && !(mctrack.isPhysicalPrimary() || mctrack.producedByGenerator())) { // only for quick check, only secondary electrons should appear.
164+
registry.fill(HIST("PCM/hXY"), mctrack.vx(), mctrack.vy());
165+
registry.fill(HIST("PCM/hRZ"), mctrack.vz(), sqrt(pow(mctrack.vx(), 2) + pow(mctrack.vy(), 2)));
149166
}
150167

151168
// these are used as denominator for efficiency. (i.e. generated information)
@@ -326,12 +343,7 @@ struct AssociateMCInfo {
326343

327344
std::vector<int> mothers;
328345
if (mctrack.has_mothers()) {
329-
// LOGF(info, "mother ids size = %d", mctrack.mothersIds().size());
330-
// int counter = 0;
331346
for (auto& m : mctrack.mothersIds()) {
332-
// LOGF(info, "counter = %d , mother id = %d", counter, m);
333-
// counter++;
334-
335347
if (m < mcTracks.size()) { // protect against bad mother indices
336348
if (fNewLabels.find(m) != fNewLabels.end()) {
337349
mothers.push_back(fNewLabels.find(m)->second);

0 commit comments

Comments
 (0)