Skip to content

Commit 4d20e71

Browse files
committed
He3-L derived data analysis
The changes introduce a new data model for the LFSlimHeLambda analysis in the PWGLF module. The main changes are: 1. Add the `LFSlimHeLambda.h` file, which defines the data model for the LFHe3 and LFLambda tables. 2. Update the `he3LambdaAnalysis.cxx` file to include the new `LFSlimHeLambda.h` header file. 3. Remove the redundant code that defined the data model in the `he3LambdaAnalysis.cxx` file, as it is now provided by the `LFSlimHeLambda.h` header. These changes aim to centralize the data model definition for the LFSlimHeLambda analysis, making it more maintainable and reusable across different analysis tasks. He3-L derived data analysis The changes introduce a new data model for the LFSlimHeLambda analysis in the PWGLF module. The main changes are: 1. Add the `LFSlimHeLambda.h` file, which defines the data model for the LFHe3 and LFLambda tables. 2. Update the `he3LambdaAnalysis.cxx` file to include the new `LFSlimHeLambda.h` header file. 3. Remove the redundant code that defined the data model in the `he3LambdaAnalysis.cxx` file, as it is now provided by the `LFSlimHeLambda.h` header. These changes aim to centralize the data model definition for the LFSlimHeLambda analysis, making it more maintainable and reusable across different analysis tasks. He3-L derived data analysis The changes introduce a new data model for the LFSlimHeLambda analysis in the PWGLF module. The main changes are: 1. Add the `LFSlimHeLambda.h` file, which defines the data model for the LFHe3 and LFLambda tables. 2. Update the `he3LambdaAnalysis.cxx` file to include the new `LFSlimHeLambda.h` header file. 3. Remove the redundant code that defined the data model in the `he3LambdaAnalysis.cxx` file, as it is now provided by the `LFSlimHeLambda.h` header. These changes aim to centralize the data model definition for the LFSlimHeLambda analysis, making it more maintainable and reusable across different analysis tasks. He3-L derived data analysis The changes introduce a new data model for the LFSlimHeLambda analysis in the PWGLF module. The main changes are: 1. Add the `LFSlimHeLambda.h` file, which defines the data model for the LFHe3 and LFLambda tables. 2. Update the `he3LambdaAnalysis.cxx` file to include the new `LFSlimHeLambda.h` header file. 3. Remove the redundant code that defined the data model in the `he3LambdaAnalysis.cxx` file, as it is now provided by the `LFSlimHeLambda.h` header. These changes aim to centralize the data model definition for the LFSlimHeLambda analysis, making it more maintainable and reusable across different analysis tasks. He3-L derived data analysis The changes introduce a new data model for the LFSlimHeLambda analysis in the PWGLF module. The main changes are: 1. Add the `LFSlimHeLambda.h` file, which defines the data model for the LFHe3 and LFLambda tables. 2. Update the `he3LambdaAnalysis.cxx` file to include the new `LFSlimHeLambda.h` header file. 3. Remove the redundant code that defined the data model in the `he3LambdaAnalysis.cxx` file, as it is now provided by the `LFSlimHeLambda.h` header. These changes aim to centralize the data model definition for the LFSlimHeLambda analysis, making it more maintainable and reusable across different analysis tasks. He3-L derived data analysis The changes introduce a new data model for the LFSlimHeLambda analysis in the PWGLF module. The main changes are: 1. Add the `LFSlimHeLambda.h` file, which defines the data model for the LFHe3 and LFLambda tables. 2. Update the `he3LambdaAnalysis.cxx` file to include the new `LFSlimHeLambda.h` header file. 3. Remove the redundant code that defined the data model in the `he3LambdaAnalysis.cxx` file, as it is now provided by the `LFSlimHeLambda.h` header. These changes aim to centralize the data model definition for the LFSlimHeLambda analysis, making it more maintainable and reusable across different analysis tasks. Please consider the following formatting changes to #12220 (#12221) He3-L derived data analysis The changes introduce a new data model for the LFSlimHeLambda analysis in the PWGLF module. The main changes are: 1. Add the `LFSlimHeLambda.h` file, which defines the data model for the LFHe3 and LFLambda tables. 2. Update the `he3LambdaAnalysis.cxx` file to include the new `LFSlimHeLambda.h` header file. 3. Remove the redundant code that defined the data model in the `he3LambdaAnalysis.cxx` file, as it is now provided by the `LFSlimHeLambda.h` header. These changes aim to centralize the data model definition for the LFSlimHeLambda analysis, making it more maintainable and reusable across different analysis tasks. He3-L derived data analysis The changes introduce a new data model for the LFSlimHeLambda analysis in the PWGLF module. The main changes are: 1. Add the `LFSlimHeLambda.h` file, which defines the data model for the LFHe3 and LFLambda tables. 2. Update the `he3LambdaAnalysis.cxx` file to include the new `LFSlimHeLambda.h` header file. 3. Remove the redundant code that defined the data model in the `he3LambdaAnalysis.cxx` file, as it is now provided by the `LFSlimHeLambda.h` header. These changes aim to centralize the data model definition for the LFSlimHeLambda analysis, making it more maintainable and reusable across different analysis tasks. He3-L derived data analysis The changes introduce a new data model for the LFSlimHeLambda analysis in the PWGLF module. The main changes are: 1. Add the `LFSlimHeLambda.h` file, which defines the data model for the LFHe3 and LFLambda tables. 2. Update the `he3LambdaAnalysis.cxx` file to include the new `LFSlimHeLambda.h` header file. 3. Remove the redundant code that defined the data model in the `he3LambdaAnalysis.cxx` file, as it is now provided by the `LFSlimHeLambda.h` header. These changes aim to centralize the data model definition for the LFSlimHeLambda analysis, making it more maintainable and reusable across different analysis tasks. Please consider the following formatting changes to #12220 (#12221) Please consider the following formatting changes to #12220 (#12221)
1 parent 291c764 commit 4d20e71

