1 #include "AliAODMCParticle.h" 2 #include "AliAODMCHeader.h" 18 fNCaloPhotonMCLabels(0),
19 fNCaloPhotonMotherMCLabels(0),
23 for (
Int_t i =0; i<50; i++){
24 fCaloPhotonMCLabels[i]=-1;
26 for (
Int_t i =0; i<20; i++){
27 fCaloPhotonMotherMCLabels[i]=-1;
40 fNCaloPhotonMCLabels(0),
41 fNCaloPhotonMotherMCLabels(0),
52 for (
Int_t i =0; i<50; i++){
55 for (
Int_t i =0; i<20; i++){
76 for (
Int_t i =0; i<50; i++){
79 for (
Int_t i =0; i<20; i++){
101 for (
Int_t i =0; i<50; i++){
104 for (
Int_t i =0; i<20; i++){
123 Double_t primCo[3] = {primVertex->GetX(),primVertex->GetY(),primVertex->GetZ()};
133 Double_t Lambda = - (CP[0]*p[0]+CP[1]*p[1]+CP[2]*p[2])/(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);
140 fDCArPrimVtx = TMath::Sqrt( TMath::Power(primCo[0]-S[0],2) + TMath::Power(primCo[1]-S[1],2));
150 Bool_t isElectron = kFALSE;
151 Bool_t isConversion = kFALSE;
152 Bool_t isConversionFullyContained = kFALSE;
154 Bool_t isMergedPartConv = kFALSE;
156 Bool_t isDalitzMerged = kFALSE;
157 Bool_t isPhotonWithElecMother = kFALSE;
159 Bool_t isSubLeadingEM = kFALSE;
160 Bool_t isElectronFromFragPhoton = kFALSE;
164 TParticle* Photon = 0x0;
179 energyPerPart[i] = dummy->Energy();
181 if (!(TMath::Abs(dummy->GetPdgCode())== 11 || TMath::Abs(dummy->GetPdgCode())== 22)){
183 energyPerPart[i]= 0.25;
187 energyPerPart[i] = 0;
191 TMath::Sort(fNCaloPhotonMCLabels,energyPerPart,sortIdx);
197 delete [] energyPerPart;
198 delete [] orginalContrib;
208 Int_t particleMotherLabel = Photon->GetMother(0);
209 Int_t particleGrandMotherLabel = -1;
210 Int_t particleGrandMotherX2Label = -1;
211 Int_t particleGrandMotherX3Label = -1;
212 Int_t particleGrandMotherX4Label = -1;
213 Int_t particleGrandMotherX5Label = -1;
214 Int_t particleGrandMotherX6Label = -1;
215 Int_t particleGrandMotherX7Label = -1;
217 Int_t particleMotherPDG = -1;
218 Int_t particleGrandMotherPDG = -1;
219 Int_t particleGrandMotherX2PDG = -1;
220 Int_t particleGrandMotherX3PDG = -1;
221 Int_t particleGrandMotherX4PDG = -1;
222 Int_t particleGrandMotherX5PDG = -1;
223 Int_t particleGrandMotherX6PDG = -1;
225 Int_t particleMotherNDaugthers = 0;
226 Int_t particleGrandMotherNDaugthers = 0;
228 if (particleMotherLabel > -1){
229 particleMotherNDaugthers = mcEvent->Particle(Photon->GetMother(0))->GetNDaughters();
230 particleGrandMotherLabel = mcEvent->Particle(Photon->GetMother(0))->GetMother(0);
231 particleMotherPDG = mcEvent->Particle(Photon->GetMother(0))->GetPdgCode();
232 if (particleGrandMotherLabel > -1){
233 particleGrandMotherPDG = mcEvent->Particle(mcEvent->Particle(Photon->GetMother(0))->GetMother(0))->GetPdgCode();
234 particleGrandMotherNDaugthers = mcEvent->Particle(mcEvent->Particle(Photon->GetMother(0))->GetMother(0))->GetNDaughters();
235 particleGrandMotherX2Label = mcEvent->Particle(mcEvent->Particle(Photon->GetMother(0))->GetMother(0))->GetMother(0);
236 if (particleGrandMotherX2Label > -1){
237 particleGrandMotherX2PDG = mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(Photon->GetMother(0))->GetMother(0))->GetMother(0))->GetPdgCode();
238 particleGrandMotherX3Label = mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(Photon->GetMother(0))->GetMother(0))->GetMother(0))->GetMother(0);
239 if (particleGrandMotherX3Label > -1){
240 particleGrandMotherX3PDG = mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(Photon->GetMother(0))->GetMother(0))->GetMother(0))->GetMother(0))->GetPdgCode();
241 particleGrandMotherX4Label = mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(Photon->GetMother(0))->GetMother(0))->GetMother(0))->GetMother(0))->GetMother(0);
242 if (particleGrandMotherX4Label > -1){
243 particleGrandMotherX4PDG = mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(Photon->GetMother(0))->GetMother(0))->GetMother(0))->GetMother(0))->GetMother(0))->GetPdgCode();
244 particleGrandMotherX5Label = mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(Photon->GetMother(0))->GetMother(0))->GetMother(0))->GetMother(0))->GetMother(0))->GetMother(0);
245 if (particleGrandMotherX5Label > -1){
246 particleGrandMotherX5PDG = mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(Photon->GetMother(0))->GetMother(0))->GetMother(0))->GetMother(0))->GetMother(0))->GetMother(0))->GetPdgCode();
247 particleGrandMotherX6Label = mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(Photon->GetMother(0))->GetMother(0))->GetMother(0))->GetMother(0))->GetMother(0))->GetMother(0))->GetMother(0);
248 if (particleGrandMotherX6Label > -1){
249 particleGrandMotherX6PDG = mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(Photon->GetMother(0))->GetMother(0))->GetMother(0))->GetMother(0))->GetMother(0))->GetMother(0))->GetMother(0))->GetPdgCode();
250 particleGrandMotherX7Label = mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(mcEvent->Particle(Photon->GetMother(0))->GetMother(0))->GetMother(0))->GetMother(0))->GetMother(0))->GetMother(0))->GetMother(0))->GetMother(0);
260 if (particleMotherLabel > -1){
261 if( TMath::Abs(particleMotherPDG) == 111 || TMath::Abs(particleMotherPDG) == 221 || TMath::Abs(particleMotherPDG) == 331 ){
264 }
else if (particleGrandMotherLabel > -1 && TMath::Abs(particleMotherPDG) == 22 &&
265 (TMath::Abs(particleGrandMotherPDG) == 111 || TMath::Abs(particleGrandMotherPDG) == 221 || TMath::Abs(particleGrandMotherPDG) == 331) ){
278 if (particleMotherLabel > -1 && particleMotherNDaugthers == 3)
281 if (TMath::Abs(particleMotherPDG) == 11){
282 isPhotonWithElecMother = kTRUE;
283 if (particleGrandMotherLabel > -1){
284 if (TMath::Abs(particleGrandMotherPDG) == 22 )
293 if (particleMotherLabel > -1) {
295 if (TMath::Abs(particleMotherPDG) == 22)
296 isConversion = kTRUE;
298 if (particleGrandMotherLabel > -1 && particleGrandMotherNDaugthers == 3 )
301 if (particleGrandMotherLabel > -1){
302 if (TMath::Abs(particleGrandMotherPDG) == 11 || TMath::Abs(particleGrandMotherPDG) == 22){
307 if (isConversion && TMath::Abs(particleGrandMotherPDG) == 11 && particleGrandMotherX2PDG == 22){
310 if (TMath::Abs(particleGrandMotherX3PDG) == 11 && particleGrandMotherX4PDG == 22 ){
313 if (TMath::Abs(particleGrandMotherX5PDG) == 11 && particleGrandMotherX6PDG == 22 ){
321 if (particleMotherLabel > -1){
322 TParticle *dummyMother = mcEvent->Particle(particleMotherLabel);
323 Bool_t originReached = kFALSE;
325 while (dummyMother->GetPdgCode() == 22 && !originReached){
326 if (dummyMother->GetMother(0) > -1){
327 dummyMother = mcEvent->Particle(dummyMother->GetMother(0));
328 if (TMath::Abs(dummyMother->GetPdgCode()) == 11){
329 if (dummyMother->GetMother(0) > -1){
330 dummyMother = mcEvent->Particle(dummyMother->GetMother(0));
332 originReached = kTRUE;
335 originReached = kTRUE;
337 isElectronFromFragPhoton = (TMath::Abs(dummyMother->GetPdgCode()) < 6);
339 originReached = kTRUE;
346 Bool_t enablePrintOuts = kFALSE;
352 TParticle* dummyPart =NULL;
355 if (i > 49)
continue;
356 if (enablePrintOuts) cout <<
"checking particle: " << i << endl;
359 Int_t dummyPartMotherLabel = dummyPart->GetMother(0);
360 Int_t dummyPartGrandMotherLabel = -1;
361 Int_t dummyPartMotherPDG = -1;
362 Int_t dummyPartGrandMotherPDG = -1;
364 if (dummyPartMotherLabel > -1){
365 dummyPartGrandMotherLabel = mcEvent->Particle(dummyPart->GetMother(0))->GetMother(0);
366 dummyPartMotherPDG = mcEvent->Particle(dummyPart->GetMother(0))->GetPdgCode();
368 if (dummyPartGrandMotherLabel > -1){
369 dummyPartGrandMotherPDG = mcEvent->Particle(mcEvent->Particle(dummyPart->GetMother(0))->GetMother(0))->GetPdgCode();
373 if (isPhoton && (!isShower || !isPhotonWithElecMother )){
374 if (enablePrintOuts) cout <<
"lead gamma" << endl;
375 if (dummyPartMotherLabel > -1 && particleMotherLabel > -1){
376 if (dummyPartMotherLabel == particleMotherLabel)
378 if (dummyPartGrandMotherLabel > -1){
380 if (TMath::Abs(dummyPart->GetPdgCode()) == 11 && dummyPartGrandMotherLabel == particleMotherLabel )
381 isMergedPartConv = kTRUE;
383 if (TMath::Abs(dummyPart->GetPdgCode()) == 11 && dummyPartMotherLabel == particleMotherLabel )
384 isDalitzMerged = kTRUE;
390 if (isElectron && !isShower){
391 if (enablePrintOuts) cout <<
"lead electron" << endl;
392 if (dummyPartMotherLabel > -1 && particleMotherLabel > -1){
393 if ( TMath::Abs(dummyPart->GetPdgCode()) == 11 && isConversion && dummyPartMotherLabel == particleMotherLabel ) {
394 isConversionFullyContained = kTRUE;
395 if (enablePrintOuts) cout <<
"found full conversion" << endl;
396 }
else if (TMath::Abs(dummyPart->GetPdgCode()) == 11) {
397 if (enablePrintOuts) cout <<
"current is electron" << endl;
399 Bool_t isShowerCurrent = kFALSE;
400 if (TMath::Abs(dummyPartGrandMotherPDG) == 11)
401 isShowerCurrent = kTRUE;
402 if (TMath::Abs(dummyPartGrandMotherPDG) == 22)
403 isShowerCurrent = kTRUE;
406 Bool_t isConvCurrent = kFALSE;
407 if (TMath::Abs(dummyPartMotherPDG) == 22 && !isShowerCurrent)
408 isConvCurrent = kTRUE;
410 if (enablePrintOuts) cout <<
"conv current: " << isConvCurrent <<
"\t shower current: " << isShowerCurrent << endl;
412 if( dummyPartMotherLabel == particleMotherLabel && TMath::Abs(particleMotherPDG) != 22 && !isShowerCurrent ) {
413 isDalitzMerged = kTRUE;
416 }
else if (isConversion && isConvCurrent){
417 if (particleGrandMotherLabel > -1 && dummyPartGrandMotherLabel > -1){
419 if( dummyPartGrandMotherLabel == particleGrandMotherLabel && !isShowerCurrent )
420 isMergedPartConv = kTRUE;
423 }
else if (dummyPartGrandMotherLabel > -1 && isConvCurrent){
424 if (dummyPartGrandMotherLabel == particleMotherLabel && (TMath::Abs(particleMotherPDG) == 111 || TMath::Abs(particleMotherPDG) == 221 || TMath::Abs(particleMotherPDG) == 331) ){
425 isDalitzMerged = kTRUE;
429 }
else if (isConversion && particleGrandMotherLabel > -1){
430 if (dummyPartMotherLabel == particleGrandMotherLabel && (TMath::Abs(dummyPartMotherPDG) == 111 || TMath::Abs(dummyPartMotherPDG) == 221 || TMath::Abs(dummyPartMotherPDG) == 331) ){
431 isDalitzMerged = kTRUE;
435 }
else if (TMath::Abs(dummyPart->GetPdgCode()) == 22){
437 Bool_t isShowerCurrent = kFALSE;
438 if (TMath::Abs(dummyPartMotherPDG) == 11)
439 isShowerCurrent = kTRUE;
440 if (TMath::Abs(dummyPartMotherPDG) == 22)
441 isShowerCurrent = kTRUE;
444 if( dummyPartMotherLabel == particleMotherLabel && !isShowerCurrent ) {
445 isDalitzMerged = kTRUE;
447 }
else if (particleGrandMotherLabel > -1){
449 if( dummyPartMotherLabel == particleGrandMotherLabel && !isShowerCurrent )
450 isMergedPartConv = kTRUE;
457 if (dummyPartMotherLabel > -1){
458 if (TMath::Abs(dummyPart->GetPdgCode()) == 22){
468 fNCaloPhotonMotherMCLabels++;
470 if ((TMath::Abs(dummyPartMotherPDG) == 111 || TMath::Abs(dummyPartMotherPDG) == 221 || TMath::Abs(dummyPartMotherPDG) == 331) && !isPhoton && !isElectron)
471 isSubLeadingEM = kTRUE;
472 }
else if (TMath::Abs(dummyPart->GetPdgCode()) == 11){
474 if ( TMath::Abs(dummyPartMotherPDG) != 22 ){
483 fNCaloPhotonMotherMCLabels++;
485 if ((TMath::Abs(dummyPartMotherPDG) == 111 || TMath::Abs(dummyPartMotherPDG) == 221 || TMath::Abs(dummyPartMotherPDG) == 331) && !isPhoton && !isElectron)
486 isSubLeadingEM = kTRUE;
487 }
else if (dummyPartGrandMotherLabel > -1){
489 if ( (TMath::Abs(dummyPartGrandMotherPDG) == 111 || TMath::Abs(dummyPartGrandMotherPDG) == 221 || TMath::Abs(dummyPartGrandMotherPDG) == 331)){
499 fNCaloPhotonMotherMCLabels++;
501 if (!isPhoton && !isElectron)
502 isSubLeadingEM = kTRUE;
509 fCaloPhotonMCFlags = isPhoton *1 + isElectron *2 + isConversion*4+ isConversionFullyContained *8 + isMerged *16 + isMergedPartConv*32 + isDalitz *64 + isDalitzMerged *128 + isPhotonWithElecMother *256 + isShower * 512 + isSubLeadingEM * 1024 + isElectronFromFragPhoton * 2048;
514 TClonesArray *AODMCTrackArray =
dynamic_cast<TClonesArray*
>(
event->FindListObject(AliAODMCParticle::StdBranchName()));
515 if (!AODMCTrackArray)
return;
518 Bool_t isElectron = kFALSE;
519 Bool_t isConversion = kFALSE;
520 Bool_t isConversionFullyContained = kFALSE;
522 Bool_t isMergedPartConv = kFALSE;
524 Bool_t isDalitzMerged = kFALSE;
525 Bool_t isPhotonWithElecMother = kFALSE;
527 Bool_t isSubLeadingEM = kFALSE;
528 Bool_t isElectronFromFragPhoton = kFALSE;
530 AliAODMCParticle* Photon;
531 AliAODMCParticle* PhotonMother;
532 AliAODMCParticle* PhotonGrandMother;
548 energyPerPart[i] = dummy->E();
550 if (!(TMath::Abs(dummy->GetPdgCode())== 11 || TMath::Abs(dummy->GetPdgCode())== 22)){
552 energyPerPart[i]= 0.25;
555 energyPerPart[i] = 0;
559 TMath::Sort(fNCaloPhotonMCLabels,energyPerPart,sortIdx);
565 delete [] energyPerPart;
566 delete [] orginalContrib;
574 Int_t particleMotherLabel = Photon->GetMother();
575 Int_t particleGrandMotherLabel = -1;
576 Int_t particleMotherPDG = -1;
577 Int_t particleGrandMotherPDG = -1;
578 Int_t particleMotherNDaugthers = 0;
579 Int_t particleGrandMotherNDaugthers = 0;
580 Int_t particleGrandMotherX2Label = -1;
581 Int_t particleGrandMotherX3Label = -1;
582 Int_t particleGrandMotherX4Label = -1;
583 Int_t particleGrandMotherX5Label = -1;
584 Int_t particleGrandMotherX6Label = -1;
585 Int_t particleGrandMotherX7Label = -1;
586 Int_t particleGrandMotherX2PDG = -1;
587 Int_t particleGrandMotherX3PDG = -1;
588 Int_t particleGrandMotherX4PDG = -1;
589 Int_t particleGrandMotherX5PDG = -1;
590 Int_t particleGrandMotherX6PDG = -1;
592 if (particleMotherLabel > -1){
593 PhotonMother = (AliAODMCParticle*) AODMCTrackArray->At(Photon->GetMother());
594 particleMotherNDaugthers = PhotonMother->GetNDaughters();
595 particleGrandMotherLabel = PhotonMother->GetMother();
596 particleMotherPDG = PhotonMother->GetPdgCode();
597 if (particleGrandMotherLabel > -1){
598 PhotonGrandMother = (AliAODMCParticle*) AODMCTrackArray->At(PhotonMother->GetMother());
599 particleGrandMotherPDG = PhotonGrandMother->GetPdgCode();
600 particleGrandMotherNDaugthers = PhotonGrandMother->GetNDaughters();
601 AliAODMCParticle* dummyGMM = NULL;
603 particleGrandMotherX2Label = PhotonGrandMother->GetMother();
604 if (particleGrandMotherX2Label > -1){
605 dummyGMM = (AliAODMCParticle*) AODMCTrackArray->At(particleGrandMotherX2Label);
606 particleGrandMotherX2PDG = dummyGMM->GetPdgCode();
607 particleGrandMotherX3Label = dummyGMM->GetMother();
608 if (particleGrandMotherX3Label > -1){
609 dummyGMM = (AliAODMCParticle*) AODMCTrackArray->At(particleGrandMotherX3Label);
610 particleGrandMotherX3PDG = dummyGMM->GetPdgCode();
611 particleGrandMotherX4Label = dummyGMM->GetMother();
612 if (particleGrandMotherX4Label > -1){
613 dummyGMM = (AliAODMCParticle*) AODMCTrackArray->At(particleGrandMotherX4Label);
614 particleGrandMotherX4PDG = dummyGMM->GetPdgCode();
615 particleGrandMotherX5Label = dummyGMM->GetMother();
616 if (particleGrandMotherX5Label > -1){
617 dummyGMM = (AliAODMCParticle*) AODMCTrackArray->At(particleGrandMotherX5Label);
618 particleGrandMotherX5PDG = dummyGMM->GetPdgCode();
619 particleGrandMotherX6Label = dummyGMM->GetMother();
620 if (particleGrandMotherX6Label > -1){
621 dummyGMM = (AliAODMCParticle*) AODMCTrackArray->At(particleGrandMotherX6Label);
622 particleGrandMotherX6PDG = dummyGMM->GetPdgCode();
623 particleGrandMotherX7Label = dummyGMM->GetMother();
633 if (particleMotherLabel > -1){
634 if( TMath::Abs(particleMotherPDG) == 111 || TMath::Abs(particleMotherPDG) == 221 || TMath::Abs(particleMotherPDG) == 331 ){
637 }
else if (TMath::Abs(particleMotherPDG) == 22 && particleGrandMotherLabel > -1){
638 if ( TMath::Abs(particleMotherPDG) == 22 && (TMath::Abs(particleGrandMotherPDG) == 111 || TMath::Abs(particleGrandMotherPDG) == 221 || TMath::Abs(particleGrandMotherPDG) == 331) ){
649 if(TMath::Abs(Photon->GetPdgCode()) == 22){
652 if (particleMotherLabel > -1 && particleMotherNDaugthers == 3)
655 if (TMath::Abs(particleMotherPDG) == 11){
656 isPhotonWithElecMother = kTRUE;
657 if (particleGrandMotherLabel > -1){
658 if (TMath::Abs(particleGrandMotherPDG) == 22 )
664 if(TMath::Abs(Photon->GetPdgCode()) == 11 ){
666 if (particleMotherLabel > -1) {
668 if (TMath::Abs(particleMotherPDG) == 22)
669 isConversion = kTRUE;
671 if (particleGrandMotherLabel > -1 && particleGrandMotherNDaugthers == 3 )
674 if (particleGrandMotherLabel > -1){
675 if (TMath::Abs(particleGrandMotherPDG) == 11 || TMath::Abs(particleGrandMotherPDG) == 22){
680 if (isConversion && TMath::Abs(particleGrandMotherPDG) == 11 && particleGrandMotherX2PDG == 22){
683 if (TMath::Abs(particleGrandMotherX3PDG) == 11 && particleGrandMotherX4PDG == 22 ){
686 if (TMath::Abs(particleGrandMotherX5PDG) == 11 && particleGrandMotherX6PDG == 22 ){
694 if (particleMotherLabel > -1){
695 AliAODMCParticle* dummyMother = (AliAODMCParticle*) AODMCTrackArray->At(Photon->GetMother());
697 Bool_t originReached = kFALSE;
698 while (dummyMother->GetPdgCode() == 22 && !originReached){
699 if (dummyMother->GetMother() > -1){
700 dummyMother = (AliAODMCParticle*) AODMCTrackArray->At(dummyMother->GetMother());
701 if (TMath::Abs(dummyMother->GetPdgCode()) == 11){
702 if (dummyMother->GetMother() > -1){
703 dummyMother = (AliAODMCParticle*) AODMCTrackArray->At(dummyMother->GetMother());
705 originReached = kTRUE;
708 originReached = kTRUE;
710 isElectronFromFragPhoton = (TMath::Abs(dummyMother->GetPdgCode()) < 6);
712 originReached = kTRUE;
723 AliAODMCParticle* dummyPart = NULL;
724 AliAODMCParticle* dummyPartMother = NULL;
725 AliAODMCParticle* dummyPartGrandMother = NULL;
727 if (i > 49)
continue;
729 Int_t dummyPartMotherLabel = dummyPart->GetMother();
730 Int_t dummyPartGrandMotherLabel = -1;
731 Int_t dummyPartMotherPDG = -1;
732 Int_t dummyPartGrandMotherPDG = -1;
735 if (dummyPartMotherLabel > -1){
736 dummyPartMother = (AliAODMCParticle*) AODMCTrackArray->At(dummyPart->GetMother());
737 dummyPartGrandMotherLabel = dummyPartMother->GetMother();
738 dummyPartMotherPDG = dummyPartMother->GetPdgCode();
740 if (dummyPartGrandMotherLabel > -1){
741 dummyPartGrandMother = (AliAODMCParticle*) AODMCTrackArray->At(dummyPartMother->GetMother());
742 dummyPartGrandMotherPDG = dummyPartGrandMother->GetPdgCode();
748 if (isPhoton && (!isShower || !isPhotonWithElecMother )){
749 if (dummyPartMotherLabel > -1 && particleMotherLabel > -1){
750 if (dummyPartMotherLabel == particleMotherLabel)
752 if (dummyPartGrandMotherLabel > -1){
754 if (TMath::Abs(dummyPart->GetPdgCode()) == 11 && dummyPartGrandMotherLabel == particleMotherLabel )
755 isMergedPartConv = kTRUE;
757 if (TMath::Abs(dummyPart->GetPdgCode()) == 11 && dummyPartMotherLabel == particleMotherLabel )
758 isDalitzMerged = kTRUE;
764 if (isElectron && !isShower){
765 if (dummyPartMotherLabel > -1 && particleMotherLabel > -1){
766 if ( TMath::Abs(dummyPart->GetPdgCode()) == 11 && isConversion && dummyPartMotherLabel == particleMotherLabel ) {
767 isConversionFullyContained = kTRUE;
768 }
else if (TMath::Abs(dummyPart->GetPdgCode()) == 11) {
771 Bool_t isShowerCurrent = kFALSE;
772 if (TMath::Abs(dummyPartGrandMotherPDG) == 11)
773 isShowerCurrent = kTRUE;
774 if (TMath::Abs(dummyPartGrandMotherPDG) == 22)
775 isShowerCurrent = kTRUE;
778 Bool_t isConvCurrent = kFALSE;
779 if (TMath::Abs(dummyPartMotherPDG) == 22 && !isShowerCurrent)
780 isConvCurrent = kTRUE;
783 if( dummyPartMotherLabel == particleMotherLabel && TMath::Abs(particleMotherPDG) != 22 && !isShowerCurrent ) {
784 isDalitzMerged = kTRUE;
787 }
else if (isConversion && isConvCurrent){
788 if (particleGrandMotherLabel > -1 && dummyPartGrandMotherLabel > -1){
790 if( dummyPartGrandMotherLabel == particleGrandMotherLabel && !isShowerCurrent )
791 isMergedPartConv = kTRUE;
794 }
else if (dummyPartGrandMotherLabel > -1 && isConvCurrent){
795 if (dummyPartGrandMotherLabel == particleMotherLabel && (TMath::Abs(particleMotherPDG) == 111 || TMath::Abs(particleMotherPDG) == 221 || TMath::Abs(particleMotherPDG) == 331) ){
796 isDalitzMerged = kTRUE;
800 }
else if (isConversion && particleGrandMotherLabel > -1){
801 if (dummyPartMotherLabel == particleGrandMotherLabel && (TMath::Abs(dummyPartMotherPDG) == 111 || TMath::Abs(dummyPartMotherPDG) == 221 || TMath::Abs(dummyPartMotherPDG) == 331) ){
802 isDalitzMerged = kTRUE;
806 }
else if (TMath::Abs(dummyPart->GetPdgCode()) == 22){
808 Bool_t isShowerCurrent = kFALSE;
809 if (TMath::Abs(dummyPartMotherPDG) == 11)
810 isShowerCurrent = kTRUE;
811 if (TMath::Abs(dummyPartMotherPDG) == 22)
812 isShowerCurrent = kTRUE;
815 if( dummyPartMotherLabel == particleMotherLabel && !isShowerCurrent ) {
816 isDalitzMerged = kTRUE;
818 }
else if (particleGrandMotherLabel > -1){
820 if( dummyPartMotherLabel == particleGrandMotherLabel && !isShowerCurrent )
821 isMergedPartConv = kTRUE;
827 if (dummyPartMotherLabel > -1){
828 if (TMath::Abs(dummyPart->GetPdgCode()) == 22){
838 fNCaloPhotonMotherMCLabels++;
840 if ((TMath::Abs(dummyPartMotherPDG) == 111 || TMath::Abs(dummyPartMotherPDG) == 221 || TMath::Abs(dummyPartMotherPDG) == 331) && !isPhoton && !isElectron)
841 isSubLeadingEM = kTRUE;
842 }
else if (TMath::Abs(dummyPart->GetPdgCode()) == 11){
844 if ( TMath::Abs(dummyPartMotherPDG) != 22 ){
853 fNCaloPhotonMotherMCLabels++;
855 if ((TMath::Abs(dummyPartMotherPDG) == 111 || TMath::Abs(dummyPartMotherPDG) == 221 || TMath::Abs(dummyPartMotherPDG) == 331) && !isPhoton && !isElectron)
856 isSubLeadingEM = kTRUE;
857 }
else if (dummyPartGrandMotherLabel > -1){
859 if ( (TMath::Abs(dummyPartGrandMotherPDG) == 111 || TMath::Abs(dummyPartGrandMotherPDG) == 221 || TMath::Abs(dummyPartGrandMotherPDG) == 331)){
869 fNCaloPhotonMotherMCLabels++;
871 if (!isPhoton && !isElectron)
872 isSubLeadingEM = kTRUE;
879 fCaloPhotonMCFlags = isPhoton *1 + isElectron *2 + isConversion*4+ isConversionFullyContained *8 + isMerged *16 + isMergedPartConv*32 + isDalitz *64 + isDalitzMerged *128 + isPhotonWithElecMother *256 + isShower * 512 + isSubLeadingEM * 1024 + isElectronFromFragPhoton * 2048;;
886 cout << endl << endl <<
"particles contributing: " << endl;
888 TParticle *dummy = NULL;
891 cout << i <<
"\t"<<
fCaloPhotonMCLabels[i] <<
"\t pdg code: " <<dummy->GetPdgCode() <<
"\t prod radius: "<< dummy->R() <<
"\t energy: " << dummy->Energy() ;
892 if (dummy->GetMother(0) > -1){
893 TParticle* dummyMother = (TParticle*)mcEvent->Particle(dummy->GetMother(0));
894 cout <<
"\t mother part: " << dummy->GetMother(0) <<
"\t mother pdg code: " << dummyMother->GetPdgCode() <<
"\t energy: " << dummyMother->Energy() << endl;
895 if (dummyMother->GetMother(0) > -1){
896 TParticle* dummyGrandMother = (TParticle*)mcEvent->Particle(dummyMother->GetMother(0));
897 cout <<
"\t grandmother part: " << dummyMother->GetMother(0) <<
"\t grandmother pdg code: " << dummyGrandMother->GetPdgCode() <<
"\t energy: " << dummyGrandMother->Energy() << endl;
907 cout <<
"mothers contributing: " << endl;
909 TParticle *dummy = NULL;
912 cout << i <<
"\t"<<
fCaloPhotonMotherMCLabels[i] <<
"\t pdg code: " <<dummy->GetPdgCode() <<
"\t prod radius: "<< dummy->R() <<
"\t energy: " << dummy->Energy() << endl;
virtual Double_t GetPy() const
Long_t fCaloPhotonMotherMCLabels[20]
Int_t fNCaloPhotonMCLabels
Int_t fNCaloPhotonMotherMCLabels
void SetCaloPhotonMCFlags(AliMCEvent *mcEvent, Bool_t enableSort)
virtual Double_t GetPz() const
void SetCaloPhotonMCLabel(Int_t i, Int_t labelCaloPhoton)
AliAODConversionPhoton & operator=(const AliAODConversionPhoton &g)
Double_t fConversionPoint[3]
void PrintCaloMCLabelsAndInfo(AliMCEvent *mcEvent)
virtual ~AliAODConversionPhoton()
Bool_t IsLargestComponentElectron()
Int_t GetCaloPhotonMCLabel(Int_t i)
void SetMass(Float_t mass)
virtual Double_t GetPx() const
Long_t fCaloPhotonMCLabels[50]
Bool_t IsPhotonWithElecMother()
Bool_t IsConversionFullyContained()
void CalculateDistanceOfClossetApproachToPrimVtx(const AliVVertex *primVertex)
void SetCaloPhotonMCFlagsAOD(AliVEvent *event, Bool_t enableSort)
Bool_t IsLargestComponentPhoton()
Bool_t IsMergedPartConv()