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
5 changes: 3 additions & 2 deletions Common/DataModel/Multiplicity.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check warning on line 1 in Common/DataModel/Multiplicity.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 @@ -8,7 +8,7 @@
// 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.
#ifndef COMMON_DATAMODEL_MULTIPLICITY_H_

Check warning on line 11 in Common/DataModel/Multiplicity.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.

Check warning on line 11 in Common/DataModel/Multiplicity.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \brief is missing, incorrect or misplaced.

Check warning on line 11 in Common/DataModel/Multiplicity.h

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \author is missing, incorrect or misplaced.
#define COMMON_DATAMODEL_MULTIPLICITY_H_

#include "Framework/AnalysisDataModel.h"
Expand Down Expand Up @@ -47,7 +47,8 @@
[](int multPveta1) -> bool { return multPveta1 > 1; });

// forward track counters
DECLARE_SOA_COLUMN(MFTNtracks, mftNtracks, int); //!
DECLARE_SOA_COLUMN(MFTNalltracks, mftNalltracks, int); //! overall counter, uses AO2D coll assoc

Check warning on line 50 in Common/DataModel/Multiplicity.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
DECLARE_SOA_COLUMN(MFTNtracks, mftNtracks, int); //! reassigned, uses mult group software

Check warning on line 51 in Common/DataModel/Multiplicity.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.

// MC
DECLARE_SOA_COLUMN(MultMCFT0A, multMCFT0A, int); //!
Expand Down Expand Up @@ -113,7 +114,7 @@
mult::IsInelGt0<mult::MultNTracksPVeta1>,
mult::IsInelGt1<mult::MultNTracksPVeta1>);
DECLARE_SOA_TABLE(MFTMults, "AOD", "MFTMULT", //! Multiplicity with MFT
mult::MFTNtracks);
mult::MFTNalltracks, mult::MFTNtracks);
using BarrelMults = soa::Join<TrackletMults, TPCMults, PVMults>;
using Mults = soa::Join<BarrelMults, FV0Mults, FT0Mults, FDDMults, ZDCMults>;
using FT0Mult = FT0Mults::iterator;
Expand Down Expand Up @@ -193,7 +194,7 @@
DECLARE_SOA_TABLE(Mult2MCExtras, "AOD", "Mult2MCEXTRA", //! Relate reco mult entry to MC extras entry
o2::soa::Index<>, mult::MultMCExtraId);

namespace multZeq

Check warning on line 197 in Common/DataModel/Multiplicity.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.
{
DECLARE_SOA_COLUMN(MultZeqFV0A, multZeqFV0A, float); //! Multiplicity equalized for the vertex position with the FV0A detector
DECLARE_SOA_COLUMN(MultZeqFT0A, multZeqFT0A, float); //! Multiplicity equalized for the vertex position with the FT0A detector
Expand Down Expand Up @@ -257,9 +258,9 @@
{
DECLARE_SOA_INDEX_COLUMN(MultBC, multBC);
}
namespace multBC

Check warning on line 261 in Common/DataModel/Multiplicity.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.
{
DECLARE_SOA_INDEX_COLUMN(FT0Mult, ft0Mult);

Check warning on line 263 in Common/DataModel/Multiplicity.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
}

// for QA purposes
Expand Down
62 changes: 38 additions & 24 deletions Common/TableProducer/multiplicityTable.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "TableHelper.h"
#include "MetadataHelper.h"
#include "TList.h"
#include "PWGMM/Mult/DataModel/bestCollisionTable.h"

using namespace o2;
using namespace o2::framework;
Expand All @@ -49,8 +50,7 @@
static constexpr int kFDDMultZeqs = 11;
static constexpr int kPVMultZeqs = 12;
static constexpr int kMultMCExtras = 13;
static constexpr int kMFTMults = 14;
static constexpr int nTables = 15;
static constexpr int nTables = 14;

// Checking that the Zeq tables are after the normal ones
static_assert(kFV0Mults < kFV0MultZeqs);
Expand All @@ -72,10 +72,9 @@
"FT0MultZeqs", // 10
"FDDMultZeqs", // 11
"PVMultZeqs", // 12
"MultMCExtras", // 13
"MFTMults"}; // 14
"MultMCExtras"}; // 13
static const std::vector<std::string> parameterNames{"Enable"};
static const int defaultParameters[nTables][nParameters]{{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}};
static const int defaultParameters[nTables][nParameters]{{-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}};

