Skip to content

Commit 8ae98b2

Browse files
committed
Add basic cursor fills for V0s
1 parent bef3c0d commit 8ae98b2

File tree

3 files changed

+57
-18
lines changed

3 files changed

+57
-18
lines changed

PWGLF/TableProducer/Strangeness/Converters/stradautracksextraconverter2.cxx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,15 @@ struct stradautracksextraconverter2 {
2424
void process(aod::DauTrackExtras_001 const& dauTrackExtras_001)
2525
{
2626
for (auto& values : dauTrackExtras_001) {
27+
const int maxFindable = 159;
28+
int findableMinusFound = maxFindable-values.tpcClusters();
29+
int findableMinusCrossedRows = maxFindable-values.tpcCrossedRows();
2730
dauTrackExtras_002(values.itsChi2PerNcl(),
2831
values.detectorMap(),
2932
values.itsClusterSizes(),
30-
static_cast<uint8_t>(0), // findable (unknown in old format)
31-
-values.tpcClusters(), // findable minus found: we know found
32-
-values.tpcCrossedRows()); // findable minus crossed rows: we know crossed rows
33+
static_cast<uint8_t>(maxFindable), // findable set to max to ensure proper range
34+
static_cast<int8_t>(findableMinusFound), // calculated based on max
35+
static_cast<int8_t>(findableMinusCrossedRows)); // calculated based on max
3336
}
3437
}
3538
};

PWGLF/TableProducer/Strangeness/strangenessbuilder.cxx

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,13 +336,20 @@ struct StrangenessBuilder {
336336

337337
// CCDB options
338338
struct : ConfigurableGroup {
339+
std::string prefix = "ccdb";
339340
Configurable<std::string> ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
340341
Configurable<std::string> grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"};
341342
Configurable<std::string> grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"};
342343
Configurable<std::string> lutPath{"lutPath", "GLO/Param/MatLUT", "Path of the Lut parametrization"};
343344
Configurable<std::string> geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"};
344345
} ccdbConfigurations;
345346

347+
// V0 building options
348+
struct : ConfigurableGroup {
349+
std::string prefix = "v0BuilderOpts";
350+
Configurable<bool> generatePhotonCandidates{"generatePhotonCandidates", false, "generate gamma conversion candidates (V0s using TPC-only tracks)"};
351+
} v0BuilderOpts;
352+
346353
o2::ccdb::CcdbApi ccdbApi;
347354
Service<o2::ccdb::BasicCCDBManager> ccdb;
348355

@@ -365,6 +372,7 @@ struct StrangenessBuilder {
365372
int f = enabledTables->get(tableNames[i].c_str(), "enable");
366373
if (f == 1) {
367374
mEnabledTables[i] = 1;
375+
LOGF(info, "Enabled table: %s", tableNames[i].c_str());
368376
}
369377
}
370378

@@ -456,6 +464,49 @@ struct StrangenessBuilder {
456464
v0Map[v0.globalIndex()] = v0sFromCascades.size(); // provide actual valid index in buffer
457465
v0sFromCascades.push_back(straHelper.v0);
458466
}
467+
// fill requested cursors only if type is not 0
468+
if (v0.v0Type() == 1 || (v0.v0Type() == 1 && v0BuilderOpts.generatePhotonCandidates)) {
469+
if(mEnabledTables[kV0Indices]){
470+
// for referencing (especially - but not only - when using derived data)
471+
v0indices(v0.posTrackId(), v0.negTrackId(),
472+
v0.collisionId(), v0.globalIndex());
473+
}
474+
if(mEnabledTables[kV0TrackXs]){
475+
// further decay chains may need this
476+
v0trackXs(straHelper.v0.positiveTrackX, straHelper.v0.negativeTrackX);
477+
}
478+
if(mEnabledTables[kV0CoresBase]){
479+
// standard analysis
480+
v0cores(straHelper.v0.position[0], straHelper.v0.position[1], straHelper.v0.position[2],
481+
straHelper.v0.positiveMomentum[0], straHelper.v0.positiveMomentum[1], straHelper.v0.positiveMomentum[2],
482+
straHelper.v0.negativeMomentum[0], straHelper.v0.negativeMomentum[1], straHelper.v0.negativeMomentum[2],
483+
straHelper.v0.daughterDCA,
484+
straHelper.v0.positiveDCAxy,
485+
straHelper.v0.negativeDCAxy,
486+
TMath::Cos(straHelper.v0.pointingAngle),
487+
straHelper.v0.dcaXY,
488+
v0.v0Type());
489+
}
490+
if(mEnabledTables[kV0TraPosAtDCAs]){
491+
// for tracking studies
492+
v0dauPositions(straHelper.v0.positivePosition[0], straHelper.v0.positivePosition[1], straHelper.v0.positivePosition[2],
493+
straHelper.v0.negativePosition[0], straHelper.v0.negativePosition[1], straHelper.v0.negativePosition[2]);
494+
495+
}
496+
if(mEnabledTables[kV0TraPosAtIUs]){
497+
// for tracking studies
498+
std::array<float, 3> positivePositionIU;
499+
std::array<float, 3> negativePositionIU;
500+
o2::track::TrackPar positiveTrackParam = getTrackPar(posTrack);
501+
o2::track::TrackPar negativeTrackParam = getTrackPar(negTrack);
502+
positiveTrackParam.getXYZGlo(positivePositionIU);
503+
negativeTrackParam.getXYZGlo(negativePositionIU);
504+
v0dauPositionsIU(positivePositionIU[0], positivePositionIU[1], positivePositionIU[2],
505+
negativePositionIU[0], negativePositionIU[1], negativePositionIU[2]);
506+
}
507+
}
508+
509+
459510
}
460511
LOGF(info, "V0s in DF: %i, V0s built: %i, V0s built and buffered for cascades: %i.", v0s.size(), nV0s, v0sFromCascades.size());
461512
}

PWGLF/Utils/strangenessBuilderHelper.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -231,19 +231,4 @@ class strangenessBuilderHelper
231231
} // namespace pwglf
232232
} // namespace o2
233233

234-
// pre-declare specializations: IU, non-IU
235-
// Run 3 case: tracks at IU
236-
// extern template<>
237-
// bool o2::pwglf::strangenessBuilderHelper::buildV0Candidate<o2::soa::Join<o2::aod::TracksIU, o2::aod::TracksExtra, o2::aod::TracksCovIU>::iterator>(o2::aod::Collision const& collision,
238-
// o2::soa::Join<o2::aod::TracksIU, o2::aod::TracksExtra, o2::aod::TracksCovIU>::iterator const& positiveTrack,
239-
// o2::soa::Join<o2::aod::TracksIU, o2::aod::TracksExtra, o2::aod::TracksCovIU>::iterator const& negativeTrack,
240-
// bool useCollinearFit);
241-
242-
// // Run 2 case: tracks at PV
243-
// extern template<>
244-
// bool o2::pwglf::strangenessBuilderHelper::buildV0Candidate<o2::soa::Join<o2::aod::Tracks, o2::aod::TracksExtra, o2::aod::TracksCov>::iterator>(o2::aod::Collision const& collision,
245-
// o2::soa::Join<o2::aod::Tracks, o2::aod::TracksExtra, o2::aod::TracksCov>::iterator const& positiveTrack,
246-
// o2::soa::Join<o2::aod::Tracks, o2::aod::TracksExtra, o2::aod::TracksCov>::iterator const& negativeTrack,
247-
// bool useCollinearFit);
248-
249234
#endif // PWGLF_UTILS_STRANGENESSBUILDERHELPER_H_

0 commit comments

Comments
 (0)