99// granted to it by virtue of its status as an Intergovernmental Organization
1010// or submit itself to any jurisdiction.
1111//
12+ // / \file k0_mixed_events.cxx
1213// / \brief Femto3D pair mixing task
1314// / \author Sofia Tomassini, Gleb Romanenko, Nicolò Jacazio
1415// / \since 31 May 2023
@@ -44,8 +45,7 @@ using namespace o2::framework;
4445using namespace o2 ::framework::expressions;
4546
4647using FilteredCollisions = soa::Filtered<aod::SingleCollSels>;
47- using FilteredTracks = soa::Filtered<aod::SingleTrackSels_v2>; // old tables (v2)
48- // using FilteredTracks = soa::Filtered<soa::Join<aod::SingleTrackSels, aod::SinglePIDEls, aod::SinglePIDPis, aod::SinglePIDKas, aod::SinglePIDPrs, aod::SinglePIDDes, aod::SinglePIDHes>>; // new tables (v3)
48+ using FilteredTracks = soa::Filtered<soa::Join<aod::SingleTrackSels, aod::SinglePIDEls, aod::SinglePIDPis, aod::SinglePIDKas, aod::SinglePIDPrs, aod::SinglePIDDes, aod::SinglePIDHes>>;
4949
5050typedef std::shared_ptr<FilteredTracks::iterator> trkType;
5151typedef std::shared_ptr<FilteredCollisions::iterator> colType;
@@ -58,46 +58,45 @@ class ResoPair : public MyFemtoPair
5858 ResoPair () {}
5959 ResoPair (trkType const & first, trkType const & second) : MyFemtoPair(first, second)
6060 {
61- SetPair (first, second);
61+ setPair (first, second);
6262 }
6363 ResoPair (trkType const & first, trkType const & second, const bool & isidentical) : MyFemtoPair(first, second, isidentical) {}
64- bool IsClosePair () const { return MyFemtoPair::IsClosePair (_deta, _dphi, _radius ); }
65- void SetEtaDiff (const float deta) { _deta = deta; }
66- void SetPhiStarDiff (const float dphi) { _dphi = dphi; }
67- void SetPair (trkType const & first, trkType const & second)
64+ bool isClosePair () const { return MyFemtoPair::IsClosePair (mDeltaEta , mDeltaPhi , mRadius ); }
65+ void setEtaDiff (const float deta) { mDeltaEta = deta; }
66+ void setPhiStarDiff (const float dphi) { mDeltaPhi = dphi; }
67+ void setPair (trkType const & first, trkType const & second)
6868 {
6969 MyFemtoPair::SetPair (first, second);
7070 lDecayDaughter1.SetPtEtaPhiM (first->pt (), first->eta (), first->phi (), particle_mass (GetPDG1 ()));
7171 lDecayDaughter2.SetPtEtaPhiM (second->pt (), second->eta (), second->phi (), particle_mass (GetPDG2 ()));
7272 lResonance = lDecayDaughter1 + lDecayDaughter2;
7373 }
74- float GetInvMass () const
74+ float getInvMass () const
7575 {
7676 // LOG(info) << "Mass = " << lResonance.M() << " 1 " << lDecayDaughter1.M() << " 2 " << lDecayDaughter2.M();
7777 return lResonance.M ();
7878 }
79- float GetPt () const { return lResonance.Pt (); }
80- float GetRapidity () const { return lResonance.Rapidity (); }
79+ float getPt () const { return lResonance.Pt (); }
80+ float getRapidity () const { return lResonance.Rapidity (); }
8181
8282 private:
8383 TLorentzVector lDecayDaughter1, lDecayDaughter2, lResonance;
84- float _deta = 0.01 ;
85- float _dphi = 0.01 ;
86- float _radius = 1.2 ;
84+ float mDeltaEta = 0.01 ;
85+ float mDeltaPhi = 0.01 ;
86+ float mRadius = 1.2 ;
8787};
8888
8989struct K0MixedEvents {
90- // using allinfo = soa::Join<aod::Tracks, aod::TracksExtra, aod::TrackSelection, aod::pidTPCFullPr, aod::TOFSignal, aod::TracksDCA, aod::pidTOFFullPr, aod::pidTOFbeta, aod::pidTOFFullKa, aod::pidTPCFullKa, aod::pidTOFFullDe, aod::pidTPCFullDe>; // aod::pidTPCPr
91- // / Construct a registry object with direct declaration
9290 HistogramRegistry registry{" registry" , {}, OutputObjHandlingPolicy::AnalysisObject};
9391
94- Configurable<float > _min_P{" min_P" , 0.0 , " lower mometum limit" };
95- Configurable<float > _max_P{" max_P" , 100.0 , " upper mometum limit" };
92+ Configurable<std::pair<float , float >> multPercentileCut{" multPercentileCut" , std::pair<float , float >{-100 .f , 1000 .f }, " [min., max.] centrality range to keep events within" };
93+ Configurable<std::pair<float , float >> momentumCut{" momentumCut" , std::pair<float , float >{0 .f , 100 .f }, " [min., max.] momentum range to keep candidates within" };
94+ Configurable<std::pair<float , float >> dcaxyCut{" dcaxyCut" , std::pair<float , float >{-100 .f , 100 .f }, " [min., max.] dcaXY range to keep candidates within" };
95+ Configurable<std::pair<float , float >> dcazCut{" dcazCut" , std::pair<float , float >{-100 .f , 100 .f }, " [min., max.] dcaZ range to keep candidates within" };
96+ Configurable<std::pair<float , float >> dcaxyExclusionCut{" dcaxyExclusionCut" , std::pair<float , float >{100 .f , -100 .f }, " [min., max.] dcaXY range to discard candidates within" };
97+ Configurable<std::pair<float , float >> dcazExclusionCut{" dcazExclusionCut" , std::pair<float , float >{100 .f , -100 .f }, " [min., max.] dcaZ range to discard candidates within" };
98+
9699 Configurable<float > _eta{" eta" , 100.0 , " abs eta value limit" };
97- Configurable<float > _dcaXY{" dcaXY" , 1000.0 , " abs dcaXY value limit" };
98- Configurable<float > _dcaXYmin{" dcaXYmin" , -0.1 , " abs dcaXY min. value limit" };
99- Configurable<float > _dcaZ{" dcaZ" , 1000.0 , " abs dcaZ value limit" };
100- Configurable<float > _dcaZmin{" dcaZmin" , -0.1 , " abs dcaZ min. value limit" };
101100 Configurable<int16_t > _tpcNClsFound{" minTpcNClsFound" , 0 , " minimum allowed number of TPC clasters" };
102101 Configurable<float > _tpcChi2NCl{" tpcChi2NCl" , 100.0 , " upper limit for chi2 value of a fit over TPC clasters" };
103102 Configurable<float > _tpcCrossedRowsOverFindableCls{" tpcCrossedRowsOverFindableCls" , 0 , " lower limit of TPC CrossedRows/FindableCls value" };
@@ -149,12 +148,14 @@ struct K0MixedEvents {
149148
150149 std::unique_ptr<ResoPair> Pair = std::make_unique<ResoPair>();
151150
152- Filter pFilter = o2::aod::singletrackselector::p > _min_P && o2::aod::singletrackselector::p < _max_P ;
151+ Filter pFilter = o2::aod::singletrackselector::p > momentumCut.value.first && o2::aod::singletrackselector::p < momentumCut.value.second ;
153152 Filter etaFilter = nabs(o2::aod::singletrackselector::eta) < _eta;
154153 Filter tpcTrkFilter = o2::aod::singletrackselector::tpcNClsFound >= _tpcNClsFound && o2::aod::singletrackselector::tpcNClsShared <= (uint8_t )_tpcNClsShared;
154+
155155 // Filter itsNClsFilter = o2::aod::singletrackselector::itsNCls >= (uint8_t)_itsNCls;
156156
157157 Filter vertexFilter = nabs(o2::aod::singletrackselector::posZ) < _vertexZ;
158+ Filter multPercentileFilter = o2::aod::singletrackselector::multPerc > multPercentileCut.value.first&& o2::aod::singletrackselector::multPerc < multPercentileCut.value.second;
158159
159160 const char * pdgToSymbol (const int pdg)
160161 {
@@ -179,7 +180,7 @@ struct K0MixedEvents {
179180 Pair->SetIdentical (IsIdentical);
180181 Pair->SetPDG1 (_particlePDG_1);
181182 Pair->SetPDG2 (_particlePDG_2);
182- Pair->SetEtaDiff (1 );
183+ Pair->setEtaDiff (1 );
183184
184185 TPCcuts_1 = std::make_pair (_particlePDG_1, _tpcNSigma_1);
185186 TOFcuts_1 = std::make_pair (_particlePDG_1, _tofNSigma_1);
@@ -219,21 +220,21 @@ struct K0MixedEvents {
219220 { // template for identical particles from the same collision
220221
221222 LOG (debug) << " Mixing tracks of the same event" ;
222- for (uint32_t ii = 0 ; ii < tracks.size (); ii ++) { // nested loop for all the combinations
223- for (uint32_t iii = ii + 1 ; iii < tracks.size (); iii ++) {
223+ for (uint32_t trk1 = 0 ; trk1 < tracks.size (); trk1 ++) { // nested loop for all the combinations
224+ for (uint32_t trk2 = trk1 + 1 ; trk2 < tracks.size (); trk2 ++) {
224225
225- Pair->SetPair (tracks[ii ], tracks[iii ]);
226+ Pair->setPair (tracks[trk1 ], tracks[trk2 ]);
226227
227228 registry.fill (HIST (" SEcand" ), 1 .f );
228- if (!Pair->IsClosePair ()) {
229+ if (!Pair->isClosePair ()) {
229230 continue ;
230231 }
231- if (std::abs (Pair->GetRapidity ()) > 0 .5f ) {
232+ if (std::abs (Pair->getRapidity ()) > 0 .5f ) {
232233 continue ;
233234 }
234235 registry.fill (HIST (" SEcand" ), 2 .f );
235- registry.fill (HIST (" SE" ), Pair->GetInvMass ()); // close pair rejection and fillig the SE histo
236- registry.fill (HIST (" SEvsPt" ), Pair->GetInvMass (), Pair->GetPt ()); // close pair rejection and fillig the SE histo
236+ registry.fill (HIST (" SE" ), Pair->getInvMass ()); // close pair rejection and fillig the SE histo
237+ registry.fill (HIST (" SEvsPt" ), Pair->getInvMass (), Pair->getPt ()); // close pair rejection and fillig the SE histo
237238 }
238239 }
239240 }
@@ -242,27 +243,27 @@ struct K0MixedEvents {
242243 void mixTracks (Type const & tracks1, Type const & tracks2)
243244 {
244245 LOG (debug) << " Mixing tracks of two different events" ;
245- for (auto ii : tracks1) {
246- for (auto iii : tracks2) {
246+ for (auto trk1 : tracks1) {
247+ for (auto trk2 : tracks2) {
247248
248- Pair->SetPair (ii, iii );
249+ Pair->setPair (trk1, trk2 );
249250
250251 if constexpr (isSameEvent) {
251252 registry.fill (HIST (" SEcand" ), 1 .f );
252253 }
253- if (!Pair->IsClosePair ()) {
254+ if (!Pair->isClosePair ()) {
254255 continue ;
255256 }
256- if (std::abs (Pair->GetRapidity ()) > 0 .5f ) {
257+ if (std::abs (Pair->getRapidity ()) > 0 .5f ) {
257258 continue ;
258259 }
259260 if constexpr (isSameEvent) {
260261 registry.fill (HIST (" SEcand" ), 2 .f );
261- registry.fill (HIST (" SE" ), Pair->GetInvMass ());
262- registry.fill (HIST (" SEvsPt" ), Pair->GetInvMass (), Pair->GetPt ());
262+ registry.fill (HIST (" SE" ), Pair->getInvMass ());
263+ registry.fill (HIST (" SEvsPt" ), Pair->getInvMass (), Pair->getPt ());
263264 } else {
264- registry.fill (HIST (" ME" ), Pair->GetInvMass ());
265- registry.fill (HIST (" MEvsPt" ), Pair->GetInvMass (), Pair->GetPt ());
265+ registry.fill (HIST (" ME" ), Pair->getInvMass ());
266+ registry.fill (HIST (" MEvsPt" ), Pair->getInvMass (), Pair->getPt ());
266267 }
267268 }
268269 }
@@ -295,17 +296,37 @@ struct K0MixedEvents {
295296 if (track.tpcCrossedRowsOverFindableCls () < _tpcCrossedRowsOverFindableCls) {
296297 continue ;
297298 }
298- if (track.dcaXY () < _dcaXYmin || track.dcaXY () > _dcaXY) {
299+ if (track.dcaXY () < dcaxyCut.value .first ) {
300+ continue ;
301+ }
302+ if (track.dcaXY () > dcaxyCut.value .second ) {
303+ continue ;
304+ }
305+ if (track.dcaXY () > dcaxyExclusionCut.value .first ) {
306+ continue ;
307+ }
308+ if (track.dcaXY () < dcaxyExclusionCut.value .second ) {
299309 continue ;
300310 }
301- if (track.dcaZ () < _dcaZmin || track.dcaZ () > _dcaZ) {
311+ if (track.dcaZ () < dcazCut.value .first ) {
312+ continue ;
313+ }
314+ if (track.dcaZ () > dcazCut.value .second ) {
315+ continue ;
316+ }
317+ if (track.dcaZ () > dcazExclusionCut.value .first ) {
318+ continue ;
319+ }
320+ if (track.dcaZ () < dcazExclusionCut.value .second ) {
302321 continue ;
303322 }
304323
305324 registry.fill (HIST (" Trks" ), 1 );
306- const float vtxZ = track.singleCollSel_as <FilteredCollisions>().posZ ();
307- registry.fill (HIST (" VTX" ), vtxZ);
308- if (std::abs (vtxZ) > _vertexZ)
325+ const auto & col = track.singleCollSel_as <FilteredCollisions>();
326+ registry.fill (HIST (" VTX" ), col.posZ ());
327+ if (std::abs (col.posZ ()) > _vertexZ)
328+ continue ;
329+ if (col.multPerc () > multPercentileCut.value .second || col.multPerc () < multPercentileCut.value .first )
309330 continue ;
310331 registry.fill (HIST (" eta" ), track.pt (), track.eta ());
311332 if (std::abs (track.rapidity (particle_mass (_particlePDG_1))) > _maxy) {
0 commit comments