Skip to content

Commit fa620ca

Browse files
committed
format
1 parent ce8b290 commit fa620ca

File tree

4 files changed

+45
-59
lines changed

4 files changed

+45
-59
lines changed

Common/Core/FFitWeights.cxx

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
#include <TCollection.h>
2020
#include <TH1.h>
2121
#include <TH2.h>
22-
#include <TProfile.h>
2322
#include <TNamed.h>
2423
#include <TObjArray.h>
24+
#include <TProfile.h>
2525
#include <TSpline.h>
2626
#include <TString.h>
2727

@@ -77,8 +77,8 @@ void FFitWeights::init()
7777

7878
if (!ptAxis)
7979
this->setPtAxis(3000, -3, 3);
80-
//fW_data->Add(new TH2D("hPtWeight", "", centBin, 0, centBin, ptBin, ptAxis->GetXmin(), ptAxis->GetXmax()));
81-
fW_data->Add(new TProfile("pMeanPt","", centBin, 0, centBin));
80+
// fW_data->Add(new TH2D("hPtWeight", "", centBin, 0, centBin, ptBin, ptAxis->GetXmin(), ptAxis->GetXmax()));
81+
fW_data->Add(new TProfile("pMeanPt", "", centBin, 0, centBin));
8282
fW_data->Add(new TH2D("hPtWeight", "", centBin, 0, centBin, ptBin, ptAxis->GetXmin(), ptAxis->GetXmax()));
8383
};
8484

