Skip to content

Commit beaee0e

Browse files
authored
adding Jets and Nuclei skimming tasks
1 parent 7f62c07 commit beaee0e

File tree

13 files changed

+649
-62
lines changed

13 files changed

+649
-62
lines changed

Analysis/Tasks/PWGJE/jetfinder.cxx

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "Framework/AnalysisTask.h"
1717
#include "Framework/AnalysisDataModel.h"
1818
#include "Framework/ASoA.h"
19+
#include "AnalysisDataModel/TrackSelectionTables.h"
1920

2021
#include "fastjet/PseudoJet.hh"
2122
#include "fastjet/ClusterSequenceArea.hh"
@@ -36,14 +37,20 @@ struct JetFinderTask {
3637
OutputObj<TH1F> hJetEta{"h_jet_eta"};
3738
OutputObj<TH1F> hJetN{"h_jet_n"};
3839

39-
Configurable<bool> b_DoRhoAreaSub{"b_DoRhoAreaSub", false, "do rho area subtraction"};
40-
Configurable<bool> b_DoConstSub{"b_DoConstSub", false, "do constituent subtraction"};
40+
Configurable<float> vertexZCut{"vertexZCut", 10.0f, "Accepted z-vertex range"};
41+
Configurable<float> trackPtCut{"trackPtCut", 0.15, "minimum constituent pT"};
42+
Configurable<float> trackEtaCut{"trackEtaCut", 0.9, "constituent eta cut"};
43+
Configurable<bool> DoRhoAreaSub{"DoRhoAreaSub", false, "do rho area subtraction"};
44+
Configurable<bool> DoConstSub{"DoConstSub", false, "do constituent subtraction"};
45+
Configurable<float> jetPtMin{"jetPtMin", 10.0, "minimum jet pT"};
46+
Configurable<float> jetR{"jetR", 0.4, "jet resolution"};
4147

42-
Filter trackCuts = aod::track::pt >= 0.15f && aod::track::eta >= -0.9f && aod::track::eta <= 0.9f;
48+
Filter collisionFilter = nabs(aod::collision::posZ) < vertexZCut;
49+
Filter trackFilter = (nabs(aod::track::eta) < trackEtaCut) && (aod::track::isGlobalTrack == (uint8_t) true) && (aod::track::pt > trackPtCut);
4350

4451
std::vector<fastjet::PseudoJet> jets;
4552
std::vector<fastjet::PseudoJet> inputParticles;
46-
JetFinder jetFinder;
53+
JetFinder jetFinder; //should be a configurable but for now this cant be changed on hyperloop
4754

4855
void init(InitContext const&)
4956
{
@@ -55,16 +62,18 @@ struct JetFinderTask {
5562
70, -0.7, 0.7));
5663
hJetN.setObject(new TH1F("h_jet_n", "jet n;n constituents",
5764
30, 0., 30.));
58-
if (b_DoRhoAreaSub) {
65+
if (DoRhoAreaSub) {
5966
jetFinder.setBkgSubMode(JetFinder::BkgSubMode::rhoAreaSub);
6067
}
61-
if (b_DoConstSub) {
68+
if (DoConstSub) {
6269
jetFinder.setBkgSubMode(JetFinder::BkgSubMode::constSub);
6370
}
71+
jetFinder.jetPtMin = jetPtMin;
72+
jetFinder.jetR = jetR;
6473
}
6574

66-
void process(aod::Collision const& collision,
67-
soa::Filtered<aod::Tracks> const& tracks)
75+
void process(soa::Filtered<aod::Collisions>::iterator const& collision,
76+
soa::Filtered<soa::Join<aod::Tracks, aod::TrackSelection>> const& tracks)
6877
{
6978

7079
jets.clear();
@@ -88,7 +97,7 @@ struct JetFinderTask {
8897
hJetEta->Fill(jet.eta());
8998
hJetN->Fill(jet.constituents().size());
9099
for (const auto& constituent : jet.constituents()) { //event or jetwise
91-
if (b_DoConstSub) {
100+
if (DoConstSub) {
92101
constituentsSubTable(jetsTable.lastIndex(), constituent.pt(), constituent.eta(), constituent.phi(),
93102
constituent.E(), constituent.m());
94103
}

Analysis/Tasks/SkimmingTutorials/CMakeLists.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,37 @@ o2_add_dpl_workflow(tpcspectra-task-skim-analyser
2323
SOURCES spectraTPCAnalyser.cxx
2424
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2::AnalysisDataModel
2525
COMPONENT_NAME Analysis)
26+
27+
o2_add_dpl_workflow(nucleispectra-task-skim-reference
28+
SOURCES spectraNucleiReference.cxx
29+
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2::AnalysisDataModel O2::AnalysisCore
30+
COMPONENT_NAME Analysis)
31+
32+
o2_add_dpl_workflow(nucleispectra-task-skim-provider
33+
SOURCES spectraNucleiProvider.cxx
34+
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2::AnalysisDataModel O2::AnalysisCore
35+
COMPONENT_NAME Analysis)
36+
37+
o2_add_dpl_workflow(nucleispectra-task-skim-analyser
38+
SOURCES spectraNucleiAnalyser.cxx
39+
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2::AnalysisDataModel O2::AnalysisCore
40+
COMPONENT_NAME Analysis)
41+
if(FastJet_FOUND)
42+
o2_add_dpl_workflow(jet-task-skim-provider
43+
SOURCES jetProvider.cxx
44+
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2::AnalysisDataModel
45+
O2::AnalysisJets
46+
COMPONENT_NAME Analysis)
47+
48+
o2_add_dpl_workflow(jetspectra-task-skim-analyser
49+
SOURCES jetSpectraAnalyser.cxx
50+
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2::AnalysisDataModel
51+
O2::AnalysisJets
52+
COMPONENT_NAME Analysis)
53+
54+
o2_add_dpl_workflow(jetspectra-task-skim-reference
55+
SOURCES jetSpectraReference.cxx
56+
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2::AnalysisDataModel
57+
O2::AnalysisJets
58+
COMPONENT_NAME Analysis)
59+
endif()
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
#ifndef O2_ANALYSIS_JEDERIVED_H
11+
#define O2_ANALYSIS_JEDERIVED_H
12+
13+
#include "Framework/ASoA.h"
14+
#include "Framework/AnalysisDataModel.h"
15+
16+
namespace o2::aod
17+
{
18+
namespace jejet
19+
{
20+
DECLARE_SOA_COLUMN(Pt, pt, float);
21+
DECLARE_SOA_COLUMN(Eta, eta, float);
22+
DECLARE_SOA_COLUMN(Phi, phi, float);
23+
DECLARE_SOA_COLUMN(Energy, energy, float);
24+
DECLARE_SOA_COLUMN(Mass, mass, float);
25+
DECLARE_SOA_COLUMN(Area, area, float);
26+
DECLARE_SOA_DYNAMIC_COLUMN(Px, px, [](float pt, float phi) { return pt * TMath::Cos(phi); });
27+
DECLARE_SOA_DYNAMIC_COLUMN(Py, py, [](float pt, float phi) { return pt * TMath::Sin(phi); });
28+
DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz, [](float pt, float eta) { return pt * TMath::SinH(eta); });
29+
DECLARE_SOA_DYNAMIC_COLUMN(P, p, [](float pt, float eta) { return pt * TMath::CosH(eta); }); //absolute p
30+
} // namespace jejet
31+
32+
DECLARE_SOA_TABLE(JEJets, "AOD", "JEJET",
33+
o2::soa::Index<>,
34+
jejet::Pt,
35+
jejet::Eta,
36+
jejet::Phi,
37+
jejet::Energy,
38+
jejet::Mass,
39+
jejet::Area,
40+
jejet::Px<jejet::Pt, jejet::Phi>,
41+
jejet::Py<jejet::Pt, jejet::Phi>,
42+
jejet::Pz<jejet::Pt, jejet::Eta>,
43+
jejet::P<jejet::Pt, jejet::Eta>);
44+
45+
using JEJet = JEJets::iterator;
46+
47+
namespace jeconstituent
48+
{
49+
DECLARE_SOA_INDEX_COLUMN(JEJet, jejet);
50+
DECLARE_SOA_COLUMN(Pt, pt, float);
51+
DECLARE_SOA_COLUMN(Eta, eta, float);
52+
DECLARE_SOA_COLUMN(Phi, phi, float);
53+
DECLARE_SOA_DYNAMIC_COLUMN(Px, px, [](float pt, float phi) { return pt * TMath::Cos(phi); });
54+
DECLARE_SOA_DYNAMIC_COLUMN(Py, py, [](float pt, float phi) { return pt * TMath::Sin(phi); });
55+
DECLARE_SOA_DYNAMIC_COLUMN(Pz, pz, [](float pt, float eta) { return pt * TMath::SinH(eta); });
56+
DECLARE_SOA_DYNAMIC_COLUMN(P, p, [](float pt, float eta) { return pt * TMath::CosH(eta); }); //absolute p
57+
} // namespace jeconstituent
58+
59+
DECLARE_SOA_TABLE(JEConstituents, "AOD", "JECONSTITUENT", o2::soa::Index<>,
60+
jeconstituent::JEJetId,
61+
jeconstituent::Pt, jeconstituent::Eta, jeconstituent::Phi,
62+
jeconstituent::Px<jeconstituent::Pt, jeconstituent::Phi>,
63+
jeconstituent::Py<jeconstituent::Pt, jeconstituent::Phi>,
64+
jeconstituent::Pz<jeconstituent::Pt, jeconstituent::Eta>,
65+
jeconstituent::P<jeconstituent::Pt, jeconstituent::Eta>);
66+
using JEConstituent = JEConstituents::iterator;
67+
} // namespace o2::aod
68+
69+
#endif // O2_ANALYSIS_JEDERIVED_H

Analysis/Tasks/SkimmingTutorials/DataModel/LFDerived.h

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,60 @@
1515

1616
namespace o2::aod
1717
{
18-
//DECLARE_SOA_TABLE(LFCollisions, "AOD", "LFCOLLISION", o2::soa::Index<>,
19-
// o2::aod::bc::RunNumber, o2::aod::collision::PosZ);
20-
//using LFCollision = LFCollisions::iterator;
18+
DECLARE_SOA_TABLE(LFCollisions, "AOD", "LFCOLLISION", o2::soa::Index<>,
19+
o2::aod::collision::PosZ);
20+
using LFCollision = LFCollisions::iterator;
2121

2222
namespace lftrack
2323
{
24-
//DECLARE_SOA_INDEX_COLUMN(LFCollision, lfCollision);
24+
DECLARE_SOA_INDEX_COLUMN(LFCollision, lfCollision);
2525
DECLARE_SOA_COLUMN(Pt, pt, float);
2626
DECLARE_SOA_COLUMN(P, p, float);
2727
DECLARE_SOA_COLUMN(Eta, eta, float);
28-
DECLARE_SOA_COLUMN(TPCNSigma, tpcNSigma, float[9]);
28+
DECLARE_SOA_COLUMN(Phi, phi, float);
29+
DECLARE_SOA_COLUMN(TpcNSigmaEl, tpcNSigmaEl, float);
30+
DECLARE_SOA_COLUMN(TpcNSigmaMu, tpcNSigmaMu, float);
31+
DECLARE_SOA_COLUMN(TpcNSigmaPi, tpcNSigmaPi, float);
32+
DECLARE_SOA_COLUMN(TpcNSigmaKa, tpcNSigmaKa, float);
33+
DECLARE_SOA_COLUMN(TpcNSigmaPr, tpcNSigmaPr, float);
34+
DECLARE_SOA_COLUMN(TpcNSigmaDe, tpcNSigmaDe, float);
35+
DECLARE_SOA_COLUMN(TpcNSigmaTr, tpcNSigmaTr, float);
36+
DECLARE_SOA_COLUMN(TpcNSigmaHe, tpcNSigmaHe, float);
37+
DECLARE_SOA_COLUMN(TpcNSigmaAl, tpcNSigmaAl, float);
38+
DECLARE_SOA_COLUMN(TofNSigmaEl, tofNSigmaEl, float);
39+
DECLARE_SOA_COLUMN(TofNSigmaMu, tofNSigmaMu, float);
40+
DECLARE_SOA_COLUMN(TofNSigmaPi, tofNSigmaPi, float);
41+
DECLARE_SOA_COLUMN(TofNSigmaKa, tofNSigmaKa, float);
42+
DECLARE_SOA_COLUMN(TofNSigmaPr, tofNSigmaPr, float);
43+
DECLARE_SOA_COLUMN(TofNSigmaDe, tofNSigmaDe, float);
44+
DECLARE_SOA_COLUMN(TofNSigmaTr, tofNSigmaTr, float);
45+
DECLARE_SOA_COLUMN(TofNSigmaHe, tofNSigmaHe, float);
46+
DECLARE_SOA_COLUMN(TofNSigmaAl, tofNSigmaAl, float);
2947
} // namespace lftrack
3048
DECLARE_SOA_TABLE(LFTracks, "AOD", "LFTRACK", o2::soa::Index<>,
31-
//lftrack::LFCollisionId,
3249
lftrack::Pt, lftrack::P, lftrack::Eta,
33-
lftrack::TPCNSigma);
50+
lftrack::TpcNSigmaEl, lftrack::TpcNSigmaMu,
51+
lftrack::TpcNSigmaPi, lftrack::TpcNSigmaKa,
52+
lftrack::TpcNSigmaPr, lftrack::TpcNSigmaDe,
53+
lftrack::TpcNSigmaTr, lftrack::TpcNSigmaHe,
54+
lftrack::TpcNSigmaAl);
3455
using LFTrack = LFTracks::iterator;
56+
57+
DECLARE_SOA_TABLE(LFNucleiTracks, "AOD", "LFNUCLEITRACK", o2::soa::Index<>,
58+
lftrack::LFCollisionId,
59+
lftrack::Pt, lftrack::P,
60+
lftrack::Eta, lftrack::Phi,
61+
lftrack::TpcNSigmaEl, lftrack::TpcNSigmaMu,
62+
lftrack::TpcNSigmaPi, lftrack::TpcNSigmaKa,
63+
lftrack::TpcNSigmaPr, lftrack::TpcNSigmaDe,
64+
lftrack::TpcNSigmaTr, lftrack::TpcNSigmaHe,
65+
lftrack::TpcNSigmaAl,
66+
lftrack::TofNSigmaEl, lftrack::TofNSigmaMu,
67+
lftrack::TofNSigmaPi, lftrack::TofNSigmaKa,
68+
lftrack::TofNSigmaPr, lftrack::TofNSigmaDe,
69+
lftrack::TofNSigmaTr, lftrack::TofNSigmaHe,
70+
lftrack::TofNSigmaAl);
71+
using LFNucleiTrack = LFNucleiTracks::iterator;
3572
} // namespace o2::aod
3673

3774
#endif // O2_ANALYSIS_LFDERIVED_H

Analysis/Tasks/SkimmingTutorials/LFDerived.h

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
/// \author Nima Zardoshti <nima.zardoshti@cern.ch>, CERN
11+
12+
// O2 includes
13+
#include "ReconstructionDataFormats/Track.h"
14+
#include "Framework/AnalysisTask.h"
15+
#include "Framework/AnalysisDataModel.h"
16+
#include "Framework/ASoAHelpers.h"
17+
#include "AnalysisDataModel/TrackSelectionTables.h"
18+
#include "DataModel/JEDerived.h"
19+
#include "AnalysisDataModel/Jet.h"
20+
#include "AnalysisCore/JetFinder.h"
21+
22+
using namespace o2;
23+
using namespace o2::framework;
24+
using namespace o2::framework::expressions;
25+
26+
#include "Framework/runDataProcessing.h"
27+
28+
struct JetProviderTask {
29+
30+
Produces<aod::JEJets> outputJets;
31+
Produces<aod::JEConstituents> outputConstituents;
32+
33+
Configurable<float> jetPtMin{"jetPtMin", 0.0, "minimum jet pT cut"};
34+
Configurable<bool> keepConstituents{"keepConstituents", true, "Constituent table is filled"};
35+
Configurable<bool> DoConstSub{"DoConstSub", false, "do constituent subtraction"};
36+
Filter jetCuts = aod::jet::pt > jetPtMin;
37+
38+
void process(soa::Filtered<aod::Jets>::iterator const& jet,
39+
aod::Tracks const& tracks,
40+
aod::JetConstituents const& constituents,
41+
aod::JetConstituentsSub const& constituentsSub)
42+
{
43+
outputJets(jet.pt(), jet.eta(), jet.phi(), jet.energy(), jet.mass(), jet.area());
44+
if (keepConstituents) {
45+
if (DoConstSub) {
46+
outputConstituents.reserve(constituentsSub.size());
47+
for (const auto constituent : constituentsSub) {
48+
outputConstituents(outputJets.lastIndex(), constituent.pt(), constituent.eta(), constituent.phi());
49+
}
50+
} else {
51+
outputConstituents.reserve(constituents.size());
52+
for (const auto constituentIndex : constituents) {
53+
auto constituent = constituentIndex.track();
54+
outputConstituents(outputJets.lastIndex(), constituent.pt(), constituent.eta(), constituent.phi());
55+
}
56+
}
57+
}
58+
}
59+
};
60+
61+
WorkflowSpec defineDataProcessing(ConfigContext const&)
62+
{
63+
WorkflowSpec workflow{adaptAnalysisTask<JetProviderTask>("jet-task-skim-provider")};
64+
return workflow;
65+
}

0 commit comments

Comments
 (0)