2828#include " PWGCF/FemtoDream/FemtoDreamContainer.h"
2929#include " PWGCF/FemtoDream/FemtoDreamMath.h"
3030#include " PWGCF/FemtoDream/FemtoDreamPairCleaner.h"
31+ #include " PWGCF/FemtoDream/FemtoDreamDetaDphiStar.h"
32+ #include " PWGCF/FemtoDream/FemtoDreamContainer.h"
3133
3234#include " Common/DataModel/EventSelection.h"
3335#include " Common/DataModel/Multiplicity.h"
@@ -51,13 +53,13 @@ enum CFTriggers {
5153
5254static const std::vector<std::string> CfTriggerNames{" ppp" , " ppL" , " pLL" , " LLL" };
5355
54- // uint8_t trackTypeSel = o2::aod::femtodreamparticle::ParticleType::kTrack; Fix this to work instead of below hardcoded lines
55- // uint V0TypeSel = o2::aod::femtodreamparticle::ParticleType::kV0; Fix this to work instead of below hardcoded lines
56+ // uint8_t trackTypeSel = o2::aod::femtodreamparticle::ParticleType::kTrack; Fix this to work instead of below hardcoded lines
57+ // uint V0TypeSel = o2::aod::femtodreamparticle::ParticleType::kV0; Fix this to work instead of below hardcoded lines
5658static constexpr uint8_t Track = 0 ; // Track
5759static constexpr uint8_t V0 = 1 ; // V0
5860static constexpr uint8_t V0Daughter = 2 ; // V0 daughters
5961static constexpr uint32_t kSignMinusMask = 1 ;
60- static constexpr uint32_t kSignPlusMask = 1 << 1 ;
62+ static constexpr uint32_t kSignPlusMask = 2 ;
6163static constexpr uint32_t kValue0 = 0 ;
6264
6365} // namespace
@@ -78,25 +80,45 @@ struct CFFilter {
7880
7981 Produces<aod::CFFilters> tags;
8082
81- // Obtain particle and antiparticle candidates of protons and lambda hyperons for current femto collision
83+ Configurable<std::vector<float >> confQ3TriggerLimit{" Q3TriggerLimitC" , std::vector<float >{0 .6f , 0 .6f , 0 .6f , 0 .6f }, " Q3 limit for selection" };
84+ Configurable<int > Q3Trigger{" Q3Trigger" , 0 , " Choice which trigger to run" };
85+ Configurable<float > ldeltaPhiMax{" ldeltaPhiMax" , 0.017 , " Max limit of delta phi" };
86+ Configurable<float > ldeltaEtaMax{" ldeltaEtaMax" , 0.017 , " Max limit of delta eta" };
87+ Configurable<float > lmagfield{" lmagfield" , 0.5 , " Magnetic field value" };
88+
89+ // Obtain particle and antiparticle candidates of protons and lambda hyperons for current femto collision
8290 Partition<o2::aod::FemtoDreamParticles> partsProton1 = (o2::aod::femtodreamparticle::partType == Track) && ((o2::aod::femtodreamparticle::cut & kSignPlusMask ) > kValue0 );
8391 Partition<o2::aod::FemtoDreamParticles> partsLambda1 = (o2::aod::femtodreamparticle::partType == V0 ) && ((o2::aod::femtodreamparticle::cut & kSignPlusMask ) > kValue0 );
8492 Partition<o2::aod::FemtoDreamParticles> partsProton0 = (o2::aod::femtodreamparticle::partType == Track) && ((o2::aod::femtodreamparticle::cut & kSignMinusMask ) > kValue0 );
8593 Partition<o2::aod::FemtoDreamParticles> partsLambda0 = (o2::aod::femtodreamparticle::partType == V0 ) && ((o2::aod::femtodreamparticle::cut & kSignMinusMask ) > kValue0 );
8694
87- HistogramRegistry registry{" registry" , {}, OutputObjHandlingPolicy::AnalysisObject, true , true };
95+ HistogramRegistry registry{" registry" , {}, OutputObjHandlingPolicy::AnalysisObject};
96+ HistogramRegistry registryQA{" registryQA" , {}, OutputObjHandlingPolicy::AnalysisObject};
8897
89- // FemtoDreamPairCleaner<aod::femtodreamparticle::ParticleType::kTrack, aod::femtodreamparticle::ParticleType::kTrack> pairCleanerTT; Currently not used, will be needed later
98+ // FemtoDreamPairCleaner<aod::femtodreamparticle::ParticleType::kTrack, aod::femtodreamparticle::ParticleType::kTrack> pairCleanerTT; Currently not used, will be needed later
9099 FemtoDreamPairCleaner<aod::femtodreamparticle::ParticleType::kTrack , aod::femtodreamparticle::ParticleType::kV0 > pairCleanerTV;
100+ FemtoDreamDetaDphiStar<aod::femtodreamparticle::ParticleType::kTrack , aod::femtodreamparticle::ParticleType::kTrack > closePairRejectionTT;
101+ FemtoDreamDetaDphiStar<aod::femtodreamparticle::ParticleType::kTrack , aod::femtodreamparticle::ParticleType::kV0 > closePairRejectionTV0;
91102
92103 void init (o2::framework::InitContext&)
93104 {
105+ bool plotPerRadii = true ;
106+
107+ closePairRejectionTT.init (®istry, ®istryQA, ldeltaPhiMax, ldeltaEtaMax, lmagfield, plotPerRadii);
108+ closePairRejectionTV0.init (®istry, ®istryQA, ldeltaPhiMax, ldeltaEtaMax, lmagfield, plotPerRadii);
94109 registry.add (" fProcessedEvents" , " CF - event filtered;;events" , HistType::kTH1F , {{6 , -0.5 , 5.5 }});
95110 std::array<std::string, 6 > eventTitles = {" all" , " rejected" , " p-p-p" , " p-p-L" , " p-L-L" , " L-L-L" };
96111 for (size_t iBin = 0 ; iBin < eventTitles.size (); iBin++) {
97112 registry.get <TH1 >(HIST (" fProcessedEvents" ))->GetXaxis ()->SetBinLabel (iBin + 1 , eventTitles[iBin].data ());
98113 }
99- registry.add (" fSameEvent" , " CF - same event distribution;;events" , HistType::kTH1F , {{8000 , 0 , 8 }});
114+ if (Q3Trigger == 0 || Q3Trigger == 11 ) {
115+ registry.add (" fSameEventPartPPP" , " CF - same event ppp distribution for particles;;events" , HistType::kTH1F , {{8000 , 0 , 8 }});
116+ registry.add (" fSameEventAntiPartPPP" , " CF - same event ppp distribution for antiparticles;;events" , HistType::kTH1F , {{8000 , 0 , 8 }});
117+ }
118+ if (Q3Trigger == 1 || Q3Trigger == 11 ) {
119+ registry.add (" fSameEventPartPPL" , " CF - same event ppL distribution for particles;;events" , HistType::kTH1F , {{8000 , 0 , 8 }});
120+ registry.add (" fSameEventAntiPartPPL" , " CF - same event ppL distribution for antiparticles;;events" , HistType::kTH1F , {{8000 , 0 , 8 }});
121+ }
100122 }
101123
102124 float mMassProton = TDatabasePDG::Instance()->GetParticle (2212 )->Mass();
@@ -106,42 +128,114 @@ struct CFFilter {
106128 {
107129 registry.get <TH1 >(HIST (" fProcessedEvents" ))->Fill (0 );
108130 bool keepEvent[nTriplets]{false };
109-
110- // This is the main trigger part for proton-proton-Lambda
111- // pairCleanerTV -> Test if lambda hyperons don't have a daughter which is as well used as primary proton
112- // Calculate Q3 and check if it is smaller than 0.6
113- // If at collision has at least one triplet with Q3<0.6, the trigger value is set to true!
114- // IMPORTANT: Include close pair rejection here
131+ int lowQ3Triplets[2 ] = {0 , 0 };
115132 if (partsFemto.size () != 0 ) {
116- int lowQ3Triplets = 0 ;
117- if (partsLambda0.size () >= 1 && partsProton0.size () >= 2 ) {
118- for (auto & partLambda : partsLambda0) {
119- if (!pairCleanerTV.isCleanPair (partLambda, partLambda, partsFemto)) {
120- continue ;
121- }
122- for (auto & [p1, p2] : combinations (partsProton0, partsProton0)) {
123- auto Q3 = FemtoDreamMath::getQ3 (p1, mMassProton , p2, mMassProton , partLambda, mMassLambda );
124- registry.get <TH1 >(HIST (" fSameEvent" ))->Fill (Q3 );
125- if (Q3 < 1.5 )
126- lowQ3Triplets++; // real value 0.6. We use 1.5 here for testing locally because of statistics
133+ auto Q3TriggerLimit = (std::vector<float >)confQ3TriggerLimit;
134+ // TRIGGER FOR PPP TRIPLETS
135+ if (Q3Trigger == 0 || Q3Trigger == 11 ) {
136+ if (partsProton0.size () >= 3 ) {
137+ for (auto & [p1, p2, p3] : combinations (partsProton0, partsProton0, partsProton0)) {
138+ // Think if pair cleaning is needed in current framework
139+ if (closePairRejectionTT.isClosePair (p1, p2, partsFemto)) {
140+ continue ;
141+ }
142+ if (closePairRejectionTT.isClosePair (p1, p3, partsFemto)) {
143+ continue ;
144+ }
145+ if (closePairRejectionTT.isClosePair (p2, p3, partsFemto)) {
146+ continue ;
147+ }
148+ auto Q3 = FemtoDreamMath::getQ3 (p1, mMassProton , p2, mMassProton , p3, mMassProton );
149+ registry.get <TH1 >(HIST (" fSameEventPartPPP" ))->Fill (Q3 );
150+ if (Q3 < Q3TriggerLimit.at (0 )) {
151+ lowQ3Triplets[0 ]++;
152+ }
127153 }
154+ } // end if
155+
156+ if (lowQ3Triplets[0 ] == 0 ) { // if at least one triplet found in particles, no need to check antiparticles
157+ if (partsProton1.size () >= 3 ) {
158+ for (auto & [p1, p2, p3] : combinations (partsProton1, partsProton1, partsProton1)) {
159+ // Think if pair cleaning is needed in current framework
160+ if (closePairRejectionTT.isClosePair (p1, p2, partsFemto)) {
161+ continue ;
162+ }
163+ if (closePairRejectionTT.isClosePair (p1, p3, partsFemto)) {
164+ continue ;
165+ }
166+ if (closePairRejectionTT.isClosePair (p2, p3, partsFemto)) {
167+ continue ;
168+ }
169+ auto Q3 = FemtoDreamMath::getQ3 (p1, mMassProton , p2, mMassProton , p3, mMassProton );
170+ registry.get <TH1 >(HIST (" fSameEventAntiPartPPP" ))->Fill (Q3 );
171+ if (Q3 < Q3TriggerLimit.at (0 )) {
172+ lowQ3Triplets[0 ]++;
173+ }
174+ }
175+ } // end if
128176 }
129- } // end if
130- if (partsLambda1.size () >= 1 && partsProton1.size () >= 2 ) {
131- for (auto & partLambda : partsLambda1) {
132- if (!pairCleanerTV.isCleanPair (partLambda, partLambda, partsFemto)) {
133- continue ;
134- }
135- for (auto & [p1, p2] : combinations (partsProton1, partsProton1)) {
136- auto Q3 = FemtoDreamMath::getQ3 (p1, mMassProton , p2, mMassProton , partLambda, mMassLambda );
137- registry.get <TH1 >(HIST (" fSameEvent" ))->Fill (Q3 );
138- if (Q3 < 1.5 )
139- lowQ3Triplets++; // real value 0.6. We use 1.5 here for testing locally because of statistics
177+ }
178+
179+ // TRIGGER FOR PPL TRIPLETS
180+ if (Q3Trigger == 1 || Q3Trigger == 11 ) {
181+ if (partsLambda0.size () >= 1 && partsProton0.size () >= 2 ) {
182+ for (auto & partLambda : partsLambda0) {
183+ if (!pairCleanerTV.isCleanPair (partLambda, partLambda, partsFemto)) {
184+ continue ;
185+ }
186+ for (auto & [p1, p2] : combinations (partsProton0, partsProton0)) {
187+ if (closePairRejectionTT.isClosePair (p1, p2, partsFemto)) {
188+ continue ;
189+ }
190+ if (closePairRejectionTV0.isClosePair (p1, partLambda, partsFemto)) {
191+ continue ;
192+ }
193+ if (closePairRejectionTV0.isClosePair (p2, partLambda, partsFemto)) {
194+ continue ;
195+ }
196+ auto Q3 = FemtoDreamMath::getQ3 (p1, mMassProton , p2, mMassProton , partLambda, mMassLambda );
197+ registry.get <TH1 >(HIST (" fSameEventPartPPL" ))->Fill (Q3 );
198+ if (Q3 < Q3TriggerLimit.at (1 )) {
199+ lowQ3Triplets[1 ]++;
200+ }
201+ }
140202 }
203+ } // end if
204+
205+ if (lowQ3Triplets[1 ] == 0 ) { // if at least one triplet found in particles, no need to check antiparticles
206+ if (partsLambda1.size () >= 1 && partsProton1.size () >= 2 ) {
207+ for (auto & partLambda : partsLambda1) {
208+ if (!pairCleanerTV.isCleanPair (partLambda, partLambda, partsFemto)) {
209+ continue ;
210+ }
211+ for (auto & [p1, p2] : combinations (partsProton1, partsProton1)) {
212+ if (closePairRejectionTT.isClosePair (p1, p2, partsFemto)) {
213+ continue ;
214+ }
215+ if (closePairRejectionTV0.isClosePair (p1, partLambda, partsFemto)) {
216+ continue ;
217+ }
218+ if (closePairRejectionTV0.isClosePair (p2, partLambda, partsFemto)) {
219+ continue ;
220+ }
221+ auto Q3 = FemtoDreamMath::getQ3 (p1, mMassProton , p2, mMassProton , partLambda, mMassLambda );
222+ registry.get <TH1 >(HIST (" fSameEventAntiPartPPL" ))->Fill (Q3 );
223+ if (Q3 < Q3TriggerLimit.at (1 )) {
224+ lowQ3Triplets[1 ]++;
225+ }
226+ }
227+ }
228+ } // end if
141229 }
142- } // end if
143- if (lowQ3Triplets > 0 )
144- keepEvent[kPPL ] = true ;
230+ }
231+ }
232+
233+ if (lowQ3Triplets[0 ] > 0 ) {
234+ keepEvent[kPPP ] = true ;
235+ }
236+
237+ if (lowQ3Triplets[1 ] > 0 ) {
238+ keepEvent[kPPL ] = true ;
145239 }
146240
147241 tags (keepEvent[kPPP ], keepEvent[kPPL ], keepEvent[kPLL ], keepEvent[kLLL ]);
0 commit comments