Skip to content

Commit 60b0dc7

Browse files
committed
femtoflow checked via o2 linter
1 parent 6dcee52 commit 60b0dc7

16 files changed

+404
-1086
lines changed

PWGCF/Femto/Core/FemtoFlowAngularContainer.h

Lines changed: 37 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,24 @@
2121
#define PWGCF_FEMTOFLOW_CORE_FEMTOFLOWANGULARCONTAINER_H_
2222

2323
#include "PWGCF/Femto/Core/FemtoFlowMath.h"
24+
#include "PWGCF/Femto/DataModel/FemtoDerived.h"
2425

2526
#include "Common/Core/RecoDecay.h"
2627

2728
#include "Framework/HistogramRegistry.h"
2829

2930
#include "Math/Vector4D.h"
30-
#include "TDatabasePDG.h"
31+
#include "Framework/ASoAHelpers.h"
32+
#include "Framework/O2DatabasePDGPlugin.h"
33+
#include "Framework/AnalysisTask.h"
34+
3135
#include "TMath.h"
3236

3337
#include <fairlogger/Logger.h>
3438

3539
#include <string>
3640
#include <vector>
3741

38-
using namespace o2::framework;
39-
4042
namespace o2::analysis::femto_flow
4143
{
4244

@@ -77,6 +79,8 @@ class FemtoFlowAngularContainer
7779
template <typename T>
7880
void initBase(std::string folderName, std::string /*femtoObs*/, T /*femtoObsAxis*/, T /*multAxis*/, T /*kTAxis*/, T /*mTAxis*/, T /*multAxis3D*/, T /*mTAxis3D*/, T etaAxis, T phiAxis, bool use3dplots)
7981
{
82+
using namespace o2::framework;
83+
8084
mHistogramRegistry->add((folderName + "/DeltaEtaDeltaPhi").c_str(), "; #Delta#varphi (rad); #Delta#eta", kTH2F, {phiAxis, etaAxis});
8185
if (use3dplots) {
8286
// use 3d plots
@@ -106,28 +110,30 @@ class FemtoFlowAngularContainer
106110
/// \param phiBins phi binning for the histograms
107111
/// \param isMC add Monte Carlo truth histograms to the output file
108112
template <typename T, typename P>
109-
void init(HistogramRegistry* registry, T& kstarBins, T& multBins, T& kTBins, T& mTBins, T& multBins3D, T& mTBins3D, P& etaBins, P& phiBins, bool isMC, bool use3dplots)
113+
void init(o2::framework::HistogramRegistry* registry, T& kstarBins, T& multBins, T& kTBins, T& mTBins, T& multBins3D, T& mTBins3D, P& etaBins, P& phiBins, bool isMC, bool use3dplots)
110114
{
115+
using namespace o2::framework;
116+
111117
mHistogramRegistry = registry;
112118
std::string femtoObs;
113119
if constexpr (FemtoObs == femto_flow_angular_container::Observable::kstar) {
114120
femtoObs = "#it{k*} (GeV/#it{c})";
115121
}
116122

117123
std::vector<double> tmpVecMult = multBins;
118-
framework::AxisSpec multAxis = {tmpVecMult, "Multiplicity"};
119-
framework::AxisSpec femtoObsAxis = {kstarBins, femtoObs.c_str()};
120-
framework::AxisSpec kTAxis = {kTBins, "#it{k}_{T} (GeV/#it{c})"};
121-
framework::AxisSpec mTAxis = {mTBins, "#it{m}_{T} (GeV/#it{c}^{2})"};
124+
o2::framework::AxisSpec multAxis = {tmpVecMult, "Multiplicity"};
125+
o2::framework::AxisSpec femtoObsAxis = {kstarBins, femtoObs.c_str()};
126+
o2::framework::AxisSpec kTAxis = {kTBins, "#it{k}_{T} (GeV/#it{c})"};
127+
o2::framework::AxisSpec mTAxis = {mTBins, "#it{m}_{T} (GeV/#it{c}^{2})"};
122128

123-
framework::AxisSpec multAxis3D = {multBins3D, "Multiplicity"};
124-
framework::AxisSpec mTAxis3D = {mTBins3D, "#it{m}_{T} (GeV/#it{c})"};
129+
o2::framework::AxisSpec multAxis3D = {multBins3D, "Multiplicity"};
130+
o2::framework::AxisSpec mTAxis3D = {mTBins3D, "#it{m}_{T} (GeV/#it{c})"};
125131

126132
// angular correlations
127133
mPhiLow = (-static_cast<int>(phiBins / 4) + 0.5) * o2::constants::math::TwoPI / phiBins;
128134
mPhiHigh = o2::constants::math::TwoPI + (-static_cast<int>(phiBins / 4) + 0.5) * o2::constants::math::TwoPI / phiBins;
129-
framework::AxisSpec phiAxis = {phiBins, mPhiLow, mPhiHigh};
130-
framework::AxisSpec etaAxis = {etaBins, -2.0, 2.0};
135+
o2::framework::AxisSpec phiAxis = {phiBins, mPhiLow, mPhiHigh};
136+
o2::framework::AxisSpec etaAxis = {etaBins, -2.0, 2.0};
131137

132138
std::string folderName = static_cast<std::string>(FolderSuffix[EventType]) + static_cast<std::string>(o2::aod::femtoflow_mc_particle::MCTypeName[o2::aod::femtoflow_mc_particle::MCType::kRecon]);
133139

@@ -140,16 +146,18 @@ class FemtoFlowAngularContainer
140146
}
141147

142148
/// Set the PDG codes of the two particles involved
143-
/// \param pdg1 PDG code of particle one
149+
/// \param PDG code of particle one
144150
/// \param pdg2 PDG code of particle two
145-
void setPDGCodes(const int pdg1, const int pdg2)
151+
void setPDGCodesMass(const int pdg1, const int pdg2, const double mass1, const int mass2)
146152
{
147-
mMassOne = TDatabasePDG::Instance()->GetParticle(pdg1)->Mass();
148-
mMassTwo = TDatabasePDG::Instance()->GetParticle(pdg2)->Mass();
153+
mMassOne = mass1;
154+
mMassTwo = mass2;
149155
mPDGOne = pdg1;
150156
mPDGTwo = pdg2;
151157
}
152158

159+
160+
153161
/// Pass a pair to the container and compute all the relevant observables
154162
/// Called by setPair both in case of data/ and Monte Carlo reconstructed and for Monte Carlo truth
155163
/// \tparam T type of the femtoflowparticle
@@ -159,16 +167,20 @@ class FemtoFlowAngularContainer
159167
template <o2::aod::femtoflow_mc_particle::MCType mc, typename T>
160168
void setPairBase(const float /*femtoObs*/, const float /*mT*/, T const& part1, T const& part2, const int /*mult*/, bool use3dplots, float weight = 1.0f)
161169
{
170+
using namespace o2::framework;
171+
162172
deltaEta = part1.eta() - part2.eta();
163173

164174
deltaPhi = part1.phi() - part2.phi();
165175

166-
while (deltaPhi < mPhiLow) {
167-
deltaPhi += o2::constants::math::TwoPI;
168-
}
169-
while (deltaPhi > mPhiHigh) {
170-
deltaPhi -= o2::constants::math::TwoPI;
171-
}
176+
deltaPhi = RecoDecay::constrainAngle(deltaPhi, mPhiLow, 1);
177+
178+
// while (deltaPhi < mPhiLow) {
179+
// deltaPhi += o2::constants::math::TwoPI;
180+
// }
181+
// while (deltaPhi > mPhiHigh) {
182+
// deltaPhi -= o2::constants::math::TwoPI;
183+
// }
172184

173185
mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtoflow_mc_particle::MCTypeName[mc]) + HIST("/DeltaEtaDeltaPhi"), deltaPhi, deltaEta, weight);
174186
if (use3dplots) {
@@ -201,6 +213,8 @@ class FemtoFlowAngularContainer
201213
template <bool isMC, typename T>
202214
void setPair(T const& part1, T const& part2, const int mult, bool use3dplots, float weight = 1.0f)
203215
{
216+
using namespace o2::framework;
217+
204218
float femtoObs, femtoObsMC;
205219
// Calculate femto observable and the mT with reconstructed information
206220
if constexpr (FemtoObs == femto_flow_angular_container::Observable::kstar) {
@@ -232,7 +246,7 @@ class FemtoFlowAngularContainer
232246
}
233247

234248
protected:
235-
HistogramRegistry* mHistogramRegistry = nullptr; ///< For QA output
249+
o2::framework::HistogramRegistry* mHistogramRegistry = nullptr; ///< For QA output
236250
static constexpr std::string_view FolderSuffix[2] = {"SameEvent", "MixedEvent"}; ///< Folder naming for the output according to EventType
237251
static constexpr femto_flow_angular_container::Observable FemtoObs = obs; ///< Femtoscopic observable to be computed (according to femto_flow_angular_container::Observable)
238252
static constexpr int EventType = eventType; ///< Type of the event (same/mixed, according to femto_flow_angular_container::EventType)

0 commit comments

Comments
 (0)