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
19 changes: 19 additions & 0 deletions PWGLF/DataModel/LFEbyeTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
DECLARE_SOA_COLUMN(Zvtx, zvtx, float);
DECLARE_SOA_COLUMN(ZvtxMask, zvtxMask, int8_t);
DECLARE_SOA_COLUMN(TriggerMask, triggerMask, uint8_t);
DECLARE_SOA_COLUMN(CBMultiplicity, cbMultiplicity, uint8_t);

Check failure on line 28 in PWGLF/DataModel/LFEbyeTables.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(Ntracks, ntracks, uint8_t);
} // namespace LFEbyeCollTable

Expand Down Expand Up @@ -55,11 +55,11 @@
DECLARE_SOA_COLUMN(TpcNcls, tpcNcls, uint8_t);
DECLARE_SOA_COLUMN(TpcNsigma, tpcNsigma, float);
DECLARE_SOA_COLUMN(TofMass, tofMass, float);
DECLARE_SOA_COLUMN(DcaV0PV, dcaV0Pv, float);

Check failure on line 58 in PWGLF/DataModel/LFEbyeTables.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(DcaNegPV, dcaNegPv, float);

Check failure on line 59 in PWGLF/DataModel/LFEbyeTables.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(DcaPosPV, dcaPosPv, float);

Check failure on line 60 in PWGLF/DataModel/LFEbyeTables.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(DcaV0Tracks, dcaV0tracks, float);

Check failure on line 61 in PWGLF/DataModel/LFEbyeTables.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(CosPA, cosPa, double);

Check failure on line 62 in PWGLF/DataModel/LFEbyeTables.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(TpcNsigmaNeg, tpcNsigmaNeg, float);
DECLARE_SOA_COLUMN(TpcNsigmaPos, tpcNsigmaPos, float);
DECLARE_SOA_COLUMN(IdNeg, idNeg, int64_t);
Expand Down Expand Up @@ -160,6 +160,25 @@
LFEbyeTable::GenEtaMask,
LFEbyeTable::IsReco);
using McMiniTrkTable = McMiniTrkTables::iterator;

DECLARE_SOA_TABLE(MiniChTables, "AOD", "MINICHTABLE",
o2::soa::Index<>,
LFEbyeTable::MiniCollTableId,
LFEbyeTable::Pt,
LFEbyeTable::EtaMask,
LFEbyeTable::SelMask);
using MiniChTable = MiniChTables::iterator;

DECLARE_SOA_TABLE(McMiniChTables, "AOD", "MCMINICHTABLE",
o2::soa::Index<>,
LFEbyeTable::MiniCollTableId,
LFEbyeTable::Pt,
LFEbyeTable::EtaMask,
LFEbyeTable::SelMask,
LFEbyeTable::GenPt,
LFEbyeTable::GenEtaMask,
LFEbyeTable::IsReco);
using McMiniChTable = McMiniChTables::iterator;
} // namespace o2::aod

#endif // PWGLF_DATAMODEL_LFEBYETABLES_H_
47 changes: 30 additions & 17 deletions PWGLF/TableProducer/Nuspex/ebyeMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -214,19 +214,21 @@
Produces<aod::McNucleiEbyeTable> mcNucleiEbyeTable;
Produces<aod::McLambdaEbyeTable> mcLambdaEbyeTable;
Produces<aod::McMiniTrkTable> mcMiniTrkTable;
Produces<aod::MiniChTable> miniChTable;
Produces<aod::McMiniChTable> mcMiniChTable;
std::mt19937 gen32;
std::vector<CandidateV0> candidateV0s;
std::array<std::vector<CandidateTrack>, 2> candidateTracks;
Service<o2::ccdb::BasicCCDBManager> ccdb;
o2::vertexing::DCAFitterN<2> fitter;
std::vector<int> classIds;

int mRunNumber;
float dBz;
uint8_t nTrackletsColl;
uint8_t nTracksColl;
uint8_t nChPartGen;
int nTracksCollFull;
int mRunNumber{-999};
float dBz{-999.f};
uint8_t nTrackletsColl{0u};
uint8_t nTracksColl{0u};
uint8_t nChPartGen{0u};
int nTracksCollFull{-999};

