99// granted to it by virtue of its status as an Intergovernmental Organization
1010// or submit itself to any jurisdiction.
1111
12- // / \file FemtoDreamResoSelection .h
12+ // / \file femtoDreamResoSelection .h
1313// / \brief Definition of the FemtoDreamResoSelection
14- // / \author Valentina Mantovani Sarti, TU München valentina.mantovani-sarti@tum.de
15- // / \author Andi Mathis, TU München, andreas.mathis@ph.tum.de
16- // / \author Luca Barioglio, TU München, luca.barioglio@cern.ch
14+ // / \author Christopher Klumm, TU München, christopher.klumm@cern.ch
15+ // / \author Nils Fabian Konert, TU München, nils.fabian.konert@cern.ch
1716
1817#ifndef PWGCF_FEMTODREAM_CORE_FEMTODREAMRESOSELECTION_H_
1918#define PWGCF_FEMTODREAM_CORE_FEMTODREAMRESOSELECTION_H_
3433#include < array>
3534#include < cstdint>
3635#include < fstream>
37- #include < iostream>
3836#include < string>
3937#include < vector>
4038
39+ namespace o2 ::analysis::femtoDream
40+ {
41+
4142using namespace o2 ;
4243using namespace o2 ::framework;
4344
44- // / std::ofstream wtftest("logResoHeader.txt", std::ios::app);
45-
46- namespace o2 ::analysis::femtoDream
47- {
4845namespace femtoDreamResoSelection
4946{
5047enum ResoSel {
@@ -94,10 +91,10 @@ class FemtoDreamResoSelection
9491 void setDaughterPIDSpecies (T const & daugh, V& pids);
9592
9693 template <typename V>
97- bool DaughterSelection1 (V const & track1, bool UseThreshold );
94+ bool daughterSelection1 (V const & track1, bool useThreshold );
9895
9996 template <typename V>
100- bool DaughterSelection2 (V const & track2, bool UseThreshold );
97+ bool daughterSelection2 (V const & track2, bool useThreshold );
10198
10299 template <typename cutContainerType, typename V>
103100 std::array<cutContainerType, 5 > getCutContainer (V const & track1, V const & track2, float sign);
@@ -110,9 +107,9 @@ class FemtoDreamResoSelection
110107 void setDaughternSigmaPIDOffset (femtoDreamResoSelection::Daughtertype daugh, float offsetTPC, float offsetTOF)
111108 {
112109 if (daugh == femtoDreamResoSelection::kPosdaugh ) {
113- PosDaughTrack .setnSigmaPIDOffset (offsetTPC, offsetTOF);
110+ posDaughtTrack .setnSigmaPIDOffset (offsetTPC, offsetTOF);
114111 } else if (daugh == femtoDreamResoSelection::kNegdaugh ) {
115- NegDaughTrack .setnSigmaPIDOffset (offsetTPC, offsetTOF);
112+ negDaughtTrack .setnSigmaPIDOffset (offsetTPC, offsetTOF);
116113 }
117114 };
118115
@@ -148,7 +145,7 @@ class FemtoDreamResoSelection
148145 std::string_view suffix = " " )
149146 {
150147 std::string outString = static_cast <std::string>(prefix);
151- outString += static_cast <std::string>(mSelectionNames [iSel]);
148+ outString += static_cast <std::string>(kSelectionNames [iSel]);
152149 outString += suffix;
153150 return outString;
154151 }
@@ -161,7 +158,7 @@ class FemtoDreamResoSelection
161158 {
162159 for (int index = 0 ; index < kNresoSelection ; index++) {
163160 std::string comp = static_cast <std::string>(prefix) +
164- static_cast <std::string>(mSelectionNames [index]);
161+ static_cast <std::string>(kSelectionNames [index]);
165162 std::string_view cmp{comp};
166163 if (obs.compare (cmp) == 0 )
167164 return index;
@@ -175,7 +172,7 @@ class FemtoDreamResoSelection
175172 static femtoDreamSelection::SelectionType
176173 getSelectionType (femtoDreamResoSelection::ResoSel iSel)
177174 {
178- return mSelectionTypes [iSel];
175+ return kSelectionTypes [iSel];
179176 }
180177
181178 // / for consistent description of the configurables
@@ -185,24 +182,24 @@ class FemtoDreamResoSelection
185182 std::string_view prefix = " " )
186183 {
187184 std::string outString = static_cast <std::string>(prefix);
188- outString += static_cast <std::string>(mSelectionHelper [iSel]);
185+ outString += static_cast <std::string>(kSelectionHelper [iSel]);
189186 return outString;
190187 }
191188
192189 private:
193190 float mDaughPTPCThr ;
194191
195- FemtoDreamTrackSelection PosDaughTrack ;
196- FemtoDreamTrackSelection NegDaughTrack ;
192+ FemtoDreamTrackSelection posDaughtTrack ;
193+ FemtoDreamTrackSelection negDaughtTrack ;
197194
198195 static constexpr int kNresoSelection = 1 ;
199196
200- static constexpr std::string_view mSelectionNames [kNresoSelection ] = {" Sign" };
197+ static constexpr std::string_view kSelectionNames [kNresoSelection ] = {" Sign" };
201198
202- static constexpr femtoDreamSelection::SelectionType mSelectionTypes [kNresoSelection ]{
199+ static constexpr femtoDreamSelection::SelectionType kSelectionTypes [kNresoSelection ]{
203200 femtoDreamSelection::kEqual };
204201
205- static constexpr std::string_view mSelectionHelper [kNresoSelection ] = {
202+ static constexpr std::string_view kSelectionHelper [kNresoSelection ] = {
206203 " +1 for Reso, -1 for AntiReso" };
207204
208205}; // namespace femtoDream
@@ -245,14 +242,14 @@ void FemtoDreamResoSelection::init(HistogramRegistry* QAregistry, HistogramRegis
245242 this ->mHistogramRegistry = Registry;
246243 this ->mQAHistogramRegistry = QAregistry;
247244
248- PosDaughTrack .init <PartDaugh,
249- aod::femtodreamparticle::kPosChild ,
250- aod::femtodreamparticle::cutContainerType>(
245+ posDaughtTrack .init <PartDaugh,
246+ aod::femtodreamparticle::kPosChild ,
247+ aod::femtodreamparticle::cutContainerType>(
251248 mQAHistogramRegistry , mHistogramRegistry );
252249
253- NegDaughTrack .init <PartDaugh,
254- aod::femtodreamparticle::kNegChild ,
255- aod::femtodreamparticle::cutContainerType>(
250+ negDaughtTrack .init <PartDaugh,
251+ aod::femtodreamparticle::kNegChild ,
252+ aod::femtodreamparticle::cutContainerType>(
256253 mQAHistogramRegistry , mHistogramRegistry );
257254 }
258255}
@@ -262,46 +259,46 @@ template <aod::femtodreamparticle::ParticleType part,
262259 aod::femtodreamparticle::TrackType trackType2, typename T>
263260void FemtoDreamResoSelection::fillQA (T const & track1, T const & track2)
264261{
265- PosDaughTrack .fillQA <part, trackType1>(track1);
266- NegDaughTrack .fillQA <part, trackType2>(track2);
262+ posDaughtTrack .fillQA <part, trackType1>(track1);
263+ negDaughtTrack .fillQA <part, trackType2>(track2);
267264}
268265
269266template <typename T, typename V>
270267void FemtoDreamResoSelection::setDaughterCuts (femtoDreamResoSelection::Daughtertype daugh, T selVal,
271268 V selVar, femtoDreamSelection::SelectionType selType)
272269{
273270 if (daugh == femtoDreamResoSelection::kPosdaugh ) {
274- PosDaughTrack .setSelection (selVal, selVar, selType);
271+ posDaughtTrack .setSelection (selVal, selVar, selType);
275272 }
276273 if (daugh == femtoDreamResoSelection::kNegdaugh ) {
277- NegDaughTrack .setSelection (selVal, selVar, selType);
274+ negDaughtTrack .setSelection (selVal, selVar, selType);
278275 }
279276}
280277
281278template <typename T, typename V>
282279void FemtoDreamResoSelection::setDaughterPIDSpecies (T const & daugh, V& pids)
283280{
284281 if (daugh == femtoDreamResoSelection::kPosdaugh ) {
285- PosDaughTrack .setPIDSpecies (pids);
282+ posDaughtTrack .setPIDSpecies (pids);
286283 }
287284 if (daugh == femtoDreamResoSelection::kNegdaugh ) {
288- NegDaughTrack .setPIDSpecies (pids);
285+ negDaughtTrack .setPIDSpecies (pids);
289286 }
290287}
291288
292289template <typename V>
293- bool FemtoDreamResoSelection::DaughterSelection1 (V const & track1, bool UseThreshold )
290+ bool FemtoDreamResoSelection::daughterSelection1 (V const & track1, bool useThreshold )
294291{
295- if (!PosDaughTrack .isSelectedMinimal (track1, UseThreshold )) {
292+ if (!posDaughtTrack .isSelectedMinimal (track1, useThreshold )) {
296293 return false ;
297294 }
298295 return true ;
299296}
300297
301298template <typename V>
302- bool FemtoDreamResoSelection::DaughterSelection2 (V const & track2, bool UseThreshold )
299+ bool FemtoDreamResoSelection::daughterSelection2 (V const & track2, bool useThreshold )
303300{
304- if (!NegDaughTrack .isSelectedMinimal (track2, UseThreshold )) {
301+ if (!negDaughtTrack .isSelectedMinimal (track2, useThreshold )) {
305302 return false ;
306303 }
307304 return true ;
@@ -319,9 +316,9 @@ bool FemtoDreamResoSelection::isResoOfKind(T const& PosTrack, T const& NegTrack,
319316
320317 bool resultPos = false ;
321318 float nSigPosTPC1 = o2::aod::pidutils::tpcNSigma (part1, PosTrack);
322- float nSigPosTOF1 = PosDaughTrack .getNsigmaTOF (PosTrack, part1); // / for TOF use function in TrackSelection, because it also checks hasTOF()
319+ float nSigPosTOF1 = posDaughtTrack .getNsigmaTOF (PosTrack, part1); // / for TOF use function in TrackSelection, because it also checks hasTOF()
323320 float nSigPosTPC2 = o2::aod::pidutils::tpcNSigma (part2, PosTrack);
324- float nSigPosTOF2 = PosDaughTrack .getNsigmaTOF (PosTrack, part2);
321+ float nSigPosTOF2 = posDaughtTrack .getNsigmaTOF (PosTrack, part2);
325322 if (PosTrack.pt () < mDaughPTPCThr ) {
326323 resultPos = (std::abs (nSigPosTPC1) <= std::abs (nSigPosTPC2));
327324 } else {
@@ -330,9 +327,9 @@ bool FemtoDreamResoSelection::isResoOfKind(T const& PosTrack, T const& NegTrack,
330327
331328 bool resultNeg = false ;
332329 float nSigNegTPC1 = o2::aod::pidutils::tpcNSigma (part1, NegTrack);
333- float nSigNegTOF1 = NegDaughTrack .getNsigmaTOF (NegTrack, part1);
330+ float nSigNegTOF1 = negDaughtTrack .getNsigmaTOF (NegTrack, part1);
334331 float nSigNegTPC2 = o2::aod::pidutils::tpcNSigma (part2, NegTrack);
335- float nSigNegTOF2 = NegDaughTrack .getNsigmaTOF (NegTrack, part2);
332+ float nSigNegTOF2 = negDaughtTrack .getNsigmaTOF (NegTrack, part2);
336333 if (NegTrack.pt () < mDaughPTPCThr ) {
337334 resultNeg = (std::abs (nSigNegTPC2) <= std::abs (nSigNegTPC1));
338335 } else {
@@ -349,17 +346,17 @@ std::array<cutContainerType, 5> FemtoDreamResoSelection::getCutContainer(V const
349346 cutContainerType outputPID = 0 ;
350347 size_t counter = 0 ;
351348 for (auto & sel : mSelections ) { // / it should just be a 1D vector with sign
352- const auto selVariable = sel.getSelectionVariable ();
349+ auto selVariable = sel.getSelectionVariable ();
353350 if (selVariable == femtoDreamResoSelection::kResoSign ) {
354351 sel.checkSelectionSetBit (sign, outputSign, counter, nullptr );
355352 }
356353 }
357354
358- const auto DCA1 = std::sqrt (track1.dcaXY () * track1.dcaXY () + track1.dcaZ () * track1.dcaZ ());
359- const auto DCA2 = std::sqrt (track2.dcaXY () * track2.dcaXY () + track2.dcaZ () * track2.dcaZ ());
355+ const auto dCA1 = std::sqrt (track1.dcaXY () * track1.dcaXY () + track1.dcaZ () * track1.dcaZ ());
356+ const auto dCA2 = std::sqrt (track2.dcaXY () * track2.dcaXY () + track2.dcaZ () * track2.dcaZ ());
360357
361- auto outputPosTrack = PosDaughTrack .getCutContainer <false , cutContainerType>(track1, track1.pt (), track1.eta (), DCA1 ); // false for useItsPid
362- auto outputNegTrack = NegDaughTrack .getCutContainer <false , cutContainerType>(track2, track2.pt (), track2.eta (), DCA2 );
358+ auto outputPosTrack = posDaughtTrack .getCutContainer <false , cutContainerType>(track1, track1.pt (), track1.eta (), dCA1 ); // false for useItsPid
359+ auto outputNegTrack = negDaughtTrack .getCutContainer <false , cutContainerType>(track2, track2.pt (), track2.eta (), dCA2 );
363360
364361 const auto shiftvalue = numBitsUsed (outputSign);
365362 outputPID = (outputNegTrack.at (femtoDreamTrackSelection::TrackContainerPosition::kPID ) << shiftvalue) | outputSign;
0 commit comments