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] = {
51 "BackgroundScheme", //1
52 "NumberOfBGEvents", //2
53 "DegreesForRotationMethod", //3
54 "RapidityMesonCut", //4
58 "SharedElectronCuts", //8
59 "RejectToCloseV0s", //9
60 "UseMCPSmearing", //10
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 fElectronLabelArraySize(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[fElectronLabelArraySize];
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 fElectronLabelArraySize(ref.fElectronLabelArraySize),
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[fElectronLabelArraySize];
148 if (fBrem == NULL)fBrem = (TF1*)ref.fBrem->Clone("fBrem");
149 // Histograms are not copied, if you need them, call InitCutHistograms
153 //________________________________________________________________________
154 AliConversionMesonCuts::~AliConversionMesonCuts() {
156 //Deleting fHistograms leads to seg fault it it's added to output collection of a task
158 // delete fHistograms;
159 // fHistograms = NULL;
160 if(fCutString != NULL){
164 if(fElectronLabelArray){
165 delete fElectronLabelArray;
166 fElectronLabelArray = NULL;
171 //________________________________________________________________________
172 void AliConversionMesonCuts::InitCutHistograms(TString name){
174 // Initialize Cut Histograms for QA (only initialized and filled if function is called)
175 TH1::AddDirectory(kFALSE);
177 if(fHistograms != NULL){
181 if(fHistograms==NULL){
182 fHistograms=new TList();
183 fHistograms->SetOwner(kTRUE);
184 if(name=="")fHistograms->SetName(Form("ConvMesonCuts_%s",GetCutNumber().Data()));
185 else fHistograms->SetName(Form("%s_%s",name.Data(),GetCutNumber().Data()));
189 hMesonCuts=new TH1F(Form("MesonCuts %s",GetCutNumber().Data()),"MesonCuts",10,-0.5,9.5);
190 hMesonCuts->GetXaxis()->SetBinLabel(1,"in");
191 hMesonCuts->GetXaxis()->SetBinLabel(2,"undef rapidity");
192 hMesonCuts->GetXaxis()->SetBinLabel(3,"rapidity cut");
193 hMesonCuts->GetXaxis()->SetBinLabel(4,"opening angle");
194 hMesonCuts->GetXaxis()->SetBinLabel(5,"alpha max");
195 hMesonCuts->GetXaxis()->SetBinLabel(6,"alpha min");
196 hMesonCuts->GetXaxis()->SetBinLabel(7,"out");
197 fHistograms->Add(hMesonCuts);
199 hMesonBGCuts=new TH1F(Form("MesonBGCuts %s",GetCutNumber().Data()),"MesonBGCuts",10,-0.5,9.5);
200 hMesonBGCuts->GetXaxis()->SetBinLabel(1,"in");
201 hMesonBGCuts->GetXaxis()->SetBinLabel(2,"undef rapidity");
202 hMesonBGCuts->GetXaxis()->SetBinLabel(3,"rapidity cut");
203 hMesonBGCuts->GetXaxis()->SetBinLabel(4,"opening angle");
204 hMesonBGCuts->GetXaxis()->SetBinLabel(5,"alpha max");
205 hMesonBGCuts->GetXaxis()->SetBinLabel(6,"alpha min");
206 hMesonBGCuts->GetXaxis()->SetBinLabel(7,"out");
207 fHistograms->Add(hMesonBGCuts);
209 TH1::AddDirectory(kTRUE);
212 //________________________________________________________________________
213 Bool_t AliConversionMesonCuts::MesonIsSelectedMC(TParticle *fMCMother,AliStack *fMCStack, Double_t fRapidityShift){
214 // Returns true for all pions within acceptance cuts for decay into 2 photons
215 // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
217 if(!fMCStack)return kFALSE;
219 if(fMCMother->GetPdgCode()==111 || fMCMother->GetPdgCode()==221){
220 if(fMCMother->R()>fMaxR) return kFALSE; // cuts on distance from collision point
222 Double_t rapidity = 10.;
223 if(fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0){
224 rapidity=8.-fRapidityShift;
226 rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
230 if(abs(rapidity)>fRapidityCutMeson)return kFALSE;
232 // Select only -> 2y decay channel
233 if(fMCMother->GetNDaughters()!=2)return kFALSE;
235 for(Int_t i=0;i<2;i++){
236 TParticle *MDaughter=fMCStack->Particle(fMCMother->GetDaughter(i));
237 // Is Daughter a Photon?
238 if(MDaughter->GetPdgCode()!=22)return kFALSE;
239 // Is Photon in Acceptance?
240 // if(bMCDaughtersInAcceptance){
241 // if(!PhotonIsSelectedMC(MDaughter,fMCStack)){return kFALSE;}
249 //________________________________________________________________________
250 Bool_t AliConversionMesonCuts::MesonIsSelectedMCDalitz(TParticle *fMCMother,AliStack *fMCStack, Double_t fRapidityShift){
251 // Returns true for all pions within acceptance cuts for decay into 2 photons
252 // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
254 if(!fMCStack)return kFALSE;
256 if(fMCMother->GetPdgCode()==111 || fMCMother->GetPdgCode()==221){
258 if(fMCMother->R()>fMaxR) return kFALSE; // cuts on distance from collision point
260 Double_t rapidity = 10.;
261 if(fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0){
262 rapidity=8.-fRapidityShift;
265 rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
269 if(abs(rapidity)>fRapidityCutMeson)return kFALSE;
271 // Select only -> Dalitz decay channel
272 if(fMCMother->GetNDaughters()!=3)return kFALSE;
274 Int_t daughterPDGs[3] = {0,0,0};
277 // iParticle->GetFirstDaughter(); idxPi0 <= iParticle->GetLastDaughter()
279 for(Int_t i=fMCMother->GetFirstDaughter(); i<= fMCMother->GetLastDaughter();i++){
280 TParticle *MDaughter=fMCStack->Particle(i);
281 // Is Daughter a Photon or an electron?
282 daughterPDGs[index]=MDaughter->GetPdgCode();
285 for (Int_t j=0;j<2;j++){
287 for (Int_t i=0;i<2;i++){
288 if (daughterPDGs[i] > daughterPDGs[i+1]){
289 Int_t interMed = daughterPDGs[i] ;
290 daughterPDGs[i] = daughterPDGs[i+1];
291 daughterPDGs[i+1] = interMed;
295 if (daughterPDGs[0] == -11 && daughterPDGs[1] == 11 && daughterPDGs[2] == 22) return kTRUE;
301 ///________________________________________________________________________
302 Bool_t AliConversionMesonCuts::MesonIsSelected(AliAODConversionMother *pi0,Bool_t IsSignal, Double_t fRapidityShift)
304 // Selection of reconstructed Meson candidates
305 // Use flag IsSignal in order to fill Fill different
306 // histograms for Signal and Background
309 if(IsSignal){hist=hMesonCuts;}
310 else{hist=hMesonBGCuts;}
314 if(hist)hist->Fill(cutIndex);
317 // Undefined Rapidity -> Floating Point exception
318 if((pi0->E()+pi0->Pz())/(pi0->E()-pi0->Pz())<=0){
319 if(hist)hist->Fill(cutIndex);
324 // PseudoRapidity Cut --> But we cut on Rapidity !!!
326 if(abs(pi0->Rapidity()-fRapidityShift)>fRapidityCutMeson){
327 if(hist)hist->Fill(cutIndex);
334 //fOpeningAngle=2*TMath::ATan(0.134/pi0->P());// physical minimum opening angle
335 if( pi0->GetOpeningAngle() < fOpeningAngle){
336 if(hist)hist->Fill(cutIndex);
342 if(pi0->GetAlpha()>fAlphaCutMeson){
343 if(hist)hist->Fill(cutIndex);
349 if(pi0->GetAlpha()<fAlphaMinCutMeson){
350 if(hist)hist->Fill(cutIndex);
355 if(hist)hist->Fill(cutIndex);
361 ///________________________________________________________________________
362 ///________________________________________________________________________
363 Bool_t AliConversionMesonCuts::UpdateCutString() {
364 ///Update the cut string (if it has been created yet)
366 if(fCutString && fCutString->GetString().Length() == kNCuts) {
367 fCutString->SetString(GetCutNumber());
374 ///________________________________________________________________________
375 Bool_t AliConversionMesonCuts::InitializeCutsFromCutString(const TString analysisCutSelection ) {
376 // Initialize Cuts from a given Cut string
377 AliInfo(Form("Set Meson Cutnumber: %s",analysisCutSelection.Data()));
378 if(analysisCutSelection.Length()!=kNCuts) {
379 AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
382 if(!analysisCutSelection.IsDigit()){
383 AliError("Cut selection contains characters");
387 const char *cutSelection = analysisCutSelection.Data();
388 #define ASSIGNARRAY(i) fCuts[i] = cutSelection[i] - '0'
389 for(Int_t ii=0;ii<kNCuts;ii++){
393 // Set Individual Cuts
394 for(Int_t ii=0;ii<kNCuts;ii++){
395 if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
401 ///________________________________________________________________________
402 Bool_t AliConversionMesonCuts::SetCut(cutIds cutID, const Int_t value) {
403 ///Set individual cut ID
405 //cout << "Updating cut " << fgkCutNames[cutID] << " (" << cutID << ") to " << value << endl;
408 if( SetMesonKind(value)) {
409 fCuts[kMesonKind] = value;
412 } else return kFALSE;
414 if( SetChi2MesonCut(value)) {
415 fCuts[kchi2MesonCut] = value;
418 } else return kFALSE;
420 if( SetAlphaMesonCut(value)) {
421 fCuts[kalphaMesonCut] = value;
424 } else return kFALSE;
426 if( SetRCut(value)) {
427 fCuts[kRCut] = value;
430 } else return kFALSE;
432 case kRapidityMesonCut:
433 if( SetRapidityMesonCut(value)) {
434 fCuts[kRapidityMesonCut] = value;
437 } else return kFALSE;
439 case kBackgroundScheme:
440 if( SetBackgroundScheme(value)) {
441 fCuts[kBackgroundScheme] = value;
444 } else return kFALSE;
446 case kDegreesForRotationMethod:
447 if( SetNDegreesForRotationMethod(value)) {
448 fCuts[kDegreesForRotationMethod] = value;
451 } else return kFALSE;
453 case kNumberOfBGEvents:
454 if( SetNumberOfBGEvents(value)) {
455 fCuts[kNumberOfBGEvents] = value;
458 } else return kFALSE;
460 case kuseMCPSmearing:
461 if( SetMCPSmearing(value)) {
462 fCuts[kuseMCPSmearing] = value;
465 } else return kFALSE;
467 if( SetSharedElectronCut(value)) {
468 fCuts[kElecShare] = value;
471 } else return kFALSE;
473 if( SetToCloseV0sCut(value)) {
474 fCuts[kToCloseV0s] = value;
477 } else return kFALSE;
480 cout << "Error:: Cut id out of range"<< endl;
484 cout << "Error:: Cut id " << cutID << " not recognized "<< endl;
490 ///________________________________________________________________________
491 void AliConversionMesonCuts::PrintCuts() {
492 // Print out current Cut Selection
493 for(Int_t ic = 0; ic < kNCuts; ic++) {
494 printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
498 ///________________________________________________________________________
499 Bool_t AliConversionMesonCuts::SetMesonKind(Int_t mesonKind){
509 cout<<"Warning: Meson kind not defined"<<mesonKind<<endl;
515 ///________________________________________________________________________
516 Bool_t AliConversionMesonCuts::SetRCut(Int_t rCut){
537 // High purity cuts for PbPb
542 cout<<"Warning: rCut not defined"<<rCut<<endl;
548 ///________________________________________________________________________
549 Bool_t AliConversionMesonCuts::SetChi2MesonCut(Int_t chi2MesonCut){
551 switch(chi2MesonCut){
553 fChi2CutMeson = 100.;
562 fChi2CutMeson = 200.;
565 fChi2CutMeson = 500.;
568 fChi2CutMeson = 1000.;
571 cout<<"Warning: Chi2MesonCut not defined "<<chi2MesonCut<<endl;
578 ///________________________________________________________________________
579 Bool_t AliConversionMesonCuts::SetAlphaMesonCut(Int_t alphaMesonCut)
581 switch(alphaMesonCut){
583 fAlphaMinCutMeson = 0.0;
584 fAlphaCutMeson = 0.7;
587 fAlphaMinCutMeson = 0.0;
588 fAlphaCutMeson = 0.5;
591 fAlphaMinCutMeson = 0.5;
595 fAlphaMinCutMeson = 0.0;
599 fAlphaMinCutMeson = 0.0;
600 fAlphaCutMeson = 0.65;
603 fAlphaMinCutMeson = 0.0;
604 fAlphaCutMeson = 0.75;
607 fAlphaMinCutMeson = 0.0;
608 fAlphaCutMeson = 0.8;
611 fAlphaMinCutMeson = 0.0;
612 fAlphaCutMeson = 0.85;
615 fAlphaMinCutMeson = 0.0;
616 fAlphaCutMeson = 0.6;
619 fAlphaMinCutMeson = 0.0;
620 fAlphaCutMeson = 0.3;
623 cout<<"Warning: AlphaMesonCut not defined "<<alphaMesonCut<<endl;
629 ///________________________________________________________________________
630 Bool_t AliConversionMesonCuts::SetRapidityMesonCut(Int_t RapidityMesonCut){
632 switch(RapidityMesonCut){
634 fRapidityCutMeson = 0.9;
637 fRapidityCutMeson = 0.8;
640 fRapidityCutMeson = 0.7;
643 fRapidityCutMeson = 0.6;
646 fRapidityCutMeson = 0.5;
649 fRapidityCutMeson = 0.85;
652 fRapidityCutMeson = 0.75;
655 fRapidityCutMeson = 0.3;
658 fRapidityCutMeson = 0.35;
661 fRapidityCutMeson = 0.4;
664 cout<<"Warning: RapidityMesonCut not defined "<<RapidityMesonCut<<endl;
671 ///________________________________________________________________________
672 Bool_t AliConversionMesonCuts::SetBackgroundScheme(Int_t BackgroundScheme){
674 switch(BackgroundScheme){
676 fUseRotationMethodInBG=kTRUE;
677 fdoBGProbability=kFALSE;
679 case 1: // mixed event with V0 multiplicity
680 fUseRotationMethodInBG=kFALSE;
681 fUseTrackMultiplicityForBG=kFALSE;
682 fdoBGProbability=kFALSE;
684 case 2: // mixed event with track multiplicity
685 fUseRotationMethodInBG=kFALSE;
686 fUseTrackMultiplicityForBG=kTRUE;
687 fdoBGProbability=kFALSE;
690 fUseRotationMethodInBG=kTRUE;
691 fdoBGProbability=kTRUE;
693 case 4: //No BG calculation
694 cout << "no BG calculation should be done" << endl;
695 fUseRotationMethodInBG=kFALSE;
696 fdoBGProbability=kFALSE;
700 fUseRotationMethodInBG=kTRUE;
701 fdoBGProbability=kFALSE;
702 fBackgroundHandler = 1;
704 case 6: // mixed event with V0 multiplicity
705 fUseRotationMethodInBG=kFALSE;
706 fUseTrackMultiplicityForBG=kFALSE;
707 fdoBGProbability=kFALSE;
708 fBackgroundHandler = 1;
710 case 7: // mixed event with track multiplicity
711 fUseRotationMethodInBG=kFALSE;
712 fUseTrackMultiplicityForBG=kTRUE;
713 fdoBGProbability=kFALSE;
714 fBackgroundHandler = 1;
717 fUseRotationMethodInBG=kTRUE;
718 fdoBGProbability=kTRUE;
719 fBackgroundHandler = 1;
722 cout<<"Warning: BackgroundScheme not defined "<<BackgroundScheme<<endl;
729 ///________________________________________________________________________
730 Bool_t AliConversionMesonCuts::SetNDegreesForRotationMethod(Int_t DegreesForRotationMethod){
732 switch(DegreesForRotationMethod){
734 fnDegreeRotationPMForBG = 5;
737 fnDegreeRotationPMForBG = 10;
740 fnDegreeRotationPMForBG = 15;
743 fnDegreeRotationPMForBG = 20;
746 cout<<"Warning: DegreesForRotationMethod not defined "<<DegreesForRotationMethod<<endl;
749 fCuts[kDegreesForRotationMethod]=DegreesForRotationMethod;
753 ///________________________________________________________________________
754 Bool_t AliConversionMesonCuts::SetNumberOfBGEvents(Int_t NumberOfBGEvents){
756 switch(NumberOfBGEvents){
758 fNumberOfBGEvents = 5;
761 fNumberOfBGEvents = 10;
764 fNumberOfBGEvents = 15;
767 fNumberOfBGEvents = 20;
770 fNumberOfBGEvents = 2;
773 fNumberOfBGEvents = 50;
776 fNumberOfBGEvents = 80;
779 fNumberOfBGEvents = 100;
782 cout<<"Warning: NumberOfBGEvents not defined "<<NumberOfBGEvents<<endl;
787 ///________________________________________________________________________
788 Bool_t AliConversionMesonCuts::SetSharedElectronCut(Int_t sharedElec) {
792 fDoSharedElecCut = kFALSE;
795 fDoSharedElecCut = kTRUE;
798 cout<<"Warning: Shared Electron Cut not defined "<<sharedElec<<endl;
805 ///________________________________________________________________________
806 Bool_t AliConversionMesonCuts::SetToCloseV0sCut(Int_t toClose) {
810 fDoToCloseV0sCut = kFALSE;
814 fDoToCloseV0sCut = kTRUE;
818 fDoToCloseV0sCut = kTRUE;
822 fDoToCloseV0sCut = kTRUE;
826 cout<<"Warning: Shared Electron Cut not defined "<<toClose<<endl;
832 ///________________________________________________________________________
833 Bool_t AliConversionMesonCuts::SetMCPSmearing(Int_t useMCPSmearing)
835 switch(useMCPSmearing){
844 fPBremSmearing=1.0e-14;
850 fPBremSmearing=1.0e-15;
858 fPSigSmearingCte=0.002;
864 fPSigSmearingCte=0.007;
870 fPSigSmearingCte=0.016;
876 fPSigSmearingCte=0.016;
880 fPBremSmearing=1.0e-16;
888 fPSigSmearingCte=0.014;
894 fPSigSmearingCte=0.011;
898 AliError("Warning: UseMCPSmearing not defined");
903 ///________________________________________________________________________
904 TString AliConversionMesonCuts::GetCutNumber(){
905 // returns TString with current cut number
907 for(Int_t ii=0;ii<kNCuts;ii++){
908 a.Append(Form("%d",fCuts[ii]));
913 ///________________________________________________________________________
914 void AliConversionMesonCuts::FillElectonLabelArray(AliAODConversionPhoton* photon, Int_t nV0){
916 Int_t posLabel = photon->GetTrackLabelPositive();
917 Int_t negLabel = photon->GetTrackLabelNegative();
919 fElectronLabelArray[nV0*2] = posLabel;
920 fElectronLabelArray[(nV0*2)+1] = negLabel;
923 ///________________________________________________________________________
924 Bool_t AliConversionMesonCuts::RejectSharedElectronV0s(AliAODConversionPhoton* photon, Int_t nV0, Int_t nV0s){
926 Int_t posLabel = photon->GetTrackLabelPositive();
927 Int_t negLabel = photon->GetTrackLabelNegative();
929 for(Int_t i = 0; i<nV0s*2;i++){
930 if(i==nV0*2) continue;
931 if(i==(nV0*2)+1) continue;
932 if(fElectronLabelArray[i] == posLabel){
934 if(fElectronLabelArray[i] == negLabel){
940 ///________________________________________________________________________
941 Bool_t AliConversionMesonCuts::RejectToCloseV0s(AliAODConversionPhoton* photon, TList *photons, Int_t nV0){
942 Double_t posX = photon->GetConversionX();
943 Double_t posY = photon->GetConversionY();
944 Double_t posZ = photon->GetConversionZ();
946 for(Int_t i = 0;i<photons->GetEntries();i++){
947 if(nV0 == i) continue;
948 AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
949 Double_t posCompX = photonComp->GetConversionX();
950 Double_t posCompY = photonComp->GetConversionY();
951 Double_t posCompZ = photonComp->GetConversionZ();
953 Double_t dist = pow((posX - posCompX),2)+pow((posY - posCompY),2)+pow((posZ - posCompZ),2);
955 if(dist < fminV0Dist*fminV0Dist){
956 if(photon->GetChi2perNDF() < photonComp->GetChi2perNDF()) return kTRUE;
965 ///________________________________________________________________________
966 void AliConversionMesonCuts::SmearParticle(AliAODConversionPhoton* photon)
969 if (photon==NULL) return;
970 Double_t facPBrem = 1.;
971 Double_t facPSig = 0.;
981 theta=acos( photon->Pz()/ photon->P());
984 if( fPSigSmearing != 0. || fPSigSmearingCte!=0. ){
985 facPSig = TMath::Sqrt(fPSigSmearingCte*fPSigSmearingCte+fPSigSmearing*fPSigSmearing*P*P)*fRandom.Gaus(0.,1.);
988 if( fPBremSmearing != 1.){
990 facPBrem = fBrem->GetRandom();
994 photon->SetPx(facPBrem* (1+facPSig)* P*sin(theta)*cos(phi)) ;
995 photon->SetPy(facPBrem* (1+facPSig)* P*sin(theta)*sin(phi)) ;
996 photon->SetPz(facPBrem* (1+facPSig)* P*cos(theta)) ;
997 photon->SetE(photon->P());