File tree

4 files changed

+236
-60
lines changed

4 files changed

+236
-60
lines changed

PWGLF/DataModel/LFSlimHeLambda.h

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
///
13+
/// \file LFSlimNucleiTables.h
14+
/// \brief Slim nuclei tables
15+
///
16+
17+
#ifndef PWGLF_DATAMODEL_LFSLIMNUCLEITABLES_H_
18+
#define PWGLF_DATAMODEL_LFSLIMNUCLEITABLES_H_
19+
20+
#include "Framework/ASoAHelpers.h"
21+
#include "Framework/AnalysisDataModel.h"
22+
#include <Math/Vector4D.h>
23+
24+
namespace o2::aod
25+
{
26+
namespace lfv0he3
27+
{
28+
DECLARE_SOA_COLUMN(Z, z, float);
29+
DECLARE_SOA_COLUMN(CentT0C, centT0C, float);
30+
} // namespace lfv0he3
31+
DECLARE_SOA_TABLE(LFEvents, "AOD", "LFEVENT", o2::soa::Index<>, lfv0he3::Z, lfv0he3::CentT0C);
32+
33+
namespace lfv0he3
34+
{
35+
DECLARE_SOA_INDEX_COLUMN(LFEvent, lfEvent); // Collision ID for the event
36+
DECLARE_SOA_COLUMN(Pt, pt, float);
37+
DECLARE_SOA_COLUMN(Eta, eta, float);
38+
DECLARE_SOA_COLUMN(Phi, phi, float);
39+
DECLARE_SOA_COLUMN(Mass, mass, float);
40+
DECLARE_SOA_COLUMN(CosPA, cosPA, float);
41+
DECLARE_SOA_COLUMN(DCAxy, dcaXY, float);
42+
DECLARE_SOA_COLUMN(DCAz, dcaZ, float);
43+
DECLARE_SOA_COLUMN(TPCnCls, tpcNCls, int);
44+
DECLARE_SOA_COLUMN(ITSClusterSizes, itsClusterSizes, uint32_t);
45+
DECLARE_SOA_COLUMN(NsigmaTPC, nSigmaTPC, float);
46+
// DECLARE_SOA_COLUMN(NsigmaTPCproton, nSigmaTPCproton, float);
47+
DECLARE_SOA_COLUMN(DCAdaughters, dcaDaughters, float);
48+
DECLARE_SOA_COLUMN(DCAPVProton, dcaPVProton, float);
49+
DECLARE_SOA_COLUMN(DCAPVPion, dcaPVPion, float);
50+
DECLARE_SOA_COLUMN(V0Radius, v0Radius, float);
51+
DECLARE_SOA_COLUMN(Sign, sign, int8_t);
52+
} // namespace lfv0he3
53+
DECLARE_SOA_TABLE(LFHe3, "AOD", "LFHE3V0", lfv0he3::LFEventId, lfv0he3::Pt, lfv0he3::Eta, lfv0he3::Phi, lfv0he3::DCAxy, lfv0he3::DCAz, lfv0he3::TPCnCls, lfv0he3::ITSClusterSizes, lfv0he3::NsigmaTPC, lfv0he3::Sign);
54+
DECLARE_SOA_TABLE(LFLambda, "AOD", "LFLAMBDA", lfv0he3::LFEventId, lfv0he3::Pt, lfv0he3::Eta, lfv0he3::Phi, lfv0he3::Mass, lfv0he3::CosPA, lfv0he3::DCAdaughters, lfv0he3::DCAPVProton, lfv0he3::DCAPVPion, lfv0he3::V0Radius, lfv0he3::Sign);
55+
} // namespace o2::aod
56+
57+
struct he3Candidate {
58+
ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<double>> momentum; // 4-momentum of the He3 candidate
59+
float nSigmaTPC = -999.f; // TPC nSigma for He3
60+
float dcaXY = -999.f;
61+
float dcaZ = -999.f;
62+
int tpcNClsFound = 0; // Number of TPC clusters found
63+
int itsNCls = 0; // Number of ITS clusters
64+
uint32_t itsClusterSizes = 0; // ITS cluster sizes
65+
int8_t sign = 0; // Charge sign of the He3 candidate
66+
};
67+
68+
struct lambdaCandidate {
69+
ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<double>> momentum;
70+
float mass = -1.f; // Lambda mass
71+
float cosPA = -2.f; // Cosine of pointing angle
72+
float dcaV0Daughters = -999.f; // DCA between V0 daughters
73+
float dcaProtonToPV = -999.f; // DCA of the proton to primary vertex
74+
float dcaPionToPV = -999.f; // DCA of the pion to primary vertex
75+
float v0Radius = -1.f; // V0 radius
76+
float protonNSigmaTPC = -999.f; // Proton TPC nSigma
77+
float pionNSigmaTPC = -999.f;
78+
int8_t sign = 0; // Charge sign of the Lambda candidate
79+
};
80+
81+
82+
#endif // PWGLF_DATAMODEL_LFSLIMNUCLEITABLES_H_

