Skip to content

Commit 398c307

Browse files
author
Christopher Klumm
committed
Iprovements in formatting
1 parent b2879de commit 398c307

2 files changed

Lines changed: 119 additions & 0 deletions

File tree

PWGCF/FemtoDream/Core/femtoDreamResoSelectionK0Short.h

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
//
55
// This software is distributed under the terms of the GNU General Public
66
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
<<<<<<< HEAD
78
//
9+
=======
10+
// kPhiPosdaughTOF_NegdaughTPC
11+
>>>>>>> c6a3f815b (Iprovements in formatting)
812
// In applying this license CERN does not waive the privileges and immunities
913
// granted to it by virtue of its status as an Intergovernmental Organization
1014
// or submit itself to any jurisdiction.
@@ -33,8 +37,13 @@
3337
#include <array>
3438
#include <cstdint>
3539
#include <fstream>
40+
<<<<<<< HEAD
3641
#include <string>
3742
#include <utility>
43+
=======
44+
#include <iostream>
45+
#include <string>
46+
>>>>>>> c6a3f815b (Iprovements in formatting)
3847
#include <vector>
3948

4049
using namespace o2;
@@ -95,10 +104,17 @@ class FemtoDreamResoSelection
95104
void setDaughterPIDSpecies(T const& daugh, V& pids);
96105

97106
template <typename V>
107+
<<<<<<< HEAD
98108
bool daughterSelectionPos(V const& track1, bool useThreshold);
99109

100110
template <typename V>
101111
bool daughterSelectionNeg(V const& track2, bool useThreshold);
112+
=======
113+
bool DaughterSelectionPos(V const& track1, bool UseThreshold);
114+
115+
template <typename V>
116+
bool DaughterSelectionNeg(V const& track2, bool UseThreshold);
117+
>>>>>>> c6a3f815b (Iprovements in formatting)
102118

103119
template <typename cutContainerType, typename V>
104120
std::array<cutContainerType, 5> getCutContainer(V const& track1, V const& track2, float sign);
@@ -119,9 +135,15 @@ class FemtoDreamResoSelection
119135
void setDaughternSigmaPIDOffset(femtoDreamResoSelection::Daughtertype daugh, float offsetTPC, float offsetTOF)
120136
{
121137
if (daugh == femtoDreamResoSelection::kPosdaugh) {
138+
<<<<<<< HEAD
122139
posDaughTrack.setnSigmaPIDOffset(offsetTPC, offsetTOF);
123140
} else if (daugh == femtoDreamResoSelection::kNegdaugh) {
124141
negDaughTrack.setnSigmaPIDOffset(offsetTPC, offsetTOF);
142+
=======
143+
PosDaughTrack.setnSigmaPIDOffset(offsetTPC, offsetTOF);
144+
} else if (daugh == femtoDreamResoSelection::kNegdaugh) {
145+
NegDaughTrack.setnSigmaPIDOffset(offsetTPC, offsetTOF);
146+
>>>>>>> c6a3f815b (Iprovements in formatting)
125147
}
126148
mPIDoffsetTPC = offsetTPC;
127149
mPIDoffsetTOF = offsetTOF;
@@ -155,7 +177,11 @@ class FemtoDreamResoSelection
155177
std::string_view suffix = "")
156178
{
157179
std::string outString = static_cast<std::string>(prefix);
180+
<<<<<<< HEAD
158181
outString += static_cast<std::string>(kSelectionNames[iSel]);
182+
=======
183+
outString += static_cast<std::string>(mSelectionNames[iSel]);
184+
>>>>>>> c6a3f815b (Iprovements in formatting)
159185
outString += suffix;
160186
return outString;
161187
}
@@ -168,7 +194,11 @@ class FemtoDreamResoSelection
168194
{
169195
for (int index = 0; index < kNresoSelection; index++) {
170196
std::string comp = static_cast<std::string>(prefix) +
197+
<<<<<<< HEAD
171198
static_cast<std::string>(kSelectionNames[index]);
199+
=======
200+
static_cast<std::string>(mSelectionNames[index]);
201+
>>>>>>> c6a3f815b (Iprovements in formatting)
172202
std::string_view cmp{comp};
173203
if (obs.compare(cmp) == 0)
174204
return index;
@@ -182,7 +212,11 @@ class FemtoDreamResoSelection
182212
static femtoDreamSelection::SelectionType
183213
getSelectionType(femtoDreamResoSelection::ResoSel iSel)
184214
{
215+
<<<<<<< HEAD
185216
return kSelectionTypes[iSel];
217+
=======
218+
return mSelectionTypes[iSel];
219+
>>>>>>> c6a3f815b (Iprovements in formatting)
186220
}
187221

188222
/// for consistent description of the configurables
@@ -192,7 +226,11 @@ class FemtoDreamResoSelection
192226
std::string_view prefix = "")
193227
{
194228
std::string outString = static_cast<std::string>(prefix);
229+
<<<<<<< HEAD
195230
outString += static_cast<std::string>(kSelectionHelper[iSel]);
231+
=======
232+
outString += static_cast<std::string>(mSelectionHelper[iSel]);
233+
>>>>>>> c6a3f815b (Iprovements in formatting)
196234
return outString;
197235
}
198236

@@ -201,6 +239,7 @@ class FemtoDreamResoSelection
201239
float mPIDoffsetTPC;
202240
float mPIDoffsetTOF;
203241

242+
<<<<<<< HEAD
204243
FemtoDreamTrackSelection posDaughTrack;
205244
FemtoDreamTrackSelection negDaughTrack;
206245

@@ -212,6 +251,19 @@ class FemtoDreamResoSelection
212251
femtoDreamSelection::kEqual};
213252

