Skip to content

Commit 171f8ac

Browse files
committed
Adding dynamic columns for readability. Adding more centrality information in derived data. Removing useless histograms from derived data consumer output and cleaning folder structure
1 parent 3ba13b4 commit 171f8ac

File tree

3 files changed

+355
-394
lines changed

3 files changed

+355
-394
lines changed

PWGLF/DataModel/lambdaJetPolarizationIons.h

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ namespace lambdajetpol
3030

3131
// DECLARE_SOA_COLUMN(CollIdx, collIdx, uint64_t); // Using a regular SOA column instead of an index column for convenience
3232
DECLARE_SOA_INDEX_COLUMN(Collision, collision);
33-
DECLARE_SOA_COLUMN(Centrality, centrality, float);
33+
DECLARE_SOA_COLUMN(CentFT0M, centFT0M, float);
34+
DECLARE_SOA_COLUMN(CentFT0C, centFT0C, float);
35+
DECLARE_SOA_COLUMN(CentFT0CVariant1, centFT0CVariant1, float);
36+
DECLARE_SOA_COLUMN(CentMFT, centMFT, float);
37+
DECLARE_SOA_COLUMN(CentNGlobal, centNGlobal, float);
38+
DECLARE_SOA_COLUMN(CentFV0A, centFV0A, float);
3439

3540
DECLARE_SOA_COLUMN(JetPt, jetPt, float);
3641
DECLARE_SOA_COLUMN(JetEta, jetEta, float);
@@ -57,7 +62,20 @@ DECLARE_SOA_COLUMN(NegPt, negPt, float);
5762
DECLARE_SOA_COLUMN(NegEta, negEta, float);
5863
DECLARE_SOA_COLUMN(NegPhi, negPhi, float);
5964

60-
// (TODO: add dynamic columns with jet px, py, pz)
65+
// Dynamic columns for jets (Px,Py,Pz):
66+
DECLARE_SOA_DYNAMIC_COLUMN(JetPx, jetPx, //! Jet px
67+
[](float jetPt, float jetPhi) -> float {return jetPt * std::cos(jetPhi);});
68+
DECLARE_SOA_DYNAMIC_COLUMN(JetPy, jetPy, //! Jet py
69+
[](float jetPt, float jetPhi) -> float {return jetPt * std::sin(jetPhi);});
70+
DECLARE_SOA_DYNAMIC_COLUMN(JetPz, jetPz, //! Jet pz
71+
[](float jetPt, float jetEta) -> float {return jetPt * std::sinh(jetEta);});
72+
// Same for leading particles:
73+
DECLARE_SOA_DYNAMIC_COLUMN(LeadParticlePx, leadParticlePx, //! Leading particle px
74+
[](float leadParticlePt, float leadParticlePhi) -> float {return leadParticlePt * std::cos(leadParticlePhi);});
75+
DECLARE_SOA_DYNAMIC_COLUMN(LeadParticlePy, leadParticlePy, //! Leading particle py
76+
[](float leadParticlePt, float leadParticlePhi) -> float {return leadParticlePt * std::sin(leadParticlePhi);});
77+
DECLARE_SOA_DYNAMIC_COLUMN(LeadParticlePz, leadParticlePz, //! Leading particle pz
78+
[](float leadParticlePt, float leadParticleEta) -> float {return leadParticlePt * std::sinh(leadParticleEta);});
6179

6280
} // namespace lambdajetpol
6381

@@ -66,13 +84,23 @@ DECLARE_SOA_TABLE(RingJets, "AOD", "RINGJETS", // Renamed to follow convention o
6684
lambdajetpol::JetPt,
6785
lambdajetpol::JetEta,
6886
lambdajetpol::JetPhi,
69-
lambdajetpol::JetNConstituents);
87+
lambdajetpol::JetNConstituents,
88+
// Dynamic columns
89+
lambdajetpol::JetPx<lambdajetpol::JetPt, lambdajetpol::JetPhi>, // Explicitly binding to static columns
90+
lambdajetpol::JetPy<lambdajetpol::JetPt, lambdajetpol::JetPhi>,
91+
lambdajetpol::JetPz<lambdajetpol::JetPt, lambdajetpol::JetEta>
92+
);
7093