PWGLF/TableProducer/Nuspex/he3LambdaAnalysis.cxx

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

12+
#include "PWGLF/DataModel/LFSlimHeLambda.h"
13+
1214
#include "Common/Core/trackUtilities.h"
1315
#include "Common/DataModel/Centrality.h"
1416
#include "Common/DataModel/EventSelection.h"
1517
#include "Common/DataModel/PIDResponseITS.h"
1618
#include "Common/DataModel/PIDResponseTPC.h"
1719
#include "EventFiltering/Zorro.h"
1820
#include "EventFiltering/ZorroSummary.h"
21+
#include "PWGLF/DataModel/LFSlimHeLambda.h"
1922

2023
#include <CCDB/BasicCCDBManager.h>
2124
#include <DCAFitter/DCAFitterN.h>
@@ -45,39 +48,6 @@ using namespace o2;
4548
using namespace o2::framework;
4649
using namespace o2::framework::expressions;
4750
using namespace o2::constants::physics;
48-
49-
namespace o2::aod
50-
{
51-
namespace lfv0he3
52-
{
53-
DECLARE_SOA_COLUMN(Z, z, float);
54-
DECLARE_SOA_COLUMN(CentT0C, centT0C, float);
55-
} // namespace lfv0he3
56-
DECLARE_SOA_TABLE(LFEvents, "AOD", "LFEVENT", o2::soa::Index<>, lfv0he3::Z, lfv0he3::CentT0C);
57-
58-
namespace lfv0he3
59-
{
60-
DECLARE_SOA_INDEX_COLUMN(LFEvent, lfEvent); // Collision ID for the event
61-
DECLARE_SOA_COLUMN(Pt, pt, float);
62-
DECLARE_SOA_COLUMN(Eta, eta, float);
63-
DECLARE_SOA_COLUMN(Phi, phi, float);
64-
DECLARE_SOA_COLUMN(Mass, mass, float);
65-
DECLARE_SOA_COLUMN(CosPA, cosPA, float);
66-
DECLARE_SOA_COLUMN(DCAxy, dcaXY, float);
67-
DECLARE_SOA_COLUMN(DCAz, dcaZ, float);
68-
DECLARE_SOA_COLUMN(TPCnCls, tpcNCls, int);
69-
DECLARE_SOA_COLUMN(ITSClusterSizes, itsClusterSizes, uint32_t);
70-
DECLARE_SOA_COLUMN(NsigmaTPC, nSigmaTPC, float);
71-
DECLARE_SOA_COLUMN(DCAdaughters, dcaDaughters, float);
72-
DECLARE_SOA_COLUMN(DCAPVProton, dcaPVProton, float);
73-
DECLARE_SOA_COLUMN(DCAPVPion, dcaPVPion, float);
74-
DECLARE_SOA_COLUMN(V0Radius, v0Radius, float);
75-
DECLARE_SOA_COLUMN(Sign, sign, int8_t);
76-
} // namespace lfv0he3
77-
DECLARE_SOA_TABLE(LFHe3, "AOD", "LFHE3V0", lfv0he3::LFEventId, lfv0he3::Pt, lfv0he3::Eta, lfv0he3::Phi, lfv0he3::DCAxy, lfv0he3::DCAz, lfv0he3::TPCnCls, lfv0he3::ITSClusterSizes, lfv0he3::NsigmaTPC, lfv0he3::Sign);
78-
DECLARE_SOA_TABLE(LFLambda, "AOD", "LFLAMBDA", lfv0he3::LFEventId, lfv0he3::Pt, lfv0he3::Eta, lfv0he3::Phi, lfv0he3::Mass, lfv0he3::CosPA, lfv0he3::DCAdaughters, lfv0he3::DCAPVProton, lfv0he3::DCAPVPion, lfv0he3::V0Radius, lfv0he3::Sign);
79-
} // namespace o2::aod
80-
8151
namespace
8252
{
8353
constexpr double betheBlochDefault[1][6]{{-1.e32, -1.e32, -1.e32, -1.e32, -1.e32, -1.e32}};
@@ -106,37 +76,14 @@ std::shared_ptr<TH2> hTPCnSigmaAll;
10676
std::shared_ptr<TH2> hTPCnSigmaHe3;
10777
std::shared_ptr<TH2> hArmenterosPodolanskiAll;
10878
std::shared_ptr<TH2> hArmenterosPodolanskiSelected;
109-
std::shared_ptr<TH2> hInvariantMass;
79+
std::shared_ptr<TH2> hInvariantMassUS;
80+
std::shared_ptr<TH2> hInvariantMassLS;
11081

11182
}; // namespace
11283

