Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
262 changes: 128 additions & 134 deletions PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ struct HfElectronSelectionWithTpcEmcal {
registry.add("hphiElectron", "hphiElectron", {HistType::kTH1D, {axisPhi}});
registry.add("hphiElectronPassEmcal", "hphiElectron pass Emcal", {HistType::kTH1D, {axisPhi}});


registry.add("hMcgenAllNonHfeElectron", "Mc Gen All NonHf Electron", {HistType::kTH1D, {{axisPt}}});
registry.add("hMcgenNonHfeElectron", "Mc Gen NonHf Electron with mother", {HistType::kTH1D, {{axisPt}}});
registry.add("hPi0eEmbTrkPt", "Mc Gen Pi0 mother NonHf Electron", {HistType::kTH1D, {{axisPt}}});
Expand Down Expand Up @@ -558,7 +557,6 @@ struct HfElectronSelectionWithTpcEmcal {
bool isEmbEta = false;
bool isEmbPi0 = false;


// Check first mother
if (mcParticle.has_mothers()) {
auto const& mother = mcParticle.template mothers_first_as<aod::McParticles>();
Expand Down Expand Up @@ -602,7 +600,135 @@ struct HfElectronSelectionWithTpcEmcal {
}
}

// Check first mother
if (mcParticle.has_mothers()) {
auto const& mother = mcParticle.template mothers_first_as<aod::McParticles>();

if (std::abs(mother.pdgCode()) == kEtaLocal || std::abs(mother.pdgCode()) == kPi0 || std::abs(mother.pdgCode()) == kGamma) {

auto const& gmother = mother.template mothers_first_as<aod::McParticles>();
// cases to consider: eta->e, eta->pi0->e, eta->gamma->e, eta->pi0->gamma->e, pi0->e, pi0->gamma->e

//================= eta->e ======================================
if (std::abs(mother.pdgCode()) == kEtaLocal) {

if (mother.isPhysicalPrimary()) {
if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) ||
(std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) {
continue;
}
isEmbEta = true;
}
}

//================= eta->pi0->e ======================================

if (std::abs(mother.pdgCode()) == kPi0) {
if (mother.isPhysicalPrimary()) {
if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) ||
(std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) {
continue;
}
isEmbPi0 = true; // pi0 -> e
}
if (std::abs(gmother.pdgCode()) == kEtaLocal) {
if (gmother.isPhysicalPrimary() || gmother.has_mothers()) {
auto const& ggmother = gmother.template mothers_first_as<aod::McParticles>();
if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) ||
(std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) {
continue;
}
isEmbEta = true; // eta->pi0-> e
}
}
}

>
/// ==================================== eta->gamma->e and eta->pi0->gamma->e============
if (std::abs(mother.pdgCode()) == kGamma)
{

if (std::abs(gmother.pdgCode()) == kEtaLocal) {
if (gmother.isPhysicalPrimary() || gmother.has_mothers()) {
auto const& ggmother = gmother.template mothers_first_as<aod::McParticles>();
if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) ||
(std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) {
continue;
}
isEmbEta = true; // eta->gamma-> e
}
}
if (std::abs(gmother.pdgCode()) == kPi0) {
if (gmother.isPhysicalPrimary() || gmother.has_mothers()) {
auto const& ggmother = gmother.template mothers_first_as<aod::McParticles>();
if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) ||
(std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) {
continue;
}
isEmbPi0 = true; // pi0-> gamma-> e
}
if (gmother.has_mothers()) {
auto const& ggmother = gmother.template mothers_first_as<aod::McParticles>();
if (std::abs(ggmother.pdgCode()) == kEtaLocal) {
if (ggmother.isPhysicalPrimary() || ggmother.has_mothers()) {
auto const& gggmother = ggmother.template mothers_first_as<aod::McParticles>();
if ((std::abs(gggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gggmother.pdgCode()) < pdgCodeCharmMax) ||
(std::abs(gggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gggmother.pdgCode()) < pdgCodeBeautyMax)) {
continue;
}
isEmbEta = true; // eta->pi0->gamma-> e
}
}
}
}
}
if (!(isEmbPi0 && isEmbEta)) {
continue;
}
}
}
}
}
}
nonHfe(matchTrack, tracks, true);