@@ -110,8 +110,7 @@ void FFitWeights::fillPt(float centrality, float pt, bool first)
110110
tp = reinterpret_cast<TProfile*>(tar->At(tar->GetEntries() - 1));
111111
}
112112
tp->Fill(centrality, pt);
113-
}
114-
else {
113+
} else {
115114
auto th2 = reinterpret_cast<TH2D*>(tar->FindObject("hPtWeight"));
116115
if (!th2) {
117116
tar->Add(new TH2D("hPtWeight", "", centBin, 0, centBin, ptBin, ptAxis->GetXmin(), ptAxis->GetXmax()));
@@ -142,9 +141,9 @@ Long64_t FFitWeights::Merge(TCollection* collist)
142141
fW_data->SetName("FFitWeights_Data");
143142
fW_data->SetOwner(kTRUE);
144143
}
145-
FFitWeights* lW= 0;
144+
FFitWeights* lW = 0;
146145
TIter allW(collist);
147-
while ((lW= (reinterpret_cast<FFitWeights*>(allW())))) {
146+
while ((lW = (reinterpret_cast<FFitWeights*>(allW())))) {
148147
addArray(fW_data, lW->getDataArray());
149148
nmerged++;
150149
}
@@ -154,7 +153,7 @@ void FFitWeights::addArray(TObjArray* targ, TObjArray* sour)
154153
{
155154
if (!sour) {
156155
// printf("Source array does not exist!\n");
157-
//LOGF(info, "FFitWeights source array does not exist!");
156+
// LOGF(info, "FFitWeights source array does not exist!");
158157
return;
159158
}
160159
for (int i = 0; i < sour->GetEntries(); i++) {
@@ -195,7 +194,6 @@ void FFitWeights::mptSel()
195194
tmpgr->SetName(Form("sp_mpt_%i", iSP));
196195
fW_data->Add(tmpgr);
197196
}
198-
199197
}
200198

201199
void FFitWeights::qSelection(const std::vector<int>& nhv, const std::vector<std::string>& stv) /* only execute OFFLINE */
@@ -210,8 +208,8 @@ void FFitWeights::qSelection(const std::vector<int>& nhv, const std::vector<std:
210208
for (const auto& nh : nhv) {
211209
TH2D* th2{reinterpret_cast<TH2D*>(tar->FindObject(this->getQName(nh, pf.c_str())))};
212210
if (!th2) {
213-
//printf("qh not found!\n");
214-
//LOGF(info, "FFitWeights qh not found!");
211+
// printf("qh not found!\n");
212+
// LOGF(info, "FFitWeights qh not found!");
215213
return;
216214
}
217215

@@ -287,4 +285,3 @@ float FFitWeights::evalPt(float centr, const float& mpt)
287285
}
288286
return ptVal;
289287
};
290-

Common/Core/FFitWeights.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ class FFitWeights : public TNamed
6767

6868
void mptSel();
6969

70-
7170
private:
7271
TObjArray* fW_data;
7372

Common/DataModel/EseTable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// or submit itself to any jurisdiction.
1111

1212
/// \file EseTable.h
13-
/// \brief ESE Framework (20/08/2024)
13+
/// \brief ESE Framework (20/08/2024)
1414
/// \author Joachim C. K. B. Hansen, Lund University, joachim.hansen@cern.ch
1515

1616
//
@@ -51,7 +51,7 @@ namespace meanptshape
5151
{
5252
DECLARE_SOA_COLUMN(FMEANPT, fMEANPT, std::vector<float>);
5353
DECLARE_SOA_COLUMN(FMEANPTSHAPE, fMEANPTSHAPE, std::vector<float>);
54-
}
54+
} // namespace meanptshape
5555
DECLARE_SOA_TABLE(MeanPts, "AOD", "MEANPT", meanptshape::FMEANPT);
5656
DECLARE_SOA_TABLE(MeanPtShapes, "AOD", "MEANPTSHAPE", meanptshape::FMEANPTSHAPE);
5757
using MeanPt = MeanPts::iterator;

Common/TableProducer/eseTableProducer.cxx

Lines changed: 34 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@
1616

1717
#include "FFitWeights.h"
1818

19+
#include "Common/Core/TrackSelection.h"
1920
#include "Common/DataModel/Centrality.h"
2021
#include "Common/DataModel/EseTable.h"
2122
#include "Common/DataModel/EventSelection.h"
2223
#include "Common/DataModel/Multiplicity.h"
2324
#include "Common/DataModel/Qvectors.h"
24-
25-
#include "Common/Core/TrackSelection.h"
2625
#include "Common/DataModel/TrackSelectionTables.h"
2726

2827
#include <CCDB/BasicCCDBManager.h>
@@ -64,7 +63,6 @@ struct EseTableProducer {
6463
Produces<o2::aod::MeanPt> meanPts;
6564
Produces<o2::aod::MeanPtShapes> meanPtShapes;
6665

67-
6866
OutputObj<FFitWeights> weightsFFit{FFitWeights("weights")};
6967
HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject, false, false};
7068

@@ -86,7 +84,6 @@ struct EseTableProducer {
8684
static constexpr int Step1{1};
8785
static constexpr int Step2{2};
8886

89-
9087
enum class DetID { FT0C,
9188
FT0A,
9289
FT0M,
@@ -108,7 +105,6 @@ struct EseTableProducer {
108105

109106
Service<o2::ccdb::BasicCCDBManager> ccdb;
110107

111-
112108
Configurable<float> cfgVtxZ{"cfgVtxZ", 10.0f, "max z vertex position"};
113109
Configurable<float> cfgEta{"cfgEta", 0.8f, "max eta"};
114110
Configurable<float> cfgPtmin{"cfgPtmin", 0.2f, "min pt"};
@@ -119,11 +115,10 @@ struct EseTableProducer {
119115

120116
o2::framework::expressions::Filter collisionFilter = nabs(aod::collision::posZ) < cfgVtxZ;
121117
o2::framework::expressions::Filter trackFilter = nabs(aod::track::eta) < cfgEta && aod::track::pt > cfgPtmin&& aod::track::pt < cfgPtmax && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == static_cast<uint8_t>(true))) && (aod::track::itsChi2NCl < cfgChi2PrITSCls) && (aod::track::tpcChi2NCl < cfgChi2PrTPCCls) && nabs(aod::track::dcaZ) < cfgDCAz;
122-
118+
123119
Preslice<aod::Tracks> perCollision = aod::track::collisionId;
124120
using GFWTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelection, aod::TracksDCA>>;
125121

126-
127122
void init(o2::framework::InitContext&)
128123
{
129124

@@ -260,17 +255,16 @@ struct EseTableProducer {
260255
}
261256
};
262257

263-
264258
template <typename TTracks, typename Cent>
265259
double calculateMeanPt(TTracks const& tracks, Cent const& centrality)
266260
{
267261
std::vector<double> meanPtEvent;
268-
for (const auto& track : tracks)
269-
{
262+
for (const auto& track : tracks) {
270263
meanPtEvent.push_back(track.pt());
271264
weightsFFit->fillPt(centrality, track.pt(), true);
272265
}
273-
if (meanPtEvent.empty()) return 0.0;
266+
if (meanPtEvent.empty())
267+
return 0.0;
274268
auto mean = std::accumulate(meanPtEvent.begin(), meanPtEvent.end(), 0.0) / meanPtEvent.size();
275269
return mean;
276270
}
@@ -306,44 +300,40 @@ struct EseTableProducer {
306300
}
307301
PROCESS_SWITCH(EseTableProducer, processESE, "process q vectors to calculate reduced q-vector", true);
308302

309-
void processMeanPt(soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::CentFT0Cs, aod::CentFT0CVariant1s, aod::CentFT0Ms, aod::CentNTPVs, aod::CentNGlobals, aod::CentMFTs>>::iterator const& collision, aod::BCsWithTimestamps const&, GFWTracks const& tracks) {
310-
311-
std::vector<float> meanPt{ -1 };
312-
std::vector<float> meanPtShape{ -1 };
313-
314-
registry.fill(HIST("hMeanPtStat"), 0.5);
315-
const auto centrality = collision.centFT0C();
316-
const auto mean = calculateMeanPt(tracks, centrality);
317-
318-
if (cfgMeanPt == 0) {
319-
registry.fill(HIST("hMeanPtStat"), 1.5);
320-
}
321-
else {
322-
const auto avgpt = eventShape->getPtMult(centrality);
323-
if (mean == 0.0) {
324-
registry.fill(HIST("hMeanPtStat"), cfgMeanPt == Step1 ? 2.5 : 3.5);
325-
}
326-
else {
327-
const auto binval = (mean - avgpt) / avgpt;
328-
weightsFFit->fillPt(centrality, binval, false);
329-
meanPt[0] = binval;
303+
void processMeanPt(soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::Mults, aod::CentFT0Cs, aod::CentFT0CVariant1s, aod::CentFT0Ms, aod::CentNTPVs, aod::CentNGlobals, aod::CentMFTs>>::iterator const& collision, aod::BCsWithTimestamps const&, GFWTracks const& tracks)
304+
{
330305

331-
if (cfgMeanPt == Step1) {
332-
registry.fill(HIST("hMeanPtStat"), 2.5);
333-
}
334-
else if (cfgMeanPt == Step2) {
335-
registry.fill(HIST("hMeanPtStat"), 3.5);
336-
const auto value = eventShape->evalPt(centrality, binval);
337-
meanPtShape[0] = value;
306+
std::vector<float> meanPt{-1};
307+
std::vector<float> meanPtShape{-1};
308+
309+
registry.fill(HIST("hMeanPtStat"), 0.5);
310+
const auto centrality = collision.centFT0C();
311+
const auto mean = calculateMeanPt(tracks, centrality);
312+
313+
if (cfgMeanPt == 0) {
314+
registry.fill(HIST("hMeanPtStat"), 1.5);
315+
} else {
316+
const auto avgpt = eventShape->getPtMult(centrality);
317+
if (mean == 0.0) {
318+
registry.fill(HIST("hMeanPtStat"), cfgMeanPt == Step1 ? 2.5 : 3.5);
319+
} else {
320+
const auto binval = (mean - avgpt) / avgpt;
321+
weightsFFit->fillPt(centrality, binval, false);
322+
meanPt[0] = binval;
323+
324+
if (cfgMeanPt == Step1) {
325+
registry.fill(HIST("hMeanPtStat"), 2.5);
326+
} else if (cfgMeanPt == Step2) {
327+
registry.fill(HIST("hMeanPtStat"), 3.5);
328+
const auto value = eventShape->evalPt(centrality, binval);
329+
meanPtShape[0] = value;
330+
}
338331
}
339332
}
340-
}
341-
342-
meanPts(meanPt);
343-
meanPtShapes(meanPtShape);
344333

334+
meanPts(meanPt);
335+
meanPtShapes(meanPtShape);
345336
}
346337
PROCESS_SWITCH(EseTableProducer, processMeanPt, "process mean pt selection", false);
347-
348338
};
349339
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask<EseTableProducer>(cfgc)}; }

0 commit comments

Comments
 (0)