11384
using TracksFull = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::pidTPCFullPr, aod::pidTPCFullPi>;
11485
using CollisionsFull = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0As, aod::CentFT0Cs, aod::CentFT0Ms>;
11586

116-
struct he3Candidate {
117-
ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<double>> momentum; // 4-momentum of the He3 candidate
118-
float nSigmaTPC; // TPC nSigma for He3
119-
float dcaXY;
120-
float dcaZ;
121-
int tpcNClsFound; // Number of TPC clusters found
122-
int itsNCls; // Number of ITS clusters
123-
uint32_t itsClusterSizes; // ITS cluster sizes
124-
int8_t sign; // Charge sign of the He3 candidate
125-
};
126-
127-
struct lambdaCandidate {
128-
ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<double>> momentum;
129-
float mass; // Lambda mass
130-
float cosPA; // Cosine of pointing angle
131-
float dcaV0Daughters; // DCA between V0 daughters
132-
float dcaProtonToPV; // DCA of the proton to primary vertex
133-
float dcaPionToPV; // DCA of the pion to primary vertex
134-
float v0Radius;
135-
float protonNSigmaTPC; // Proton TPC nSigma
136-
float pionNSigmaTPC;
137-
int8_t sign; // Charge sign of the Lambda candidate
138-
};
139-
14087
struct he3LambdaAnalysis {
14188

14289
// Services
@@ -251,7 +198,8 @@ struct he3LambdaAnalysis {
251198
hArmenterosPodolanskiSelected = mRegistry.add<TH2>("hArmenterosPodolanskiSelected", "Armenteros-Podolanski Selected", {HistType::kTH2D, {{100, -1., 1.}, {100, 0., 0.5}}});
252199

253200
constexpr double ConstituentsMass = o2::constants::physics::MassProton + o2::constants::physics::MassNeutron * 2 + o2::constants::physics::MassSigmaPlus;
254-
hInvariantMass = mRegistry.add<TH2>("hInvariantMass", "Invariant Mass", {HistType::kTH2D, {{45, 1., 10}, {100, ConstituentsMass - 0.05, ConstituentsMass + 0.05}}});
201+
hInvariantMassUS = mRegistry.add<TH2>("hInvariantMassUS", "Invariant Mass", {HistType::kTH2D, {{45, 1., 10}, {100, ConstituentsMass - 0.05, ConstituentsMass + 0.05}}});
202+
hInvariantMassLS = mRegistry.add<TH2>("hInvariantMassLS", "Invariant Mass", {HistType::kTH2D, {{45, 1., 10}, {100, ConstituentsMass - 0.05, ConstituentsMass + 0.05}}});
255203

256204
LOGF(info, "He3-Lambda analysis initialized");
257205
}
@@ -439,7 +387,7 @@ struct he3LambdaAnalysis {
439387
for (const auto& he3 : he3Candidates) {
440388
for (const auto& lambda : lambdaCandidates) {
441389
auto pairMomentum = lambda.momentum + he3.momentum; // Calculate invariant mass
442-
hInvariantMass->Fill(pairMomentum.Pt(), pairMomentum.M());
390+
(he3.sign * lambda.sign > 0 ? hInvariantMassLS : hInvariantMassUS)->Fill(pairMomentum.Pt(), pairMomentum.M());
443391
}
444392
}
445393
}

PWGLF/Tasks/Nuspex/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,9 @@ o2physics_add_dpl_workflow(kink-pika
145145
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
146146
COMPONENT_NAME Analysis)
147147

148+
o2physics_add_dpl_workflow(he3-lambda-derived-analysis
149+
SOURCES he3LambdaDerivedAnalysis.cxx
150+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
151+
COMPONENT_NAME Analysis)
152+
148153
endif()
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
#include "PWGLF/DataModel/LFSlimHeLambda.h"
13+
14+
#include <Framework/AnalysisTask.h>
15+
#include <Framework/ASoAHelpers.h>
16+
#include <Framework/HistogramRegistry.h>
17+
#include <Framework/runDataProcessing.h>
18+
19+
#include <Math/Vector4D.h>
20+
21+
#include <memory>
22+
23+
namespace {
24+
std::shared_ptr<TH2> hInvariantMassUS[2];
25+
std::shared_ptr<TH2> hInvariantMassLS[2];
26+
std::shared_ptr<TH2> hRotationInvariantMassUS[2];
27+
std::shared_ptr<TH2> hRotationInvariantMassLS[2];
28+
std::shared_ptr<TH2> hRotationInvariantMassAntiLSeta[2];
29+
std::shared_ptr<TH2> hInvariantMassLambda[2];
30+
std::shared_ptr<TH2> hCosPALambda;
31+
std::shared_ptr<TH2> hNsigmaHe3;
32+
std::shared_ptr<TH2> hNsigmaProton;
33+
};
34+
35+
using namespace o2;
36+
using namespace o2::framework;
37+
using namespace o2::framework::expressions;
38+
using namespace o2::constants::physics;
39+
40+
struct he3LambdaDerivedAnalysis {
41+
HistogramRegistry mRegistry{"He3LambdaDerivedAnalysis"};
42+
43+
Configurable<int> cfgNrotations{"cfgNrotations", 7, "Number of rotations for He3 candidates"};
44+
Configurable<bool> cfgMirrorEta{"cfgMirrorEta", true, "Mirror eta for He3 candidates"};
45+
Configurable<float> cfgMinCosPA{"cfgMinCosPA", 0.99, "Minimum cosPA for Lambda candidates"};
46+
Configurable<float> cfgMaxNSigmaTPCHe3{"cfgMaxNSigmaTPCHe3", 2.0, "Maximum nSigmaTPC for He3 candidates"};
47+
Configurable<float> cfgMinLambdaPt{"cfgMinLambdaPt", 0.4, "Minimum pT for Lambda candidates"};
48+
Configurable<float> cfgMaxLambdaDeltaM{"cfgMaxLambdaDeltaM", 10.0e-3, "Maximum deltaM for Lambda candidates"};
49+
50+
void init(InitContext const&)
51+
{
52+
constexpr double ConstituentsMass = o2::constants::physics::MassProton + o2::constants::physics::MassNeutron * 2 + o2::constants::physics::MassSigmaPlus;
53+
for (int i = 0; i < 2; ++i) {
54+
hInvariantMassUS[i] = mRegistry.add<TH2>(Form("hInvariantMassUS%i",i), "Invariant Mass", {HistType::kTH2D, {{45, 1., 10}, {100, ConstituentsMass - 0.05, ConstituentsMass + 0.05}}});
55+
hInvariantMassLS[i] = mRegistry.add<TH2>(Form("hInvariantMassLS%i",i), "Invariant Mass", {HistType::kTH2D, {{45, 1., 10}, {100, ConstituentsMass - 0.05, ConstituentsMass + 0.05}}});
56+
hRotationInvariantMassUS[i] = mRegistry.add<TH2>(Form("hRotationInvariantMassUS%i",i), "Rotation Invariant Mass", {HistType::kTH2D, {{45, 1., 10}, {100, ConstituentsMass - 0.05, ConstituentsMass + 0.05}}});
57+
hRotationInvariantMassLS[i] = mRegistry.add<TH2>(Form("hRotationInvariantMassLS%i",i), "Rotation Invariant Mass", {HistType::kTH2D, {{45, 1., 10}, {100, ConstituentsMass - 0.05, ConstituentsMass + 0.05}}});
58+
hInvariantMassLambda[i] = mRegistry.add<TH2>(Form("hInvariantMassLambda%i",i), "Invariant Mass Lambda", {HistType::kTH2D, {{50, 0., 10.}, {30, o2::constants::physics::MassLambda0 - 0.015, o2::constants::physics::MassLambda0 + 0.015}}});
59+
hRotationInvariantMassAntiLSeta[i] = mRegistry.add<TH2>(Form("hRotationInvariantMassAntiLSeta%i",i), "Rotation Invariant Mass Anti-Lambda", {HistType::kTH2D, {{45, 1., 10}, {100, ConstituentsMass - 0.05, ConstituentsMass + 0.05}}});
60+
61+
}
62+
hCosPALambda = mRegistry.add<TH2>("hCosPALambda", "Cosine of Pointing Angle for Lambda", {HistType::kTH2D, {{50, 0., 10.}, {500, 0.9, 1.}}});
63+
hNsigmaHe3 = mRegistry.add<TH2>("hNsigmaHe3", "nSigma TPC for He3", {HistType::kTH2D, {{100, -10., 10.}, {200, -5, 5.}}});
64+
hNsigmaProton = mRegistry.add<TH2>("hNsigmaProton", "nSigma TPC for Proton", {HistType::kTH2D, {{100, -10., 10.}, {200, -5, 5.}}});
65+
}
66+
67+
void processSameEvent(o2::aod::LFEvents::iterator const& collision, o2::aod::LFHe3 const& he3s, o2::aod::LFLambda const& lambdas)
68+
{
69+
std::vector<he3Candidate> he3Candidates;
70+
he3Candidates.reserve(he3s.size());
71+
std::vector<lambdaCandidate> lambdaCandidates;
72+
lambdaCandidates.reserve(lambdas.size());
73+
for (const auto& he3 : he3s) {
74+
if (he3.lfEventId() != collision.globalIndex()) {
75+
std::cout << "He3 candidate does not match event index, skipping." << std::endl;
76+
return;
77+
}
78+
he3Candidate candidate;
79+
candidate.momentum = ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<double>>(he3.pt(), he3.eta(), he3.phi(), o2::constants::physics::MassHelium3);
80+
candidate.nSigmaTPC = he3.nSigmaTPC();
81+
candidate.dcaXY = he3.dcaXY();
82+
candidate.dcaZ = he3.dcaZ();
83+
candidate.tpcNClsFound = he3.tpcNCls();
84+
candidate.itsNCls = he3.itsClusterSizes();
85+
candidate.itsClusterSizes = he3.itsClusterSizes();
86+
candidate.sign = he3.sign();
87+
hNsigmaHe3->Fill(he3.pt() * he3.sign(), he3.nSigmaTPC());
88+
if (std::abs(he3.nSigmaTPC()) > cfgMaxNSigmaTPCHe3) {
89+
continue; // Skip candidates with nSigmaTPC outside range
90+
}
91+
he3Candidates.push_back(candidate);
92+
}
93+
for (const auto& lambda : lambdas) {
94+
if (lambda.lfEventId() != collision.globalIndex()) {
95+
std::cout << "Lambda candidate does not match event index, skipping." << std::endl;
96+
return;
97+
}
98+
lambdaCandidate candidate;
99+
candidate.momentum.SetCoordinates(lambda.pt(), lambda.eta(), lambda.phi(), o2::constants::physics::MassLambda0);
100+
candidate.mass = lambda.mass();
101+
candidate.cosPA = lambda.cosPA();
102+
candidate.dcaV0Daughters = lambda.dcaDaughters();
103+
hCosPALambda->Fill(lambda.pt(), candidate.cosPA);
104+
// hNsigmaProton->Fill(lambda.pt() * lambda.sign(), lambda.protonNSigmaTPC());
105+
hInvariantMassLambda[0]->Fill(lambda.pt(), lambda.mass());
106+
if (candidate.cosPA < cfgMinCosPA || lambda.pt() < cfgMinLambdaPt ||
107+
std::abs(lambda.mass() - o2::constants::physics::MassLambda0) > cfgMaxLambdaDeltaM) {
108+
continue; // Skip candidates with low cosPA
109+
}
110+
hInvariantMassLambda[1]->Fill(lambda.pt(), lambda.mass());
111+
lambdaCandidates.push_back(candidate);
112+
}
113+
114+
for (const auto& he3 : he3Candidates) {
115+
for (const auto& lambda : lambdaCandidates) {
116+
auto pairMomentum = lambda.momentum + he3.momentum; // Calculate invariant mass
117+
(he3.sign * lambda.sign > 0 ? hInvariantMassLS : hInvariantMassUS)[he3.sign > 0]->Fill(pairMomentum.Pt(), pairMomentum.M());
118+
}
119+
for (int iEta{0}; iEta <= cfgMirrorEta; ++iEta) {
120+
for (int iR{0}; iR <= cfgNrotations; ++iR) {
121+
auto he3Momentum = ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<double>>(he3.momentum.Pt(), (1. - iEta * 2.) * he3.momentum.Eta(), he3.momentum.Phi() + TMath::Pi() * (0.75 + 0.5 * iR / cfgNrotations), he3.momentum.M());
122+
for (const auto& lambda : lambdaCandidates) {
123+
auto pairMomentum = lambda.momentum + he3Momentum; // Calculate invariant mass
124+
(he3.sign * lambda.sign > 0 ? hRotationInvariantMassLS : hRotationInvariantMassUS)[he3.sign > 0]->Fill(pairMomentum.Pt(), pairMomentum.M());
125+
if (he3.sign < 0 && lambda.sign < 0) {
126+
hRotationInvariantMassAntiLSeta[iEta]->Fill(pairMomentum.Pt(), pairMomentum.M());
127+
}
128+
}
129+
}
130+
}
131+
132+
}
133+
}
134+
PROCESS_SWITCH(he3LambdaDerivedAnalysis, processSameEvent, "Process same event", true);
135+
};
136+
137+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
138+
{
139+
return WorkflowSpec{
140+
adaptAnalysisTask<he3LambdaDerivedAnalysis>(cfgc)};
141+
}

0 commit comments

Comments
 (0)