Skip to content
Merged
Show file tree
Hide file tree
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
17 changes: 9 additions & 8 deletions PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand Down Expand Up @@ -43,7 +43,7 @@

using MyCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms>;
using MyMCCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms, aod::McCollisionLabels>;
using MyBCs = soa::Join<aod::BCs, aod::BcSels, aod::Timestamps>;
using MyBCs = soa::Join<aod::BCs, aod::BcSels, aod::Timestamps, aod::BCCentFT0Ms>;

using SelectedUniqueClusters = soa::Filtered<aod::EMCALClusters>; // Clusters from collisions with only one collision in the BC
using SelectedUniqueMCClusters = soa::Filtered<soa::Join<aod::EMCALClusters, aod::EMCALMCClusters>>; // Clusters from collisions with only one collision in the BC
Expand All @@ -51,7 +51,7 @@
using SelectedAmbiguousMCClusters = soa::Filtered<soa::Join<aod::EMCALAmbiguousClusters, aod::EMCALAmbiguousMCClusters>>; // Clusters from BCs with multiple collisions (no vertex assignment possible)
using SelectedCells = o2::soa::Filtered<aod::Calos>;

struct bcWiseClusterSkimmer {

Check failure on line 54 in PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/struct]

Use UpperCamelCase for names of structs.
Produces<aod::BCWiseBCs> bcTable;
Produces<aod::BCWiseClusters> clusterTable;
Produces<aod::BCWiseCollisions> collisionTable;
Expand Down Expand Up @@ -100,6 +100,7 @@
mHistManager.get<TH1>(HIST("nBCs"))->GetXaxis()->SetBinLabel(iBin + 1, binLabels[iBin]);

mHistManager.add("CentralityVsGenMultiplicity", "Centrality vs number of generated MC particles;Centrality;#bf{#it{N}_{gen}}", HistType::kTH2F, {{102, 0., 102}, cfgMultiplicityBinning});
mHistManager.add("BCCentVsCollCent", "Centrality of the BC vs Centrality of the collision;BC Centrality;Collision Centrality", HistType::kTH2F, {{102, 0., 102}, {102, 0., 102}});

LOG(info) << "BC wise cluster skimmer cuts:";
LOG(info) << "------------------------------------";
Expand Down Expand Up @@ -232,11 +233,14 @@

double mu = cfgStoreMu ? calculateMu(bc) : 0.;
float ft0Amp = hasFT0 ? bc.foundFT0().sumAmpA() + bc.foundFT0().sumAmpC() : 0.;
double centrality = 101.5;
double centralityOfCollision = 101.5;
if (collisionsInBC.size() > 0)
centrality = collisionsInBC.iteratorAt(0).centFT0M();
centralityOfCollision = collisionsInBC.iteratorAt(0).centFT0M();
double centralityOfBC = bc.centFT0M();

bcTable(hasFT0, hasTVX, haskTVXinEMC, hasEMCCell, hasNoTFROFBorder, convertForStorage<uint8_t>(centrality, kFT0MCent), convertForStorage<uint16_t>(ft0Amp, kFT0Amp), convertForStorage<uint16_t>(mu, kMu));
mHistManager.fill(HIST("BCCentVsCollCent"), centralityOfBC, centralityOfCollision);

bcTable(hasFT0, hasTVX, haskTVXinEMC, hasEMCCell, hasNoTFROFBorder, convertForStorage<uint8_t>(centralityOfBC, kFT0MCent), convertForStorage<uint16_t>(ft0Amp, kFT0Amp), convertForStorage<uint16_t>(mu, kMu));

