Skip to content

Commit f9bf2d3

Browse files
committed
adding V0 selection
1 parent 9304f93 commit f9bf2d3

8 files changed

Lines changed: 66 additions & 79 deletions

File tree

Analysis/Tasks/PWGCF/FemtoDream/femtoDreamProducerTask.cxx

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,19 @@ using FilteredFullV0s = soa::Filtered<aod::V0Datas>; /// predefined Join table f
5656
// unsigned int rows = sizeof(arrayV0Sel) / sizeof(arrayV0Sel[0]);
5757
// unsigned int columns = sizeof(arrayV0Sel[0]) / sizeof(arrayV0Sel[0][0]);
5858

59+
template <typename T>
60+
int getRowDaughters(int daughID, T const& vecID)
61+
{
62+
int rowInPrimaryTrackTableDaugh = -1;
63+
for (size_t i = 0; i < vecID.size(); i++) {
64+
if (vecID.at(i) == daughID) {
65+
rowInPrimaryTrackTableDaugh = i;
66+
break;
67+
}
68+
}
69+
return rowInPrimaryTrackTableDaugh;
70+
}
71+
5972
struct femtoDreamProducerTask {
6073

6174
Produces<aod::FemtoDreamCollisions> outputCollision;
@@ -173,7 +186,7 @@ struct femtoDreamProducerTask {
173186
colCuts.fillQA(col);
174187
outputCollision(vtxZ, mult, spher);
175188

176-
int childIDs[2] = {0,0};
189+
int childIDs[2] = {0, 0};
177190
std::vector<int> tmpIDtrack;
178191
float temptrack[2];
179192
std::vector<float> temptrackPt;
@@ -188,12 +201,10 @@ struct femtoDreamProducerTask {
188201
if (cutContainer > 0) {
189202
trackCuts.fillCutQA(track, cutContainer);
190203
outputTracks(outputCollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::femtodreamparticle::ParticleType::kTrack, cutContainer, track.dcaXY(), childIDs);
191-
192204
tmpIDtrack.push_back(track.globalIndex());
193205
temptrackPt.push_back(track.pt());
194206
temptrack[0] = outputTracks.lastIndex();
195207
temptrack[1] = track.pt();
196-
197208
if (ConfDebugOutput) {
198209
outputDebugTracks(outputCollision.lastIndex(),
199210
track.sign(), track.tpcNClsFound(),
@@ -203,7 +214,7 @@ struct femtoDreamProducerTask {
203214
track.tofNSigmaEl(), track.tofNSigmaPi(), track.tofNSigmaKa(), track.tofNSigmaPr(), track.tofNSigmaDe());
204215
}
205216
}
206-
} //end tracks loop
217+
}
207218

208219
for (auto& v0 : fullV0s) {
209220
auto postrack = v0.posTrack_as<aod::FilteredFullTracks>();
@@ -216,44 +227,25 @@ struct femtoDreamProducerTask {
216227
if ((cutContainerV0.at(0) > 0) && (cutContainerV0.at(1) > 0) && (cutContainerV0.at(2) > 0)) {
217228
int postrackID = v0.posTrackId();
218229
int rowInPrimaryTrackTablePos = -1;
219-
for (size_t i = 0; i < tmpIDtrack.size(); i++) {
220-
if (tmpIDtrack.at(i) == postrackID) {
221-
printf("++++++++++++Equal ID tracks and positive daughter++++++++++++++++++++\n");
222-
printf("i= %i --- tmpIDtrack.at(i) = %i --- postrackID = %i\n", i, tmpIDtrack.at(i), postrackID);
223-
printf("ptTracks in Femtotable at i= %.2f\n", temptrackPt.at(i));
224-
printf("++++++++++++++++++++++++++++++++\n");
225-
rowInPrimaryTrackTablePos = i;
226-
break;
227-
}
228-
}
230+
rowInPrimaryTrackTablePos = getRowDaughters(postrackID, tmpIDtrack);
229231
childIDs[0] = rowInPrimaryTrackTablePos;
230232
childIDs[1] = 0;
231233
ROOT::Math::PxPyPzMVector postrackVec(v0.pxpos(), v0.pypos(), v0.pzpos(), 0.);
232234
ROOT::Math::PxPyPzMVector negtrackVec(v0.pxneg(), v0.pyneg(), v0.pzneg(), 0.);
233235
outputTracks(outputCollision.lastIndex(), postrackVec.Pt(), postrackVec.Eta(), postrackVec.Phi(), aod::femtodreamparticle::ParticleType::kV0Child, cutContainerV0.at(1), 0., childIDs);
234236
const int rowOfPosTrack = outputTracks.lastIndex();
235-
tempPostrackPt.push_back(postrackVec.Pt());
236-
printf("childIDs[0] = %i -- postrackVec.Pt() = %.4f -- temptrackPt = %.4f\n",
237-
childIDs[0], static_cast<int>(temptrack[0]), postrackVec.Pt(), temptrackPt.at(childIDs[0]));
238-
239237
int negtrackID = v0.negTrackId();
240238
int rowInPrimaryTrackTableNeg = -1;
241-
for (size_t i = 0; i < tmpIDtrack.size(); i++) {
242-
if (tmpIDtrack.at(i) == negtrackID) {
243-
rowInPrimaryTrackTableNeg = i;
244-
break;
245-
}
246-
}
247-
childIDs[0] = rowInPrimaryTrackTablePos;
239+
rowInPrimaryTrackTableNeg = getRowDaughters(negtrackID, tmpIDtrack);
240+
childIDs[0] = 0;
248241
childIDs[1] = rowInPrimaryTrackTableNeg;
249242
outputTracks(outputCollision.lastIndex(), negtrackVec.Pt(), negtrackVec.Eta(), negtrackVec.Phi(), aod::femtodreamparticle::ParticleType::kV0Child, cutContainerV0.at(2), 0., childIDs);
250243
const int rowOfNegTrack = outputTracks.lastIndex();
251-
252-
int indexChildID[2] = {postrackID, negtrackID};
244+
int indexChildID[2] = {rowOfPosTrack, rowOfNegTrack};
253245
outputTracks(outputCollision.lastIndex(), v0.pt(), v0.eta(), v0.phi(), aod::femtodreamparticle::ParticleType::kV0, cutContainerV0.at(0), v0.v0cosPA(col.posX(), col.posY(), col.posZ()), indexChildID);
254-
} //end cutContainer loop
255-
} // end V0 loop
256-
} //end process
246+
}
247+
}
248+
}
257249
};
258250