214253
static constexpr std::string_view kSelectionHelper[kNresoSelection] = {
254+
=======
255+
FemtoDreamTrackSelection PosDaughTrack;
256+
FemtoDreamTrackSelection NegDaughTrack;
257+
258+
static constexpr int kNresoSelection = 1;
259+
260+
static constexpr std::string_view mSelectionNames[kNresoSelection] = {"Sign"};
261+
262+
static constexpr femtoDreamSelection::SelectionType mSelectionTypes[kNresoSelection]{
263+
femtoDreamSelection::kEqual};
264+
265+
static constexpr std::string_view mSelectionHelper[kNresoSelection] = {
266+
>>>>>>> c6a3f815b (Iprovements in formatting)
215267
"+1 for Reso, -1 for AntiReso"};
216268

217269
}; // namespace femtoDream
@@ -254,12 +306,20 @@ void FemtoDreamResoSelection::init(HistogramRegistry* QAregistry, HistogramRegis
254306
this->mHistogramRegistry = Registry;
255307
this->mQAHistogramRegistry = QAregistry;
256308

309+
<<<<<<< HEAD
257310
posDaughTrack.init<PartDaugh,
311+
=======
312+
PosDaughTrack.init<PartDaugh,
313+
>>>>>>> c6a3f815b (Iprovements in formatting)
258314
aod::femtodreamparticle::kPosChild,
259315
aod::femtodreamparticle::cutContainerType>(
260316
mQAHistogramRegistry, mHistogramRegistry);
261317

318+
<<<<<<< HEAD
262319
negDaughTrack.init<PartDaugh,
320+
=======
321+
NegDaughTrack.init<PartDaugh,
322+
>>>>>>> c6a3f815b (Iprovements in formatting)
263323
aod::femtodreamparticle::kNegChild,
264324
aod::femtodreamparticle::cutContainerType>(
265325
mQAHistogramRegistry, mHistogramRegistry);
@@ -271,34 +331,54 @@ template <aod::femtodreamparticle::ParticleType part,
271331
aod::femtodreamparticle::TrackType trackType2, typename T>
272332
void FemtoDreamResoSelection::fillQA(T const& track1, T const& track2)
273333
{
334+
<<<<<<< HEAD
274335
posDaughTrack.fillQA<part, trackType1>(track1);
275336
negDaughTrack.fillQA<part, trackType2>(track2);
337+
=======
338+
PosDaughTrack.fillQA<part, trackType1>(track1);
339+
NegDaughTrack.fillQA<part, trackType2>(track2);
340+
>>>>>>> c6a3f815b (Iprovements in formatting)
276341
}
277342

278343
template <typename T, typename V>
279344
void FemtoDreamResoSelection::setDaughterCuts(femtoDreamResoSelection::Daughtertype daugh, T selVal,
280345
V selVar, femtoDreamSelection::SelectionType selType)
281346
{
282347
if (daugh == femtoDreamResoSelection::kPosdaugh) {
348+
<<<<<<< HEAD
283349
posDaughTrack.setSelection(selVal, selVar, selType);
284350
}
285351
if (daugh == femtoDreamResoSelection::kNegdaugh) {
286352
negDaughTrack.setSelection(selVal, selVar, selType);
353+
=======
354+
PosDaughTrack.setSelection(selVal, selVar, selType);
355+
};
356+
if (daugh == femtoDreamResoSelection::kNegdaugh) {
357+
NegDaughTrack.setSelection(selVal, selVar, selType);
358+
>>>>>>> c6a3f815b (Iprovements in formatting)
287359
}
288360
}
289361

290362
template <typename T, typename V>
291363
void FemtoDreamResoSelection::setDaughterPIDSpecies(T const& daugh, V& pids)
292364
{
293365
if (daugh == femtoDreamResoSelection::kPosdaugh) {
366+
<<<<<<< HEAD
294367
posDaughTrack.setPIDSpecies(pids);
295368
}
296369
if (daugh == femtoDreamResoSelection::kNegdaugh) {
297370
negDaughTrack.setPIDSpecies(pids);
371+
=======
372+
PosDaughTrack.setPIDSpecies(pids);
373+
}
374+
if (daugh == femtoDreamResoSelection::kNegdaugh) {
375+
NegDaughTrack.setPIDSpecies(pids);
376+
>>>>>>> c6a3f815b (Iprovements in formatting)
298377
}
299378
}
300379

301380
template <typename V>
381+
<<<<<<< HEAD
302382
bool FemtoDreamResoSelection::daughterSelectionPos(V const& track1, bool useThreshold)
303383
{
304384
return posDaughTrack.isSelectedMinimal(track1, useThreshold);
@@ -308,6 +388,17 @@ template <typename V>
308388
bool FemtoDreamResoSelection::daughterSelectionNeg(V const& track2, bool useThreshold)
309389
{
310390
return negDaughTrack.isSelectedMinimal(track2, useThreshold);
391+
=======
392+
bool FemtoDreamResoSelection::DaughterSelectionPos(V const& track1, bool UseThreshold)
393+
{
394+
return PosDaughTrack.isSelectedMinimal(track1, UseThreshold);
395+
}
396+
397+
template <typename V>
398+
bool FemtoDreamResoSelection::DaughterSelectionNeg(V const& track2, bool UseThreshold)
399+
{
400+
return NegDaughTrack.isSelectedMinimal(track2, UseThreshold);
401+
>>>>>>> c6a3f815b (Iprovements in formatting)
311402
}
312403

313404
template <typename T>
@@ -319,13 +410,23 @@ std::pair<bool, bool> FemtoDreamResoSelection::checkCombination(T const& PosTrac
319410
auto [part1, part2] = getPIDPairFromMother(mother);
320411

321412
float nSigPosTPC1 = o2::aod::pidutils::tpcNSigma(part1, PosTrack) - mPIDoffsetTPC;
413+
<<<<<<< HEAD
322414
float nSigPosTOF1 = posDaughTrack.getNsigmaTOF(PosTrack, part1) - mPIDoffsetTOF; /// for TOF use function in TrackSelection, because it also checks hasTOF()
323415
float nSigPosTPC2 = o2::aod::pidutils::tpcNSigma(part2, PosTrack) - mPIDoffsetTPC;
324416
float nSigPosTOF2 = posDaughTrack.getNsigmaTOF(PosTrack, part2) - mPIDoffsetTOF;
325417
float nSigNegTPC1 = o2::aod::pidutils::tpcNSigma(part1, NegTrack) - mPIDoffsetTPC;
326418
float nSigNegTOF1 = negDaughTrack.getNsigmaTOF(NegTrack, part1) - mPIDoffsetTOF;
327419
float nSigNegTPC2 = o2::aod::pidutils::tpcNSigma(part2, NegTrack) - mPIDoffsetTPC;
328420
float nSigNegTOF2 = negDaughTrack.getNsigmaTOF(NegTrack, part2) - mPIDoffsetTOF;
421+
=======
422+
float nSigPosTOF1 = PosDaughTrack.getNsigmaTOF(PosTrack, part1) - mPIDoffsetTOF; /// for TOF use function in TrackSelection, because it also checks hasTOF()
423+
float nSigPosTPC2 = o2::aod::pidutils::tpcNSigma(part2, PosTrack) - mPIDoffsetTPC;
424+
float nSigPosTOF2 = PosDaughTrack.getNsigmaTOF(PosTrack, part2) - mPIDoffsetTOF;
425+
float nSigNegTPC1 = o2::aod::pidutils::tpcNSigma(part1, NegTrack) - mPIDoffsetTPC;
426+
float nSigNegTOF1 = NegDaughTrack.getNsigmaTOF(NegTrack, part1) - mPIDoffsetTOF;
427+
float nSigNegTPC2 = o2::aod::pidutils::tpcNSigma(part2, NegTrack) - mPIDoffsetTPC;
428+
float nSigNegTOF2 = NegDaughTrack.getNsigmaTOF(NegTrack, part2) - mPIDoffsetTOF;
429+
>>>>>>> c6a3f815b (Iprovements in formatting)
329430

330431
if (checkPID(PosTrack, nSigPosTPC1, nSigPosTOF1, nSigPosTPC2, nSigPosTOF2) && checkPID(NegTrack, nSigNegTPC2, nSigNegTOF2, nSigNegTPC1, nSigNegTOF1)) {
331432
return {true, false};
@@ -390,11 +491,19 @@ std::array<cutContainerType, 5> FemtoDreamResoSelection::getCutContainer(V const
390491
}
391492
}
392493

494+
<<<<<<< HEAD
393495
const auto dCA1 = std::sqrt(track1.dcaXY() * track1.dcaXY() + track1.dcaZ() * track1.dcaZ());
394496
const auto dCA2 = std::sqrt(track2.dcaXY() * track2.dcaXY() + track2.dcaZ() * track2.dcaZ());
395497

396498
auto outputPosTrack = posDaughTrack.getCutContainer<false, cutContainerType>(track1, track1.pt(), track1.eta(), dCA1); // false for useItsPid
397499
auto outputNegTrack = negDaughTrack.getCutContainer<false, cutContainerType>(track2, track2.pt(), track2.eta(), dCA2);
500+
=======
501+
const auto DCA1 = std::sqrt(track1.dcaXY() * track1.dcaXY() + track1.dcaZ() * track1.dcaZ());
502+
const auto DCA2 = std::sqrt(track2.dcaXY() * track2.dcaXY() + track2.dcaZ() * track2.dcaZ());
503+
504+
auto outputPosTrack = PosDaughTrack.getCutContainer<false, cutContainerType>(track1, track1.pt(), track1.eta(), DCA1); // false for useItsPid
505+
auto outputNegTrack = NegDaughTrack.getCutContainer<false, cutContainerType>(track2, track2.pt(), track2.eta(), DCA2);
506+
>>>>>>> c6a3f815b (Iprovements in formatting)
398507

399508
const auto shiftvalue = numBitsUsed(outputSign);
400509
outputPID = (outputNegTrack.at(femtoDreamTrackSelection::TrackContainerPosition::kPID) << shiftvalue) | outputSign;
@@ -408,4 +517,8 @@ std::array<cutContainerType, 5> FemtoDreamResoSelection::getCutContainer(V const
408517
}
409518
} // namespace o2::analysis::femtoDream
410519

520+
<<<<<<< HEAD
411521
#endif // PWGCF_FEMTODREAM_CORE_FEMTODREAMRESOSELECTIONK0SHORT_H_
522+
=======
523+
#endif // PWGCF_FEMTODREAM_CORE_FEMTODREAMRESOSELECTION_H_
524+
>>>>>>> c6a3f815b (Iprovements in formatting)

PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskResoKshort.cxx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151

5252
#include <fairlogger/Logger.h>
5353

54+
#include <fstream> // delete after debugging
55+
#include <iostream> // delete in the end
5456
#include <string>
5557
#include <vector>
5658

@@ -1051,6 +1053,10 @@ struct femtoDreamProducerTaskResoKshort {
10511053
// fill the tables
10521054
auto tracksWithItsPid = soa::Attach<aod::FemtoFullTracks, aod::pidits::ITSNSigmaEl, aod::pidits::ITSNSigmaPi, aod::pidits::ITSNSigmaKa,
10531055
aod::pidits::ITSNSigmaPr, aod::pidits::ITSNSigmaDe, aod::pidits::ITSNSigmaTr, aod::pidits::ITSNSigmaHe>(tracks);
1056+
<<<<<<< HEAD
1057+
=======
1058+
1059+
>>>>>>> c6a3f815b (Iprovements in formatting)
10541060
if (ConfUseItsPid.value) {
10551061
fillCollisionsAndTracksAndV0<false, true, true, true>(col, tracks, tracksWithItsPid, fullV0s);
10561062
} else {

0 commit comments

Comments
 (0)