@@ -85,10 +85,11 @@ enum KindOfCorrType {
8585 kFT0CGLOBAL ,
8686 kFV0GLOBAL ,
8787 kMFTGLOBAL ,
88- kFV0MFT
88+ kFV0MFT ,
89+ kFT0AMFT
8990};
9091
91- static constexpr std::string_view kCorrType [] = {" Ft0aGlobal/" , " Ft0cGlobal/" , " Fv0Global/" , " MftGlobal/" , " Fv0Mft/" };
92+ static constexpr std::string_view kCorrType [] = {" Ft0aGlobal/" , " Ft0cGlobal/" , " Fv0Global/" , " MftGlobal/" , " Fv0Mft/" , " Ft0aMft/ " };
9293static constexpr std::string_view kEvntType [] = {" SE/" , " ME/" };
9394
9495AxisSpec axisEvent{10 , 0.5 , 9.5 , " #Event" , " EventAxis" };
@@ -159,6 +160,8 @@ struct LongrangeCorrelation {
159160 OutputObj<CorrelationContainer> mixedFv0Global{Form (" mixedEventFv0Global_%i_%i" , static_cast <int >(cfgMinMult), static_cast <int >(cfgMaxMult))};
160161 OutputObj<CorrelationContainer> sameFv0Mft{Form (" sameEventFv0Mft_%i_%i" , static_cast <int >(cfgMinMult), static_cast <int >(cfgMaxMult))};
161162 OutputObj<CorrelationContainer> mixedFv0Mft{Form (" mixedEventFv0Mft_%i_%i" , static_cast <int >(cfgMinMult), static_cast <int >(cfgMaxMult))};
163+ OutputObj<CorrelationContainer> sameFt0aMft{Form (" sameEventFt0aMft_%i_%i" , static_cast <int >(cfgMinMult), static_cast <int >(cfgMaxMult))};
164+ OutputObj<CorrelationContainer> mixedFt0aMft{Form (" mixedEventFt0aMft_%i_%i" , static_cast <int >(cfgMinMult), static_cast <int >(cfgMaxMult))};
162165
163166 template <KindOfCorrType corrType, KindOfEvntType evntType>
164167 void addHistos ()
@@ -253,6 +256,13 @@ struct LongrangeCorrelation {
253256 sameFv0Mft.setObject (new CorrelationContainer (Form (" sameEventFv0Mft_%i_%i" , static_cast <int >(cfgMinMult), static_cast <int >(cfgMaxMult)), Form (" sameEventFv0Mft_%i_%i" , static_cast <int >(cfgMinMult), static_cast <int >(cfgMaxMult)), corrAxis, effAxis, userAxis));
254257 mixedFv0Mft.setObject (new CorrelationContainer (Form (" mixedEventFv0Mft_%i_%i" , static_cast <int >(cfgMinMult), static_cast <int >(cfgMaxMult)), Form (" mixedEventFv0Mft_%i_%i" , static_cast <int >(cfgMinMult), static_cast <int >(cfgMaxMult)), corrAxis, effAxis, userAxis));
255258 }
259+
260+ if (doprocessFt0aMftSE || doprocessFt0aMftME) {
261+ addHistos<kFT0AMFT , kSE >();
262+ addHistos<kFT0AMFT , kME >();
263+ sameFt0aMft.setObject (new CorrelationContainer (Form (" sameEventFt0aMft_%i_%i" , static_cast <int >(cfgMinMult), static_cast <int >(cfgMaxMult)), Form (" sameEventFt0aMft_%i_%i" , static_cast <int >(cfgMinMult), static_cast <int >(cfgMaxMult)), corrAxis, effAxis, userAxis));
264+ mixedFt0aMft.setObject (new CorrelationContainer (Form (" mixedEventFt0aMft_%i_%i" , static_cast <int >(cfgMinMult), static_cast <int >(cfgMaxMult)), Form (" mixedEventFt0aMft_%i_%i" , static_cast <int >(cfgMinMult), static_cast <int >(cfgMaxMult)), corrAxis, effAxis, userAxis));
265+ }
256266 }
257267
258268 Filter fTrackSelectionITS = ncheckbit(aod::track::v001::detectorMap, (uint8_t )o2::aod::track::ITS) &&
@@ -268,14 +278,14 @@ struct LongrangeCorrelation {
268278 Filter fMftTrackColID = (aod::fwdtrack::bestCollisionId >= 0 );
269279 Filter fMftTrackDca = (nabs(aod::fwdtrack::bestDCAXY) < cfigMftDcaxy);
270280
271- double getPhiFT0 (UInt_t chno, int i)
281+ double getPhiFT0 (uint chno, int i)
272282 {
273283 ft0Det.calculateChannelCenter ();
274284 auto chPos = ft0Det.getChannelCenter (chno);
275285 return RecoDecay::phi (chPos.X () + (*offsetFT0)[i].getX (), chPos.Y () + (*offsetFT0)[i].getY ());
276286 }
277287
278- double getPhiFV0 (UInt_t chno)
288+ double getPhiFV0 (uint chno)
279289 {
280290 int cellsInLeft[] = {0 , 1 , 2 , 3 , 8 , 9 , 10 , 11 , 16 , 17 , 18 , 19 , 24 , 25 , 26 , 27 , 32 , 40 , 33 , 41 , 34 , 42 , 35 , 43 };
281291 bool isChnoInLeft = std::find (std::begin (cellsInLeft), std::end (cellsInLeft), chno) != std::end (cellsInLeft);
@@ -296,7 +306,7 @@ struct LongrangeCorrelation {
296306 return RecoDecay::phi (chPos.x + offsetX, chPos.y + offsetY);
297307 }
298308
299- double getEtaFT0 (UInt_t chno, int i)
309+ double getEtaFT0 (uint chno, int i)
300310 {
301311 ft0Det.calculateChannelCenter ();
302312 auto chPos = ft0Det.getChannelCenter (chno);
@@ -308,7 +318,7 @@ struct LongrangeCorrelation {
308318 return -std::log (std::tan (0.5 * theta));
309319 }
310320
311- double getEtaFV0 (UInt_t chno)
321+ double getEtaFV0 (uint chno)
312322 {
313323 int cellsInLeft[] = {0 , 1 , 2 , 3 , 8 , 9 , 10 , 11 , 16 , 17 , 18 , 19 , 24 , 25 , 26 , 27 , 32 , 40 , 33 , 41 , 34 , 42 , 35 , 43 };
314324 bool isChnoInLeft = std::find (std::begin (cellsInLeft), std::end (cellsInLeft), chno) != std::end (cellsInLeft);
@@ -367,22 +377,16 @@ struct LongrangeCorrelation {
367377 template <KindOfCorrType corrType, KindOfEvntType evntType, typename TTracks>
368378 void fillYield (TTracks tracks)
369379 {
370- if (evntType == 1 ) {
371- histos.fill (HIST (kCorrType [corrType]) + HIST (kEvntType [evntType]) + HIST (" hMult" ), tracks.size ());
372- for (auto const & iTrk : tracks) {
373- histos.fill (HIST (kCorrType [corrType]) + HIST (kEvntType [evntType]) + HIST (" Trig_etavsphi" ), iTrk.phi (), iTrk.eta ());
374- histos.fill (HIST (kCorrType [corrType]) + HIST (kEvntType [evntType]) + HIST (" Trig_eta" ), iTrk.eta ());
375- histos.fill (HIST (kCorrType [corrType]) + HIST (kEvntType [evntType]) + HIST (" Trig_phi" ), iTrk.phi ());
376- histos.fill (HIST (kCorrType [corrType]) + HIST (kEvntType [evntType]) + HIST (" Trig_pt" ), iTrk.pt ());
377- }
378- } else {
379- histos.fill (HIST (kCorrType [corrType]) + HIST (kEvntType [evntType]) + HIST (" hMult" ), tracks.size ());
380- for (auto const & iTrk : tracks) {
381- histos.fill (HIST (kCorrType [corrType]) + HIST (kEvntType [evntType]) + HIST (" Trig_etavsphi" ), iTrk.phi (), iTrk.eta ());
382- histos.fill (HIST (kCorrType [corrType]) + HIST (kEvntType [evntType]) + HIST (" Trig_eta" ), iTrk.eta ());
383- histos.fill (HIST (kCorrType [corrType]) + HIST (kEvntType [evntType]) + HIST (" Trig_phi" ), iTrk.phi ());
384- histos.fill (HIST (kCorrType [corrType]) + HIST (kEvntType [evntType]) + HIST (" Trig_pt" ), iTrk.pt ());
380+ histos.fill (HIST (kCorrType [corrType]) + HIST (kEvntType [evntType]) + HIST (" hMult" ), tracks.size ());
381+ for (auto const & iTrk : tracks) {
382+ auto phi = iTrk.phi ();
383+ if constexpr (corrType == kFV0MFT || corrType == kFT0AMFT ) {
384+ o2::math_utils::bringTo02Pi (phi);
385385 }
386+ histos.fill (HIST (kCorrType [corrType]) + HIST (kEvntType [evntType]) + HIST (" Trig_etavsphi" ), phi, iTrk.eta ());
387+ histos.fill (HIST (kCorrType [corrType]) + HIST (kEvntType [evntType]) + HIST (" Trig_eta" ), iTrk.eta ());
388+ histos.fill (HIST (kCorrType [corrType]) + HIST (kEvntType [evntType]) + HIST (" Trig_phi" ), phi);
389+ histos.fill (HIST (kCorrType [corrType]) + HIST (kEvntType [evntType]) + HIST (" Trig_pt" ), iTrk.pt ());
386390 }
387391 }
388392
@@ -597,6 +601,55 @@ struct LongrangeCorrelation {
597601 } // trigger tracks
598602 } // fillCorrFv0Mft
599603
604+ template <CorrelationContainer::CFStep step, typename TTarget, typename TTracks, typename TTriggers, typename TFT0s>
605+ void fillCorrFt0aMft (TTarget target, TTracks const & tracks, TTriggers const & triggers, TFT0s const & ft0, bool mixing, float vz)
606+ {
607+ int fSampleIndex = gRandom ->Uniform (0 , cfgSampleSize);
608+ if (!mixing)
609+ histos.fill (HIST (" Ft0aMft/SE/hMult_used" ), tracks.size ());
610+ for (auto const & triggerTrack : triggers) {
611+ if (!isMftTrackSelected (triggerTrack)) {
612+ continue ;
613+ }
614+ if (!mixing)
615+ histos.fill (HIST (" Ft0aMft/SE/Trig_hist" ), fSampleIndex , vz, triggerTrack.pt ());
616+
617+ auto trigphi = triggerTrack.phi ();
618+ o2::math_utils::bringTo02Pi (trigphi);
619+
620+ for (std::size_t iCh = 0 ; iCh < ft0.channelA ().size (); iCh++) {
621+ auto chanelid = ft0.channelA ()[iCh];
622+ float ampl = ft0.amplitudeA ()[iCh];
623+
624+ if (mixing)
625+ histos.fill (HIST (" Ft0aMft/ME/Assoc_amp" ), chanelid, ampl);
626+ else
627+ histos.fill (HIST (" Ft0aMft/SE/Assoc_amp" ), chanelid, ampl);
628+
629+ auto phi = getPhiFT0 (chanelid, 0 );
630+ auto eta = getEtaFT0 (chanelid, 0 );
631+
632+ if (mixing) {
633+ histos.fill (HIST (" Ft0aMft/ME/Assoc_eta" ), eta);
634+ histos.fill (HIST (" Ft0aMft/ME/Assoc_phi" ), phi);
635+ histos.fill (HIST (" Ft0aMft/ME/Assoc_etavsphi" ), phi, eta);
636+ } else {
637+ histos.fill (HIST (" Ft0aMft/SE/Assoc_eta" ), eta);
638+ histos.fill (HIST (" Ft0aMft/SE/Assoc_phi" ), phi);
639+ histos.fill (HIST (" Ft0aMft/SE/Assoc_etavsphi" ), phi, eta);
640+ }
641+
642+ float deltaPhi = RecoDecay::constrainAngle (trigphi - phi, -PIHalf);
643+ float deltaEta = triggerTrack.eta () - eta;
644+ if (mixing)
645+ histos.fill (HIST (" Ft0aMft/ME/deltaEta_deltaPhi" ), deltaPhi, deltaEta);
646+ else
647+ histos.fill (HIST (" Ft0aMft/SE/deltaEta_deltaPhi" ), deltaPhi, deltaEta);
648+ target->getPairHist ()->Fill (step, fSampleIndex , vz, triggerTrack.pt (), triggerTrack.pt (), deltaPhi, deltaEta);
649+ } // associated ft0 tracks
650+ } // trigger tracks
651+ } // fillCorrFt0aMft
652+
600653 void processEventStat (CollTable::iterator const & col)
601654 {
602655 histos.fill (HIST (" QA/EventHist" ), 1 );
@@ -691,6 +744,21 @@ struct LongrangeCorrelation {
691744 }
692745 } // same event
693746
747+ void processFt0aMftSE (CollTable::iterator const & col, aod::FT0s const &, TrksTable const & tracks, MftTrkTable const & mfttracks)
748+ {
749+ if (!isEventSelected (col)) {
750+ return ;
751+ }
752+ if (col.has_foundFT0 ()) {
753+ fillYield<kFT0AMFT , kSE >(mfttracks);
754+ const auto & ft0 = col.foundFT0 ();
755+ if (tracks.size () < cfgMinMult || tracks.size () >= cfgMaxMult) {
756+ return ;
757+ }
758+ fillCorrFt0aMft<CorrelationContainer::kCFStepReconstructed >(sameFt0aMft, tracks, mfttracks, ft0, false , col.posZ ());
759+ }
760+ } // same event
761+
694762 void processFt0aGlobalME (CollTable const & col, aod::FT0s const &, TrksTable const & tracks)
695763 {
696764 auto getTracksSize = [&tracks, this ](CollTable::iterator const & collision) {
@@ -826,6 +894,35 @@ struct LongrangeCorrelation {
826894 }
827895 } // mixed event
828896
897+ void processFt0aMftME (CollTable const & col, aod::FT0s const &, TrksTable const & tracks, MftTrkTable const & mfttracks)
898+ {
899+ auto getTracksSize = [&tracks, this ](CollTable::iterator const & collision) {
900+ auto associatedTracks = tracks.sliceByCached (o2::aod::track::collisionId, collision.globalIndex (), this ->cache );
901+ return associatedTracks.size ();
902+ };
903+
904+ using MixedBinning = FlexibleBinningPolicy<std::tuple<decltype (getTracksSize)>, aod::collision::PosZ, decltype (getTracksSize)>;
905+ MixedBinning binningOnVtxAndMult{{getTracksSize}, {axisVtxZME, axisMultME}, true };
906+ for (auto const & [col1, col2] : soa::selfCombinations (binningOnVtxAndMult, mixingParameter, -1 , col, col)) {
907+ if (!isEventSelected (col1) || !isEventSelected (col2)) {
908+ continue ;
909+ }
910+ if (col1.globalIndex () == col2.globalIndex ()) {
911+ continue ;
912+ }
913+ if (col1.has_foundFT0 () && col2.has_foundFT0 ()) {
914+ auto slicedGlobalTracks = tracks.sliceBy (perColGlobal, col1.globalIndex ());
915+ auto slicedTriggerMftTracks = mfttracks.sliceBy (perColMft, col1.globalIndex ());
916+ fillYield<kFT0AMFT , kME >(slicedTriggerMftTracks);
917+ const auto & ft0 = col2.foundFT0 ();
918+ if (slicedGlobalTracks.size () < cfgMinMult || slicedGlobalTracks.size () >= cfgMaxMult) {
919+ continue ;
920+ }
921+ fillCorrFt0aMft<CorrelationContainer::kCFStepReconstructed >(mixedFt0aMft, slicedGlobalTracks, slicedTriggerMftTracks, ft0, true , col1.posZ ());
922+ }
923+ }
924+ } // mixed event
925+
829926 PROCESS_SWITCH (LongrangeCorrelation, processEventStat, " event stat" , false );
830927 PROCESS_SWITCH (LongrangeCorrelation, processFt0aGlobalSE, " same event FT0a vs global" , false );
831928 PROCESS_SWITCH (LongrangeCorrelation, processFt0aGlobalME, " mixed event FT0a vs global" , false );
@@ -837,6 +934,8 @@ struct LongrangeCorrelation {
837934 PROCESS_SWITCH (LongrangeCorrelation, processFv0GlobalME, " mixed event FV0 vs global" , false );
838935 PROCESS_SWITCH (LongrangeCorrelation, processFv0MftSE, " same event FV0 vs MFT" , false );
839936 PROCESS_SWITCH (LongrangeCorrelation, processFv0MftME, " mixed event FV0 vs MFT" , false );
937+ PROCESS_SWITCH (LongrangeCorrelation, processFt0aMftSE, " same event FT0a vs MFT" , false );
938+ PROCESS_SWITCH (LongrangeCorrelation, processFt0aMftME, " mixed event FT0a vs MFT" , false );
840939};
841940
842941WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
0 commit comments