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
62 "SharedElectronCuts", //8
63 "RejectToCloseV0s", //9
64 "UseMCPSmearing", //10
71 //________________________________________________________________________
72 AliConversionMesonCuts::AliConversionMesonCuts(const char *name,const char *title) :
73 AliAnalysisCuts(name,title),
81 fUseRotationMethodInBG(kFALSE),
83 fdoBGProbability(kFALSE),
84 fUseTrackMultiplicityForBG(kFALSE),
85 fnDegreeRotationPMForBG(0),
88 fDoToCloseV0sCut(kFALSE),
90 fDoSharedElecCut(kFALSE),
91 fUseMCPSmearing(kFALSE),
98 fAlphaPtDepCut(kFALSE),
99 fElectronLabelArraySize(500),
100 fElectronLabelArray(NULL),
101 fDCAGammaGammaCut(1000),
102 fDCAZMesonPrimVtxCut(1000),
103 fDCARMesonPrimVtxCut(1000),
104 fBackgroundHandler(0),
108 hDCAGammaGammaMesonBefore(NULL),
109 hDCAZMesonPrimVtxBefore(NULL),
110 hDCARMesonPrimVtxBefore(NULL),
111 hDCAGammaGammaMesonAfter(NULL),
112 hDCAZMesonPrimVtxAfter(NULL),
113 hDCARMesonPrimVtxAfter(NULL)
116 for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;}
117 fCutString=new TObjString((GetCutNumber()).Data());
118 fElectronLabelArray = new Int_t[fElectronLabelArraySize];
120 fBrem = new TF1("fBrem","pow(-log(x),[0]/log(2.0)-1.0)/TMath::Gamma([0]/log(2.0))",0.00001,0.999999999);
121 // tests done with 1.0e-14
122 fBrem->SetParameter(0,fPBremSmearing);
123 fBrem->SetNpx(100000);
128 //________________________________________________________________________
129 AliConversionMesonCuts::AliConversionMesonCuts(const AliConversionMesonCuts &ref) :
130 AliAnalysisCuts(ref),
132 fMesonKind(ref.fMesonKind),
134 fChi2CutMeson(ref.fChi2CutMeson),
135 fAlphaMinCutMeson(ref.fAlphaMinCutMeson),
136 fAlphaCutMeson(ref.fAlphaCutMeson),
137 fRapidityCutMeson(ref.fRapidityCutMeson),
138 fUseRotationMethodInBG(ref.fUseRotationMethodInBG),
140 fdoBGProbability(ref.fdoBGProbability),
141 fUseTrackMultiplicityForBG(ref.fUseTrackMultiplicityForBG),
142 fnDegreeRotationPMForBG(ref.fnDegreeRotationPMForBG),
143 fNumberOfBGEvents(ref. fNumberOfBGEvents),
144 fOpeningAngle(ref.fOpeningAngle),
145 fDoToCloseV0sCut(ref.fDoToCloseV0sCut),
146 fminV0Dist(ref.fminV0Dist),
147 fDoSharedElecCut(ref.fDoSharedElecCut),
148 fUseMCPSmearing(ref.fUseMCPSmearing),
149 fPBremSmearing(ref.fPBremSmearing),
150 fPSigSmearing(ref.fPSigSmearing),
151 fPSigSmearingCte(ref.fPSigSmearingCte),
153 fRandom(ref.fRandom),
155 fAlphaPtDepCut(ref.fAlphaPtDepCut),
156 fElectronLabelArraySize(ref.fElectronLabelArraySize),
157 fElectronLabelArray(NULL),
158 fDCAGammaGammaCut(ref.fDCAGammaGammaCut),
159 fDCAZMesonPrimVtxCut(ref.fDCAZMesonPrimVtxCut),
160 fDCARMesonPrimVtxCut(ref.fDCARMesonPrimVtxCut),
161 fBackgroundHandler(ref.fBackgroundHandler),
165 hDCAGammaGammaMesonBefore(NULL),
166 hDCAZMesonPrimVtxBefore(NULL),
167 hDCARMesonPrimVtxBefore(NULL),
168 hDCAGammaGammaMesonAfter(NULL),
169 hDCAZMesonPrimVtxAfter(NULL),
170 hDCARMesonPrimVtxAfter(NULL)
173 for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=ref.fCuts[jj];}
174 fCutString=new TObjString((GetCutNumber()).Data());
175 fElectronLabelArray = new Int_t[fElectronLabelArraySize];
176 if (fBrem == NULL)fBrem = (TF1*)ref.fBrem->Clone("fBrem");
177 // Histograms are not copied, if you need them, call InitCutHistograms
181 //________________________________________________________________________
182 AliConversionMesonCuts::~AliConversionMesonCuts() {
184 //Deleting fHistograms leads to seg fault it it's added to output collection of a task
186 // delete fHistograms;
187 // fHistograms = NULL;
188 if(fCutString != NULL){
192 if(fElectronLabelArray){
193 delete fElectronLabelArray;
194 fElectronLabelArray = NULL;
199 //________________________________________________________________________
200 void AliConversionMesonCuts::InitCutHistograms(TString name, Bool_t additionalHists){
202 // Initialize Cut Histograms for QA (only initialized and filled if function is called)
203 TH1::AddDirectory(kFALSE);
205 if(fHistograms != NULL){
209 if(fHistograms==NULL){
210 fHistograms=new TList();
211 fHistograms->SetOwner(kTRUE);
212 if(name=="")fHistograms->SetName(Form("ConvMesonCuts_%s",GetCutNumber().Data()));
213 else fHistograms->SetName(Form("%s_%s",name.Data(),GetCutNumber().Data()));
217 hMesonCuts=new TH1F(Form("MesonCuts %s",GetCutNumber().Data()),"MesonCuts",13,-0.5,12.5);
218 hMesonCuts->GetXaxis()->SetBinLabel(1,"in");
219 hMesonCuts->GetXaxis()->SetBinLabel(2,"undef rapidity");
220 hMesonCuts->GetXaxis()->SetBinLabel(3,"rapidity cut");
221 hMesonCuts->GetXaxis()->SetBinLabel(4,"opening angle");
222 hMesonCuts->GetXaxis()->SetBinLabel(5,"alpha max");
223 hMesonCuts->GetXaxis()->SetBinLabel(6,"alpha min");
224 hMesonCuts->GetXaxis()->SetBinLabel(7,"dca gamma gamma");
225 hMesonCuts->GetXaxis()->SetBinLabel(8,"dca R prim Vtx");
226 hMesonCuts->GetXaxis()->SetBinLabel(9,"dca Z prim Vtx");
227 hMesonCuts->GetXaxis()->SetBinLabel(10,"out");
228 fHistograms->Add(hMesonCuts);
230 hMesonBGCuts=new TH1F(Form("MesonBGCuts %s",GetCutNumber().Data()),"MesonBGCuts",13,-0.5,12.5);
231 hMesonBGCuts->GetXaxis()->SetBinLabel(1,"in");
232 hMesonBGCuts->GetXaxis()->SetBinLabel(2,"undef rapidity");
233 hMesonBGCuts->GetXaxis()->SetBinLabel(3,"rapidity cut");
234 hMesonBGCuts->GetXaxis()->SetBinLabel(4,"opening angle");
235 hMesonBGCuts->GetXaxis()->SetBinLabel(5,"alpha max");
236 hMesonBGCuts->GetXaxis()->SetBinLabel(6,"alpha min");
237 hMesonBGCuts->GetXaxis()->SetBinLabel(7,"dca gamma gamma");
238 hMesonBGCuts->GetXaxis()->SetBinLabel(8,"dca R prim Vtx");
239 hMesonBGCuts->GetXaxis()->SetBinLabel(9,"dca Z prim Vtx");
240 hMesonBGCuts->GetXaxis()->SetBinLabel(10,"out");
242 fHistograms->Add(hMesonBGCuts);
244 if (additionalHists){
245 hDCAGammaGammaMesonBefore=new TH1F(Form("DCAGammaGammaMeson Before %s",GetCutNumber().Data()),"DCAGammaGammaMeson Before",200,0,10);
246 fHistograms->Add(hDCAGammaGammaMesonBefore);
248 hDCARMesonPrimVtxBefore=new TH1F(Form("DCARMesonPrimVtx Before %s",GetCutNumber().Data()),"DCARMesonPrimVtx Before",200,0,10);
249 fHistograms->Add(hDCARMesonPrimVtxBefore);
251 hDCAZMesonPrimVtxBefore=new TH1F(Form("DCAZMesonPrimVtx Before %s",GetCutNumber().Data()),"DCAZMesonPrimVtx Before",401,-10,10);
252 fHistograms->Add(hDCAZMesonPrimVtxBefore);
256 hDCAGammaGammaMesonAfter=new TH1F(Form("DCAGammaGammaMeson After %s",GetCutNumber().Data()),"DCAGammaGammaMeson After",200,0,10);
257 fHistograms->Add(hDCAGammaGammaMesonAfter);
259 hDCAZMesonPrimVtxAfter=new TH2F(Form("InvMassDCAZMesonPrimVtx After %s",GetCutNumber().Data()),"InvMassDCAZMesonPrimVtx After",800,0,0.8,401,-10,10);
260 fHistograms->Add(hDCAZMesonPrimVtxAfter);
262 hDCARMesonPrimVtxAfter=new TH1F(Form("DCARMesonPrimVtx After %s",GetCutNumber().Data()),"DCARMesonPrimVtx After",200,0,10);
263 fHistograms->Add(hDCARMesonPrimVtxAfter);
265 TH1::AddDirectory(kTRUE);
268 //________________________________________________________________________
269 Bool_t AliConversionMesonCuts::MesonIsSelectedMC(TParticle *fMCMother,AliStack *fMCStack, Double_t fRapidityShift){
270 // Returns true for all pions within acceptance cuts for decay into 2 photons
271 // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
273 if(!fMCStack)return kFALSE;
275 if(fMCMother->GetPdgCode()==111 || fMCMother->GetPdgCode()==221){
276 if(fMCMother->R()>fMaxR) return kFALSE; // cuts on distance from collision point
278 Double_t rapidity = 10.;
279 if(fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0){
280 rapidity=8.-fRapidityShift;
282 rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
286 if(abs(rapidity)>fRapidityCutMeson)return kFALSE;
288 // Select only -> 2y decay channel
289 if(fMCMother->GetNDaughters()!=2)return kFALSE;
291 for(Int_t i=0;i<2;i++){
292 TParticle *MDaughter=fMCStack->Particle(fMCMother->GetDaughter(i));
293 // Is Daughter a Photon?
294 if(MDaughter->GetPdgCode()!=22)return kFALSE;
295 // Is Photon in Acceptance?
296 // if(bMCDaughtersInAcceptance){
297 // if(!PhotonIsSelectedMC(MDaughter,fMCStack)){return kFALSE;}
304 //________________________________________________________________________
305 Bool_t AliConversionMesonCuts::MesonIsSelectedAODMC(AliAODMCParticle *MCMother,TClonesArray *AODMCArray, Double_t fRapidityShift){
306 // Returns true for all pions within acceptance cuts for decay into 2 photons
307 // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
309 if(!AODMCArray)return kFALSE;
311 if(MCMother->GetPdgCode()==111 || MCMother->GetPdgCode()==221){
312 Double_t rMeson = sqrt( (MCMother->Xv()*MCMother->Xv()) + (MCMother->Yv()*MCMother->Yv()) ) ;
313 if(rMeson>fMaxR) return kFALSE; // cuts on distance from collision point
315 Double_t rapidity = 10.;
316 if(MCMother->E() - MCMother->Pz() == 0 || MCMother->E() + MCMother->Pz() == 0){
317 rapidity=8.-fRapidityShift;
319 rapidity = 0.5*(TMath::Log((MCMother->E()+MCMother->Pz()) / (MCMother->E()-MCMother->Pz())))-fRapidityShift;
323 if(abs(rapidity)>fRapidityCutMeson)return kFALSE;
325 // Select only -> 2y decay channel
326 if(MCMother->GetNDaughters()!=2)return kFALSE;
328 for(Int_t i=0;i<2;i++){
329 AliAODMCParticle *MDaughter=static_cast<AliAODMCParticle*>(AODMCArray->At(MCMother->GetDaughter(i)));
330 // Is Daughter a Photon?
331 if(MDaughter->GetPdgCode()!=22)return kFALSE;
332 // Is Photon in Acceptance?
333 // if(bMCDaughtersInAcceptance){
334 // if(!PhotonIsSelectedMC(MDaughter,fMCStack)){return kFALSE;}
342 //________________________________________________________________________
343 Bool_t AliConversionMesonCuts::MesonIsSelectedMCDalitz(TParticle *fMCMother,AliStack *fMCStack, Int_t &labelelectron, Int_t &labelpositron, Int_t &labelgamma, Double_t fRapidityShift){
345 // Returns true for all pions within acceptance cuts for decay into 2 photons
346 // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
348 if( !fMCStack )return kFALSE;
350 if( fMCMother->GetPdgCode() != 111 && fMCMother->GetPdgCode() != 221 ) return kFALSE;
352 if( fMCMother->R()>fMaxR ) return kFALSE; // cuts on distance from collision point
354 Double_t rapidity = 10.;
356 if( fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0 ){
357 rapidity=8.-fRapidityShift;
360 rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
364 if( abs(rapidity) > fRapidityCutMeson )return kFALSE;
366 // Select only -> Dalitz decay channel
367 if( fMCMother->GetNDaughters() != 3 )return kFALSE;
369 TParticle *positron = 0x0;
370 TParticle *electron = 0x0;
371 TParticle *gamma = 0x0;
373 for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
375 TParticle* temp = (TParticle*)fMCStack->Particle( index );
377 switch( temp->GetPdgCode() ) {
380 labelpositron = index;
384 labelelectron = index;
393 if( positron && electron && gamma) return kTRUE;
397 //________________________________________________________________________
398 Bool_t AliConversionMesonCuts::MesonIsSelectedMCEtaPiPlPiMiGamma(TParticle *fMCMother,AliStack *fMCStack, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelGamma, Double_t fRapidityShift){
400 // Returns true for all pions within acceptance cuts for decay into 2 photons
401 // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
403 if( !fMCStack )return kFALSE;
405 if( fMCMother->GetPdgCode() != 221 ) return kFALSE;
407 if( fMCMother->R()>fMaxR ) return kFALSE; // cuts on distance from collision point
409 Double_t rapidity = 10.;
411 if( fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0 ){
412 rapidity=8.-fRapidityShift;
415 rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
419 if( abs(rapidity) > fRapidityCutMeson )return kFALSE;
421 // Select only -> Dalitz decay channel
422 if( fMCMother->GetNDaughters() != 3 )return kFALSE;
424 TParticle *posPion = 0x0;
425 TParticle *negPion = 0x0;
426 TParticle *gamma = 0x0;
428 for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
430 TParticle* temp = (TParticle*)fMCStack->Particle( index );
432 switch( temp->GetPdgCode() ) {
435 labelPosPion = index;
439 labelNegPion = index;
448 if( posPion && negPion && gamma) return kTRUE;
452 //________________________________________________________________________
453 Bool_t AliConversionMesonCuts::MesonIsSelectedMCPiPlPiMiPiZero(TParticle *fMCMother,AliStack *fMCStack, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelNeutPion, Double_t fRapidityShift){
455 // Returns true for all pions within acceptance cuts for decay into 2 photons
456 // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
458 if( !fMCStack )return kFALSE;
460 if( !(fMCMother->GetPdgCode() == 221 || fMCMother->GetPdgCode() == 223) ) return kFALSE;
462 if( fMCMother->R()>fMaxR ) return kFALSE; // cuts on distance from collision point
464 Double_t rapidity = 10.;
466 if( fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0 ){
467 rapidity=8.-fRapidityShift;
470 rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
474 if( abs(rapidity) > fRapidityCutMeson )return kFALSE;
476 // Select only -> pi+ pi- pi0
477 if( fMCMother->GetNDaughters() != 3 )return kFALSE;
479 TParticle *posPion = 0x0;
480 TParticle *negPion = 0x0;
481 TParticle *neutPion = 0x0;
483 for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
485 TParticle* temp = (TParticle*)fMCStack->Particle( index );
486 switch( temp->GetPdgCode() ) {
489 labelPosPion = index;
493 labelNegPion = index;
497 labelNeutPion = index;
502 if( posPion && negPion && neutPion ) return kTRUE;
507 //________________________________________________________________________
508 Bool_t AliConversionMesonCuts::MesonIsSelectedMCChiC(TParticle *fMCMother,AliStack *fMCStack,Int_t & labelelectronChiC, Int_t & labelpositronChiC, Int_t & labelgammaChiC, Double_t fRapidityShift){
509 // Returns true for all ChiC within acceptance cuts for decay into JPsi + gamma -> e+ + e- + gamma
510 // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
512 if(!fMCStack)return kFALSE;
513 // if(fMCMother->GetPdgCode()==20443 ){
516 if(fMCMother->GetPdgCode()==10441 || fMCMother->GetPdgCode()==10443 || fMCMother->GetPdgCode()==445 ){
517 if(fMCMother->R()>fMaxR) return kFALSE; // cuts on distance from collision point
519 Double_t rapidity = 10.;
520 if(fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0){
521 rapidity=8.-fRapidityShift;
524 rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
528 if(abs(rapidity)>fRapidityCutMeson)return kFALSE;
530 // Select only -> ChiC radiative (JPsi+gamma) decay channel
531 if(fMCMother->GetNDaughters()!=2)return kFALSE;
533 TParticle *jpsi = 0x0;
534 TParticle *gamma = 0x0;
535 TParticle *positron = 0x0;
536 TParticle *electron = 0x0;
538 Int_t labeljpsiChiC = -1;
540 for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
542 TParticle* temp = (TParticle*)fMCStack->Particle( index );
544 switch( temp->GetPdgCode() ) {
547 labeljpsiChiC = index;
551 labelgammaChiC = index;
556 if ( !jpsi || ! gamma) return kFALSE;
557 if(jpsi->GetNDaughters()!=2)return kFALSE;
560 for(Int_t index= jpsi->GetFirstDaughter();index<= jpsi->GetLastDaughter();index++){
561 TParticle* temp = (TParticle*)fMCStack->Particle( index );
562 switch( temp->GetPdgCode() ) {
565 labelelectronChiC = index;
569 labelpositronChiC = index;
573 if( !electron || !positron) return kFALSE;
574 if( positron && electron && gamma) return kTRUE;
579 ///________________________________________________________________________
580 Bool_t AliConversionMesonCuts::MesonIsSelected(AliAODConversionMother *pi0,Bool_t IsSignal, Double_t fRapidityShift)
583 // Selection of reconstructed Meson candidates
584 // Use flag IsSignal in order to fill Fill different
585 // histograms for Signal and Background
588 if(IsSignal){hist=hMesonCuts;}
589 else{hist=hMesonBGCuts;}
593 if(hist)hist->Fill(cutIndex);
596 // Undefined Rapidity -> Floating Point exception
597 if((pi0->E()+pi0->Pz())/(pi0->E()-pi0->Pz())<=0){
598 if(hist)hist->Fill(cutIndex);
600 // cout << "undefined rapidity" << endl;
604 // PseudoRapidity Cut --> But we cut on Rapidity !!!
606 if(abs(pi0->Rapidity()-fRapidityShift)>fRapidityCutMeson){
607 if(hist)hist->Fill(cutIndex);
608 // cout << abs(pi0->Rapidity()-fRapidityShift) << ">" << fRapidityCutMeson << endl;
615 //fOpeningAngle=2*TMath::ATan(0.134/pi0->P());// physical minimum opening angle
616 if( pi0->GetOpeningAngle() < fOpeningAngle){
617 // cout << pi0->GetOpeningAngle() << "<" << fOpeningAngle << endl;
618 if(hist)hist->Fill(cutIndex);
623 if ( fAlphaPtDepCut == kTRUE ) {
625 fAlphaCutMeson = fFAlphaCut->Eval( pi0->Pt() );
630 if(pi0->GetAlpha()>fAlphaCutMeson){
631 // cout << pi0->GetAlpha() << ">" << fAlphaCutMeson << endl;
632 if(hist)hist->Fill(cutIndex);
638 if(pi0->GetAlpha()<fAlphaMinCutMeson){
639 // cout << pi0->GetAlpha() << "<" << fAlphaMinCutMeson << endl;
640 if(hist)hist->Fill(cutIndex);
645 if (hDCAGammaGammaMesonBefore)hDCAGammaGammaMesonBefore->Fill(pi0->GetDCABetweenPhotons());
646 if (hDCARMesonPrimVtxBefore)hDCARMesonPrimVtxBefore->Fill(pi0->GetDCARMotherPrimVtx());
648 if (pi0->GetDCABetweenPhotons() > fDCAGammaGammaCut){
649 // cout << pi0->GetDCABetweenPhotons() << ">" << fDCAGammaGammaCut << endl;
650 if(hist)hist->Fill(cutIndex);
655 if (pi0->GetDCARMotherPrimVtx() > fDCARMesonPrimVtxCut){
656 // cout << pi0->GetDCARMotherPrimVtx() << ">" << fDCARMesonPrimVtxCut << endl;
657 if(hist)hist->Fill(cutIndex);
663 if (hDCAZMesonPrimVtxBefore)hDCAZMesonPrimVtxBefore->Fill(pi0->GetDCAZMotherPrimVtx());
665 if (abs(pi0->GetDCAZMotherPrimVtx()) > fDCAZMesonPrimVtxCut){
666 // cout << pi0->GetDCAZMotherPrimVtx() << ">" << fDCAZMesonPrimVtxCut << endl;
667 if(hist)hist->Fill(cutIndex);
673 if (hDCAGammaGammaMesonAfter)hDCAGammaGammaMesonAfter->Fill(pi0->GetDCABetweenPhotons());
674 if (hDCARMesonPrimVtxAfter)hDCARMesonPrimVtxAfter->Fill(pi0->GetDCARMotherPrimVtx());
675 if (hDCAZMesonPrimVtxAfter)hDCAZMesonPrimVtxAfter->Fill(pi0->M(),pi0->GetDCAZMotherPrimVtx());
677 if(hist)hist->Fill(cutIndex);
683 ///________________________________________________________________________
684 ///________________________________________________________________________
685 Bool_t AliConversionMesonCuts::UpdateCutString() {
686 ///Update the cut string (if it has been created yet)
688 if(fCutString && fCutString->GetString().Length() == kNCuts) {
689 fCutString->SetString(GetCutNumber());
696 ///________________________________________________________________________
697 Bool_t AliConversionMesonCuts::InitializeCutsFromCutString(const TString analysisCutSelection ) {
698 // Initialize Cuts from a given Cut string
699 AliInfo(Form("Set Meson Cutnumber: %s",analysisCutSelection.Data()));
700 if(analysisCutSelection.Length()!=kNCuts) {
701 AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
704 if(!analysisCutSelection.IsDigit()){
705 AliError("Cut selection contains characters");
709 const char *cutSelection = analysisCutSelection.Data();
710 #define ASSIGNARRAY(i) fCuts[i] = cutSelection[i] - '0'
711 for(Int_t ii=0;ii<kNCuts;ii++){
715 // Set Individual Cuts
716 for(Int_t ii=0;ii<kNCuts;ii++){
717 if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
720 PrintCutsWithValues();
723 ///________________________________________________________________________
724 Bool_t AliConversionMesonCuts::SetCut(cutIds cutID, const Int_t value) {
725 ///Set individual cut ID
727 //cout << "Updating cut " << fgkCutNames[cutID] << " (" << cutID << ") to " << value << endl;
730 if( SetMesonKind(value)) {
731 fCuts[kMesonKind] = value;
734 } else return kFALSE;
736 if( SetChi2MesonCut(value)) {
737 fCuts[kchi2MesonCut] = value;
740 } else return kFALSE;
742 if( SetAlphaMesonCut(value)) {
743 fCuts[kalphaMesonCut] = value;
746 } else return kFALSE;
748 if( SetRCut(value)) {
749 fCuts[kRCut] = value;
752 } else return kFALSE;
754 case kRapidityMesonCut:
755 if( SetRapidityMesonCut(value)) {
756 fCuts[kRapidityMesonCut] = value;
759 } else return kFALSE;
761 case kBackgroundScheme:
762 if( SetBackgroundScheme(value)) {
763 fCuts[kBackgroundScheme] = value;
766 } else return kFALSE;
768 case kDegreesForRotationMethod:
769 if( SetNDegreesForRotationMethod(value)) {
770 fCuts[kDegreesForRotationMethod] = value;
773 } else return kFALSE;
775 case kNumberOfBGEvents:
776 if( SetNumberOfBGEvents(value)) {
777 fCuts[kNumberOfBGEvents] = value;
780 } else return kFALSE;
782 case kuseMCPSmearing:
783 if( SetMCPSmearing(value)) {
784 fCuts[kuseMCPSmearing] = value;
787 } else return kFALSE;
789 if( SetSharedElectronCut(value)) {
790 fCuts[kElecShare] = value;
793 } else return kFALSE;
795 if( SetToCloseV0sCut(value)) {
796 fCuts[kToCloseV0s] = value;
799 } else return kFALSE;
801 if( SetDCAGammaGammaCut(value)) {
802 fCuts[kDcaGammaGamma] = value;
805 } else return kFALSE;
807 if( SetDCAZMesonPrimVtxCut(value)) {
808 fCuts[kDcaZPrimVtx] = value;
811 } else return kFALSE;
813 if( SetDCARMesonPrimVtxCut(value)) {
814 fCuts[kDcaRPrimVtx] = value;
817 } else return kFALSE;
820 cout << "Error:: Cut id out of range"<< endl;
824 cout << "Error:: Cut id " << cutID << " not recognized "<< endl;
830 ///________________________________________________________________________
831 void AliConversionMesonCuts::PrintCuts() {
832 // Print out current Cut Selection
833 for(Int_t ic = 0; ic < kNCuts; ic++) {
834 printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
838 ///________________________________________________________________________
839 void AliConversionMesonCuts::PrintCutsWithValues() {
840 // Print out current Cut Selection with values
841 printf("\nMeson cutnumber \n");
842 for(Int_t ic = 0; ic < kNCuts; ic++) {
843 printf("%d",fCuts[ic]);
847 printf("Meson cuts \n");
848 printf("\t |y| < %3.2f \n", fRapidityCutMeson);
849 printf("\t theta_{open} < %3.2f\n", fOpeningAngle);
850 if (!fAlphaPtDepCut) printf("\t %3.2f < alpha < %3.2f\n", fAlphaMinCutMeson, fAlphaCutMeson);
851 printf("\t dca_{gamma,gamma} > %3.2f\n", fDCAGammaGammaCut);
852 printf("\t dca_{R, prim Vtx} > %3.2f\n", fDCARMesonPrimVtxCut);
853 printf("\t dca_{Z, prim Vtx} > %3.2f\n\n", fDCAZMesonPrimVtxCut);
855 printf("Meson BG settings \n");
857 if (!fUseRotationMethodInBG & !fUseTrackMultiplicityForBG) printf("\t BG scheme: mixing V0 mult \n");
858 if (!fUseRotationMethodInBG & fUseTrackMultiplicityForBG) printf("\t BG scheme: mixing track mult \n");
859 if (fUseRotationMethodInBG )printf("\t BG scheme: rotation \n");
860 if (fdoBGProbability) printf("\t -> use BG probability \n");
861 if (fBackgroundHandler) printf("\t -> use new BG handler \n");
862 printf("\t depth of pool: %d\n", fNumberOfBGEvents);
863 if (fUseRotationMethodInBG )printf("\t degree's for BG rotation: %d\n", fnDegreeRotationPMForBG);
869 ///________________________________________________________________________
870 Bool_t AliConversionMesonCuts::SetMesonKind(Int_t mesonKind){
880 cout<<"Warning: Meson kind not defined"<<mesonKind<<endl;
886 ///________________________________________________________________________
887 Bool_t AliConversionMesonCuts::SetRCut(Int_t rCut){
908 // High purity cuts for PbPb
913 cout<<"Warning: rCut not defined"<<rCut<<endl;
919 ///________________________________________________________________________
920 Bool_t AliConversionMesonCuts::SetChi2MesonCut(Int_t chi2MesonCut){
922 switch(chi2MesonCut){
924 fChi2CutMeson = 100.;
933 fChi2CutMeson = 200.;
936 fChi2CutMeson = 500.;
939 fChi2CutMeson = 1000.;
942 cout<<"Warning: Chi2MesonCut not defined "<<chi2MesonCut<<endl;
949 ///________________________________________________________________________
950 Bool_t AliConversionMesonCuts::SetAlphaMesonCut(Int_t alphaMesonCut)
952 switch(alphaMesonCut){
954 fAlphaMinCutMeson = 0.0;
955 fAlphaCutMeson = 0.7;
956 fAlphaPtDepCut = kFALSE;
958 case 1: // Updated 31 October 2013 before 0.0 - 0.5
959 if( fFAlphaCut ) delete fFAlphaCut;
960 fFAlphaCut= new TF1("fFAlphaCut","[0]*tanh([1]*x)",0.,100.);
961 fFAlphaCut->SetParameter(0,0.7);
962 fFAlphaCut->SetParameter(1,1.2);
963 fAlphaMinCutMeson = 0.0;
964 fAlphaCutMeson = -1.0;
965 fAlphaPtDepCut = kTRUE;
967 case 2: // Updated 31 October 2013 before 0.5-1
968 if( fFAlphaCut ) delete fFAlphaCut;
969 fFAlphaCut= new TF1("fFAlphaCut","[0]*tanh([1]*x)",0.,100.);
970 fFAlphaCut->SetParameter(0,0.8);
971 fFAlphaCut->SetParameter(1,1.2);
972 fAlphaMinCutMeson = 0.0;
973 fAlphaCutMeson = -1.0;
974 fAlphaPtDepCut = kTRUE;
977 fAlphaMinCutMeson = 0.0;
979 fAlphaPtDepCut = kFALSE;
982 fAlphaMinCutMeson = 0.0;
983 fAlphaCutMeson = 0.65;
984 fAlphaPtDepCut = kFALSE;
987 fAlphaMinCutMeson = 0.0;
988 fAlphaCutMeson = 0.75;
989 fAlphaPtDepCut = kFALSE;
992 fAlphaMinCutMeson = 0.0;
993 fAlphaCutMeson = 0.8;
994 fAlphaPtDepCut = kFALSE;
997 fAlphaMinCutMeson = 0.0;
998 fAlphaCutMeson = 0.85;
999 fAlphaPtDepCut = kFALSE;
1002 fAlphaMinCutMeson = 0.0;
1003 fAlphaCutMeson = 0.6;
1004 fAlphaPtDepCut = kFALSE;
1006 case 9: // Updated 11 November 2013 before 0.0 - 0.3
1007 if( fFAlphaCut ) delete fFAlphaCut;
1008 fFAlphaCut= new TF1("fFAlphaCut","[0]*tanh([1]*x)",0.,100.);
1009 fFAlphaCut->SetParameter(0,0.65);
1010 fFAlphaCut->SetParameter(1,1.2);
1011 fAlphaMinCutMeson = 0.0;
1012 fAlphaCutMeson = -1.0;
1013 fAlphaPtDepCut = kTRUE;
1016 cout<<"Warning: AlphaMesonCut not defined "<<alphaMesonCut<<endl;
1022 ///________________________________________________________________________
1023 Bool_t AliConversionMesonCuts::SetRapidityMesonCut(Int_t RapidityMesonCut){
1025 switch(RapidityMesonCut){
1026 case 0: // changed from 0.9 to 1.35
1027 fRapidityCutMeson = 1.35;
1030 fRapidityCutMeson = 0.8;
1033 fRapidityCutMeson = 0.7;
1036 fRapidityCutMeson = 0.6;
1039 fRapidityCutMeson = 0.5;
1042 fRapidityCutMeson = 0.85;
1045 fRapidityCutMeson = 0.75;
1048 fRapidityCutMeson = 0.3;
1050 case 8: //changed, before 0.35
1051 fRapidityCutMeson = 0.25;
1054 fRapidityCutMeson = 0.4;
1057 cout<<"Warning: RapidityMesonCut not defined "<<RapidityMesonCut<<endl;
1064 ///________________________________________________________________________
1065 Bool_t AliConversionMesonCuts::SetBackgroundScheme(Int_t BackgroundScheme){
1067 switch(BackgroundScheme){
1069 fUseRotationMethodInBG=kTRUE;
1070 fdoBGProbability=kFALSE;
1072 case 1: // mixed event with V0 multiplicity
1073 fUseRotationMethodInBG=kFALSE;
1074 fUseTrackMultiplicityForBG=kFALSE;
1075 fdoBGProbability=kFALSE;
1077 case 2: // mixed event with track multiplicity
1078 fUseRotationMethodInBG=kFALSE;
1079 fUseTrackMultiplicityForBG=kTRUE;
1080 fdoBGProbability=kFALSE;
1083 fUseRotationMethodInBG=kTRUE;
1084 fdoBGProbability=kTRUE;
1086 case 4: //No BG calculation
1087 cout << "no BG calculation should be done" << endl;
1088 fUseRotationMethodInBG=kFALSE;
1089 fdoBGProbability=kFALSE;
1093 fUseRotationMethodInBG=kTRUE;
1094 fdoBGProbability=kFALSE;
1095 fBackgroundHandler = 1;
1097 case 6: // mixed event with V0 multiplicity
1098 fUseRotationMethodInBG=kFALSE;
1099 fUseTrackMultiplicityForBG=kFALSE;
1100 fdoBGProbability=kFALSE;
1101 fBackgroundHandler = 1;
1103 case 7: // mixed event with track multiplicity
1104 fUseRotationMethodInBG=kFALSE;
1105 fUseTrackMultiplicityForBG=kTRUE;
1106 fdoBGProbability=kFALSE;
1107 fBackgroundHandler = 1;
1110 fUseRotationMethodInBG=kTRUE;
1111 fdoBGProbability=kTRUE;
1112 fBackgroundHandler = 1;
1115 cout<<"Warning: BackgroundScheme not defined "<<BackgroundScheme<<endl;
1122 ///________________________________________________________________________
1123 Bool_t AliConversionMesonCuts::SetNDegreesForRotationMethod(Int_t DegreesForRotationMethod){
1125 switch(DegreesForRotationMethod){
1127 fnDegreeRotationPMForBG = 5;
1130 fnDegreeRotationPMForBG = 10;
1133 fnDegreeRotationPMForBG = 15;
1136 fnDegreeRotationPMForBG = 20;
1139 cout<<"Warning: DegreesForRotationMethod not defined "<<DegreesForRotationMethod<<endl;
1142 fCuts[kDegreesForRotationMethod]=DegreesForRotationMethod;
1146 ///________________________________________________________________________
1147 Bool_t AliConversionMesonCuts::SetNumberOfBGEvents(Int_t NumberOfBGEvents){
1149 switch(NumberOfBGEvents){
1151 fNumberOfBGEvents = 5;
1154 fNumberOfBGEvents = 10;
1157 fNumberOfBGEvents = 15;
1160 fNumberOfBGEvents = 20;
1163 fNumberOfBGEvents = 2;
1166 fNumberOfBGEvents = 50;
1169 fNumberOfBGEvents = 80;
1172 fNumberOfBGEvents = 100;
1175 cout<<"Warning: NumberOfBGEvents not defined "<<NumberOfBGEvents<<endl;
1180 ///________________________________________________________________________
1181 Bool_t AliConversionMesonCuts::SetSharedElectronCut(Int_t sharedElec) {
1185 fDoSharedElecCut = kFALSE;
1188 fDoSharedElecCut = kTRUE;
1191 cout<<"Warning: Shared Electron Cut not defined "<<sharedElec<<endl;
1198 ///________________________________________________________________________
1199 Bool_t AliConversionMesonCuts::SetToCloseV0sCut(Int_t toClose) {
1203 fDoToCloseV0sCut = kFALSE;
1207 fDoToCloseV0sCut = kTRUE;
1211 fDoToCloseV0sCut = kTRUE;
1215 fDoToCloseV0sCut = kTRUE;
1219 cout<<"Warning: Shared Electron Cut not defined "<<toClose<<endl;
1225 ///________________________________________________________________________
1226 Bool_t AliConversionMesonCuts::SetMCPSmearing(Int_t useMCPSmearing)
1228 switch(useMCPSmearing){
1233 fPSigSmearingCte=0.;
1237 fPBremSmearing=1.0e-14;
1239 fPSigSmearingCte=0.;
1243 fPBremSmearing=1.0e-15;
1245 fPSigSmearingCte=0.;
1250 fPSigSmearing=0.003;
1251 fPSigSmearingCte=0.002;
1256 fPSigSmearing=0.003;
1257 fPSigSmearingCte=0.007;
1262 fPSigSmearing=0.003;
1263 fPSigSmearingCte=0.016;
1268 fPSigSmearing=0.007;
1269 fPSigSmearingCte=0.016;
1273 fPBremSmearing=1.0e-16;
1275 fPSigSmearingCte=0.;
1280 fPSigSmearing=0.007;
1281 fPSigSmearingCte=0.014;
1286 fPSigSmearing=0.007;
1287 fPSigSmearingCte=0.011;
1291 AliError("Warning: UseMCPSmearing not defined");
1298 ///________________________________________________________________________
1299 Bool_t AliConversionMesonCuts::SetDCAGammaGammaCut(Int_t DCAGammaGamma){
1301 switch(DCAGammaGamma){
1303 fDCAGammaGammaCut = 1000;
1306 fDCAGammaGammaCut = 10;
1309 fDCAGammaGammaCut = 5;
1312 fDCAGammaGammaCut = 4;
1315 fDCAGammaGammaCut = 3;
1318 fDCAGammaGammaCut = 2.5;
1321 fDCAGammaGammaCut = 2;
1324 fDCAGammaGammaCut = 1.5;
1327 fDCAGammaGammaCut = 1;
1330 fDCAGammaGammaCut = 0.5;
1333 cout<<"Warning: DCAGammaGamma not defined "<<DCAGammaGamma<<endl;
1339 ///________________________________________________________________________
1340 Bool_t AliConversionMesonCuts::SetDCAZMesonPrimVtxCut(Int_t DCAZMesonPrimVtx){
1342 switch(DCAZMesonPrimVtx){
1344 fDCAZMesonPrimVtxCut = 1000;
1347 fDCAZMesonPrimVtxCut = 10;
1350 fDCAZMesonPrimVtxCut = 5;
1353 fDCAZMesonPrimVtxCut = 4;
1356 fDCAZMesonPrimVtxCut = 3;
1359 fDCAZMesonPrimVtxCut = 2.5;
1362 fDCAZMesonPrimVtxCut = 2;
1365 fDCAZMesonPrimVtxCut = 1.5;
1368 fDCAZMesonPrimVtxCut = 1;
1371 fDCAZMesonPrimVtxCut = 0.5;
1374 cout<<"Warning: DCAZMesonPrimVtx not defined "<<DCAZMesonPrimVtx<<endl;
1380 ///________________________________________________________________________
1381 Bool_t AliConversionMesonCuts::SetDCARMesonPrimVtxCut(Int_t DCARMesonPrimVtx){
1383 switch(DCARMesonPrimVtx){
1385 fDCARMesonPrimVtxCut = 1000;
1388 fDCARMesonPrimVtxCut = 10;
1391 fDCARMesonPrimVtxCut = 5;
1394 fDCARMesonPrimVtxCut = 4;
1397 fDCARMesonPrimVtxCut = 3;
1400 fDCARMesonPrimVtxCut = 2.5;
1403 fDCARMesonPrimVtxCut = 2;
1406 fDCARMesonPrimVtxCut = 1.5;
1409 fDCARMesonPrimVtxCut = 1;
1412 fDCARMesonPrimVtxCut = 0.5;
1415 cout<<"Warning: DCARMesonPrimVtx not defined "<<DCARMesonPrimVtx<<endl;
1422 ///________________________________________________________________________
1423 TString AliConversionMesonCuts::GetCutNumber(){
1424 // returns TString with current cut number
1426 for(Int_t ii=0;ii<kNCuts;ii++){
1427 a.Append(Form("%d",fCuts[ii]));
1432 ///________________________________________________________________________
1433 void AliConversionMesonCuts::FillElectonLabelArray(AliAODConversionPhoton* photon, Int_t nV0){
1435 Int_t posLabel = photon->GetTrackLabelPositive();
1436 Int_t negLabel = photon->GetTrackLabelNegative();
1438 fElectronLabelArray[nV0*2] = posLabel;
1439 fElectronLabelArray[(nV0*2)+1] = negLabel;
1442 ///________________________________________________________________________
1443 Bool_t AliConversionMesonCuts::RejectSharedElectronV0s(AliAODConversionPhoton* photon, Int_t nV0, Int_t nV0s){
1445 Int_t posLabel = photon->GetTrackLabelPositive();
1446 Int_t negLabel = photon->GetTrackLabelNegative();
1448 for(Int_t i = 0; i<nV0s*2;i++){
1449 if(i==nV0*2) continue;
1450 if(i==(nV0*2)+1) continue;
1451 if(fElectronLabelArray[i] == posLabel){
1453 if(fElectronLabelArray[i] == negLabel){
1459 ///________________________________________________________________________
1460 Bool_t AliConversionMesonCuts::RejectToCloseV0s(AliAODConversionPhoton* photon, TList *photons, Int_t nV0){
1461 Double_t posX = photon->GetConversionX();
1462 Double_t posY = photon->GetConversionY();
1463 Double_t posZ = photon->GetConversionZ();
1465 for(Int_t i = 0;i<photons->GetEntries();i++){
1466 if(nV0 == i) continue;
1467 AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
1468 Double_t posCompX = photonComp->GetConversionX();
1469 Double_t posCompY = photonComp->GetConversionY();
1470 Double_t posCompZ = photonComp->GetConversionZ();
1472 Double_t dist = pow((posX - posCompX),2)+pow((posY - posCompY),2)+pow((posZ - posCompZ),2);
1474 if(dist < fminV0Dist*fminV0Dist){
1475 if(photon->GetChi2perNDF() < photonComp->GetChi2perNDF()) return kTRUE;
1484 ///________________________________________________________________________
1485 void AliConversionMesonCuts::SmearParticle(AliAODConversionPhoton* photon)
1488 if (photon==NULL) return;
1489 Double_t facPBrem = 1.;
1490 Double_t facPSig = 0.;
1499 if( photon->P()!=0){
1500 theta=acos( photon->Pz()/ photon->P());
1503 if( fPSigSmearing != 0. || fPSigSmearingCte!=0. ){
1504 facPSig = TMath::Sqrt(fPSigSmearingCte*fPSigSmearingCte+fPSigSmearing*fPSigSmearing*P*P)*fRandom.Gaus(0.,1.);
1507 if( fPBremSmearing != 1.){
1509 facPBrem = fBrem->GetRandom();
1513 photon->SetPx(facPBrem* (1+facPSig)* P*sin(theta)*cos(phi)) ;
1514 photon->SetPy(facPBrem* (1+facPSig)* P*sin(theta)*sin(phi)) ;
1515 photon->SetPz(facPBrem* (1+facPSig)* P*cos(theta)) ;
1516 photon->SetE(photon->P());
1518 ///________________________________________________________________________
1519 void AliConversionMesonCuts::SmearVirtualPhoton(AliAODConversionPhoton* photon)
1522 if (photon==NULL) return;
1523 Double_t facPBrem = 1.;
1524 Double_t facPSig = 0.;
1533 if( photon->P()!=0){
1534 theta=acos( photon->Pz()/ photon->P());
1537 if( fPSigSmearing != 0. || fPSigSmearingCte!=0. ){
1538 facPSig = TMath::Sqrt(fPSigSmearingCte*fPSigSmearingCte+fPSigSmearing*fPSigSmearing*P*P)*fRandom.Gaus(0.,1.);
1541 if( fPBremSmearing != 1.){
1543 facPBrem = fBrem->GetRandom();
1547 photon->SetPx(facPBrem* (1+facPSig)* P*sin(theta)*cos(phi)) ;
1548 photon->SetPy(facPBrem* (1+facPSig)* P*sin(theta)*sin(phi)) ;
1549 photon->SetPz(facPBrem* (1+facPSig)* P*cos(theta)) ;
1552 ///________________________________________________________________________
1553 TLorentzVector AliConversionMesonCuts::SmearElectron(TLorentzVector particle)
1556 //if (particle==0) return;
1557 Double_t facPBrem = 1.;
1558 Double_t facPSig = 0.;
1569 if (phi < 0.) phi += 2. * TMath::Pi();
1571 if( particle.P()!=0){
1572 theta=acos( particle.Pz()/ particle.P());
1576 Double_t fPSigSmearingHalf = fPSigSmearing / 2.0; //The parameter was set for gammas with 2 particles and here we have just one electron
1577 Double_t sqrtfPSigSmearingCteHalf = fPSigSmearingCte / 2.0 ; //The parameter was set for gammas with 2 particles and here we have just one electron
1581 if( fPSigSmearingHalf != 0. || sqrtfPSigSmearingCteHalf!=0. ){
1582 facPSig = TMath::Sqrt(sqrtfPSigSmearingCteHalf*sqrtfPSigSmearingCteHalf+fPSigSmearingHalf*fPSigSmearingHalf*P*P)*fRandom.Gaus(0.,1.);
1585 if( fPBremSmearing != 1.){
1587 facPBrem = fBrem->GetRandom();
1591 TLorentzVector SmearedParticle;
1593 SmearedParticle.SetXYZM( facPBrem* (1+facPSig)* P*sin(theta)*cos(phi) , facPBrem* (1+facPSig)* P*sin(theta)*sin(phi) ,
1594 facPBrem* (1+facPSig)* P*cos(theta) , TDatabasePDG::Instance()->GetParticle( ::kElectron )->Mass()) ;
1596 //particle.SetPx(facPBrem* (1+facPSig)* P*sin(theta)*cos(phi)) ;
1597 //particle.SetPy(facPBrem* (1+facPSig)* P*sin(theta)*sin(phi)) ;
1598 //particle.SetPz(facPBrem* (1+facPSig)* P*cos(theta)) ;
1600 return SmearedParticle;