259251
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

Analysis/Tasks/PWGCF/FemtoDream/include/FemtoDream/FemtoDerived.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ using FemtoDreamCollision = FemtoDreamCollisions::iterator;
3838

3939
namespace femtodreamparticle
4040
{
41-
enum ParticleType {
42-
kTrack,
43-
kV0,
44-
kV0Child,
45-
kCascade,
46-
kCascadeBachelor
47-
};
41+
enum ParticleType {
42+
kTrack,
43+
kV0,
44+
kV0Child,
45+
kCascade,
46+
kCascadeBachelor
47+
};
4848

4949
DECLARE_SOA_INDEX_COLUMN(FemtoDreamCollision, femtoDreamCollision);
5050
DECLARE_SOA_COLUMN(Pt, pt, float);

Analysis/Tasks/PWGCF/FemtoDream/include/FemtoDream/FemtoDreamContainer.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
// Copyright CERN and copyright holders of ALICE O2. This software is
2-
// distributed under the terms of the GNU General Public License v3 (GPL
3-
// Version 3), copied verbatim in the file "COPYING".
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
44
//
5-
// See http://alice-o2.web.cern.ch/license for full licensing information.
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
67
//
78
// In applying this license CERN does not waive the privileges and immunities
89
// granted to it by virtue of its status as an Intergovernmental Organization

Analysis/Tasks/PWGCF/FemtoDream/include/FemtoDream/FemtoDreamMath.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
// Copyright CERN and copyright holders of ALICE O2. This software is
2-
// distributed under the terms of the GNU General Public License v3 (GPL
3-
// Version 3), copied verbatim in the file "COPYING".
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
44
//
5-
// See http://alice-o2.web.cern.ch/license for full licensing information.
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
67
//
78
// In applying this license CERN does not waive the privileges and immunities
89
// granted to it by virtue of its status as an Intergovernmental Organization
910
// or submit itself to any jurisdiction.
1011

1112
/// \file FemtoDreamMath.h
1213
/// \brief Definition of the FemtoDreamMath Container for math calculations of quantities related to pairs
13-
/// \author Valentina Mantovani Sarti, TU München, valentina.mantovani-sarti@ph.tum.de
14+
/// \author Valentina Mantovani Sarti, TU München, valentina.mantovani-sarti@tum.de
1415

1516
#ifndef ANALYSIS_TASKS_PWGCF_FEMTODREAM_FEMTODREAMMATH_H_
1617
#define ANALYSIS_TASKS_PWGCF_FEMTODREAM_FEMTODREAMMATH_H_
@@ -33,7 +34,6 @@ namespace femtoDream
3334
class FemtoDreamMath
3435
{
3536
public:
36-
3737
template <typename T>
3838
static float getkstar(const T& part1, const float mass1, const T& part2, const float mass2)
3939
{

Analysis/Tasks/PWGCF/FemtoDream/include/FemtoDream/FemtoDreamPairCleaner.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
// Copyright CERN and copyright holders of ALICE O2. This software is
2-
// distributed under the terms of the GNU General Public License v3 (GPL
3-
// Version 3), copied verbatim in the file "COPYING".
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
44
//
5-
// See http://alice-o2.web.cern.ch/license for full licensing information.
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
67
//
78
// In applying this license CERN does not waive the privileges and immunities
89
// granted to it by virtue of its status as an Intergovernmental Organization

Analysis/Tasks/PWGCF/FemtoDream/include/FemtoDream/FemtoDreamParticleHisto.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
// Copyright CERN and copyright holders of ALICE O2. This software is
2-
// distributed under the terms of the GNU General Public License v3 (GPL
3-
// Version 3), copied verbatim in the file "COPYING".
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
44
//
5-
// See http://alice-o2.web.cern.ch/license for full licensing information.
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
67
//
78
// In applying this license CERN does not waive the privileges and immunities
89
// granted to it by virtue of its status as an Intergovernmental Organization

Analysis/Tasks/PWGCF/FemtoDream/include/FemtoDream/FemtoDreamTrackSelection.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ bool FemtoDreamTrackSelection::isSelectedMinimal(T const& track)
238238
const auto tpcNClsS = track.tpcNClsShared();
239239
const auto dcaXY = track.dcaXY();
240240
const auto dcaZ = track.dcaZ();
241-
const auto dcaXYZ = std::sqrt(pow(dcaXY, 2.) + pow(dcaZ, 2.));
241+
const auto dca = std::sqrt(pow(dcaXY, 2.) + pow(dcaZ, 2.));
242242
/// check whether the most open cuts are fulfilled - most of this should have already be done by the filters
243243

244244
const static int nPtMinSel = getNSelections(femtoDreamTrackSelection::kpTMin);
@@ -290,7 +290,7 @@ bool FemtoDreamTrackSelection::isSelectedMinimal(T const& track)
290290
if (nDCAzMaxSel > 0 && std::abs(dcaZ) > dcaZMax) {
291291
return false;
292292
}
293-
if (nDCAMinSel > 0 && std::abs(dcaXYZ) < dcaMin) {
293+
if (nDCAMinSel > 0 && std::abs(dca) < dcaMin) {
294294
return false;
295295
}
296296
return true;
@@ -310,7 +310,7 @@ uint64_t FemtoDreamTrackSelection::getCutContainer(T const& track)
310310
const auto tpcNClsS = track.tpcNClsShared();
311311
const auto dcaXY = track.dcaXY();
312312
const auto dcaZ = track.dcaZ();
313-
const auto dcaXYZ = std::sqrt(pow(dcaXY, 2.) + pow(dcaZ, 2.));
313+
const auto dca = std::sqrt(pow(dcaXY, 2.) + pow(dcaZ, 2.));
314314

315315
std::vector<float> pidTPC, pidTOF;
316316
for (auto it : mPIDspecies) {
@@ -363,7 +363,7 @@ uint64_t FemtoDreamTrackSelection::getCutContainer(T const& track)
363363
observable = dcaZ;
364364
break;
365365
case (femtoDreamTrackSelection::kDCAMin):
366-
observable = dcaXYZ;
366+
observable = dca;
367367
break;
368368
case (femtoDreamTrackSelection::kPIDnSigmaMax):
369369
break;
@@ -407,7 +407,7 @@ void FemtoDreamTrackSelection::fillCutQA(T const& track, uint64_t cutContainer)
407407
const auto tpcNClsS = track.tpcNClsShared();
408408
const auto dcaXY = track.dcaXY();
409409
const auto dcaZ = track.dcaZ();
410-
const auto dcaXYZ = std::sqrt(pow(dcaXY, 2.) + pow(dcaZ, 2.));
410+
const auto dca = std::sqrt(pow(dcaXY, 2.) + pow(dcaZ, 2.));
411411

412412
std::vector<float> pidTPC, pidTOF;
413413
for (auto it : mPIDspecies) {
@@ -499,7 +499,7 @@ void FemtoDreamTrackSelection::fillCutQA(T const& track, uint64_t cutContainer)
499499
break;
500500
case (femtoDreamTrackSelection::kDCAMin):
501501
if (isTrue) {
502-
mHistogramRegistry->fill(HIST("TrackCutsQA/dcaMin"), currentTrackSelCounter, dcaXYZ);
502+
mHistogramRegistry->fill(HIST("TrackCutsQA/dcaMin"), currentTrackSelCounter, dca);
503503
}
504504
break;
505505
case (femtoDreamTrackSelection::kPIDnSigmaMax):

Analysis/Tasks/PWGCF/FemtoDream/include/FemtoDream/FemtoDreamV0Selection.h

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
// Copyright CERN and copyright holders of ALICE O2. This software is
2-
// distributed under the terms of the GNU General Public License v3 (GPL
3-
// Version 3), copied verbatim in the file "COPYING".
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
44
//
5-
// See http://alice-o2.web.cern.ch/license for full licensing information.
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
67
//
78
// In applying this license CERN does not waive the privileges and immunities
89
// granted to it by virtue of its status as an Intergovernmental Organization
@@ -52,15 +53,6 @@ class FemtoDreamV0Selection : public FemtoDreamObjectSelection<float, femtoDream
5253
/// Initializes histograms for the task
5354
void init(HistogramRegistry* registry);
5455

55-
template <typename T>
56-
void setPIDSpecies(T& pids) ///K0s,Λ and antiΛ
57-
{
58-
std::vector<int> tmpPids = pids; // necessary due to some features of the configurable
59-
for (const o2::track::PID& pid : tmpPids) {
60-
mPIDspecies.push_back(pid);
61-
}
62-
}
63-
6456
template <typename C, typename V, typename T>
6557
bool isSelectedMinimal(C const& col, V const& v0, T const& posTrack, T const& negTrack);
6658

@@ -73,16 +65,16 @@ class FemtoDreamV0Selection : public FemtoDreamObjectSelection<float, femtoDream
7365
template <typename T1, typename T2>
7466
void setChildCuts(femtoDreamV0Selection::ChildTrackType child, T1 selVal, T2 selVar, femtoDreamSelection::SelectionType selType)
7567
{
76-
if (child == femtoDreamV0Selection::kPosTrack)
68+
if (child == femtoDreamV0Selection::kPosTrack) {
7769
PosDaughTrack.setSelection(selVal, selVar, selType);
78-
else if (child == femtoDreamV0Selection::kNegTrack)
70+
} else if (child == femtoDreamV0Selection::kNegTrack) {
7971
NegDaughTrack.setSelection(selVal, selVar, selType);
72+
}
8073
}
8174

8275
private:
8376
FemtoDreamTrackSelection PosDaughTrack;
8477
FemtoDreamTrackSelection NegDaughTrack;
85-
std::vector<o2::track::PID> mPIDspecies;
8678

8779
ClassDefNV(FemtoDreamV0Selection, 1);
8880
}; // namespace femtoDream
@@ -91,10 +83,10 @@ void FemtoDreamV0Selection::init(HistogramRegistry* registry)
9183
{
9284
if (registry) {
9385
mHistogramRegistry = registry;
94-
fillSelectionHistogram("V0Cuts/cuthist"); ///For now empty since I need to understand the next nSelections
86+
fillSelectionHistogram("V0Cuts/cuthist");
9587

9688
/// \todo this should be an automatic check in the parent class, and the return type should be templated
97-
int nSelections = 2 + getNSelections(); /// the 2 still holds for the first two bits???
89+
int nSelections = getNSelections();
9890
if (8 * sizeof(uint64_t) < nSelections) {
9991
LOGF(error, "Number of selections to large for your container - quitting!");
10092
}

0 commit comments

Comments
 (0)