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"
43 #include "TDatabasePDG.h"
44 #include "AliAODMCParticle.h"
50 ClassImp(AliConversionMesonCuts)
53 const char* AliConversionMesonCuts::fgkCutNames[AliConversionMesonCuts::kNCuts] = {
55 "BackgroundScheme", //1
56 "NumberOfBGEvents", //2
57 "DegreesForRotationMethod", //3
58 "RapidityMesonCut", //4
61 "SelectionWindow", //7
62 "SharedElectronCuts", //8
63 "RejectToCloseV0s", //9
64 "UseMCPSmearing", //10
71 //________________________________________________________________________
72 AliConversionMesonCuts::AliConversionMesonCuts(const char *name,const char *title) :
73 AliAnalysisCuts(name,title),
78 fSelectionHigh(0.145),
82 fUseRotationMethodInBG(kFALSE),
84 fdoBGProbability(kFALSE),
85 fUseTrackMultiplicityForBG(kFALSE),
86 fnDegreeRotationPMForBG(0),
89 fDoToCloseV0sCut(kFALSE),
91 fDoSharedElecCut(kFALSE),
92 fUseMCPSmearing(kFALSE),
99 fAlphaPtDepCut(kFALSE),
100 fElectronLabelArraySize(500),
101 fElectronLabelArray(NULL),
102 fDCAGammaGammaCut(1000),
103 fDCAZMesonPrimVtxCut(1000),
104 fDCARMesonPrimVtxCut(1000),
105 fBackgroundHandler(0),
109 hDCAGammaGammaMesonBefore(NULL),
110 hDCAZMesonPrimVtxBefore(NULL),
111 hDCARMesonPrimVtxBefore(NULL),
112 hDCAGammaGammaMesonAfter(NULL),
113 hDCAZMesonPrimVtxAfter(NULL),
114 hDCARMesonPrimVtxAfter(NULL)
117 for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;}
118 fCutString=new TObjString((GetCutNumber()).Data());
119 fElectronLabelArray = new Int_t[fElectronLabelArraySize];
121 fBrem = new TF1("fBrem","pow(-log(x),[0]/log(2.0)-1.0)/TMath::Gamma([0]/log(2.0))",0.00001,0.999999999);
122 // tests done with 1.0e-14
123 fBrem->SetParameter(0,fPBremSmearing);
124 fBrem->SetNpx(100000);
129 //________________________________________________________________________
130 AliConversionMesonCuts::AliConversionMesonCuts(const AliConversionMesonCuts &ref) :
131 AliAnalysisCuts(ref),
133 fMesonKind(ref.fMesonKind),
135 fSelectionLow(ref.fSelectionLow),
136 fSelectionHigh(ref.fSelectionHigh),
137 fAlphaMinCutMeson(ref.fAlphaMinCutMeson),
138 fAlphaCutMeson(ref.fAlphaCutMeson),
139 fRapidityCutMeson(ref.fRapidityCutMeson),
140 fUseRotationMethodInBG(ref.fUseRotationMethodInBG),
142 fdoBGProbability(ref.fdoBGProbability),
143 fUseTrackMultiplicityForBG(ref.fUseTrackMultiplicityForBG),
144 fnDegreeRotationPMForBG(ref.fnDegreeRotationPMForBG),
145 fNumberOfBGEvents(ref. fNumberOfBGEvents),
146 fOpeningAngle(ref.fOpeningAngle),
147 fDoToCloseV0sCut(ref.fDoToCloseV0sCut),
148 fminV0Dist(ref.fminV0Dist),
149 fDoSharedElecCut(ref.fDoSharedElecCut),
150 fUseMCPSmearing(ref.fUseMCPSmearing),
151 fPBremSmearing(ref.fPBremSmearing),
152 fPSigSmearing(ref.fPSigSmearing),
153 fPSigSmearingCte(ref.fPSigSmearingCte),
155 fRandom(ref.fRandom),
157 fAlphaPtDepCut(ref.fAlphaPtDepCut),
158 fElectronLabelArraySize(ref.fElectronLabelArraySize),
159 fElectronLabelArray(NULL),
160 fDCAGammaGammaCut(ref.fDCAGammaGammaCut),
161 fDCAZMesonPrimVtxCut(ref.fDCAZMesonPrimVtxCut),
162 fDCARMesonPrimVtxCut(ref.fDCARMesonPrimVtxCut),
163 fBackgroundHandler(ref.fBackgroundHandler),
167 hDCAGammaGammaMesonBefore(NULL),
168 hDCAZMesonPrimVtxBefore(NULL),
169 hDCARMesonPrimVtxBefore(NULL),
170 hDCAGammaGammaMesonAfter(NULL),
171 hDCAZMesonPrimVtxAfter(NULL),
172 hDCARMesonPrimVtxAfter(NULL)
175 for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=ref.fCuts[jj];}
176 fCutString=new TObjString((GetCutNumber()).Data());
177 fElectronLabelArray = new Int_t[fElectronLabelArraySize];
178 if (fBrem == NULL)fBrem = (TF1*)ref.fBrem->Clone("fBrem");
179 // Histograms are not copied, if you need them, call InitCutHistograms
183 //________________________________________________________________________
184 AliConversionMesonCuts::~AliConversionMesonCuts() {
186 //Deleting fHistograms leads to seg fault it it's added to output collection of a task
188 // delete fHistograms;
189 // fHistograms = NULL;
190 if(fCutString != NULL){
194 if(fElectronLabelArray){
195 delete fElectronLabelArray;
196 fElectronLabelArray = NULL;
201 //________________________________________________________________________
202 void AliConversionMesonCuts::InitCutHistograms(TString name, Bool_t additionalHists){
204 // Initialize Cut Histograms for QA (only initialized and filled if function is called)
205 TH1::AddDirectory(kFALSE);
207 if(fHistograms != NULL){
211 if(fHistograms==NULL){
212 fHistograms=new TList();
213 fHistograms->SetOwner(kTRUE);
214 if(name=="")fHistograms->SetName(Form("ConvMesonCuts_%s",GetCutNumber().Data()));
215 else fHistograms->SetName(Form("%s_%s",name.Data(),GetCutNumber().Data()));
219 hMesonCuts=new TH1F(Form("MesonCuts %s",GetCutNumber().Data()),"MesonCuts",13,-0.5,12.5);
220 hMesonCuts->GetXaxis()->SetBinLabel(1,"in");
221 hMesonCuts->GetXaxis()->SetBinLabel(2,"undef rapidity");
222 hMesonCuts->GetXaxis()->SetBinLabel(3,"rapidity cut");
223 hMesonCuts->GetXaxis()->SetBinLabel(4,"opening angle");
224 hMesonCuts->GetXaxis()->SetBinLabel(5,"alpha max");
225 hMesonCuts->GetXaxis()->SetBinLabel(6,"alpha min");
226 hMesonCuts->GetXaxis()->SetBinLabel(7,"dca gamma gamma");
227 hMesonCuts->GetXaxis()->SetBinLabel(8,"dca R prim Vtx");
228 hMesonCuts->GetXaxis()->SetBinLabel(9,"dca Z prim Vtx");
229 hMesonCuts->GetXaxis()->SetBinLabel(10,"out");
230 fHistograms->Add(hMesonCuts);
232 hMesonBGCuts=new TH1F(Form("MesonBGCuts %s",GetCutNumber().Data()),"MesonBGCuts",13,-0.5,12.5);
233 hMesonBGCuts->GetXaxis()->SetBinLabel(1,"in");
234 hMesonBGCuts->GetXaxis()->SetBinLabel(2,"undef rapidity");
235 hMesonBGCuts->GetXaxis()->SetBinLabel(3,"rapidity cut");
236 hMesonBGCuts->GetXaxis()->SetBinLabel(4,"opening angle");
237 hMesonBGCuts->GetXaxis()->SetBinLabel(5,"alpha max");
238 hMesonBGCuts->GetXaxis()->SetBinLabel(6,"alpha min");
239 hMesonBGCuts->GetXaxis()->SetBinLabel(7,"dca gamma gamma");
240 hMesonBGCuts->GetXaxis()->SetBinLabel(8,"dca R prim Vtx");
241 hMesonBGCuts->GetXaxis()->SetBinLabel(9,"dca Z prim Vtx");
242 hMesonBGCuts->GetXaxis()->SetBinLabel(10,"out");
244 fHistograms->Add(hMesonBGCuts);
246 if (additionalHists){
247 hDCAGammaGammaMesonBefore=new TH1F(Form("DCAGammaGammaMeson Before %s",GetCutNumber().Data()),"DCAGammaGammaMeson Before",200,0,10);
248 fHistograms->Add(hDCAGammaGammaMesonBefore);
250 hDCARMesonPrimVtxBefore=new TH1F(Form("DCARMesonPrimVtx Before %s",GetCutNumber().Data()),"DCARMesonPrimVtx Before",200,0,10);
251 fHistograms->Add(hDCARMesonPrimVtxBefore);
253 hDCAZMesonPrimVtxBefore=new TH1F(Form("DCAZMesonPrimVtx Before %s",GetCutNumber().Data()),"DCAZMesonPrimVtx Before",401,-10,10);
254 fHistograms->Add(hDCAZMesonPrimVtxBefore);
258 hDCAGammaGammaMesonAfter=new TH1F(Form("DCAGammaGammaMeson After %s",GetCutNumber().Data()),"DCAGammaGammaMeson After",200,0,10);
259 fHistograms->Add(hDCAGammaGammaMesonAfter);
261 hDCAZMesonPrimVtxAfter=new TH2F(Form("InvMassDCAZMesonPrimVtx After %s",GetCutNumber().Data()),"InvMassDCAZMesonPrimVtx After",800,0,0.8,401,-10,10);
262 fHistograms->Add(hDCAZMesonPrimVtxAfter);
264 hDCARMesonPrimVtxAfter=new TH1F(Form("DCARMesonPrimVtx After %s",GetCutNumber().Data()),"DCARMesonPrimVtx After",200,0,10);
265 fHistograms->Add(hDCARMesonPrimVtxAfter);
267 TH1::AddDirectory(kTRUE);
270 //________________________________________________________________________
271 Bool_t AliConversionMesonCuts::MesonIsSelectedMC(TParticle *fMCMother,AliStack *fMCStack, Double_t fRapidityShift){
272 // Returns true for all pions within acceptance cuts for decay into 2 photons
273 // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
275 if(!fMCStack)return kFALSE;
277 if(fMCMother->GetPdgCode()==111 || fMCMother->GetPdgCode()==221){
278 if(fMCMother->R()>fMaxR) return kFALSE; // cuts on distance from collision point
280 Double_t rapidity = 10.;
281 if(fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0){
282 rapidity=8.-fRapidityShift;
284 rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
288 if(abs(rapidity)>fRapidityCutMeson)return kFALSE;
290 // Select only -> 2y decay channel
291 if(fMCMother->GetNDaughters()!=2)return kFALSE;
293 for(Int_t i=0;i<2;i++){
294 TParticle *MDaughter=fMCStack->Particle(fMCMother->GetDaughter(i));
295 // Is Daughter a Photon?
296 if(MDaughter->GetPdgCode()!=22)return kFALSE;
297 // Is Photon in Acceptance?
298 // if(bMCDaughtersInAcceptance){
299 // if(!PhotonIsSelectedMC(MDaughter,fMCStack)){return kFALSE;}
306 //________________________________________________________________________
307 Bool_t AliConversionMesonCuts::MesonIsSelectedAODMC(AliAODMCParticle *MCMother,TClonesArray *AODMCArray, Double_t fRapidityShift){
308 // Returns true for all pions within acceptance cuts for decay into 2 photons
309 // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
311 if(!AODMCArray)return kFALSE;
313 if(MCMother->GetPdgCode()==111 || MCMother->GetPdgCode()==221){
314 Double_t rMeson = sqrt( (MCMother->Xv()*MCMother->Xv()) + (MCMother->Yv()*MCMother->Yv()) ) ;
315 if(rMeson>fMaxR) return kFALSE; // cuts on distance from collision point
317 Double_t rapidity = 10.;
318 if(MCMother->E() - MCMother->Pz() == 0 || MCMother->E() + MCMother->Pz() == 0){
319 rapidity=8.-fRapidityShift;
321 rapidity = 0.5*(TMath::Log((MCMother->E()+MCMother->Pz()) / (MCMother->E()-MCMother->Pz())))-fRapidityShift;
325 if(abs(rapidity)>fRapidityCutMeson)return kFALSE;
327 // Select only -> 2y decay channel
328 if(MCMother->GetNDaughters()!=2)return kFALSE;
330 for(Int_t i=0;i<2;i++){
331 AliAODMCParticle *MDaughter=static_cast<AliAODMCParticle*>(AODMCArray->At(MCMother->GetDaughter(i)));
332 // Is Daughter a Photon?
333 if(MDaughter->GetPdgCode()!=22)return kFALSE;
334 // Is Photon in Acceptance?
335 // if(bMCDaughtersInAcceptance){
336 // if(!PhotonIsSelectedMC(MDaughter,fMCStack)){return kFALSE;}
344 //________________________________________________________________________
345 Bool_t AliConversionMesonCuts::MesonIsSelectedMCDalitz(TParticle *fMCMother,AliStack *fMCStack, Int_t &labelelectron, Int_t &labelpositron, Int_t &labelgamma, Double_t fRapidityShift){
347 // Returns true for all pions within acceptance cuts for decay into 2 photons
348 // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
350 if( !fMCStack )return kFALSE;
352 if( fMCMother->GetPdgCode() != 111 && fMCMother->GetPdgCode() != 221 ) return kFALSE;
354 if( fMCMother->R()>fMaxR ) return kFALSE; // cuts on distance from collision point
356 Double_t rapidity = 10.;
358 if( fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0 ){
359 rapidity=8.-fRapidityShift;
362 rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
366 if( abs(rapidity) > fRapidityCutMeson )return kFALSE;
368 // Select only -> Dalitz decay channel
369 if( fMCMother->GetNDaughters() != 3 )return kFALSE;
371 TParticle *positron = 0x0;
372 TParticle *electron = 0x0;
373 TParticle *gamma = 0x0;
375 for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
377 TParticle* temp = (TParticle*)fMCStack->Particle( index );
379 switch( temp->GetPdgCode() ) {
382 labelpositron = index;
386 labelelectron = index;
395 if( positron && electron && gamma) return kTRUE;
399 //________________________________________________________________________
400 Bool_t AliConversionMesonCuts::MesonIsSelectedMCEtaPiPlPiMiGamma(TParticle *fMCMother,AliStack *fMCStack, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelGamma, Double_t fRapidityShift){
402 // Returns true for all pions within acceptance cuts for decay into 2 photons
403 // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
405 if( !fMCStack )return kFALSE;
407 if( fMCMother->GetPdgCode() != 221 ) return kFALSE;
409 if( fMCMother->R()>fMaxR ) return kFALSE; // cuts on distance from collision point
411 Double_t rapidity = 10.;
413 if( fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0 ){
414 rapidity=8.-fRapidityShift;
417 rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
421 if( abs(rapidity) > fRapidityCutMeson )return kFALSE;
423 // Select only -> Dalitz decay channel
424 if( fMCMother->GetNDaughters() != 3 )return kFALSE;
426 TParticle *posPion = 0x0;
427 TParticle *negPion = 0x0;
428 TParticle *gamma = 0x0;
430 for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
432 TParticle* temp = (TParticle*)fMCStack->Particle( index );
434 switch( temp->GetPdgCode() ) {
437 labelPosPion = index;
441 labelNegPion = index;
450 if( posPion && negPion && gamma) return kTRUE;
454 //________________________________________________________________________
455 Bool_t AliConversionMesonCuts::MesonIsSelectedMCPiPlPiMiPiZero(TParticle *fMCMother,AliStack *fMCStack, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelNeutPion, Double_t fRapidityShift){
457 // Returns true for all pions within acceptance cuts for decay into 2 photons
458 // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
460 if( !fMCStack )return kFALSE;
462 if( !(fMCMother->GetPdgCode() == 221 || fMCMother->GetPdgCode() == 223) ) return kFALSE;
464 if( fMCMother->R()>fMaxR ) return kFALSE; // cuts on distance from collision point
466 Double_t rapidity = 10.;
468 if( fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0 ){
469 rapidity=8.-fRapidityShift;
472 rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
476 if( abs(rapidity) > fRapidityCutMeson )return kFALSE;
478 // Select only -> pi+ pi- pi0
479 if( fMCMother->GetNDaughters() != 3 )return kFALSE;
481 TParticle *posPion = 0x0;
482 TParticle *negPion = 0x0;
483 TParticle *neutPion = 0x0;
485 // cout << "\n"<< fMCMother->GetPdgCode() << "\n" << endl;
486 for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
488 TParticle* temp = (TParticle*)fMCStack->Particle( index );
489 // cout << temp->GetPdgCode() << endl;
490 switch( temp->GetPdgCode() ) {
493 labelPosPion = index;
497 labelNegPion = index;
501 labelNeutPion = index;
506 if( posPion && negPion && neutPion ) return kTRUE;
511 //________________________________________________________________________
512 Bool_t AliConversionMesonCuts::MesonIsSelectedMCChiC(TParticle *fMCMother,AliStack *fMCStack,Int_t & labelelectronChiC, Int_t & labelpositronChiC, Int_t & labelgammaChiC, Double_t fRapidityShift){
513 // Returns true for all ChiC within acceptance cuts for decay into JPsi + gamma -> e+ + e- + gamma
514 // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
516 if(!fMCStack)return kFALSE;
517 // if(fMCMother->GetPdgCode()==20443 ){
520 if(fMCMother->GetPdgCode()==10441 || fMCMother->GetPdgCode()==10443 || fMCMother->GetPdgCode()==445 ){
521 if(fMCMother->R()>fMaxR) return kFALSE; // cuts on distance from collision point
523 Double_t rapidity = 10.;
524 if(fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0){
525 rapidity=8.-fRapidityShift;
528 rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
532 if(abs(rapidity)>fRapidityCutMeson)return kFALSE;
534 // Select only -> ChiC radiative (JPsi+gamma) decay channel
535 if(fMCMother->GetNDaughters()!=2)return kFALSE;
537 TParticle *jpsi = 0x0;
538 TParticle *gamma = 0x0;
539 TParticle *positron = 0x0;
540 TParticle *electron = 0x0;
542 Int_t labeljpsiChiC = -1;
544 for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
546 TParticle* temp = (TParticle*)fMCStack->Particle( index );
548 switch( temp->GetPdgCode() ) {
551 labeljpsiChiC = index;
555 labelgammaChiC = index;
560 if ( !jpsi || ! gamma) return kFALSE;
561 if(jpsi->GetNDaughters()!=2)return kFALSE;
564 for(Int_t index= jpsi->GetFirstDaughter();index<= jpsi->GetLastDaughter();index++){
565 TParticle* temp = (TParticle*)fMCStack->Particle( index );
566 switch( temp->GetPdgCode() ) {
569 labelelectronChiC = index;
573 labelpositronChiC = index;
577 if( !electron || !positron) return kFALSE;
578 if( positron && electron && gamma) return kTRUE;
583 ///________________________________________________________________________
584 Bool_t AliConversionMesonCuts::MesonIsSelected(AliAODConversionMother *pi0,Bool_t IsSignal, Double_t fRapidityShift)
587 // Selection of reconstructed Meson candidates
588 // Use flag IsSignal in order to fill Fill different
589 // histograms for Signal and Background
592 if(IsSignal){hist=hMesonCuts;}
593 else{hist=hMesonBGCuts;}
597 if(hist)hist->Fill(cutIndex);
600 // Undefined Rapidity -> Floating Point exception
601 if((pi0->E()+pi0->Pz())/(pi0->E()-pi0->Pz())<=0){
602 if(hist)hist->Fill(cutIndex);
604 // cout << "undefined rapidity" << endl;
608 // PseudoRapidity Cut --> But we cut on Rapidity !!!
610 if(abs(pi0->Rapidity()-fRapidityShift)>fRapidityCutMeson){
611 if(hist)hist->Fill(cutIndex);
612 // cout << abs(pi0->Rapidity()-fRapidityShift) << ">" << fRapidityCutMeson << endl;
619 //fOpeningAngle=2*TMath::ATan(0.134/pi0->P());// physical minimum opening angle
620 if( pi0->GetOpeningAngle() < fOpeningAngle){
621 // cout << pi0->GetOpeningAngle() << "<" << fOpeningAngle << endl;
622 if(hist)hist->Fill(cutIndex);
627 if ( fAlphaPtDepCut == kTRUE ) {
629 fAlphaCutMeson = fFAlphaCut->Eval( pi0->Pt() );
634 if(pi0->GetAlpha()>fAlphaCutMeson){
635 // cout << pi0->GetAlpha() << ">" << fAlphaCutMeson << endl;
636 if(hist)hist->Fill(cutIndex);
642 if(pi0->GetAlpha()<fAlphaMinCutMeson){
643 // cout << pi0->GetAlpha() << "<" << fAlphaMinCutMeson << endl;
644 if(hist)hist->Fill(cutIndex);
649 if (hDCAGammaGammaMesonBefore)hDCAGammaGammaMesonBefore->Fill(pi0->GetDCABetweenPhotons());
650 if (hDCARMesonPrimVtxBefore)hDCARMesonPrimVtxBefore->Fill(pi0->GetDCARMotherPrimVtx());
652 if (pi0->GetDCABetweenPhotons() > fDCAGammaGammaCut){
653 // cout << pi0->GetDCABetweenPhotons() << ">" << fDCAGammaGammaCut << endl;
654 if(hist)hist->Fill(cutIndex);
659 if (pi0->GetDCARMotherPrimVtx() > fDCARMesonPrimVtxCut){
660 // cout << pi0->GetDCARMotherPrimVtx() << ">" << fDCARMesonPrimVtxCut << endl;
661 if(hist)hist->Fill(cutIndex);
667 if (hDCAZMesonPrimVtxBefore)hDCAZMesonPrimVtxBefore->Fill(pi0->GetDCAZMotherPrimVtx());
669 if (abs(pi0->GetDCAZMotherPrimVtx()) > fDCAZMesonPrimVtxCut){
670 // cout << pi0->GetDCAZMotherPrimVtx() << ">" << fDCAZMesonPrimVtxCut << endl;
671 if(hist)hist->Fill(cutIndex);
677 if (hDCAGammaGammaMesonAfter)hDCAGammaGammaMesonAfter->Fill(pi0->GetDCABetweenPhotons());
678 if (hDCARMesonPrimVtxAfter)hDCARMesonPrimVtxAfter->Fill(pi0->GetDCARMotherPrimVtx());
679 if (hDCAZMesonPrimVtxAfter)hDCAZMesonPrimVtxAfter->Fill(pi0->M(),pi0->GetDCAZMotherPrimVtx());
681 if(hist)hist->Fill(cutIndex);
687 ///________________________________________________________________________
688 ///________________________________________________________________________
689 Bool_t AliConversionMesonCuts::UpdateCutString() {
690 ///Update the cut string (if it has been created yet)
692 if(fCutString && fCutString->GetString().Length() == kNCuts) {
693 fCutString->SetString(GetCutNumber());
700 ///________________________________________________________________________
701 Bool_t AliConversionMesonCuts::InitializeCutsFromCutString(const TString analysisCutSelection ) {
702 // Initialize Cuts from a given Cut string
703 AliInfo(Form("Set Meson Cutnumber: %s",analysisCutSelection.Data()));
704 if(analysisCutSelection.Length()!=kNCuts) {
705 AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
708 if(!analysisCutSelection.IsDigit()){
709 AliError("Cut selection contains characters");
713 const char *cutSelection = analysisCutSelection.Data();
714 #define ASSIGNARRAY(i) fCuts[i] = cutSelection[i] - '0'
715 for(Int_t ii=0;ii<kNCuts;ii++){
719 // Set Individual Cuts
720 for(Int_t ii=0;ii<kNCuts;ii++){
721 if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
724 PrintCutsWithValues();
727 ///________________________________________________________________________
728 Bool_t AliConversionMesonCuts::SetCut(cutIds cutID, const Int_t value) {
729 ///Set individual cut ID
731 //cout << "Updating cut " << fgkCutNames[cutID] << " (" << cutID << ") to " << value << endl;
734 if( SetMesonKind(value)) {
735 fCuts[kMesonKind] = value;
738 } else return kFALSE;
740 if( SetSelectionWindowCut(value)) {
741 fCuts[kSelectionCut] = value;
744 } else return kFALSE;
746 if( SetAlphaMesonCut(value)) {
747 fCuts[kalphaMesonCut] = value;
750 } else return kFALSE;
752 if( SetRCut(value)) {
753 fCuts[kRCut] = value;
756 } else return kFALSE;
758 case kRapidityMesonCut:
759 if( SetRapidityMesonCut(value)) {
760 fCuts[kRapidityMesonCut] = value;
763 } else return kFALSE;
765 case kBackgroundScheme:
766 if( SetBackgroundScheme(value)) {
767 fCuts[kBackgroundScheme] = value;
770 } else return kFALSE;
772 case kDegreesForRotationMethod:
773 if( SetNDegreesForRotationMethod(value)) {
774 fCuts[kDegreesForRotationMethod] = value;
777 } else return kFALSE;
779 case kNumberOfBGEvents:
780 if( SetNumberOfBGEvents(value)) {
781 fCuts[kNumberOfBGEvents] = value;
784 } else return kFALSE;
786 case kuseMCPSmearing:
787 if( SetMCPSmearing(value)) {
788 fCuts[kuseMCPSmearing] = value;
791 } else return kFALSE;
793 if( SetSharedElectronCut(value)) {
794 fCuts[kElecShare] = value;
797 } else return kFALSE;
799 if( SetToCloseV0sCut(value)) {
800 fCuts[kToCloseV0s] = value;
803 } else return kFALSE;
805 if( SetDCAGammaGammaCut(value)) {
806 fCuts[kDcaGammaGamma] = value;
809 } else return kFALSE;
811 if( SetDCAZMesonPrimVtxCut(value)) {
812 fCuts[kDcaZPrimVtx] = value;
815 } else return kFALSE;
817 if( SetDCARMesonPrimVtxCut(value)) {
818 fCuts[kDcaRPrimVtx] = value;
821 } else return kFALSE;
824 cout << "Error:: Cut id out of range"<< endl;
828 cout << "Error:: Cut id " << cutID << " not recognized "<< endl;
834 ///________________________________________________________________________
835 void AliConversionMesonCuts::PrintCuts() {
836 // Print out current Cut Selection
837 for(Int_t ic = 0; ic < kNCuts; ic++) {
838 printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
842 ///________________________________________________________________________
843 void AliConversionMesonCuts::PrintCutsWithValues() {
844 // Print out current Cut Selection with values
845 printf("\nMeson cutnumber \n");
846 for(Int_t ic = 0; ic < kNCuts; ic++) {
847 printf("%d",fCuts[ic]);
851 printf("Meson cuts \n");
852 printf("\t |y| < %3.2f \n", fRapidityCutMeson);
853 printf("\t theta_{open} < %3.2f\n", fOpeningAngle);
854 if (!fAlphaPtDepCut) printf("\t %3.2f < alpha < %3.2f\n", fAlphaMinCutMeson, fAlphaCutMeson);
855 printf("\t dca_{gamma,gamma} > %3.2f\n", fDCAGammaGammaCut);
856 printf("\t dca_{R, prim Vtx} > %3.2f\n", fDCARMesonPrimVtxCut);
857 printf("\t dca_{Z, prim Vtx} > %3.2f\n\n", fDCAZMesonPrimVtxCut);
858 printf("\t Meson selection window for further analysis %3.3f > M_{gamma,gamma} > %3.3f\n\n", fSelectionLow, fSelectionHigh);
860 printf("Meson BG settings \n");
862 if (!fUseRotationMethodInBG & !fUseTrackMultiplicityForBG) printf("\t BG scheme: mixing V0 mult \n");
863 if (!fUseRotationMethodInBG & fUseTrackMultiplicityForBG) printf("\t BG scheme: mixing track mult \n");
864 if (fUseRotationMethodInBG )printf("\t BG scheme: rotation \n");
865 if (fdoBGProbability) printf("\t -> use BG probability \n");
866 if (fBackgroundHandler) printf("\t -> use new BG handler \n");
867 printf("\t depth of pool: %d\n", fNumberOfBGEvents);
868 if (fUseRotationMethodInBG )printf("\t degree's for BG rotation: %d\n", fnDegreeRotationPMForBG);
874 ///________________________________________________________________________
875 Bool_t AliConversionMesonCuts::SetMesonKind(Int_t mesonKind){
885 cout<<"Warning: Meson kind not defined"<<mesonKind<<endl;
891 ///________________________________________________________________________
892 Bool_t AliConversionMesonCuts::SetRCut(Int_t rCut){
913 // High purity cuts for PbPb
918 cout<<"Warning: rCut not defined"<<rCut<<endl;
924 ///________________________________________________________________________
925 Bool_t AliConversionMesonCuts::SetSelectionWindowCut(Int_t selectionCut){
927 switch(selectionCut){
929 fSelectionLow = 0.08;
930 fSelectionHigh = 0.145;
934 fSelectionHigh = 0.145;
937 fSelectionLow = 0.11;
938 fSelectionHigh = 0.145;
941 fSelectionLow = 0.12;
942 fSelectionHigh = 0.145;
946 fSelectionHigh = 0.15;
949 fSelectionLow = 0.11;
950 fSelectionHigh = 0.15;
953 fSelectionLow = 0.12;
954 fSelectionHigh = 0.15;
958 cout<<"Warning: SelectionCut not defined "<<selectionCut<<endl;
965 ///________________________________________________________________________
966 Bool_t AliConversionMesonCuts::SetAlphaMesonCut(Int_t alphaMesonCut)
968 switch(alphaMesonCut){
970 fAlphaMinCutMeson = 0.0;
971 fAlphaCutMeson = 0.7;
972 fAlphaPtDepCut = kFALSE;
974 case 1: // Updated 31 October 2013 before 0.0 - 0.5
975 if( fFAlphaCut ) delete fFAlphaCut;
976 fFAlphaCut= new TF1("fFAlphaCut","[0]*tanh([1]*x)",0.,100.);
977 fFAlphaCut->SetParameter(0,0.7);
978 fFAlphaCut->SetParameter(1,1.2);
979 fAlphaMinCutMeson = 0.0;
980 fAlphaCutMeson = -1.0;
981 fAlphaPtDepCut = kTRUE;
983 case 2: // Updated 31 October 2013 before 0.5-1
984 if( fFAlphaCut ) delete fFAlphaCut;
985 fFAlphaCut= new TF1("fFAlphaCut","[0]*tanh([1]*x)",0.,100.);
986 fFAlphaCut->SetParameter(0,0.8);
987 fFAlphaCut->SetParameter(1,1.2);
988 fAlphaMinCutMeson = 0.0;
989 fAlphaCutMeson = -1.0;
990 fAlphaPtDepCut = kTRUE;
993 fAlphaMinCutMeson = 0.0;
995 fAlphaPtDepCut = kFALSE;
998 fAlphaMinCutMeson = 0.0;
999 fAlphaCutMeson = 0.65;
1000 fAlphaPtDepCut = kFALSE;
1003 fAlphaMinCutMeson = 0.0;
1004 fAlphaCutMeson = 0.75;
1005 fAlphaPtDepCut = kFALSE;
1008 fAlphaMinCutMeson = 0.0;
1009 fAlphaCutMeson = 0.8;
1010 fAlphaPtDepCut = kFALSE;
1013 fAlphaMinCutMeson = 0.0;
1014 fAlphaCutMeson = 0.85;
1015 fAlphaPtDepCut = kFALSE;
1018 fAlphaMinCutMeson = 0.0;
1019 fAlphaCutMeson = 0.6;
1020 fAlphaPtDepCut = kFALSE;
1022 case 9: // Updated 11 November 2013 before 0.0 - 0.3
1023 if( fFAlphaCut ) delete fFAlphaCut;
1024 fFAlphaCut= new TF1("fFAlphaCut","[0]*tanh([1]*x)",0.,100.);
1025 fFAlphaCut->SetParameter(0,0.65);
1026 fFAlphaCut->SetParameter(1,1.2);
1027 fAlphaMinCutMeson = 0.0;
1028 fAlphaCutMeson = -1.0;
1029 fAlphaPtDepCut = kTRUE;
1032 cout<<"Warning: AlphaMesonCut not defined "<<alphaMesonCut<<endl;
1038 ///________________________________________________________________________
1039 Bool_t AliConversionMesonCuts::SetRapidityMesonCut(Int_t RapidityMesonCut){
1041 switch(RapidityMesonCut){
1042 case 0: // changed from 0.9 to 1.35
1043 fRapidityCutMeson = 1.35;
1046 fRapidityCutMeson = 0.8;
1049 fRapidityCutMeson = 0.7;
1052 fRapidityCutMeson = 0.6;
1055 fRapidityCutMeson = 0.5;
1058 fRapidityCutMeson = 0.85;
1061 fRapidityCutMeson = 0.75;
1064 fRapidityCutMeson = 0.3;
1066 case 8: //changed, before 0.35
1067 fRapidityCutMeson = 0.25;
1070 fRapidityCutMeson = 0.4;
1073 cout<<"Warning: RapidityMesonCut not defined "<<RapidityMesonCut<<endl;
1080 ///________________________________________________________________________
1081 Bool_t AliConversionMesonCuts::SetBackgroundScheme(Int_t BackgroundScheme){
1083 switch(BackgroundScheme){
1085 fUseRotationMethodInBG=kTRUE;
1086 fdoBGProbability=kFALSE;
1088 case 1: // mixed event with V0 multiplicity
1089 fUseRotationMethodInBG=kFALSE;
1090 fUseTrackMultiplicityForBG=kFALSE;
1091 fdoBGProbability=kFALSE;
1093 case 2: // mixed event with track multiplicity
1094 fUseRotationMethodInBG=kFALSE;
1095 fUseTrackMultiplicityForBG=kTRUE;
1096 fdoBGProbability=kFALSE;
1099 fUseRotationMethodInBG=kTRUE;
1100 fdoBGProbability=kTRUE;
1102 case 4: //No BG calculation
1103 cout << "no BG calculation should be done" << endl;
1104 fUseRotationMethodInBG=kFALSE;
1105 fdoBGProbability=kFALSE;
1109 fUseRotationMethodInBG=kTRUE;
1110 fdoBGProbability=kFALSE;
1111 fBackgroundHandler = 1;
1113 case 6: // mixed event with V0 multiplicity
1114 fUseRotationMethodInBG=kFALSE;
1115 fUseTrackMultiplicityForBG=kFALSE;
1116 fdoBGProbability=kFALSE;
1117 fBackgroundHandler = 1;
1119 case 7: // mixed event with track multiplicity
1120 fUseRotationMethodInBG=kFALSE;
1121 fUseTrackMultiplicityForBG=kTRUE;
1122 fdoBGProbability=kFALSE;
1123 fBackgroundHandler = 1;
1126 fUseRotationMethodInBG=kTRUE;
1127 fdoBGProbability=kTRUE;
1128 fBackgroundHandler = 1;
1131 cout<<"Warning: BackgroundScheme not defined "<<BackgroundScheme<<endl;
1138 ///________________________________________________________________________
1139 Bool_t AliConversionMesonCuts::SetNDegreesForRotationMethod(Int_t DegreesForRotationMethod){
1141 switch(DegreesForRotationMethod){
1143 fnDegreeRotationPMForBG = 5;
1146 fnDegreeRotationPMForBG = 10;
1149 fnDegreeRotationPMForBG = 15;
1152 fnDegreeRotationPMForBG = 20;
1155 cout<<"Warning: DegreesForRotationMethod not defined "<<DegreesForRotationMethod<<endl;
1158 fCuts[kDegreesForRotationMethod]=DegreesForRotationMethod;
1162 ///________________________________________________________________________
1163 Bool_t AliConversionMesonCuts::SetNumberOfBGEvents(Int_t NumberOfBGEvents){
1165 switch(NumberOfBGEvents){
1167 fNumberOfBGEvents = 5;
1170 fNumberOfBGEvents = 10;
1173 fNumberOfBGEvents = 15;
1176 fNumberOfBGEvents = 20;
1179 fNumberOfBGEvents = 2;
1182 fNumberOfBGEvents = 50;
1185 fNumberOfBGEvents = 80;
1188 fNumberOfBGEvents = 100;
1191 cout<<"Warning: NumberOfBGEvents not defined "<<NumberOfBGEvents<<endl;
1196 ///________________________________________________________________________
1197 Bool_t AliConversionMesonCuts::SetSharedElectronCut(Int_t sharedElec) {
1201 fDoSharedElecCut = kFALSE;
1204 fDoSharedElecCut = kTRUE;
1207 cout<<"Warning: Shared Electron Cut not defined "<<sharedElec<<endl;
1214 ///________________________________________________________________________
1215 Bool_t AliConversionMesonCuts::SetToCloseV0sCut(Int_t toClose) {
1219 fDoToCloseV0sCut = kFALSE;
1223 fDoToCloseV0sCut = kTRUE;
1227 fDoToCloseV0sCut = kTRUE;
1231 fDoToCloseV0sCut = kTRUE;
1235 cout<<"Warning: Shared Electron Cut not defined "<<toClose<<endl;
1241 ///________________________________________________________________________
1242 Bool_t AliConversionMesonCuts::SetMCPSmearing(Int_t useMCPSmearing)
1244 switch(useMCPSmearing){
1249 fPSigSmearingCte=0.;
1253 fPBremSmearing=1.0e-14;
1255 fPSigSmearingCte=0.;
1259 fPBremSmearing=1.0e-15;
1261 fPSigSmearingCte=0.;
1266 fPSigSmearing=0.003;
1267 fPSigSmearingCte=0.002;
1272 fPSigSmearing=0.003;
1273 fPSigSmearingCte=0.007;
1278 fPSigSmearing=0.003;
1279 fPSigSmearingCte=0.016;
1284 fPSigSmearing=0.007;
1285 fPSigSmearingCte=0.016;
1289 fPBremSmearing=1.0e-16;
1291 fPSigSmearingCte=0.;
1296 fPSigSmearing=0.007;
1297 fPSigSmearingCte=0.014;
1302 fPSigSmearing=0.007;
1303 fPSigSmearingCte=0.011;
1307 AliError("Warning: UseMCPSmearing not defined");
1314 ///________________________________________________________________________
1315 Bool_t AliConversionMesonCuts::SetDCAGammaGammaCut(Int_t DCAGammaGamma){
1317 switch(DCAGammaGamma){
1319 fDCAGammaGammaCut = 1000;
1322 fDCAGammaGammaCut = 10;
1325 fDCAGammaGammaCut = 5;
1328 fDCAGammaGammaCut = 4;
1331 fDCAGammaGammaCut = 3;
1334 fDCAGammaGammaCut = 2.5;
1337 fDCAGammaGammaCut = 2;
1340 fDCAGammaGammaCut = 1.5;
1343 fDCAGammaGammaCut = 1;
1346 fDCAGammaGammaCut = 0.5;
1349 cout<<"Warning: DCAGammaGamma not defined "<<DCAGammaGamma<<endl;
1355 ///________________________________________________________________________
1356 Bool_t AliConversionMesonCuts::SetDCAZMesonPrimVtxCut(Int_t DCAZMesonPrimVtx){
1358 switch(DCAZMesonPrimVtx){
1360 fDCAZMesonPrimVtxCut = 1000;
1363 fDCAZMesonPrimVtxCut = 10;
1366 fDCAZMesonPrimVtxCut = 5;
1369 fDCAZMesonPrimVtxCut = 4;
1372 fDCAZMesonPrimVtxCut = 3;
1375 fDCAZMesonPrimVtxCut = 2.5;
1378 fDCAZMesonPrimVtxCut = 2;
1381 fDCAZMesonPrimVtxCut = 1.5;
1384 fDCAZMesonPrimVtxCut = 1;
1387 fDCAZMesonPrimVtxCut = 0.5;
1390 cout<<"Warning: DCAZMesonPrimVtx not defined "<<DCAZMesonPrimVtx<<endl;
1396 ///________________________________________________________________________
1397 Bool_t AliConversionMesonCuts::SetDCARMesonPrimVtxCut(Int_t DCARMesonPrimVtx){
1399 switch(DCARMesonPrimVtx){
1401 fDCARMesonPrimVtxCut = 1000;
1404 fDCARMesonPrimVtxCut = 10;
1407 fDCARMesonPrimVtxCut = 5;
1410 fDCARMesonPrimVtxCut = 4;
1413 fDCARMesonPrimVtxCut = 3;
1416 fDCARMesonPrimVtxCut = 2.5;
1419 fDCARMesonPrimVtxCut = 2;
1422 fDCARMesonPrimVtxCut = 1.5;
1425 fDCARMesonPrimVtxCut = 1;
1428 fDCARMesonPrimVtxCut = 0.5;
1431 cout<<"Warning: DCARMesonPrimVtx not defined "<<DCARMesonPrimVtx<<endl;
1438 ///________________________________________________________________________
1439 TString AliConversionMesonCuts::GetCutNumber(){
1440 // returns TString with current cut number
1442 for(Int_t ii=0;ii<kNCuts;ii++){
1443 a.Append(Form("%d",fCuts[ii]));
1448 ///________________________________________________________________________
1449 void AliConversionMesonCuts::FillElectonLabelArray(AliAODConversionPhoton* photon, Int_t nV0){
1451 Int_t posLabel = photon->GetTrackLabelPositive();
1452 Int_t negLabel = photon->GetTrackLabelNegative();
1454 fElectronLabelArray[nV0*2] = posLabel;
1455 fElectronLabelArray[(nV0*2)+1] = negLabel;
1458 ///________________________________________________________________________
1459 Bool_t AliConversionMesonCuts::RejectSharedElectronV0s(AliAODConversionPhoton* photon, Int_t nV0, Int_t nV0s){
1461 Int_t posLabel = photon->GetTrackLabelPositive();
1462 Int_t negLabel = photon->GetTrackLabelNegative();
1464 for(Int_t i = 0; i<nV0s*2;i++){
1465 if(i==nV0*2) continue;
1466 if(i==(nV0*2)+1) continue;
1467 if(fElectronLabelArray[i] == posLabel){
1469 if(fElectronLabelArray[i] == negLabel){
1475 ///________________________________________________________________________
1476 Bool_t AliConversionMesonCuts::RejectToCloseV0s(AliAODConversionPhoton* photon, TList *photons, Int_t nV0){
1477 Double_t posX = photon->GetConversionX();
1478 Double_t posY = photon->GetConversionY();
1479 Double_t posZ = photon->GetConversionZ();
1481 for(Int_t i = 0;i<photons->GetEntries();i++){
1482 if(nV0 == i) continue;
1483 AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
1484 Double_t posCompX = photonComp->GetConversionX();
1485 Double_t posCompY = photonComp->GetConversionY();
1486 Double_t posCompZ = photonComp->GetConversionZ();
1488 Double_t dist = pow((posX - posCompX),2)+pow((posY - posCompY),2)+pow((posZ - posCompZ),2);
1490 if(dist < fminV0Dist*fminV0Dist){
1491 if(photon->GetChi2perNDF() < photonComp->GetChi2perNDF()) return kTRUE;
1500 ///________________________________________________________________________
1501 void AliConversionMesonCuts::SmearParticle(AliAODConversionPhoton* photon)
1504 if (photon==NULL) return;
1505 Double_t facPBrem = 1.;
1506 Double_t facPSig = 0.;
1515 if( photon->P()!=0){
1516 theta=acos( photon->Pz()/ photon->P());
1519 if( fPSigSmearing != 0. || fPSigSmearingCte!=0. ){
1520 facPSig = TMath::Sqrt(fPSigSmearingCte*fPSigSmearingCte+fPSigSmearing*fPSigSmearing*P*P)*fRandom.Gaus(0.,1.);
1523 if( fPBremSmearing != 1.){
1525 facPBrem = fBrem->GetRandom();
1529 photon->SetPx(facPBrem* (1+facPSig)* P*sin(theta)*cos(phi)) ;
1530 photon->SetPy(facPBrem* (1+facPSig)* P*sin(theta)*sin(phi)) ;
1531 photon->SetPz(facPBrem* (1+facPSig)* P*cos(theta)) ;
1532 photon->SetE(photon->P());
1534 ///________________________________________________________________________
1535 void AliConversionMesonCuts::SmearVirtualPhoton(AliAODConversionPhoton* photon)
1538 if (photon==NULL) return;
1539 Double_t facPBrem = 1.;
1540 Double_t facPSig = 0.;
1549 if( photon->P()!=0){
1550 theta=acos( photon->Pz()/ photon->P());
1553 if( fPSigSmearing != 0. || fPSigSmearingCte!=0. ){
1554 facPSig = TMath::Sqrt(fPSigSmearingCte*fPSigSmearingCte+fPSigSmearing*fPSigSmearing*P*P)*fRandom.Gaus(0.,1.);
1557 if( fPBremSmearing != 1.){
1559 facPBrem = fBrem->GetRandom();
1563 photon->SetPx(facPBrem* (1+facPSig)* P*sin(theta)*cos(phi)) ;
1564 photon->SetPy(facPBrem* (1+facPSig)* P*sin(theta)*sin(phi)) ;
1565 photon->SetPz(facPBrem* (1+facPSig)* P*cos(theta)) ;
1568 ///________________________________________________________________________
1569 TLorentzVector AliConversionMesonCuts::SmearElectron(TLorentzVector particle)
1572 //if (particle==0) return;
1573 Double_t facPBrem = 1.;
1574 Double_t facPSig = 0.;
1585 if (phi < 0.) phi += 2. * TMath::Pi();
1587 if( particle.P()!=0){
1588 theta=acos( particle.Pz()/ particle.P());
1592 Double_t fPSigSmearingHalf = fPSigSmearing / 2.0; //The parameter was set for gammas with 2 particles and here we have just one electron
1593 Double_t sqrtfPSigSmearingCteHalf = fPSigSmearingCte / 2.0 ; //The parameter was set for gammas with 2 particles and here we have just one electron
1597 if( fPSigSmearingHalf != 0. || sqrtfPSigSmearingCteHalf!=0. ){
1598 facPSig = TMath::Sqrt(sqrtfPSigSmearingCteHalf*sqrtfPSigSmearingCteHalf+fPSigSmearingHalf*fPSigSmearingHalf*P*P)*fRandom.Gaus(0.,1.);
1601 if( fPBremSmearing != 1.){
1603 facPBrem = fBrem->GetRandom();
1607 TLorentzVector SmearedParticle;
1609 SmearedParticle.SetXYZM( facPBrem* (1+facPSig)* P*sin(theta)*cos(phi) , facPBrem* (1+facPSig)* P*sin(theta)*sin(phi) ,
1610 facPBrem* (1+facPSig)* P*cos(theta) , TDatabasePDG::Instance()->GetParticle( ::kElectron )->Mass()) ;
1612 //particle.SetPx(facPBrem* (1+facPSig)* P*sin(theta)*cos(phi)) ;
1613 //particle.SetPy(facPBrem* (1+facPSig)* P*sin(theta)*sin(phi)) ;
1614 //particle.SetPz(facPBrem* (1+facPSig)* P*cos(theta)) ;
1616 return SmearedParticle;