Configurable<int> cfgMaterialCorrection{"cfgMaterialCorrection", static_cast<int>(o2::base::Propagator::MatCorrType::USEMatCorrNONE), "Type of material correction"};
Configurable<LabeledArray<double>> cfgBetheBlochParams{"cfgBetheBlochParams", {kBetheBlochDefault[0], 2, 6, particleNamesPar, betheBlochParNames}, "TPC Bethe-Bloch parameterisation for deuteron"};
Expand All @@ -244,7 +246,7 @@
ConfigurableAxis massLambdaAxis{"massLambdaAxis", {400, o2::constants::physics::MassLambda0 - 0.03f, o2::constants::physics::MassLambda0 + 0.03f}, "binning for the lambda invariant-mass"};

// binning of PID QA histograms
ConfigurableAxis momAxis{"momAxisFine", {5.e2, 0.f, 5.f}, "momentum axis binning"};

Check failure on line 249 in PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
ConfigurableAxis tpcAxis{"tpcAxis", {4.e2, 0.f, 4.e3f}, "tpc signal axis binning"};

Configurable<float> zVtxMax{"zVtxMax", 10.0f, "maximum z position of the primary vertex"};
Expand Down Expand Up @@ -275,8 +277,8 @@
Configurable<float> lambdaPtMax{"lambdaPtMax", 4.f, "maximum (anti)lambda pT (GeV/c)"};

Configurable<float> trackNcrossedRows{"trackNcrossedRows", 70, "Minimum number of crossed TPC rows"};
Configurable<float> trackNclusItsCut{"trackNclusITScut", 2, "Minimum number of ITS clusters"};

Check failure on line 280 in PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
Configurable<float> trackNclusTpcCut{"trackNclusTPCcut", 60, "Minimum number of TPC clusters"};

Check failure on line 281 in PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/configurable]

Use lowerCamelCase for names of configurables and use the same name for the struct member as for the JSON string. (Declare the type and names on the same line.)
Configurable<float> trackChi2Cut{"trackChi2Cut", 4.f, "Maximum chi2/ncls in TPC"};
Configurable<float> trackMinChi2Cut{"trackMinChi2Cut", 0.f, "Minimum chi2/ncls in TPC"};

Expand Down Expand Up @@ -306,11 +308,11 @@
Configurable<LabeledArray<float>> cfgTrackSels{"cfgTrackSels", {kTrackSels, 1, 12, particleName, trackSelsNames}, "Track selections"};
Configurable<LabeledArray<float>> cfgDcaSelsParam{"cfgDcaSelsParam", {kDcaSelsParam[0], 3, 3, dcaSelsNames, dcaParNames}, "DCA threshold settings"};

std::array<float, kNpart> ptMin;
std::array<float, kNpart> ptTof;
std::array<float, kNpart> ptMax;
std::array<float, kNpart> nSigmaTpcCutLow;
std::array<float, kNpart> nSigmaTpcCutUp;
std::array<float, kNpart> ptMin{0};
std::array<float, kNpart> ptTof{0};
std::array<float, kNpart> ptMax{0};
std::array<float, kNpart> nSigmaTpcCutLow{0};
std::array<float, kNpart> nSigmaTpcCutUp{0};

HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject};

Expand Down Expand Up @@ -498,13 +500,26 @@
candidateTrack.pdgcode > 0 ? candidateTrack.genpt : -candidateTrack.genpt,
static_cast<int8_t>(candidateTrack.geneta * 100),
candidateTrack.isreco);
mcMiniChTable(
miniCollTable.lastIndex(),
candidateTrack.pt,
static_cast<int8_t>(candidateTrack.eta * 100),
selMask,
candidateTrack.pdgcode > 0 ? candidateTrack.genpt : -candidateTrack.genpt,
static_cast<int8_t>(candidateTrack.geneta * 100),
candidateTrack.isreco);
} else if (!isMc) {
miniTrkTable(
miniCollTable.lastIndex(),
candidateTrack.pt,
static_cast<int8_t>(candidateTrack.eta * 100),
selMask,
candidateTrack.outerPID);
miniChTable(
miniCollTable.lastIndex(),
candidateTrack.pt,
static_cast<int8_t>(candidateTrack.eta * 100),
selMask);
}
}

