Skip to content

Commit 7ad281d

Browse files
committed
Fixing the ProducerTask for V0, starting to implement the filling QA for daughters
1 parent 480b3bd commit 7ad281d

3 files changed

Lines changed: 127 additions & 44 deletions

File tree

Analysis/Tasks/PWGCF/FemtoDream/femtoDreamProducerTask.cxx

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,14 @@ struct femtoDreamProducerTask {
109109

110110
Configurable<std::vector<float>> ConfDCAV0DaughMax{"ConfDCAV0DaughMax", std::vector<float>{1.2f, 1.5f}, "V0 sel: Max. DCA daugh from SV (cm)"};
111111
Configurable<std::vector<float>> ConfCPAV0Min{"ConfCPAV0Min", std::vector<float>{0.9f, 0.995f}, "V0 sel: Min. CPA"};
112+
Configurable<std::vector<float>> ConfV0PtMin{"ConfV0PtMin", std::vector<float>{0.3f, 0.4f, 0.5f}, "V0 sel: Min. Pt"};
113+
112114
MutableConfigurable<float> V0DecVtxMax{"V0DecVtxMax", 100.f, "V0 sel: Max. distance from Vtx (cm)"};
113115
MutableConfigurable<float> V0TranRadV0Min{"V0TranRadV0Min", 0.2f, "V0 sel: Min. transverse radius (cm)"};
114116
MutableConfigurable<float> V0TranRadV0Max{"V0TranRadV0Max", 100.f, "V0 sel: Max. transverse radius (cm)"};
115117

116118
Configurable<std::vector<float>> ConfV0DaughTPCnclsMin{"ConfV0DaughTPCnclsMin", std::vector<float>{80.f, 70.f, 60.f}, "V0 Daugh sel: Min. nCls TPC"};
117-
Configurable<std::vector<float>> ConfV0DaughDCAMax{"ConfV0DaughDCAMax", std::vector<float>{0.05f, 0.06f}, "V0 Daugh sel: Max. DCA Daugh to PV (cm)"};
119+
Configurable<std::vector<float>> ConfV0DaughDCAMin{"ConfV0DaughDCAMin", std::vector<float>{0.05f, 0.06f}, "V0 Daugh sel: Max. DCA Daugh to PV (cm)"};
118120
Configurable<std::vector<float>> ConfV0DaughPIDnSigmaMax{"ConfV0DaughPIDnSigmaMax", std::vector<float>{5.f, 4.f}, "V0 Daugh sel: Max. PID nSigma TPC"};
119121

120122
/// \todo should we add filter on min value pT/eta of V0 and daughters?
@@ -147,15 +149,21 @@ struct femtoDreamProducerTask {
147149

148150
v0Cuts.setSelection(ConfDCAV0DaughMax, femtoDreamV0Selection::kDCAV0DaughMax, femtoDreamSelection::kUpperLimit);
149151
v0Cuts.setSelection(ConfCPAV0Min, femtoDreamV0Selection::kCPAV0Min, femtoDreamSelection::kLowerLimit);
152+
v0Cuts.setSelection(ConfV0PtMin, femtoDreamV0Selection::kpTV0Min, femtoDreamSelection::kLowerLimit);
153+
150154
v0Cuts.setChildCuts(femtoDreamV0Selection::kPosTrack, ConfTrkCharge, femtoDreamTrackSelection::kSign, femtoDreamSelection::kEqual);
155+
v0Cuts.setChildCuts(femtoDreamV0Selection::kPosTrack, ConfTrkEta, femtoDreamTrackSelection::kEtaMax, femtoDreamSelection::kAbsUpperLimit);
151156
v0Cuts.setChildCuts(femtoDreamV0Selection::kPosTrack, ConfV0DaughTPCnclsMin, femtoDreamTrackSelection::kTPCnClsMin, femtoDreamSelection::kLowerLimit);
152-
v0Cuts.setChildCuts(femtoDreamV0Selection::kPosTrack, ConfV0DaughDCAMax, femtoDreamTrackSelection::kDCAzMax, femtoDreamSelection::kAbsUpperLimit);
157+
// v0Cuts.setChildCuts(femtoDreamV0Selection::kPosTrack, ConfV0DaughDCAMin, femtoDreamTrackSelection::kDCAMin, femtoDreamSelection::kAbsLowerLimit);
153158
v0Cuts.setChildCuts(femtoDreamV0Selection::kPosTrack, ConfV0DaughPIDnSigmaMax, femtoDreamTrackSelection::kPIDnSigmaMax, femtoDreamSelection::kAbsUpperLimit);
154159
v0Cuts.setChildCuts(femtoDreamV0Selection::kNegTrack, ConfTrkCharge, femtoDreamTrackSelection::kSign, femtoDreamSelection::kEqual);
160+
v0Cuts.setChildCuts(femtoDreamV0Selection::kNegTrack, ConfTrkEta, femtoDreamTrackSelection::kEtaMax, femtoDreamSelection::kAbsUpperLimit);
155161
v0Cuts.setChildCuts(femtoDreamV0Selection::kNegTrack, ConfV0DaughTPCnclsMin, femtoDreamTrackSelection::kTPCnClsMin, femtoDreamSelection::kLowerLimit);
156-
v0Cuts.setChildCuts(femtoDreamV0Selection::kNegTrack, ConfV0DaughDCAMax, femtoDreamTrackSelection::kDCAzMax, femtoDreamSelection::kAbsUpperLimit);
162+
// v0Cuts.setChildCuts(femtoDreamV0Selection::kNegTrack, ConfV0DaughDCAMin, femtoDreamTrackSelection::kDCAMin, femtoDreamSelection::kAbsLowerLimit);
157163
v0Cuts.setChildCuts(femtoDreamV0Selection::kNegTrack, ConfV0DaughPIDnSigmaMax, femtoDreamTrackSelection::kPIDnSigmaMax, femtoDreamSelection::kAbsUpperLimit);
158-
v0Cuts.init<aod::femtodreamparticle::ParticleType::kV0, aod::femtodreamparticle::cutContainerType>(&qaRegistry);
164+
v0Cuts.setChildPIDSpecies(femtoDreamV0Selection::kPosTrack, ConfTrkTPIDspecies);
165+
v0Cuts.setChildPIDSpecies(femtoDreamV0Selection::kNegTrack, ConfTrkTPIDspecies);
166+
v0Cuts.init<aod::femtodreamparticle::ParticleType::kV0, aod::femtodreamparticle::ParticleType::kV0Child, aod::femtodreamparticle::cutContainerType>(&qaRegistry);
159167
}
160168

161169
void process(aod::FilteredFullCollision const& col,
@@ -198,30 +206,43 @@ struct femtoDreamProducerTask {
198206
}
199207
}
200208

209+
printf("V0 Loop\n");
201210
for (auto& v0 : fullV0s) {
211+
// printf("pT of V0 candidates before selection = %.2f\n", v0.pt());
202212
auto postrack = v0.posTrack_as<aod::FilteredFullTracks>();
203213
auto negtrack = v0.negTrack_as<aod::FilteredFullTracks>(); ///\tocheck funnily enough if we apply the filter the sign of Pos and Neg track is always negative
214+
// printf("+++++ In Producer 1\n");
215+
const auto dcaXYpos = postrack.dcaXY();
216+
const auto dcaZpos = postrack.dcaZ();
217+
const auto dcapos = std::sqrt(pow(dcaXYpos, 2.) + pow(dcaZpos, 2.));
218+
// printf("dcaxy Positive Daughter = %.2f\n", dcaXYpos);
219+
// printf("dcaz Positive Daughter = %.2f\n", dcaZpos);
220+
// printf("dca Positive Daughter = %.2f\n", dcapos);
221+
// printf("isSelectedMinimal V0 = %i\n", v0Cuts.isSelectedMinimal(col, v0, postrack, negtrack));
204222
if (!v0Cuts.isSelectedMinimal(col, v0, postrack, negtrack)) {
205223
continue;
206224
}
207-
v0Cuts.fillQA(col, v0); ///\todo fill QA also for daughters
225+
// printf("+++++2\n");
226+
v0Cuts.fillQA<aod::femtodreamparticle::ParticleType::kV0, aod::femtodreamparticle::ParticleType::kV0Child>(col, v0, postrack, negtrack); ///\todo fill QA also for daughters
208227
auto cutContainerV0 = v0Cuts.getCutContainer<aod::femtodreamparticle::cutContainerType>(col, v0, postrack, negtrack);
228+
// printf("Container in V0\n");
229+
// printf("cutContainerV0.at(0) = %i\n", cutContainerV0.at(0));
209230
if ((cutContainerV0.at(0) > 0) && (cutContainerV0.at(1) > 0) && (cutContainerV0.at(2) > 0)) {
231+
// printf("pT of V0 candidates after selection = %.2f\n", v0.pt());
232+
// printf("Inside Cut container!!!!!!\n");
210233
int postrackID = v0.posTrackId();
211234
int rowInPrimaryTrackTablePos = -1;
212235
rowInPrimaryTrackTablePos = getRowDaughters(postrackID, tmpIDtrack);
213236
childIDs[0] = rowInPrimaryTrackTablePos;
214237
childIDs[1] = 0;
215-
ROOT::Math::PxPyPzMVector postrackVec(v0.pxpos(), v0.pypos(), v0.pzpos(), 0.);
216-
ROOT::Math::PxPyPzMVector negtrackVec(v0.pxneg(), v0.pyneg(), v0.pzneg(), 0.);
217-
outputTracks(outputCollision.lastIndex(), postrackVec.Pt(), postrackVec.Eta(), postrackVec.Phi(), aod::femtodreamparticle::ParticleType::kV0Child, cutContainerV0.at(1), cutContainerV0.at(2), 0., childIDs);
238+
outputTracks(outputCollision.lastIndex(), v0.positivept(), v0.positiveeta(), v0.positivephi(), aod::femtodreamparticle::ParticleType::kV0Child, cutContainerV0.at(1), cutContainerV0.at(2), 0., childIDs);
218239
const int rowOfPosTrack = outputTracks.lastIndex();
219240
int negtrackID = v0.negTrackId();
220241
int rowInPrimaryTrackTableNeg = -1;
221242
rowInPrimaryTrackTableNeg = getRowDaughters(negtrackID, tmpIDtrack);
222243
childIDs[0] = 0;
223244
childIDs[1] = rowInPrimaryTrackTableNeg;
224-
outputTracks(outputCollision.lastIndex(), negtrackVec.Pt(), negtrackVec.Eta(), negtrackVec.Phi(), aod::femtodreamparticle::ParticleType::kV0Child, cutContainerV0.at(3), cutContainerV0.at(4), 0., childIDs);
245+
outputTracks(outputCollision.lastIndex(), v0.negativept(), v0.negativeeta(), v0.negativephi(), aod::femtodreamparticle::ParticleType::kV0Child, cutContainerV0.at(3), cutContainerV0.at(4), 0., childIDs);
225246
const int rowOfNegTrack = outputTracks.lastIndex();
226247
int indexChildID[2] = {rowOfPosTrack, rowOfNegTrack};
227248
outputTracks(outputCollision.lastIndex(), v0.pt(), v0.eta(), v0.phi(), aod::femtodreamparticle::ParticleType::kV0, cutContainerV0.at(0), 0, v0.v0cosPA(col.posX(), col.posY(), col.posZ()), indexChildID);

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

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class FemtoDreamTrackSelection : public FemtoDreamObjectSelection<float, femtoDr
5555
/// \tparam cutContainerType Data type of the bit-wise container for the selections
5656
/// \param registry HistogramRegistry for QA output
5757
template <o2::aod::femtodreamparticle::ParticleType part, typename cutContainerType>
58-
void init(HistogramRegistry* registry);
58+
void init(HistogramRegistry* registry, const std::string WhichDaugh = "");
5959

6060
/// Passes the species to the task for which PID needs to be stored
6161
/// \tparam T Data type of the configurable passed to the functions
@@ -106,7 +106,7 @@ class FemtoDreamTrackSelection : public FemtoDreamObjectSelection<float, femtoDr
106106
/// \tparam T Data type of the track
107107
/// \param track Track
108108
template <o2::aod::femtodreamparticle::ParticleType part, typename T>
109-
void fillQA(T const& track);
109+
void fillQA(T const& track, const std::string WhichDaugh = "");
110110

111111
/// Helper function to obtain the name of a given selection criterion for consistent naming of the configurables
112112
/// \param iSel Track selection variable to be examined
@@ -159,19 +159,25 @@ class FemtoDreamTrackSelection : public FemtoDreamObjectSelection<float, femtoDr
159159
}; // namespace femtoDream
160160

161161
template <o2::aod::femtodreamparticle::ParticleType part, typename cutContainerType>
162-
void FemtoDreamTrackSelection::init(HistogramRegistry* registry)
162+
void FemtoDreamTrackSelection::init(HistogramRegistry* registry, const std::string WhichDaugh)
163163
{
164164
if (registry) {
165165
mHistogramRegistry = registry;
166-
fillSelectionHistogram<part>();
166+
std::string folderName;
167+
if (WhichDaugh.empty()) {
168+
fillSelectionHistogram<part>();
169+
folderName = static_cast<std::string>(o2::aod::femtodreamparticle::ParticleTypeName[part]);
170+
} else {
171+
printf("Are you working on Daughters? Not filling the selection criteria histogram!");
172+
folderName = static_cast<std::string>(o2::aod::femtodreamparticle::ParticleTypeName[part]) + "/" + WhichDaugh;
173+
}
167174

168175
/// \todo this should be an automatic check in the parent class
169176
int nSelections = getNSelections() + mPIDspecies.size() * (getNSelections(femtoDreamTrackSelection::kPIDnSigmaMax) - 1);
170177
if (8 * sizeof(cutContainerType) < nSelections) {
171178
LOG(FATAL) << "FemtoDreamTrackCuts: Number of selections to large for your container - quitting!";
172179
}
173180

174-
std::string folderName = static_cast<std::string>(o2::aod::femtodreamparticle::ParticleTypeName[part]);
175181
mHistogramRegistry->add((folderName + "/pThist").c_str(), "; #it{p}_{T} (GeV/#it{c}); Entries", kTH1F, {{1000, 0, 10}});
176182
mHistogramRegistry->add((folderName + "/etahist").c_str(), "; #eta; Entries", kTH1F, {{1000, -1, 1}});
177183
mHistogramRegistry->add((folderName + "/phihist").c_str(), "; #phi; Entries", kTH1F, {{1000, 0, 2. * M_PI}});
@@ -292,47 +298,69 @@ bool FemtoDreamTrackSelection::isSelectedMinimal(T const& track)
292298
const static float dcaMin = getMinimalSelection(femtoDreamTrackSelection::kDCAMin, femtoDreamSelection::kAbsLowerLimit);
293299
const static float nSigmaPIDMax = getMinimalSelection(femtoDreamTrackSelection::kPIDnSigmaMax, femtoDreamSelection::kAbsUpperLimit);
294300

301+
// printf("nPtMinSel > 0 ? %i --- pT < pTMin(%.2f) ? %.2f\n", nPtMinSel, pTMin, pT);
295302
if (nPtMinSel > 0 && pT < pTMin) {
303+
// printf("nPtMinSel false\n");
296304
return false;
297305
}
298306
if (nPtMaxSel > 0 && pT > pTMax) {
307+
// printf("nPtMaxSel false\n");
299308
return false;
300309
}
310+
// printf("nEtaSel > 0 ? %i --- eta > etaMax(%.2f) ? %.2f\n", nEtaSel, etaMax, std::abs(eta));
301311
if (nEtaSel > 0 && std::abs(eta) > etaMax) {
312+
// printf("nEtaSel false\n");
302313
return false;
303314
}
315+
// printf("nTPCnMinSel > 0 ? %i --- tpcNClsF < nClsMin(%.2f) ? %.2f\n", nTPCnMinSel, nClsMin, tpcNClsF);
304316
if (nTPCnMinSel > 0 && tpcNClsF < nClsMin) {
317+
// printf("nTPCnMinSel false\n");
305318
return false;
306319
}
320+
// printf("nTPCfMinSel > 0 ? %i --- tpcRClsC < fClsMin(%.2f) ? %.2f\n", nTPCfMinSel, fClsMin, tpcRClsC);
307321
if (nTPCfMinSel > 0 && tpcRClsC < fClsMin) {
322+
// printf("nTPCfMinSel false\n");
308323
return false;
309324
}
325+
// printf("nTPCcMinSel > 0 ? %i --- tpcNClsC < cTPCMin(%.2f) ? %.2f\n", nTPCcMinSel, cTPCMin, tpcNClsC);
310326
if (nTPCcMinSel > 0 && tpcNClsC < cTPCMin) {
327+
// printf("nTPCcMinSel false\n");
311328
return false;
312329
}
330+
// printf("nTPCsMaxSel > 0 ? %i --- tpcNClsS > sTPCMax(%.2f) ? %.2f\n", nTPCsMaxSel, sTPCMax, tpcNClsS);
313331
if (nTPCsMaxSel > 0 && tpcNClsS > sTPCMax) {
332+
// printf("nTPCsMaxSel false\n");
314333
return false;
315334
}
335+
// printf("nDCAxyMaxSel > 0 ? %i --- std::abs(dcaXY) > dcaXYMax(%.2f) ? %.2f\n", nDCAxyMaxSel, dcaXYMax, std::abs(dcaXY));
316336
if (nDCAxyMaxSel > 0 && std::abs(dcaXY) > dcaXYMax) {
337+
// printf("nDCAxyMaxSel false\n");
317338
return false;
318339
}
340+
// printf("nDCAzMaxSel > 0 ? %i --- std::abs(dcaZ) > dcaZMax(%.2f) ? %.2f\n", nDCAzMaxSel, dcaZMax, std::abs(dcaZ));
319341
if (nDCAzMaxSel > 0 && std::abs(dcaZ) > dcaZMax) {
342+
// printf("nDCAzMaxSel false\n");
320343
return false;
321344
}
345+
// printf("nDCAMinSel > 0 ? %i --- std::abs(dca) < dcaMin(%.2f) ? %.2f\n", nDCAMinSel, dcaMin, std::abs(dca));
322346
if (nDCAMinSel > 0 && std::abs(dca) < dcaMin) {
347+
// printf("nDCAMinSel false\n");
323348
return false;
324349
}
350+
// printf("nPIDnSigmaSel > 0 ? %i\n", nPIDnSigmaSel);
325351
if (nPIDnSigmaSel > 0) {
326352
bool isFulfilled = false;
327353
for (size_t i = 0; i < pidTPC.size(); ++i) {
328354
auto pidTPCVal = pidTPC.at(i);
329355
auto pidTOFVal = pidTOF.at(i);
330356
auto pidComb = std::sqrt(pidTPCVal * pidTPCVal + pidTOFVal * pidTOFVal);
331357
if (std::abs(pidTPCVal) < nSigmaPIDMax || pidComb < nSigmaPIDMax) {
358+
// printf("isFulfilled true\n");
332359
isFulfilled = true;
333360
}
334361
}
335362
if (!isFulfilled) {
363+
// printf("isFulfilled ? %i\n", isFulfilled);
336364
return isFulfilled;
337365
}
338366
}
@@ -420,7 +448,7 @@ std::array<cutContainerType, 2> FemtoDreamTrackSelection::getCutContainer(T cons
420448
}
421449

422450
template <o2::aod::femtodreamparticle::ParticleType part, typename T>
423-
void FemtoDreamTrackSelection::fillQA(T const& track)
451+
void FemtoDreamTrackSelection::fillQA(T const& track, const std::string WhichDaugh)
424452
{
425453
if (mHistogramRegistry) {
426454
mHistogramRegistry->fill(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/pThist"), track.pt());

0 commit comments

Comments
 (0)