for (const auto& collision : collisionsInBC)
collisionTable(bcTable.lastIndex(), convertForStorage<uint8_t>(collision.centFT0M(), kFT0MCent), convertForStorage<int16_t>(collision.posZ(), kZVtx));
Expand All @@ -246,10 +250,10 @@
bool isGammaGammaDecay(TMCParticle mcParticle, TMCParticles mcParticles)
{
auto daughtersIds = mcParticle.daughtersIds();
if (daughtersIds.size() != 2)

Check failure on line 253 in PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return false;
for (const auto& daughterId : daughtersIds) {
if (mcParticles.iteratorAt(daughterId).pdgCode() != 22)

Check failure on line 256 in PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.

Check failure on line 256 in PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
return false;
}
return true;
Expand All @@ -259,10 +263,10 @@
bool isAccepted(TMCParticle mcParticle, TMCParticles mcParticles)
{
auto daughtersIds = mcParticle.daughtersIds();
if (daughtersIds.size() != 2)

Check failure on line 266 in PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return false;
for (const auto& daughterId : daughtersIds) {
if (mcParticles.iteratorAt(daughterId).pdgCode() != 22)

Check failure on line 269 in PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.

Check failure on line 269 in PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
return false;
int iCellID = -1;
try {
Expand Down Expand Up @@ -313,12 +317,9 @@
auto mcCollisionsBC = mcCollisions.sliceBy(mcCollperBC, bc.globalIndex());
for (const auto& mcCollision : mcCollisionsBC) {
auto mcParticlesInColl = mcParticles.sliceBy(perMcCollision, mcCollision.globalIndex());
double centrality = 101.5;
if (collisionsInBC.size() > 0)
centrality = collisionsInBC.iteratorAt(0).centFT0M();
mHistManager.fill(HIST("CentralityVsGenMultiplicity"), centrality, mcParticlesInColl.size());
mHistManager.fill(HIST("CentralityVsGenMultiplicity"), bc.centFT0M(), mcParticlesInColl.size());
for (const auto& mcParticle : mcParticlesInColl) {
if (mcParticle.pdgCode() != 111 || std::abs(mcParticle.y()) > cfgRapidityCut || !isGammaGammaDecay(mcParticle, mcParticles) || mcParticle.pt() < cfgMinPtGenPi0)

Check failure on line 322 in PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.

Check failure on line 322 in PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
continue;
bool isPrimary = mcParticle.isPhysicalPrimary() || mcParticle.producedByGenerator();
bool isFromWD = (aod::pwgem::photonmeson::utils::mcutil::IsFromWD(mcCollision, mcParticle, mcParticles)) > 0;
Expand Down
4 changes: 2 additions & 2 deletions PWGEM/PhotonMeson/Tasks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ o2physics_add_dpl_workflow(emc-pi0-qc
PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(emc-bc-wise-pi0
SOURCES emcalBcWisePi0.cxx
o2physics_add_dpl_workflow(emc-bc-wise-gammagamma
SOURCES emcalBcWiseGammaGamma.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2::EMCALCalib O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
/// \author Nicolas Strangmann (nicolas.strangmann@cern.ch) Goethe University Frankfurt
///

#include "Framework/runDataProcessing.h"
#include "PWGEM/PhotonMeson/DataModel/bcWiseTables.h"

#include "CommonConstants/MathConstants.h"
#include "EMCALBase/Geometry.h"
#include "Framework/AnalysisTask.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/runDataProcessing.h"

#include "TString.h"
#include "Math/Vector4D.h"
#include "Math/Vector3D.h"
#include "Math/AxisAngle.h"
#include "Math/LorentzRotation.h"
#include "Math/Rotation3D.h"
#include "Math/AxisAngle.h"

#include "CommonConstants/MathConstants.h"
#include "EMCALBase/Geometry.h"
#include "PWGEM/PhotonMeson/DataModel/bcWiseTables.h"
#include "Math/Vector3D.h"
#include "Math/Vector4D.h"
#include "TString.h"

using namespace o2;
using namespace o2::framework;
Expand All @@ -39,7 +39,7 @@ using namespace o2::framework::expressions;
using SelectedClusters = soa::Filtered<aod::BCWiseClusters>;
using SelectedMCClusters = soa::Filtered<soa::Join<aod::BCWiseClusters, aod::BCWiseMCClusters>>;

struct EmcalBcWisePi0 {
struct EmcalBcWiseGammaGamma {
HistogramRegistry mHistManager{"EmcalGammaGammaBcWiseHistograms"};

Configurable<bool> cfgRequirekTVXinEMC{"cfgRequirekTVXinEMC", true, "Reconstruct pi0s only in kTVXinEMC triggered BCs"};
Expand Down Expand Up @@ -313,7 +313,7 @@ struct EmcalBcWisePi0 {

reconstructTrueMesons(clusters, mcPi0s, bc);
}
PROCESS_SWITCH(EmcalBcWisePi0, processMCInfo, "Run true and gen", false);
PROCESS_SWITCH(EmcalBcWiseGammaGamma, processMCInfo, "Run true and gen", false);
};

WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask<EmcalBcWisePi0>(cfgc)}; }
WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask<EmcalBcWiseGammaGamma>(cfgc)}; }
2 changes: 1 addition & 1 deletion PWGJE/Tasks/emcEventSelectionQA.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ struct EmcEventSelectionQA {
if (bc.runNumber() > mRun3MinNumber) {
// in case of run3 not all BCs contain EMCAL data, require trigger selection also for min. bias
// in addition select also L0/L1 triggers as triggers with EMCAL in reaodut
if (bc.alias_bit(kTVXinEMC) || bc.alias_bit(kEMC7) || bc.alias_bit(kEG1) || bc.alias_bit(kEG2) || bc.alias_bit(kDG1) || bc.alias_bit(kDG2) || bc.alias_bit(kEJ1) || bc.alias_bit(kEJ2) || bc.alias_bit(kDJ1) || bc.alias_bit(kDJ2)) {
if (bc.alias_bit(kTVXinEMC) || bc.alias_bit(kEMC7) || bc.alias_bit(kDMC7) || bc.alias_bit(kEG1) || bc.alias_bit(kEG2) || bc.alias_bit(kDG1) || bc.alias_bit(kDG2) || bc.alias_bit(kEJ1) || bc.alias_bit(kEJ2) || bc.alias_bit(kDJ1) || bc.alias_bit(kDJ2)) {
isEMCALreadout = true;
}
} else {
Expand Down
Loading