4242#include < Math/Vector4Dfwd.h>
4343#include < TF1.h>
4444#include < TProfile2D.h>
45- #include < TVector2.h>
4645
4746#include < array>
4847#include < chrono>
@@ -75,7 +74,7 @@ struct lambdaTwoPartPolarization {
7574 std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now ().time_since_epoch ()).count (),
7675 " Latest acceptable timestamp of creation for the object" };
7776 } cfgCcdbParam;
78- Service<o2::ccdb::BasicCCDBManager> ccdb;
77+ Service<o2::ccdb::BasicCCDBManager> ccdb = nullptr ;
7978 o2::ccdb::CcdbApi ccdbApi;
8079
8180 Configurable<float > cfgCentSel{" cfgCentSel" , 100 ., " Centrality selection" };
@@ -140,9 +139,9 @@ struct lambdaTwoPartPolarization {
140139 TF1 * fMultPVCutLow = nullptr ;
141140 TF1 * fMultPVCutHigh = nullptr ;
142141
143- float centrality;
144- float dphi;
145- float weight;
142+ float centrality = 1 . ;
143+ float dphi = 1 . ;
144+ float weight = 1 . ;
146145
147146 TProfile2D* EffMap = nullptr ;
148147 TProfile2D* AccMap = nullptr ;
@@ -194,13 +193,13 @@ struct lambdaTwoPartPolarization {
194193
195194 ROOT ::Math::PxPyPzMVector ProtonVec1, PionVec1, LambdaVec1, ProtonBoostedVec1, PionBoostedVec1;
196195 ROOT ::Math::PxPyPzMVector ProtonVec2, PionVec2, LambdaVec2, ProtonBoostedVec2, PionBoostedVec2;
197- int V01Tag;
198- int V02Tag;
199- double costhetastar1;
200- double costhetastar2;
196+ int V01Tag = 1 ;
197+ int V02Tag = 1 ;
198+ double costhetastar1 = 0.0 ;
199+ double costhetastar2 = 0.0 ;
201200
202201 template <typename TCollision>
203- bool eventSelected (TCollision collision)
202+ bool eventSelected (TCollision const & collision)
204203 {
205204 if (!collision.sel8 ()) {
206205 return 0 ;
@@ -230,52 +229,70 @@ struct lambdaTwoPartPolarization {
230229 template <typename TCollision, typename V0 >
231230 bool selectionV0 (TCollision const & collision, V0 const & candidate, int LambdaTag)
232231 {
233- if (candidate.v0radius () < cfgv0radiusMin)
232+ if (candidate.v0radius () < cfgv0radiusMin) {
234233 return false ;
234+ }
235235 if (LambdaTag) {
236- if (std::abs (candidate.dcapostopv ()) < cfgDCAPrToPVMin)
236+ if (std::abs (candidate.dcapostopv ()) < cfgDCAPrToPVMin) {
237237 return false ;
238- if (std::abs (candidate.dcanegtopv ()) < cfgDCAPiToPVMin)
238+ }
239+ if (std::abs (candidate.dcanegtopv ()) < cfgDCAPiToPVMin) {
239240 return false ;
241+ }
240242 } else if (!LambdaTag) {
241- if (std::abs (candidate.dcapostopv ()) < cfgDCAPiToPVMin)
243+ if (std::abs (candidate.dcapostopv ()) < cfgDCAPiToPVMin) {
242244 return false ;
243- if (std::abs (candidate.dcanegtopv ()) < cfgDCAPrToPVMin)
245+ }
246+ if (std::abs (candidate.dcanegtopv ()) < cfgDCAPrToPVMin) {
244247 return false ;
248+ }
245249 }
246- if (candidate.v0cosPA () < cfgv0CosPA)
250+ if (candidate.v0cosPA () < cfgv0CosPA) {
247251 return false ;
248- if (std::abs (candidate.dcaV0daughters ()) > cfgDCAV0Dau)
252+ }
253+ if (std::abs (candidate.dcaV0daughters ()) > cfgDCAV0Dau) {
249254 return false ;
250- if (candidate.pt () < cfgV0PtMin)
255+ }
256+ if (candidate.pt () < cfgV0PtMin) {
251257 return false ;
252- if (candidate.yLambda () < cfgV0EtaMin)
258+ }
259+ if (candidate.yLambda () < cfgV0EtaMin) {
253260 return false ;
254- if (candidate.yLambda () > cfgV0EtaMax)
261+ }
262+ if (candidate.yLambda () > cfgV0EtaMax) {
255263 return false ;
256- if (candidate.distovertotmom (collision.posX (), collision.posY (), collision.posZ ()) * massLambda > cfgV0LifeTime)
264+ }
265+ if (candidate.distovertotmom (collision.posX (), collision.posY (), collision.posZ ()) * massLambda > cfgV0LifeTime) {
257266 return false ;
267+ }
258268
259269 return true ;
260270 }
261271
262272 template <typename T>
263273 bool isSelectedV0Daughter (T const & track, int pid) // pid 0: proton, pid 1: pion
264274 {
265- if (track.tpcNClsFound () < cfgDaughTPCnclsMin)
275+ if (track.tpcNClsFound () < cfgDaughTPCnclsMin) {
266276 return false ;
267- if (pid == 0 && std::abs (track.tpcNSigmaPr ()) > cfgDaughPIDCutsTPCPr)
277+ }
278+ if (pid == 0 && std::abs (track.tpcNSigmaPr ()) > cfgDaughPIDCutsTPCPr) {
268279 return false ;
269- if (pid == 1 && std::abs (track.tpcNSigmaPi ()) > cfgDaughPIDCutsTPCPi)
280+ }
281+ if (pid == 1 && std::abs (track.tpcNSigmaPi ()) > cfgDaughPIDCutsTPCPi) {
270282 return false ;
271- if (track.eta () > cfgDaughEtaMax)
283+ }
284+ if (track.eta () > cfgDaughEtaMax) {
272285 return false ;
273- if (track.eta () < cfgDaughEtaMin)
286+ }
287+ if (track.eta () < cfgDaughEtaMin) {
274288 return false ;
275- if (pid == 0 && track.pt () < cfgDaughPrPt)
289+ }
290+ if (pid == 0 && track.pt () < cfgDaughPrPt) {
276291 return false ;
277- if (pid == 1 && track.pt () < cfgDaughPiPt)
292+ }
293+ if (pid == 1 && track.pt () < cfgDaughPiPt) {
278294 return false ;
295+ }
279296
280297 return true ;
281298 }
@@ -345,11 +362,13 @@ struct lambdaTwoPartPolarization {
345362 continue ;
346363 }
347364
348- if (LambdaTag == aLambdaTag)
365+ if (LambdaTag == aLambdaTag) {
349366 continue ;
367+ }
350368
351- if (!selectionV0 (c1, v01, LambdaTag))
369+ if (!selectionV0 (c1, v01, LambdaTag)) {
352370 continue ;
371+ }
353372
354373 if (LambdaTag) {
355374 ProtonVec1 = ROOT::Math::PxPyPzMVector (v01.pxpos (), v01.pypos (), v01.pzpos (), massPr);
@@ -398,11 +417,13 @@ struct lambdaTwoPartPolarization {
398417 aLambdaTag = 1 ;
399418 }
400419
401- if (LambdaTag == aLambdaTag)
420+ if (LambdaTag == aLambdaTag) {
402421 continue ;
422+ }
403423
404- if (!selectionV0 (c1, v01, LambdaTag))
424+ if (!selectionV0 (c1, v01, LambdaTag)) {
405425 continue ;
426+ }
406427
407428 if (LambdaTag) {
408429 ProtonVec1 = ROOT::Math::PxPyPzMVector (v01.pxpos (), v01.pypos (), v01.pzpos (), massPr);
@@ -425,8 +446,9 @@ struct lambdaTwoPartPolarization {
425446 histos.fill (HIST (" Ana/Acceptance" ), v01.pt (), centrality, v01.yLambda (), costhetastar1 * costhetastar1);
426447
427448 for (auto & v02 : V02s) {
428- if (v01.v0Id () <= v02.v0Id () && doprocessDataSame)
449+ if (v01.v0Id () <= v02.v0Id () && doprocessDataSame) {
429450 continue ;
451+ }
430452 auto postrack_v02 = v02.template posTrack_as <TrackCandidates>();
431453 auto negtrack_v02 = v02.template negTrack_as <TrackCandidates>();
432454
@@ -440,15 +462,18 @@ struct lambdaTwoPartPolarization {
440462 aLambdaTag = 1 ;
441463 }
442464
443- if (LambdaTag == aLambdaTag)
465+ if (LambdaTag == aLambdaTag) {
444466 continue ;
467+ }
445468
446- if (!selectionV0 (c2, v02, LambdaTag))
469+ if (!selectionV0 (c2, v02, LambdaTag)) {
447470 continue ;
471+ }
448472
449473 if (doprocessDataSame) {
450- if (postrack_v01.globalIndex () == postrack_v02.globalIndex () || postrack_v01.globalIndex () == negtrack_v02.globalIndex () || negtrack_v01.globalIndex () == postrack_v02.globalIndex () || negtrack_v01.globalIndex () == negtrack_v02.globalIndex ())
474+ if (postrack_v01.globalIndex () == postrack_v02.globalIndex () || postrack_v01.globalIndex () == negtrack_v02.globalIndex () || negtrack_v01.globalIndex () == postrack_v02.globalIndex () || negtrack_v01.globalIndex () == negtrack_v02.globalIndex ()) {
451475 continue ; // no shared decay products
476+ }
452477 }
453478
454479 if (LambdaTag) {
@@ -556,18 +581,21 @@ struct lambdaTwoPartPolarization {
556581 {
557582 for (auto & [c1, c2] : selfCombinations (colBinningT0C, cfgNoMixedEvents, -1 , collisions, collisions)) {
558583
559- if (c1.index () == c2.index ())
584+ if (c1.index () == c2.index ()) {
560585 continue ;
586+ }
561587
562588 centrality = c1.centFT0C ();
563589 if (cfgAccCor) {
564590 auto bc = c1.bc_as <aod::BCsWithTimestamps>();
565591 AccMap = ccdb->getForTimeStamp <TProfile2D>(cfgAccCorPath.value , bc.timestamp ());
566592 }
567- if (!eventSelected (c1))
593+ if (!eventSelected (c1)) {
568594 continue ;
569- if (!eventSelected (c2))
595+ }
596+ if (!eventSelected (c2)) {
570597 continue ;
598+ }
571599
572600 auto tracks1 = V0s.sliceBy (tracksPerCollisionV0, c1.globalIndex ());
573601 auto tracks2 = V0s.sliceBy (tracksPerCollisionV0, c2.globalIndex ());
@@ -585,18 +613,21 @@ struct lambdaTwoPartPolarization {
585613 {
586614 for (auto & [c1, c2] : selfCombinations (colBinningT0M, cfgNoMixedEvents, -1 , collisions, collisions)) {
587615
588- if (c1.index () == c2.index ())
616+ if (c1.index () == c2.index ()) {
589617 continue ;
618+ }
590619
591620 centrality = c1.centFT0M ();
592621 if (cfgAccCor) {
593622 auto bc = c1.bc_as <aod::BCsWithTimestamps>();
594623 AccMap = ccdb->getForTimeStamp <TProfile2D>(cfgAccCorPath.value , bc.timestamp ());
595624 }
596- if (!eventSelected (c1))
625+ if (!eventSelected (c1)) {
597626 continue ;
598- if (!eventSelected (c2))
627+ }
628+ if (!eventSelected (c2)) {
599629 continue ;
630+ }
600631
601632 auto tracks1 = V0s.sliceBy (tracksPerCollisionV0, c1.globalIndex ());
602633 auto tracks2 = V0s.sliceBy (tracksPerCollisionV0, c2.globalIndex ());
0 commit comments