Skip to content

Commit 3cc4e0c

Browse files
committed
[PWGEM,PWGEM-8] Clean up of PhotonMeson
- Remove gammaSelection.cxx, gammaSelectionCuts.h and produceMesonCalo.cxx since they were not used - Remove many old tables that were unused - Update `SkimEMCClusters` table to use the new DeltaEta und DeltaPhi columns coming from the emcalCorrectionTask for better TM. - Update histogram libs and cut libs according to the change above - Fix includes according to IWYU for all touched files
1 parent 36501fc commit 3cc4e0c

16 files changed

+278
-788
lines changed

PWGEM/PhotonMeson/Core/EMCPhotonCut.cxx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,17 @@
1313
// Class for EMCal cluster selection
1414
//
1515

16-
#include <string>
17-
#include "Framework/Logger.h"
1816
#include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h"
17+
1918
#include "PWGJE/DataModel/EMCALClusters.h"
2019

20+
#include "Framework/Logger.h"
21+
22+
#include <Rtypes.h>
23+
24+
#include <functional>
25+
#include <string>
26+
2127
ClassImp(EMCPhotonCut);
2228

2329
const char* EMCPhotonCut::mCutNames[static_cast<int>(EMCPhotonCut::EMCPhotonCuts::kNCuts)] = {"Definition", "Energy", "NCell", "M02", "Timing", "TrackMatching", "Exotic"};

PWGEM/PhotonMeson/Core/EMCPhotonCut.h

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,19 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111

12-
//
13-
// Class for emcal photon selection
14-
//
12+
/// \file EMCPhotonCut.h
13+
/// \brief Header of class for emcal photon selection.
14+
/// \author M. Hemmer, marvin.hemmer@cern.ch; N. Strangmann, nicolas.strangmann@cern.ch
1515

1616
#ifndef PWGEM_PHOTONMESON_CORE_EMCPHOTONCUT_H_
1717
#define PWGEM_PHOTONMESON_CORE_EMCPHOTONCUT_H_
1818

19-
#include <set>
20-
#include <vector>
21-
#include <utility>
19+
#include <TNamed.h>
20+
21+
#include <Rtypes.h>
22+
23+
#include <functional>
2224
#include <string>
23-
#include <optional>
24-
#include "Framework/Logger.h"
25-
#include "Framework/DataTypes.h"
26-
#include "Rtypes.h"
27-
#include "TNamed.h"
2825