///////////////// NonHf electron Selection without Emcal ////////////////////////
electronSel(track.collisionId(), track.globalIndex(), etaTrack, phiTrack, ptTrack, pTrack, trackRapidity, dcaxyTrack, dcazTrack, track.tpcNSigmaEl(), track.tofNSigmaEl(),
eMatchEmcCluster, etaMatchEmcCluster, phiMatchEmcCluster, m02MatchEmcCluster, m20MatchEmcCluster, cellEmcCluster, timeEmcCluster, deltaEtaMatch, deltaPhiMatch, isEMcal);
}
/// Electron information without Emcal and use TPC and TOF
if (isEMcal) {
continue;
}
if (std::abs(track.tofNSigmaEl()) > tofNSigmaEl) {
continue;
}
registry.fill(HIST("hTofNSigmaVsPt"), track.tofNSigmaEl(), track.pt());
registry.fill(HIST("hTpcNSigmaVsPt"), track.tpcNSigmaEl(), track.pt());

if ((track.tpcNSigmaEl() < tpcNsigmaElectronMin || track.tpcNSigmaEl() > tpcNsigmaElectronMax)) {
continue;
}

registry.fill(HIST("hphiElectron"), track.phi());
=======

if constexpr (IsMc) {
if (track.has_mcParticle()) {
auto mcParticle = track.template mcParticle_as<aod::McParticles>();
if (std::abs(mcParticle.pdgCode()) == kElectron) {

registry.fill(HIST("hMcRecwithoutEMCalInElectron"), mcParticle.pt());
bool isEmbEta = false;
bool isEmbPi0 = false;

// Check first mother
if (mcParticle.has_mothers()) {
auto const& mother = mcParticle.template mothers_first_as<aod::McParticles>();

registry.fill(HIST("hMcRecwithoutEMCalInElectron"), mcParticle.pt());
bool isEmbEta = false;
bool isEmbPi0 = false;

// Check first mother
if (mcParticle.has_mothers()) {
Expand Down Expand Up @@ -647,7 +773,6 @@ struct HfElectronSelectionWithTpcEmcal {
}
}

>
/// ==================================== eta->gamma->e and eta->pi0->gamma->e============
if (std::abs(mother.pdgCode()) == kGamma) {

Expand Down Expand Up @@ -691,137 +816,6 @@ struct HfElectronSelectionWithTpcEmcal {
}
}
}
}
}
nonHfe(matchTrack, tracks, true);

///////////////// NonHf electron Selection without Emcal ////////////////////////
electronSel(track.collisionId(), track.globalIndex(), etaTrack, phiTrack, ptTrack, pTrack, trackRapidity, dcaxyTrack, dcazTrack, track.tpcNSigmaEl(), track.tofNSigmaEl(),
eMatchEmcCluster, etaMatchEmcCluster, phiMatchEmcCluster, m02MatchEmcCluster, m20MatchEmcCluster, cellEmcCluster, timeEmcCluster, deltaEtaMatch, deltaPhiMatch, isEMcal);
}
/// Electron information without Emcal and use TPC and TOF
if (isEMcal) {
continue;
}
if (std::abs(track.tofNSigmaEl()) > tofNSigmaEl) {
continue;
}
registry.fill(HIST("hTofNSigmaVsPt"), track.tofNSigmaEl(), track.pt());
registry.fill(HIST("hTpcNSigmaVsPt"), track.tpcNSigmaEl(), track.pt());

if ((track.tpcNSigmaEl() < tpcNsigmaElectronMin || track.tpcNSigmaEl() > tpcNsigmaElectronMax)) {
continue;
}

registry.fill(HIST("hphiElectron"), track.phi());
=======

