AliPhysics  b752f14 (b752f14)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliConversionMesonCuts.cxx
Go to the documentation of this file.
1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Authors: Svein Lindal, Daniel Lohner *
5 * Version 1.0 *
6 * *
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 **************************************************************************/
15 
17 //---------------------------------------------
18 // Class handling all kinds of selection cuts for
19 // Gamma Conversion analysis
20 //---------------------------------------------
22 
23 #include "AliConversionMesonCuts.h"
24 
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"
33 #include "TH1.h"
34 #include "TH2.h"
35 #include "AliStack.h"
36 #include "AliAODConversionMother.h"
37 #include "TObjString.h"
38 #include "AliAODEvent.h"
39 #include "AliESDEvent.h"
40 #include "AliCentrality.h"
41 #include "TList.h"
42 #include "TPDGCode.h"
43 #include "TDatabasePDG.h"
44 #include "AliAODMCParticle.h"
45 
46 class iostream;
47 
48 using namespace std;
49 
53 
54 
55 const char* AliConversionMesonCuts::fgkCutNames[AliConversionMesonCuts::kNCuts] = {
56  "MesonKind", //0
57  "BackgroundScheme", //1
58  "NumberOfBGEvents", //2
59  "DegreesForRotationMethod", //3
60  "RapidityMesonCut", //4
61  "RCut", //5
62  "AlphaMesonCut", //6
63  "SelectionWindow", //7
64  "SharedElectronCuts", //8
65  "RejectToCloseV0s", //9
66  "UseMCPSmearing", //10
67  "DcaGammaGamma", //11
68  "DcaRPrimVtx", //12
69  "DcaZPrimVtx", //13
70  "MinOpanMesonCut", //14
71  "MaxOpanMesonCut" //15
72 };
73 
74 
75 //________________________________________________________________________
77  AliAnalysisCuts(name,title),
78  fHistograms(NULL),
79  fDoLightOutput(kFALSE),
80  fMode(0),
81  fCaloPhotonCuts(NULL),
82  fMesonKind(0),
83  fIsMergedClusterCut(0),
84  fMaxR(200),
85  fEnableMassCut(kFALSE),
86  fSelectionLow(0.08),
87  fSelectionHigh(0.145),
88  fSelectionWindowCut(-1),
89  fAlphaMinCutMeson(0),
90  fAlphaCutMeson(1),
91  fRapidityCutMeson(1),
92  fUseRotationMethodInBG(kFALSE),
93  fUsePtmaxMethodForBG(kFALSE),
94  fDoBG(kTRUE),
95  fdoBGProbability(kFALSE),
96  fUseTrackMultiplicityForBG(kFALSE),
97  fnDegreeRotationPMForBG(0),
98  fNumberOfBGEvents(0),
99  fOpeningAngle(0.005),
100  fEnableMinOpeningAngleCut(kTRUE),
101  fEnableOneCellDistCut(kFALSE),
102  fDoToCloseV0sCut(kFALSE),
103  fminV0Dist(200.),
104  fDoSharedElecCut(kFALSE),
105  fUseMCPSmearing(kFALSE),
106  fPBremSmearing(0),
107  fPSigSmearing(0),
108  fPSigSmearingCte(0),
109  fBrem(NULL),
110  fRandom(0),
111  fFAlphaCut(0),
112  fAlphaPtDepCut(kFALSE),
113  fElectronLabelArraySize(500),
114  fElectronLabelArray(NULL),
115  fDCAGammaGammaCut(1000),
116  fDCAZMesonPrimVtxCut(1000),
117  fDCARMesonPrimVtxCut(1000),
118  fDCAGammaGammaCutOn(kFALSE),
119  fDCAZMesonPrimVtxCutOn(kFALSE),
120  fDCARMesonPrimVtxCutOn(kFALSE),
121  fMinOpanCutMeson(0),
122  fFMinOpanCut(0),
123  fMinOpanPtDepCut(kFALSE),
124  fMaxOpanCutMeson(TMath::Pi()),
125  fFMaxOpanCut(0),
126  fMaxOpanPtDepCut(kFALSE),
127  fCutString(NULL),
128  fCutStringRead(""),
129  fBackgroundHandler(0),
130  fHistoMesonCuts(NULL),
131  fHistoMesonBGCuts(NULL),
132  fHistoDCAGGMesonBefore(NULL),
133  fHistoDCAZMesonPrimVtxBefore(NULL),
134  fHistoDCARMesonPrimVtxBefore(NULL),
135  fHistoDCAGGMesonAfter(NULL),
136  fHistoDCAZMesonPrimVtxAfter(NULL),
137  fHistoDCARMesonPrimVtxAfter(NULL),
138  fHistoInvMassBefore(NULL),
139  fHistoInvMassAfter(NULL)
140 {
141  for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;}
142  fCutString=new TObjString((GetCutNumber()).Data());
144  if (fBrem == NULL){
145  fBrem = new TF1("fBrem","pow(-log(x),[0]/log(2.0)-1.0)/TMath::Gamma([0]/log(2.0))",0.00001,0.999999999);
146  // tests done with 1.0e-14
147  fBrem->SetParameter(0,fPBremSmearing);
148  fBrem->SetNpx(100000);
149  }
150 
151 }
152 
153 //________________________________________________________________________
155  AliAnalysisCuts(ref),
156  fHistograms(NULL),
157  fDoLightOutput(ref.fDoLightOutput),
158  fMode(ref.fMode),
159  fCaloPhotonCuts(ref.fCaloPhotonCuts),
160  fMesonKind(ref.fMesonKind),
161  fIsMergedClusterCut(ref.fIsMergedClusterCut),
162  fMaxR(ref.fMaxR),
163  fEnableMassCut(ref.fEnableMassCut),
164  fSelectionLow(ref.fSelectionLow),
165  fSelectionHigh(ref.fSelectionHigh),
166  fSelectionWindowCut(-1),
167  fAlphaMinCutMeson(ref.fAlphaMinCutMeson),
168  fAlphaCutMeson(ref.fAlphaCutMeson),
169  fRapidityCutMeson(ref.fRapidityCutMeson),
170  fUseRotationMethodInBG(ref.fUseRotationMethodInBG),
171  fUsePtmaxMethodForBG(ref.fUsePtmaxMethodForBG),
172  fDoBG(ref.fDoBG),
173  fdoBGProbability(ref.fdoBGProbability),
174  fUseTrackMultiplicityForBG(ref.fUseTrackMultiplicityForBG),
175  fnDegreeRotationPMForBG(ref.fnDegreeRotationPMForBG),
176  fNumberOfBGEvents(ref. fNumberOfBGEvents),
177  fOpeningAngle(ref.fOpeningAngle),
178  fEnableMinOpeningAngleCut(ref.fEnableMinOpeningAngleCut),
179  fEnableOneCellDistCut(ref.fEnableOneCellDistCut),
180  fDoToCloseV0sCut(ref.fDoToCloseV0sCut),
181  fminV0Dist(ref.fminV0Dist),
182  fDoSharedElecCut(ref.fDoSharedElecCut),
183  fUseMCPSmearing(ref.fUseMCPSmearing),
184  fPBremSmearing(ref.fPBremSmearing),
185  fPSigSmearing(ref.fPSigSmearing),
186  fPSigSmearingCte(ref.fPSigSmearingCte),
187  fBrem(NULL),
188  fRandom(ref.fRandom),
189  fFAlphaCut(NULL),
190  fAlphaPtDepCut(ref.fAlphaPtDepCut),
191  fElectronLabelArraySize(ref.fElectronLabelArraySize),
192  fElectronLabelArray(NULL),
193  fDCAGammaGammaCut(ref.fDCAGammaGammaCut),
194  fDCAZMesonPrimVtxCut(ref.fDCAZMesonPrimVtxCut),
195  fDCARMesonPrimVtxCut(ref.fDCARMesonPrimVtxCut),
196  fDCAGammaGammaCutOn(ref.fDCAGammaGammaCutOn),
197  fDCAZMesonPrimVtxCutOn(ref.fDCAZMesonPrimVtxCutOn),
198  fDCARMesonPrimVtxCutOn(ref.fDCARMesonPrimVtxCutOn),
199  fBackgroundHandler(ref.fBackgroundHandler),
200  fFMinOpanCut(0),
201  fMinOpanPtDepCut(kFALSE),
202  fMaxOpanCutMeson(TMath::Pi()),
203  fFMaxOpanCut(0),
204  fMaxOpanPtDepCut(kFALSE),
205  fMinOpanCutMeson(0),
206  fCutString(NULL),
207  fCutStringRead(""),
208  fHistoMesonCuts(NULL),
209  fHistoMesonBGCuts(NULL),
210  fHistoDCAGGMesonBefore(NULL),
211  fHistoDCAZMesonPrimVtxBefore(NULL),
212  fHistoDCARMesonPrimVtxBefore(NULL),
213  fHistoDCAGGMesonAfter(NULL),
214  fHistoDCAZMesonPrimVtxAfter(NULL),
215  fHistoDCARMesonPrimVtxAfter(NULL),
216  fHistoInvMassBefore(NULL),
217  fHistoInvMassAfter(NULL)
218 {
219  // Copy Constructor
220  for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=ref.fCuts[jj];}
221  fCutString=new TObjString((GetCutNumber()).Data());
223  if (fBrem == NULL)fBrem = (TF1*)ref.fBrem->Clone("fBrem");
224  // Histograms are not copied, if you need them, call InitCutHistograms
225 }
226 
227 
228 //________________________________________________________________________
230  // Destructor
231  //Deleting fHistograms leads to seg fault it it's added to output collection of a task
232  // if(fHistograms)
233  // delete fHistograms;
234  // fHistograms = NULL;
235  if(fCutString != NULL){
236  delete fCutString;
237  fCutString = NULL;
238  }
240  delete fElectronLabelArray;
241  fElectronLabelArray = NULL;
242  }
243 
244  if(fFAlphaCut != NULL){
245  delete fFAlphaCut;
246  fFAlphaCut = NULL;
247  }
248  if(fBrem != NULL){
249  delete fBrem;
250  fBrem = NULL;
251  }
252  if(fFMinOpanCut != NULL){
253  delete fFMinOpanCut;
254  fFMinOpanCut = NULL;
255  }
256  if(fFMaxOpanCut != NULL){
257  delete fFMaxOpanCut;
258  fFMaxOpanCut = NULL;
259  }
260 }
261 
262 //________________________________________________________________________
264 
265  // Initialize Cut Histograms for QA (only initialized and filled if function is called)
266  TH1::AddDirectory(kFALSE);
267 
268  if(fHistograms != NULL){
269  delete fHistograms;
270  fHistograms=NULL;
271  }
272  if(fHistograms==NULL){
273  fHistograms=new TList();
274  fHistograms->SetOwner(kTRUE);
275  if(name=="")fHistograms->SetName(Form("ConvMesonCuts_%s",GetCutNumber().Data()));
276  else fHistograms->SetName(Form("%s_%s",name.Data(),GetCutNumber().Data()));
277  }
278 
279  // Meson Cuts
280  if (fIsMergedClusterCut == 1){
281  fHistoMesonCuts=new TH2F(Form("MesonCuts %s",GetCutNumber().Data()),"MesonCuts vs Pt",8,-0.5,7.5, 500, 0, 100);
282  fHistoMesonCuts->GetXaxis()->SetBinLabel(1,"in");
283  fHistoMesonCuts->GetXaxis()->SetBinLabel(2,"undef rapidity");
284  fHistoMesonCuts->GetXaxis()->SetBinLabel(3,"rapidity cut");
285  fHistoMesonCuts->GetXaxis()->SetBinLabel(4,"mass cut");
286  fHistoMesonCuts->GetXaxis()->SetBinLabel(5,"opening angle");
287  fHistoMesonCuts->GetXaxis()->SetBinLabel(6,"alpha max");
288  fHistoMesonCuts->GetXaxis()->SetBinLabel(7,"alpha min");
289  fHistoMesonCuts->GetXaxis()->SetBinLabel(8,"out");
291  } else if (fIsMergedClusterCut == 2){
292  fHistoMesonCuts=new TH2F(Form("MesonCuts %s",GetCutNumber().Data()),"MesonCuts vs Pt",8,-0.5,7.5, 250, 0, 50);
293  fHistoMesonCuts->GetXaxis()->SetBinLabel(1,"in");
294  fHistoMesonCuts->GetXaxis()->SetBinLabel(2,"undef rapidity");
295  fHistoMesonCuts->GetXaxis()->SetBinLabel(3,"rapidity cut");
296  fHistoMesonCuts->GetXaxis()->SetBinLabel(4,"1 cell distance");
297  fHistoMesonCuts->GetXaxis()->SetBinLabel(5,"opening angle");
298  fHistoMesonCuts->GetXaxis()->SetBinLabel(6,"alpha max");
299  fHistoMesonCuts->GetXaxis()->SetBinLabel(7,"alpha min");
300  fHistoMesonCuts->GetXaxis()->SetBinLabel(8,"out");
302 
303  fHistoMesonBGCuts=new TH2F(Form("MesonBGCuts %s",GetCutNumber().Data()),"MesonBGCuts vs Pt",8,-0.5,7.5, 250, 0, 50);
304  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(1,"in");
305  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(2,"undef rapidity");
306  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(3,"rapidity cut");
307  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(4,"1 cell distance");
308  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(5,"opening angle");
309  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(6,"alpha max");
310  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(7,"alpha min");
311  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(8,"out");
313  } else {
314  fHistoMesonCuts=new TH2F(Form("MesonCuts %s",GetCutNumber().Data()),"MesonCuts vs Pt",10,-0.5,9.5, 250, 0, 50);
315  fHistoMesonCuts->GetXaxis()->SetBinLabel(1,"in");
316  fHistoMesonCuts->GetXaxis()->SetBinLabel(2,"undef rapidity");
317  fHistoMesonCuts->GetXaxis()->SetBinLabel(3,"rapidity cut");
318  fHistoMesonCuts->GetXaxis()->SetBinLabel(4,"opening angle");
319  fHistoMesonCuts->GetXaxis()->SetBinLabel(5,"alpha max");
320  fHistoMesonCuts->GetXaxis()->SetBinLabel(6,"alpha min");
321  fHistoMesonCuts->GetXaxis()->SetBinLabel(7,"dca gamma gamma");
322  fHistoMesonCuts->GetXaxis()->SetBinLabel(8,"dca R prim Vtx");
323  fHistoMesonCuts->GetXaxis()->SetBinLabel(9,"dca Z prim Vtx");
324  fHistoMesonCuts->GetXaxis()->SetBinLabel(10,"out");
326 
327  fHistoMesonBGCuts=new TH2F(Form("MesonBGCuts %s",GetCutNumber().Data()),"MesonBGCuts vs Pt",10,-0.5,9.5, 250, 0, 50);
328  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(1,"in");
329  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(2,"undef rapidity");
330  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(3,"rapidity cut");
331  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(4,"opening angle");
332  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(5,"alpha max");
333  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(6,"alpha min");
334  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(7,"dca gamma gamma");
335  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(8,"dca R prim Vtx");
336  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(9,"dca Z prim Vtx");
337  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(10,"out");
339  }
340 
341  if(!fDoLightOutput){
342  if (fIsMergedClusterCut == 1){
343  fHistoInvMassBefore=new TH1F(Form("InvMassMeson Before %s",GetCutNumber().Data()),"InvMassMeson Before",1000,0,1);
345  fHistoInvMassAfter=new TH1F(Form("InvMassMeson After %s",GetCutNumber().Data()),"InvMassMeson After",1000,0,1);
347  }
348 
349  if (additionalHists && fIsMergedClusterCut== 0){
350  fHistoDCAGGMesonBefore=new TH1F(Form("DCAGammaGammaMeson Before %s",GetCutNumber().Data()),"DCAGammaGammaMeson Before",200,0,10);
352 
353  fHistoDCARMesonPrimVtxBefore=new TH1F(Form("DCARMesonPrimVtx Before %s",GetCutNumber().Data()),"DCARMesonPrimVtx Before",200,0,10);
355 
356  fHistoDCAZMesonPrimVtxBefore=new TH1F(Form("DCAZMesonPrimVtx Before %s",GetCutNumber().Data()),"DCAZMesonPrimVtx Before",401,-10,10);
358  }
359 
360  if (fIsMergedClusterCut == 0){
361  fHistoDCAGGMesonAfter=new TH1F(Form("DCAGammaGammaMeson After %s",GetCutNumber().Data()),"DCAGammaGammaMeson After",200,0,10);
363 
364  fHistoDCAZMesonPrimVtxAfter=new TH2F(Form("InvMassDCAZMesonPrimVtx After %s",GetCutNumber().Data()),"InvMassDCAZMesonPrimVtx After",800,0,0.8,401,-10,10);
366 
367  fHistoDCARMesonPrimVtxAfter=new TH1F(Form("DCARMesonPrimVtx After %s",GetCutNumber().Data()),"DCARMesonPrimVtx After",200,0,10);
369  }
370  }
371 
372  TH1::AddDirectory(kTRUE);
373 }
374 
375 //________________________________________________________________________
376 Bool_t AliConversionMesonCuts::MesonIsSelectedMC(TParticle *fMCMother,AliStack *fMCStack, Double_t fRapidityShift){
377  // Returns true for all pions within acceptance cuts for decay into 2 photons
378  // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
379 
380  if(!fMCStack)return kFALSE;
381 
382  if(fMCMother->GetPdgCode()==111 || fMCMother->GetPdgCode()==221){
383  if(fMCMother->R()>fMaxR) return kFALSE; // cuts on distance from collision point
384 
385  Double_t rapidity = 10.;
386  if(fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0){
387  rapidity=8.-fRapidityShift;
388  } else{
389  rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
390  }
391 
392  // Rapidity Cut
393  if(TMath::Abs(rapidity)>fRapidityCutMeson)return kFALSE;
394 
395  // Select only -> 2y decay channel
396  if(fMCMother->GetNDaughters()!=2)return kFALSE;
397 
398  for(Int_t i=0;i<2;i++){
399  if(fMCMother->GetDaughter(i) < 0) return kFALSE;
400  TParticle *MDaughter=fMCStack->Particle(fMCMother->GetDaughter(i));
401  // Is Daughter a Photon?
402  if(MDaughter->GetPdgCode()!=22)return kFALSE;
403  // Is Photon in Acceptance?
404  // if(bMCDaughtersInAcceptance){
405  // if(!PhotonIsSelectedMC(MDaughter,fMCStack)){return kFALSE;}
406  // }
407  }
408  return kTRUE;
409  }
410  return kFALSE;
411 }
412 
413 //________________________________________________________________________
414 Bool_t AliConversionMesonCuts::MesonIsSelectedAODMC(AliAODMCParticle *MCMother,TClonesArray *AODMCArray, Double_t fRapidityShift){
415  // Returns true for all pions within acceptance cuts for decay into 2 photons
416  // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
417 
418  if(!AODMCArray)return kFALSE;
419 
420  if(MCMother->GetPdgCode()==111 || MCMother->GetPdgCode()==221){
421  Double_t rMeson = sqrt( (MCMother->Xv()*MCMother->Xv()) + (MCMother->Yv()*MCMother->Yv()) ) ;
422  if(rMeson>fMaxR) return kFALSE; // cuts on distance from collision point
423 
424  Double_t rapidity = 10.;
425  if(MCMother->E() - MCMother->Pz() == 0 || MCMother->E() + MCMother->Pz() == 0){
426  rapidity=8.-fRapidityShift;
427  } else{
428  rapidity = 0.5*(TMath::Log((MCMother->E()+MCMother->Pz()) / (MCMother->E()-MCMother->Pz())))-fRapidityShift;
429  }
430 
431  // Rapidity Cut
432  if(TMath::Abs(rapidity)>fRapidityCutMeson)return kFALSE;
433 
434  // Select only -> 2y decay channel
435  if(MCMother->GetNDaughters()!=2)return kFALSE;
436 
437  for(Int_t i=0;i<2;i++){
438  AliAODMCParticle *MDaughter=static_cast<AliAODMCParticle*>(AODMCArray->At(MCMother->GetDaughter(i)));
439  // Is Daughter a Photon?
440  if(MDaughter->GetPdgCode()!=22)return kFALSE;
441  // Is Photon in Acceptance?
442  // if(bMCDaughtersInAcceptance){
443  // if(!PhotonIsSelectedMC(MDaughter,fMCStack)){return kFALSE;}
444  // }
445  }
446  return kTRUE;
447  }
448  return kFALSE;
449 }
450 
451 //________________________________________________________________________
452 Bool_t AliConversionMesonCuts::MesonIsSelectedMCDalitz(TParticle *fMCMother,AliStack *fMCStack, Int_t &labelelectron, Int_t &labelpositron, Int_t &labelgamma, Double_t fRapidityShift){
453 
454  // Returns true for all pions within acceptance cuts for decay into 2 photons
455  // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
456 
457  if( !fMCStack )return kFALSE;
458 
459  if( fMCMother->GetPdgCode() != 111 && fMCMother->GetPdgCode() != 221 ) return kFALSE;
460 
461  if( fMCMother->R()>fMaxR ) return kFALSE; // cuts on distance from collision point
462 
463  Double_t rapidity = 10.;
464 
465  if( fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0 ){
466  rapidity=8.-fRapidityShift;
467  }
468  else{
469  rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
470  }
471 
472  // Rapidity Cut
473  if( TMath::Abs(rapidity) > fRapidityCutMeson )return kFALSE;
474 
475  // Select only -> Dalitz decay channel
476  if( fMCMother->GetNDaughters() != 3 )return kFALSE;
477 
478  TParticle *positron = 0x0;
479  TParticle *electron = 0x0;
480  TParticle *gamma = 0x0;
481 
482  for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
483  if(index < 0) continue;
484  TParticle* temp = (TParticle*)fMCStack->Particle( index );
485 
486  switch( temp->GetPdgCode() ) {
487  case ::kPositron:
488  positron = temp;
489  labelpositron = index;
490  break;
491  case ::kElectron:
492  electron = temp;
493  labelelectron = index;
494  break;
495  case ::kGamma:
496  gamma = temp;
497  labelgamma = index;
498  break;
499  }
500  }
501 
502  if( positron && electron && gamma) return kTRUE;
503  return kFALSE;
504 }
505 
506 //________________________________________________________________________
507 Bool_t AliConversionMesonCuts::MesonIsSelectedAODMCDalitz(AliAODMCParticle *fMCMother,TClonesArray *AODMCArray, Int_t &labelelectron, Int_t &labelpositron, Int_t &labelgamma, Double_t fRapidityShift){
508 
509  // Returns true for all pions within acceptance cuts for decay into 2 photons
510  // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
511 
512  if( !AODMCArray )return kFALSE;
513 
514  if( fMCMother->GetPdgCode() != 111 && fMCMother->GetPdgCode() != 221 ) return kFALSE;
515 
516  Double_t rMeson = sqrt( (fMCMother->Xv()*fMCMother->Xv()) + (fMCMother->Yv()*fMCMother->Yv()) ) ;
517  if(rMeson>fMaxR) return kFALSE; // cuts on distance from collision point
518 
519  Double_t rapidity = 10.;
520 
521  if( fMCMother->E() - fMCMother->Pz() == 0 || fMCMother->E() + fMCMother->Pz() == 0 ){
522  rapidity=8.-fRapidityShift;
523  }
524  else{
525  rapidity = 0.5*(TMath::Log((fMCMother->E()+fMCMother->Pz()) / (fMCMother->E()-fMCMother->Pz())))-fRapidityShift;
526  }
527 
528  // Rapidity Cut
529  if( TMath::Abs(rapidity) > fRapidityCutMeson )return kFALSE;
530 
531  // Select only -> Dalitz decay channel
532  if( fMCMother->GetNDaughters() != 3 )return kFALSE;
533 
534  AliAODMCParticle *positron = 0x0;
535  AliAODMCParticle *electron = 0x0;
536  AliAODMCParticle *gamma = 0x0;
537 
538  for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
539  if(index < 0) continue;
540  AliAODMCParticle* temp = static_cast<AliAODMCParticle*>(AODMCArray->At(index));
541  if (!temp) continue;
542 
543  switch( temp->GetPdgCode() ) {
544  case ::kPositron:
545  positron = temp;
546  labelpositron = index;
547  break;
548  case ::kElectron:
549  electron = temp;
550  labelelectron = index;
551  break;
552  case ::kGamma:
553  gamma = temp;
554  labelgamma = index;
555  break;
556  }
557  }
558 
559  if( positron && electron && gamma) return kTRUE;
560  return kFALSE;
561 }
562 
563 //________________________________________________________________________
564 Bool_t AliConversionMesonCuts::MesonIsSelectedMCEtaPiPlPiMiGamma(TParticle *fMCMother,AliStack *fMCStack, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelGamma, Double_t fRapidityShift){
565 
566  // Returns true for all pions within acceptance cuts for decay into 2 photons
567  // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
568 
569  if( !fMCStack )return kFALSE;
570 
571  if( fMCMother->GetPdgCode() != 221 ) return kFALSE;
572 
573  if( fMCMother->R()>fMaxR ) return kFALSE; // cuts on distance from collision point
574 
575  Double_t rapidity = 10.;
576 
577  if( fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0 ){
578  rapidity=8.-fRapidityShift;
579  }
580  else{
581  rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
582  }
583 
584  // Rapidity Cut
585  if( TMath::Abs(rapidity) > fRapidityCutMeson )return kFALSE;
586 
587  // Select only -> Dalitz decay channel
588  if( fMCMother->GetNDaughters() != 3 )return kFALSE;
589 
590  TParticle *posPion = 0x0;
591  TParticle *negPion = 0x0;
592  TParticle *gamma = 0x0;
593 
594  for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
595  if(index < 0) continue;
596  TParticle* temp = (TParticle*)fMCStack->Particle( index );
597 
598  switch( temp->GetPdgCode() ) {
599  case 211:
600  posPion = temp;
601  labelPosPion = index;
602  break;
603  case -211:
604  negPion = temp;
605  labelNegPion = index;
606  break;
607  case ::kGamma:
608  gamma = temp;
609  labelGamma = index;
610  break;
611  }
612  }
613 
614  if( posPion && negPion && gamma) return kTRUE;
615  return kFALSE;
616 }
617 
618 //________________________________________________________________________
619 Bool_t AliConversionMesonCuts::MesonIsSelectedMCPiPlPiMiPiZero(TParticle *fMCMother,AliStack *fMCStack, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelNeutPion, Double_t fRapidityShift){
620 
621  // Returns true for all pions within acceptance cuts for decay into 2 photons
622  // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
623 
624  if( !fMCStack )return kFALSE;
625 
626  if( !(fMCMother->GetPdgCode() == 221 || fMCMother->GetPdgCode() == 223) ) return kFALSE;
627 
628  if( fMCMother->R()>fMaxR ) return kFALSE; // cuts on distance from collision point
629 
630  Double_t rapidity = 10.;
631 
632  if( fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0 ){
633  rapidity=8.-fRapidityShift;
634  }
635  else{
636  rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
637  }
638 
639  // Rapidity Cut
640  if( TMath::Abs(rapidity) > fRapidityCutMeson )return kFALSE;
641 
642  // Select only -> pi+ pi- pi0
643  if( fMCMother->GetNDaughters() != 3 )return kFALSE;
644 
645  TParticle *posPion = 0x0;
646  TParticle *negPion = 0x0;
647  TParticle *neutPion = 0x0;
648 
649 // cout << "\n"<< fMCMother->GetPdgCode() << "\n" << endl;
650  for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
651  if(index < 0) continue;
652  TParticle* temp = (TParticle*)fMCStack->Particle( index );
653 // cout << temp->GetPdgCode() << endl;
654  switch( temp->GetPdgCode() ) {
655  case 211:
656  posPion = temp;
657  labelPosPion = index;
658  break;
659  case -211:
660  negPion = temp;
661  labelNegPion = index;
662  break;
663  case 111:
664  neutPion = temp;
665  labelNeutPion = index;
666  break;
667  }
668  }
669 
670  if( posPion && negPion && neutPion ) return kTRUE;
671  return kFALSE;
672 }
673 
674 //________________________________________________________________________
675 Bool_t AliConversionMesonCuts::MesonIsSelectedMCPiZeroGamma(TParticle *fMCMother, AliStack *fMCStack, Int_t &labelNeutPion, Int_t &labelGamma, Double_t fRapidityShift){
676  // returns true for omegas decaying into pi0 + gamma within the rapidity window
677 
678  if(!fMCStack) return kFALSE;
679 
680  if(fMCMother->GetPdgCode()!=223) return kFALSE; // we only want omegas
681 
682  Double_t rapidity = 10.;
683 
684  if(fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0){
685  rapidity=8.-fRapidityShift;
686  }
687  else{
688  rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
689  }
690 
691  // Rapidity Cut
692  if(TMath::Abs(rapidity) > fRapidityCutMeson)return kFALSE;
693 
694  if(fMCMother->GetNDaughters()!=2) return kFALSE;
695 
696  TParticle *gamma = 0x0;
697  TParticle *pi0 = 0x0;
698 
699  for(Int_t index = fMCMother->GetFirstDaughter();index <= fMCMother->GetLastDaughter();index++){
700  if(index < 0) continue;
701  TParticle *temp = (TParticle*)fMCStack->Particle(index);
702  switch(temp->GetPdgCode()){
703  case 22:
704  gamma = temp;
705  labelGamma = index;
706  break;
707  case 111:
708  pi0 = temp;
709  labelNeutPion = index;
710  break;
711  }
712  }
713 
714  if(gamma && pi0) return kTRUE;
715  return kFALSE;
716 
717 }
718 
719 //________________________________________________________________________
721 
722  if(!DoPiZeroAngleCut) return kTRUE;
723 
724  Double_t PiZeroGammaAngle = pi0->Angle(gamma->Vect());
725  Double_t omegaPt = omega->Pt();
726 
727  if(PiZeroGammaAngle > lowerFactor * maxfit->Eval(omegaPt) && PiZeroGammaAngle < upperFactor * maxfit->Eval(omegaPt)) return kTRUE;
728  return kFALSE;
729 
730 }
731 
732 //________________________________________________________________________
733 Bool_t AliConversionMesonCuts::MesonIsSelectedMCChiC(TParticle *fMCMother,AliStack *fMCStack,Int_t & labelelectronChiC, Int_t & labelpositronChiC, Int_t & labelgammaChiC, Double_t fRapidityShift){
734  // Returns true for all ChiC within acceptance cuts for decay into JPsi + gamma -> e+ + e- + gamma
735  // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
736 
737  if(!fMCStack)return kFALSE;
738  // if(fMCMother->GetPdgCode()==20443 ){
739  // return kFALSE;
740  // }
741  if(fMCMother->GetPdgCode()==10441 || fMCMother->GetPdgCode()==10443 || fMCMother->GetPdgCode()==445 ){
742  if(fMCMother->R()>fMaxR) return kFALSE; // cuts on distance from collision point
743 
744  Double_t rapidity = 10.;
745  if(fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0){
746  rapidity=8.-fRapidityShift;
747  }
748  else{
749  rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
750  }
751 
752  // Rapidity Cut
753  if(TMath::Abs(rapidity)>fRapidityCutMeson)return kFALSE;
754 
755  // Select only -> ChiC radiative (JPsi+gamma) decay channel
756  if(fMCMother->GetNDaughters()!=2)return kFALSE;
757 
758  TParticle *jpsi = 0x0;
759  TParticle *gamma = 0x0;
760  TParticle *positron = 0x0;
761  TParticle *electron = 0x0;
762 
763  Int_t labeljpsiChiC = -1;
764 
765  for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
766  if(index < 0) continue;
767  TParticle* temp = (TParticle*)fMCStack->Particle( index );
768 
769  switch( temp->GetPdgCode() ) {
770  case 443:
771  jpsi = temp;
772  labeljpsiChiC = index;
773  break;
774  case 22:
775  gamma = temp;
776  labelgammaChiC = index;
777  break;
778  }
779  }
780 
781  if ( !jpsi || ! gamma) return kFALSE;
782  if(jpsi->GetNDaughters()!=2)return kFALSE;
783 
784 
785  for(Int_t index= jpsi->GetFirstDaughter();index<= jpsi->GetLastDaughter();index++){
786  if(index < 0) continue;
787  TParticle* temp = (TParticle*)fMCStack->Particle( index );
788  switch( temp->GetPdgCode() ) {
789  case -11:
790  electron = temp;
791  labelelectronChiC = index;
792  break;
793  case 11:
794  positron = temp;
795  labelpositronChiC = index;
796  break;
797  }
798  }
799  if( !electron || !positron) return kFALSE;
800  if( positron && electron && gamma) return kTRUE;
801  }
802  return kFALSE;
803 }
804 
805 //________________________________________________________________________
806 Bool_t AliConversionMesonCuts::MesonIsSelected(AliAODConversionMother *pi0,Bool_t IsSignal, Double_t fRapidityShift, Int_t leadingCellID1, Int_t leadingCellID2)
807 {
808 
809  // Selection of reconstructed Meson candidates
810  // Use flag IsSignal in order to fill Fill different
811  // histograms for Signal and Background
812  TH2 *hist=0x0;
813 
814  if(IsSignal){hist=fHistoMesonCuts;}
815  else{hist=fHistoMesonBGCuts;}
816 
817  Int_t cutIndex=0;
818 
819  if(hist)hist->Fill(cutIndex, pi0->Pt());
820  cutIndex++;
821 
822  // Undefined Rapidity -> Floating Point exception
823  if((pi0->E()+pi0->Pz())/(pi0->E()-pi0->Pz())<=0){
824  if(hist)hist->Fill(cutIndex, pi0->Pt());
825  cutIndex++;
826  if (!IsSignal)cout << "undefined rapidity" << endl;
827  return kFALSE;
828  }
829  else{
830  // PseudoRapidity Cut --> But we cut on Rapidity !!!
831  cutIndex++;
832  if(TMath::Abs(pi0->Rapidity()-fRapidityShift)>fRapidityCutMeson){
833  if(hist)hist->Fill(cutIndex, pi0->Pt());
834  return kFALSE;
835  }
836  }
837  cutIndex++;
838 
839  if (fHistoInvMassBefore) fHistoInvMassBefore->Fill(pi0->M());
840  // Mass cut
841  if (fIsMergedClusterCut == 1 ){
842  if (fEnableMassCut){
843  Double_t massMin = FunctionMinMassCut(pi0->E());
844  Double_t massMax = FunctionMaxMassCut(pi0->E());
845  // cout << "Min mass: " << massMin << "\t max Mass: " << massMax << "\t mass current: " << pi0->M()<< "\t E current: " << pi0->E() << endl;
846  if (pi0->M() > massMax || pi0->M() < massMin ){
847  if(hist)hist->Fill(cutIndex, pi0->Pt());
848  return kFALSE;
849  }
850  }
851  cutIndex++;
852  }else if(fIsMergedClusterCut == 2){
853  if(fEnableOneCellDistCut && ((leadingCellID1 == leadingCellID2) || fCaloPhotonCuts->AreNeighbours(leadingCellID1,leadingCellID2)) ){
854  if(hist)hist->Fill(cutIndex, pi0->Pt());
855  return kFALSE;
856  }
857  cutIndex++;
858  }
859 
860  // Opening Angle Cut
861  //fOpeningAngle=2*TMath::ATan(0.134/pi0->P());// physical minimum opening angle
863  if(hist)hist->Fill(cutIndex, pi0->Pt());
864  return kFALSE;
865  }
866 
867  // Min Opening Angle
868  if (fMinOpanPtDepCut == kTRUE) fMinOpanCutMeson = fFMinOpanCut->Eval(pi0->Pt());
869 
870  if (pi0->GetOpeningAngle() < fMinOpanCutMeson){
871  if(hist)hist->Fill(cutIndex, pi0->Pt());
872  return kFALSE;
873  }
874 
875  // Max Opening Angle
876  if (fMaxOpanPtDepCut == kTRUE) fMaxOpanCutMeson = fFMaxOpanCut->Eval(pi0->Pt());
877 
878  if( pi0->GetOpeningAngle() > fMaxOpanCutMeson){
879  if(hist)hist->Fill(cutIndex, pi0->Pt());
880  return kFALSE;
881  }
882  cutIndex++;
883 
884  // Alpha Max Cut
885  if (fIsMergedClusterCut == 1 && fAlphaPtDepCut) fAlphaCutMeson = fFAlphaCut->Eval(pi0->E());
886  else if (fAlphaPtDepCut == kTRUE) fAlphaCutMeson = fFAlphaCut->Eval(pi0->Pt());
887 
888  if(TMath::Abs(pi0->GetAlpha())>fAlphaCutMeson){
889  if(hist)hist->Fill(cutIndex, pi0->Pt());
890  return kFALSE;
891  }
892  cutIndex++;
893 
894  // Alpha Min Cut
895  if(TMath::Abs(pi0->GetAlpha())<fAlphaMinCutMeson){
896  if(hist)hist->Fill(cutIndex, pi0->Pt());
897  return kFALSE;
898  }
899  cutIndex++;
900 
901  if (fHistoInvMassAfter) fHistoInvMassAfter->Fill(pi0->M());
902 
903  if (fIsMergedClusterCut == 0){
906 
907  if (fDCAGammaGammaCutOn){
909  if(hist)hist->Fill(cutIndex, pi0->Pt());
910  return kFALSE;
911  }
912  }
913  cutIndex++;
914 
917  if(hist)hist->Fill(cutIndex, pi0->Pt());
918  return kFALSE;
919  }
920  }
921  cutIndex++;
922 
924 
926  if (TMath::Abs(pi0->GetDCAZMotherPrimVtx()) > fDCAZMesonPrimVtxCut){
927  if(hist)hist->Fill(cutIndex, pi0->Pt());
928  return kFALSE;
929  }
930  }
931  cutIndex++;
932 
936  }
937 
938  if(hist)hist->Fill(cutIndex, pi0->Pt());
939  return kTRUE;
940 }
941 
942 
943 
944 //________________________________________________________________________
945 //________________________________________________________________________
948 
949  if(fCutString && fCutString->GetString().Length() == kNCuts) {
950  fCutString->SetString(GetCutNumber());
951  } else {
952  return kFALSE;
953  }
954  return kTRUE;
955 }
956 
957 //________________________________________________________________________
959  fCutStringRead = Form("%s",analysisCutSelection.Data());
960 
961  // Initialize Cuts from a given Cut string
962  AliInfo(Form("Set Meson Cutnumber: %s",analysisCutSelection.Data()));
963  if(analysisCutSelection.Length()!=kNCuts) {
964  AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
965  return kFALSE;
966  }
967  if(!analysisCutSelection.IsAlnum()){
968  AliError("Cut selection is not alphanumeric");
969  return kFALSE;
970  }
971 
972  TString analysisCutSelectionLowerCase = Form("%s",analysisCutSelection.Data());
973  analysisCutSelectionLowerCase.ToLower();
974  const char *cutSelection = analysisCutSelectionLowerCase.Data();
975  #define ASSIGNARRAY(i) fCuts[i] = ((int)cutSelection[i]>=(int)'a') ? cutSelection[i]-'a'+10 : cutSelection[i]-'0'
976  for(Int_t ii=0;ii<kNCuts;ii++){
977  ASSIGNARRAY(ii);
978  }
979 
980  // Set Individual Cuts
981  for(Int_t ii=0;ii<kNCuts;ii++){
982  if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
983  }
984 
986  return kTRUE;
987 }
988 //________________________________________________________________________
991 
992  //cout << "Updating cut " << fgkCutNames[cutID] << " (" << cutID << ") to " << value << endl;
993  switch (cutID) {
994  case kMesonKind:
995  if( SetMesonKind(value)) {
996  fCuts[kMesonKind] = value;
997  UpdateCutString();
998  return kTRUE;
999  } else return kFALSE;
1000  case kSelectionCut:
1001  if (fIsMergedClusterCut == 1){
1002  if( SetSelectionWindowMergedCut(value)) {
1003  fCuts[kSelectionCut] = value;
1004  UpdateCutString();
1005  return kTRUE;
1006  } else return kFALSE;
1007  } else {
1008  if( SetSelectionWindowCut(value)) {
1009  fCuts[kSelectionCut] = value;
1010  UpdateCutString();
1011  return kTRUE;
1012  } else return kFALSE;
1013  }
1014  case kalphaMesonCut:
1015  if (fIsMergedClusterCut == 1){
1016  if( SetAlphaMesonMergedCut(value)) {
1017  fCuts[kalphaMesonCut] = value;
1018  UpdateCutString();
1019  return kTRUE;
1020  } else return kFALSE;
1021  } else {
1022  if( SetAlphaMesonCut(value)) {
1023  fCuts[kalphaMesonCut] = value;
1024  UpdateCutString();
1025  return kTRUE;
1026  } else return kFALSE;
1027  }
1028  case kRCut:
1029  if( SetRCut(value)) {
1030  fCuts[kRCut] = value;
1031  UpdateCutString();
1032  return kTRUE;
1033  } else return kFALSE;
1034 
1035  case kRapidityMesonCut:
1036  if( SetRapidityMesonCut(value)) {
1037  fCuts[kRapidityMesonCut] = value;
1038  UpdateCutString();
1039  return kTRUE;
1040  } else return kFALSE;
1041 
1042  case kBackgroundScheme:
1043  if( SetBackgroundScheme(value)) {
1044  fCuts[kBackgroundScheme] = value;
1045  UpdateCutString();
1046  return kTRUE;
1047  } else return kFALSE;
1048 
1050  if( SetNDegreesForRotationMethod(value)) {
1052  UpdateCutString();
1053  return kTRUE;
1054  } else return kFALSE;
1055 
1056  case kNumberOfBGEvents:
1057  if( SetNumberOfBGEvents(value)) {
1058  fCuts[kNumberOfBGEvents] = value;
1059  UpdateCutString();
1060  return kTRUE;
1061  } else return kFALSE;
1062 
1063  case kuseMCPSmearing:
1064  if( SetMCPSmearing(value)) {
1065  fCuts[kuseMCPSmearing] = value;
1066  UpdateCutString();
1067  return kTRUE;
1068  } else return kFALSE;
1069  case kElecShare:
1070  if( SetSharedElectronCut(value)) {
1071  fCuts[kElecShare] = value;
1072  UpdateCutString();
1073  return kTRUE;
1074  } else return kFALSE;
1075  case kToCloseV0s:
1076  if( SetToCloseV0sCut(value)) {
1077  fCuts[kToCloseV0s] = value;
1078  UpdateCutString();
1079  return kTRUE;
1080  } else return kFALSE;
1081  case kDcaGammaGamma:
1082  if( SetDCAGammaGammaCut(value)) {
1083  fCuts[kDcaGammaGamma] = value;
1084  UpdateCutString();
1085  return kTRUE;
1086  } else return kFALSE;
1087  case kDcaZPrimVtx:
1088  if( SetDCAZMesonPrimVtxCut(value)) {
1089  fCuts[kDcaZPrimVtx] = value;
1090  UpdateCutString();
1091  return kTRUE;
1092  } else return kFALSE;
1093  case kDcaRPrimVtx:
1094  if( SetDCARMesonPrimVtxCut(value)) {
1095  fCuts[kDcaRPrimVtx] = value;
1096  UpdateCutString();
1097  return kTRUE;
1098  } else return kFALSE;
1099  case kMinOpanMesonCut:
1100  if( SetMinOpanMesonCut(value)) {
1101  fCuts[kMinOpanMesonCut] = value;
1102  UpdateCutString();
1103  return kTRUE;
1104  } else return kFALSE;
1105 
1106  case kMaxOpanMesonCut:
1107  if( SetMaxOpanMesonCut(value)) {
1108  fCuts[kMaxOpanMesonCut] = value;
1109  UpdateCutString();
1110  return kTRUE;
1111  } else return kFALSE;
1112 
1113  case kNCuts:
1114  cout << "Error:: Cut id out of range"<< endl;
1115  return kFALSE;
1116  }
1117 
1118  cout << "Error:: Cut id " << cutID << " not recognized "<< endl;
1119  return kFALSE;
1120 
1121 }
1122 
1123 
1124 //________________________________________________________________________
1126  // Print out current Cut Selection
1127  for(Int_t ic = 0; ic < kNCuts; ic++) {
1128  printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
1129  }
1130 }
1131 
1132 //________________________________________________________________________
1134  // Print out current Cut Selection with values
1135  printf("\nMeson cutnumber \n");
1136  for(Int_t ic = 0; ic < kNCuts; ic++) {
1137  printf("%d",fCuts[ic]);
1138  }
1139  printf("\n\n");
1140 
1141  printf("Meson cuts \n");
1142  printf("\t |y| < %3.2f \n", fRapidityCutMeson);
1143  if (fEnableOneCellDistCut) printf("\t Only valid for GammaCalo: one cell distance cut enabled");
1144  if (fEnableMinOpeningAngleCut) printf("\t theta_{open} > %3.4f\n", fOpeningAngle);
1145  if (!fAlphaPtDepCut) printf("\t %3.2f < alpha < %3.2f\n", fAlphaMinCutMeson, fAlphaCutMeson);
1146  else printf("\t alpha pT-dep cut active\n");
1147  if (!fIsMergedClusterCut){
1148  if (fDCAGammaGammaCutOn)printf("\t dca_{gamma,gamma} < %3.2f\n", fDCAGammaGammaCut);
1149  if (fDCARMesonPrimVtxCutOn)printf("\t dca_{R, prim Vtx} < %3.2f\n", fDCARMesonPrimVtxCut);
1150  if (fDCAZMesonPrimVtxCutOn)printf("\t dca_{Z, prim Vtx} < %3.2f\n\n", fDCAZMesonPrimVtxCut);
1151  }
1152  if (fIsMergedClusterCut == 1 && fEnableMassCut){
1153  printf("\t Meson selection energy dependent\n\n");
1154  } else {
1155  printf("\t Meson selection window for further analysis %3.3f > M_{gamma,gamma} > %3.3f\n\n", fSelectionLow, fSelectionHigh);
1156  }
1157  if (!fMinOpanPtDepCut) printf("\t theta_{open} > %3.4f\n", fMinOpanCutMeson);
1158  else printf("\t Min theta_{open} pT-dep cut active\n");
1159  if (!fMaxOpanPtDepCut) printf("\t %3.4f < theta_{open}\n", fMaxOpanCutMeson);
1160  else printf("\t Max theta_{open} pT-dep cut active\n");
1161  printf("\t Running mode for cutselection (0 std, 2 PCM-Calo): %d\n", fMode);
1162 
1163  printf("Meson BG settings \n");
1164  if (!fDoBG){
1165  printf("\t No BG estimation \n");
1166  } else {
1167  if (!fUseRotationMethodInBG & !fUseTrackMultiplicityForBG & !fBackgroundHandler) printf("\t BG scheme: mixing V0 mult \n");
1168  if (!fUseRotationMethodInBG & fUseTrackMultiplicityForBG & !fBackgroundHandler) printf("\t BG scheme: mixing track mult \n");
1169  if (fUseRotationMethodInBG )printf("\t BG scheme: rotation \n");
1170  if (fUsePtmaxMethodForBG )printf("\t BG scheme: Ptmax \n");
1171  if (fdoBGProbability) printf("\t -> use BG probability \n");
1172  if (fBackgroundHandler) printf("\t -> use new BG handler \n");
1173  printf("\t depth of pool: %d\n", fNumberOfBGEvents);
1174  if (fUseRotationMethodInBG )printf("\t degree's for BG rotation: %d\n", fnDegreeRotationPMForBG);
1175  if (!fUseRotationMethodInBG & !fUseTrackMultiplicityForBG & fBackgroundHandler) printf("\t BG scheme: event plane angle with V0 mult \n");
1176  }
1177 }
1178 
1179 
1180 //________________________________________________________________________
1182  // Set Cut
1183  switch(mesonKind){
1184  case 0:
1185  fMesonKind = 0;
1186  break;
1187  case 1:
1188  fMesonKind = 1;
1189  break;
1190  default:
1191  cout<<"Warning: Meson kind not defined"<<mesonKind<<endl;
1192  return kFALSE;
1193  }
1194  return kTRUE;
1195 }
1196 
1197 //________________________________________________________________________
1199  // Set Cut
1200  switch(rCut){
1201  case 0:
1202  fMaxR = 180.;
1203  break;
1204  case 1:
1205  fMaxR = 180.;
1206  break;
1207  case 2:
1208  fMaxR = 180.;
1209  break;
1210  case 3:
1211  fMaxR = 70.;
1212  break;
1213  case 4:
1214  fMaxR = 70.;
1215  break;
1216  case 5:
1217  fMaxR = 180.;
1218  break;
1219  // High purity cuts for PbPb
1220  case 9:
1221  fMaxR = 180.;
1222  break;
1223  default:
1224  cout<<"Warning: rCut not defined"<<rCut<<endl;
1225  return kFALSE;
1226  }
1227  return kTRUE;
1228 }
1229 
1230 //________________________________________________________________________
1232  // Set Cut
1233  switch(selectionCut){
1234  case 0:
1235  fSelectionLow = 0.08;
1236  fSelectionHigh = 0.145;
1237  break;
1238  case 1:
1239  fSelectionLow = 0.1;
1240  fSelectionHigh = 0.145;
1241  break;
1242  case 2:
1243  fSelectionLow = 0.11;
1244  fSelectionHigh = 0.145;
1245  break;
1246  case 3:
1247  fSelectionLow = 0.12;
1248  fSelectionHigh = 0.145;
1249  break;
1250  case 4:
1251  fSelectionLow = 0.1;
1252  fSelectionHigh = 0.15;
1253  break;
1254  case 5:
1255  fSelectionLow = 0.11;
1256  fSelectionHigh = 0.15;
1257  break;
1258  case 6:
1259  fSelectionLow = 0.12;
1260  fSelectionHigh = 0.15;
1261  break;
1262 
1263  default:
1264  cout<<"Warning: SelectionCut not defined "<<selectionCut<<endl;
1265  return kFALSE;
1266  }
1267  return kTRUE;
1268 }
1269 
1271  // Set Cut
1272  fSelectionWindowCut = selectionCut;
1273  switch(fSelectionWindowCut){
1274  case 0:
1275  fEnableMassCut = kFALSE;
1276  break;
1277  case 1: //NLM 1
1278  fEnableMassCut = kTRUE;
1279  break;
1280  case 2: //NLM 2
1281  fEnableMassCut = kTRUE;
1282  break;
1283  case 3: //NLM 1
1284  fEnableMassCut = kTRUE;
1285  break;
1286  case 4: //NLM 2
1287  fEnableMassCut = kTRUE;
1288  break;
1289  case 5: //NLM 1
1290  fEnableMassCut = kTRUE;
1291  break;
1292  case 6: //NLM 2
1293  fEnableMassCut = kTRUE;
1294  break;
1295  case 7: //min mass cut around 0
1296  fEnableMassCut = kTRUE;
1297  break;
1298  case 8: //min mass cut around 0
1299  fEnableMassCut = kTRUE;
1300  break;
1301  case 9: //min mass cut around 0
1302  fEnableMassCut = kTRUE;
1303  break;
1304  default:
1305  cout<<"Warning: SelectionCut merged not defined "<<selectionCut<<endl;
1306  return kFALSE;
1307  }
1308 
1309  return kTRUE;
1310 
1311 }
1312 
1314 
1315  Float_t switchMass = 0;
1316  Float_t aMassLow = 0;
1317  Float_t bMassLow = 0;
1318  Float_t aMassHigh = 0;
1319  Float_t bMassHigh = 0;
1320  Float_t aMass = 0;
1321  Float_t bMass = 0;
1322  Float_t switchSigma = 0.;
1323  Float_t nSigma = 0;
1324  Float_t aSigmaLow = 0.;
1325  Float_t bSigmaLow = 0;
1326  Float_t aSigmaHigh = 0.;
1327  Float_t bSigmaHigh = 0;
1328  Float_t mass = 0;
1329  Float_t sigma = 0;
1330 
1331  switch(fSelectionWindowCut){
1332  case 0:
1333  fEnableMassCut = kFALSE;
1334  break;
1335  case 1: //NLM 1
1336  aMass = 0.044;
1337  bMass = 0.0049;
1338  switchSigma = 19.;
1339  nSigma = 3;
1340  aSigmaLow = 0.012;
1341  bSigmaLow = 0;
1342  aSigmaHigh = 0.0012;
1343  bSigmaHigh = 6e-4;
1344 
1345  mass = aMass + bMass*e;
1346  sigma = 0;
1347  if (e < switchSigma){
1348  sigma = aSigmaLow + bSigmaLow*e;
1349  } else {
1350  sigma = aSigmaHigh + bSigmaHigh*e;
1351  }
1352  return mass + nSigma*sigma;
1353  break;
1354  case 2: //NLM 2
1355  switchMass = 21;
1356  aMassLow = 0.115;
1357  bMassLow = 9.6e-4;
1358  aMassHigh = 0.1;
1359  bMassHigh = 0.0017;
1360  switchSigma = 10.;
1361  nSigma = 3;
1362  aSigmaLow = 0.009;
1363  bSigmaLow = 0;
1364  aSigmaHigh = 0.0023;
1365  bSigmaHigh = 6.7e-4;
1366 
1367  mass = 0;
1368  if (e < switchMass){
1369  mass = aMassLow + bMassLow*e;
1370  } else {
1371  mass = aMassHigh + bMassHigh*e;
1372  }
1373  sigma = 0;
1374  if (e < switchSigma){
1375  sigma = aSigmaLow + bSigmaLow*e;
1376  } else {
1377  sigma = aSigmaHigh + bSigmaHigh*e;
1378  }
1379  return mass + nSigma*sigma;
1380  break;
1381  case 3: //NLM 1
1382  aMass = 0.044;
1383  bMass = 0.0049;
1384  switchSigma = 19.;
1385  nSigma = 2;
1386  aSigmaLow = 0.012;
1387  bSigmaLow = 0;
1388  aSigmaHigh = 0.0012;
1389  bSigmaHigh = 6e-4;
1390 
1391  mass = aMass + bMass*e;
1392  sigma = 0;
1393  if (e < switchSigma){
1394  sigma = aSigmaLow + bSigmaLow*e;
1395  } else {
1396  sigma = aSigmaHigh + bSigmaHigh*e;
1397  }
1398  return mass + nSigma*sigma;
1399  break;
1400  case 4: //NLM 2
1401  switchMass = 21;
1402  aMassLow = 0.115;
1403  bMassLow = 9.6e-4;
1404  aMassHigh = 0.1;
1405  bMassHigh = 0.0017;
1406  switchSigma = 10.;
1407  nSigma = 2;
1408  aSigmaLow = 0.009;
1409  bSigmaLow = 0;
1410  aSigmaHigh = 0.0023;
1411  bSigmaHigh = 6.7e-4;
1412 
1413  mass = 0;
1414  if (e < switchMass){
1415  mass = aMassLow + bMassLow*e;
1416  } else {
1417  mass = aMassHigh + bMassHigh*e;
1418  }
1419  sigma = 0;
1420  if (e < switchSigma){
1421  sigma = aSigmaLow + bSigmaLow*e;
1422  } else {
1423  sigma = aSigmaHigh + bSigmaHigh*e;
1424  }
1425  return mass + nSigma*sigma;
1426  break;
1427  case 5: //NLM 1
1428  aMass = 0.044;
1429  bMass = 0.0049;
1430  switchSigma = 19.;
1431  nSigma = 4;
1432  aSigmaLow = 0.012;
1433  bSigmaLow = 0;
1434  aSigmaHigh = 0.0012;
1435  bSigmaHigh = 6e-4;
1436 
1437  mass = aMass + bMass*e;
1438  sigma = 0;
1439  if (e < switchSigma){
1440  sigma = aSigmaLow + bSigmaLow*e;
1441  } else {
1442  sigma = aSigmaHigh + bSigmaHigh*e;
1443  }
1444  return mass + nSigma*sigma;
1445  break;
1446  case 6: //NLM 2
1447  switchMass = 21;
1448  aMassLow = 0.115;
1449  bMassLow = 9.6e-4;
1450  aMassHigh = 0.1;
1451  bMassHigh = 0.0017;
1452  switchSigma = 10.;
1453  nSigma = 4;
1454  aSigmaLow = 0.009;
1455  bSigmaLow = 0;
1456  aSigmaHigh = 0.0023;
1457  bSigmaHigh = 6.7e-4;
1458 
1459  mass = 0;
1460  if (e < switchMass){
1461  mass = aMassLow + bMassLow*e;
1462  } else {
1463  mass = aMassHigh + bMassHigh*e;
1464  }
1465  sigma = 0;
1466  if (e < switchSigma){
1467  sigma = aSigmaLow + bSigmaLow*e;
1468  } else {
1469  sigma = aSigmaHigh + bSigmaHigh*e;
1470  }
1471  return mass + nSigma*sigma;
1472  break;
1473  case 7: // maximum mass
1474  return 10000.;
1475  break;
1476  case 8: // maximum mass
1477  return 10000.;
1478  break;
1479  case 9: // maximum mass
1480  return 10000.;
1481  break;
1482  default:
1483  cout<<"Warning: SelectionCut merged not defined "<<fSelectionWindowCut<<endl;
1484  return -1;
1485  }
1486  return -1;
1487 
1488 }
1489 
1491 
1492  Float_t switchMass = 0;
1493  Float_t aMassLow = 0;
1494  Float_t bMassLow = 0;
1495  Float_t aMassHigh = 0;
1496  Float_t bMassHigh = 0;
1497  Float_t aMass = 0;
1498  Float_t bMass = 0;
1499  Float_t switchSigma = 0.;
1500  Float_t nSigma = 0;
1501  Float_t aSigmaLow = 0.;
1502  Float_t bSigmaLow = 0;
1503  Float_t aSigmaHigh = 0.;
1504  Float_t bSigmaHigh = 0;
1505  Float_t mass = 0;
1506  Float_t sigma = 0;
1507 
1508  switch(fSelectionWindowCut){
1509  case 0:
1510  fEnableMassCut = kFALSE;
1511  break;
1512  case 1: //NLM 1
1513  aMass = 0.044;
1514  bMass = 0.0049;
1515  switchSigma = 19.;
1516  nSigma = 3;
1517  aSigmaLow = 0.012;
1518  bSigmaLow = 0;
1519  aSigmaHigh = 0.0012;
1520  bSigmaHigh = 6e-4;
1521 
1522  mass = aMass + bMass*e;
1523  sigma = 0;
1524  if (e < switchSigma){
1525  sigma = aSigmaLow + bSigmaLow*e;
1526  } else {
1527  sigma = aSigmaHigh + bSigmaHigh*e;
1528  }
1529  // cout << "E: "<< e << "\t mass: " << mass << "\t sigma: " << sigma<< endl;
1530  return mass - nSigma*sigma;
1531  break;
1532  case 2: //NLM 2
1533  switchMass = 21;
1534  aMassLow = 0.115;
1535  bMassLow = 9.6e-4;
1536  aMassHigh = 0.1;
1537  bMassHigh = 0.0017;
1538  switchSigma = 10.;
1539  nSigma = 3;
1540  aSigmaLow = 0.009;
1541  bSigmaLow = 0;
1542  aSigmaHigh = 0.0023;
1543  bSigmaHigh = 6.7e-4;
1544 
1545  mass = 0;
1546  if (e < switchMass){
1547  mass = aMassLow + bMassLow*e;
1548  } else {
1549  mass = aMassHigh + bMassHigh*e;
1550  }
1551  sigma = 0;
1552  if (e < switchSigma){
1553  sigma = aSigmaLow + bSigmaLow*e;
1554  } else {
1555  sigma = aSigmaHigh + bSigmaHigh*e;
1556  }
1557  // cout << "E: "<< e << "\t mass: " << mass << "\t sigma: "<< sigma << endl;
1558 
1559  return mass - nSigma*sigma;
1560  break;
1561  case 3: //NLM 1
1562  aMass = 0.044;
1563  bMass = 0.0049;
1564  switchSigma = 19.;
1565  nSigma = 2;
1566  aSigmaLow = 0.012;
1567  bSigmaLow = 0;
1568  aSigmaHigh = 0.0012;
1569  bSigmaHigh = 6e-4;
1570 
1571  mass = aMass + bMass*e;
1572  sigma = 0;
1573  if (e < switchSigma){
1574  sigma = aSigmaLow + bSigmaLow*e;
1575  } else {
1576  sigma = aSigmaHigh + bSigmaHigh*e;
1577  }
1578  // cout << "E: "<< e << "\t mass: " << mass << "\t sigma: " << sigma<< endl;
1579  return mass - nSigma*sigma;
1580  break;
1581  case 4: //NLM 2
1582  switchMass = 21;
1583  aMassLow = 0.115;
1584  bMassLow = 9.6e-4;
1585  aMassHigh = 0.1;
1586  bMassHigh = 0.0017;
1587  switchSigma = 10.;
1588  nSigma = 2;
1589  aSigmaLow = 0.009;
1590  bSigmaLow = 0;
1591  aSigmaHigh = 0.0023;
1592  bSigmaHigh = 6.7e-4;
1593 
1594  mass = 0;
1595  if (e < switchMass){
1596  mass = aMassLow + bMassLow*e;
1597  } else {
1598  mass = aMassHigh + bMassHigh*e;
1599  }
1600  sigma = 0;
1601  if (e < switchSigma){
1602  sigma = aSigmaLow + bSigmaLow*e;
1603  } else {
1604  sigma = aSigmaHigh + bSigmaHigh*e;
1605  }
1606  // cout << "E: "<< e << "\t mass: " << mass << "\t sigma: "<< sigma << endl;
1607 
1608  return mass - nSigma*sigma;
1609  break;
1610  case 5: //NLM 1
1611  aMass = 0.044;
1612  bMass = 0.0049;
1613  switchSigma = 19.;
1614  nSigma = 4;
1615  aSigmaLow = 0.012;
1616  bSigmaLow = 0;
1617  aSigmaHigh = 0.0012;
1618  bSigmaHigh = 6e-4;
1619 
1620  mass = aMass + bMass*e;
1621  sigma = 0;
1622  if (e < switchSigma){
1623  sigma = aSigmaLow + bSigmaLow*e;
1624  } else {
1625  sigma = aSigmaHigh + bSigmaHigh*e;
1626  }
1627  // cout << "E: "<< e << "\t mass: " << mass << "\t sigma: " << sigma<< endl;
1628  return mass - nSigma*sigma;
1629  break;
1630  case 6: //NLM 2
1631  switchMass = 21;
1632  aMassLow = 0.115;
1633  bMassLow = 9.6e-4;
1634  aMassHigh = 0.1;
1635  bMassHigh = 0.0017;
1636  switchSigma = 10.;
1637  nSigma = 4;
1638  aSigmaLow = 0.009;
1639  bSigmaLow = 0;
1640  aSigmaHigh = 0.0023;
1641  bSigmaHigh = 6.7e-4;
1642 
1643  mass = 0;
1644  if (e < switchMass){
1645  mass = aMassLow + bMassLow*e;
1646  } else {
1647  mass = aMassHigh + bMassHigh*e;
1648  }
1649  sigma = 0;
1650  if (e < switchSigma){
1651  sigma = aSigmaLow + bSigmaLow*e;
1652  } else {
1653  sigma = aSigmaHigh + bSigmaHigh*e;
1654  }
1655  // cout << "E: "<< e << "\t mass: " << mass << "\t sigma: "<< sigma << endl;
1656  return mass - nSigma*sigma;
1657  break;
1658 
1659  case 7: // just exclude band at 0
1660  return 0.005+0.004*e;
1661  break;
1662  case 8: // just exclude band at 0 looser
1663  return 0.004+0.004*e;
1664  break;
1665  case 9: // just exclude band at 0 tighter
1666  return 0.006+0.004*e;
1667  break;
1668 
1669  default:
1670  cout<<"Warning: SelectionCut merged not defined "<<fSelectionWindowCut<<endl;
1671  return -1;
1672  }
1673  return -1;
1674 }
1675 
1676 //________________________________________________________________________
1678 { // Set Cut
1679  switch(alphaMesonCut){
1680  case 0: // 0- 0.7
1681  fAlphaMinCutMeson = 0.0;
1682  fAlphaCutMeson = 0.7;
1683  fAlphaPtDepCut = kFALSE;
1684  break;
1685  case 1: // Updated 15 May 2015
1686  if (fIsMergedClusterCut == 0){
1687  if( fFAlphaCut ) delete fFAlphaCut;
1688  fFAlphaCut = new TF1("fFAlphaCut","[0]*tanh([1]*x)",0.,100.);
1689  fFAlphaCut->SetParameter(0,0.65);
1690  fFAlphaCut->SetParameter(1,1.8);
1691  fAlphaMinCutMeson = 0.0;
1692  fAlphaCutMeson = -1.0;
1693  fAlphaPtDepCut = kTRUE;
1694  } else {
1695  fAlphaPtDepCut = kFALSE;
1696  fAlphaMinCutMeson = 0.5;
1697  fAlphaCutMeson = 1;
1698  }
1699  break;
1700  case 2: // Updated 31 October 2013 before 0.5-1
1701  if (fIsMergedClusterCut == 0){
1702  if( fFAlphaCut ) delete fFAlphaCut;
1703  fFAlphaCut = new TF1("fFAlphaCut","[0]*tanh([1]*x)",0.,100.);
1704  fFAlphaCut->SetParameter(0,0.8);
1705  fFAlphaCut->SetParameter(1,1.2);
1706  fAlphaMinCutMeson = 0.0;
1707  fAlphaCutMeson = -1.0;
1708  fAlphaPtDepCut = kTRUE;
1709  } else {
1710  fAlphaPtDepCut = kFALSE;
1711  fAlphaMinCutMeson = 0.6;
1712  fAlphaCutMeson = 1;
1713  }
1714  break;
1715  case 3: // 0.0-1
1716  fAlphaMinCutMeson = 0.0;
1717  fAlphaCutMeson = 1.;
1718  fAlphaPtDepCut = kFALSE;
1719  break;
1720  case 4: // 0-0.65
1721  fAlphaMinCutMeson = 0.0;
1722  fAlphaCutMeson = 0.65;
1723  fAlphaPtDepCut = kFALSE;
1724  break;
1725  case 5: // 0-0.75
1726  fAlphaMinCutMeson = 0.0;
1727  fAlphaCutMeson = 0.75;
1728  fAlphaPtDepCut = kFALSE;
1729  break;
1730  case 6: // 0-0.8
1731  fAlphaMinCutMeson = 0.0;
1732  fAlphaCutMeson = 0.8;
1733  fAlphaPtDepCut = kFALSE;
1734  break;
1735  case 7: // 0.0-0.85
1736  fAlphaMinCutMeson = 0.0;
1737  fAlphaCutMeson = 0.85;
1738  fAlphaPtDepCut = kFALSE;
1739  break;
1740  case 8: // 0.0-0.6
1741  fAlphaMinCutMeson = 0.0;
1742  fAlphaCutMeson = 0.6;
1743  fAlphaPtDepCut = kFALSE;
1744  break;
1745  case 9: // Updated 11 November 2013 before 0.0 - 0.3
1746  if (fIsMergedClusterCut == 0){
1747  if( fFAlphaCut ) delete fFAlphaCut;
1748  fFAlphaCut = new TF1("fFAlphaCut","[0]*tanh([1]*x)",0.,100.);
1749  fFAlphaCut->SetParameter(0,0.65);
1750  fFAlphaCut->SetParameter(1,1.2);
1751  fAlphaMinCutMeson = 0.0;
1752  fAlphaCutMeson = -1.0;
1753  fAlphaPtDepCut = kTRUE;
1754  } else {
1755  fAlphaPtDepCut = kFALSE;
1756  fAlphaMinCutMeson = 0.4;
1757  fAlphaCutMeson = 1;
1758  }
1759  break;
1760  case 10: //a 0-0.2
1761  fAlphaMinCutMeson = 0.0;
1762  fAlphaCutMeson = 0.2;
1763  fAlphaPtDepCut = kFALSE;
1764  break;
1765  case 11: //b 0.2-0.6
1766  fAlphaMinCutMeson = 0.2;
1767  fAlphaCutMeson = 0.6;
1768  fAlphaPtDepCut = kFALSE;
1769  break;
1770  case 12: //c 0.6-1.0
1771  fAlphaMinCutMeson = 0.6;
1772  fAlphaCutMeson = 1.0;
1773  fAlphaPtDepCut = kFALSE;
1774  break;
1775  default:
1776  cout<<"Warning: AlphaMesonCut not defined "<<alphaMesonCut<<endl;
1777  return kFALSE;
1778  }
1779  return kTRUE;
1780 }
1781 
1782 
1783 //________________________________________________________________________
1785 { // Set Cut
1786  switch(alphaMesonCut){
1787  case 0: // 0- 1
1788  fAlphaMinCutMeson = 0.0;
1789  fAlphaCutMeson = 1;
1790  fAlphaPtDepCut = kFALSE;
1791  break;
1792  case 1: // cut for NLM 1
1793  if( fFAlphaCut ) delete fFAlphaCut;
1794  fFAlphaCut = new TF1("fFAlphaCut","[0]+[1]*x+[2]/(x*x*x)",0.,100.);
1795  fFAlphaCut->SetParameter(0,0.96);
1796  fFAlphaCut->SetParameter(1,0);
1797  fFAlphaCut->SetParameter(2,-879);
1798  fAlphaMinCutMeson = 0.0;
1799  fAlphaCutMeson = -1.0;
1800  fAlphaPtDepCut = kTRUE;
1801  break;
1802  case 2: // cut for NLM 2
1803  if( fFAlphaCut ) delete fFAlphaCut;
1804  fFAlphaCut = new TF1("fFAlphaCut","[0]+[1]*x+[2]/(x*x*x)",0.,100.);
1805  fFAlphaCut->SetParameter(0,0.95);
1806  fFAlphaCut->SetParameter(1,0.0015);
1807  fFAlphaCut->SetParameter(2,-233);
1808  fAlphaMinCutMeson = 0.0;
1809  fAlphaCutMeson = -1.0;
1810  fAlphaPtDepCut = kTRUE;
1811  break;
1812  case 3: // cut for NLM 1 larger
1813  if( fFAlphaCut ) delete fFAlphaCut;
1814  fFAlphaCut = new TF1("fFAlphaCut","[0]+[1]*x+[2]/(x*x*x)",0.,100.);
1815  fFAlphaCut->SetParameter(0,0.975);
1816  fFAlphaCut->SetParameter(1,0);
1817  fFAlphaCut->SetParameter(2,-800);
1818  fAlphaMinCutMeson = 0.0;
1819  fAlphaCutMeson = -1.0;
1820  fAlphaPtDepCut = kTRUE;
1821  break;
1822  case 4: // cut for NLM 2 larger
1823  if( fFAlphaCut ) delete fFAlphaCut;
1824  fFAlphaCut = new TF1("fFAlphaCut","[0]+[1]*x+[2]/(x*x*x)",0.,100.);
1825  fFAlphaCut->SetParameter(0,0.97);
1826  fFAlphaCut->SetParameter(1,0.0015);
1827  fFAlphaCut->SetParameter(2,-200);
1828  fAlphaMinCutMeson = 0.0;
1829  fAlphaCutMeson = -1.0;
1830  fAlphaPtDepCut = kTRUE;
1831  break;
1832  case 5: // cut for NLM 1 smaller
1833  if( fFAlphaCut ) delete fFAlphaCut;
1834  fFAlphaCut = new TF1("fFAlphaCut","[0]+[1]*x+[2]/(x*x*x)",0.,100.);
1835  fFAlphaCut->SetParameter(0,0.94);
1836  fFAlphaCut->SetParameter(1,0);
1837  fFAlphaCut->SetParameter(2,-970);
1838  fAlphaMinCutMeson = 0.0;
1839  fAlphaCutMeson = -1.0;
1840  fAlphaPtDepCut = kTRUE;
1841  break;
1842  case 6: // cut for NLM 2 smaller
1843  if( fFAlphaCut ) delete fFAlphaCut;
1844  fFAlphaCut = new TF1("fFAlphaCut","[0]+[1]*x+[2]/(x*x*x)",0.,100.);
1845  fFAlphaCut->SetParameter(0,0.935);
1846  fFAlphaCut->SetParameter(1,0.0015);
1847  fFAlphaCut->SetParameter(2,-273);
1848  fAlphaMinCutMeson = 0.0;
1849  fAlphaCutMeson = -1.0;
1850  fAlphaPtDepCut = kTRUE;
1851  break;
1852 
1853  default:
1854  cout<<"Warning: AlphaMesonCut for merged clusters not defined "<<alphaMesonCut<<endl;
1855  return kFALSE;
1856  }
1857  return kTRUE;
1858 }
1859 
1860 //________________________________________________________________________
1862  // Set Cut
1863  switch(RapidityMesonCut){
1864  case 0: // changed from 0.9 to 1.35
1865  fRapidityCutMeson = 1.35;
1866  break;
1867  case 1: //
1868  fRapidityCutMeson = 0.8;
1869  break;
1870  case 2: //
1871  fRapidityCutMeson = 0.7;
1872  break;
1873  case 3: //
1874  fRapidityCutMeson = 0.6;
1875  break;
1876  case 4: //
1877  fRapidityCutMeson = 0.5;
1878  break;
1879  case 5: //
1880  fRapidityCutMeson = 0.85;
1881  break;
1882  case 6: //
1883  fRapidityCutMeson = 0.75;
1884  break;
1885  case 7: //
1886  fRapidityCutMeson = 0.3;
1887  break;
1888  case 8: //changed, before 0.35
1889  fRapidityCutMeson = 0.25;
1890  break;
1891  case 9: //
1892  fRapidityCutMeson = 0.4;
1893  break;
1894  default:
1895  cout<<"Warning: RapidityMesonCut not defined "<<RapidityMesonCut<<endl;
1896  return kFALSE;
1897  }
1898  return kTRUE;
1899 }
1900 
1901 
1902 //________________________________________________________________________
1904  // Set Cut
1905  switch(BackgroundScheme){
1906  case 0: //Rotation
1907  fUseRotationMethodInBG = kTRUE;
1908  fdoBGProbability = kFALSE;
1909  break;
1910  case 1: // mixed event with V0 multiplicity
1911  fUseRotationMethodInBG = kFALSE;
1912  fUseTrackMultiplicityForBG = kFALSE;
1913  fdoBGProbability = kFALSE;
1914  break;
1915  case 2: // mixed event with track multiplicity
1916  fUseRotationMethodInBG = kFALSE;
1918  fdoBGProbability = kFALSE;
1919  break;
1920  case 3: //Rotation
1921  fUseRotationMethodInBG = kTRUE;
1922  fdoBGProbability = kTRUE;
1923  break;
1924  case 4: //No BG calculation
1925  cout << "no BG calculation should be done" << endl;
1926  fUseRotationMethodInBG = kFALSE;
1927  fdoBGProbability = kFALSE;
1928  fDoBG = kFALSE;
1929  break;
1930  case 5: //Rotation
1931  fUseRotationMethodInBG = kTRUE;
1932  fdoBGProbability = kFALSE;
1933  fBackgroundHandler = 1;
1934  break;
1935  case 6: // mixed event with V0 multiplicity
1936  fUseRotationMethodInBG = kFALSE;
1937  fUseTrackMultiplicityForBG = kFALSE;
1938  fdoBGProbability = kFALSE;
1939  fBackgroundHandler = 1;
1940  break;
1941  case 7: // mixed event with track multiplicity
1942  fUseRotationMethodInBG = kFALSE;
1944  fdoBGProbability = kFALSE;
1945  fBackgroundHandler = 1;
1946  break;
1947  case 8: //Rotation
1948  fUseRotationMethodInBG = kTRUE;
1949  fdoBGProbability = kTRUE;
1950  fBackgroundHandler = 1;
1951  break;
1952  case 9: // mixed event with Ptmax method
1953  fUseRotationMethodInBG = kFALSE;
1954  fUseTrackMultiplicityForBG = kFALSE;
1955  fdoBGProbability = kFALSE;
1956  fUsePtmaxMethodForBG = kTRUE;
1957  break;
1958  default:
1959  cout<<"Warning: BackgroundScheme not defined "<<BackgroundScheme<<endl;
1960  return kFALSE;
1961  }
1962  return kTRUE;
1963 }
1964 
1965 
1966 //________________________________________________________________________
1968  // Set Cut
1969  switch(DegreesForRotationMethod){
1970  case 0:
1972  break;
1973  case 1:
1975  break;
1976  case 2:
1978  break;
1979  case 3:
1981  break;
1982  default:
1983  cout<<"Warning: DegreesForRotationMethod not defined "<<DegreesForRotationMethod<<endl;
1984  return kFALSE;
1985  }
1986  fCuts[kDegreesForRotationMethod]=DegreesForRotationMethod;
1987  return kTRUE;
1988 }
1989 
1990 //________________________________________________________________________
1992  // Set Cut
1993  switch(NumberOfBGEvents){
1994  case 0:
1995  fNumberOfBGEvents = 5;
1996  break;
1997  case 1:
1998  fNumberOfBGEvents = 10;
1999  break;
2000  case 2:
2001  fNumberOfBGEvents = 15;
2002  break;
2003  case 3:
2004  fNumberOfBGEvents = 20;
2005  break;
2006  case 4:
2007  fNumberOfBGEvents = 2;
2008  break;
2009  case 5:
2010  fNumberOfBGEvents = 50;
2011  break;
2012  case 6:
2013  fNumberOfBGEvents = 80;
2014  break;
2015  case 7:
2016  fNumberOfBGEvents = 100;
2017  break;
2018  default:
2019  cout<<"Warning: NumberOfBGEvents not defined "<<NumberOfBGEvents<<endl;
2020  return kFALSE;
2021  }
2022  return kTRUE;
2023 }
2024 //________________________________________________________________________
2026 
2027  switch(sharedElec){
2028  case 0:
2029  fDoSharedElecCut = kFALSE;
2030  break;
2031  case 1:
2032  fDoSharedElecCut = kTRUE;
2033  break;
2034  default:
2035  cout<<"Warning: Shared Electron Cut not defined "<<sharedElec<<endl;
2036  return kFALSE;
2037  }
2038 
2039  return kTRUE;
2040 }
2041 
2042 //________________________________________________________________________
2044 
2045  switch(toClose){
2046  case 0:
2047  fDoToCloseV0sCut = kFALSE;
2048  fminV0Dist = 250;
2049  break;
2050  case 1:
2051  fDoToCloseV0sCut = kTRUE;
2052  fminV0Dist = 1;
2053  break;
2054  case 2:
2055  fDoToCloseV0sCut = kTRUE;
2056  fminV0Dist = 2;
2057  break;
2058  case 3:
2059  fDoToCloseV0sCut = kTRUE;
2060  fminV0Dist = 3;
2061  break;
2062  default:
2063  cout<<"Warning: Shared Electron Cut not defined "<<toClose<<endl;
2064  return kFALSE;
2065  }
2066  return kTRUE;
2067 }
2068 
2069 //________________________________________________________________________
2071 {// Set Cut
2072  if(fMode == 2){ //PCM-EMCal running
2073  switch(useMCPSmearing){
2074  case 0:
2075  fUseMCPSmearing = 0;
2076  fPBremSmearing = 1.;
2077  fPSigSmearing = 0.;
2078  fPSigSmearingCte = 0.;
2079  break;
2080  case 1:
2081  fUseMCPSmearing = 1;
2082  fPBremSmearing = 1;
2083  fPSigSmearing = 0.010;
2084  fPSigSmearingCte = 0.010;
2085  break;
2086  case 2:
2087  fUseMCPSmearing = 1;
2088  fPBremSmearing = 1;
2089  fPSigSmearing = 0.015;
2090  fPSigSmearingCte = 0.010;
2091  break;
2092  case 3:
2093  fUseMCPSmearing = 1;
2094  fPBremSmearing = 1.;
2095  fPSigSmearing = 0.020;
2096  fPSigSmearingCte = 0.010;
2097  break;
2098  case 4:
2099  fUseMCPSmearing = 1;
2100  fPBremSmearing = 1.;
2101  fPSigSmearing = 0.020;
2102  fPSigSmearingCte = 0.020;
2103  break;
2104  case 5:
2105  fUseMCPSmearing = 1;
2106  fPBremSmearing = 1.;
2107  fPSigSmearing = 0.030;
2108  fPSigSmearingCte = 0.020;
2109  break;
2110  case 6:
2111  fUseMCPSmearing = 1;
2112  fPBremSmearing = 1.;
2113  fPSigSmearing = 0.030;
2114  fPSigSmearingCte = 0.030;
2115  break;
2116  case 7:
2117  fUseMCPSmearing = 1;
2118  fPBremSmearing = 1;
2119  fPSigSmearing = 0.030;
2120  fPSigSmearingCte = 0.050;
2121  break;
2122  case 8:
2123  fUseMCPSmearing = 1;
2124  fPBremSmearing = 1.;
2125  fPSigSmearing = 0.030;
2126  fPSigSmearingCte = 0.060;
2127  break;
2128  case 9:
2129  fUseMCPSmearing = 1;
2130  fPBremSmearing = 1.;
2131  fPSigSmearing = 0.075;
2132  fPSigSmearingCte = 0.050;
2133  break;
2134 
2135  default:
2136  AliError("Warning: UseMCPSmearing not defined");
2137  return kFALSE;
2138  }
2139  }else{
2140  switch(useMCPSmearing){
2141  case 0:
2142  fUseMCPSmearing = 0;
2143  fPBremSmearing = 1.;
2144  fPSigSmearing = 0.;
2145  fPSigSmearingCte = 0.;
2146  break;
2147  case 1:
2148  fUseMCPSmearing = 1;
2149  fPBremSmearing = 1.0e-14;
2150  fPSigSmearing = 0.;
2151  fPSigSmearingCte = 0.;
2152  break;
2153  case 2:
2154  fUseMCPSmearing = 1;
2155  fPBremSmearing = 1.0e-15;
2156  fPSigSmearing = 0.0;
2157  fPSigSmearingCte = 0.;
2158  break;
2159  case 3:
2160  fUseMCPSmearing = 1;
2161  fPBremSmearing = 1.;
2162  fPSigSmearing = 0.003;
2163  fPSigSmearingCte = 0.002;
2164  break;
2165  case 4:
2166  fUseMCPSmearing = 1;
2167  fPBremSmearing = 1.;
2168  fPSigSmearing = 0.003;
2169  fPSigSmearingCte = 0.007;
2170  break;
2171  case 5:
2172  fUseMCPSmearing = 1;
2173  fPBremSmearing = 1.;
2174  fPSigSmearing = 0.003;
2175  fPSigSmearingCte = 0.016;
2176  break;
2177  case 6:
2178  fUseMCPSmearing = 1;
2179  fPBremSmearing = 1.;
2180  fPSigSmearing = 0.007;
2181  fPSigSmearingCte = 0.016;
2182  break;
2183  case 7:
2184  fUseMCPSmearing = 1;
2185  fPBremSmearing = 1.0e-16;
2186  fPSigSmearing = 0.0;
2187  fPSigSmearingCte = 0.;
2188  break;
2189  case 8:
2190  fUseMCPSmearing = 1;
2191  fPBremSmearing = 1.;
2192  fPSigSmearing = 0.007;
2193  fPSigSmearingCte = 0.014;
2194  break;
2195  case 9:
2196  fUseMCPSmearing = 1;
2197  fPBremSmearing = 1.;
2198  fPSigSmearing = 0.007;
2199  fPSigSmearingCte = 0.011;
2200  break;
2201 
2202  default:
2203  AliError("Warning: UseMCPSmearing not defined");
2204  return kFALSE;
2205  }
2206  }
2207  return kTRUE;
2208 }
2209 
2210 
2211 //________________________________________________________________________
2213  // Set Cut
2214  switch(DCAGammaGamma){
2215  case 0: //
2216  fDCAGammaGammaCutOn = kFALSE;
2217  fDCAGammaGammaCut = 1000;
2218  break;
2219  case 1: //
2220  fDCAGammaGammaCutOn = kTRUE;
2221  fDCAGammaGammaCut = 10;
2222  break;
2223  case 2: //
2224  fDCAGammaGammaCutOn = kTRUE;
2225  fDCAGammaGammaCut = 5;
2226  break;
2227  case 3: //
2228  fDCAGammaGammaCutOn = kTRUE;
2229  fDCAGammaGammaCut = 4;
2230  break;
2231  case 4: //
2232  fDCAGammaGammaCutOn = kTRUE;
2233  fDCAGammaGammaCut = 3;
2234  break;
2235  case 5: //
2236  fDCAGammaGammaCutOn = kTRUE;
2237  fDCAGammaGammaCut = 2.5;
2238  break;
2239  case 6: //
2240  fDCAGammaGammaCutOn = kTRUE;
2241  fDCAGammaGammaCut = 2;
2242  break;
2243  case 7: //
2244  fDCAGammaGammaCutOn = kTRUE;
2245  fDCAGammaGammaCut = 1.5;
2246  break;
2247  case 8: //
2248  fDCAGammaGammaCutOn = kTRUE;
2249  fDCAGammaGammaCut = 1;
2250  break;
2251  case 9: //
2252  fDCAGammaGammaCutOn = kTRUE;
2253  fDCAGammaGammaCut = 0.5;
2254  break;
2255  default:
2256  cout<<"Warning: DCAGammaGamma not defined "<<DCAGammaGamma<<endl;
2257  return kFALSE;
2258  }
2259  return kTRUE;
2260 }
2261 
2262 //________________________________________________________________________
2264  // Set Cut
2265  switch(DCAZMesonPrimVtx){
2266  case 0: //
2267  fDCAZMesonPrimVtxCutOn = kFALSE;
2268  fDCAZMesonPrimVtxCut = 1000;
2269  break;
2270  case 1: //
2271  fDCAZMesonPrimVtxCutOn = kTRUE;
2272  fDCAZMesonPrimVtxCut = 10;
2273  break;
2274  case 2: //
2275  fDCAZMesonPrimVtxCutOn = kTRUE;
2277  break;
2278  case 3: //
2279  fDCAZMesonPrimVtxCutOn = kTRUE;
2281  break;
2282  case 4: //
2283  fDCAZMesonPrimVtxCutOn = kTRUE;
2285  break;
2286  case 5: //
2287  fDCAZMesonPrimVtxCutOn = kTRUE;
2288  fDCAZMesonPrimVtxCut = 2.5;
2289  break;
2290  case 6: //
2291  fDCAZMesonPrimVtxCutOn = kTRUE;
2293  break;
2294  case 7: //
2295  fDCAZMesonPrimVtxCutOn = kTRUE;
2296  fDCAZMesonPrimVtxCut = 1.5;
2297  break;
2298  case 8: //
2299  fDCAZMesonPrimVtxCutOn = kTRUE;
2301  break;
2302  case 9: //
2303  fDCAZMesonPrimVtxCutOn = kTRUE;
2304  fDCAZMesonPrimVtxCut = 0.5;
2305  break;
2306  default:
2307  cout<<"Warning: DCAZMesonPrimVtx not defined "<<DCAZMesonPrimVtx<<endl;
2308  return kFALSE;
2309  }
2310  return kTRUE;
2311 }
2312 
2313 //________________________________________________________________________
2315  // Set Cut
2316  switch(DCARMesonPrimVtx){
2317  case 0: //
2318  fDCARMesonPrimVtxCutOn = kFALSE;
2319  fDCARMesonPrimVtxCut = 1000;
2320  break;
2321  case 1: //
2322  fDCARMesonPrimVtxCutOn = kTRUE;
2323  fDCARMesonPrimVtxCut = 10;
2324  break;
2325  case 2: //
2326  fDCARMesonPrimVtxCutOn = kTRUE;
2328  break;
2329  case 3: //
2330  fDCARMesonPrimVtxCutOn = kTRUE;
2332  break;
2333  case 4: //
2334  fDCARMesonPrimVtxCutOn = kTRUE;
2336  break;
2337  case 5: //
2338  fDCARMesonPrimVtxCutOn = kTRUE;
2339  fDCARMesonPrimVtxCut = 2.5;
2340  break;
2341  case 6: //
2342  fDCARMesonPrimVtxCutOn = kTRUE;
2344  break;
2345  case 7: //
2346  fDCARMesonPrimVtxCutOn = kTRUE;
2347  fDCARMesonPrimVtxCut = 1.5;
2348  break;
2349  case 8: //
2350  fDCARMesonPrimVtxCutOn = kTRUE;
2352  break;
2353  case 9: //
2354  fDCARMesonPrimVtxCutOn = kTRUE;
2355  fDCARMesonPrimVtxCut = 0.5;
2356  break;
2357  default:
2358  cout<<"Warning: DCARMesonPrimVtx not defined "<<DCARMesonPrimVtx<<endl;
2359  return kFALSE;
2360  }
2361  return kTRUE;
2362 }
2363 
2364 //________________________________________________________________________
2366  // Set Cut
2367 
2368  switch(minOpanMesonCut){
2369  case 0: //
2370  fMinOpanCutMeson = 0;
2371  fMinOpanPtDepCut = kFALSE;
2372  break;
2373  case 1: //
2374  fMinOpanCutMeson = 0.005;
2375  fMinOpanPtDepCut = kFALSE;
2376  break;
2377  case 2:
2378  if( fFMinOpanCut ) delete fFMinOpanCut;
2379  fFMinOpanCut = new TF1("fFMinOpanCut","[0]*exp(-[1]*x)+[2]",0.,100.);
2380  fFMinOpanCut->SetParameter(0,1.5);
2381  fFMinOpanCut->SetParameter(1,1.35);
2382  fFMinOpanCut->SetParameter(2,0.02);
2383  fMinOpanCutMeson = 0;
2384  fMinOpanPtDepCut = kTRUE;
2385  break;
2386  case 3: //
2387  fMinOpanCutMeson = 0.01;
2388  fMinOpanPtDepCut = kFALSE;
2389  break;
2390  case 4: //
2391  fMinOpanCutMeson = 0.0152; // minimum 0.75 EMCal cell diagonals
2392  fMinOpanPtDepCut = kFALSE;
2393  break;
2394  case 5: //
2395  fMinOpanCutMeson = 0.0202; // minimum 1 EMCal cell diagonal
2396  fMinOpanPtDepCut = kFALSE;
2397  break;
2398  case 6: //
2399  fMinOpanCutMeson = 0.017; // new standard cut for EMCal analyses as of 17.05.2017
2400  fMinOpanPtDepCut = kFALSE;
2401  break;
2402  case 7: //
2403  fMinOpanCutMeson = 0.016;
2404  fMinOpanPtDepCut = kFALSE;
2405  break;
2406  case 8: //
2407  fMinOpanCutMeson = 0.018;
2408  fMinOpanPtDepCut = kFALSE;
2409  break;
2410  case 9: //
2411  fMinOpanCutMeson = 0.019;
2412  fMinOpanPtDepCut = kFALSE;
2413  break;
2414 
2415  //cuts with one cell dist for GammaCalo only
2416  case 10: //a
2417  fMinOpanCutMeson = 0.;
2418  fEnableMinOpeningAngleCut = kFALSE;
2419  fMinOpanPtDepCut = kFALSE;
2420  fEnableOneCellDistCut = kTRUE;
2421  break;
2422  case 11: //b
2423  fMinOpanCutMeson = 0.0152;
2424  fEnableMinOpeningAngleCut = kFALSE;
2425  fMinOpanPtDepCut = kFALSE;
2426  fEnableOneCellDistCut = kTRUE;
2427  break;
2428  case 12: //c
2429  fMinOpanCutMeson = 0.016;
2430  fEnableMinOpeningAngleCut = kFALSE;
2431  fMinOpanPtDepCut = kFALSE;
2432  fEnableOneCellDistCut = kTRUE;
2433  break;
2434  case 13: //d
2435  fMinOpanCutMeson = 0.017;
2436  fEnableMinOpeningAngleCut = kFALSE;
2437  fMinOpanPtDepCut = kFALSE;
2438  fEnableOneCellDistCut = kTRUE;
2439  break;
2440  case 14: //e
2441  fMinOpanCutMeson = 0.018;
2442  fEnableMinOpeningAngleCut = kFALSE;
2443  fMinOpanPtDepCut = kFALSE;
2444  fEnableOneCellDistCut = kTRUE;
2445  break;
2446  case 15: //f
2447  fMinOpanCutMeson = 0.019;
2448  fEnableMinOpeningAngleCut = kFALSE;
2449  fMinOpanPtDepCut = kFALSE;
2450  fEnableOneCellDistCut = kTRUE;
2451  break;
2452  case 16: //g
2453  fMinOpanCutMeson = 0.0202;
2454  fEnableMinOpeningAngleCut = kFALSE;
2455  fMinOpanPtDepCut = kFALSE;
2456  fEnableOneCellDistCut = kTRUE;
2457  break;
2458  // opening angle cut variations for EMCal related analyses up to 17. May 2017
2459 // case 5: //
2460 // fMinOpanCutMeson = 0.0202; // minimum 1 EMCal cell diagonal
2461 // fMinOpanPtDepCut = kFALSE;
2462 // break;
2463 // case 6: //
2464 // fMinOpanCutMeson = 0.0404; // minimum 2 EMCal cell diagonals
2465 // fMinOpanPtDepCut = kFALSE;
2466 // break;
2467 // case 7: //
2468 // fMinOpanCutMeson = 0.0303; // minimum 1.5 EMCal cell diagonal
2469 // fMinOpanPtDepCut = kFALSE;
2470 // break;
2471 // case 8: //
2472 // fMinOpanCutMeson = 0.02525; // minimum 1.25 EMCal cell diagonal
2473 // fMinOpanPtDepCut = kFALSE;
2474 // break;
2475 // case 9: //
2476 // fMinOpanCutMeson = 0.03535; // minimum 1.75 EMCal cell diagonal
2477 // fMinOpanPtDepCut = kFALSE;
2478 // break;
2479  default:
2480  cout<<"Warning:minOpanMesonCut not defined "<<minOpanMesonCut<<endl;
2481  return kFALSE;
2482  }
2483 
2484  return kTRUE;
2485 }
2486 
2487 //________________________________________________________________________
2489  // Set Cut
2490  switch(maxOpanMesonCut){
2491  case 0: //
2492  fMaxOpanCutMeson = TMath::Pi();
2493  fMaxOpanPtDepCut = kFALSE;
2494  break;
2495  case 1:
2496  if( fFMaxOpanCut ) delete fFMaxOpanCut;
2497  fFMaxOpanCut = new TF1("fFMaxOpanCut","[0]*exp(-[1]*x)+[2]",0.,100.);
2498  fFMaxOpanCut->SetParameter(0,2.5);
2499  fFMaxOpanCut->SetParameter(1,0.85);
2500  fFMaxOpanCut->SetParameter(2,0.35);
2501  fMaxOpanPtDepCut = kTRUE;
2502  fMaxOpanCutMeson = TMath::Pi();
2503  break;
2504  case 2:
2505  if( fFMaxOpanCut ) delete fFMaxOpanCut;
2506  fFMaxOpanCut = new TF1("fFMaxOpanCut","[0]*exp(-[1]*x)+[2]",0.,100.);
2507  fFMaxOpanCut->SetParameter(0,2.3);
2508  fFMaxOpanCut->SetParameter(1,0.85);
2509  fFMaxOpanCut->SetParameter(2,0.35);
2510  fMaxOpanPtDepCut = kTRUE;
2511  fMaxOpanCutMeson = TMath::Pi();
2512  break;
2513  default:
2514  cout<<"Warning: maxOpanMesonCut not defined "<< maxOpanMesonCut<<endl;
2515  return kFALSE;
2516  }
2517  return kTRUE;
2518 }
2519 
2520 //________________________________________________________________________
2522  // returns TString with current cut number
2523  return fCutStringRead;
2524 }
2525 
2526 //________________________________________________________________________
2528 
2529  Int_t posLabel = photon->GetTrackLabelPositive();
2530  Int_t negLabel = photon->GetTrackLabelNegative();
2531 
2532  fElectronLabelArray[nV0*2] = posLabel;
2533  fElectronLabelArray[(nV0*2)+1] = negLabel;
2534 }
2535 
2536 //________________________________________________________________________
2538 
2539  Int_t posLabel = photon->GetTrackLabelPositive();
2540  Int_t negLabel = photon->GetTrackLabelNegative();
2541 
2542  for(Int_t i = 0; i<nV0s*2;i++){
2543  if(i==nV0*2) continue;
2544  if(i==(nV0*2)+1) continue;
2545  if(fElectronLabelArray[i] == posLabel){
2546  return kFALSE;}
2547  if(fElectronLabelArray[i] == negLabel){
2548  return kFALSE;}
2549  }
2550 
2551  return kTRUE;
2552 }
2553 //________________________________________________________________________
2555  Double_t posX = photon->GetConversionX();
2556  Double_t posY = photon->GetConversionY();
2557  Double_t posZ = photon->GetConversionZ();
2558 
2559  for(Int_t i = 0;i<photons->GetEntries();i++){
2560  if(nV0 == i) continue;
2561  AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
2562  Double_t posCompX = photonComp->GetConversionX();
2563  Double_t posCompY = photonComp->GetConversionY();
2564  Double_t posCompZ = photonComp->GetConversionZ();
2565 
2566  Double_t dist = pow((posX - posCompX),2)+pow((posY - posCompY),2)+pow((posZ - posCompZ),2);
2567 
2568  if(dist < fminV0Dist*fminV0Dist){
2569  if(photon->GetChi2perNDF() < photonComp->GetChi2perNDF()) return kTRUE;
2570  else {
2571  return kFALSE;}
2572  }
2573 
2574  }
2575  return kTRUE;
2576 }
2577 
2578 //________________________________________________________________________
2580 {
2581 
2582  if (photon==NULL) return;
2583  Double_t facPBrem = 1.;
2584  Double_t facPSig = 0.;
2585 
2586  Double_t phi=0.;
2587  Double_t theta=0.;
2588  Double_t P=0.;
2589 
2590 
2591  P=photon->P();
2592  phi=photon->Phi();
2593  if( photon->P()!=0){
2594  theta=acos( photon->Pz()/ photon->P());
2595  }
2596 
2597  if( fPSigSmearing != 0. || fPSigSmearingCte!=0. ){
2598  facPSig = TMath::Sqrt(fPSigSmearingCte*fPSigSmearingCte+fPSigSmearing*fPSigSmearing*P*P)*fRandom.Gaus(0.,1.);
2599  }
2600 
2601  if( fPBremSmearing != 1.){
2602  if(fBrem!=NULL){
2603  facPBrem = fBrem->GetRandom();
2604  }
2605  }
2606 
2607  photon->SetPx(facPBrem* (1+facPSig)* P*sin(theta)*cos(phi)) ;
2608  photon->SetPy(facPBrem* (1+facPSig)* P*sin(theta)*sin(phi)) ;
2609  photon->SetPz(facPBrem* (1+facPSig)* P*cos(theta)) ;
2610  photon->SetE(photon->P());
2611 }
2612 //________________________________________________________________________
2614 {
2615 
2616  if (photon==NULL) return;
2617  Double_t facPBrem = 1.;
2618  Double_t facPSig = 0.;
2619 
2620  Double_t phi=0.;
2621  Double_t theta=0.;
2622  Double_t P=0.;
2623 
2624 
2625  P=photon->P();
2626  phi=photon->Phi();
2627  if( photon->P()!=0){
2628  theta=acos( photon->Pz()/ photon->P());
2629  }
2630 
2631  if( fPSigSmearing != 0. || fPSigSmearingCte!=0. ){
2632  facPSig = TMath::Sqrt(fPSigSmearingCte*fPSigSmearingCte+fPSigSmearing*fPSigSmearing*P*P)*fRandom.Gaus(0.,1.);
2633  }
2634 
2635  if( fPBremSmearing != 1.){
2636  if(fBrem!=NULL){
2637  facPBrem = fBrem->GetRandom();
2638  }
2639  }
2640 
2641  photon->SetPx(facPBrem* (1+facPSig)* P*sin(theta)*cos(phi)) ;
2642  photon->SetPy(facPBrem* (1+facPSig)* P*sin(theta)*sin(phi)) ;
2643  photon->SetPz(facPBrem* (1+facPSig)* P*cos(theta)) ;
2644 
2645 }
2646 //________________________________________________________________________
2647 TLorentzVector AliConversionMesonCuts::SmearElectron(TLorentzVector particle)
2648 {
2649 
2650  //if (particle==0) return;
2651  Double_t facPBrem = 1.;
2652  Double_t facPSig = 0.;
2653 
2654  Double_t phi=0.;
2655  Double_t theta=0.;
2656  Double_t P=0.;
2657 
2658  P=particle.P();
2659  phi=particle.Phi();
2660  if (phi < 0.) phi += 2. * TMath::Pi();
2661 
2662  if( particle.P()!=0){
2663  theta=acos( particle.Pz()/ particle.P());
2664  }
2665 
2666 
2667  Double_t fPSigSmearingHalf = fPSigSmearing / 2.0; //The parameter was set for gammas with 2 particles and here we have just one electron
2668  Double_t sqrtfPSigSmearingCteHalf = fPSigSmearingCte / 2.0 ; //The parameter was set for gammas with 2 particles and here we have just one electron
2669 
2670 
2671 
2672  if( fPSigSmearingHalf != 0. || sqrtfPSigSmearingCteHalf!=0. ){
2673  facPSig = TMath::Sqrt(sqrtfPSigSmearingCteHalf*sqrtfPSigSmearingCteHalf+fPSigSmearingHalf*fPSigSmearingHalf*P*P)*fRandom.Gaus(0.,1.);
2674  }
2675 
2676  if( fPBremSmearing != 1.){
2677  if(fBrem!=NULL){
2678  facPBrem = fBrem->GetRandom();
2679  }
2680  }
2681 
2682  TLorentzVector SmearedParticle;
2683 
2684  SmearedParticle.SetXYZM( facPBrem* (1+facPSig)* P*sin(theta)*cos(phi) , facPBrem* (1+facPSig)* P*sin(theta)*sin(phi) ,
2685  facPBrem* (1+facPSig)* P*cos(theta) , TDatabasePDG::Instance()->GetParticle( ::kElectron )->Mass()) ;
2686 
2687  //particle.SetPx(facPBrem* (1+facPSig)* P*sin(theta)*cos(phi)) ;
2688  //particle.SetPy(facPBrem* (1+facPSig)* P*sin(theta)*sin(phi)) ;
2689  //particle.SetPz(facPBrem* (1+facPSig)* P*cos(theta)) ;
2690 
2691  return SmearedParticle;
2692 
2693 }
AliCaloPhotonCuts * fCaloPhotonCuts
CaloPhotonCutObject belonging to same main task.
Bool_t SetSelectionWindowMergedCut(Int_t selectionCut)
#define P(T, U, S)
double Double_t
Definition: External.C:58
Int_t fSelectionWindowCut
selection window for merged ana in mass
Definition: External.C:236
const char * title
Definition: MakeQAPdf.C:27
void FillElectonLabelArray(AliAODConversionPhoton *photon, Int_t nV0)
Bool_t SetBackgroundScheme(Int_t BackgroundScheme)
Float_t FunctionMaxMassCut(Float_t e)
Double_t fDCARMesonPrimVtxCut
cut value for the maximum distance in R between the production point of the Meson & the primary verte...
Double_t fRapidityCutMeson
max value for meson rapidity
Double_t mass
Bool_t SetNumberOfBGEvents(Int_t NumberOfBGEvents)
Int_t fMode
running mode of ConversionMesonCuts to select different sets of cut parameters for different running ...
Bool_t MesonIsSelectedAODMC(AliAODMCParticle *MCMother, TClonesArray *AODMCArray, Double_t fRapidityShift=0.)
Bool_t RejectSharedElectronV0s(AliAODConversionPhoton *photon, Int_t nV0, Int_t nV0s)
void InitCutHistograms(TString name="", Bool_t additionalHists=kFALSE)
Bool_t SetAlphaMesonMergedCut(Int_t alphaMesonCut)
Double_t fSelectionHigh
higher meson inv mass window for further selection
Bool_t SetToCloseV0sCut(Int_t toClose)
Float_t fOpeningAngle
min opening angle for meson
Bool_t fDoBG
flag to intialize BG
Bool_t MesonIsSelectedMCChiC(TParticle *fMCMother, AliStack *fMCStack, Int_t &, Int_t &, Int_t &, Double_t fRapidityShift=0.)
Bool_t SetSelectionWindowCut(Int_t selectionCut)
Double_t * sigma
Bool_t MesonIsSelectedAODMCDalitz(AliAODMCParticle *MCMother, TClonesArray *AODMCArray, Int_t &labelelectron, Int_t &labelpositron, Int_t &labelgamma, Double_t fRapidityShift=0.)
Bool_t MesonIsSelectedMCPiZeroGamma(TParticle *fMCMother, AliStack *fMCStack, Int_t &labelNeutPion, Int_t &labelGamma, Double_t fRapidityShift=0)
Bool_t SetDCAGammaGammaCut(Int_t DCAGammaGamma)
Float_t FunctionMinMassCut(Float_t e)
Bool_t fUseTrackMultiplicityForBG
flag to use track multiplicity for meson bg estimation (else V0 mult)
int Int_t
Definition: External.C:63
Bool_t SetRapidityMesonCut(Int_t RapidityMesonCut)
Bool_t SetAlphaMesonCut(Int_t alphaMesonCut)
Double_t fAlphaCutMeson
max value for meson alpha cut
float Float_t
Definition: External.C:68
Bool_t MesonIsSelectedMCDalitz(TParticle *fMCMother, AliStack *fMCStack, Int_t &labelelectron, Int_t &labelpositron, Int_t &labelgamma, Double_t fRapidityShift=0.)
void SmearParticle(AliAODConversionPhoton *photon)
Bool_t RejectToCloseV0s(AliAODConversionPhoton *photon, TList *photons, Int_t nV0)
TH2F * fHistoMesonCuts
bookkeeping for meson cuts
Bool_t fUsePtmaxMethodForBG
flag to apply Ptmax method
TObjString * fCutString
cut number used for analysis
rapidity
Definition: HFPtSpectrum.C:47
void SmearVirtualPhoton(AliAODConversionPhoton *photon)
Bool_t fEnableMinOpeningAngleCut
flag to enable min opening angle cut
Int_t fIsMergedClusterCut
flag for merged cluster and di cluster analysis
Double_t GetOpeningAngle() const
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
Bool_t MesonIsSelectedPiZeroGammaAngle(AliAODConversionMother *omega, AliAODConversionMother *pi0, AliAODConversionPhoton *gamma, Bool_t DoPiZeroAngleCut, TF1 *maxfit, Double_t lowerFactor, Double_t upperFactor)
ClassImp(AliAnalysisTaskDeltaPt) AliAnalysisTaskDeltaPt
Float_t GetDCABetweenPhotons() const
Bool_t fEnableMassCut
flag to enable mass cut
Bool_t MesonIsSelectedMCEtaPiPlPiMiGamma(TParticle *fMCMother, AliStack *fMCStack, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelGamma, Double_t fRapidityShift=0)
Bool_t fDoLightOutput
switch for running light output, kFALSE -> normal mode, kTRUE -> light mode
Bool_t fdoBGProbability
flag to use probability method for meson bg estimation
Float_t GetDCARMotherPrimVtx() const
static const char * fgkCutNames[kNCuts]
Bool_t fEnableOneCellDistCut
flag to enable 1 cell dist cut
Bool_t SetDCAZMesonPrimVtxCut(Int_t DCAZMesonPrimVtx)
AliConversionMesonCuts(const char *name="MesonCuts", const char *title="Meson Cuts")
Definition: External.C:220
Class handling all kinds of selection cuts for Gamma Conversion analysis.
Bool_t MesonIsSelected(AliAODConversionMother *pi0, Bool_t IsSignal=kTRUE, Double_t fRapidityShift=0., Int_t leadingCellID1=0, Int_t leadingCellID2=0)
Bool_t MesonIsSelectedMCPiPlPiMiPiZero(TParticle *fMCMother, AliStack *fMCStack, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelNeutPion, Double_t fRapidityShift=0)
TH2F * fHistoMesonBGCuts
bookkeeping for meson bg cuts
Bool_t SetMaxOpanMesonCut(Int_t maxOpanMesonCut)
Double_t fSelectionLow
lower meson inv mass window for further selection
Bool_t fDCARMesonPrimVtxCutOn
cut flag for the maximum distance in R between the production point of the Meson & the primary vertex...
Bool_t SetSharedElectronCut(Int_t sharedElec)
#define ASSIGNARRAY(i)
bool Bool_t
Definition: External.C:53
Bool_t fDCAZMesonPrimVtxCutOn
cut flag for the maximum distance in Z between the production point of the Meson & the primary vertex...
Bool_t SetNDegreesForRotationMethod(Int_t DegreesForRotationMethod)
Bool_t MesonIsSelectedMC(TParticle *fMCMother, AliStack *fMCStack, Double_t fRapidityShift=0.)
Bool_t SetMinOpanMesonCut(Int_t minOpanMesonCut)
Float_t GetDCAZMotherPrimVtx() const
Bool_t fUseRotationMethodInBG
flag to apply rotation method for meson bg estimation
Double_t fAlphaMinCutMeson
min value for meson alpha cut
TLorentzVector SmearElectron(TLorentzVector particle)
TList * fHistograms
List of QA histograms.
Bool_t AreNeighbours(Int_t absCellId1, Int_t absCellId2)
Bool_t SetMesonKind(Int_t mesonKind)
Double_t fDCAGammaGammaCut
cut value for the maximum distance between the two photons [cm]
Bool_t fDCAGammaGammaCutOn
cut flag for the maximum distance between the two photons
Bool_t InitializeCutsFromCutString(const TString analysisCutSelection)
Bool_t SetDCARMesonPrimVtxCut(Int_t DCARMesonPrimVtx)
Bool_t SetMCPSmearing(Int_t useMCPSmearing)
Bool_t SetCut(cutIds cutID, Int_t cut)
Double_t fDCAZMesonPrimVtxCut
cut value for the maximum distance in Z between the production point of the Meson & the primary verte...