2926
class EMCPhotonCut : public TNamed
3027
{
@@ -95,14 +92,14 @@ class EMCPhotonCut : public TNamed
9592
return mMinTime <= cluster.time() && cluster.time() <= mMaxTime;
9693

9794
case EMCPhotonCuts::kTM: {
98-
auto trackseta = cluster.tracketa(); // std:vector<float>
99-
auto tracksphi = cluster.trackphi(); // std:vector<float>
100-
auto trackspt = cluster.trackpt(); // std:vector<float>
101-
auto tracksp = cluster.trackp(); // std:vector<float>
95+
auto dEtas = cluster.deltaEta(); // std:vector<float>
96+
auto dPhis = cluster.deltaPhi(); // std:vector<float>
97+
auto trackspt = cluster.trackpt(); // std:vector<float>
98+
auto tracksp = cluster.trackp(); // std:vector<float>
10299
int ntrack = tracksp.size();
103100
for (int itr = 0; itr < ntrack; itr++) {
104-
float dEta = fabs(trackseta[itr] - cluster.eta());
105-
float dPhi = fabs(tracksphi[itr] - cluster.phi());
101+
float dEta = std::fabs(dEtas[itr]);
102+
float dPhi = std::fabs(dPhis[itr]);
106103
bool result = (dEta > mTrackMatchingEta(trackspt[itr])) || (dPhi > mTrackMatchingPhi(trackspt[itr])) || (cluster.e() / tracksp[itr] >= mMinEoverP);
107104
if (!result) {
108105
return false;

PWGEM/PhotonMeson/Core/HistogramsLibrary.cxx

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,25 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111
//
12-
// Contact: daiki.sekihata@cern.ch
13-
//
14-
#include <iostream>
15-
#include <memory>
16-
#include <fstream>
17-
using namespace std;
12+
/// \file HistogramsLibrary.cxx
13+
/// \brief Small histogram library for photon and meson analysis.
14+
/// \author D. Sekihata, daiki.sekihata@cern.ch
15+
16+
#include "PWGEM/PhotonMeson/Core/HistogramsLibrary.h"
17+
18+
#include <Framework/Logger.h>
1819

19-
#include <TObject.h>
20-
#include <TObjArray.h>
20+
#include <TH1.h>
21+
#include <TH2.h>
2122
#include <THashList.h>
22-
#include <TH1F.h>
23-
#include <TH2F.h>
24-
#include <TH3F.h>
25-
#include <TProfile.h>
26-
#include <TProfile2D.h>
27-
#include <TProfile3D.h>
28-
#include <THn.h>
2923
#include <THnSparse.h>
30-
#include <TIterator.h>
31-
#include <TClass.h>
32-
#include "Framework/Logger.h"
33-
#include "PWGEM/PhotonMeson/Core/HistogramsLibrary.h"
24+
#include <TString.h>
25+
26+
#include <string_view>
27+
28+
#include <math.h>
29+
30+
using namespace std;
3431

3532
void o2::aod::pwgem::photon::histogram::DefineHistograms(THashList* list, const char* histClass, const char* subGroup)
3633
{
@@ -184,7 +181,7 @@ void o2::aod::pwgem::photon::histogram::DefineHistograms(THashList* list, const
184181
list->Add(new TH2F("hEtaRec_DeltaEta", "photon #eta resolution;#eta^{rec} of conversion point;#eta^{rec} - #eta^{gen}", 400, -2, +2, 400, -1.0f, 1.0f));
185182
list->Add(new TH2F("hEtaRec_DeltaPhi", "photon #varphi resolution;#eta^{rec} of conversion point;#varphi^{rec} - #varphi^{gen} (rad.)", 400, -2, +2, 400, -1.0f, 1.0f));
186183
} // end of mc
187-
} // end of V0
184+
} // end of V0
188185

189186
if (TString(histClass).Contains("Dalitz")) {
190187
THnSparseF* hs_dilepton_uls_same = nullptr;
@@ -576,7 +573,7 @@ void o2::aod::pwgem::photon::histogram::DefineHistograms(THashList* list, const
576573
hs_conv_point_mix->Sumw2();
577574
list->Add(hs_conv_point_mix);
578575
} // end of pair
579-
} // end of material budget study
576+
} // end of material budget study
580577

581578
if (TString(histClass) == "Generated") {
582579
list->Add(new TH1F("hCollisionCounter", "hCollisionCounter", 5, 0.5f, 5.5f));

PWGEM/PhotonMeson/Core/HistogramsLibrary.h

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,25 @@
88
// In applying this license CERN does not waive the privileges and immunities
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
11-
//
12-
// Contact: daiki.sekihata@cern.ch
13-
//
11+
12+
/// \file HistogramsLibrary.h
13+
/// \brief Small histogram library for photon and meson analysis.
14+
/// \author D. Sekihata, daiki.sekihata@cern.ch
1415

1516
#ifndef PWGEM_PHOTONMESON_CORE_HISTOGRAMSLIBRARY_H_
1617
#define PWGEM_PHOTONMESON_CORE_HISTOGRAMSLIBRARY_H_
1718

18-
#include <iostream>
19-
#include <array>
20-
#include <TString.h>
21-
#include <THashList.h>
22-
#include <TObject.h>
23-
#include <TObjArray.h>
24-
#include <THashList.h>
25-
#include <TMath.h>
26-
#include <TH1F.h>
27-
#include <TH2F.h>
28-
#include <TH3F.h>
29-
#include <TProfile.h>
30-
#include <TProfile2D.h>
31-
#include <TProfile3D.h>
32-
#include <THn.h>
33-
#include <THnSparse.h>
34-
#include <TIterator.h>
35-
#include <TClass.h>
3619
#include "Common/CCDB/EventSelectionParams.h"
3720
#include "Common/Core/RecoDecay.h"
3821

22+
#include <TH2.h>
23+
#include <THashList.h>
24+
#include <TString.h>
25+
26+
#include <array>
27+
#include <cmath>
28+
#include <cstddef>
29+
3930
enum EMHistType {
4031
kEvent = 0,
4132
kEvent_Cent = 1,
@@ -48,6 +39,8 @@ enum EMHistType {
4839
kEMCCluster = 8,
4940
};
5041

42+
const float maxZ = 10.f;
43+
5144
namespace o2::aod
5245
{
5346
namespace pwgem::photon::histogram
@@ -81,7 +74,7 @@ void FillHistClass(THashList* list, const char* subGroup, T1 const& obj1 /*, con
8174
if (obj1.sel8()) {
8275
reinterpret_cast<TH1F*>(list->FindObject("hCollisionCounter"))->Fill("sel8", 1.f);
8376
}
84-
if (abs(obj1.posZ()) < 10.0) {
77+
if (std::abs(obj1.posZ()) < maxZ) {
8578
reinterpret_cast<TH1F*>(list->FindObject("hCollisionCounter"))->Fill("|Z_{vtx}| < 10 cm", 1.f);
8679
}
8780

@@ -176,9 +169,9 @@ void FillHistClass(THashList* list, const char* subGroup, T1 const& obj1 /*, con
176169
reinterpret_cast<TH1F*>(list->FindObject("hQoverPt"))->Fill(obj1.sign() / obj1.pt());
177170
reinterpret_cast<TH2F*>(list->FindObject("hEtaPhi"))->Fill(obj1.phi(), obj1.eta());
178171
reinterpret_cast<TH2F*>(list->FindObject("hDCAxyz"))->Fill(obj1.dcaXY(), obj1.dcaZ());
179-
reinterpret_cast<TH2F*>(list->FindObject("hDCAxyzSigma"))->Fill(obj1.dcaXY() / sqrt(obj1.cYY()), obj1.dcaZ() / sqrt(obj1.cZZ()));
180-
reinterpret_cast<TH2F*>(list->FindObject("hDCAxyRes_Pt"))->Fill(obj1.pt(), sqrt(obj1.cYY()) * 1e+4); // convert cm to um
181-
reinterpret_cast<TH2F*>(list->FindObject("hDCAzRes_Pt"))->Fill(obj1.pt(), sqrt(obj1.cZZ()) * 1e+4); // convert cm to um
172+
reinterpret_cast<TH2F*>(list->FindObject("hDCAxyzSigma"))->Fill(obj1.dcaXY() / std::sqrt(obj1.cYY()), obj1.dcaZ() / std::sqrt(obj1.cZZ()));
173+
reinterpret_cast<TH2F*>(list->FindObject("hDCAxyRes_Pt"))->Fill(obj1.pt(), std::sqrt(obj1.cYY()) * 1e+4); // convert cm to um
174+
reinterpret_cast<TH2F*>(list->FindObject("hDCAzRes_Pt"))->Fill(obj1.pt(), std::sqrt(obj1.cZZ()) * 1e+4); // convert cm to um
182175
reinterpret_cast<TH1F*>(list->FindObject("hNclsITS"))->Fill(obj1.itsNCls());
183176
reinterpret_cast<TH1F*>(list->FindObject("hNclsTPC"))->Fill(obj1.tpcNClsFound());
184177
reinterpret_cast<TH1F*>(list->FindObject("hNcrTPC"))->Fill(obj1.tpcNClsCrossedRows());
@@ -225,8 +218,8 @@ void FillHistClass(THashList* list, const char* subGroup, T1 const& obj1 /*, con
225218
reinterpret_cast<TH1F*>(list->FindObject("hPt"))->Fill(obj1.pt());
226219
reinterpret_cast<TH1F*>(list->FindObject("hE"))->Fill(obj1.e());
227220
reinterpret_cast<TH2F*>(list->FindObject("hEtaPhi"))->Fill(obj1.phi(), obj1.eta());
228-
for (size_t itrack = 0; itrack < obj1.tracketa().size(); itrack++) { // Fill TrackEtaPhi histogram with delta phi and delta eta of all tracks saved in the vectors in skimmerGammaCalo.cxx
229-
reinterpret_cast<TH2F*>(list->FindObject("hTrackEtaPhi"))->Fill(obj1.trackphi()[itrack] - obj1.phi(), obj1.tracketa()[itrack] - obj1.eta());
221+
for (size_t itrack = 0; itrack < obj1.deltaEta().size(); itrack++) { // Fill TrackEtaPhi histogram with delta phi and delta eta of all tracks saved in the vectors in skimmerGammaCalo.cxx
222+
reinterpret_cast<TH2F*>(list->FindObject("hTrackEtaPhi"))->Fill(obj1.deltaPhi()[itrack], obj1.deltaEta()[itrack]);
230223
}
231224
}
232225
}

PWGEM/PhotonMeson/DataModel/gammaTables.h

Lines changed: 15 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,21 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111

12-
#include <vector>
13-
#include <TMath.h>
12+
#include "PWGEM/Dilepton/DataModel/dileptonTables.h"
1413

1514
#include "Common/Core/RecoDecay.h"
1615
#include "Common/DataModel/CaloClusters.h"
16+
#include "Common/DataModel/PIDResponseTOF.h"
17+
#include "Common/DataModel/PIDResponseTPC.h"
18+
#include "Common/DataModel/TrackSelectionTables.h"
1719

18-
#include "PWGEM/Dilepton/DataModel/dileptonTables.h"
20+
#include <Framework/ASoA.h>
21+
#include <Framework/AnalysisDataModel.h>
1922

20-
#include "PWGJE/DataModel/EMCALClusters.h"
23+
#include <array>
24+
#include <cmath>
25+
#include <cstdint>
26+
#include <vector>
2127

2228
#ifndef PWGEM_PHOTONMESON_DATAMODEL_GAMMATABLES_H_
2329
#define PWGEM_PHOTONMESON_DATAMODEL_GAMMATABLES_H_
@@ -462,16 +468,16 @@ DECLARE_SOA_COLUMN(Time, time, float);
462468
DECLARE_SOA_COLUMN(IsExotic, isExotic, bool); //! flag to mark cluster as exotic
463469
DECLARE_SOA_COLUMN(Definition, definition, int); //! cluster definition, see EMCALClusterDefinition.h
464470
DECLARE_SOA_ARRAY_INDEX_COLUMN(Track, track); //! TrackIds
465-
DECLARE_SOA_COLUMN(TrackEta, tracketa, std::vector<float>); //! eta values of the matched tracks
466-
DECLARE_SOA_COLUMN(TrackPhi, trackphi, std::vector<float>); //! phi values of the matched tracks
471+
DECLARE_SOA_COLUMN(DeltaPhi, deltaPhi, std::vector<float>); //! phi values of the matched tracks
472+
DECLARE_SOA_COLUMN(DeltaEta, deltaEta, std::vector<float>); //! eta values of the matched tracks
467473
DECLARE_SOA_COLUMN(TrackP, trackp, std::vector<float>); //! momentum values of the matched tracks
468474
DECLARE_SOA_COLUMN(TrackPt, trackpt, std::vector<float>); //! pt values of the matched tracks
469475
DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](float e, float eta, float m = 0) -> float { return sqrt(e * e - m * m) / cosh(eta); }); //! cluster pt, mass to be given as argument when getter is called!
470476
} // namespace emccluster
471-
DECLARE_SOA_TABLE(SkimEMCClusters, "AOD", "SKIMEMCCLUSTERS", //! table of skimmed EMCal clusters
477+
DECLARE_SOA_TABLE(SkimEMCClusters, "AOD", "SKIMEMCCLUSTER", //! table of skimmed EMCal clusters
472478
o2::soa::Index<>, skimmedcluster::CollisionId, emccluster::Definition, skimmedcluster::E, skimmedcluster::Eta, skimmedcluster::Phi,
473-
skimmedcluster::M02, skimmedcluster::NCells, skimmedcluster::Time, emccluster::IsExotic, emccluster::TrackEta,
474-
emccluster::TrackPhi, emccluster::TrackP, emccluster::TrackPt, emccluster::Pt<skimmedcluster::E, skimmedcluster::Eta>);
479+
skimmedcluster::M02, skimmedcluster::NCells, skimmedcluster::Time, emccluster::IsExotic, emccluster::DeltaPhi,
480+
emccluster::DeltaEta, emccluster::TrackP, emccluster::TrackPt, emccluster::Pt<skimmedcluster::E, skimmedcluster::Eta>);
475481
using SkimEMCCluster = SkimEMCClusters::iterator;
476482

477483
DECLARE_SOA_TABLE(EMCEMEventIds, "AOD", "EMCEMEVENTID", emccluster::EMEventId); // To be joined with SkimEMCClusters table at analysis level.
@@ -523,42 +529,11 @@ namespace caloextra
523529
{
524530
DECLARE_SOA_INDEX_COLUMN_FULL(Cluster, cluster, int, SkimEMCClusters, ""); //! reference to the gamma in the skimmed EMCal table
525531
DECLARE_SOA_INDEX_COLUMN_FULL(Cell, cell, int, Calos, ""); //! reference to the gamma in the skimmed EMCal table
526-
// DECLARE_SOA_INDEX_COLUMN(Track, track); //! TrackID
527-
DECLARE_SOA_COLUMN(TrackEta, tracketa, float); //! eta of the matched track
528-
DECLARE_SOA_COLUMN(TrackPhi, trackphi, float); //! phi of the matched track
529-
DECLARE_SOA_COLUMN(TrackP, trackp, float); //! momentum of the matched track
530-
DECLARE_SOA_COLUMN(TrackPt, trackpt, float); //! pt of the matched track
531532
} // namespace caloextra
532533

533534
DECLARE_SOA_TABLE(SkimEMCCells, "AOD", "SKIMEMCCELLS", //! table of link between skimmed EMCal clusters and their cells
534535
o2::soa::Index<>, caloextra::ClusterId, caloextra::CellId); //!
535536
using SkimEMCCell = SkimEMCCells::iterator;
536-
537-
DECLARE_SOA_TABLE(SkimEMCMTs, "AOD", "SKIMEMCMTS", //! table of link between skimmed EMCal clusters and their matched tracks
538-
o2::soa::Index<>, caloextra::ClusterId, caloextra::TrackEta,
539-
caloextra::TrackPhi, caloextra::TrackP, caloextra::TrackPt);
540-
using SkimEMCMT = SkimEMCMTs::iterator;
541-
542-
namespace gammareco
543-
{
544-
DECLARE_SOA_COLUMN(Method, method, int); //! cut bit for PCM photon candidates
545-
DECLARE_SOA_INDEX_COLUMN_FULL(SkimmedPCM, skimmedPCM, int, V0PhotonsKF, ""); //! reference to the gamma in the skimmed PCM table
546-
DECLARE_SOA_INDEX_COLUMN_FULL(SkimmedPHOS, skimmedPHOS, int, PHOSClusters, ""); //! reference to the gamma in the skimmed PHOS table
547-
DECLARE_SOA_INDEX_COLUMN_FULL(SkimmedEMC, skimmedEMC, int, SkimEMCClusters, ""); //! reference to the gamma in the skimmed EMCal table
548-
DECLARE_SOA_COLUMN(PCMCutBit, pcmcutbit, uint64_t); //! cut bit for PCM photon candidates
549-
DECLARE_SOA_COLUMN(PHOSCutBit, phoscutbit, uint64_t); //! cut bit for PHOS photon candidates
550-
DECLARE_SOA_COLUMN(EMCCutBit, emccutbit, uint64_t); //! cut bit for EMCal photon candidates
551-
} // namespace gammareco
552-
DECLARE_SOA_TABLE(SkimGammas, "AOD", "SKIMGAMMAS", //! table of all gamma candidates (PCM, EMCal and PHOS) after cuts
553-
o2::soa::Index<>, skimmedcluster::CollisionId, gammareco::Method,
554-
skimmedcluster::E, skimmedcluster::Eta, skimmedcluster::Phi,
555-
gammareco::SkimmedEMCId, gammareco::SkimmedPHOSId);
556-
DECLARE_SOA_TABLE(SkimPCMCuts, "AOD", "SKIMPCMCUTS", //! table of link between skimmed PCM photon candidates and their cuts
557-
o2::soa::Index<>, gammareco::SkimmedPCMId, gammareco::PCMCutBit); //!
558-
DECLARE_SOA_TABLE(SkimPHOSCuts, "AOD", "SKIMPHOSCUTS", //! table of link between skimmed PHOS photon candidates and their cuts
559-
o2::soa::Index<>, gammareco::SkimmedPHOSId, gammareco::PHOSCutBit); //!
560-
DECLARE_SOA_TABLE(SkimEMCCuts, "AOD", "SKIMEMCCUTS", //! table of link between skimmed EMCal photon candidates and their cuts
561-
o2::soa::Index<>, gammareco::SkimmedEMCId, gammareco::EMCCutBit); //!
562537
} // namespace o2::aod
563538

564539
#endif // PWGEM_PHOTONMESON_DATAMODEL_GAMMATABLES_H_

PWGEM/PhotonMeson/TableProducer/CMakeLists.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,3 @@ o2physics_add_dpl_workflow(skimmer-dalitz-ee
6363
SOURCES skimmerDalitzEE.cxx
6464
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
6565
COMPONENT_NAME Analysis)
66-
67-
o2physics_add_dpl_workflow(gamma-table-producer
68-
SOURCES gammaSelection.cxx
69-
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
70-
COMPONENT_NAME Analysis)
71-
72-
o2physics_add_dpl_workflow(produce-meson-calo
73-
SOURCES produceMesonCalo.cxx
74-
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
75-
COMPONENT_NAME Analysis)

0 commit comments

Comments
 (0)