Skip to content

Commit 66f7106

Browse files
authored
Merge pull request #1 from alibuild/alibot-cleanup-14763
Please consider the following formatting changes to #14763
2 parents f29788b + a51e81a commit 66f7106

File tree

1 file changed

+54
-43
lines changed

1 file changed

+54
-43
lines changed

PWGHF/HFL/Tasks/taskSingleElectron.cxx

Lines changed: 54 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ using namespace o2::constants::physics;
4242
using namespace o2::framework;
4343
using namespace o2::framework::expressions;
4444

45-
enum PdgCode { kEta = 221, kOmega = 223, kEtaPrime = 331 };
45+
enum PdgCode { kEta = 221,
46+
kOmega = 223,
47+
kEtaPrime = 331 };
4648

4749
enum SourceType {
4850
NotElec = 0, // not electron
@@ -88,8 +90,8 @@ struct HfTaskSingleElectron {
8890
Configurable<int> tpcNCrossedRowMin{"tpcNCrossedRowMin", 70,
8991
"max of TPC n cluster crossed rows"};
9092
Configurable<float> tpcNClsFoundOverFindableMin{
91-
"tpcNClsFoundOverFindableMin", 0.8,
92-
"min # of TPC found/findable clusters"};
93+
"tpcNClsFoundOverFindableMin", 0.8,
94+
"min # of TPC found/findable clusters"};
9395
Configurable<float> tpcChi2perNClMax{"tpcChi2perNClMax", 4.,
9496
"min # of tpc chi2 per clusters"};
9597
Configurable<int> itsIBClsMin{"itsIBClsMin", 3,
@@ -117,12 +119,12 @@ struct HfTaskSingleElectron {
117119
// using declarations
118120
using MyCollisions = soa::Join<aod::Collisions, aod::EvSels>;
119121
using TracksEl =
120-
soa::Join<aod::Tracks, aod::TrackSelection, aod::TrackSelectionExtension,
121-
aod::TracksExtra, aod::TracksDCA, aod::pidTOFFullEl,
122-
aod::pidTPCFullEl>;
122+
soa::Join<aod::Tracks, aod::TrackSelection, aod::TrackSelectionExtension,
123+
aod::TracksExtra, aod::TracksDCA, aod::pidTOFFullEl,
124+
aod::pidTPCFullEl>;
123125
using McTracksEl =
124-
soa::Join<aod::Tracks, aod::TrackExtra, aod::TracksDCA, aod::pidTOFFullEl,
125-
aod::pidTPCFullEl, aod::McTrackLabels>;
126+
soa::Join<aod::Tracks, aod::TrackExtra, aod::TracksDCA, aod::pidTOFFullEl,
127+
aod::pidTPCFullEl, aod::McTrackLabels>;
126128

127129
// Filter
128130
Filter collZFilter = nabs(aod::collision::posZ) < posZMax;
@@ -131,17 +133,20 @@ struct HfTaskSingleElectron {
131133

132134
// ConfigurableAxis
133135
ConfigurableAxis axisPtEl{
134-
"axisPtEl",
135-
{VARIABLE_WIDTH, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.f, 1.1f,
136-
1.2f, 1.3f, 1.4f, 1.5f, 1.75f, 2.0f, 2.25f, 2.5f,
137-
2.75f, 3.f, 3.5f, 4.0f, 5.0f, 6.0f, 8.0f, 10.0f},
138-
"electron pt bins"};
136+
"axisPtEl",
137+
{VARIABLE_WIDTH, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.f, 1.1f,
138+
1.2f, 1.3f, 1.4f, 1.5f, 1.75f, 2.0f, 2.25f, 2.5f,
139+
2.75f, 3.f, 3.5f, 4.0f, 5.0f, 6.0f, 8.0f, 10.0f},
140+
"electron pt bins"};
139141

140142
// Histogram registry
141143
HistogramRegistry histos{
142-
"histos", {}, OutputObjHandlingPolicy::AnalysisObject};
144+
"histos",
145+
{},
146+
OutputObjHandlingPolicy::AnalysisObject};
143147

144-
void init(InitContext const &) {
148+
void init(InitContext const&)
149+
{
145150
// AxisSpec
146151
const AxisSpec axisEvt{4, 0., 4., "nEvents"};
147152
const AxisSpec axisNCont{100, 0., 100., "nCont"};
@@ -194,7 +199,9 @@ struct HfTaskSingleElectron {
194199
histos.add("hPdgCo", "", kTH1D, {{10001, -0.5, 10000.5}});
195200
}
196201

197-
template <typename TrackType> bool trackSel(const TrackType &track) {
202+
template <typename TrackType>
203+
bool trackSel(const TrackType& track)
204+
{
198205
if ((track.pt() > ptTrackMax) || (track.pt() < ptTrackMin)) {
199206
return false;
200207
}
@@ -234,7 +241,8 @@ struct HfTaskSingleElectron {
234241
}
235242

236243
template <typename TrackType>
237-
int getElecSource(const TrackType &track, double &mpt, int &mpdg) {
244+
int getElecSource(const TrackType& track, double& mpt, int& mpdg)
245+
{
238246
auto mcpart = track.mcParticle();
239247
if (std::abs(mcpart.pdgCode()) != kElectron) {
240248
return NotElec;
@@ -248,15 +256,15 @@ struct HfTaskSingleElectron {
248256
int ggrmotherPt = -999.; // mother, grand mother, grand grand mother pt
249257

250258
auto partMother =
251-
mcpart.template mothers_as<aod::McParticles>(); // first mother particle
252-
// of electron
253-
auto partMotherCopy = partMother; // copy of the first mother
254-
auto mctrack = partMother; // will change all the time
259+
mcpart.template mothers_as<aod::McParticles>(); // first mother particle
260+
// of electron
261+
auto partMotherCopy = partMother; // copy of the first mother
262+
auto mctrack = partMother; // will change all the time
255263

256264
motherPt = partMother.front().pt(); // first mother pt
257265
motherPdg = std::abs(partMother.front().pdgCode()); // first mother pdg
258-
mpt = motherPt; // copy of first mother pt
259-
mpdg = motherPdg; // copy of first mother pdg
266+
mpt = motherPt; // copy of first mother pt
267+
mpdg = motherPdg; // copy of first mother pdg
260268

261269
// check if electron from charm hadrons
262270
if ((static_cast<int>(motherPdg / 100.) % 10) == kCharm ||
@@ -266,7 +274,7 @@ struct HfTaskSingleElectron {
266274
while (partMother.size()) {
267275
mctrack = partMother.front().template mothers_as<aod::McParticles>();
268276
if (mctrack.size()) {
269-
auto const &grmothersIdsVec = mctrack.front().mothersIds();
277+
auto const& grmothersIdsVec = mctrack.front().mothersIds();
270278

271279
if (grmothersIdsVec.empty()) {
272280
return DirectCharm;
@@ -284,13 +292,13 @@ struct HfTaskSingleElectron {
284292
}
285293
} else if ((static_cast<int>(motherPdg / 100.) % 10) == kBottom ||
286294
(static_cast<int>(motherPdg / 1000.) % 10) ==
287-
kBottom) { // check if electron from beauty hadrons
295+
kBottom) { // check if electron from beauty hadrons
288296
return DirectBeauty;
289297
} else if (motherPdg ==
290298
kGamma) { // check if electron from photon conversion
291299
mctrack = partMother.front().template mothers_as<aod::McParticles>();
292300
if (mctrack.size()) {
293-
auto const &grmothersIdsVec = mctrack.front().mothersIds();
301+
auto const& grmothersIdsVec = mctrack.front().mothersIds();
294302
if (grmothersIdsVec.empty()) {
295303
return DirectGamma;
296304
}
@@ -301,7 +309,7 @@ struct HfTaskSingleElectron {
301309
partMother = mctrack;
302310
mctrack = partMother.front().template mothers_as<aod::McParticles>();
303311
if (mctrack.size()) {
304-
auto const &ggrmothersIdsVec = mctrack.front().mothersIds();
312+
auto const& ggrmothersIdsVec = mctrack.front().mothersIds();
305313
if (ggrmothersIdsVec.empty()) {
306314
if (grmotherPdg == kPi0) {
307315
return GammaPi0;
@@ -378,17 +386,17 @@ struct HfTaskSingleElectron {
378386
} else { // check if electron from Dalitz decays
379387
mctrack = partMother.front().template mothers_as<aod::McParticles>();
380388
if (mctrack.size()) {
381-
auto const &grmothersIdsVec = mctrack.front().mothersIds();
389+
auto const& grmothersIdsVec = mctrack.front().mothersIds();
382390
if (grmothersIdsVec.empty()) {
383391
static const std::map<int, SourceType> pdgToSource = {
384-
{kPi0, Pi0},
385-
{PdgCode::kEta, Eta},
386-
{PdgCode::kOmega, Omega},
387-
{kPhi, Phi},
388-
{PdgCode::kEtaPrime, EtaPrime},
389-
{kRho770_0, Rho0},
390-
{kKPlus, Ke3},
391-
{kK0Long, K0l}};
392+
{kPi0, Pi0},
393+
{PdgCode::kEta, Eta},
394+
{PdgCode::kOmega, Omega},
395+
{kPhi, Phi},
396+
{PdgCode::kEtaPrime, EtaPrime},
397+
{kRho770_0, Rho0},
398+
{kKPlus, Ke3},
399+
{kK0Long, K0l}};
392400

393401
auto it = pdgToSource.find(motherPdg);
394402
if (it != pdgToSource.end()) {
@@ -448,8 +456,9 @@ struct HfTaskSingleElectron {
448456
return Else;
449457
}
450458

451-
void processData(soa::Filtered<MyCollisions>::iterator const &collision,
452-
TracksEl const &tracks) {
459+
void processData(soa::Filtered<MyCollisions>::iterator const& collision,
460+
TracksEl const& tracks)
461+
{
453462
float const flagAnalysedEvt = 0.5;
454463

455464
if (!collision.sel8()) {
@@ -463,7 +472,7 @@ struct HfTaskSingleElectron {
463472
histos.fill(HIST("VtxZ"), collision.posZ());
464473
histos.fill(HIST("nEvents"), flagAnalysedEvt);
465474

466-
for (const auto &track : tracks) {
475+
for (const auto& track : tracks) {
467476

468477
if (!trackSel(track)) {
469478
continue;
@@ -515,8 +524,9 @@ struct HfTaskSingleElectron {
515524
}
516525
PROCESS_SWITCH(HfTaskSingleElectron, processData, "For real data", true);
517526

518-
void processMc(soa::Filtered<MyCollisions>::iterator const &collision,
519-
McTracksEl const &tracks, aod::McParticles const &) {
527+
void processMc(soa::Filtered<MyCollisions>::iterator const& collision,
528+
McTracksEl const& tracks, aod::McParticles const&)
529+
{
520530
float const flagAnalysedEvt = 0.5;
521531

522532
if (!collision.sel8()) {
@@ -530,7 +540,7 @@ struct HfTaskSingleElectron {
530540
histos.fill(HIST("VtxZ"), collision.posZ());
531541
histos.fill(HIST("nEvents"), flagAnalysedEvt);
532542

533-
for (const auto &track : tracks) {
543+
for (const auto& track : tracks) {
534544

535545
if (!trackSel(track)) {
536546
continue;
@@ -597,6 +607,7 @@ struct HfTaskSingleElectron {
597607
PROCESS_SWITCH(HfTaskSingleElectron, processMc, "For real data", false);
598608
};
599609

600-
WorkflowSpec defineDataProcessing(ConfigContext const &cfgc) {
610+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
611+
{
601612
return WorkflowSpec{adaptAnalysisTask<HfTaskSingleElectron>(cfgc)};
602613
}

0 commit comments

Comments
 (0)