@@ -42,13 +42,15 @@ struct flowTest {
4242
4343 ConfigurableAxis axisB{" axisB" , {100 , 0 .0f , 20 .0f }, " " };
4444 ConfigurableAxis axisPhi{" axisPhi" , {100 , 0 .0f , 2 .0f * TMath::Pi ()}, " " };
45+ ConfigurableAxis axisNch{" axisNch" , {300 , 0 .0f , 3000 .0f }, " Nch in |eta|<0.8" };
4546
4647 ConfigurableAxis axisPt{" axisPt" , {VARIABLE_WIDTH, 0 .0f , 0 .1f , 0 .2f , 0 .3f , 0 .4f , 0 .5f , 0 .6f , 0 .7f , 0 .8f , 0 .9f , 1 .0f , 1 .1f , 1 .2f , 1 .3f , 1 .4f , 1 .5f , 1 .6f , 1 .7f , 1 .8f , 1 .9f , 2 .0f , 2 .2f , 2 .4f , 2 .6f , 2 .8f , 3 .0f , 3 .2f , 3 .4f , 3 .6f , 3 .8f , 4 .0f , 4 .4f , 4 .8f , 5 .2f , 5 .6f , 6 .0f , 6 .5f , 7 .0f , 7 .5f , 8 .0f , 9 .0f , 10 .0f , 11 .0f , 12 .0f }, " pt axis" };
4748
4849 void init (InitContext&)
4950 {
5051 // pT histograms
5152 histos.add <TH1>(" hImpactParameter" , " hImpactParameter" , HistType::kTH1D , {axisB});
53+ histos.add <TH2>(" hNchVsImpactParameter" , " hNchVsImpactParameter" , HistType::kTH2D , {axisB, axisNch});
5254 histos.add <TH1>(" hEventPlaneAngle" , " hEventPlaneAngle" , HistType::kTH1D , {axisPhi});
5355 histos.add <TH2>(" hPtVsPhiGenerated" , " hPtVsPhiGenerated" , HistType::kTH2D , {axisPhi, axisPt});
5456 histos.add <TH2>(" hPtVsPhiGlobal" , " hPtVsPhiGlobal" , HistType::kTH2D , {axisPhi, axisPt});
@@ -80,6 +82,8 @@ struct flowTest {
8082 if (evPhi < 0 )
8183 evPhi += 2 . * TMath::Pi ();
8284
85+ long nCh = 0 ;
86+
8387 if (imp > minB && imp < maxB) {
8488 // event within range
8589 histos.fill (HIST (" hImpactParameter" ), imp);
@@ -104,6 +108,8 @@ struct flowTest {
104108 histos.fill (HIST (" hPtVsPhiGenerated" ), deltaPhi, mcParticle.pt ());
105109 histos.fill (HIST (" hBVsPtVsPhiGenerated" ), imp, deltaPhi, mcParticle.pt ());
106110
111+ nCh++;
112+
107113 bool validGlobal = false ;
108114 bool validTrack = false ;
109115 bool validTPCTrack = false ;
@@ -146,94 +152,75 @@ struct flowTest {
146152 histos.fill (HIST (" hBVsPtVsPhiITSABTrack" ), imp, deltaPhi, mcParticle.pt ());
147153 }
148154 }
155+ histos.fill (HIST (" hNchVsImpactParameter" ), imp, nCh);
149156 }
150157
151158 using LabeledCascades = soa::Join<aod::CascDataExt, aod::McCascLabels>;
152159
153- void processCascade (aod::McParticles const & mcParticles, LabeledCascades const & cascades, recoTracks const &, aod::McCollisions const &)
160+ void processCascade (aod::McParticle const & mcParticle, soa::SmallGroups< LabeledCascades> const & cascades, recoTracks const &, aod::McCollisions const &)
154161 {
155- std::vector<bool > isRecoed;
156- isRecoed.resize (mcParticles.size (), false );
157- for (auto const & cascade : cascades) {
158- if (cascade.has_mcParticle ()) {
159- isRecoed[cascade.mcParticleId ()] = true ;
160- }
161- }
162-
163- for (auto const & mcParticle : mcParticles) {
164- auto mcCollision = mcParticle.mcCollision ();
165- float imp = mcCollision.impactParameter ();
166-
167- int pdgCode = TMath::Abs (mcParticle.pdgCode ());
168- if (pdgCode != 3312 && pdgCode != 3334 )
169- return ;
170-
171- if (!mcParticle.isPhysicalPrimary ())
172- return ;
173- if (TMath::Abs (mcParticle.eta ()) > 0.8 )
174- return ;
162+ auto mcCollision = mcParticle.mcCollision ();
163+ float imp = mcCollision.impactParameter ();
175164
176- float deltaPhi = mcParticle.phi () - mcCollision.eventPlaneAngle ();
177- if (deltaPhi < 0 )
178- deltaPhi += 2 . * TMath::Pi ();
179- if (deltaPhi > 2 . * TMath::Pi ())
180- deltaPhi -= 2 . * TMath::Pi ();
165+ int pdgCode = TMath::Abs (mcParticle.pdgCode ());
166+ if (pdgCode != 3312 && pdgCode != 3334 )
167+ return ;
168+
169+ if (!mcParticle.isPhysicalPrimary ())
170+ return ;
171+ if (TMath::Abs (mcParticle.eta ()) > 0.8 )
172+ return ;
173+
174+ float deltaPhi = mcParticle.phi () - mcCollision.eventPlaneAngle ();
175+ if (deltaPhi < 0 )
176+ deltaPhi += 2 . * TMath::Pi ();
177+ if (deltaPhi > 2 . * TMath::Pi ())
178+ deltaPhi -= 2 . * TMath::Pi ();
179+ if (pdgCode == 3312 )
180+ histos.fill (HIST (" hBVsPtVsPhiGeneratedXi" ), imp, deltaPhi, mcParticle.pt ());
181+ if (pdgCode == 3334 )
182+ histos.fill (HIST (" hBVsPtVsPhiGeneratedOmega" ), imp, deltaPhi, mcParticle.pt ());
183+
184+ if (cascades.size () > 0 ) {
181185 if (pdgCode == 3312 )
182- histos.fill (HIST (" hBVsPtVsPhiGeneratedXi " ), imp, deltaPhi, mcParticle.pt ());
186+ histos.fill (HIST (" hBVsPtVsPhiGlobalXi " ), imp, deltaPhi, mcParticle.pt ());
183187 if (pdgCode == 3334 )
184- histos.fill (HIST (" hBVsPtVsPhiGeneratedOmega" ), imp, deltaPhi, mcParticle.pt ());
185-
186- if (isRecoed[mcParticle.globalIndex ()]) {
187- if (pdgCode == 3312 )
188- histos.fill (HIST (" hBVsPtVsPhiGlobalXi" ), imp, deltaPhi, mcParticle.pt ());
189- if (pdgCode == 3334 )
190- histos.fill (HIST (" hBVsPtVsPhiGlobalOmega" ), imp, deltaPhi, mcParticle.pt ());
191- }
188+ histos.fill (HIST (" hBVsPtVsPhiGlobalOmega" ), imp, deltaPhi, mcParticle.pt ());
192189 }
193190 }
194191 PROCESS_SWITCH (flowTest, processCascade, " Process cascades" , true );
195192
196193 using LabeledV0s = soa::Join<aod::V0Datas, aod::McV0Labels>;
197194
198- void processV0s (aod::McParticles const & mcParticles, LabeledV0s const & v0s, recoTracks const &, aod::McCollisions const &)
195+ void processV0s (aod::McParticle const & mcParticle, soa::SmallGroups< LabeledV0s> const & v0s, recoTracks const &, aod::McCollisions const &)
199196 {
200- std::vector<bool > isRecoed;
201- isRecoed.resize (mcParticles.size (), false );
202- for (auto const & v0 : v0s) {
203- if (v0.has_mcParticle ()) {
204- isRecoed[v0.mcParticleId ()] = true ;
205- }
206- }
207-
208- for (auto const & mcParticle : mcParticles) {
209- auto mcCollision = mcParticle.mcCollision ();
210- float imp = mcCollision.impactParameter ();
211-
212- int pdgCode = TMath::Abs (mcParticle.pdgCode ());
213- if (pdgCode != 310 && pdgCode != 3122 )
214- return ;
215-
216- if (!mcParticle.isPhysicalPrimary ())
217- return ;
218- if (TMath::Abs (mcParticle.eta ()) > 0.8 )
219- return ;
197+ auto mcCollision = mcParticle.mcCollision ();
198+ float imp = mcCollision.impactParameter ();
220199
221- float deltaPhi = mcParticle.phi () - mcCollision.eventPlaneAngle ();
222- if (deltaPhi < 0 )
223- deltaPhi += 2 . * TMath::Pi ();
224- if (deltaPhi > 2 . * TMath::Pi ())
225- deltaPhi -= 2 . * TMath::Pi ();
200+ int pdgCode = TMath::Abs (mcParticle.pdgCode ());
201+ if (pdgCode != 310 && pdgCode != 3122 )
202+ return ;
203+
204+ if (!mcParticle.isPhysicalPrimary ())
205+ return ;
206+ if (TMath::Abs (mcParticle.eta ()) > 0.8 )
207+ return ;
208+
209+ float deltaPhi = mcParticle.phi () - mcCollision.eventPlaneAngle ();
210+ if (deltaPhi < 0 )
211+ deltaPhi += 2 . * TMath::Pi ();
212+ if (deltaPhi > 2 . * TMath::Pi ())
213+ deltaPhi -= 2 . * TMath::Pi ();
214+ if (pdgCode == 310 )
215+ histos.fill (HIST (" hBVsPtVsPhiGeneratedK0Short" ), imp, deltaPhi, mcParticle.pt ());
216+ if (pdgCode == 3122 )
217+ histos.fill (HIST (" hBVsPtVsPhiGeneratedLambda" ), imp, deltaPhi, mcParticle.pt ());
218+
219+ if (v0s.size () > 0 ) {
226220 if (pdgCode == 310 )
227- histos.fill (HIST (" hBVsPtVsPhiGeneratedK0Short " ), imp, deltaPhi, mcParticle.pt ());
221+ histos.fill (HIST (" hBVsPtVsPhiGlobalK0Short " ), imp, deltaPhi, mcParticle.pt ());
228222 if (pdgCode == 3122 )
229- histos.fill (HIST (" hBVsPtVsPhiGeneratedLambda" ), imp, deltaPhi, mcParticle.pt ());
230-
231- if (isRecoed[mcParticle.globalIndex ()]) {
232- if (pdgCode == 310 )
233- histos.fill (HIST (" hBVsPtVsPhiGlobalK0Short" ), imp, deltaPhi, mcParticle.pt ());
234- if (pdgCode == 3122 )
235- histos.fill (HIST (" hBVsPtVsPhiGlobalLambda" ), imp, deltaPhi, mcParticle.pt ());
236- }
223+ histos.fill (HIST (" hBVsPtVsPhiGlobalLambda" ), imp, deltaPhi, mcParticle.pt ());
237224 }
238225 }
239226 PROCESS_SWITCH (flowTest, processV0s, " Process V0s" , true );
0 commit comments