7194
DECLARE_SOA_TABLE(RingLeadP, "AOD", "RINGLEADP", // Leading particle table
7295
lambdajetpol::CollisionId,
7396
lambdajetpol::LeadParticlePt,
7497
lambdajetpol::LeadParticleEta,
75-
lambdajetpol::LeadParticlePhi);
98+
lambdajetpol::LeadParticlePhi,
99+
// Dynamic columns
100+
lambdajetpol::LeadParticlePx<lambdajetpol::LeadParticlePt, lambdajetpol::LeadParticlePhi>,
101+
lambdajetpol::LeadParticlePy<lambdajetpol::LeadParticlePt, lambdajetpol::LeadParticlePhi>,
102+
lambdajetpol::LeadParticlePz<lambdajetpol::LeadParticlePt, lambdajetpol::LeadParticleEta>
103+
);
76104

77105
DECLARE_SOA_TABLE(RingLaV0s, "AOD", "RINGLAV0S", // Had to write this in a shorter form because the derived data did not accept long names
78106
lambdajetpol::CollisionId,
@@ -88,11 +116,19 @@ DECLARE_SOA_TABLE(RingLaV0s, "AOD", "RINGLAV0S", // Had to write this in a short
88116
lambdajetpol::PosPhi,
89117
lambdajetpol::NegPt,
90118
lambdajetpol::NegEta,
91-
lambdajetpol::NegPhi);
119+
lambdajetpol::NegPhi
120+
);
92121

93122
DECLARE_SOA_TABLE(RingCollisions, "AOD", "RINGCOLLISIONS",
94123
lambdajetpol::CollisionId,
95-
lambdajetpol::Centrality);
124+
lambdajetpol::CentFT0M,
125+
lambdajetpol::CentFT0C,
126+
lambdajetpol::CentFT0CVariant1,
127+
lambdajetpol::CentMFT,
128+
lambdajetpol::CentNGlobal,
129+
lambdajetpol::CentFV0A
130+
);
131+
96132
} // namespace o2::aod
97133

98134
#endif // PWGLF_DATAMODEL_LAMBDAJETPOL_H_

PWGLF/TableProducer/Strangeness/lambdaJetPolarizationIons.cxx