Expand Down Expand Up @@ -616,7 +631,7 @@
for (const auto& track : tracks) {
if (track.trackType() == o2::aod::track::TrackTypeEnum::Run2Tracklet && std::abs(track.eta()) < etaMax && !(doprocessRun3 || doprocessMcRun3)) { // tracklet
nTrackletsColl++;
} else if (std::abs(track.eta()) < etaMax && track.itsNCls() > 3 && (doprocessRun3 || doprocessMcRun3)) { // ITS only + global tracks

Check failure on line 634 in PWGLF/TableProducer/Nuspex/ebyeMaker.cxx

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.
nTrackletsColl++;
}
if (!selectTrack(track)) {
Expand Down Expand Up @@ -663,7 +678,7 @@
continue;
}

if (trackPt <= ptTof[iP] || (trackPt > ptTof[iP] && hasTof)) {
if (trackPt <= ptTof[iP] || hasTof) {
CandidateTrack candTrack;
candTrack.pt = track.sign() > 0. ? trackPt : -trackPt;
candTrack.eta = trackEta;
Expand All @@ -683,7 +698,6 @@
}

if (lambdaPtMax > lambdaPtMin) {
std::vector<int64_t> trkId;
for (const auto& v0 : V0s) {
auto posTrack = v0.posTrack_as<T>();
auto negTrack = v0.negTrack_as<T>();
Expand Down Expand Up @@ -931,7 +945,7 @@
candV0.genpt = genPt;
candV0.geneta = mcPart.eta();
candV0.pdgcode = pdgCode;
auto it = find_if(candidateV0s.begin(), candidateV0s.end(), [&](CandidateV0 v0) { return v0.mcIndex == mcPart.globalIndex(); });
auto it = find_if(candidateV0s.begin(), candidateV0s.end(), [&](const CandidateV0& v0) { return v0.mcIndex == mcPart.globalIndex(); });
if (it != candidateV0s.end()) {
continue;
} else {
Expand All @@ -945,7 +959,6 @@
}
if ((!mcPart.isPhysicalPrimary() && !doprocessMiniMcRun2))
continue;
auto genPt = std::hypot(mcPart.px(), mcPart.py());
CandidateTrack candTrack;
candTrack.genpt = genPt;
candTrack.geneta = mcPart.eta();
Expand All @@ -955,7 +968,7 @@
else if (mcPart.has_mothers() && iP == 0 && kUsePID)
candTrack.pdgcodemoth = getPartTypeMother(mcPart);

auto it = find_if(candidateTracks[iP].begin(), candidateTracks[iP].end(), [&](CandidateTrack trk) { return trk.mcIndex == mcPart.globalIndex(); });
auto it = find_if(candidateTracks[iP].begin(), candidateTracks[iP].end(), [&](const CandidateTrack& trk) { return trk.mcIndex == mcPart.globalIndex(); });
if (it != candidateTracks[iP].end()) {
continue;
} else {
Expand Down Expand Up @@ -1013,7 +1026,7 @@

float centrality = collision.centRun2V0M();
const float centTriggerEdges[]{10.f, 30.f, 50.f};
if (!(collision.sel7() && collision.alias_bit(kINT7)) && (!kINT7Intervals || (kINT7Intervals && ((centrality >= centTriggerEdges[0] && centrality < centTriggerEdges[1]) || centrality > centTriggerEdges[2]))))
if (!(collision.sel7() && collision.alias_bit(kINT7)) && (!kINT7Intervals || ((centrality >= centTriggerEdges[0] && centrality < centTriggerEdges[1]) || centrality > centTriggerEdges[2])))
continue;

float centralityCl0 = collision.centRun2CL0();
Expand Down
Loading