@@ -43,8 +43,8 @@ using namespace o2;
4343using namespace o2 ::framework;
4444using namespace o2 ::framework::expressions;
4545
46- struct ptSpectraInclusiveUpc {
47-
46+ struct ptSpectraInclusiveUpc {
47+
4848 HistogramRegistry histos{" histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
4949
5050 Configurable<int > nBinsPt{" nBinsPt" , 100 , " N bins in pT histos" };
@@ -76,7 +76,8 @@ struct ptSpectraInclusiveUpc{
7676 const double sigmaMax = 3 .;
7777 const double dcaZlimit = 2 .;
7878
79- void init (InitContext const &){
79+ void init (InitContext const &)
80+ {
8081
8182 massPion = o2::constants::physics::MassPionCharged;
8283 massKaon = o2::constants::physics::MassKaonCharged;
@@ -88,48 +89,49 @@ struct ptSpectraInclusiveUpc{
8889 const AxisSpec axisDCAxy{nBinsDCAxy, -0.6 , 0.6 , " DCA_{xy} cm" };
8990
9091 // histograms
91- histos.add (" ptGeneratedPion" , " ptGeneratedPion" , kTH1F , {axisPt});
92- histos.add (" ptGeneratedKaon" , " ptGeneratedKaon" , kTH1F , {axisPt});
92+ histos.add (" ptGeneratedPion" , " ptGeneratedPion" , kTH1F , {axisPt});
93+ histos.add (" ptGeneratedKaon" , " ptGeneratedKaon" , kTH1F , {axisPt});
9394 histos.add (" ptGeneratedProton" , " ptGeneratedProton" , kTH1F , {axisPt});
9495
95- histos.add (" ptReconstructedTPCPion" , " ptReconstructedTPCPion" , kTH1F , {axisPt});
96- histos.add (" ptReconstructedTPCKaon" , " ptReconstructedTPCKaon" , kTH1F , {axisPt});
96+ histos.add (" ptReconstructedTPCPion" , " ptReconstructedTPCPion" , kTH1F , {axisPt});
97+ histos.add (" ptReconstructedTPCKaon" , " ptReconstructedTPCKaon" , kTH1F , {axisPt});
9798 histos.add (" ptReconstructedTPCProton" , " ptReconstructedTPCProton" , kTH1F , {axisPt});
9899
99- histos.add (" ptReconstructedTOFPion" , " ptReconstructedTOFPion" , kTH1F , {axisPt});
100- histos.add (" ptReconstructedTOFKaon" , " ptReconstructedTOFKaon" , kTH1F , {axisPt});
100+ histos.add (" ptReconstructedTOFPion" , " ptReconstructedTOFPion" , kTH1F , {axisPt});
101+ histos.add (" ptReconstructedTOFKaon" , " ptReconstructedTOFKaon" , kTH1F , {axisPt});
101102 histos.add (" ptReconstructedTOFProton" , " ptReconstructedTOFProton" , kTH1F , {axisPt});
102103
103- histos.add (" ptDataTPCPion" , " ptDataTPCPion" , kTH1F , {axisPt});
104- histos.add (" ptDataTPCKaon" , " ptDataTPCKaon" , kTH1F , {axisPt});
104+ histos.add (" ptDataTPCPion" , " ptDataTPCPion" , kTH1F , {axisPt});
105+ histos.add (" ptDataTPCKaon" , " ptDataTPCKaon" , kTH1F , {axisPt});
105106 histos.add (" ptDataTPCProton" , " ptDataTPCProton" , kTH1F , {axisPt});
106107
107- histos.add (" ptDataTOFPion" , " ptDataTOFPion" , kTH1F , {axisPt});
108- histos.add (" ptDataTOFKaon" , " ptDataTOFKaon" , kTH1F , {axisPt});
108+ histos.add (" ptDataTOFPion" , " ptDataTOFPion" , kTH1F , {axisPt});
109+ histos.add (" ptDataTOFKaon" , " ptDataTOFKaon" , kTH1F , {axisPt});
109110 histos.add (" ptDataTOFProton" , " ptDataTOFProton" , kTH1F , {axisPt});
110111
111112 histos.add (" myEventCounter" , " myEventCounter" , kTH1F , {axisEventCounter});
112- histos.add (" DCAxy_primary_pions" , " DCAxy_primary_pions" , kTH1F , {axisDCAxy});
113+ histos.add (" DCAxy_primary_pions" , " DCAxy_primary_pions" , kTH1F , {axisDCAxy});
113114 histos.add (" DCAxy_secondary_pions" , " DCAxy_secondary_pions" , kTH1F , {axisDCAxy});
114- histos.add (" DCAxy_primary_kaons" , " DCAxy_primary_kaons" , kTH1F , {axisDCAxy});
115+ histos.add (" DCAxy_primary_kaons" , " DCAxy_primary_kaons" , kTH1F , {axisDCAxy});
115116 histos.add (" DCAxy_secondary_kaons" , " DCAxy_secondary_kaons" , kTH1F , {axisDCAxy});
116- histos.add (" DCAxy_primary_protons" , " DCAxy_primary_protons" , kTH1F , {axisDCAxy});
117+ histos.add (" DCAxy_primary_protons" , " DCAxy_primary_protons" , kTH1F , {axisDCAxy});
117118 histos.add (" DCAxy_secondary_protons" , " DCAxy_secondary_protons" , kTH1F , {axisDCAxy});
118119 histos.add (" DCAxy_material_protons" , " DCAxy_material_protons" , kTH1F , {axisDCAxy});
119- histos.add (" DCAxy_data_pions" , " DCAxy_data_pions" , kTH1F , {axisDCAxy});
120- histos.add (" DCAxy_data_kaons" , " DCAxy_data_kaons" , kTH1F , {axisDCAxy});
120+ histos.add (" DCAxy_data_pions" , " DCAxy_data_pions" , kTH1F , {axisDCAxy});
121+ histos.add (" DCAxy_data_kaons" , " DCAxy_data_kaons" , kTH1F , {axisDCAxy});
121122 histos.add (" DCAxy_data_protons" , " DCAxy_data_protons" , kTH1F , {axisDCAxy});
122123 }
123124
124- void processSim (aod::UDMcCollisions::iterator const & mcCollision, aod::UDMcParticles const & mcParticles){
125+ void processSim (aod::UDMcCollisions::iterator const & mcCollision, aod::UDMcParticles const & mcParticles)
126+ {
125127
126- for (const auto & mcParticle : mcParticles){
128+ for (const auto & mcParticle : mcParticles) {
127129 if (!mcParticle.isPhysicalPrimary ())
128130 continue ;
129131
130132 LorentzVectorM pMC (mcParticle.px (), mcParticle.py (), mcParticle.pz (), massPion);
131-
132- if (applyKineCutsInGen){
133+
134+ if (applyKineCutsInGen) {
133135 if (fabs (pMC.Eta ()) > etaMax)
134136 continue ;
135137
@@ -158,7 +160,8 @@ struct ptSpectraInclusiveUpc{
158160 }
159161 }
160162
161- void processReco (CC const & collision, TCs const & tracks, aod::UDMcParticles const & mcParticles){
163+ void processReco (CC const & collision, TCs const & tracks, aod::UDMcParticles const & mcParticles)
164+ {
162165
163166 Partition<TCs> pvContributors = aod::udtrack::isPVContributor == true ;
164167 pvContributors.bindTable (tracks);
@@ -172,9 +175,9 @@ struct ptSpectraInclusiveUpc{
172175 auto nSigmaKaTOF = -999 .;
173176 auto nSigmaPrTOF = -999 .;
174177
175- LorentzVectorM * pion = new LorentzVectorM ();
176- LorentzVectorM * kaon = new LorentzVectorM ();
177- LorentzVectorM * proton = new LorentzVectorM ();
178+ LorentzVectorM* pion = new LorentzVectorM ();
179+ LorentzVectorM* kaon = new LorentzVectorM ();
180+ LorentzVectorM* proton = new LorentzVectorM ();
178181
179182 for (const auto & track : tracks) {
180183 if (!track.isPVContributor ()) {
@@ -186,7 +189,7 @@ struct ptSpectraInclusiveUpc{
186189 }
187190
188191 if (track.pt () < ptMin) {
189- continue ;
192+ continue ;
190193 }
191194
192195 if (!(std::abs (track.dcaZ ()) < dcaZlimit)) {
@@ -213,18 +216,18 @@ struct ptSpectraInclusiveUpc{
213216 proton->SetPz (track.pz ());
214217 proton->SetM (massProton);
215218
216- if (!track.has_udMcParticle ()){
219+ if (!track.has_udMcParticle ()) {
217220 continue ;
218221 }
219222 auto mcParticle = track.udMcParticle ();
220223
221224 bool has_tpc = false ;
222225 // TPC tracks
223226 if (track.hasTPC ()) {
224- has_tpc = true ;
225- nSigmaPi = track.tpcNSigmaPi ();
226- nSigmaKa = track.tpcNSigmaKa ();
227- nSigmaPr = track.tpcNSigmaPr ();
227+ has_tpc = true ;
228+ nSigmaPi = track.tpcNSigmaPi ();
229+ nSigmaKa = track.tpcNSigmaKa ();
230+ nSigmaPr = track.tpcNSigmaPr ();
228231
229232 if (std::abs (nSigmaPi) < sigmaMax) {
230233 if (std::abs (pion->Rapidity ()) > yMax) {
@@ -233,9 +236,9 @@ struct ptSpectraInclusiveUpc{
233236
234237 if (mcParticle.isPhysicalPrimary ()) {
235238 histos.fill (HIST (" ptReconstructedTPCPion" ), pion->Pt ());
236- // selEv = true;
239+ // selEv = true;
237240 histos.fill (HIST (" DCAxy_primary_pions" ), track.dcaXY ());
238- }else {
241+ } else {
239242 histos.fill (HIST (" DCAxy_secondary_pions" ), track.dcaXY ());
240243 }
241244 }
@@ -246,9 +249,9 @@ struct ptSpectraInclusiveUpc{
246249
247250 if (mcParticle.isPhysicalPrimary ()) {
248251 histos.fill (HIST (" ptReconstructedTPCKaon" ), kaon->Pt ());
249- // selEv = true;
252+ // selEv = true;
250253 histos.fill (HIST (" DCAxy_primary_kaons" ), track.dcaXY ());
251- }else {
254+ } else {
252255 histos.fill (HIST (" DCAxy_secondary_kaons" ), track.dcaXY ());
253256 }
254257 }
@@ -260,25 +263,23 @@ struct ptSpectraInclusiveUpc{
260263
261264 if (mcParticle.isPhysicalPrimary ()) {
262265 histos.fill (HIST (" ptReconstructedTPCProton" ), proton->Pt ());
263- // selEv = true;
266+ // selEv = true;
264267 histos.fill (HIST (" DCAxy_primary_protons" ), track.dcaXY ());
265- }else {
268+ } else {
266269 if (mcParticle.getProcess () == kPDecay ) {
267270 histos.fill (HIST (" DCAxy_secondary_protons" ), track.dcaXY ());
268- }
269- else {
271+ } else {
270272 histos.fill (HIST (" DCAxy_material_protons" ), track.dcaXY ());
271273 }
272274 }
273275 }
274-
275276 }
276277
277278 // TPC tracks
278279 if (track.hasTOF ()) {
279- nSigmaPi = track.tofNSigmaPi ();
280- nSigmaKa = track.tofNSigmaKa ();
281- nSigmaPr = track.tofNSigmaPr ();
280+ nSigmaPi = track.tofNSigmaPi ();
281+ nSigmaKa = track.tofNSigmaKa ();
282+ nSigmaPr = track.tofNSigmaPr ();
282283
283284 if (std::abs (nSigmaPi) < sigmaMax) {
284285 if (std::abs (pion->Rapidity ()) > yMax) {
@@ -287,9 +288,11 @@ struct ptSpectraInclusiveUpc{
287288
288289 if (mcParticle.isPhysicalPrimary ()) {
289290 histos.fill (HIST (" ptReconstructedTOFPion" ), pion->Pt ());
290- if (!has_tpc) histos.fill (HIST (" DCAxy_primary_pions" ), track.dcaXY ());
291- }else {
292- if (!has_tpc) histos.fill (HIST (" DCAxy_secondary_pions" ), track.dcaXY ());
291+ if (!has_tpc)
292+ histos.fill (HIST (" DCAxy_primary_pions" ), track.dcaXY ());
293+ } else {
294+ if (!has_tpc)
295+ histos.fill (HIST (" DCAxy_secondary_pions" ), track.dcaXY ());
293296 }
294297 }
295298 if (std::abs (nSigmaKa) < sigmaMax) {
@@ -299,9 +302,11 @@ struct ptSpectraInclusiveUpc{
299302
300303 if (mcParticle.isPhysicalPrimary ()) {
301304 histos.fill (HIST (" ptReconstructedTOFKaon" ), kaon->Pt ());
302- if (!has_tpc) histos.fill (HIST (" DCAxy_primary_kaons" ), track.dcaXY ());
303- }else {
304- if (!has_tpc) histos.fill (HIST (" DCAxy_secondary_kaons" ), track.dcaXY ());
305+ if (!has_tpc)
306+ histos.fill (HIST (" DCAxy_primary_kaons" ), track.dcaXY ());
307+ } else {
308+ if (!has_tpc)
309+ histos.fill (HIST (" DCAxy_secondary_kaons" ), track.dcaXY ());
305310 }
306311 }
307312
@@ -312,24 +317,24 @@ struct ptSpectraInclusiveUpc{
312317
313318 if (mcParticle.isPhysicalPrimary ()) {
314319 histos.fill (HIST (" ptReconstructedTOFProton" ), proton->Pt ());
315- if (!has_tpc) histos.fill (HIST (" DCAxy_primary_protons" ), track.dcaXY ());
316- }else {
317- if (!has_tpc) {
320+ if (!has_tpc)
321+ histos.fill (HIST (" DCAxy_primary_protons" ), track.dcaXY ());
322+ } else {
323+ if (!has_tpc) {
318324 if (mcParticle.getProcess () == kPDecay ) {
319325 histos.fill (HIST (" DCAxy_secondary_protons" ), track.dcaXY ());
320- }
321- else {
326+ } else {
322327 histos.fill (HIST (" DCAxy_material_protons" ), track.dcaXY ());
323328 }
324329 }
325330 }
326331 }
327-
328332 }
329333 }
330334 }
331335
332- void processData (CC const & collision, TCs const & tracks){
336+ void processData (CC const & collision, TCs const & tracks)
337+ {
333338
334339 Partition<TCs> pvContributors = aod::udtrack::isPVContributor == true ;
335340 pvContributors.bindTable (tracks);
@@ -343,9 +348,9 @@ struct ptSpectraInclusiveUpc{
343348 auto nSigmaKaTOF = -999 .;
344349 auto nSigmaPrTOF = -999 .;
345350
346- LorentzVectorM * pion = new LorentzVectorM ();
347- LorentzVectorM * kaon = new LorentzVectorM ();
348- LorentzVectorM * proton = new LorentzVectorM ();
351+ LorentzVectorM* pion = new LorentzVectorM ();
352+ LorentzVectorM* kaon = new LorentzVectorM ();
353+ LorentzVectorM* proton = new LorentzVectorM ();
349354
350355 for (const auto & track : tracks) {
351356 if (!track.isPVContributor ()) {
@@ -357,7 +362,7 @@ struct ptSpectraInclusiveUpc{
357362 }
358363
359364 if (track.pt () < ptMin) {
360- continue ;
365+ continue ;
361366 }
362367
363368 if (!(std::abs (track.dcaZ ()) < dcaZlimit)) {
@@ -387,10 +392,10 @@ struct ptSpectraInclusiveUpc{
387392 bool has_tpc = false ;
388393 // TPC tracks
389394 if (track.hasTPC ()) {
390- has_tpc = true ;
391- nSigmaPi = track.tpcNSigmaPi ();
392- nSigmaKa = track.tpcNSigmaKa ();
393- nSigmaPr = track.tpcNSigmaPr ();
395+ has_tpc = true ;
396+ nSigmaPi = track.tpcNSigmaPi ();
397+ nSigmaKa = track.tpcNSigmaKa ();
398+ nSigmaPr = track.tpcNSigmaPr ();
394399
395400 if (std::abs (nSigmaPi) < sigmaMax) {
396401 if (std::abs (pion->Rapidity ()) > yMax) {
@@ -415,49 +420,48 @@ struct ptSpectraInclusiveUpc{
415420 histos.fill (HIST (" ptDataTPCProton" ), proton->Pt ());
416421 histos.fill (HIST (" DCAxy_data_protons" ), track.dcaXY ());
417422 }
418-
419423 }
420424
421425 // TPC tracks
422426 if (track.hasTOF ()) {
423- nSigmaPi = track.tofNSigmaPi ();
424- nSigmaKa = track.tofNSigmaKa ();
425- nSigmaPr = track.tofNSigmaPr ();
427+ nSigmaPi = track.tofNSigmaPi ();
428+ nSigmaKa = track.tofNSigmaKa ();
429+ nSigmaPr = track.tofNSigmaPr ();
426430
427431 if (std::abs (nSigmaPi) < sigmaMax) {
428432 if (std::abs (pion->Rapidity ()) > yMax) {
429433 continue ;
430434 }
431435 histos.fill (HIST (" ptDataTOFPion" ), pion->Pt ());
432- if (!has_tpc) histos.fill (HIST (" DCAxy_data_pions" ), track.dcaXY ());
436+ if (!has_tpc)
437+ histos.fill (HIST (" DCAxy_data_pions" ), track.dcaXY ());
433438 }
434439 if (std::abs (nSigmaKa) < sigmaMax) {
435440 if (std::abs (kaon->Rapidity ()) > yMax) {
436441 continue ;
437442 }
438443 histos.fill (HIST (" ptDataTOFKaon" ), kaon->Pt ());
439- if (!has_tpc) histos.fill (HIST (" DCAxy_data_kaons" ), track.dcaXY ());
444+ if (!has_tpc)
445+ histos.fill (HIST (" DCAxy_data_kaons" ), track.dcaXY ());
440446 }
441447
442448 if (std::abs (nSigmaPr) < sigmaMax) {
443449 if (std::abs (proton->Rapidity ()) > yMax) {
444450 continue ;
445451 }
446452 histos.fill (HIST (" ptDataTOFProton" ), proton->Pt ());
447- if (!has_tpc) histos.fill (HIST (" DCAxy_data_protons" ), track.dcaXY ());
453+ if (!has_tpc)
454+ histos.fill (HIST (" DCAxy_data_protons" ), track.dcaXY ());
448455 }
449-
450456 }
451457 }
452458 }
453459
454-
455460 PROCESS_SWITCH (ptSpectraInclusiveUpc, processSim, " processSim" , true );
456461
457462 PROCESS_SWITCH (ptSpectraInclusiveUpc, processReco, " processReco" , true );
458463
459464 PROCESS_SWITCH (ptSpectraInclusiveUpc, processData, " processData" , true );
460-
461465};
462466
463467WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
0 commit comments