struct MultiplicityTable {
SliceCache cache;
Expand All @@ -94,7 +93,7 @@
Produces<aod::PVMultZeqs> tablePVZeqs; // 12
Produces<aod::MultMCExtras> tableExtraMc; // 13
Produces<aod::Mult2MCExtras> tableExtraMult2MCExtras;
Produces<aod::MFTMults> mftMults; // 14
Produces<aod::MFTMults> mftMults; // Not accounted for, produced using custom process function to avoid dependencies
Produces<aod::MultsGlobal> multsGlobal; // Not accounted for, produced based on process function processGlobalTrackingCounters

// For vertex-Z corrections in calibration
Expand Down Expand Up @@ -301,8 +300,7 @@
aod::Zdcs const&,
aod::FV0As const&,
aod::FT0s const&,
aod::FDDs const&,
aod::MFTTracks const& mftTracks)
aod::FDDs const&)
{
// reserve memory
for (auto i : mEnabledTables) {
Expand Down Expand Up @@ -348,9 +346,6 @@
break;
case kMultMCExtras: // MC extra information (nothing to do in the data)
break;
case kMFTMults: // Equalized multiplicity for PV
mftMults.reserve(collisions.size());
break;
default:
LOG(fatal) << "Unknown table requested: " << i;
break;
Expand Down Expand Up @@ -592,7 +587,7 @@
} break;
case kFV0MultZeqs: // Z equalized FV0
{
if (fabs(collision.posZ()) < 15.0f && lCalibLoaded) {

Check warning on line 590 in Common/TableProducer/multiplicityTable.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
multZeqFV0A = hVtxZFV0A->Interpolate(0.0) * multFV0A / hVtxZFV0A->Interpolate(collision.posZ());
}
tableFV0Zeqs(multZeqFV0A);
Expand Down Expand Up @@ -629,19 +624,6 @@
case kMultMCExtras: // MC only (nothing to do)
{
} break;
case kMFTMults: {
// for centrality estimation with the MFT if desired
// step 1: produce proper grouping
const uint64_t collIdx = collision.globalIndex();
auto mftTracksGrouped = mftTracks.sliceBy(perCollisionMFT, collIdx);
int nTracks = 0;
for (auto& track : mftTracksGrouped) {
if (track.nClusters() >= 5) { // hardcoded on purpose to avoid trouble
nTracks++;
}
}
mftMults(nTracks);
} break;
default: // Default
{
LOG(fatal) << "Unknown table requested: " << i;
Expand Down Expand Up @@ -754,12 +736,44 @@
multsGlobal(nGlobalTracks, multNContribsEta08_kGlobalTrackWoDCA, multNContribsEta10_kGlobalTrackWoDCA, multNContribsEta05_kGlobalTrackWoDCA);
}

void processRun3MFT(soa::Join<aod::Collisions, aod::EvSels>::iterator const&,
o2::aod::MFTTracks const& mftTracks,
soa::SmallGroups<aod::BestCollisionsFwd> const& retracks)
{
int nAllTracks = 0;
int nTracks = 0;

for (auto& track : mftTracks) {
if (track.nClusters() >= 5) { // hardcoded for now
nAllTracks++;
}
}

if (retracks.size() > 0) {
for (auto& retrack : retracks) {
auto track = retrack.mfttrack();
if (track.nClusters() < 5) {
continue; // min cluster requirement
}
if ((track.eta() > -2.0f) && (track.eta() < -3.9f)) {
continue; // too far to be of true interest
}
if (std::abs(retrack.bestDCAXY()) > 2.0f) {
continue; // does not point to PV properly
}
nTracks++;
}
}
mftMults(nAllTracks, nTracks);
}

// Process switches
PROCESS_SWITCH(MultiplicityTable, processRun2, "Produce Run 2 multiplicity tables", false);
PROCESS_SWITCH(MultiplicityTable, processRun3, "Produce Run 3 multiplicity tables", true);
PROCESS_SWITCH(MultiplicityTable, processGlobalTrackingCounters, "Produce Run 3 global counters", false);
PROCESS_SWITCH(MultiplicityTable, processMC, "Produce MC multiplicity tables", false);
PROCESS_SWITCH(MultiplicityTable, processMC2Mults, "Produce MC -> Mult map", false);
PROCESS_SWITCH(MultiplicityTable, processRun3MFT, "Produce MFT mult tables", false);
};

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
Expand Down
Loading