Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions PWGCF/FemtoDream/Core/femtoDreamCollisionSelection.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2025 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGCF/FemtoDream/Core/femtoDreamCollisionSelection.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Provide mandatory file documentation.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -11,21 +11,21 @@

/// \file FemtoDreamCollisionSelection.h
/// \brief FemtoDreamCollisionSelection - event selection within the o2femtodream framework
/// \author Andi Mathis, TU München, andreas.mathis@ph.tum.de

Check failure on line 14 in PWGCF/FemtoDream/Core/femtoDreamCollisionSelection.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.

#ifndef PWGCF_FEMTODREAM_CORE_FEMTODREAMCOLLISIONSELECTION_H_
#define PWGCF_FEMTODREAM_CORE_FEMTODREAMCOLLISIONSELECTION_H_

#include <string>
#include <iostream>

Check failure on line 20 in PWGCF/FemtoDream/Core/femtoDreamCollisionSelection.h

View workflow job for this annotation

GitHub Actions / O2 linter

[include-iostream]

Do not include iostream. Use O2 logging instead.
#include "Common/CCDB/TriggerAliases.h"
#include "Common/DataModel/EventSelection.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/Logger.h"

using namespace o2::framework;

Check failure on line 26 in PWGCF/FemtoDream/Core/femtoDreamCollisionSelection.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.

namespace o2::analysis::femtoDream

Check failure on line 28 in PWGCF/FemtoDream/Core/femtoDreamCollisionSelection.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/namespace]

Use snake_case for names of namespaces. Double underscores are not allowed.
{

/// \class FemtoDreamCollisionSelection
Expand Down Expand Up @@ -188,22 +188,21 @@
float computeSphericity(T1 const& col, T2 const& tracks)
{
double ptTot = 0.;
double s00 = 0.; //elements of the sphericity matrix taken form EPJC72:2124
double s00 = 0.; // elements of the sphericity matrix taken form EPJC72:2124
double s01 = 0.;
double s10 = 0.;
double s11 = 0.;

int numOfTracks = col.numContrib();
if (numOfTracks < 3)

Check failure on line 197 in PWGCF/FemtoDream/Core/femtoDreamCollisionSelection.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return -9999.;


for (auto& track : tracks) {

Check failure on line 200 in PWGCF/FemtoDream/Core/femtoDreamCollisionSelection.h

View workflow job for this annotation

GitHub Actions / O2 linter

[const-ref-in-for-loop]

Use constant references for non-modified iterators in range-based for loops.
double pt = track.pt();
double eta = track.eta();
double px = track.px();
double py = track.py();
if (TMath::Abs(pt) < /*lowerPtbound*/ 0.5 || TMath::Abs(eta) > 0.8) {

Check failure on line 205 in PWGCF/FemtoDream/Core/femtoDreamCollisionSelection.h

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
continue;
}

Expand All @@ -213,22 +212,21 @@
s01 += px * py / pt;
s10 = s01;
s11 += py * py / pt;

}

//normalize to total Pt to obtain a linear form:
// normalize to total Pt to obtain a linear form:
if (ptTot == 0.)
return -9999.;
s00 /= ptTot;
s11 /= ptTot;
s10 /= ptTot;

//Calculate the trace of the sphericity matrix:
// Calculate the trace of the sphericity matrix:
double T = s00 + s11;

Check failure on line 225 in PWGCF/FemtoDream/Core/femtoDreamCollisionSelection.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
//Calculate the determinant of the sphericity matrix:
double D = s00 * s11 - s10 * s10; //S10 = S01
// Calculate the determinant of the sphericity matrix:
double D = s00 * s11 - s10 * s10; // S10 = S01

Check failure on line 227 in PWGCF/FemtoDream/Core/femtoDreamCollisionSelection.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.

//Calculate the eigenvalues of the sphericity matrix:
// Calculate the eigenvalues of the sphericity matrix:
double lambda1 = 0.5 * (T + std::sqrt(T * T - 4. * D));
double lambda2 = 0.5 * (T - std::sqrt(T * T - 4. * D));

Expand All @@ -243,7 +241,6 @@
spt = 2. * lambda2 / (lambda1 + lambda2);
}


mHistogramRegistry->fill(HIST("Event/Sphericity"), spt);

return spt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ struct femtoDreamProducerReducedTask {

colCuts.setCuts(ConfEvtZvtx.value, ConfEvtTriggerCheck.value, ConfEvtTriggerSel.value, ConfEvtOfflineCheck.value, ConfEvtAddOfflineCheck.value, ConfIsRun3.value, ConfEvtMinSphericity.value, ConfEvtSphericityPtmin.value);
colCuts.init(&qaRegistry);


trackCuts.setSelection(ConfTrkCharge, femtoDreamTrackSelection::kSign, femtoDreamSelection::kEqual);
trackCuts.setSelection(ConfTrkPtmin, femtoDreamTrackSelection::kpTMin, femtoDreamSelection::kLowerLimit);
Expand Down
1 change: 0 additions & 1 deletion PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "Common/DataModel/TrackSelectionTables.h"
#include "EventFiltering/Zorro.h"


#include "DataFormatsParameters/GRPMagField.h"
#include "DataFormatsParameters/GRPObject.h"
#include "Framework/ASoAHelpers.h"
Expand Down
Loading