Lines changed: 27 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,9 @@ struct lambdajetpolarizationions {
190190

191191
Configurable<bool> doPPAnalysis{"doPPAnalysis", false, "if in pp, set to true. Default is HI"};
192192
Configurable<std::string> irSource{"irSource", "ZNChadronic", "Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNChadronic)"}; // Renamed David's "ZNC hadronic" to the proper code "ZNChadronic"
193-
Configurable<int> centralityEstimator{"centralityEstimator", kCentFT0M, "Run 3 centrality estimator (0:CentFT0C, 1:CentFT0M, 2:CentFT0CVariant1, 3:CentMFT, 4:CentNGlobal, 5:CentFV0A)"}; // Default is FT0M
193+
Configurable<int> centralityEstimatorForQA{"centralityEstimatorForQA", kCentFT0M, "Run 3 centrality estimator (0:CentFT0C, 1:CentFT0M, 2:CentFT0CVariant1, 3:CentMFT, 4:CentNGlobal, 5:CentFV0A)"}; // Default is FT0M
194+
// (Now saving all centralities at the derived data level -- Makes them all available for consumer)
195+
// (But still using this variable for QA histograms)
194196

195197
/////////////////////////////////////////////
196198
Configurable<bool> doEventQA{"doEventQA", false, "do event QA histograms"};
@@ -417,7 +419,7 @@ struct lambdajetpolarizationions {
417419
} axisConfigurations;
418420

419421
// Jet selection configuration:
420-
// (TODO: Add a configurable to select charged jets, neutral jets, full jets, photon-tagged jets and so on)
422+
// (TODO: create a reasonable track selection for full, photon, and Z-tagged jet tracks, including detector angular acceptance parameters for EMCal)
421423
struct : ConfigurableGroup {
422424
std::string prefix = "jetConfigurations"; // JSON group name
423425
Configurable<double> minJetPt{"minJetPt", 30.0f, "Minimum reconstructed pt of the jet (GeV/c)"}; // Something in between pp and PbPb minima. Change for bkgSubtraction true or false!
@@ -429,27 +431,17 @@ struct lambdajetpolarizationions {
429431
Configurable<int> bkgSubtraction{"bkgSubtraction", kNoSubtraction, "Jet background subtraction: No subtraction (false), Area (true), Constituent (TODO)"}; // Selection bool for background subtraction strategy
430432
Configurable<float> GhostedAreaSpecRapidity{"GhostedAreaSpecRapidity", 1.1, "Max ghost particle rapidity for jet area estimates"}; // At least 1.0 for tracks and jets within the |eta| < 0.9 window of ITS+TPC
431433
// Using an enum for readability:
432-
Configurable<int> jetType{"jetType", kChargedJet, "Jet type: 0: Charged Jet, 1: Full Jet, 2: Photon-tagged, 3: Z-tagged"};
433-
// (TODO: create a reasonable track selection for full jets and photon/Z-tagged jet tracks, including detector angular acceptance parameters for EMCal)
434+
Configurable<int> jetType{"jetType", kChargedJet, "Jet type: 0: Charged Jet, 1: Full Jet, 2: Photon-tagged, 3: Z-tagged"}; // TODO: implement full, photon and Z jets
435+
// (TODO: check the maximum pT of jets used in my analyses! If it is way too hard, it might not be the best jet to use!)
434436

437+
// (TODO: Check which of these configurables might be useful for the photon-tagged and regular analyses)
435438
// // Configurables from JE PWG:
436-
// // (TODO: check the maximum pT of jets used in my analyses! If it is way too hard, it might not be the best jet to use!)
437439
// Configurable<float> jetEWSPtMin{"jetEWSPtMin", 0.0, "minimum event-wise subtracted jet pT"};
438440
// Configurable<float> jetEWSPtMax{"jetEWSPtMax", 1000.0, "maximum event-wise subtracted jet pT"};
439441
// Configurable<float> jetGhostArea{"jetGhostArea", 0.005, "jet ghost area"};
440442
// Configurable<int> ghostRepeat{"ghostRepeat", 0, "set to 0 to gain speed if you dont need area calculation"};
441443
// Configurable<bool> DoTriggering{"DoTriggering", false, "used for the charged jet trigger to remove the eta constraint on the jet axis"};
442444
// Configurable<float> jetAreaFractionMin{"jetAreaFractionMin", -99.0, "used to make a cut on the jet areas"};
443-
444-
// (TODO: Check which of these configurables might be useful for the photon-tagged and regular analyses)
445-
// // event level configurables
446-
// Configurable<int> trackOccupancyInTimeRangeMax{"trackOccupancyInTimeRangeMax", 999999, "maximum occupancy of tracks in neighbouring collisions in a given time range"};
447-
// Configurable<std::string> triggerMasks{"triggerMasks", "", "possible JE Trigger masks: fJetChLowPt,fJetChHighPt,fTrackLowPt,fTrackHighPt,fJetD0ChLowPt,fJetD0ChHighPt,fJetLcChLowPt,fJetLcChHighPt,fEMCALReadout,fJetFullHighPt,fJetFullLowPt,fJetNeutralHighPt,fJetNeutralLowPt,fGammaVeryHighPtEMCAL,fGammaVeryHighPtDCAL,fGammaHighPtEMCAL,fGammaHighPtDCAL,fGammaLowPtEMCAL,fGammaLowPtDCAL,fGammaVeryLowPtEMCAL,fGammaVeryLowPtDCAL"};
448-
// Configurable<bool> skipMBGapEvents{"skipMBGapEvents", true, "decide to run over MB gap events or not"};
449-
// Configurable<bool> applyRCTSelections{"applyRCTSelections", true, "decide to apply RCT selections"};
450-
// // track level configurables
451-
// Configurable<std::string> trackSelections{"trackSelections", "globalTracks", "set track selections"};
452-
// Configurable<std::string> particleSelections{"particleSelections", "PhysicalPrimary", "set particle selections"};
453445
// // cluster level configurables
454446
// Configurable<std::string> clusterDefinitionS{"clusterDefinition", "kV3Default", "cluster definition to be selected, e.g. V3Default"};
455447
// Configurable<float> clusterEtaMin{"clusterEtaMin", -0.71, "minimum cluster eta"}; // For ECMAL: |eta| < 0.7, phi = 1.40 - 3.26
@@ -515,7 +507,7 @@ struct lambdajetpolarizationions {
515507

516508
JetBkgSubUtils backgroundSub;
517509

518-
void init(InitContext const&){ // (TODO: add all useful histograms here! Add flags for QA plots and the such too)
510+
void init(InitContext const&){
519511
// setting CCDB service
520512
ccdb->setURL(ccdbConfigurations.ccdbUrl);
521513
ccdb->setCaching(true);
@@ -918,12 +910,12 @@ struct lambdajetpolarizationions {
918910
template <typename TCollision>
919911
auto getCentrality(TCollision const& collision)
920912
{
921-
if (centralityEstimator == kCentFT0M) return collision.centFT0M();
922-
else if (centralityEstimator == kCentFT0C) return collision.centFT0C();
923-
else if (centralityEstimator == kCentFT0CVariant1) return collision.centFT0CVariant1();
924-
else if (centralityEstimator == kCentMFT) return collision.centMFT();
925-
else if (centralityEstimator == kCentNGlobal) return collision.centNGlobal();
926-
else if (centralityEstimator == kCentFV0A) return collision.centFV0A();
913+
if (centralityEstimatorForQA == kCentFT0M) return collision.centFT0M();
914+
else if (centralityEstimatorForQA == kCentFT0C) return collision.centFT0C();
915+
else if (centralityEstimatorForQA == kCentFT0CVariant1) return collision.centFT0CVariant1();
916+
else if (centralityEstimatorForQA == kCentMFT) return collision.centMFT();
917+
else if (centralityEstimatorForQA == kCentNGlobal) return collision.centNGlobal();
918+
else if (centralityEstimatorForQA == kCentFV0A) return collision.centFV0A();
927919
return -1.f;
928920
}
929921

@@ -1034,7 +1026,7 @@ struct lambdajetpolarizationions {
10341026

10351027
/////////////////////////////////////////////
10361028
// Helper functions for event and candidate selection:
1037-
template <typename TCollision, typename TBC> // (TODO: add fillHists and doEventQA capabilities from derivedlambdakzeroanalysis)
1029+
template <typename TCollision, typename TBC>
10381030
bool isEventAccepted(TCollision const& collision, TBC const& bc, float centrality, bool fillHists){ // check whether the collision passes our collision selections
10391031
int selectionIdx = 0; // To loop over QA histograms. First bin is already filled: first call will already increment this index (not actually the bin index, but a value in the X axis).
10401032
if (eventSelections.requireSel8 && !collision.sel8()) return false;
@@ -1148,7 +1140,7 @@ struct lambdajetpolarizationions {
11481140

11491141
// Lambda selections:
11501142
template <typename TV0>
1151-
bool passesGenericV0Cuts(TV0 const& v0){ // (TODO: cache the posTrackExtra and neg track objects outside the V0cuts and hypothesis dependent cuts and then pass them by reference? May be quicker!)
1143+
bool passesGenericV0Cuts(TV0 const& v0){
11521144
// Base topological variables (high rejection, low cost checks)
11531145
if (v0.v0radius() < v0Selections.v0radius) return false;
11541146
V0SelCounter.fill();
@@ -1237,7 +1229,6 @@ struct lambdajetpolarizationions {
12371229
return true;
12381230
}
12391231

1240-
// (TODO: implement Armenteros cut in later function to distinguish between Lambda or antiLambda)
12411232
// Tests the hypothesis of the V0 being a Lambda or of it being an antiLambda.
12421233
template <typename TV0, typename TCollision>
12431234
bool passesLambdaLambdaBarHypothesis(TV0 const& v0, TCollision const& collision, bool Lambda_hypothesis){
@@ -1308,9 +1299,6 @@ struct lambdajetpolarizationions {
13081299
// Function to help distinguish ambiguous candidates (via Armenteros) that pass both
13091300
// the Lambda_hypothesis true (i.e., a Lambda) or false (i.e., an AntiLambda) checks
13101301
// (This function is only called in about 1-3% of the Lambda-Like V0s which remain ambiguous after all other cuts)
1311-
// (TODO: add a histogram that tracks the amount of ambiguous candidates distinguished
1312-
// by Armenteros, so that we can reconstruct the full ambiguous candidates number from
1313-
// the number of ambiguous even after Armenteros and the total number before the cut)
13141302
// int isCandidateArmenterosLambda(const float alpha, const float qt){
13151303
// // Remove K0s band
13161304
// if (std::abs(alpha) < v0Selections.armK0AlphaThreshold && qt < v0Selections.armK0QtThreshold) return kIsArmenterosK0;
@@ -1601,7 +1589,7 @@ struct lambdajetpolarizationions {
16011589
// Had to include DauTracks in subscription, even though I don't loop in it, for the indices
16021590
// to resolve, avoiding " Exception while running: Index pointing to Tracks is not bound!"
16031591
void processV0sData(SelCollisions::iterator const& collision, V0CandidatesWithTOF const& fullV0s, aod::BCsWithTimestamps const& bcs, DauTracks const& V0DauTracks){
1604-
float centrality = getCentrality(collision);
1592+
float centrality = getCentrality(collision); // Strictly for QA. We save other types of centrality estimators in the derived data!
16051593

16061594
// For event QA the last two indices never change for NEv_withJets and NEv_withV0s
16071595
// (Not the best way to initialize this: runs once per collision! TODO: think of a better way to do it)
@@ -1619,9 +1607,15 @@ struct lambdajetpolarizationions {
16191607
if (v0Selections.rejectTPCsectorBoundary) initCCDB(bc); // Substituted call from collision to bc for raw data
16201608

16211609
// Fill event table:
1622-
tableCollisions(collIdx, centrality); // (TODO: add InteractionRate info and other useful cuts for later on in the analysis!)
1610+
tableCollisions(collIdx,
1611+
collision.centFT0M(),
1612+
collision.centFT0C(),
1613+
collision.centFT0CVariant1(),
1614+
collision.centMFT(),
1615+
collision.centNGlobal(),
1616+
collision.centFV0A()
1617+
); // (TODO: add InteractionRate info and other useful cuts for later on in the analysis?)
16231618

1624-
// bool hasValidV0 = false; // Bool to know if event information can be saved.
16251619
for (auto const& v0 : fullV0s){
16261620
V0SelCounter.resetForNewV0();
16271621
V0SelCounter.fill(); // Fill for all v0 candidates
@@ -1636,8 +1630,7 @@ struct lambdajetpolarizationions {
16361630
if (analyseLambda) isLambda = passesLambdaLambdaBarHypothesis(v0, collision, true);
16371631
if (analyseAntiLambda) isAntiLambda = passesLambdaLambdaBarHypothesis(v0, collision, false);
16381632

1639-
if (!isLambda && !isAntiLambda) continue; // Candidate is not considered to be a Lambda (TODO: expand this to a full if block with QA about rejections)
1640-
// hasValidV0 = true;
1633+
if (!isLambda && !isAntiLambda) continue; // Candidate is not considered to be a Lambda
16411634

16421635
if (doArmenterosQA) histos.fill(HIST("GeneralQA/h2dArmenterosFullSelected"), v0.alpha(), v0.qtarm()); // cross-check
16431636
if (isLambda && !isAntiLambda) histos.fill(HIST("GeneralQA/h2dArmenterosFullSelectedLambda"), v0.alpha(), v0.qtarm());
@@ -1792,8 +1785,7 @@ struct lambdajetpolarizationions {
17921785
}
17931786
}
17941787
if (isAntiLambda && analyseAntiLambda) {
1795-
// histos.add("h2dNbrOfAntiLambdaVsCentrality", "h2dNbrOfAntiLambdaVsCentrality", kTH2D, {axisConfigurations.axisCentrality, {10, -0.5f, 9.5f}});
1796-
// histos.fill(HIST("h2dNbrOfAntiLambdaVsCentrality"), centrality, v0pt, v0.mAntiLambda()); // (TODO: add the proper call to this fill)
1788+
// histos.fill(HIST("h2dNbrOfAntiLambdaVsCentrality"), centrality, NbrAntiLambda); // (TODO: add the proper call to this fill)
17971789
histos.fill(HIST("h3dMassAntiLambda"), centrality, v0pt, v0.mAntiLambda());
17981790
histos.fill(HIST("hMassAntiLambda"), v0.mAntiLambda());
17991791
histos.fill(HIST("AntiLambda/hPosDCAToPV"), v0.dcapostopv());
@@ -1841,12 +1833,6 @@ struct lambdajetpolarizationions {
18411833
}
18421834
} // end CompleteTopoQA
18431835
} // end V0s loop
1844-
// Only fills collision when there is a valid V0 in it: (TODO: could probably do the same for the jets table)
1845-
// if (hasValidV0){
1846-
// LOG(INFO) << "Filling tableCollisions";
1847-
// Current logic now fills tables independently of collision having V0s, for the Jets table to match correctly, at the START of the code
1848-
// tableCollisions(collIdx, centrality);
1849-
// }
18501836
}
18511837

18521838
PROCESS_SWITCH(lambdajetpolarizationions, processJetsData, "Process jets and produce derived data in Run 3 Data", true);

0 commit comments

Comments
 (0)