Skip to content

Commit cf2d261

Browse files
committed
Update CMakeLists for new task
1 parent 84d16cb commit cf2d261

File tree

3 files changed

+36
-25
lines changed

3 files changed

+36
-25
lines changed

PWGLF/TableProducer/Resonances/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,8 @@ o2physics_add_dpl_workflow(cksspinalignment
5454
SOURCES cksspinalignment.cxx
5555
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
5656
COMPONENT_NAME Analysis)
57+
58+
o2physics_add_dpl_workflow(resonance-tree-creator
59+
SOURCES resonanceTreeCreator.cxx
60+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
61+
COMPONENT_NAME Analysis)

PWGLF/TableProducer/Resonances/resonanceTreeCreator.cxx

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,41 +13,38 @@
1313
/// \brief Produces a TTree with machine learning variables for resonances in the LF group
1414
/// \author Stefano Cannito (stefano.cannito@cern.ch)
1515

16-
#include "Common/DataModel/EventSelection.h"
17-
18-
#include "Framework/AnalysisDataModel.h"
19-
#include "Framework/AnalysisTask.h"
20-
#include "Framework/runDataProcessing.h"
21-
22-
#include <Math/Vector4D.h>
23-
#include <TPDGCode.h>
24-
25-
#include <algorithm>
26-
#include <array>
27-
#include <cmath>
28-
#include <cstdlib>
29-
#include <string>
30-
#include <utility>
31-
#include <vector>
32-
// #include "PWGLF/DataModel/LFResonanceMLTables.h"
3316
#include "PWGLF/DataModel/mcCentrality.h"
3417
#include "PWGLF/Utils/inelGt.h"
3518

3619
#include "Common/Core/RecoDecay.h"
3720
#include "Common/Core/TrackSelection.h"
3821
#include "Common/Core/trackUtilities.h"
3922
#include "Common/DataModel/Centrality.h"
23+
#include "Common/DataModel/EventSelection.h"
4024
#include "Common/DataModel/Multiplicity.h"
4125
#include "Common/DataModel/PIDResponse.h"
4226
#include "Common/DataModel/TrackSelectionTables.h"
4327

4428
#include "CommonConstants/PhysicsConstants.h"
4529
#include "Framework/ASoAHelpers.h"
4630
#include "Framework/AnalysisDataModel.h"
31+
#include "Framework/AnalysisTask.h"
4732
#include "Framework/HistogramRegistry.h"
4833
#include "Framework/O2DatabasePDGPlugin.h"
34+
#include "Framework/runDataProcessing.h"
4935
#include "ReconstructionDataFormats/Track.h"
5036

37+
#include <Math/Vector4D.h>
38+
#include <TPDGCode.h>
39+
40+
#include <algorithm>
41+
#include <array>
42+
#include <cmath>
43+
#include <cstdlib>
44+
#include <string>
45+
#include <utility>
46+
#include <vector>
47+
5148
using namespace o2;
5249
using namespace o2::framework;
5350
using namespace o2::framework::expressions;
@@ -97,6 +94,16 @@ DECLARE_SOA_COLUMN(Sign, sign, int8_t); //! Sign of the candidate
9794
DECLARE_SOA_COLUMN(IsPhi, isPhi, bool); //! Flag to indicate if the candidate is a phi meson
9895
} // namespace resomlcandidates
9996

97+
DECLARE_SOA_TABLE(ResoCandidates, "AOD", "RESOCANDIDATES",
98+
resomlcandidates::M,
99+
resomlcandidates::Pt,
100+
resomlcandidates::P,
101+
resomlcandidates::Phi,
102+
resomlcandidates::Eta,
103+
resomlcandidates::Y,
104+
resomlcandidates::Sign,
105+
resomlcandidates::IsPhi);
106+
100107
DECLARE_SOA_TABLE(ResoMLCandidates, "AOD", "RESOMLCANDIDATES",
101108
resomlcandidates::MultClass,
102109
resomlcandidates::PtDaughter1,
@@ -145,6 +152,7 @@ DECLARE_SOA_TABLE(ResoPhiMLSelection, "AOD", "RESOPHIMLSELECTION",
145152

146153
struct resonanceTreeCreator {
147154
// Production of the TTree
155+
Produces<aod::ResoCandidates> resoCandidates;
148156
Produces<aod::ResoMLCandidates> resoMLCandidates;
149157

150158
// Configurables for track selection
@@ -171,8 +179,8 @@ struct resonanceTreeCreator {
171179
Partition<FullMCTracks> posMCTracks = aod::track::signed1Pt > cfgCutCharge;
172180
Partition<FullMCTracks> negMCTracks = aod::track::signed1Pt < cfgCutCharge;
173181

174-
// Cache for the tracks
175-
SliceCache cache;
182+
Preslice<aod::Tracks> perColl = aod::track::collisionId;
183+
Preslice<aod::McParticles> perMCColl = aod::mcparticle::mcCollisionId;
176184

177185
// Necessary to flag INEL>0 events in GenMC
178186
Service<o2::framework::O2DatabasePDG> pdgDB;
@@ -278,10 +286,6 @@ struct resonanceTreeCreator {
278286
return; // Skip filling if only background is requested and a phi candidate
279287
}
280288

281-
/*isPhi = (mcTrack1.pdgCode() == PDG_t::kKPlus && mcTrack2.pdgCode() == PDG_t::kKMinus &&
282-
motherOfMcTrack1.pdgCode() == motherOfMcTrack2.pdgCode() && motherOfMcTrack1.pdgCode() == o2::constants::physics::Pdg::kPhi);
283-
}*/
284-
285289
resoMLCandidates(collision.centFT0M(),
286290
track1.pt(), track1.p(), track1.phi(), track1.eta(), track1.rapidity(masstrack1), track1.dcaXY(), track1.dcaZ(),
287291
track1.tpcNSigmaPi(), track1.tpcNSigmaKa(), track1.tofNSigmaPi(), track1.tofNSigmaKa(), tpctofPi1, tpctofKa1,
@@ -331,4 +335,4 @@ struct resonanceTreeCreator {
331335
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
332336
{
333337
return WorkflowSpec{adaptAnalysisTask<resonanceTreeCreator>(cfgc)};
334-
}
338+
}

PWGLF/Tasks/Strangeness/phik0shortanalysis.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3409,7 +3409,9 @@ struct Phik0shortanalysis {
34093409
continue; // condition to avoid double counting of pair
34103410

34113411
ROOT::Math::PxPyPzMVector recPhi = recMother(track1, track2, massKa, massKa);
3412-
if (recPhi.Pt() < phiConfigs.minPhiPt || recPhi.Pt() > phiConfigs.maxPhiPt)
3412+
if (recPhi.Pt() < phiConfigs.minPhiPt)
3413+
continue;
3414+
if (recPhi.M() < phiConfigs.lowMPhi || recPhi.M() > phiConfigs.upMPhi)
34133415
continue;
34143416
if (std::abs(recPhi.Rapidity()) > deltaYConfigs.cfgYAcceptance)
34153417
continue;

0 commit comments

Comments
 (0)