if constexpr (IsMc) {
if (track.has_mcParticle()) {
auto mcParticle = track.template mcParticle_as<aod::McParticles>();
if (std::abs(mcParticle.pdgCode()) == kElectron) {


registry.fill(HIST("hMcRecwithoutEMCalInElectron"), mcParticle.pt());
bool isEmbEta = false;
bool isEmbPi0 = false;

// Check first mother
if (mcParticle.has_mothers()) {
auto const& mother = mcParticle.template mothers_first_as<aod::McParticles>();



registry.fill(HIST("hMcRecwithoutEMCalInElectron"), mcParticle.pt());
bool isEmbEta = false;
bool isEmbPi0 = false;

// Check first mother
if (mcParticle.has_mothers()) {
auto const& mother = mcParticle.template mothers_first_as<aod::McParticles>();

if (std::abs(mother.pdgCode()) == kEtaLocal || std::abs(mother.pdgCode()) == kPi0 || std::abs(mother.pdgCode()) == kGamma) {

auto const& gmother = mother.template mothers_first_as<aod::McParticles>();
// cases to consider: eta->e, eta->pi0->e, eta->gamma->e, eta->pi0->gamma->e, pi0->e, pi0->gamma->e

//================= eta->e ======================================
if (std::abs(mother.pdgCode()) == kEtaLocal) {

if (mother.isPhysicalPrimary()) {
if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) ||
(std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) {
continue;
}
isEmbEta = true;
}
}

//================= eta->pi0->e ======================================

if (std::abs(mother.pdgCode()) == kPi0) {
if (mother.isPhysicalPrimary()) {
if ((std::abs(gmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gmother.pdgCode()) < pdgCodeCharmMax) ||
(std::abs(gmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gmother.pdgCode()) < pdgCodeBeautyMax)) {
continue;
}
isEmbPi0 = true; // pi0 -> e
}
if (std::abs(gmother.pdgCode()) == kEtaLocal) {
if (gmother.isPhysicalPrimary() || gmother.has_mothers()) {
auto const& ggmother = gmother.template mothers_first_as<aod::McParticles>();
if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) ||
(std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) {
continue;
}
isEmbEta = true; // eta->pi0-> e
}
}
}

/// ==================================== eta->gamma->e and eta->pi0->gamma->e============
if (std::abs(mother.pdgCode()) == kGamma) {

if (std::abs(gmother.pdgCode()) == kEtaLocal) {
if (gmother.isPhysicalPrimary() || gmother.has_mothers()) {
auto const& ggmother = gmother.template mothers_first_as<aod::McParticles>();
if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) ||
(std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) {
continue;
}
isEmbEta = true; // eta->gamma-> e
}
}
if (std::abs(gmother.pdgCode()) == kPi0) {
if (gmother.isPhysicalPrimary() || gmother.has_mothers()) {
auto const& ggmother = gmother.template mothers_first_as<aod::McParticles>();
if ((std::abs(ggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(ggmother.pdgCode()) < pdgCodeCharmMax) ||
(std::abs(ggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(ggmother.pdgCode()) < pdgCodeBeautyMax)) {
continue;
}
isEmbPi0 = true; // pi0-> gamma-> e
}
if (gmother.has_mothers()) {
auto const& ggmother = gmother.template mothers_first_as<aod::McParticles>();
if (std::abs(ggmother.pdgCode()) == kEtaLocal) {
if (ggmother.isPhysicalPrimary() || ggmother.has_mothers()) {
auto const& gggmother = ggmother.template mothers_first_as<aod::McParticles>();
if ((std::abs(gggmother.pdgCode()) >= pdgCodeCharmMin && std::abs(gggmother.pdgCode()) < pdgCodeCharmMax) ||
(std::abs(gggmother.pdgCode()) >= pdgCodeBeautyMin && std::abs(gggmother.pdgCode()) < pdgCodeBeautyMax)) {
continue;
}
isEmbEta = true; // eta->pi0->gamma-> e
}
}
}
}
}
if (!(isEmbPi0 && isEmbEta)) {
continue;
}
}
}
}
}
}
nonHfe(track, tracks, false);
Expand Down
Loading