Transition from chi2 to chi2/NDF.
[u/mrichter/AliRoot.git] / STEER / CreateAODfromKineTree.C
CommitLineData
3a0584e6 1#if !defined(__CINT__) || defined(__MAKECINT__)
2
3#include <Riostream.h>
4#include <TFile.h>
5#include <TTree.h>
6#include <TMath.h>
7
8#include "AliRun.h"
9#include "AliRunLoader.h"
10#include "AliHeader.h"
11#include "AliStack.h"
12#include "TParticle.h"
13
14#include "AliAODEvent.h"
15#include "AliAODHeader.h"
16#include "AliAODVertex.h"
17#include "AliAODTrack.h"
18#include "AliAODCluster.h"
19
20#endif
21
22// function declarations
23void SetVertexType(TParticle *part, AliAODVertex *vertex);
24void SetChargeAndPID(Int_t pdgCode, AliAODTrack *track);
25Int_t LoopOverSecondaries(TParticle *mother);
26void CreateAODfromKineTree(const char *inFileName = "galice.root",
27 const char *outFileName = "AliAOD.root");
28
29// global variables
30AliAODEvent *aod = NULL;
31AliStack *stack = NULL;
32
33Int_t jVertices = 0;
34Int_t jTracks = 0;
35Int_t jKinks = 0;
36Int_t jV0s = 0;
37Int_t jCascades = 0;
38Int_t jMultis = 0;
39Int_t nPos = 0;
40Int_t nNeg = 0;
41
42Int_t nGamma = 0;
43Int_t nElectron = 0;
44Int_t nPositron = 0;
45Int_t nMuon = 0;
46Int_t nAntiMuon = 0;
47Int_t nProton = 0;
48Int_t nAntiProton = 0;
49Int_t nNeutron = 0;
50Int_t nAntiNeutron = 0;
51Int_t nPi0 = 0;
52Int_t nPiMinus = 0;
53Int_t nPiPlus = 0;
54Int_t nK0 = 0;
55Int_t nKPlus = 0;
56Int_t nKMinus = 0;
57
994b4747 58// global arrays and pointers
59Float_t p[3];
60Float_t x[3];
61Float_t *cov = NULL; // set to NULL because not provided
62Float_t *pid = NULL; // set to NULL because not provided
63AliAODVertex *primary = NULL;
64AliAODVertex *secondary = NULL;
65AliAODTrack *currTrack = NULL;
66
3a0584e6 67void CreateAODfromKineTree(const char *inFileName,
68 const char *outFileName) {
69 printf("This macro works only correctly in comiled mode!\n");
70 /* This probem is due to CINT which gets confused if arrays are reused */
71
72 // create an AliAOD object
73 aod = new AliAODEvent();
74 aod->CreateStdContent();
75
76 // open the file
77 TFile *outFile = TFile::Open(outFileName, "RECREATE");
78
79 // create the tree
80 TTree *aodTree = new TTree("AOD", "AliAOD tree");
81 aodTree->Branch(aod->GetList());
82
83 AliRunLoader *runLoader;
84 delete gAlice;
85 gAlice = NULL;
86 runLoader = AliRunLoader::Open(inFileName);
87 if (!runLoader) return;
88
89 runLoader->LoadHeader();
90 runLoader->LoadKinematics();
91
92 Int_t nEvents = runLoader->GetNumberOfEvents();
93
94 // loop over events and fill them
95 for (Int_t iEvent = 0; iEvent < nEvents; ++iEvent) {
96
97 cout << "Event " << iEvent+1 << "/" << nEvents;
98 runLoader->GetEvent(iEvent);
99
100 AliHeader *aliHeader = runLoader->GetHeader();
101 stack = runLoader->Stack();
102 Int_t nTracks = stack->GetNtrack();
103 Int_t nPrims = stack->GetNprimary();
104
105 nPos = 0;
106 nNeg = 0;
107
108 nGamma = 0;
109 nElectron = 0;
110 nPositron = 0;
111 nMuon = 0;
112 nAntiMuon = 0;
113 nProton = 0;
114 nAntiProton = 0;
115 nNeutron = 0;
116 nAntiNeutron = 0;
117 nPi0 = 0;
118 nPiMinus = 0;
119 nPiPlus = 0;
120 nK0 = 0;
121 nKPlus = 0;
122 nKMinus = 0;
123
124 // create the header
125 aod->AddHeader(new AliAODHeader(aliHeader->GetRun(),
126 0, // bunchX number
127 0, // orbit number
128 nTracks,
129 nPos,
130 nNeg,
131 -999, // mag. field
132 -999., // muon mag. field
133 -999., // centrality
134 -999, // ZDCN1Energy
135 -999, // ZDCP1Energy
136 -999, // ZDCN2Energy
137 -999, // ZDCP2Energy
138 -999, // ZDCEMEnergy
139 0, // TriggerMask
140 0, // TriggerCluster
141 0)); // EventType
142
143 // Access to the header
144 AliAODHeader *header = aod->GetHeader();
145
146 // Access to the AOD container of vertices
147 TClonesArray &vertices = *(aod->GetVertices());
148 jVertices=0;
149 jKinks=0;
150 jV0s=0;
151 jCascades=0;
152 jMultis=0;
153
154 // Access to the AOD container of tracks
155 TClonesArray &tracks = *(aod->GetTracks());
156 jTracks=0;
157
158 aod->ResetStd(nTracks, 1);
159
3a0584e6 160 // track loop
161 for (Int_t iTrack = 0; iTrack < nPrims; ++iTrack) {
162
163 TParticle *part = stack->Particle(iTrack);
164
165 //if (part->IsPrimary()) { // this will exclude 'funny' primaries, too
166 if (kTRUE) { // this won't
167 p[0] = part->Px(); p[1] = part->Py(); p[2] = part->Pz();
168 x[0] = part->Vx(); x[1] = part->Vy(); x[2] = part->Vz();
169
170 if (iTrack == 0) {
171 // add primary vertex
172 primary = new(vertices[jVertices++])
173 AliAODVertex(x, NULL, -999., NULL, AliAODVertex::kPrimary);
174 }
175
176 // add primary tracks
177 primary->AddDaughter(new(tracks[jTracks++]) AliAODTrack(0, // ID,
178 0, // Label
179 p,
180 kTRUE,
181 x,
182 kFALSE,
994b4747 183 cov,
3a0584e6 184 (Short_t)-99,
185 0, // no ITSClusterMap
186 pid,
187 primary,
188 kFALSE, // no fit preformed
189 AliAODTrack::kPrimary));
190 currTrack = (AliAODTrack*)tracks.Last();
191 SetChargeAndPID(part->GetPdgCode(), currTrack);
192 if (currTrack->Charge() != -99) {
193 if (currTrack->Charge() > 0) {
194 nPos++;
195 } else if (currTrack->Charge() < 0) {
196 nNeg++;
197 }
198 }
199
200 LoopOverSecondaries(part);
201 }
202 } // end of track loop
203
204 header->SetRefMultiplicityPos(nPos);
205 header->SetRefMultiplicityNeg(nNeg);
206
207 cout << ":: primaries: " << nPrims << " secondaries: " << tracks.GetEntriesFast()-nPrims <<
208 " (pos: " << nPos << ", neg: " << nNeg << "), vertices: " << vertices.GetEntriesFast() <<
209 " (kinks: " << jKinks << ", V0: " << jV0s << ", cascades: " << jCascades <<
210 ", multi: " << jMultis << ")" << endl;
211 /*
212 cout << " gamma: " << nGamma << " e-: " << nElectron << " e+: " << nPositron << " p: " << nProton <<
213 " pBar: " << nAntiProton << " n: " << nNeutron << " nBar: " << nAntiNeutron << " pi0: " << nPi0 <<
214 " pi+: " << nPiPlus << " pi-: " << nPiMinus << " K0: " << nK0 << " K+: " << nKPlus <<
215 " K-: " << nKMinus << endl;
216 */
217 // fill the tree for this event
218 aodTree->Fill();
219 } // end of event loop
220
221 aodTree->GetUserInfo()->Add(aod);
222
223 // write the tree to the specified file
224 outFile = aodTree->GetCurrentFile();
225 outFile->cd();
226 aodTree->Write();
227 outFile->Close();
228
229}
230
231
232Int_t LoopOverSecondaries(TParticle *mother) {
233
234 if (mother->GetNDaughters() > 0) {
235
236 TClonesArray &vertices = *(aod->GetVertices());
237 TClonesArray &tracks = *(aod->GetTracks());
238
3a0584e6 239 for (Int_t iDaughter = mother->GetFirstDaughter(); iDaughter <= mother->GetLastDaughter(); iDaughter++) {
994b4747 240 TParticle *part = stack->Particle(iDaughter);
241 p[0] = part->Px();
242 p[1] = part->Py();
243 p[2] = part->Pz();
244 x[0] = part->Vx();
245 x[1] = part->Vy();
246 x[2] = part->Vz();
3a0584e6 247
248 if (iDaughter == mother->GetFirstDaughter()) {
249 // add secondary vertex
250 secondary = new(vertices[jVertices++])
994b4747 251 AliAODVertex(x, NULL, -999., tracks.Last(), AliAODVertex::kUndef);
3a0584e6 252
994b4747 253 SetVertexType(part, secondary);
3a0584e6 254 }
255
256 // add secondary tracks
257 secondary->AddDaughter(new(tracks[jTracks++]) AliAODTrack(0, // ID
258 0, // label
994b4747 259 p,
3a0584e6 260 kTRUE,
994b4747 261 x,
3a0584e6 262 kFALSE,
994b4747 263 cov,
3a0584e6 264 (Short_t)-99,
265 0, // no cluster map available
994b4747 266 pid,
3a0584e6 267 secondary,
268 kFALSE, // no fit performed
269 AliAODTrack::kSecondary));
270
994b4747 271 currTrack = (AliAODTrack*)tracks.Last();
272 SetChargeAndPID(part->GetPdgCode(), currTrack);
273 if (currTrack->Charge() != -99) {
274 if (currTrack->Charge() > 0) {
3a0584e6 275 nPos++;
994b4747 276 } else if (currTrack->Charge() < 0) {
3a0584e6 277 nNeg++;
278 }
279 }
280
994b4747 281 LoopOverSecondaries(part);
3a0584e6 282 }
283 return 1;
284 } else {
285 return 0;
286 }
287}
288
289
290void SetChargeAndPID(Int_t pdgCode, AliAODTrack *track) {
291
292 Float_t PID[10] = {0., 0., 0., 0., 0., 0., 0., 0., 0., 0.};
293
294 switch (pdgCode) {
2ca95bbe 295
3a0584e6 296 case 22: // gamma
297 track->SetCharge(0);
2ca95bbe 298 PID[AliAODTrack::kUnknown] = 1.;
3a0584e6 299 track->SetPID(PID);
300 nGamma++;
301 break;
302
2ca95bbe 303 case 11: // e-
3a0584e6 304 track->SetCharge(-1);
2ca95bbe 305 PID[AliAODTrack::kElectron] = 1.;
3a0584e6 306 track->SetPID(PID);
307 nElectron++;
308 break;
309
2ca95bbe 310 case -11: // e+
3a0584e6 311 track->SetCharge(+1);
2ca95bbe 312 PID[AliAODTrack::kElectron] = 1.;
3a0584e6 313 track->SetPID(PID);
314 nPositron++;
315 break;
316
2ca95bbe 317 case 13: // mu-
3a0584e6 318 track->SetCharge(-1);
2ca95bbe 319 PID[AliAODTrack::kMuon] = 1.;
3a0584e6 320 track->SetPID(PID);
321 nMuon++;
322 break;
323
2ca95bbe 324 case -13: // mu+
3a0584e6 325 track->SetCharge(+1);
2ca95bbe 326 PID[AliAODTrack::kMuon] = 1.;
3a0584e6 327 track->SetPID(PID);
328 nAntiMuon++;
329 break;
330
331 case 111: // pi0
332 track->SetCharge(0);
2ca95bbe 333 PID[AliAODTrack::kUnknown] = 1.;
3a0584e6 334 track->SetPID(PID);
335 nPi0++;
336 break;
337
338 case 211: // pi+
339 track->SetCharge(+1);
2ca95bbe 340 PID[AliAODTrack::kPion] = 1.;
3a0584e6 341 track->SetPID(PID);
342 nPiPlus++;
343 break;
344
345 case -211: // pi-
346 track->SetCharge(-1);
2ca95bbe 347 PID[AliAODTrack::kPion] = 1.;
3a0584e6 348 track->SetPID(PID);
349 nPiMinus++;
350 break;
351
352 case 130: // K0L
353 track->SetCharge(0);
2ca95bbe 354 PID[AliAODTrack::kUnknown] = 1.;
3a0584e6 355 track->SetPID(PID);
356 nK0++;
357 break;
358
359 case 321: // K+
360 track->SetCharge(+1);
2ca95bbe 361 PID[AliAODTrack::kKaon] = 1.;
3a0584e6 362 track->SetPID(PID);
363 nKPlus++;
364 break;
365
366 case -321: // K-
367 track->SetCharge(-1);
2ca95bbe 368 PID[AliAODTrack::kKaon] = 1.;
3a0584e6 369 track->SetPID(PID);
370 nKMinus++;
371 break;
372
2ca95bbe 373 case 2112: // n
3a0584e6 374 track->SetCharge(0);
2ca95bbe 375 PID[AliAODTrack::kUnknown] = 1.;
3a0584e6 376 track->SetPID(PID);
377 nNeutron++;
378 break;
379
380 case 2212: // p
381 track->SetCharge(+1);
2ca95bbe 382 PID[AliAODTrack::kProton] = 1.;
3a0584e6 383 track->SetPID(PID);
384 nProton++;
385 break;
386
387 case -2212: // anti-p
388 track->SetCharge(-1);
2ca95bbe 389 PID[AliAODTrack::kProton] = 1.;
3a0584e6 390 track->SetPID(PID);
391 nAntiProton++;
392 break;
393
394 case 310: // K0S
395 track->SetCharge(0);
2ca95bbe 396 PID[AliAODTrack::kUnknown] = 1.;
397 track->SetPID(PID);
398 nK0++;
399 break;
400
401 case 311: // K0
402 track->SetCharge(0);
403 PID[AliAODTrack::kUnknown] = 1.;
404 track->SetPID(PID);
405 nK0++;
406 break;
407
408 case -311: // anti-K0
409 track->SetCharge(0);
410 PID[AliAODTrack::kUnknown] = 1.;
3a0584e6 411 track->SetPID(PID);
412 nK0++;
413 break;
414
415 case 221: // eta
416 track->SetCharge(0);
2ca95bbe 417 PID[AliAODTrack::kUnknown] = 1.;
418 track->SetPID(PID);
3a0584e6 419 break;
420
421 case 3122: // lambda
422 track->SetCharge(0);
2ca95bbe 423 PID[AliAODTrack::kUnknown] = 1.;
424 track->SetPID(PID);
3a0584e6 425 break;
426
427 case 3222: // Sigma+
428 track->SetCharge(+1);
2ca95bbe 429 PID[AliAODTrack::kUnknown] = 1.;
430 track->SetPID(PID);
3a0584e6 431 break;
432
433 case 3212: // Sigma0
434 track->SetCharge(-1);
2ca95bbe 435 PID[AliAODTrack::kUnknown] = 1.;
436 track->SetPID(PID);
3a0584e6 437 break;
438
439 case 3112: // Sigma-
440 track->SetCharge(-1);
2ca95bbe 441 PID[AliAODTrack::kUnknown] = 1.;
442 track->SetPID(PID);
3a0584e6 443 break;
444
445 case 3322: // Xi0
446 track->SetCharge(0);
2ca95bbe 447 PID[AliAODTrack::kUnknown] = 1.;
448 track->SetPID(PID);
3a0584e6 449 break;
450
451 case 3312: // Xi-
452 track->SetCharge(-1);
2ca95bbe 453 PID[AliAODTrack::kUnknown] = 1.;
454 track->SetPID(PID);
3a0584e6 455 break;
456
2ca95bbe 457 case 3334: // Omega-
3a0584e6 458 track->SetCharge(-1);
2ca95bbe 459 PID[AliAODTrack::kUnknown] = 1.;
460 track->SetPID(PID);
3a0584e6 461 break;
462
463 case -2112: // n-bar
464 track->SetCharge(0);
2ca95bbe 465 PID[AliAODTrack::kUnknown] = 1.;
466 track->SetPID(PID);
3a0584e6 467 break;
468
469 case -3122: // anti-Lambda
470 track->SetCharge(0);
2ca95bbe 471 PID[AliAODTrack::kUnknown] = 1.;
472 track->SetPID(PID);
3a0584e6 473 break;
474
475 case -3222: // anti-Sigma-
476 track->SetCharge(-1);
2ca95bbe 477 PID[AliAODTrack::kUnknown] = 1.;
478 track->SetPID(PID);
3a0584e6 479 break;
480
481 case -3212: // anti-Sigma0
482 track->SetCharge(0);
2ca95bbe 483 PID[AliAODTrack::kUnknown] = 1.;
484 track->SetPID(PID);
3a0584e6 485 break;
486
487 case -3112: // anti-Sigma+
488 track->SetCharge(+1);
2ca95bbe 489 PID[AliAODTrack::kUnknown] = 1.;
490 track->SetPID(PID);
3a0584e6 491 break;
492
493 case -3322: // anti-Xi0
494 track->SetCharge(0);
2ca95bbe 495 PID[AliAODTrack::kUnknown] = 1.;
496 track->SetPID(PID);
3a0584e6 497 break;
498
499 case -3312: // anti-Xi+
500 track->SetCharge(+1);
501 break;
502
2ca95bbe 503 case -3334: // anti-Omega+
3a0584e6 504 track->SetCharge(+1);
2ca95bbe 505 PID[AliAODTrack::kUnknown] = 1.;
506 track->SetPID(PID);
3a0584e6 507 break;
508
509 case 411: // D+
510 track->SetCharge(+1);
2ca95bbe 511 PID[AliAODTrack::kUnknown] = 1.;
512 track->SetPID(PID);
3a0584e6 513 break;
514
515 case -411: // D-
516 track->SetCharge(-1);
2ca95bbe 517 PID[AliAODTrack::kUnknown] = 1.;
518 track->SetPID(PID);
3a0584e6 519 break;
520
521 case 421: // D0
522 track->SetCharge(0);
2ca95bbe 523 PID[AliAODTrack::kUnknown] = 1.;
524 track->SetPID(PID);
3a0584e6 525 break;
526
527 case -421: // anti-D0
528 track->SetCharge(0);
2ca95bbe 529 PID[AliAODTrack::kUnknown] = 1.;
530 track->SetPID(PID);
3a0584e6 531 break;
532
533 default : // unknown
534 track->SetCharge(-99);
2ca95bbe 535 PID[AliAODTrack::kUnknown] = 1.;
536 track->SetPID(PID);
537 }
3a0584e6 538
539 return;
540}
541
542
543void SetVertexType(TParticle *part, AliAODVertex *vertex) {
544 // this whole thing doesn't make much sense. but anyhow...
545
546 TParticle *mother = stack->Particle(part->GetFirstMother());
547 Int_t pdgMother = mother->GetPdgCode();
548 Int_t pdgPart = part->GetPdgCode();
549
550 // kinks
551 if (mother->GetNDaughters() == 2) {
552 Int_t firstPdgCode = stack->Particle(mother->GetFirstDaughter())->GetPdgCode();
553 Int_t lastPdgCode = stack->Particle(mother->GetLastDaughter())->GetPdgCode();
554
555 if (!(pdgMother == 22 || pdgMother == 111 || pdgMother == 130 ||
2ca95bbe 556 TMath::Abs(pdgMother) == 2112 || pdgMother == 310 || pdgMother == 221 ||
3a0584e6 557 TMath::Abs(pdgMother) == 3122 || TMath::Abs(pdgMother) == 3322 ||
2ca95bbe 558 pdgMother == -3212 || TMath::Abs(pdgMother) == 421 ||
559 TMath::Abs(pdgMother) == 311) // not neutral
3a0584e6 560 && (((firstPdgCode == 22 || firstPdgCode == 111 || firstPdgCode == 130 ||
2ca95bbe 561 TMath::Abs(firstPdgCode) == 2112 || firstPdgCode == 310 ||
3a0584e6 562 firstPdgCode == 221 || TMath::Abs(firstPdgCode) == 3122 ||
563 TMath::Abs(firstPdgCode) == 3322 || firstPdgCode == -3212 ||
2ca95bbe 564 TMath::Abs(firstPdgCode) == 421 || TMath::Abs(pdgMother) == 311) // neutral
3a0584e6 565 && !(lastPdgCode == 22 || lastPdgCode == 111 || lastPdgCode == 130 ||
2ca95bbe 566 TMath::Abs(lastPdgCode) == 2112 || lastPdgCode == 310 ||
3a0584e6 567 lastPdgCode == 221 || TMath::Abs(lastPdgCode) == 3122 ||
568 TMath::Abs(lastPdgCode) == 3322 || lastPdgCode == -3212 ||
2ca95bbe 569 TMath::Abs(lastPdgCode) == 421 || TMath::Abs(pdgMother) == 311)) // not neutral
3a0584e6 570 || !((firstPdgCode == 22 || firstPdgCode == 111 || firstPdgCode == 130 ||
2ca95bbe 571 TMath::Abs(firstPdgCode) == 2112 || firstPdgCode == 310 ||
3a0584e6 572 firstPdgCode == 221 || TMath::Abs(firstPdgCode) == 3122 ||
573 TMath::Abs(firstPdgCode) == 3322 || firstPdgCode == -3212 ||
2ca95bbe 574 TMath::Abs(firstPdgCode) == 421 || TMath::Abs(pdgMother) == 311) // not neutral
3a0584e6 575 && (lastPdgCode == 22 || lastPdgCode == 111 || lastPdgCode == 130 ||
2ca95bbe 576 TMath::Abs(lastPdgCode) == 2112 || lastPdgCode == 310 ||
3a0584e6 577 lastPdgCode == 221 || TMath::Abs(lastPdgCode) == 3122 ||
578 TMath::Abs(lastPdgCode) == 3322 || lastPdgCode == -3212 ||
2ca95bbe 579 TMath::Abs(lastPdgCode) == 421 || TMath::Abs(pdgMother) == 311)))) { // neutral
3a0584e6 580
581 vertex->SetType(AliAODVertex::kKink);
582 jKinks++;
583 }
584 }
585
586 // V0
587 else if (mother->GetNDaughters() == 2) {
588 Int_t firstPdgCode = stack->Particle(mother->GetFirstDaughter())->GetPdgCode();
589 Int_t lastPdgCode = stack->Particle(mother->GetLastDaughter())->GetPdgCode();
590
591 if ((pdgMother == 22 || pdgMother == 111 || pdgMother == 130 ||
2ca95bbe 592 TMath::Abs(pdgMother) == 2112 || pdgMother == 310 ||
3a0584e6 593 pdgMother == 221 || TMath::Abs(pdgMother) == 3122 ||
594 TMath::Abs(pdgMother) == 3322 || pdgMother == -3212 ||
2ca95bbe 595 TMath::Abs(pdgMother) == 421 || TMath::Abs(pdgMother) == 311) // neutral
3a0584e6 596 && !(lastPdgCode == 22 || lastPdgCode == 111 || lastPdgCode == 130 ||
2ca95bbe 597 TMath::Abs(lastPdgCode) == 2112 || lastPdgCode == 310 ||
3a0584e6 598 lastPdgCode == 221 || TMath::Abs(lastPdgCode) == 3122 ||
599 TMath::Abs(lastPdgCode) == 3322 || lastPdgCode == -3212 ||
2ca95bbe 600 TMath::Abs(lastPdgCode) == 421 || TMath::Abs(pdgMother) == 311) // not neutral
3a0584e6 601 && !(firstPdgCode == 22 || firstPdgCode == 111 || firstPdgCode == 130 ||
2ca95bbe 602 TMath::Abs(firstPdgCode) == 2112 || firstPdgCode == 310 ||
3a0584e6 603 firstPdgCode == 221 || TMath::Abs(firstPdgCode) == 3122 ||
604 TMath::Abs(firstPdgCode) == 3322 || firstPdgCode == -3212 ||
2ca95bbe 605 TMath::Abs(firstPdgCode) == 421 || TMath::Abs(pdgMother) == 311)) { // not neutral
3a0584e6 606
607 vertex->SetType(AliAODVertex::kV0);
608 jV0s++;
609 }
610 }
611
612 // Cascade
613 else if (mother->GetNDaughters() == 2) {
614 Int_t firstPdgCode = stack->Particle(mother->GetFirstDaughter())->GetPdgCode();
615 Int_t lastPdgCode = stack->Particle(mother->GetLastDaughter())->GetPdgCode();
616
2ca95bbe 617 if ((TMath::Abs(pdgMother) == 3334 || TMath::Abs(pdgMother) == 3312 || TMath::Abs(pdgMother) == 3322) &&
3a0584e6 618 (TMath::Abs(pdgPart) == 3122 || TMath::Abs(pdgPart) == 211 || TMath::Abs(pdgPart) == 321)
619 && ((!(firstPdgCode == 22 || firstPdgCode == 111 || firstPdgCode == 130 ||
2ca95bbe 620 TMath::Abs(firstPdgCode) == 2112 || firstPdgCode == 310 ||
3a0584e6 621 firstPdgCode == 221 || TMath::Abs(firstPdgCode) == 3122 ||
622 TMath::Abs(firstPdgCode) == 3322 || firstPdgCode == -3212 ||
2ca95bbe 623 TMath::Abs(firstPdgCode) == 421 || TMath::Abs(pdgMother) == 311) // not neutral
3a0584e6 624 && TMath::Abs(lastPdgCode) == 3122) // labmda or anti-lambda
625 || ((!(lastPdgCode == 22 || lastPdgCode == 111 || lastPdgCode == 130 ||
2ca95bbe 626 TMath::Abs(lastPdgCode) == 2112 || lastPdgCode == 310 ||
3a0584e6 627 lastPdgCode == 221 || TMath::Abs(lastPdgCode) == 3122 ||
628 TMath::Abs(lastPdgCode) == 3322 || lastPdgCode == -3212 ||
2ca95bbe 629 TMath::Abs(lastPdgCode) == 421 || TMath::Abs(pdgMother) == 311) // not neutral
3a0584e6 630 && TMath::Abs(firstPdgCode) == 3122)))) { // lambda or anti-lambda
631 vertex->SetType(AliAODVertex::kCascade);
632 jCascades++;
633 }
634 }
635
636 // Multi
637 else if (mother->GetNDaughters() > 2) {
638
639 vertex->SetType(AliAODVertex::kMulti);
640 jMultis++;
641 }
642
643 else {
644 vertex->SetType(AliAODVertex::kUndef);
645 }
646}
647// LocalWords: SetCharge