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
24 changes: 18 additions & 6 deletions EventFiltering/PWGUD/DGHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,30 @@ struct DGSelector {

// no global tracks which are not vtx tracks
// no vtx tracks which are not global tracks
auto rgtrwTOF = 0.;
for (auto& track : tracks) {
if (track.isGlobalTrack() && !track.isPVContributor()) {
return 3;
}
if (diffCuts.globalTracksOnly() && !track.isGlobalTrack() && track.isPVContributor()) {
return 4;
}

// update fraction of PV tracks with TOF hit
if (track.isPVContributor() && track.hasTOF()) {
rgtrwTOF += 1.;
}
}
if (collision.numContrib() > 0) {
rgtrwTOF /= collision.numContrib();
}
if (rgtrwTOF < diffCuts.minRgtrwTOF()) {
return 5;
}

// number of vertex tracks
if (collision.numContrib() < diffCuts.minNTracks() || collision.numContrib() > diffCuts.maxNTracks()) {
return 5;
return 6;
}

// PID, pt, and eta of tracks, invariant mass, and net charge
Expand All @@ -135,18 +147,18 @@ struct DGSelector {

// PID
if (!hasGoodPID(diffCuts, track)) {
return 6;
return 7;
}

// pt
lvtmp.SetXYZM(track.px(), track.py(), track.pz(), mass2Use);
if (lvtmp.Perp() < diffCuts.minPt() || lvtmp.Perp() > diffCuts.maxPt()) {
return 7;
return 8;
}

// eta
if (lvtmp.Eta() < diffCuts.minEta() || lvtmp.Eta() > diffCuts.maxEta()) {
return 8;
return 9;
}
netCharge += track.sign();
ivm += lvtmp;
Expand All @@ -155,11 +167,11 @@ struct DGSelector {

// net charge
if (netCharge < diffCuts.minNetCharge() || netCharge > diffCuts.maxNetCharge()) {
return 9;
return 10;
}
// invariant mass
if (ivm.M() < diffCuts.minIVM() || ivm.M() > diffCuts.maxIVM()) {
return 10;
return 11;
}

// if we arrive here then the event is good!
Expand Down
21 changes: 11 additions & 10 deletions EventFiltering/PWGUD/diffractionFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,21 @@ struct DGFilterRun3 {
// 4: number of FwdTracks > 0
// 5: not all global tracks are vtx tracks
// 6: not all vtx tracks are global tracks
// 7: number of vtx tracks out of range
// 8: has not good PID information
// 9: track pt out of range
// 10: track eta out of range
// 11: net charge out of range
// 12: IVM out of range
// 7: fraction of tracks with TOF hit too low
// 8: number of vtx tracks out of range
// 9: has not good PID information
// 10: track pt out of range
// 11: track eta out of range
// 12: net charge out of range
// 13: IVM out of range
static constexpr std::string_view histNames[4] = {"aftercut2pi", "aftercut4pi", "aftercut2K", "aftercut4K"};
HistogramRegistry registry{
"registry",
{
{histNames[0].data(), "#aftercut2pi", {HistType::kTH1F, {{12, -0.5, 11.5}}}},
{histNames[1].data(), "#aftercut4pi", {HistType::kTH1F, {{12, -0.5, 11.5}}}},
{histNames[2].data(), "#aftercut2K", {HistType::kTH1F, {{12, -0.5, 11.5}}}},
{histNames[3].data(), "#aftercut4K", {HistType::kTH1F, {{12, -0.5, 11.5}}}},
{histNames[0].data(), "#aftercut2pi", {HistType::kTH1F, {{13, -0.5, 12.5}}}},
{histNames[1].data(), "#aftercut4pi", {HistType::kTH1F, {{13, -0.5, 12.5}}}},
{histNames[2].data(), "#aftercut2K", {HistType::kTH1F, {{13, -0.5, 12.5}}}},
{histNames[3].data(), "#aftercut4K", {HistType::kTH1F, {{13, -0.5, 12.5}}}},
}};

void init(InitContext&)
Expand Down
58 changes: 58 additions & 0 deletions PWGUD/Core/UDHelperFunctions.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
///
/// \brief
/// \author Paul Buehler, paul.buehler@oeaw.ac.at
/// \since 01.10.2021

#ifndef O2_ANALYSISUDHEPLER_H_
#define O2_ANALYSISUDHEPLER_H_

#include "Framework/Logger.h"
#include "CommonConstants/LHCConstants.h"
#include "Common/DataModel/EventSelection.h"

using namespace o2;
using namespace o2::framework;

// .............................................................................
// return net charge of PV tracks
template <typename TCs>
int8_t netCharge(TCs tracks)
{
int8_t nch = 0;
for (auto track : tracks) {
if (track.isPVContributor()) {
nch += track.sign();
}
}
return nch;
}

// .............................................................................
// return fraction of PV tracks with a TOF hit
template <typename TCs>
float rPVtrwTOF(TCs tracks, int nPVTracks)
{
float rpvrwTOF = 0.;
for (auto& track : tracks) {
if (track.isPVContributor() && track.hasTOF()) {
rpvrwTOF += 1.;
}
}
if (nPVTracks > 0) {
rpvrwTOF /= nPVTracks;
}
return rpvrwTOF;
}

// -----------------------------------------------------------------------------
#endif // O2_ANALYSISUDHEPLER_H_
4 changes: 3 additions & 1 deletion PWGUD/DataModel/DGCandidates.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ namespace o2::aod
namespace dgcand
{
DECLARE_SOA_COLUMN(NetCharge, netCharge, int8_t); //! Sum of track signs
DECLARE_SOA_COLUMN(RgtrwTOF, rgtrwTOF, float); //! Fraction of global tracks with TOF hit

} // namespace dgcand
DECLARE_SOA_TABLE(DGCandidates, "AOD", "DGCANDIDATES", //! Table with DG candidates
o2::soa::Index<>, bc::RunNumber, timestamp::Timestamp,
collision::PosX, collision::PosY, collision::PosZ,
collision::NumContrib, dgcand::NetCharge);
collision::NumContrib, dgcand::NetCharge, dgcand::RgtrwTOF);
using DGCandidate = DGCandidates::iterator;

namespace dgtrack
Expand Down
15 changes: 2 additions & 13 deletions PWGUD/TableProducer/DGCandProducer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,13 @@
#include "Framework/AnalysisTask.h"

#include "EventFiltering/PWGUD/DGHelpers.h"
#include "PWGUD/Core/UDHelperFunctions.h"
#include "PWGUD/DataModel/DGCandidates.h"

using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;

template <typename TCs>
int8_t netCharge(TCs tracks)
{
int8_t nch = 0;
for (auto track : tracks) {
if (track.isPVContributor()) {
nch += track.sign();
}
}
return nch;
}

struct DGCandProducer {

// get a DGCutparHolder
Expand Down Expand Up @@ -120,7 +109,7 @@ struct DGCandProducer {
// update DGCandidates tables
outputCollisions(bc.runNumber(), bc.timestamp(),
collision.posX(), collision.posY(), collision.posZ(),
collision.numContrib(), netCharge(tracks));
collision.numContrib(), netCharge(tracks), rPVtrwTOF(tracks, collision.numContrib()));

// update DGTracks tables
for (auto& track : tracks) {
Expand Down
5 changes: 5 additions & 0 deletions PWGUD/Tasks/DGCandAnalyzer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ struct DGCandAnalyzer {
return;
}

// skip events with out-of-range rgtrwTOF
if (dgcand.rgtrwTOF() < diffCuts.minRgtrwTOF()) {
return;
}

// find track combinations which are compatible with anaPars.TPCnSigmas()
auto nIVMs = pidsel.computeIVMs(anaPars.nCombine(), dgtracks);

Expand Down
Loading