1212// / \file correlatorDplusHadrons.cxx
1313// / \author Shyam Kumar <shyam.kumar@cern.ch>
1414
15-
1615#include " Framework/AnalysisTask.h"
1716#include " PWGHF/DataModel/CandidateReconstructionTables.h"
1817#include " PWGHF/DataModel/CandidateSelectionTables.h"
@@ -58,7 +57,6 @@ const int ptDAxisBins = 180;
5857const double ptDAxisMin = 0 .;
5958const double ptDAxisMax = 36 .;
6059
61-
6260// definition of ME variables
6361std::vector<double > zBins{VARIABLE_WIDTH, -10.0 , -2.5 , 2.5 , 10.0 };
6462std::vector<double > multBins{VARIABLE_WIDTH, 0 ., 200 ., 500.0 , 5000 .};
@@ -90,7 +88,7 @@ struct HfDplusSelection {
9088 if (ptCandMin >= 0 . && candidate1.pt () < ptCandMin) {
9189 continue ;
9290 }
93- isDplusFound = 1 ;
91+ isDplusFound = 1 ;
9492 break ;
9593 }
9694 }
@@ -114,7 +112,7 @@ struct HfDplusSelection {
114112 if (ptCandMin >= 0 . && candidate1.pt () < ptCandMin) {
115113 continue ;
116114 }
117- isDplusFound = 1 ;
115+ isDplusFound = 1 ;
118116 break ;
119117 }
120118 }
@@ -136,7 +134,7 @@ struct HfDplusSelection {
136134 if (ptCandMin >= 0 . && particle1.pt () < ptCandMin) {
137135 continue ;
138136 }
139- isDplusFound = 1 ;
137+ isDplusFound = 1 ;
140138 break ;
141139 }
142140 dplusSel (isDplusFound);
@@ -151,7 +149,7 @@ struct HfCorrelatorDplusHadrons {
151149
152150 Produces<aod::DplusHadronPair> entryDplusHadronPair;
153151 Produces<aod::DplusHadronRecoInfo> entryDplusHadronRecoInfo;
154- Configurable<int > selectionFlagDplus{" selectionFlagDplus" , 1 , " Selection Flag for Dplus" };
152+ Configurable<int > selectionFlagDplus{" selectionFlagDplus" , 1 , " Selection Flag for Dplus" };
155153 Configurable<int > applyEfficiency{" applyEfficiency" , 1 , " Flag for applying D-meson efficiency weights" };
156154 Configurable<float > yCandMax{" yCandMax" , 0.8 , " max. cand. rapidity" };
157155 Configurable<float > etaTrackMax{" etaTrackMax" , 0.8 , " max. eta of tracks" };
@@ -286,7 +284,7 @@ struct HfCorrelatorDplusHadrons {
286284 entryDplusHadronPair (getDeltaPhi (track.phi (), candidate1.phi ()),
287285 track.eta () - candidate1.eta (),
288286 candidate1.pt (),
289- track.pt (),poolBin);
287+ track.pt (), poolBin);
290288 entryDplusHadronRecoInfo (invMassDplusToPiKPi (candidate1), 0 );
291289 } // Hadron Tracks loop
292290 } // end outer Dplus loop
@@ -361,7 +359,7 @@ struct HfCorrelatorDplusHadrons {
361359 } else {
362360 registry.fill (HIST (" hMassDplusMCRecBkg" ), invMassDplusToPiKPi (candidate1), candidate1.pt (), efficiencyWeight);
363361 }
364- registry.fill (HIST (" hDplusBin" ), poolBin);
362+ registry.fill (HIST (" hDplusBin" ), poolBin);
365363 // Dplus-Hadron correlation dedicated section
366364 // if the candidate is selected as Dplus, search for Hadron and evaluate correlations
367365 flagDplusSignal = candidate1.flagMcMatchRec () == 1 << DecayType::DplusToPiKPi;
@@ -382,7 +380,7 @@ struct HfCorrelatorDplusHadrons {
382380 entryDplusHadronPair (getDeltaPhi (track.phi (), candidate1.phi ()),
383381 track.eta () - candidate1.eta (),
384382 candidate1.pt (),
385- track.pt (),poolBin);
383+ track.pt (), poolBin);
386384 entryDplusHadronRecoInfo (invMassDplusToPiKPi (candidate1), flagDplusSignal);
387385 } // end inner loop (Tracks)
388386
@@ -398,7 +396,7 @@ struct HfCorrelatorDplusHadrons {
398396 {
399397 int counterDplusHadron = 0 ;
400398 registry.fill (HIST (" hMCEvtCount" ), 0 );
401-
399+
402400 auto getTracksSize = [&particlesMc](aod::McCollision const & collision) {
403401 int nTracks = 0 ;
404402 for (auto const & track : particlesMc) {
@@ -436,8 +434,8 @@ struct HfCorrelatorDplusHadrons {
436434 }
437435 registry.fill (HIST (" hcountDplustriggersMCGen" ), 0 , particle1.pt ()); // to count trigger Dplus for normalisation)
438436 for (auto const & particle2 : particlesMc) {
439-
440- // Check Mother of particle 2
437+
438+ // Check Mother of particle 2
441439 bool flagMotherFound = false ;
442440 for (auto & m : particle2.mothers_as <aod::McParticles>()) {
443441 if (m.globalIndex () == particle1.globalIndex ()) {
@@ -462,7 +460,7 @@ struct HfCorrelatorDplusHadrons {
462460 entryDplusHadronPair (getDeltaPhi (particle2.phi (), particle1.phi ()),
463461 particle2.eta () - particle1.eta (),
464462 particle1.pt (),
465- particle2.pt (),poolBin);
463+ particle2.pt (), poolBin);
466464
467465 } // end inner loop
468466 } // end outer loop
@@ -471,17 +469,16 @@ struct HfCorrelatorDplusHadrons {
471469 registry.fill (HIST (" hMultiplicity" ), getTracksSize (mccollision));
472470 }
473471 PROCESS_SWITCH (HfCorrelatorDplusHadrons, processMcGen, " Process MC Gen mode" , false );
474-
472+
475473 // Event Mixing for the Data Mode
476474 using myCollisions = soa::Join<aod::Collisions, aod::Mults, aod::DmesonSelection>;
477475 using fullTracks = soa::Join<aod::Tracks, aod::TracksDCA>;
478476 using mySelCollisions = soa::Filtered<myCollisions>;
479477 using myTracks = soa::Filtered<fullTracks>;
480478 using myCandidatesData = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDplusToPiKPi>>;
481-
482- Filter collisionFilter = aod::hf_selection_dmeson_collision::dmesonSel==true ;
483- Filter trackFilter = (nabs(aod::track::eta) < etaTrackMax) && (nabs(aod::track::pt) > ptTrackMin) && (nabs(aod::track::dcaXY) < dcaXYTrackMax)
484- && (nabs(aod::track::dcaZ) < dcaZTrackMax);
479+
480+ Filter collisionFilter = aod::hf_selection_dmeson_collision::dmesonSel == true ;
481+ Filter trackFilter = (nabs(aod::track::eta) < etaTrackMax) && (nabs(aod::track::pt) > ptTrackMin) && (nabs(aod::track::dcaXY) < dcaXYTrackMax) && (nabs(aod::track::dcaZ) < dcaZTrackMax);
485482 Filter dplusfilter = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= 1 ;
486483
487484 void processDataMixedEvent (mySelCollisions& collisions, myCandidatesData& candidates, myTracks& tracks)
@@ -505,7 +502,7 @@ struct HfCorrelatorDplusHadrons {
505502 PROCESS_SWITCH (HfCorrelatorDplusHadrons, processDataMixedEvent, " Process Mixed Event Data" , false );
506503
507504 // Event Mixing for the MCRec Mode
508- using myCandidatesMcRec = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDplusToPiKPi, aod::HfCand3ProngMcRec>>;
505+ using myCandidatesMcRec = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDplusToPiKPi, aod::HfCand3ProngMcRec>>;
509506
510507 void processMcRecMixedEvent (mySelCollisions& collisions, myCandidatesMcRec& candidates, myTracks& tracks)
511508 {
@@ -526,64 +523,64 @@ struct HfCorrelatorDplusHadrons {
526523 }
527524 PROCESS_SWITCH (HfCorrelatorDplusHadrons, processMcRecMixedEvent, " Process Mixed Event MCRec" , false );
528525
529- // Event Mixing for the MCGen Mode
526+ // Event Mixing for the MCGen Mode
530527 using myCollisionsMcGen = soa::Join<aod::McCollisions, aod::DmesonSelection>;
531528 using fullTracksMcGen = aod::McParticles;
532- using mySelCollisionsMcGen= soa::Filtered<myCollisionsMcGen>;
533- using myTracksMcGen = soa::Filtered<fullTracksMcGen>;
534-
535- Filter collisionFilterGen = aod::hf_selection_dmeson_collision::dmesonSel== true ;
529+ using mySelCollisionsMcGen = soa::Filtered<myCollisionsMcGen>;
530+ using myTracksMcGen = soa::Filtered<fullTracksMcGen>;
531+
532+ Filter collisionFilterGen = aod::hf_selection_dmeson_collision::dmesonSel == true ;
536533 Filter particlesFilter = nabs(aod::mcparticle::pdgCode) == 411 || ((aod::mcparticle::flags & (uint8_t )o2::aod::mcparticle::enums::PhysicalPrimary) == (uint8_t )o2::aod::mcparticle::enums::PhysicalPrimary);
537-
538- void processMcGenMixedEvent (mySelCollisionsMcGen& collisions, myTracksMcGen& particlesMc)
539- {
540-
534+
535+ void processMcGenMixedEvent (mySelCollisionsMcGen& collisions, myTracksMcGen& particlesMc)
536+ {
537+
541538 auto getTracksSize = [&particlesMc, this ](mySelCollisionsMcGen::iterator const & collision) {
542539 int nTracks = 0 ;
543- auto associatedTracks = particlesMc.sliceByCached (o2::aod::mcparticle::mcCollisionId, collision.globalIndex (), this ->cache );
540+ auto associatedTracks = particlesMc.sliceByCached (o2::aod::mcparticle::mcCollisionId, collision.globalIndex (), this ->cache );
544541 for (auto const & track : associatedTracks) {
545542 if (track.isPhysicalPrimary () && std::abs (track.eta ()) < 1.0 ) {
546543 nTracks++;
547544 }
548545 }
549546 return nTracks;
550547 };
551-
552- using BinningTypeMcGen = FlexibleBinningPolicy<std::tuple<decltype (getTracksSize)>, aod::mccollision::PosZ, decltype (getTracksSize)>;
553- BinningTypeMcGen corrBinningMcGen{{getTracksSize}, {zBins, multBins}, true };
554-
555- auto tracksTuple = std::make_tuple (particlesMc, particlesMc);
556- Pair<mySelCollisionsMcGen, myTracksMcGen, myTracksMcGen, BinningTypeMcGen> pairMcGen{corrBinningMcGen, 5 , -1 , collisions, tracksTuple, &cache};
548+
549+ using BinningTypeMcGen = FlexibleBinningPolicy<std::tuple<decltype (getTracksSize)>, aod::mccollision::PosZ, decltype (getTracksSize)>;
550+ BinningTypeMcGen corrBinningMcGen{{getTracksSize}, {zBins, multBins}, true };
551+
552+ auto tracksTuple = std::make_tuple (particlesMc, particlesMc);
553+ Pair<mySelCollisionsMcGen, myTracksMcGen, myTracksMcGen, BinningTypeMcGen> pairMcGen{corrBinningMcGen, 5 , -1 , collisions, tracksTuple, &cache};
557554
558555 for (auto & [c1, tracks1, c2, tracks2] : pairMcGen) {
559556 for (auto & [t1, t2] : o2::soa::combinations (o2::soa::CombinationsFullIndexPolicy (tracks1, tracks2))) {
560-
561- // Check track t1 is Dplus
562- if (std::abs (t1.pdgCode ()) != pdg::Code::kDPlus ) {
563- continue ;
564- }
565557
566- double yD = RecoDecay::y (array{t1.px (), t1.py (), t1.pz ()}, RecoDecay::getMassPDG (t1.pdgCode ()));
567- if (yCandMax >= 0 . && std::abs (yD) > yCandMax) {
568- continue ;
569- }
570- if (ptCandMin >= 0 . && t1.pt () < ptCandMin) {
571- continue ;
572- }
573-
574- if (std::abs (t2.eta ()) > etaTrackMax) {
558+ // Check track t1 is Dplus
559+ if (std::abs (t1.pdgCode ()) != pdg::Code::kDPlus ) {
560+ continue ;
561+ }
562+
563+ double yD = RecoDecay::y (array{t1.px (), t1.py (), t1.pz ()}, RecoDecay::getMassPDG (t1.pdgCode ()));
564+ if (yCandMax >= 0 . && std::abs (yD) > yCandMax) {
565+ continue ;
566+ }
567+ if (ptCandMin >= 0 . && t1.pt () < ptCandMin) {
568+ continue ;
569+ }
570+
571+ if (std::abs (t2.eta ()) > etaTrackMax) {
575572 continue ;
576573 }
577574 if (t2.pt () < ptTrackMin) {
578575 continue ;
579576 }
580577 int poolBin = corrBinningMcGen.getBin (std::make_tuple (c2.posZ (), getTracksSize (c2)));
581- // LOGF(info, "Mixed event collisions: Index = (%d,%d), tracks Size: (%d,%d), Z Vertex: (%f), Pool Bin: (%d)", c1.globalIndex(), c2.globalIndex(), getTracksSize(c1), getTracksSize(c2), c2.posZ(), poolBin); // For debug
578+ // LOGF(info, "Mixed event collisions: Index = (%d,%d), tracks Size: (%d,%d), Z Vertex: (%f), Pool Bin: (%d)", c1.globalIndex(), c2.globalIndex(), getTracksSize(c1), getTracksSize(c2), c2.posZ(), poolBin); // For debug
582579 entryDplusHadronPair (getDeltaPhi (t2.phi (), t1.phi ()), t2.eta () - t1.eta (), t1.pt (), t2.pt (), poolBin);
583580 }
584581 }
585- }
586- PROCESS_SWITCH (HfCorrelatorDplusHadrons, processMcGenMixedEvent, " Process Mixed Event MCGen" , false );
582+ }
583+ PROCESS_SWITCH (HfCorrelatorDplusHadrons, processMcGenMixedEvent, " Process Mixed Event MCGen" , false );
587584};
588585
589586WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
0 commit comments