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 for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
487 TParticle* temp = (TParticle*)fMCStack->Particle( index );
488 switch( temp->GetPdgCode() ) {
491 labelPosPion = index;
495 labelNegPion = index;
499 labelNeutPion = index;
504 if( posPion && negPion && neutPion ) return kTRUE;
509 //________________________________________________________________________
510 Bool_t AliConversionMesonCuts::MesonIsSelectedMCChiC(TParticle *fMCMother,AliStack *fMCStack,Int_t & labelelectronChiC, Int_t & labelpositronChiC, Int_t & labelgammaChiC, Double_t fRapidityShift){
511 // Returns true for all ChiC within acceptance cuts for decay into JPsi + gamma -> e+ + e- + gamma
512 // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
514 if(!fMCStack)return kFALSE;
515 // if(fMCMother->GetPdgCode()==20443 ){
518 if(fMCMother->GetPdgCode()==10441 || fMCMother->GetPdgCode()==10443 || fMCMother->GetPdgCode()==445 ){
519 if(fMCMother->R()>fMaxR) return kFALSE; // cuts on distance from collision point
521 Double_t rapidity = 10.;
522 if(fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0){
523 rapidity=8.-fRapidityShift;
526 rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
530 if(abs(rapidity)>fRapidityCutMeson)return kFALSE;
532 // Select only -> ChiC radiative (JPsi+gamma) decay channel
533 if(fMCMother->GetNDaughters()!=2)return kFALSE;
535 TParticle *jpsi = 0x0;
536 TParticle *gamma = 0x0;
537 TParticle *positron = 0x0;
538 TParticle *electron = 0x0;
540 Int_t labeljpsiChiC = -1;
542 for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
544 TParticle* temp = (TParticle*)fMCStack->Particle( index );
546 switch( temp->GetPdgCode() ) {
549 labeljpsiChiC = index;
553 labelgammaChiC = index;
558 if ( !jpsi || ! gamma) return kFALSE;
559 if(jpsi->GetNDaughters()!=2)return kFALSE;
562 for(Int_t index= jpsi->GetFirstDaughter();index<= jpsi->GetLastDaughter();index++){
563 TParticle* temp = (TParticle*)fMCStack->Particle( index );
564 switch( temp->GetPdgCode() ) {
567 labelelectronChiC = index;
571 labelpositronChiC = index;
575 if( !electron || !positron) return kFALSE;
576 if( positron && electron && gamma) return kTRUE;
581 ///________________________________________________________________________
582 Bool_t AliConversionMesonCuts::MesonIsSelected(AliAODConversionMother *pi0,Bool_t IsSignal, Double_t fRapidityShift)
585 // Selection of reconstructed Meson candidates
586 // Use flag IsSignal in order to fill Fill different
587 // histograms for Signal and Background
590 if(IsSignal){hist=hMesonCuts;}
591 else{hist=hMesonBGCuts;}
595 if(hist)hist->Fill(cutIndex);
598 // Undefined Rapidity -> Floating Point exception
599 if((pi0->E()+pi0->Pz())/(pi0->E()-pi0->Pz())<=0){
600 if(hist)hist->Fill(cutIndex);
602 // cout << "undefined rapidity" << endl;
606 // PseudoRapidity Cut --> But we cut on Rapidity !!!
608 if(abs(pi0->Rapidity()-fRapidityShift)>fRapidityCutMeson){
609 if(hist)hist->Fill(cutIndex);
610 // cout << abs(pi0->Rapidity()-fRapidityShift) << ">" << fRapidityCutMeson << endl;
617 //fOpeningAngle=2*TMath::ATan(0.134/pi0->P());// physical minimum opening angle
618 if( pi0->GetOpeningAngle() < fOpeningAngle){
619 // cout << pi0->GetOpeningAngle() << "<" << fOpeningAngle << endl;
620 if(hist)hist->Fill(cutIndex);
625 if ( fAlphaPtDepCut == kTRUE ) {
627 fAlphaCutMeson = fFAlphaCut->Eval( pi0->Pt() );
632 if(pi0->GetAlpha()>fAlphaCutMeson){
633 // cout << pi0->GetAlpha() << ">" << fAlphaCutMeson << endl;
634 if(hist)hist->Fill(cutIndex);
640 if(pi0->GetAlpha()<fAlphaMinCutMeson){
641 // cout << pi0->GetAlpha() << "<" << fAlphaMinCutMeson << endl;
642 if(hist)hist->Fill(cutIndex);
647 if (hDCAGammaGammaMesonBefore)hDCAGammaGammaMesonBefore->Fill(pi0->GetDCABetweenPhotons());
648 if (hDCARMesonPrimVtxBefore)hDCARMesonPrimVtxBefore->Fill(pi0->GetDCARMotherPrimVtx());
650 if (pi0->GetDCABetweenPhotons() > fDCAGammaGammaCut){
651 // cout << pi0->GetDCABetweenPhotons() << ">" << fDCAGammaGammaCut << endl;
652 if(hist)hist->Fill(cutIndex);
657 if (pi0->GetDCARMotherPrimVtx() > fDCARMesonPrimVtxCut){
658 // cout << pi0->GetDCARMotherPrimVtx() << ">" << fDCARMesonPrimVtxCut << endl;
659 if(hist)hist->Fill(cutIndex);
665 if (hDCAZMesonPrimVtxBefore)hDCAZMesonPrimVtxBefore->Fill(pi0->GetDCAZMotherPrimVtx());
667 if (abs(pi0->GetDCAZMotherPrimVtx()) > fDCAZMesonPrimVtxCut){
668 // cout << pi0->GetDCAZMotherPrimVtx() << ">" << fDCAZMesonPrimVtxCut << endl;
669 if(hist)hist->Fill(cutIndex);
675 if (hDCAGammaGammaMesonAfter)hDCAGammaGammaMesonAfter->Fill(pi0->GetDCABetweenPhotons());
676 if (hDCARMesonPrimVtxAfter)hDCARMesonPrimVtxAfter->Fill(pi0->GetDCARMotherPrimVtx());
677 if (hDCAZMesonPrimVtxAfter)hDCAZMesonPrimVtxAfter->Fill(pi0->M(),pi0->GetDCAZMotherPrimVtx());
679 if(hist)hist->Fill(cutIndex);
685 ///________________________________________________________________________
686 ///________________________________________________________________________
687 Bool_t AliConversionMesonCuts::UpdateCutString() {
688 ///Update the cut string (if it has been created yet)
690 if(fCutString && fCutString->GetString().Length() == kNCuts) {
691 fCutString->SetString(GetCutNumber());
698 ///________________________________________________________________________
699 Bool_t AliConversionMesonCuts::InitializeCutsFromCutString(const TString analysisCutSelection ) {
700 // Initialize Cuts from a given Cut string
701 AliInfo(Form("Set Meson Cutnumber: %s",analysisCutSelection.Data()));
702 if(analysisCutSelection.Length()!=kNCuts) {
703 AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
706 if(!analysisCutSelection.IsDigit()){
707 AliError("Cut selection contains characters");
711 const char *cutSelection = analysisCutSelection.Data();
712 #define ASSIGNARRAY(i) fCuts[i] = cutSelection[i] - '0'
713 for(Int_t ii=0;ii<kNCuts;ii++){
717 // Set Individual Cuts
718 for(Int_t ii=0;ii<kNCuts;ii++){
719 if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
722 PrintCutsWithValues();
725 ///________________________________________________________________________
726 Bool_t AliConversionMesonCuts::SetCut(cutIds cutID, const Int_t value) {
727 ///Set individual cut ID
729 //cout << "Updating cut " << fgkCutNames[cutID] << " (" << cutID << ") to " << value << endl;
732 if( SetMesonKind(value)) {
733 fCuts[kMesonKind] = value;
736 } else return kFALSE;
738 if( SetSelectionWindowCut(value)) {
739 fCuts[kSelectionCut] = value;
742 } else return kFALSE;
744 if( SetAlphaMesonCut(value)) {
745 fCuts[kalphaMesonCut] = value;
748 } else return kFALSE;
750 if( SetRCut(value)) {
751 fCuts[kRCut] = value;
754 } else return kFALSE;
756 case kRapidityMesonCut:
757 if( SetRapidityMesonCut(value)) {
758 fCuts[kRapidityMesonCut] = value;
761 } else return kFALSE;
763 case kBackgroundScheme:
764 if( SetBackgroundScheme(value)) {
765 fCuts[kBackgroundScheme] = value;
768 } else return kFALSE;
770 case kDegreesForRotationMethod:
771 if( SetNDegreesForRotationMethod(value)) {
772 fCuts[kDegreesForRotationMethod] = value;
775 } else return kFALSE;
777 case kNumberOfBGEvents:
778 if( SetNumberOfBGEvents(value)) {
779 fCuts[kNumberOfBGEvents] = value;
782 } else return kFALSE;
784 case kuseMCPSmearing:
785 if( SetMCPSmearing(value)) {
786 fCuts[kuseMCPSmearing] = value;
789 } else return kFALSE;
791 if( SetSharedElectronCut(value)) {
792 fCuts[kElecShare] = value;
795 } else return kFALSE;
797 if( SetToCloseV0sCut(value)) {
798 fCuts[kToCloseV0s] = value;
801 } else return kFALSE;
803 if( SetDCAGammaGammaCut(value)) {
804 fCuts[kDcaGammaGamma] = value;
807 } else return kFALSE;
809 if( SetDCAZMesonPrimVtxCut(value)) {
810 fCuts[kDcaZPrimVtx] = value;
813 } else return kFALSE;
815 if( SetDCARMesonPrimVtxCut(value)) {
816 fCuts[kDcaRPrimVtx] = value;
819 } else return kFALSE;
822 cout << "Error:: Cut id out of range"<< endl;
826 cout << "Error:: Cut id " << cutID << " not recognized "<< endl;
832 ///________________________________________________________________________
833 void AliConversionMesonCuts::PrintCuts() {
834 // Print out current Cut Selection
835 for(Int_t ic = 0; ic < kNCuts; ic++) {
836 printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
840 ///________________________________________________________________________
841 void AliConversionMesonCuts::PrintCutsWithValues() {
842 // Print out current Cut Selection with values
843 printf("\nMeson cutnumber \n");
844 for(Int_t ic = 0; ic < kNCuts; ic++) {
845 printf("%d",fCuts[ic]);
849 printf("Meson cuts \n");
850 printf("\t |y| < %3.2f \n", fRapidityCutMeson);
851 printf("\t theta_{open} < %3.2f\n", fOpeningAngle);
852 if (!fAlphaPtDepCut) printf("\t %3.2f < alpha < %3.2f\n", fAlphaMinCutMeson, fAlphaCutMeson);
853 printf("\t dca_{gamma,gamma} > %3.2f\n", fDCAGammaGammaCut);
854 printf("\t dca_{R, prim Vtx} > %3.2f\n", fDCARMesonPrimVtxCut);
855 printf("\t dca_{Z, prim Vtx} > %3.2f\n\n", fDCAZMesonPrimVtxCut);
856 printf("\t Meson selection window for further analysis %3.3f > M_{gamma,gamma} > %3.3f\n\n", fSelectionLow, fSelectionHigh);
858 printf("Meson BG settings \n");
860 if (!fUseRotationMethodInBG & !fUseTrackMultiplicityForBG) printf("\t BG scheme: mixing V0 mult \n");
861 if (!fUseRotationMethodInBG & fUseTrackMultiplicityForBG) printf("\t BG scheme: mixing track mult \n");
862 if (fUseRotationMethodInBG )printf("\t BG scheme: rotation \n");
863 if (fdoBGProbability) printf("\t -> use BG probability \n");
864 if (fBackgroundHandler) printf("\t -> use new BG handler \n");
865 printf("\t depth of pool: %d\n", fNumberOfBGEvents);
866 if (fUseRotationMethodInBG )printf("\t degree's for BG rotation: %d\n", fnDegreeRotationPMForBG);
872 ///________________________________________________________________________
873 Bool_t AliConversionMesonCuts::SetMesonKind(Int_t mesonKind){
883 cout<<"Warning: Meson kind not defined"<<mesonKind<<endl;
889 ///________________________________________________________________________
890 Bool_t AliConversionMesonCuts::SetRCut(Int_t rCut){
911 // High purity cuts for PbPb
916 cout<<"Warning: rCut not defined"<<rCut<<endl;
922 ///________________________________________________________________________
923 Bool_t AliConversionMesonCuts::SetSelectionWindowCut(Int_t selectionCut){
925 switch(selectionCut){
927 fSelectionLow = 0.08;
928 fSelectionHigh = 0.145;
932 fSelectionHigh = 0.145;
935 fSelectionLow = 0.11;
936 fSelectionHigh = 0.145;
939 fSelectionLow = 0.12;
940 fSelectionHigh = 0.145;
944 fSelectionHigh = 0.15;
947 fSelectionLow = 0.11;
948 fSelectionHigh = 0.15;
951 fSelectionLow = 0.12;
952 fSelectionHigh = 0.15;
956 cout<<"Warning: SelectionCut not defined "<<selectionCut<<endl;
963 ///________________________________________________________________________
964 Bool_t AliConversionMesonCuts::SetAlphaMesonCut(Int_t alphaMesonCut)
966 switch(alphaMesonCut){
968 fAlphaMinCutMeson = 0.0;
969 fAlphaCutMeson = 0.7;
970 fAlphaPtDepCut = kFALSE;
972 case 1: // Updated 31 October 2013 before 0.0 - 0.5
973 if( fFAlphaCut ) delete fFAlphaCut;
974 fFAlphaCut= new TF1("fFAlphaCut","[0]*tanh([1]*x)",0.,100.);
975 fFAlphaCut->SetParameter(0,0.7);
976 fFAlphaCut->SetParameter(1,1.2);
977 fAlphaMinCutMeson = 0.0;
978 fAlphaCutMeson = -1.0;
979 fAlphaPtDepCut = kTRUE;
981 case 2: // Updated 31 October 2013 before 0.5-1
982 if( fFAlphaCut ) delete fFAlphaCut;
983 fFAlphaCut= new TF1("fFAlphaCut","[0]*tanh([1]*x)",0.,100.);
984 fFAlphaCut->SetParameter(0,0.8);
985 fFAlphaCut->SetParameter(1,1.2);
986 fAlphaMinCutMeson = 0.0;
987 fAlphaCutMeson = -1.0;
988 fAlphaPtDepCut = kTRUE;
991 fAlphaMinCutMeson = 0.0;
993 fAlphaPtDepCut = kFALSE;
996 fAlphaMinCutMeson = 0.0;
997 fAlphaCutMeson = 0.65;
998 fAlphaPtDepCut = kFALSE;
1001 fAlphaMinCutMeson = 0.0;
1002 fAlphaCutMeson = 0.75;
1003 fAlphaPtDepCut = kFALSE;
1006 fAlphaMinCutMeson = 0.0;
1007 fAlphaCutMeson = 0.8;
1008 fAlphaPtDepCut = kFALSE;
1011 fAlphaMinCutMeson = 0.0;
1012 fAlphaCutMeson = 0.85;
1013 fAlphaPtDepCut = kFALSE;
1016 fAlphaMinCutMeson = 0.0;
1017 fAlphaCutMeson = 0.6;
1018 fAlphaPtDepCut = kFALSE;
1020 case 9: // Updated 11 November 2013 before 0.0 - 0.3
1021 if( fFAlphaCut ) delete fFAlphaCut;
1022 fFAlphaCut= new TF1("fFAlphaCut","[0]*tanh([1]*x)",0.,100.);
1023 fFAlphaCut->SetParameter(0,0.65);
1024 fFAlphaCut->SetParameter(1,1.2);
1025 fAlphaMinCutMeson = 0.0;
1026 fAlphaCutMeson = -1.0;
1027 fAlphaPtDepCut = kTRUE;
1030 cout<<"Warning: AlphaMesonCut not defined "<<alphaMesonCut<<endl;
1036 ///________________________________________________________________________
1037 Bool_t AliConversionMesonCuts::SetRapidityMesonCut(Int_t RapidityMesonCut){
1039 switch(RapidityMesonCut){
1040 case 0: // changed from 0.9 to 1.35
1041 fRapidityCutMeson = 1.35;
1044 fRapidityCutMeson = 0.8;
1047 fRapidityCutMeson = 0.7;
1050 fRapidityCutMeson = 0.6;
1053 fRapidityCutMeson = 0.5;
1056 fRapidityCutMeson = 0.85;
1059 fRapidityCutMeson = 0.75;
1062 fRapidityCutMeson = 0.3;
1064 case 8: //changed, before 0.35
1065 fRapidityCutMeson = 0.25;
1068 fRapidityCutMeson = 0.4;
1071 cout<<"Warning: RapidityMesonCut not defined "<<RapidityMesonCut<<endl;
1078 ///________________________________________________________________________
1079 Bool_t AliConversionMesonCuts::SetBackgroundScheme(Int_t BackgroundScheme){
1081 switch(BackgroundScheme){
1083 fUseRotationMethodInBG=kTRUE;
1084 fdoBGProbability=kFALSE;
1086 case 1: // mixed event with V0 multiplicity
1087 fUseRotationMethodInBG=kFALSE;
1088 fUseTrackMultiplicityForBG=kFALSE;
1089 fdoBGProbability=kFALSE;
1091 case 2: // mixed event with track multiplicity
1092 fUseRotationMethodInBG=kFALSE;
1093 fUseTrackMultiplicityForBG=kTRUE;
1094 fdoBGProbability=kFALSE;
1097 fUseRotationMethodInBG=kTRUE;
1098 fdoBGProbability=kTRUE;
1100 case 4: //No BG calculation
1101 cout << "no BG calculation should be done" << endl;
1102 fUseRotationMethodInBG=kFALSE;
1103 fdoBGProbability=kFALSE;
1107 fUseRotationMethodInBG=kTRUE;
1108 fdoBGProbability=kFALSE;
1109 fBackgroundHandler = 1;
1111 case 6: // mixed event with V0 multiplicity
1112 fUseRotationMethodInBG=kFALSE;
1113 fUseTrackMultiplicityForBG=kFALSE;
1114 fdoBGProbability=kFALSE;
1115 fBackgroundHandler = 1;
1117 case 7: // mixed event with track multiplicity
1118 fUseRotationMethodInBG=kFALSE;
1119 fUseTrackMultiplicityForBG=kTRUE;
1120 fdoBGProbability=kFALSE;
1121 fBackgroundHandler = 1;
1124 fUseRotationMethodInBG=kTRUE;
1125 fdoBGProbability=kTRUE;
1126 fBackgroundHandler = 1;
1129 cout<<"Warning: BackgroundScheme not defined "<<BackgroundScheme<<endl;
1136 ///________________________________________________________________________
1137 Bool_t AliConversionMesonCuts::SetNDegreesForRotationMethod(Int_t DegreesForRotationMethod){
1139 switch(DegreesForRotationMethod){
1141 fnDegreeRotationPMForBG = 5;
1144 fnDegreeRotationPMForBG = 10;
1147 fnDegreeRotationPMForBG = 15;
1150 fnDegreeRotationPMForBG = 20;
1153 cout<<"Warning: DegreesForRotationMethod not defined "<<DegreesForRotationMethod<<endl;
1156 fCuts[kDegreesForRotationMethod]=DegreesForRotationMethod;
1160 ///________________________________________________________________________
1161 Bool_t AliConversionMesonCuts::SetNumberOfBGEvents(Int_t NumberOfBGEvents){
1163 switch(NumberOfBGEvents){
1165 fNumberOfBGEvents = 5;
1168 fNumberOfBGEvents = 10;
1171 fNumberOfBGEvents = 15;
1174 fNumberOfBGEvents = 20;
1177 fNumberOfBGEvents = 2;
1180 fNumberOfBGEvents = 50;
1183 fNumberOfBGEvents = 80;
1186 fNumberOfBGEvents = 100;
1189 cout<<"Warning: NumberOfBGEvents not defined "<<NumberOfBGEvents<<endl;
1194 ///________________________________________________________________________
1195 Bool_t AliConversionMesonCuts::SetSharedElectronCut(Int_t sharedElec) {
1199 fDoSharedElecCut = kFALSE;
1202 fDoSharedElecCut = kTRUE;
1205 cout<<"Warning: Shared Electron Cut not defined "<<sharedElec<<endl;
1212 ///________________________________________________________________________
1213 Bool_t AliConversionMesonCuts::SetToCloseV0sCut(Int_t toClose) {
1217 fDoToCloseV0sCut = kFALSE;
1221 fDoToCloseV0sCut = kTRUE;
1225 fDoToCloseV0sCut = kTRUE;
1229 fDoToCloseV0sCut = kTRUE;
1233 cout<<"Warning: Shared Electron Cut not defined "<<toClose<<endl;
1239 ///________________________________________________________________________
1240 Bool_t AliConversionMesonCuts::SetMCPSmearing(Int_t useMCPSmearing)
1242 switch(useMCPSmearing){
1247 fPSigSmearingCte=0.;
1251 fPBremSmearing=1.0e-14;
1253 fPSigSmearingCte=0.;
1257 fPBremSmearing=1.0e-15;
1259 fPSigSmearingCte=0.;
1264 fPSigSmearing=0.003;
1265 fPSigSmearingCte=0.002;
1270 fPSigSmearing=0.003;
1271 fPSigSmearingCte=0.007;
1276 fPSigSmearing=0.003;
1277 fPSigSmearingCte=0.016;
1282 fPSigSmearing=0.007;
1283 fPSigSmearingCte=0.016;
1287 fPBremSmearing=1.0e-16;
1289 fPSigSmearingCte=0.;
1294 fPSigSmearing=0.007;
1295 fPSigSmearingCte=0.014;
1300 fPSigSmearing=0.007;
1301 fPSigSmearingCte=0.011;
1305 AliError("Warning: UseMCPSmearing not defined");
1312 ///________________________________________________________________________
1313 Bool_t AliConversionMesonCuts::SetDCAGammaGammaCut(Int_t DCAGammaGamma){
1315 switch(DCAGammaGamma){
1317 fDCAGammaGammaCut = 1000;
1320 fDCAGammaGammaCut = 10;
1323 fDCAGammaGammaCut = 5;
1326 fDCAGammaGammaCut = 4;
1329 fDCAGammaGammaCut = 3;
1332 fDCAGammaGammaCut = 2.5;
1335 fDCAGammaGammaCut = 2;
1338 fDCAGammaGammaCut = 1.5;
1341 fDCAGammaGammaCut = 1;
1344 fDCAGammaGammaCut = 0.5;
1347 cout<<"Warning: DCAGammaGamma not defined "<<DCAGammaGamma<<endl;
1353 ///________________________________________________________________________
1354 Bool_t AliConversionMesonCuts::SetDCAZMesonPrimVtxCut(Int_t DCAZMesonPrimVtx){
1356 switch(DCAZMesonPrimVtx){
1358 fDCAZMesonPrimVtxCut = 1000;
1361 fDCAZMesonPrimVtxCut = 10;
1364 fDCAZMesonPrimVtxCut = 5;
1367 fDCAZMesonPrimVtxCut = 4;
1370 fDCAZMesonPrimVtxCut = 3;
1373 fDCAZMesonPrimVtxCut = 2.5;
1376 fDCAZMesonPrimVtxCut = 2;
1379 fDCAZMesonPrimVtxCut = 1.5;
1382 fDCAZMesonPrimVtxCut = 1;
1385 fDCAZMesonPrimVtxCut = 0.5;
1388 cout<<"Warning: DCAZMesonPrimVtx not defined "<<DCAZMesonPrimVtx<<endl;
1394 ///________________________________________________________________________
1395 Bool_t AliConversionMesonCuts::SetDCARMesonPrimVtxCut(Int_t DCARMesonPrimVtx){
1397 switch(DCARMesonPrimVtx){
1399 fDCARMesonPrimVtxCut = 1000;
1402 fDCARMesonPrimVtxCut = 10;
1405 fDCARMesonPrimVtxCut = 5;
1408 fDCARMesonPrimVtxCut = 4;
1411 fDCARMesonPrimVtxCut = 3;
1414 fDCARMesonPrimVtxCut = 2.5;
1417 fDCARMesonPrimVtxCut = 2;
1420 fDCARMesonPrimVtxCut = 1.5;
1423 fDCARMesonPrimVtxCut = 1;
1426 fDCARMesonPrimVtxCut = 0.5;
1429 cout<<"Warning: DCARMesonPrimVtx not defined "<<DCARMesonPrimVtx<<endl;
1436 ///________________________________________________________________________
1437 TString AliConversionMesonCuts::GetCutNumber(){
1438 // returns TString with current cut number
1440 for(Int_t ii=0;ii<kNCuts;ii++){
1441 a.Append(Form("%d",fCuts[ii]));
1446 ///________________________________________________________________________
1447 void AliConversionMesonCuts::FillElectonLabelArray(AliAODConversionPhoton* photon, Int_t nV0){
1449 Int_t posLabel = photon->GetTrackLabelPositive();
1450 Int_t negLabel = photon->GetTrackLabelNegative();
1452 fElectronLabelArray[nV0*2] = posLabel;
1453 fElectronLabelArray[(nV0*2)+1] = negLabel;
1456 ///________________________________________________________________________
1457 Bool_t AliConversionMesonCuts::RejectSharedElectronV0s(AliAODConversionPhoton* photon, Int_t nV0, Int_t nV0s){
1459 Int_t posLabel = photon->GetTrackLabelPositive();
1460 Int_t negLabel = photon->GetTrackLabelNegative();
1462 for(Int_t i = 0; i<nV0s*2;i++){
1463 if(i==nV0*2) continue;
1464 if(i==(nV0*2)+1) continue;
1465 if(fElectronLabelArray[i] == posLabel){
1467 if(fElectronLabelArray[i] == negLabel){
1473 ///________________________________________________________________________
1474 Bool_t AliConversionMesonCuts::RejectToCloseV0s(AliAODConversionPhoton* photon, TList *photons, Int_t nV0){
1475 Double_t posX = photon->GetConversionX();
1476 Double_t posY = photon->GetConversionY();
1477 Double_t posZ = photon->GetConversionZ();
1479 for(Int_t i = 0;i<photons->GetEntries();i++){
1480 if(nV0 == i) continue;
1481 AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
1482 Double_t posCompX = photonComp->GetConversionX();
1483 Double_t posCompY = photonComp->GetConversionY();
1484 Double_t posCompZ = photonComp->GetConversionZ();
1486 Double_t dist = pow((posX - posCompX),2)+pow((posY - posCompY),2)+pow((posZ - posCompZ),2);
1488 if(dist < fminV0Dist*fminV0Dist){
1489 if(photon->GetChi2perNDF() < photonComp->GetChi2perNDF()) return kTRUE;
1498 ///________________________________________________________________________
1499 void AliConversionMesonCuts::SmearParticle(AliAODConversionPhoton* photon)
1502 if (photon==NULL) return;
1503 Double_t facPBrem = 1.;
1504 Double_t facPSig = 0.;
1513 if( photon->P()!=0){
1514 theta=acos( photon->Pz()/ photon->P());
1517 if( fPSigSmearing != 0. || fPSigSmearingCte!=0. ){
1518 facPSig = TMath::Sqrt(fPSigSmearingCte*fPSigSmearingCte+fPSigSmearing*fPSigSmearing*P*P)*fRandom.Gaus(0.,1.);
1521 if( fPBremSmearing != 1.){
1523 facPBrem = fBrem->GetRandom();
1527 photon->SetPx(facPBrem* (1+facPSig)* P*sin(theta)*cos(phi)) ;
1528 photon->SetPy(facPBrem* (1+facPSig)* P*sin(theta)*sin(phi)) ;
1529 photon->SetPz(facPBrem* (1+facPSig)* P*cos(theta)) ;
1530 photon->SetE(photon->P());
1532 ///________________________________________________________________________
1533 void AliConversionMesonCuts::SmearVirtualPhoton(AliAODConversionPhoton* photon)
1536 if (photon==NULL) return;
1537 Double_t facPBrem = 1.;
1538 Double_t facPSig = 0.;
1547 if( photon->P()!=0){
1548 theta=acos( photon->Pz()/ photon->P());
1551 if( fPSigSmearing != 0. || fPSigSmearingCte!=0. ){
1552 facPSig = TMath::Sqrt(fPSigSmearingCte*fPSigSmearingCte+fPSigSmearing*fPSigSmearing*P*P)*fRandom.Gaus(0.,1.);
1555 if( fPBremSmearing != 1.){
1557 facPBrem = fBrem->GetRandom();
1561 photon->SetPx(facPBrem* (1+facPSig)* P*sin(theta)*cos(phi)) ;
1562 photon->SetPy(facPBrem* (1+facPSig)* P*sin(theta)*sin(phi)) ;
1563 photon->SetPz(facPBrem* (1+facPSig)* P*cos(theta)) ;
1566 ///________________________________________________________________________
1567 TLorentzVector AliConversionMesonCuts::SmearElectron(TLorentzVector particle)
1570 //if (particle==0) return;
1571 Double_t facPBrem = 1.;
1572 Double_t facPSig = 0.;
1583 if (phi < 0.) phi += 2. * TMath::Pi();
1585 if( particle.P()!=0){
1586 theta=acos( particle.Pz()/ particle.P());
1590 Double_t fPSigSmearingHalf = fPSigSmearing / 2.0; //The parameter was set for gammas with 2 particles and here we have just one electron
1591 Double_t sqrtfPSigSmearingCteHalf = fPSigSmearingCte / 2.0 ; //The parameter was set for gammas with 2 particles and here we have just one electron
1595 if( fPSigSmearingHalf != 0. || sqrtfPSigSmearingCteHalf!=0. ){
1596 facPSig = TMath::Sqrt(sqrtfPSigSmearingCteHalf*sqrtfPSigSmearingCteHalf+fPSigSmearingHalf*fPSigSmearingHalf*P*P)*fRandom.Gaus(0.,1.);
1599 if( fPBremSmearing != 1.){
1601 facPBrem = fBrem->GetRandom();
1605 TLorentzVector SmearedParticle;
1607 SmearedParticle.SetXYZM( facPBrem* (1+facPSig)* P*sin(theta)*cos(phi) , facPBrem* (1+facPSig)* P*sin(theta)*sin(phi) ,
1608 facPBrem* (1+facPSig)* P*cos(theta) , TDatabasePDG::Instance()->GetParticle( ::kElectron )->Mass()) ;
1610 //particle.SetPx(facPBrem* (1+facPSig)* P*sin(theta)*cos(phi)) ;
1611 //particle.SetPy(facPBrem* (1+facPSig)* P*sin(theta)*sin(phi)) ;
1612 //particle.SetPz(facPBrem* (1+facPSig)* P*cos(theta)) ;
1614 return SmearedParticle;