1515// / \brief Task to monitor the single particle QA, at the particle and track level, showing the tracked and the origin of particles
1616// /
1717
18- // O2 includes
19- #include " Framework/AnalysisTask.h"
20- #include " Framework/runDataProcessing.h"
21- #include " Framework/HistogramRegistry.h"
22- #include " Framework/O2DatabasePDGPlugin.h"
23- #include " TDatabasePDG.h"
24- #include " TMCProcess.h"
18+ #include < Framework/AnalysisTask.h>
19+ #include < Framework/HistogramRegistry.h>
20+ #include < Framework/O2DatabasePDGPlugin.h>
21+ #include < Framework/runDataProcessing.h>
22+
23+ #include < TDatabasePDG.h>
24+ #include < TMCProcess.h>
25+
26+ #include < vector>
2527
2628using namespace o2 ;
2729using namespace o2 ::framework;
@@ -97,11 +99,9 @@ struct Alice3SingleParticle {
9799 const AxisSpec axisProdz{prodBinsZ, prodMinZ, prodMaxZ, " Prod. Vertex Z (cm)" };
98100 const AxisSpec axisProdRadius{prodBins, 0 ., 2 . * prodMax, " Prod. Vertex Radius (cm)" };
99101
100- if (!doprocessParticleOnly) {
101- histos.add (" event/VtxX" , " Vertex X" , kTH1D , {axisVx});
102- histos.add (" event/VtxY" , " Vertex Y" , kTH1D , {axisVy});
103- histos.add (" event/VtxZ" , " Vertex Z" , kTH1D , {axisVz});
104- }
102+ histos.add (" event/VtxX" , " Vertex X" , kTH1D , {axisVx});
103+ histos.add (" event/VtxY" , " Vertex Y" , kTH1D , {axisVy});
104+ histos.add (" event/VtxZ" , " Vertex Z" , kTH1D , {axisVz});
105105
106106 histos.add (" particle/PDGs" , " Particle PDGs" , kTH2D , {axisPDGs, axisCharge});
107107 histos.add (" particle/PDGsPrimaries" , " Particle PDGs of Primaries" , kTH2D , {axisPDGs, axisCharge});
@@ -145,6 +145,7 @@ struct Alice3SingleParticle {
145145 histos.add (" particle/Py" , " Particle Py " + tit, kTH1D , {axisPy});
146146 histos.add (" particle/Pz" , " Particle Pz " + tit, kTH1D , {axisPz});
147147
148+ histos.add (" particle/daughters/Number" , " Number of Daughters " + tit, kTH1D , {{20 , -0.5 , 19.5 }});
148149 histos.add (" particle/daughters/PDGs" , " Daughters PDGs " + tit, kTH2D , {axisPDGs, axisCharge});
149150 histos.add (" particle/daughters/PDGsPrimaries" , " Daughters PDGs Primaries of " + tit, kTH2D , {axisPDGs, axisCharge});
150151 histos.add (" particle/daughters/PDGsSecondaries" , " Daughters PDGs Secondaries of " + tit, kTH2D , {axisPDGs, axisCharge});
@@ -158,6 +159,7 @@ struct Alice3SingleParticle {
158159 histos.add (" particle/daughters/prodRadiusVsPt" , " Daughters Prod. Vertex Radius " + tit, kTH2D , {axisPt, axisProdRadius});
159160 histos.add (" particle/daughters/prodRadius3DVsPt" , " Daughters Prod. Vertex Radius XYZ " + tit, kTH2D , {axisPt, axisProdRadius});
160161
162+ histos.add (" particle/mothers/Number" , " Number of Mothers " + tit, kTH1D , {{20 , -0.5 , 19.5 }});
161163 histos.add (" particle/mothers/PDGs" , " Mothers PDGs " + tit, kTH2D , {axisPDGs, axisCharge});
162164 histos.add (" particle/mothers/PDGsPrimaries" , " Mothers PDGs Primaries of " + tit, kTH2D , {axisPDGs, axisCharge});
163165 histos.add (" particle/mothers/PDGsSecondaries" , " Mothers PDGs Secondaries of " + tit, kTH2D , {axisPDGs, axisCharge});
@@ -167,6 +169,8 @@ struct Alice3SingleParticle {
167169 histos.add (" particle/mothers/prodRadiusVsPt" , " Mothers Prod. Vertex Radius " + tit, kTH2D , {axisPt, axisProdRadius});
168170 histos.add (" particle/mothers/prodRadius3DVsPt" , " Mothers Prod. Vertex Radius XYZ " + tit, kTH2D , {axisPt, axisProdRadius});
169171
172+ // Go up one generation
173+ histos.add (" particle/mothers/mothers/Number" , " Number of Mothers mothers " + tit, kTH1D , {{20 , -0.5 , 19.5 }});
170174 histos.add (" particle/mothers/mothers/PDGs" , " Mothers mothers PDGs " + tit, kTH2D , {axisPDGs, axisCharge});
171175 histos.add (" particle/mothers/mothers/PDGsPrimaries" , " Mothers mothers PDGs Primaries of " + tit, kTH2D , {axisPDGs, axisCharge});
172176 histos.add (" particle/mothers/mothers/PDGsSecondaries" , " Mothers mothers PDGs Secondaries of " + tit, kTH2D , {axisPDGs, axisCharge});
@@ -272,6 +276,7 @@ struct Alice3SingleParticle {
272276 histos.fill (HIST (" particle/prodVz" ), mcParticle.vz ());
273277 if (mcParticle.has_daughters ()) {
274278 auto daughters = mcParticle.daughters_as <aod::McParticles>();
279+ histos.fill (HIST (" particle/daughters/Number" ), daughters.size ());
275280 for (const auto & daughter : daughters) {
276281 const auto & pdgStringDau = getPdgCodeString (daughter);
277282 const auto & pdgChargeDau = getCharge (daughter);
@@ -293,6 +298,8 @@ struct Alice3SingleParticle {
293298 histos.fill (HIST (" particle/daughters/prodRadiusVsPt" ), mcParticle.pt (), std::sqrt (daughter.vx () * daughter.vx () + daughter.vy () * daughter.vy ()));
294299 histos.fill (HIST (" particle/daughters/prodRadius3DVsPt" ), mcParticle.pt (), std::sqrt (daughter.vx () * daughter.vx () + daughter.vy () * daughter.vy () + daughter.vz () * daughter.vz ()));
295300 }
301+ } else {
302+ histos.fill (HIST (" particle/daughters/Number" ), 0 .f );
296303 }
297304 if (mcParticle.has_mothers ()) {
298305 const auto & mothers = mcParticle.mothers_as <aod::McParticles>();
@@ -415,8 +422,14 @@ struct Alice3SingleParticle {
415422 }
416423 PROCESS_SWITCH (Alice3SingleParticle, processStandard, " Process IU tracks" , true );
417424
418- void processParticleOnly (const aod::McParticles& mcParticles)
425+ void processParticleOnly (const o2::aod::McCollisions& colls,
426+ const aod::McParticles& mcParticles)
419427 {
428+ for (const auto & col : colls) {
429+ histos.fill (HIST (" event/VtxX" ), col.posX ());
430+ histos.fill (HIST (" event/VtxY" ), col.posY ());
431+ histos.fill (HIST (" event/VtxZ" ), col.posZ ());
432+ }
420433 for (const auto & mcParticle : mcParticles) {
421434 const auto & pdgString = getPdgCodeString (mcParticle);
422435 const auto & pdgCharge = getCharge (mcParticle);
@@ -467,6 +480,7 @@ struct Alice3SingleParticle {
467480 histos.fill (HIST (" particle/prodVz" ), mcParticle.vz ());
468481 if (mcParticle.has_daughters ()) {
469482 auto daughters = mcParticle.daughters_as <aod::McParticles>();
483+ histos.fill (HIST (" particle/daughters/Number" ), daughters.size ());
470484 for (const auto & daughter : daughters) {
471485 const auto & pdgStringDau = getPdgCodeString (daughter);
472486 const auto & pdgChargeDau = getCharge (daughter);
@@ -484,6 +498,8 @@ struct Alice3SingleParticle {
484498 histos.fill (HIST (" particle/daughters/prodRadiusVsPt" ), mcParticle.pt (), std::sqrt (mcParticle.vx () * mcParticle.vx () + mcParticle.vy () * mcParticle.vy ()));
485499 histos.fill (HIST (" particle/daughters/prodRadius3DVsPt" ), mcParticle.pt (), std::sqrt (mcParticle.vx () * mcParticle.vx () + mcParticle.vy () * mcParticle.vy () + mcParticle.vz () * mcParticle.vz ()));
486500 }
501+ } else {
502+ histos.fill (HIST (" particle/daughters/Number" ), 0 .f );
487503 }
488504 if (mcParticle.has_mothers ()) {
489505 auto mothers = mcParticle.mothers_as <aod::McParticles>();
@@ -586,6 +602,7 @@ struct Alice3SingleParticle {
586602 histos.fill (HIST (" particle/prodVz" ), mcParticle.vz ());
587603 if (mcParticle.has_daughters ()) {
588604 auto daughters = mcParticle.daughters_as <aod::McParticles>();
605+ histos.fill (HIST (" particle/daughters/Number" ), daughters.size ());
589606 for (const auto & daughter : daughters) {
590607 const auto & pdgStringDau = getPdgCodeString (daughter);
591608 const auto & pdgChargeDau = getCharge (daughter);
@@ -603,6 +620,8 @@ struct Alice3SingleParticle {
603620 histos.fill (HIST (" particle/daughters/prodRadiusVsPt" ), mcParticle.pt (), std::sqrt (mcParticle.vx () * mcParticle.vx () + mcParticle.vy () * mcParticle.vy ()));
604621 histos.fill (HIST (" particle/daughters/prodRadius3DVsPt" ), mcParticle.pt (), std::sqrt (mcParticle.vx () * mcParticle.vx () + mcParticle.vy () * mcParticle.vy () + mcParticle.vz () * mcParticle.vz ()));
605622 }
623+ } else {
624+ histos.fill (HIST (" particle/daughters/Number" ), 0 .f );
606625 }
607626 if (mcParticle.has_mothers ()) {
608627 auto mothers = mcParticle.mothers_as <aod::McParticles>();
0 commit comments