1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Authors: Svein Lindal, Daniel Lohner *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 ////////////////////////////////////////////////
17 //---------------------------------------------
18 // Class handling all kinds of selection cuts for
19 // Gamma Conversion analysis
20 //---------------------------------------------
21 ////////////////////////////////////////////////
23 #include "AliConversionMesonCuts.h"
25 #include "AliKFVertex.h"
26 #include "AliAODTrack.h"
27 #include "AliESDtrack.h"
28 #include "AliAnalysisManager.h"
29 #include "AliInputEventHandler.h"
30 #include "AliMCEventHandler.h"
31 #include "AliAODHandler.h"
32 #include "AliPIDResponse.h"
36 #include "AliAODConversionMother.h"
37 #include "TObjString.h"
38 #include "AliAODEvent.h"
39 #include "AliESDEvent.h"
40 #include "AliCentrality.h"
46 ClassImp(AliConversionMesonCuts)
49 const char* AliConversionMesonCuts::fgkCutNames[AliConversionMesonCuts::kNCuts] = {
53 "DegreesForRotationMethod",
64 //________________________________________________________________________
65 AliConversionMesonCuts::AliConversionMesonCuts(const char *name,const char *title) :
66 AliAnalysisCuts(name,title),
74 fUseRotationMethodInBG(kFALSE),
76 fdoBGProbability(kFALSE),
77 fUseTrackMultiplicityForBG(kFALSE),
78 fnDegreeRotationPMForBG(0),
81 fDoToCloseV0sCut(kFALSE),
83 fDoSharedElecCut(kFALSE),
84 fUseMCPSmearing(kFALSE),
90 fElectronArraySize(500),
91 fElectronLabelArray(NULL),
92 fBackgroundHandler(0),
98 for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;}
99 fCutString=new TObjString((GetCutNumber()).Data());
100 fElectronLabelArray = new Int_t[500];
102 fBrem = new TF1("fBrem","pow(-log(x),[0]/log(2.0)-1.0)/TMath::Gamma([0]/log(2.0))",0.00001,0.999999999);
103 // tests done with 1.0e-14
104 fBrem->SetParameter(0,fPBremSmearing);
105 fBrem->SetNpx(100000);
110 //________________________________________________________________________
111 AliConversionMesonCuts::AliConversionMesonCuts(const AliConversionMesonCuts &ref) :
112 AliAnalysisCuts(ref),
114 fMesonKind(ref.fMesonKind),
116 fChi2CutMeson(ref.fChi2CutMeson),
117 fAlphaMinCutMeson(ref.fAlphaMinCutMeson),
118 fAlphaCutMeson(ref.fAlphaCutMeson),
119 fRapidityCutMeson(ref.fRapidityCutMeson),
120 fUseRotationMethodInBG(ref.fUseRotationMethodInBG),
122 fdoBGProbability(ref.fdoBGProbability),
123 fUseTrackMultiplicityForBG(ref.fUseTrackMultiplicityForBG),
124 fnDegreeRotationPMForBG(ref.fnDegreeRotationPMForBG),
125 fNumberOfBGEvents(ref. fNumberOfBGEvents),
126 fOpeningAngle(ref.fOpeningAngle),
127 fDoToCloseV0sCut(ref.fDoToCloseV0sCut),
128 fminV0Dist(ref.fminV0Dist),
129 fDoSharedElecCut(ref.fDoSharedElecCut),
130 fUseMCPSmearing(ref.fUseMCPSmearing),
131 fPBremSmearing(ref.fPBremSmearing),
132 fPSigSmearing(ref.fPSigSmearing),
133 fPSigSmearingCte(ref.fPSigSmearingCte),
135 fRandom(ref.fRandom),
136 fElectronArraySize(ref.fElectronArraySize),
137 fElectronLabelArray(NULL),
138 fBackgroundHandler(ref.fBackgroundHandler),
145 for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=ref.fCuts[jj];}
146 fCutString=new TObjString((GetCutNumber()).Data());
147 fElectronLabelArray = new Int_t[fElectronArraySize];
148 if (fBrem == NULL)fBrem = (TF1*)ref.fBrem->Clone("fBrem");
149 // Histograms are not copied, if you need them, call InitCutHistograms
152 //________________________________________________________________________
153 AliConversionMesonCuts::~AliConversionMesonCuts() {
155 //Deleting fHistograms leads to seg fault it it's added to output collection of a task
157 // delete fHistograms;
158 // fHistograms = NULL;
159 if(fCutString != NULL){
163 if(fElectronLabelArray){
164 delete fElectronLabelArray;
165 fElectronLabelArray = NULL;
170 //________________________________________________________________________
171 void AliConversionMesonCuts::InitCutHistograms(TString name){
173 // Initialize Cut Histograms for QA (only initialized and filled if function is called)
175 if(fHistograms != NULL){
179 if(fHistograms==NULL){
180 fHistograms=new TList();
181 if(name=="")fHistograms->SetName(Form("ConvMesonCuts_%s",GetCutNumber().Data()));
182 else fHistograms->SetName(Form("%s_%s",name.Data(),GetCutNumber().Data()));
186 hMesonCuts=new TH1F(Form("MesonCuts %s",GetCutNumber().Data()),"MesonCuts",10,-0.5,9.5);
187 hMesonCuts->GetXaxis()->SetBinLabel(1,"in");
188 hMesonCuts->GetXaxis()->SetBinLabel(2,"undef rapidity");
189 hMesonCuts->GetXaxis()->SetBinLabel(3,"rapidity cut");
190 hMesonCuts->GetXaxis()->SetBinLabel(4,"opening angle");
191 hMesonCuts->GetXaxis()->SetBinLabel(5,"alpha max");
192 hMesonCuts->GetXaxis()->SetBinLabel(6,"alpha min");
193 hMesonCuts->GetXaxis()->SetBinLabel(7,"out");
194 fHistograms->Add(hMesonCuts);
196 hMesonBGCuts=new TH1F(Form("MesonBGCuts %s",GetCutNumber().Data()),"MesonBGCuts",10,-0.5,9.5);
197 hMesonBGCuts->GetXaxis()->SetBinLabel(1,"in");
198 hMesonBGCuts->GetXaxis()->SetBinLabel(2,"undef rapidity");
199 hMesonBGCuts->GetXaxis()->SetBinLabel(3,"rapidity cut");
200 hMesonBGCuts->GetXaxis()->SetBinLabel(4,"opening angle");
201 hMesonBGCuts->GetXaxis()->SetBinLabel(5,"alpha max");
202 hMesonBGCuts->GetXaxis()->SetBinLabel(6,"alpha min");
203 hMesonBGCuts->GetXaxis()->SetBinLabel(7,"out");
204 fHistograms->Add(hMesonBGCuts);
208 //________________________________________________________________________
209 Bool_t AliConversionMesonCuts::MesonIsSelectedMC(TParticle *fMCMother,AliStack *fMCStack){
210 // Returns true for all pions within acceptance cuts for decay into 2 photons
211 // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
213 if(!fMCStack)return kFALSE;
215 if(fMCMother->GetPdgCode()==111 || fMCMother->GetPdgCode()==221){
216 if(fMCMother->R()>fMaxR) return kFALSE; // cuts on distance from collision point
218 Double_t rapidity = 10.;
219 if(fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0){
222 rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())));
226 if(abs(rapidity)>fRapidityCutMeson)return kFALSE;
228 // Select only -> 2y decay channel
229 if(fMCMother->GetNDaughters()!=2)return kFALSE;
231 for(Int_t i=0;i<2;i++){
232 TParticle *MDaughter=fMCStack->Particle(fMCMother->GetDaughter(i));
233 // Is Daughter a Photon?
234 if(MDaughter->GetPdgCode()!=22)return kFALSE;
235 // Is Photon in Acceptance?
236 // if(bMCDaughtersInAcceptance){
237 // if(!PhotonIsSelectedMC(MDaughter,fMCStack)){return kFALSE;}
245 //________________________________________________________________________
246 Bool_t AliConversionMesonCuts::MesonIsSelectedMCDalitz(TParticle *fMCMother,AliStack *fMCStack){
247 // Returns true for all pions within acceptance cuts for decay into 2 photons
248 // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
250 if(!fMCStack)return kFALSE;
252 if(fMCMother->GetPdgCode()==111 || fMCMother->GetPdgCode()==221){
254 if(fMCMother->R()>fMaxR) return kFALSE; // cuts on distance from collision point
256 Double_t rapidity = 10.;
257 if(fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0){
261 rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())));
265 if(abs(rapidity)>fRapidityCutMeson)return kFALSE;
267 // Select only -> Dalitz decay channel
268 if(fMCMother->GetNDaughters()!=3)return kFALSE;
270 Int_t daughterPDGs[3] = {0,0,0};
273 // iParticle->GetFirstDaughter(); idxPi0 <= iParticle->GetLastDaughter()
275 for(Int_t i=fMCMother->GetFirstDaughter(); i<= fMCMother->GetLastDaughter();i++){
276 TParticle *MDaughter=fMCStack->Particle(i);
277 // Is Daughter a Photon or an electron?
278 daughterPDGs[index]=MDaughter->GetPdgCode();
281 for (Int_t j=0;j<2;j++){
283 for (Int_t i=0;i<2;i++){
284 if (daughterPDGs[i] > daughterPDGs[i+1]){
285 Int_t interMed = daughterPDGs[i] ;
286 daughterPDGs[i] = daughterPDGs[i+1];
287 daughterPDGs[i+1] = interMed;
291 if (daughterPDGs[0] == -11 && daughterPDGs[1] == 11 && daughterPDGs[2] == 22) return kTRUE;
297 ///________________________________________________________________________
298 Bool_t AliConversionMesonCuts::MesonIsSelected(AliAODConversionMother *pi0,Bool_t IsSignal)
300 // Selection of reconstructed Meson candidates
301 // Use flag IsSignal in order to fill Fill different
302 // histograms for Signal and Background
305 if(IsSignal){hist=hMesonCuts;}
306 else{hist=hMesonBGCuts;}
310 if(hist)hist->Fill(cutIndex);
313 // Undefined Rapidity -> Floating Point exception
314 if((pi0->E()+pi0->Pz())/(pi0->E()-pi0->Pz())<=0){
315 if(hist)hist->Fill(cutIndex);
320 // PseudoRapidity Cut --> But we cut on Rapidity !!!
322 if(abs(pi0->Rapidity())>fRapidityCutMeson){
323 if(hist)hist->Fill(cutIndex);
330 //fOpeningAngle=2*TMath::ATan(0.134/pi0->P());// physical minimum opening angle
331 if( pi0->GetOpeningAngle() < fOpeningAngle){
332 if(hist)hist->Fill(cutIndex);
338 if(pi0->GetAlpha()>fAlphaCutMeson){
339 if(hist)hist->Fill(cutIndex);
345 if(pi0->GetAlpha()<fAlphaMinCutMeson){
346 if(hist)hist->Fill(cutIndex);
351 if(hist)hist->Fill(cutIndex);
357 ///________________________________________________________________________
358 ///________________________________________________________________________
359 Bool_t AliConversionMesonCuts::UpdateCutString() {
360 ///Update the cut string (if it has been created yet)
362 if(fCutString && fCutString->GetString().Length() == kNCuts) {
363 // cout << "Updating cut id in spot number " << cutID << " to " << value << endl;
364 fCutString->SetString(GetCutNumber());
366 // cout << "fCutString not yet initialized, will not be updated" << endl;
369 // cout << fCutString->GetString().Data() << endl;
373 ///________________________________________________________________________
374 Bool_t AliConversionMesonCuts::InitializeCutsFromCutString(const TString analysisCutSelection ) {
375 // Initialize Cuts from a given Cut string
376 AliInfo(Form("Set Meson Cutnumber: %s",analysisCutSelection.Data()));
377 if(analysisCutSelection.Length()!=kNCuts) {
378 AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
381 if(!analysisCutSelection.IsDigit()){
382 AliError("Cut selection contains characters");
386 const char *cutSelection = analysisCutSelection.Data();
387 #define ASSIGNARRAY(i) fCuts[i] = cutSelection[i] - '0'
388 for(Int_t ii=0;ii<kNCuts;ii++){
392 // Set Individual Cuts
393 for(Int_t ii=0;ii<kNCuts;ii++){
394 if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
400 ///________________________________________________________________________
401 Bool_t AliConversionMesonCuts::SetCut(cutIds cutID, const Int_t value) {
402 ///Set individual cut ID
404 //cout << "Updating cut " << fgkCutNames[cutID] << " (" << cutID << ") to " << value << endl;
407 if( SetMesonKind(value)) {
408 fCuts[kMesonKind] = value;
411 } else return kFALSE;
413 if( SetChi2MesonCut(value)) {
414 fCuts[kchi2MesonCut] = value;
417 } else return kFALSE;
419 if( SetAlphaMesonCut(value)) {
420 fCuts[kalphaMesonCut] = value;
423 } else return kFALSE;
425 if( SetRCut(value)) {
426 fCuts[kRCut] = value;
429 } else return kFALSE;
431 case kRapidityMesonCut:
432 if( SetRapidityMesonCut(value)) {
433 fCuts[kRapidityMesonCut] = value;
436 } else return kFALSE;
438 case kBackgroundScheme:
439 if( SetBackgroundScheme(value)) {
440 fCuts[kBackgroundScheme] = value;
443 } else return kFALSE;
445 case kDegreesForRotationMethod:
446 if( SetNDegreesForRotationMethod(value)) {
447 fCuts[kDegreesForRotationMethod] = value;
450 } else return kFALSE;
452 case kNumberOfBGEvents:
453 if( SetNumberOfBGEvents(value)) {
454 fCuts[kNumberOfBGEvents] = value;
457 } else return kFALSE;
459 case kuseMCPSmearing:
460 if( SetMCPSmearing(value)) {
461 fCuts[kuseMCPSmearing] = value;
464 } else return kFALSE;
466 if( SetSharedElectronCut(value)) {
467 fCuts[kElecShare] = value;
470 } else return kFALSE;
472 if( SetToCloseV0sCut(value)) {
473 fCuts[kToCloseV0s] = value;
476 } else return kFALSE;
479 cout << "Error:: Cut id out of range"<< endl;
483 cout << "Error:: Cut id " << cutID << " not recognized "<< endl;
489 ///________________________________________________________________________
490 void AliConversionMesonCuts::PrintCuts() {
491 // Print out current Cut Selection
492 for(Int_t ic = 0; ic < kNCuts; ic++) {
493 printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
497 ///________________________________________________________________________
498 Bool_t AliConversionMesonCuts::SetMesonKind(Int_t mesonKind){
508 cout<<"Warning: Meson kind not defined"<<mesonKind<<endl;
514 ///________________________________________________________________________
515 Bool_t AliConversionMesonCuts::SetRCut(Int_t rCut){
536 // High purity cuts for PbPb
541 cout<<"Warning: rCut not defined"<<rCut<<endl;
547 ///________________________________________________________________________
548 Bool_t AliConversionMesonCuts::SetChi2MesonCut(Int_t chi2MesonCut){
550 switch(chi2MesonCut){
552 fChi2CutMeson = 100.;
561 fChi2CutMeson = 200.;
564 fChi2CutMeson = 500.;
567 fChi2CutMeson = 1000.;
570 cout<<"Warning: Chi2MesonCut not defined "<<chi2MesonCut<<endl;
577 ///________________________________________________________________________
578 Bool_t AliConversionMesonCuts::SetAlphaMesonCut(Int_t alphaMesonCut)
580 switch(alphaMesonCut){
582 fAlphaMinCutMeson = 0.0;
583 fAlphaCutMeson = 0.7;
586 fAlphaMinCutMeson = 0.0;
587 fAlphaCutMeson = 0.5;
590 fAlphaMinCutMeson = 0.5;
594 fAlphaMinCutMeson = 0.0;
598 fAlphaMinCutMeson = 0.0;
599 fAlphaCutMeson = 0.65;
602 fAlphaMinCutMeson = 0.0;
603 fAlphaCutMeson = 0.75;
606 fAlphaMinCutMeson = 0.0;
607 fAlphaCutMeson = 0.8;
610 fAlphaMinCutMeson = 0.0;
611 fAlphaCutMeson = 0.85;
614 fAlphaMinCutMeson = 0.0;
615 fAlphaCutMeson = 0.6;
618 fAlphaMinCutMeson = 0.0;
619 fAlphaCutMeson = 0.3;
622 cout<<"Warning: AlphaMesonCut not defined "<<alphaMesonCut<<endl;
628 ///________________________________________________________________________
629 Bool_t AliConversionMesonCuts::SetRapidityMesonCut(Int_t RapidityMesonCut){
631 switch(RapidityMesonCut){
633 fRapidityCutMeson = 0.9;
636 fRapidityCutMeson = 0.8;
639 fRapidityCutMeson = 0.7;
642 fRapidityCutMeson = 0.6;
645 fRapidityCutMeson = 0.5;
648 fRapidityCutMeson = 0.85;
651 fRapidityCutMeson = 0.75;
655 cout<<"Warning: RapidityMesonCut not defined "<<RapidityMesonCut<<endl;
662 ///________________________________________________________________________
663 Bool_t AliConversionMesonCuts::SetBackgroundScheme(Int_t BackgroundScheme){
665 switch(BackgroundScheme){
667 fUseRotationMethodInBG=kTRUE;
668 fdoBGProbability=kFALSE;
670 case 1: // mixed event with V0 multiplicity
671 fUseRotationMethodInBG=kFALSE;
672 fUseTrackMultiplicityForBG=kFALSE;
673 fdoBGProbability=kFALSE;
675 case 2: // mixed event with track multiplicity
676 fUseRotationMethodInBG=kFALSE;
677 fUseTrackMultiplicityForBG=kTRUE;
678 fdoBGProbability=kFALSE;
681 fUseRotationMethodInBG=kTRUE;
682 fdoBGProbability=kTRUE;
684 case 4: //No BG calculation
685 cout << "no BG calculation should be done" << endl;
686 fUseRotationMethodInBG=kFALSE;
687 fdoBGProbability=kFALSE;
691 fUseRotationMethodInBG=kTRUE;
692 fdoBGProbability=kFALSE;
693 fBackgroundHandler = 1;
695 case 6: // mixed event with V0 multiplicity
696 fUseRotationMethodInBG=kFALSE;
697 fUseTrackMultiplicityForBG=kFALSE;
698 fdoBGProbability=kFALSE;
699 fBackgroundHandler = 1;
701 case 7: // mixed event with track multiplicity
702 fUseRotationMethodInBG=kFALSE;
703 fUseTrackMultiplicityForBG=kTRUE;
704 fdoBGProbability=kFALSE;
705 fBackgroundHandler = 1;
708 fUseRotationMethodInBG=kTRUE;
709 fdoBGProbability=kTRUE;
710 fBackgroundHandler = 1;
713 cout<<"Warning: BackgroundScheme not defined "<<BackgroundScheme<<endl;
720 ///________________________________________________________________________
721 Bool_t AliConversionMesonCuts::SetNDegreesForRotationMethod(Int_t DegreesForRotationMethod){
723 switch(DegreesForRotationMethod){
725 fnDegreeRotationPMForBG = 5;
728 fnDegreeRotationPMForBG = 10;
731 fnDegreeRotationPMForBG = 15;
734 fnDegreeRotationPMForBG = 20;
737 cout<<"Warning: DegreesForRotationMethod not defined "<<DegreesForRotationMethod<<endl;
740 fCuts[kDegreesForRotationMethod]=DegreesForRotationMethod;
744 ///________________________________________________________________________
745 Bool_t AliConversionMesonCuts::SetNumberOfBGEvents(Int_t NumberOfBGEvents){
747 switch(NumberOfBGEvents){
749 fNumberOfBGEvents = 5;
752 fNumberOfBGEvents = 10;
755 fNumberOfBGEvents = 15;
758 fNumberOfBGEvents = 20;
761 fNumberOfBGEvents = 2;
764 fNumberOfBGEvents = 50;
767 fNumberOfBGEvents = 80;
770 fNumberOfBGEvents = 100;
773 cout<<"Warning: NumberOfBGEvents not defined "<<NumberOfBGEvents<<endl;
778 ///________________________________________________________________________
779 Bool_t AliConversionMesonCuts::SetSharedElectronCut(Int_t sharedElec) {
783 fDoSharedElecCut = kFALSE;
786 fDoSharedElecCut = kTRUE;
789 cout<<"Warning: Shared Electron Cut not defined "<<sharedElec<<endl;
796 ///________________________________________________________________________
797 Bool_t AliConversionMesonCuts::SetToCloseV0sCut(Int_t toClose) {
801 fDoToCloseV0sCut = kFALSE;
805 fDoToCloseV0sCut = kTRUE;
809 fDoToCloseV0sCut = kTRUE;
813 fDoToCloseV0sCut = kTRUE;
817 cout<<"Warning: Shared Electron Cut not defined "<<toClose<<endl;
823 ///________________________________________________________________________
824 Bool_t AliConversionMesonCuts::SetMCPSmearing(Int_t useMCPSmearing)
826 switch(useMCPSmearing){
835 fPBremSmearing=1.0e-14;
841 fPBremSmearing=1.0e-15;
849 fPSigSmearingCte=0.002;
855 fPSigSmearingCte=0.007;
861 fPSigSmearingCte=0.016;
867 fPSigSmearingCte=0.016;
871 fPBremSmearing=1.0e-16;
879 fPSigSmearingCte=0.014;
885 fPSigSmearingCte=0.011;
889 AliError("Warning: UseMCPSmearing not defined");
894 ///________________________________________________________________________
895 TString AliConversionMesonCuts::GetCutNumber(){
896 // returns TString with current cut number
898 for(Int_t ii=0;ii<kNCuts;ii++){
899 a.Append(Form("%d",fCuts[ii]));
904 ///________________________________________________________________________
905 void AliConversionMesonCuts::FillElectonLabelArray(AliAODConversionPhoton* photon, Int_t nV0){
907 Int_t posLabel = photon->GetTrackLabelPositive();
908 Int_t negLabel = photon->GetTrackLabelNegative();
910 fElectronLabelArray[nV0*2] = posLabel;
911 fElectronLabelArray[(nV0*2)+1] = negLabel;
914 ///________________________________________________________________________
915 Bool_t AliConversionMesonCuts::RejectSharedElectronV0s(AliAODConversionPhoton* photon, Int_t nV0, Int_t nV0s){
917 Int_t posLabel = photon->GetTrackLabelPositive();
918 Int_t negLabel = photon->GetTrackLabelNegative();
920 for(Int_t i = 0; i<nV0s*2;i++){
921 if(i==nV0*2) continue;
922 if(i==(nV0*2)+1) continue;
923 if(fElectronLabelArray[i] == posLabel){
925 if(fElectronLabelArray[i] == negLabel){
931 ///________________________________________________________________________
932 Bool_t AliConversionMesonCuts::RejectToCloseV0s(AliAODConversionPhoton* photon, TList *photons, Int_t nV0){
933 Double_t posX = photon->GetConversionX();
934 Double_t posY = photon->GetConversionY();
935 Double_t posZ = photon->GetConversionZ();
937 for(Int_t i = 0;i<photons->GetEntries();i++){
938 if(nV0 == i) continue;
939 AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
940 Double_t posCompX = photonComp->GetConversionX();
941 Double_t posCompY = photonComp->GetConversionY();
942 Double_t posCompZ = photonComp->GetConversionZ();
944 Double_t dist = pow((posX - posCompX),2)+pow((posY - posCompY),2)+pow((posZ - posCompZ),2);
946 if(dist < fminV0Dist*fminV0Dist){
947 if(photon->GetChi2perNDF() < photonComp->GetChi2perNDF()) return kTRUE;
956 ///________________________________________________________________________
957 void AliConversionMesonCuts::SmearParticle(AliAODConversionPhoton* photon)
959 Double_t facPBrem = 1.;
960 Double_t facPSig = 0.;
970 theta=acos( photon->Pz()/ photon->P());
973 if( fPSigSmearing != 0. || fPSigSmearingCte!=0. ){
974 facPSig = TMath::Sqrt(fPSigSmearingCte*fPSigSmearingCte+fPSigSmearing*fPSigSmearing*P*P)*fRandom.Gaus(0.,1.);
977 if( fPBremSmearing != 1.){
979 facPBrem = fBrem->GetRandom();
983 photon->SetPx(facPBrem* (1+facPSig)* P*sin(theta)*cos(phi)) ;
984 photon->SetPy(facPBrem* (1+facPSig)* P*sin(theta)*sin(phi)) ;
985 photon->SetPz(facPBrem* (1+facPSig)* P*cos(theta)) ;
986 photon->SetE(photon->P());