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
69 changes: 66 additions & 3 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 All @@ -41,7 +41,7 @@
/// \param checkTrigger whether or not to check for the trigger alias
/// \param trig Requested trigger alias
/// \param checkOffline whether or not to check for offline selection criteria
void setCuts(float zvtxMax, bool checkTrigger, int trig, bool checkOffline, bool addCheckOffline, bool checkRun3)
void setCuts(float zvtxMax, bool checkTrigger, int trig, bool checkOffline, bool addCheckOffline, bool checkRun3, float minSphericity, float sphericityPtmin)
{
mCutsSet = true;
mZvtxMax = zvtxMax;
Expand All @@ -50,6 +50,8 @@
mCheckOffline = checkOffline;
mAddCheckOffline = addCheckOffline;
mCheckIsRun3 = checkRun3;
mMinSphericity = minSphericity;
mSphericityPtmin = sphericityPtmin;
}

/// Initializes histograms for the task
Expand All @@ -66,6 +68,7 @@
mHistogramRegistry->add("Event/MultNTracksPV", "; MultNTracksPV; Entries", kTH1F, {{200, 0, 200}});
mHistogramRegistry->add("Event/MultNTracklets", "; MultNTrackslets; Entries", kTH1F, {{300, 0, 300}});
mHistogramRegistry->add("Event/MultTPC", "; MultTPC; Entries", kTH1F, {{600, 0, 600}});
mHistogramRegistry->add("Event/Sphericity", "; Sphericity; Entries", kTH1F, {{100, 0, 1}});
}

/// Print some debug information
Expand All @@ -76,6 +79,8 @@
LOG(info) << "Check trigger: " << mCheckTrigger;
LOG(info) << "Trigger: " << mTrigger;
LOG(info) << " Check offline: " << mCheckOffline;
LOG(info) << "Min sphericity: " << mMinSphericity;
LOG(info) << "Min Pt (sphericity): " << mSphericityPtmin;
}

/// Check whether the collisions fulfills the specified selections
Expand Down Expand Up @@ -180,9 +185,65 @@
/// \param tracks All tracks
/// \return value of the sphericity of the event
template <typename T1, typename T2>
float computeSphericity(T1 const& /*col*/, T2 const& /*tracks*/)
float computeSphericity(T1 const& col, T2 const& tracks)
{
return 2.f;
double ptTot = 0.;
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 const& track : tracks) {
double pt = track.pt();
double eta = track.eta();
double px = track.px();
double py = track.py();
if (TMath::Abs(pt) < mSphericityPtmin || 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

[magic-number]

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

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;
}

ptTot += pt;

s00 += px * px / pt;
s01 += px * py / pt;
// s10 = s01;
s11 += py * py / pt;
}

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

// 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 - s01 * s01; // 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:
double lambda1 = 0.5 * (T + std::sqrt(T * T - 4. * D));
double lambda2 = 0.5 * (T - std::sqrt(T * T - 4. * D));

if ((lambda1 + lambda2) == 0.)
return -9999.;

double spt = -1.;

if (lambda2 > lambda1) {
spt = 2. * lambda1 / (lambda1 + lambda2);
} else {
spt = 2. * lambda2 / (lambda1 + lambda2);
}

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

return spt;
}

private:
Expand All @@ -194,6 +255,8 @@
bool mCheckIsRun3 = false; ///< Check if running on Pilot Beam
triggerAliases mTrigger = kINT7; ///< Trigger to check for
float mZvtxMax = 999.f; ///< Maximal deviation from nominal z-vertex (cm)
float mMinSphericity = 0.f;
float mSphericityPtmin = 0.f;
};
} // namespace o2::analysis::femtoDream

Expand Down
5 changes: 0 additions & 5 deletions PWGCF/FemtoDream/TableProducer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ o2physics_add_dpl_workflow(femtodream-producer
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::EventFilteringUtils
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(femtodream-producer-withcascades
SOURCES femtoDreamProducerTaskWithCascades.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::EventFilteringUtils
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(femtodream-producer-reduced
SOURCES femtoDreamProducerReducedTask.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ struct femtoDreamProducerReducedTask {
Configurable<int> ConfEvtTriggerSel{"ConfEvtTriggerSel", kINT7, "Evt sel: trigger"};
Configurable<bool> ConfEvtOfflineCheck{"ConfEvtOfflineCheck", false, "Evt sel: check for offline selection"};
Configurable<bool> ConfEvtAddOfflineCheck{"ConfEvtAddOfflineCheck", false, "Evt sel: additional checks for offline selection (not part of sel8 yet)"};
Configurable<float> ConfEvtMinSphericity{"ConfEvtMinSphericity", 0.0f, "Evt sel: Min. sphericity of event"};
Configurable<float> ConfEvtSphericityPtmin{"ConfEvtSphericityPtmin", 0.0f, "Evt sel: Min. Pt for sphericity calculation"};

Configurable<bool> ConfTrkRejectNotPropagated{"ConfTrkRejectNotPropagated", false, "True: reject not propagated tracks"};

Expand Down Expand Up @@ -116,7 +118,7 @@ struct femtoDreamProducerReducedTask {
int CutBits = 8 * sizeof(o2::aod::femtodreamparticle::cutContainerType);
Registry.add("AnalysisQA/CutCounter", "; Bit; Counter", kTH1F, {{CutBits + 1, -0.5, CutBits + 0.5}});

colCuts.setCuts(ConfEvtZvtx.value, ConfEvtTriggerCheck.value, ConfEvtTriggerSel.value, ConfEvtOfflineCheck.value, ConfEvtAddOfflineCheck.value, ConfIsRun3.value);
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);
Expand Down
4 changes: 3 additions & 1 deletion PWGCF/FemtoDream/TableProducer/femtoDreamProducerTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ struct femtoDreamProducerTask {
Configurable<bool> ConfEvtAddOfflineCheck{"ConfEvtAddOfflineCheck", false, "Evt sel: additional checks for offline selection (not part of sel8 yet)"};
Configurable<bool> ConfIsActivateV0{"ConfIsActivateV0", true, "Activate filling of V0 into femtodream tables"};
Configurable<bool> ConfIsActivateReso{"ConfIsActivateReso", false, "Activate filling of sl Resonances into femtodream tables"};
Configurable<float> ConfEvtMinSphericity{"ConfEvtMinSphericity", 0.0f, "Evt sel: Min. sphericity of event"};
Configurable<float> ConfEvtSphericityPtmin{"ConfEvtSphericityPtmin", 0.0f, "Evt sel: Min. Pt for sphericity calculation"};

Configurable<bool> ConfTrkRejectNotPropagated{"ConfTrkRejectNotPropagated", false, "True: reject not propagated tracks"};
// Configurable<bool> ConfRejectITSHitandTOFMissing{ "ConfRejectITSHitandTOFMissing", false, "True: reject if neither ITS hit nor TOF timing satisfied"};
Expand Down Expand Up @@ -270,7 +272,7 @@ struct femtoDreamProducerTask {

rctChecker.init(rctCut.cfgEvtRCTFlagCheckerLabel, false, rctCut.cfgEvtRCTFlagCheckerLimitAcceptAsBad);

colCuts.setCuts(ConfEvtZvtx.value, ConfEvtTriggerCheck.value, ConfEvtTriggerSel.value, ConfEvtOfflineCheck.value, ConfEvtAddOfflineCheck.value, ConfIsRun3.value);
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);
Expand Down
Loading
Loading