AliPhysics  3337bb0 (3337bb0)
 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 "AliMCEvent.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 
51 ClassImp(AliConversionMesonCuts)
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  fBackgroundHandler(0),
128  fCutString(NULL),
129  fCutStringRead(""),
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  fMinOpanCutMeson(0),
200  fFMinOpanCut(0),
201  fMinOpanPtDepCut(kFALSE),
202  fMaxOpanCutMeson(TMath::Pi()),
203  fFMaxOpanCut(0),
204  fMaxOpanPtDepCut(kFALSE),
205  fBackgroundHandler(ref.fBackgroundHandler),
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,AliMCEvent *mcEvent, 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(!mcEvent)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=mcEvent->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,mcEvent)){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,mcEvent)){return kFALSE;}
444  // }
445  }
446  return kTRUE;
447  }
448  return kFALSE;
449 }
450 
451 //________________________________________________________________________
452 Bool_t AliConversionMesonCuts::MesonIsSelectedMCDalitz(TParticle *fMCMother,AliMCEvent *mcEvent, 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( !mcEvent )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*)mcEvent->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,AliMCEvent *mcEvent, 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( !mcEvent )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*)mcEvent->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,AliMCEvent *mcEvent, 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( !mcEvent )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*)mcEvent->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, AliMCEvent *mcEvent, 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(!mcEvent) 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*)mcEvent->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,AliMCEvent *mcEvent,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(!mcEvent)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*)mcEvent->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*)mcEvent->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  case 7:
1263  fSelectionLow = 0.1;
1264  fSelectionHigh = 0.155;
1265  break;
1266  case 8:
1267  fSelectionLow = 0.125;
1268  fSelectionHigh = 0.145;
1269  break;
1270  case 9:
1271  fSelectionLow = 0.11;
1272  fSelectionHigh = 0.155;
1273  break;
1274 
1275  default:
1276  cout<<"Warning: SelectionCut not defined "<<selectionCut<<endl;
1277  return kFALSE;
1278  }
1279  return kTRUE;
1280 }
1281 
1283  // Set Cut
1284  fSelectionWindowCut = selectionCut;
1285  switch(fSelectionWindowCut){
1286  case 0:
1287  fEnableMassCut = kFALSE;
1288  break;
1289  case 1: //NLM 1
1290  fEnableMassCut = kTRUE;
1291  break;
1292  case 2: //NLM 2
1293  fEnableMassCut = kTRUE;
1294  break;
1295  case 3: //NLM 1
1296  fEnableMassCut = kTRUE;
1297  break;
1298  case 4: //NLM 2
1299  fEnableMassCut = kTRUE;
1300  break;
1301  case 5: //NLM 1
1302  fEnableMassCut = kTRUE;
1303  break;
1304  case 6: //NLM 2
1305  fEnableMassCut = kTRUE;
1306  break;
1307  case 7: //min mass cut around 0
1308  fEnableMassCut = kTRUE;
1309  break;
1310  case 8: //min mass cut around 0
1311  fEnableMassCut = kTRUE;
1312  break;
1313  case 9: //min mass cut around 0
1314  fEnableMassCut = kTRUE;
1315  break;
1316  default:
1317  cout<<"Warning: SelectionCut merged not defined "<<selectionCut<<endl;
1318  return kFALSE;
1319  }
1320 
1321  return kTRUE;
1322 
1323 }
1324 
1326 
1327  Float_t switchMass = 0;
1328  Float_t aMassLow = 0;
1329  Float_t bMassLow = 0;
1330  Float_t aMassHigh = 0;
1331  Float_t bMassHigh = 0;
1332  Float_t aMass = 0;
1333  Float_t bMass = 0;
1334  Float_t switchSigma = 0.;
1335  Float_t nSigma = 0;
1336  Float_t aSigmaLow = 0.;
1337  Float_t bSigmaLow = 0;
1338  Float_t aSigmaHigh = 0.;
1339  Float_t bSigmaHigh = 0;
1340  Float_t mass = 0;
1341  Float_t sigma = 0;
1342 
1343  switch(fSelectionWindowCut){
1344  case 0:
1345  fEnableMassCut = kFALSE;
1346  break;
1347  case 1: //NLM 1
1348  aMass = 0.044;
1349  bMass = 0.0049;
1350  switchSigma = 19.;
1351  nSigma = 3;
1352  aSigmaLow = 0.012;
1353  bSigmaLow = 0;
1354  aSigmaHigh = 0.0012;
1355  bSigmaHigh = 6e-4;
1356 
1357  mass = aMass + bMass*e;
1358  sigma = 0;
1359  if (e < switchSigma){
1360  sigma = aSigmaLow + bSigmaLow*e;
1361  } else {
1362  sigma = aSigmaHigh + bSigmaHigh*e;
1363  }
1364  return mass + nSigma*sigma;
1365  break;
1366  case 2: //NLM 2
1367  switchMass = 21;
1368  aMassLow = 0.115;
1369  bMassLow = 9.6e-4;
1370  aMassHigh = 0.1;
1371  bMassHigh = 0.0017;
1372  switchSigma = 10.;
1373  nSigma = 3;
1374  aSigmaLow = 0.009;
1375  bSigmaLow = 0;
1376  aSigmaHigh = 0.0023;
1377  bSigmaHigh = 6.7e-4;
1378 
1379  mass = 0;
1380  if (e < switchMass){
1381  mass = aMassLow + bMassLow*e;
1382  } else {
1383  mass = aMassHigh + bMassHigh*e;
1384  }
1385  sigma = 0;
1386  if (e < switchSigma){
1387  sigma = aSigmaLow + bSigmaLow*e;
1388  } else {
1389  sigma = aSigmaHigh + bSigmaHigh*e;
1390  }
1391  return mass + nSigma*sigma;
1392  break;
1393  case 3: //NLM 1
1394  aMass = 0.044;
1395  bMass = 0.0049;
1396  switchSigma = 19.;
1397  nSigma = 2;
1398  aSigmaLow = 0.012;
1399  bSigmaLow = 0;
1400  aSigmaHigh = 0.0012;
1401  bSigmaHigh = 6e-4;
1402 
1403  mass = aMass + bMass*e;
1404  sigma = 0;
1405  if (e < switchSigma){
1406  sigma = aSigmaLow + bSigmaLow*e;
1407  } else {
1408  sigma = aSigmaHigh + bSigmaHigh*e;
1409  }
1410  return mass + nSigma*sigma;
1411  break;
1412  case 4: //NLM 2
1413  switchMass = 21;
1414  aMassLow = 0.115;
1415  bMassLow = 9.6e-4;
1416  aMassHigh = 0.1;
1417  bMassHigh = 0.0017;
1418  switchSigma = 10.;
1419  nSigma = 2;
1420  aSigmaLow = 0.009;
1421  bSigmaLow = 0;
1422  aSigmaHigh = 0.0023;
1423  bSigmaHigh = 6.7e-4;
1424 
1425  mass = 0;
1426  if (e < switchMass){
1427  mass = aMassLow + bMassLow*e;
1428  } else {
1429  mass = aMassHigh + bMassHigh*e;
1430  }
1431  sigma = 0;
1432  if (e < switchSigma){
1433  sigma = aSigmaLow + bSigmaLow*e;
1434  } else {
1435  sigma = aSigmaHigh + bSigmaHigh*e;
1436  }
1437  return mass + nSigma*sigma;
1438  break;
1439  case 5: //NLM 1
1440  aMass = 0.044;
1441  bMass = 0.0049;
1442  switchSigma = 19.;
1443  nSigma = 4;
1444  aSigmaLow = 0.012;
1445  bSigmaLow = 0;
1446  aSigmaHigh = 0.0012;
1447  bSigmaHigh = 6e-4;
1448 
1449  mass = aMass + bMass*e;
1450  sigma = 0;
1451  if (e < switchSigma){
1452  sigma = aSigmaLow + bSigmaLow*e;
1453  } else {
1454  sigma = aSigmaHigh + bSigmaHigh*e;
1455  }
1456  return mass + nSigma*sigma;
1457  break;
1458  case 6: //NLM 2
1459  switchMass = 21;
1460  aMassLow = 0.115;
1461  bMassLow = 9.6e-4;
1462  aMassHigh = 0.1;
1463  bMassHigh = 0.0017;
1464  switchSigma = 10.;
1465  nSigma = 4;
1466  aSigmaLow = 0.009;
1467  bSigmaLow = 0;
1468  aSigmaHigh = 0.0023;
1469  bSigmaHigh = 6.7e-4;
1470 
1471  mass = 0;
1472  if (e < switchMass){
1473  mass = aMassLow + bMassLow*e;
1474  } else {
1475  mass = aMassHigh + bMassHigh*e;
1476  }
1477  sigma = 0;
1478  if (e < switchSigma){
1479  sigma = aSigmaLow + bSigmaLow*e;
1480  } else {
1481  sigma = aSigmaHigh + bSigmaHigh*e;
1482  }
1483  return mass + nSigma*sigma;
1484  break;
1485  case 7: // maximum mass
1486  return 10000.;
1487  break;
1488  case 8: // maximum mass
1489  return 10000.;
1490  break;
1491  case 9: // maximum mass
1492  return 10000.;
1493  break;
1494  default:
1495  cout<<"Warning: SelectionCut merged not defined "<<fSelectionWindowCut<<endl;
1496  return -1;
1497  }
1498  return -1;
1499 
1500 }
1501 
1503 
1504  Float_t switchMass = 0;
1505  Float_t aMassLow = 0;
1506  Float_t bMassLow = 0;
1507  Float_t aMassHigh = 0;
1508  Float_t bMassHigh = 0;
1509  Float_t aMass = 0;
1510  Float_t bMass = 0;
1511  Float_t switchSigma = 0.;
1512  Float_t nSigma = 0;
1513  Float_t aSigmaLow = 0.;
1514  Float_t bSigmaLow = 0;
1515  Float_t aSigmaHigh = 0.;
1516  Float_t bSigmaHigh = 0;
1517  Float_t mass = 0;
1518  Float_t sigma = 0;
1519 
1520  switch(fSelectionWindowCut){
1521  case 0:
1522  fEnableMassCut = kFALSE;
1523  break;
1524  case 1: //NLM 1
1525  aMass = 0.044;
1526  bMass = 0.0049;
1527  switchSigma = 19.;
1528  nSigma = 3;
1529  aSigmaLow = 0.012;
1530  bSigmaLow = 0;
1531  aSigmaHigh = 0.0012;
1532  bSigmaHigh = 6e-4;
1533 
1534  mass = aMass + bMass*e;
1535  sigma = 0;
1536  if (e < switchSigma){
1537  sigma = aSigmaLow + bSigmaLow*e;
1538  } else {
1539  sigma = aSigmaHigh + bSigmaHigh*e;
1540  }
1541  // cout << "E: "<< e << "\t mass: " << mass << "\t sigma: " << sigma<< endl;
1542  return mass - nSigma*sigma;
1543  break;
1544  case 2: //NLM 2
1545  switchMass = 21;
1546  aMassLow = 0.115;
1547  bMassLow = 9.6e-4;
1548  aMassHigh = 0.1;
1549  bMassHigh = 0.0017;
1550  switchSigma = 10.;
1551  nSigma = 3;
1552  aSigmaLow = 0.009;
1553  bSigmaLow = 0;
1554  aSigmaHigh = 0.0023;
1555  bSigmaHigh = 6.7e-4;
1556 
1557  mass = 0;
1558  if (e < switchMass){
1559  mass = aMassLow + bMassLow*e;
1560  } else {
1561  mass = aMassHigh + bMassHigh*e;
1562  }
1563  sigma = 0;
1564  if (e < switchSigma){
1565  sigma = aSigmaLow + bSigmaLow*e;
1566  } else {
1567  sigma = aSigmaHigh + bSigmaHigh*e;
1568  }
1569  // cout << "E: "<< e << "\t mass: " << mass << "\t sigma: "<< sigma << endl;
1570 
1571  return mass - nSigma*sigma;
1572  break;
1573  case 3: //NLM 1
1574  aMass = 0.044;
1575  bMass = 0.0049;
1576  switchSigma = 19.;
1577  nSigma = 2;
1578  aSigmaLow = 0.012;
1579  bSigmaLow = 0;
1580  aSigmaHigh = 0.0012;
1581  bSigmaHigh = 6e-4;
1582 
1583  mass = aMass + bMass*e;
1584  sigma = 0;
1585  if (e < switchSigma){
1586  sigma = aSigmaLow + bSigmaLow*e;
1587  } else {
1588  sigma = aSigmaHigh + bSigmaHigh*e;
1589  }
1590  // cout << "E: "<< e << "\t mass: " << mass << "\t sigma: " << sigma<< endl;
1591  return mass - nSigma*sigma;
1592  break;
1593  case 4: //NLM 2
1594  switchMass = 21;
1595  aMassLow = 0.115;
1596  bMassLow = 9.6e-4;
1597  aMassHigh = 0.1;
1598  bMassHigh = 0.0017;
1599  switchSigma = 10.;
1600  nSigma = 2;
1601  aSigmaLow = 0.009;
1602  bSigmaLow = 0;
1603  aSigmaHigh = 0.0023;
1604  bSigmaHigh = 6.7e-4;
1605 
1606  mass = 0;
1607  if (e < switchMass){
1608  mass = aMassLow + bMassLow*e;
1609  } else {
1610  mass = aMassHigh + bMassHigh*e;
1611  }
1612  sigma = 0;
1613  if (e < switchSigma){
1614  sigma = aSigmaLow + bSigmaLow*e;
1615  } else {
1616  sigma = aSigmaHigh + bSigmaHigh*e;
1617  }
1618  // cout << "E: "<< e << "\t mass: " << mass << "\t sigma: "<< sigma << endl;
1619 
1620  return mass - nSigma*sigma;
1621  break;
1622  case 5: //NLM 1
1623  aMass = 0.044;
1624  bMass = 0.0049;
1625  switchSigma = 19.;
1626  nSigma = 4;
1627  aSigmaLow = 0.012;
1628  bSigmaLow = 0;
1629  aSigmaHigh = 0.0012;
1630  bSigmaHigh = 6e-4;
1631 
1632  mass = aMass + bMass*e;
1633  sigma = 0;
1634  if (e < switchSigma){
1635  sigma = aSigmaLow + bSigmaLow*e;
1636  } else {
1637  sigma = aSigmaHigh + bSigmaHigh*e;
1638  }
1639  // cout << "E: "<< e << "\t mass: " << mass << "\t sigma: " << sigma<< endl;
1640  return mass - nSigma*sigma;
1641  break;
1642  case 6: //NLM 2
1643  switchMass = 21;
1644  aMassLow = 0.115;
1645  bMassLow = 9.6e-4;
1646  aMassHigh = 0.1;
1647  bMassHigh = 0.0017;
1648  switchSigma = 10.;
1649  nSigma = 4;
1650  aSigmaLow = 0.009;
1651  bSigmaLow = 0;
1652  aSigmaHigh = 0.0023;
1653  bSigmaHigh = 6.7e-4;
1654 
1655  mass = 0;
1656  if (e < switchMass){
1657  mass = aMassLow + bMassLow*e;
1658  } else {
1659  mass = aMassHigh + bMassHigh*e;
1660  }
1661  sigma = 0;
1662  if (e < switchSigma){
1663  sigma = aSigmaLow + bSigmaLow*e;
1664  } else {
1665  sigma = aSigmaHigh + bSigmaHigh*e;
1666  }
1667  // cout << "E: "<< e << "\t mass: " << mass << "\t sigma: "<< sigma << endl;
1668  return mass - nSigma*sigma;
1669  break;
1670 
1671  case 7: // just exclude band at 0
1672  return 0.005+0.004*e;
1673  break;
1674  case 8: // just exclude band at 0 looser
1675  return 0.004+0.004*e;
1676  break;
1677  case 9: // just exclude band at 0 tighter
1678  return 0.006+0.004*e;
1679  break;
1680 
1681  default:
1682  cout<<"Warning: SelectionCut merged not defined "<<fSelectionWindowCut<<endl;
1683  return -1;
1684  }
1685  return -1;
1686 }
1687 
1688 //________________________________________________________________________
1690 { // Set Cut
1691  switch(alphaMesonCut){
1692  case 0: // 0- 0.7
1693  fAlphaMinCutMeson = 0.0;
1694  fAlphaCutMeson = 0.7;
1695  fAlphaPtDepCut = kFALSE;
1696  break;
1697  case 1: // Updated 15 May 2015
1698  if (fIsMergedClusterCut == 0){
1699  if( fFAlphaCut ) delete fFAlphaCut;
1700  fFAlphaCut = new TF1("fFAlphaCut","[0]*tanh([1]*x)",0.,100.);
1701  fFAlphaCut->SetParameter(0,0.65);
1702  fFAlphaCut->SetParameter(1,1.8);
1703  fAlphaMinCutMeson = 0.0;
1704  fAlphaCutMeson = -1.0;
1705  fAlphaPtDepCut = kTRUE;
1706  } else {
1707  fAlphaPtDepCut = kFALSE;
1708  fAlphaMinCutMeson = 0.5;
1709  fAlphaCutMeson = 1;
1710  }
1711  break;
1712  case 2: // Updated 31 October 2013 before 0.5-1
1713  if (fIsMergedClusterCut == 0){
1714  if( fFAlphaCut ) delete fFAlphaCut;
1715  fFAlphaCut = new TF1("fFAlphaCut","[0]*tanh([1]*x)",0.,100.);
1716  fFAlphaCut->SetParameter(0,0.8);
1717  fFAlphaCut->SetParameter(1,1.2);
1718  fAlphaMinCutMeson = 0.0;
1719  fAlphaCutMeson = -1.0;
1720  fAlphaPtDepCut = kTRUE;
1721  } else {
1722  fAlphaPtDepCut = kFALSE;
1723  fAlphaMinCutMeson = 0.6;
1724  fAlphaCutMeson = 1;
1725  }
1726  break;
1727  case 3: // 0.0-1
1728  fAlphaMinCutMeson = 0.0;
1729  fAlphaCutMeson = 1.;
1730  fAlphaPtDepCut = kFALSE;
1731  break;
1732  case 4: // 0-0.65
1733  fAlphaMinCutMeson = 0.0;
1734  fAlphaCutMeson = 0.65;
1735  fAlphaPtDepCut = kFALSE;
1736  break;
1737  case 5: // 0-0.75
1738  fAlphaMinCutMeson = 0.0;
1739  fAlphaCutMeson = 0.75;
1740  fAlphaPtDepCut = kFALSE;
1741  break;
1742  case 6: // 0-0.8
1743  fAlphaMinCutMeson = 0.0;
1744  fAlphaCutMeson = 0.8;
1745  fAlphaPtDepCut = kFALSE;
1746  break;
1747  case 7: // 0.0-0.85
1748  fAlphaMinCutMeson = 0.0;
1749  fAlphaCutMeson = 0.85;
1750  fAlphaPtDepCut = kFALSE;
1751  break;
1752  case 8: // 0.0-0.6
1753  fAlphaMinCutMeson = 0.0;
1754  fAlphaCutMeson = 0.6;
1755  fAlphaPtDepCut = kFALSE;
1756  break;
1757  case 9: // Updated 11 November 2013 before 0.0 - 0.3
1758  if (fIsMergedClusterCut == 0){
1759  if( fFAlphaCut ) delete fFAlphaCut;
1760  fFAlphaCut = new TF1("fFAlphaCut","[0]*tanh([1]*x)",0.,100.);
1761  fFAlphaCut->SetParameter(0,0.65);
1762  fFAlphaCut->SetParameter(1,1.2);
1763  fAlphaMinCutMeson = 0.0;
1764  fAlphaCutMeson = -1.0;
1765  fAlphaPtDepCut = kTRUE;
1766  } else {
1767  fAlphaPtDepCut = kFALSE;
1768  fAlphaMinCutMeson = 0.4;
1769  fAlphaCutMeson = 1;
1770  }
1771  break;
1772  case 10: //a 0-0.2
1773  fAlphaMinCutMeson = 0.0;
1774  fAlphaCutMeson = 0.2;
1775  fAlphaPtDepCut = kFALSE;
1776  break;
1777  case 11: //b 0.2-0.6
1778  fAlphaMinCutMeson = 0.2;
1779  fAlphaCutMeson = 0.6;
1780  fAlphaPtDepCut = kFALSE;
1781  break;
1782  case 12: //c 0.6-1.0
1783  fAlphaMinCutMeson = 0.6;
1784  fAlphaCutMeson = 1.0;
1785  fAlphaPtDepCut = kFALSE;
1786  break;
1787  default:
1788  cout<<"Warning: AlphaMesonCut not defined "<<alphaMesonCut<<endl;
1789  return kFALSE;
1790  }
1791  return kTRUE;
1792 }
1793 
1794 
1795 //________________________________________________________________________
1797 { // Set Cut
1798  switch(alphaMesonCut){
1799  case 0: // 0- 1
1800  fAlphaMinCutMeson = 0.0;
1801  fAlphaCutMeson = 1;
1802  fAlphaPtDepCut = kFALSE;
1803  break;
1804  case 1: // cut for NLM 1
1805  if( fFAlphaCut ) delete fFAlphaCut;
1806  fFAlphaCut = new TF1("fFAlphaCut","[0]+[1]*x+[2]/(x*x*x)",0.,100.);
1807  fFAlphaCut->SetParameter(0,0.96);
1808  fFAlphaCut->SetParameter(1,0);
1809  fFAlphaCut->SetParameter(2,-879);
1810  fAlphaMinCutMeson = 0.0;
1811  fAlphaCutMeson = -1.0;
1812  fAlphaPtDepCut = kTRUE;
1813  break;
1814  case 2: // cut for NLM 2
1815  if( fFAlphaCut ) delete fFAlphaCut;
1816  fFAlphaCut = new TF1("fFAlphaCut","[0]+[1]*x+[2]/(x*x*x)",0.,100.);
1817  fFAlphaCut->SetParameter(0,0.95);
1818  fFAlphaCut->SetParameter(1,0.0015);
1819  fFAlphaCut->SetParameter(2,-233);
1820  fAlphaMinCutMeson = 0.0;
1821  fAlphaCutMeson = -1.0;
1822  fAlphaPtDepCut = kTRUE;
1823  break;
1824  case 3: // cut for NLM 1 larger
1825  if( fFAlphaCut ) delete fFAlphaCut;
1826  fFAlphaCut = new TF1("fFAlphaCut","[0]+[1]*x+[2]/(x*x*x)",0.,100.);
1827  fFAlphaCut->SetParameter(0,0.975);
1828  fFAlphaCut->SetParameter(1,0);
1829  fFAlphaCut->SetParameter(2,-800);
1830  fAlphaMinCutMeson = 0.0;
1831  fAlphaCutMeson = -1.0;
1832  fAlphaPtDepCut = kTRUE;
1833  break;
1834  case 4: // cut for NLM 2 larger
1835  if( fFAlphaCut ) delete fFAlphaCut;
1836  fFAlphaCut = new TF1("fFAlphaCut","[0]+[1]*x+[2]/(x*x*x)",0.,100.);
1837  fFAlphaCut->SetParameter(0,0.97);
1838  fFAlphaCut->SetParameter(1,0.0015);
1839  fFAlphaCut->SetParameter(2,-200);
1840  fAlphaMinCutMeson = 0.0;
1841  fAlphaCutMeson = -1.0;
1842  fAlphaPtDepCut = kTRUE;
1843  break;
1844  case 5: // cut for NLM 1 smaller
1845  if( fFAlphaCut ) delete fFAlphaCut;
1846  fFAlphaCut = new TF1("fFAlphaCut","[0]+[1]*x+[2]/(x*x*x)",0.,100.);
1847  fFAlphaCut->SetParameter(0,0.94);
1848  fFAlphaCut->SetParameter(1,0);
1849  fFAlphaCut->SetParameter(2,-970);
1850  fAlphaMinCutMeson = 0.0;
1851  fAlphaCutMeson = -1.0;
1852  fAlphaPtDepCut = kTRUE;
1853  break;
1854  case 6: // cut for NLM 2 smaller
1855  if( fFAlphaCut ) delete fFAlphaCut;
1856  fFAlphaCut = new TF1("fFAlphaCut","[0]+[1]*x+[2]/(x*x*x)",0.,100.);
1857  fFAlphaCut->SetParameter(0,0.935);
1858  fFAlphaCut->SetParameter(1,0.0015);
1859  fFAlphaCut->SetParameter(2,-273);
1860  fAlphaMinCutMeson = 0.0;
1861  fAlphaCutMeson = -1.0;
1862  fAlphaPtDepCut = kTRUE;
1863  break;
1864 
1865  default:
1866  cout<<"Warning: AlphaMesonCut for merged clusters not defined "<<alphaMesonCut<<endl;
1867  return kFALSE;
1868  }
1869  return kTRUE;
1870 }
1871 
1872 //________________________________________________________________________
1874  // Set Cut
1875  switch(RapidityMesonCut){
1876  case 0: // changed from 0.9 to 1.35
1877  fRapidityCutMeson = 1.35;
1878  break;
1879  case 1: //
1880  fRapidityCutMeson = 0.8;
1881  break;
1882  case 2: //
1883  fRapidityCutMeson = 0.7;
1884  break;
1885  case 3: //
1886  fRapidityCutMeson = 0.6;
1887  break;
1888  case 4: //
1889  fRapidityCutMeson = 0.5;
1890  break;
1891  case 5: //
1892  fRapidityCutMeson = 0.85;
1893  break;
1894  case 6: //
1895  fRapidityCutMeson = 0.75;
1896  break;
1897  case 7: //
1898  fRapidityCutMeson = 0.3;
1899  break;
1900  case 8: //changed, before 0.35
1901  fRapidityCutMeson = 0.25;
1902  break;
1903  case 9: //
1904  fRapidityCutMeson = 0.4;
1905  break;
1906  default:
1907  cout<<"Warning: RapidityMesonCut not defined "<<RapidityMesonCut<<endl;
1908  return kFALSE;
1909  }
1910  return kTRUE;
1911 }
1912 
1913 
1914 //________________________________________________________________________
1916  // Set Cut
1917  switch(BackgroundScheme){
1918  case 0: //Rotation
1919  fUseRotationMethodInBG = kTRUE;
1920  fdoBGProbability = kFALSE;
1921  break;
1922  case 1: // mixed event with V0 multiplicity
1923  fUseRotationMethodInBG = kFALSE;
1924  fUseTrackMultiplicityForBG = kFALSE;
1925  fdoBGProbability = kFALSE;
1926  break;
1927  case 2: // mixed event with track multiplicity
1928  fUseRotationMethodInBG = kFALSE;
1930  fdoBGProbability = kFALSE;
1931  break;
1932  case 3: //Rotation
1933  fUseRotationMethodInBG = kTRUE;
1934  fdoBGProbability = kTRUE;
1935  break;
1936  case 4: //No BG calculation
1937  cout << "no BG calculation should be done" << endl;
1938  fUseRotationMethodInBG = kFALSE;
1939  fdoBGProbability = kFALSE;
1940  fDoBG = kFALSE;
1941  break;
1942  case 5: //Rotation
1943  fUseRotationMethodInBG = kTRUE;
1944  fdoBGProbability = kFALSE;
1945  fBackgroundHandler = 1;
1946  break;
1947  case 6: // mixed event with V0 multiplicity
1948  fUseRotationMethodInBG = kFALSE;
1949  fUseTrackMultiplicityForBG = kFALSE;
1950  fdoBGProbability = kFALSE;
1951  fBackgroundHandler = 1;
1952  break;
1953  case 7: // mixed event with track multiplicity
1954  fUseRotationMethodInBG = kFALSE;
1956  fdoBGProbability = kFALSE;
1957  fBackgroundHandler = 1;
1958  break;
1959  case 8: //Rotation
1960  fUseRotationMethodInBG = kTRUE;
1961  fdoBGProbability = kTRUE;
1962  fBackgroundHandler = 1;
1963  break;
1964  case 9: // mixed event with Ptmax method
1965  fUseRotationMethodInBG = kFALSE;
1966  fUseTrackMultiplicityForBG = kFALSE;
1967  fdoBGProbability = kFALSE;
1968  fUsePtmaxMethodForBG = kTRUE;
1969  break;
1970  default:
1971  cout<<"Warning: BackgroundScheme not defined "<<BackgroundScheme<<endl;
1972  return kFALSE;
1973  }
1974  return kTRUE;
1975 }
1976 
1977 
1978 //________________________________________________________________________
1980  // Set Cut
1981  switch(DegreesForRotationMethod){
1982  case 0:
1984  break;
1985  case 1:
1987  break;
1988  case 2:
1990  break;
1991  case 3:
1993  break;
1994  default:
1995  cout<<"Warning: DegreesForRotationMethod not defined "<<DegreesForRotationMethod<<endl;
1996  return kFALSE;
1997  }
1998  fCuts[kDegreesForRotationMethod]=DegreesForRotationMethod;
1999  return kTRUE;
2000 }
2001 
2002 //________________________________________________________________________
2004  // Set Cut
2005  switch(NumberOfBGEvents){
2006  case 0:
2007  fNumberOfBGEvents = 5;
2008  break;
2009  case 1:
2010  fNumberOfBGEvents = 10;
2011  break;
2012  case 2:
2013  fNumberOfBGEvents = 15;
2014  break;
2015  case 3:
2016  fNumberOfBGEvents = 20;
2017  break;
2018  case 4:
2019  fNumberOfBGEvents = 2;
2020  break;
2021  case 5:
2022  fNumberOfBGEvents = 50;
2023  break;
2024  case 6:
2025  fNumberOfBGEvents = 80;
2026  break;
2027  case 7:
2028  fNumberOfBGEvents = 100;
2029  break;
2030  default:
2031  cout<<"Warning: NumberOfBGEvents not defined "<<NumberOfBGEvents<<endl;
2032  return kFALSE;
2033  }
2034  return kTRUE;
2035 }
2036 //________________________________________________________________________
2038 
2039  switch(sharedElec){
2040  case 0:
2041  fDoSharedElecCut = kFALSE;
2042  break;
2043  case 1:
2044  fDoSharedElecCut = kTRUE;
2045  break;
2046  default:
2047  cout<<"Warning: Shared Electron Cut not defined "<<sharedElec<<endl;
2048  return kFALSE;
2049  }
2050 
2051  return kTRUE;
2052 }
2053 
2054 //________________________________________________________________________
2056 
2057  switch(toClose){
2058  case 0:
2059  fDoToCloseV0sCut = kFALSE;
2060  fminV0Dist = 250;
2061  break;
2062  case 1:
2063  fDoToCloseV0sCut = kTRUE;
2064  fminV0Dist = 1;
2065  break;
2066  case 2:
2067  fDoToCloseV0sCut = kTRUE;
2068  fminV0Dist = 2;
2069  break;
2070  case 3:
2071  fDoToCloseV0sCut = kTRUE;
2072  fminV0Dist = 3;
2073  break;
2074  default:
2075  cout<<"Warning: Shared Electron Cut not defined "<<toClose<<endl;
2076  return kFALSE;
2077  }
2078  return kTRUE;
2079 }
2080 
2081 //________________________________________________________________________
2083 {// Set Cut
2084  if(fMode == 2){ //PCM-EMCal running
2085  switch(useMCPSmearing){
2086  case 0:
2087  fUseMCPSmearing = 0;
2088  fPBremSmearing = 1.;
2089  fPSigSmearing = 0.;
2090  fPSigSmearingCte = 0.;
2091  break;
2092  case 1:
2093  fUseMCPSmearing = 1;
2094  fPBremSmearing = 1;
2095  fPSigSmearing = 0.010;
2096  fPSigSmearingCte = 0.010;
2097  break;
2098  case 2:
2099  fUseMCPSmearing = 1;
2100  fPBremSmearing = 1;
2101  fPSigSmearing = 0.015;
2102  fPSigSmearingCte = 0.010;
2103  break;
2104  case 3:
2105  fUseMCPSmearing = 1;
2106  fPBremSmearing = 1.;
2107  fPSigSmearing = 0.020;
2108  fPSigSmearingCte = 0.010;
2109  break;
2110  case 4:
2111  fUseMCPSmearing = 1;
2112  fPBremSmearing = 1.;
2113  fPSigSmearing = 0.020;
2114  fPSigSmearingCte = 0.020;
2115  break;
2116  case 5:
2117  fUseMCPSmearing = 1;
2118  fPBremSmearing = 1.;
2119  fPSigSmearing = 0.030;
2120  fPSigSmearingCte = 0.020;
2121  break;
2122  case 6:
2123  fUseMCPSmearing = 1;
2124  fPBremSmearing = 1.;
2125  fPSigSmearing = 0.030;
2126  fPSigSmearingCte = 0.030;
2127  break;
2128  case 7:
2129  fUseMCPSmearing = 1;
2130  fPBremSmearing = 1;
2131  fPSigSmearing = 0.030;
2132  fPSigSmearingCte = 0.050;
2133  break;
2134  case 8:
2135  fUseMCPSmearing = 1;
2136  fPBremSmearing = 1.;
2137  fPSigSmearing = 0.030;
2138  fPSigSmearingCte = 0.060;
2139  break;
2140  case 9:
2141  fUseMCPSmearing = 1;
2142  fPBremSmearing = 1.;
2143  fPSigSmearing = 0.075;
2144  fPSigSmearingCte = 0.050;
2145  break;
2146 
2147  default:
2148  AliError("Warning: UseMCPSmearing not defined");
2149  return kFALSE;
2150  }
2151  }else{
2152  switch(useMCPSmearing){
2153  case 0:
2154  fUseMCPSmearing = 0;
2155  fPBremSmearing = 1.;
2156  fPSigSmearing = 0.;
2157  fPSigSmearingCte = 0.;
2158  break;
2159  case 1:
2160  fUseMCPSmearing = 1;
2161  fPBremSmearing = 1.0e-14;
2162  fPSigSmearing = 0.;
2163  fPSigSmearingCte = 0.;
2164  break;
2165  case 2:
2166  fUseMCPSmearing = 1;
2167  fPBremSmearing = 1.0e-15;
2168  fPSigSmearing = 0.0;
2169  fPSigSmearingCte = 0.;
2170  break;
2171  case 3:
2172  fUseMCPSmearing = 1;
2173  fPBremSmearing = 1.;
2174  fPSigSmearing = 0.003;
2175  fPSigSmearingCte = 0.002;
2176  break;
2177  case 4:
2178  fUseMCPSmearing = 1;
2179  fPBremSmearing = 1.;
2180  fPSigSmearing = 0.003;
2181  fPSigSmearingCte = 0.007;
2182  break;
2183  case 5:
2184  fUseMCPSmearing = 1;
2185  fPBremSmearing = 1.;
2186  fPSigSmearing = 0.003;
2187  fPSigSmearingCte = 0.016;
2188  break;
2189  case 6:
2190  fUseMCPSmearing = 1;
2191  fPBremSmearing = 1.;
2192  fPSigSmearing = 0.007;
2193  fPSigSmearingCte = 0.016;
2194  break;
2195  case 7:
2196  fUseMCPSmearing = 1;
2197  fPBremSmearing = 1.0e-16;
2198  fPSigSmearing = 0.0;
2199  fPSigSmearingCte = 0.;
2200  break;
2201  case 8:
2202  fUseMCPSmearing = 1;
2203  fPBremSmearing = 1.;
2204  fPSigSmearing = 0.007;
2205  fPSigSmearingCte = 0.014;
2206  break;
2207  case 9:
2208  fUseMCPSmearing = 1;
2209  fPBremSmearing = 1.;
2210  fPSigSmearing = 0.007;
2211  fPSigSmearingCte = 0.011;
2212  break;
2213 
2214  default:
2215  AliError("Warning: UseMCPSmearing not defined");
2216  return kFALSE;
2217  }
2218  }
2219  return kTRUE;
2220 }
2221 
2222 
2223 //________________________________________________________________________
2225  // Set Cut
2226  switch(DCAGammaGamma){
2227  case 0: //
2228  fDCAGammaGammaCutOn = kFALSE;
2229  fDCAGammaGammaCut = 1000;
2230  break;
2231  case 1: //
2232  fDCAGammaGammaCutOn = kTRUE;
2233  fDCAGammaGammaCut = 10;
2234  break;
2235  case 2: //
2236  fDCAGammaGammaCutOn = kTRUE;
2237  fDCAGammaGammaCut = 5;
2238  break;
2239  case 3: //
2240  fDCAGammaGammaCutOn = kTRUE;
2241  fDCAGammaGammaCut = 4;
2242  break;
2243  case 4: //
2244  fDCAGammaGammaCutOn = kTRUE;
2245  fDCAGammaGammaCut = 3;
2246  break;
2247  case 5: //
2248  fDCAGammaGammaCutOn = kTRUE;
2249  fDCAGammaGammaCut = 2.5;
2250  break;
2251  case 6: //
2252  fDCAGammaGammaCutOn = kTRUE;
2253  fDCAGammaGammaCut = 2;
2254  break;
2255  case 7: //
2256  fDCAGammaGammaCutOn = kTRUE;
2257  fDCAGammaGammaCut = 1.5;
2258  break;
2259  case 8: //
2260  fDCAGammaGammaCutOn = kTRUE;
2261  fDCAGammaGammaCut = 1;
2262  break;
2263  case 9: //
2264  fDCAGammaGammaCutOn = kTRUE;
2265  fDCAGammaGammaCut = 0.5;
2266  break;
2267  default:
2268  cout<<"Warning: DCAGammaGamma not defined "<<DCAGammaGamma<<endl;
2269  return kFALSE;
2270  }
2271  return kTRUE;
2272 }
2273 
2274 //________________________________________________________________________
2276  // Set Cut
2277  switch(DCAZMesonPrimVtx){
2278  case 0: //
2279  fDCAZMesonPrimVtxCutOn = kFALSE;
2280  fDCAZMesonPrimVtxCut = 1000;
2281  break;
2282  case 1: //
2283  fDCAZMesonPrimVtxCutOn = kTRUE;
2284  fDCAZMesonPrimVtxCut = 10;
2285  break;
2286  case 2: //
2287  fDCAZMesonPrimVtxCutOn = kTRUE;
2289  break;
2290  case 3: //
2291  fDCAZMesonPrimVtxCutOn = kTRUE;
2293  break;
2294  case 4: //
2295  fDCAZMesonPrimVtxCutOn = kTRUE;
2297  break;
2298  case 5: //
2299  fDCAZMesonPrimVtxCutOn = kTRUE;
2300  fDCAZMesonPrimVtxCut = 2.5;
2301  break;
2302  case 6: //
2303  fDCAZMesonPrimVtxCutOn = kTRUE;
2305  break;
2306  case 7: //
2307  fDCAZMesonPrimVtxCutOn = kTRUE;
2308  fDCAZMesonPrimVtxCut = 1.5;
2309  break;
2310  case 8: //
2311  fDCAZMesonPrimVtxCutOn = kTRUE;
2313  break;
2314  case 9: //
2315  fDCAZMesonPrimVtxCutOn = kTRUE;
2316  fDCAZMesonPrimVtxCut = 0.5;
2317  break;
2318  default:
2319  cout<<"Warning: DCAZMesonPrimVtx not defined "<<DCAZMesonPrimVtx<<endl;
2320  return kFALSE;
2321  }
2322  return kTRUE;
2323 }
2324 
2325 //________________________________________________________________________
2327  // Set Cut
2328  switch(DCARMesonPrimVtx){
2329  case 0: //
2330  fDCARMesonPrimVtxCutOn = kFALSE;
2331  fDCARMesonPrimVtxCut = 1000;
2332  break;
2333  case 1: //
2334  fDCARMesonPrimVtxCutOn = kTRUE;
2335  fDCARMesonPrimVtxCut = 10;
2336  break;
2337  case 2: //
2338  fDCARMesonPrimVtxCutOn = kTRUE;
2340  break;
2341  case 3: //
2342  fDCARMesonPrimVtxCutOn = kTRUE;
2344  break;
2345  case 4: //
2346  fDCARMesonPrimVtxCutOn = kTRUE;
2348  break;
2349  case 5: //
2350  fDCARMesonPrimVtxCutOn = kTRUE;
2351  fDCARMesonPrimVtxCut = 2.5;
2352  break;
2353  case 6: //
2354  fDCARMesonPrimVtxCutOn = kTRUE;
2356  break;
2357  case 7: //
2358  fDCARMesonPrimVtxCutOn = kTRUE;
2359  fDCARMesonPrimVtxCut = 1.5;
2360  break;
2361  case 8: //
2362  fDCARMesonPrimVtxCutOn = kTRUE;
2364  break;
2365  case 9: //
2366  fDCARMesonPrimVtxCutOn = kTRUE;
2367  fDCARMesonPrimVtxCut = 0.5;
2368  break;
2369  default:
2370  cout<<"Warning: DCARMesonPrimVtx not defined "<<DCARMesonPrimVtx<<endl;
2371  return kFALSE;
2372  }
2373  return kTRUE;
2374 }
2375 
2376 //________________________________________________________________________
2378  // Set Cut
2379 
2380  switch(minOpanMesonCut){
2381  case 0: //
2382  fMinOpanCutMeson = 0;
2383  fMinOpanPtDepCut = kFALSE;
2384  break;
2385  case 1: //
2386  fMinOpanCutMeson = 0.005;
2387  fMinOpanPtDepCut = kFALSE;
2388  break;
2389  case 2:
2390  if( fFMinOpanCut ) delete fFMinOpanCut;
2391  fFMinOpanCut = new TF1("fFMinOpanCut","[0]*exp(-[1]*x)+[2]",0.,100.);
2392  fFMinOpanCut->SetParameter(0,1.5);
2393  fFMinOpanCut->SetParameter(1,1.35);
2394  fFMinOpanCut->SetParameter(2,0.02);
2395  fMinOpanCutMeson = 0;
2396  fMinOpanPtDepCut = kTRUE;
2397  break;
2398  case 3: //
2399  fMinOpanCutMeson = 0.01;
2400  fMinOpanPtDepCut = kFALSE;
2401  break;
2402  case 4: //
2403  fMinOpanCutMeson = 0.0152; // minimum 0.75 EMCal cell diagonals
2404  fMinOpanPtDepCut = kFALSE;
2405  break;
2406  case 5: //
2407  fMinOpanCutMeson = 0.0202; // minimum 1 EMCal cell diagonal
2408  fMinOpanPtDepCut = kFALSE;
2409  break;
2410  case 6: //
2411  fMinOpanCutMeson = 0.017; // new standard cut for EMCal analyses as of 17.05.2017
2412  fMinOpanPtDepCut = kFALSE;
2413  break;
2414  case 7: //
2415  fMinOpanCutMeson = 0.016;
2416  fMinOpanPtDepCut = kFALSE;
2417  break;
2418  case 8: //
2419  fMinOpanCutMeson = 0.018;
2420  fMinOpanPtDepCut = kFALSE;
2421  break;
2422  case 9: //
2423  fMinOpanCutMeson = 0.019;
2424  fMinOpanPtDepCut = kFALSE;
2425  break;
2426 
2427  //cuts with one cell dist for GammaCalo only
2428  case 10: //a
2429  fMinOpanCutMeson = 0.;
2430  fEnableMinOpeningAngleCut = kFALSE;
2431  fMinOpanPtDepCut = kFALSE;
2432  fEnableOneCellDistCut = kTRUE;
2433  break;
2434  case 11: //b
2435  fMinOpanCutMeson = 0.0152;
2436  fEnableMinOpeningAngleCut = kFALSE;
2437  fMinOpanPtDepCut = kFALSE;
2438  fEnableOneCellDistCut = kTRUE;
2439  break;
2440  case 12: //c
2441  fMinOpanCutMeson = 0.016;
2442  fEnableMinOpeningAngleCut = kFALSE;
2443  fMinOpanPtDepCut = kFALSE;
2444  fEnableOneCellDistCut = kTRUE;
2445  break;
2446  case 13: //d
2447  fMinOpanCutMeson = 0.017;
2448  fEnableMinOpeningAngleCut = kFALSE;
2449  fMinOpanPtDepCut = kFALSE;
2450  fEnableOneCellDistCut = kTRUE;
2451  break;
2452  case 14: //e
2453  fMinOpanCutMeson = 0.018;
2454  fEnableMinOpeningAngleCut = kFALSE;
2455  fMinOpanPtDepCut = kFALSE;
2456  fEnableOneCellDistCut = kTRUE;
2457  break;
2458  case 15: //f
2459  fMinOpanCutMeson = 0.019;
2460  fEnableMinOpeningAngleCut = kFALSE;
2461  fMinOpanPtDepCut = kFALSE;
2462  fEnableOneCellDistCut = kTRUE;
2463  break;
2464  case 16: //g
2465  fMinOpanCutMeson = 0.0202;
2466  fEnableMinOpeningAngleCut = kFALSE;
2467  fMinOpanPtDepCut = kFALSE;
2468  fEnableOneCellDistCut = kTRUE;
2469  break;
2470  // opening angle cut variations for EMCal related analyses up to 17. May 2017
2471 // case 5: //
2472 // fMinOpanCutMeson = 0.0202; // minimum 1 EMCal cell diagonal
2473 // fMinOpanPtDepCut = kFALSE;
2474 // break;
2475 // case 6: //
2476 // fMinOpanCutMeson = 0.0404; // minimum 2 EMCal cell diagonals
2477 // fMinOpanPtDepCut = kFALSE;
2478 // break;
2479 // case 7: //
2480 // fMinOpanCutMeson = 0.0303; // minimum 1.5 EMCal cell diagonal
2481 // fMinOpanPtDepCut = kFALSE;
2482 // break;
2483 // case 8: //
2484 // fMinOpanCutMeson = 0.02525; // minimum 1.25 EMCal cell diagonal
2485 // fMinOpanPtDepCut = kFALSE;
2486 // break;
2487 // case 9: //
2488 // fMinOpanCutMeson = 0.03535; // minimum 1.75 EMCal cell diagonal
2489 // fMinOpanPtDepCut = kFALSE;
2490 // break;
2491  default:
2492  cout<<"Warning:minOpanMesonCut not defined "<<minOpanMesonCut<<endl;
2493  return kFALSE;
2494  }
2495 
2496  return kTRUE;
2497 }
2498 
2499 //________________________________________________________________________
2501  // Set Cut
2502  switch(maxOpanMesonCut){
2503  case 0: //
2504  fMaxOpanCutMeson = TMath::Pi();
2505  fMaxOpanPtDepCut = kFALSE;
2506  break;
2507  case 1:
2508  if( fFMaxOpanCut ) delete fFMaxOpanCut;
2509  fFMaxOpanCut = new TF1("fFMaxOpanCut","[0]*exp(-[1]*x)+[2]",0.,100.);
2510  fFMaxOpanCut->SetParameter(0,2.5);
2511  fFMaxOpanCut->SetParameter(1,0.85);
2512  fFMaxOpanCut->SetParameter(2,0.35);
2513  fMaxOpanPtDepCut = kTRUE;
2514  fMaxOpanCutMeson = TMath::Pi();
2515  break;
2516  case 2:
2517  if( fFMaxOpanCut ) delete fFMaxOpanCut;
2518  fFMaxOpanCut = new TF1("fFMaxOpanCut","[0]*exp(-[1]*x)+[2]",0.,100.);
2519  fFMaxOpanCut->SetParameter(0,2.3);
2520  fFMaxOpanCut->SetParameter(1,0.85);
2521  fFMaxOpanCut->SetParameter(2,0.35);
2522  fMaxOpanPtDepCut = kTRUE;
2523  fMaxOpanCutMeson = TMath::Pi();
2524  break;
2525  default:
2526  cout<<"Warning: maxOpanMesonCut not defined "<< maxOpanMesonCut<<endl;
2527  return kFALSE;
2528  }
2529  return kTRUE;
2530 }
2531 
2532 //________________________________________________________________________
2534  // returns TString with current cut number
2535  return fCutStringRead;
2536 }
2537 
2538 //________________________________________________________________________
2540 
2541  Int_t posLabel = photon->GetTrackLabelPositive();
2542  Int_t negLabel = photon->GetTrackLabelNegative();
2543 
2544  fElectronLabelArray[nV0*2] = posLabel;
2545  fElectronLabelArray[(nV0*2)+1] = negLabel;
2546 }
2547 
2548 //________________________________________________________________________
2550 
2551  Int_t posLabel = photon->GetTrackLabelPositive();
2552  Int_t negLabel = photon->GetTrackLabelNegative();
2553 
2554  for(Int_t i = 0; i<nV0s*2;i++){
2555  if(i==nV0*2) continue;
2556  if(i==(nV0*2)+1) continue;
2557  if(fElectronLabelArray[i] == posLabel){
2558  return kFALSE;}
2559  if(fElectronLabelArray[i] == negLabel){
2560  return kFALSE;}
2561  }
2562 
2563  return kTRUE;
2564 }
2565 //________________________________________________________________________
2567  Double_t posX = photon->GetConversionX();
2568  Double_t posY = photon->GetConversionY();
2569  Double_t posZ = photon->GetConversionZ();
2570 
2571  for(Int_t i = 0;i<photons->GetEntries();i++){
2572  if(nV0 == i) continue;
2573  AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
2574  Double_t posCompX = photonComp->GetConversionX();
2575  Double_t posCompY = photonComp->GetConversionY();
2576  Double_t posCompZ = photonComp->GetConversionZ();
2577 
2578  Double_t dist = pow((posX - posCompX),2)+pow((posY - posCompY),2)+pow((posZ - posCompZ),2);
2579 
2580  if(dist < fminV0Dist*fminV0Dist){
2581  if(photon->GetChi2perNDF() < photonComp->GetChi2perNDF()) return kTRUE;
2582  else {
2583  return kFALSE;}
2584  }
2585 
2586  }
2587  return kTRUE;
2588 }
2589 
2590 //________________________________________________________________________
2592 {
2593 
2594  if (photon==NULL) return;
2595  Double_t facPBrem = 1.;
2596  Double_t facPSig = 0.;
2597 
2598  Double_t phi=0.;
2599  Double_t theta=0.;
2600  Double_t P=0.;
2601 
2602 
2603  P=photon->P();
2604  phi=photon->Phi();
2605  if( photon->P()!=0){
2606  theta=acos( photon->Pz()/ photon->P());
2607  }
2608 
2609  if( fPSigSmearing != 0. || fPSigSmearingCte!=0. ){
2610  facPSig = TMath::Sqrt(fPSigSmearingCte*fPSigSmearingCte+fPSigSmearing*fPSigSmearing*P*P)*fRandom.Gaus(0.,1.);
2611  }
2612 
2613  if( fPBremSmearing != 1.){
2614  if(fBrem!=NULL){
2615  facPBrem = fBrem->GetRandom();
2616  }
2617  }
2618 
2619  photon->SetPx(facPBrem* (1+facPSig)* P*sin(theta)*cos(phi)) ;
2620  photon->SetPy(facPBrem* (1+facPSig)* P*sin(theta)*sin(phi)) ;
2621  photon->SetPz(facPBrem* (1+facPSig)* P*cos(theta)) ;
2622  photon->SetE(photon->P());
2623 }
2624 //________________________________________________________________________
2626 {
2627 
2628  if (photon==NULL) return;
2629  Double_t facPBrem = 1.;
2630  Double_t facPSig = 0.;
2631 
2632  Double_t phi=0.;
2633  Double_t theta=0.;
2634  Double_t P=0.;
2635 
2636 
2637  P=photon->P();
2638  phi=photon->Phi();
2639  if( photon->P()!=0){
2640  theta=acos( photon->Pz()/ photon->P());
2641  }
2642 
2643  if( fPSigSmearing != 0. || fPSigSmearingCte!=0. ){
2644  facPSig = TMath::Sqrt(fPSigSmearingCte*fPSigSmearingCte+fPSigSmearing*fPSigSmearing*P*P)*fRandom.Gaus(0.,1.);
2645  }
2646 
2647  if( fPBremSmearing != 1.){
2648  if(fBrem!=NULL){
2649  facPBrem = fBrem->GetRandom();
2650  }
2651  }
2652 
2653  photon->SetPx(facPBrem* (1+facPSig)* P*sin(theta)*cos(phi)) ;
2654  photon->SetPy(facPBrem* (1+facPSig)* P*sin(theta)*sin(phi)) ;
2655  photon->SetPz(facPBrem* (1+facPSig)* P*cos(theta)) ;
2656 
2657 }
2658 //________________________________________________________________________
2659 TLorentzVector AliConversionMesonCuts::SmearElectron(TLorentzVector particle)
2660 {
2661 
2662  //if (particle==0) return;
2663  Double_t facPBrem = 1.;
2664  Double_t facPSig = 0.;
2665 
2666  Double_t phi=0.;
2667  Double_t theta=0.;
2668  Double_t P=0.;
2669 
2670  P=particle.P();
2671  phi=particle.Phi();
2672  if (phi < 0.) phi += 2. * TMath::Pi();
2673 
2674  if( particle.P()!=0){
2675  theta=acos( particle.Pz()/ particle.P());
2676  }
2677 
2678 
2679  Double_t fPSigSmearingHalf = fPSigSmearing / 2.0; //The parameter was set for gammas with 2 particles and here we have just one electron
2680  Double_t sqrtfPSigSmearingCteHalf = fPSigSmearingCte / 2.0 ; //The parameter was set for gammas with 2 particles and here we have just one electron
2681 
2682 
2683 
2684  if( fPSigSmearingHalf != 0. || sqrtfPSigSmearingCteHalf!=0. ){
2685  facPSig = TMath::Sqrt(sqrtfPSigSmearingCteHalf*sqrtfPSigSmearingCteHalf+fPSigSmearingHalf*fPSigSmearingHalf*P*P)*fRandom.Gaus(0.,1.);
2686  }
2687 
2688  if( fPBremSmearing != 1.){
2689  if(fBrem!=NULL){
2690  facPBrem = fBrem->GetRandom();
2691  }
2692  }
2693 
2694  TLorentzVector SmearedParticle;
2695 
2696  SmearedParticle.SetXYZM( facPBrem* (1+facPSig)* P*sin(theta)*cos(phi) , facPBrem* (1+facPSig)* P*sin(theta)*sin(phi) ,
2697  facPBrem* (1+facPSig)* P*cos(theta) , TDatabasePDG::Instance()->GetParticle( ::kElectron )->Mass()) ;
2698 
2699  //particle.SetPx(facPBrem* (1+facPSig)* P*sin(theta)*cos(phi)) ;
2700  //particle.SetPy(facPBrem* (1+facPSig)* P*sin(theta)*sin(phi)) ;
2701  //particle.SetPz(facPBrem* (1+facPSig)* P*cos(theta)) ;
2702 
2703  return SmearedParticle;
2704 
2705 }
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)
Bool_t MesonIsSelectedMCPiZeroGamma(TParticle *fMCMother, AliMCEvent *mcEvent, Int_t &labelNeutPion, Int_t &labelGamma, Double_t fRapidityShift=0)
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 MesonIsSelectedMCChiC(TParticle *fMCMother, AliMCEvent *mcEvent, Int_t &, Int_t &, Int_t &, Double_t fRapidityShift=0.)
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 MesonIsSelectedMCEtaPiPlPiMiGamma(TParticle *fMCMother, AliMCEvent *mcEvent, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelGamma, Double_t fRapidityShift=0)
Bool_t SetToCloseV0sCut(Int_t toClose)
Bool_t MesonIsSelectedMCDalitz(TParticle *fMCMother, AliMCEvent *mcEvent, Int_t &labelelectron, Int_t &labelpositron, Int_t &labelgamma, Double_t fRapidityShift=0.)
Float_t fOpeningAngle
min opening angle for meson
Bool_t fDoBG
flag to intialize BG
Bool_t MesonIsSelectedMCPiPlPiMiPiZero(TParticle *fMCMother, AliMCEvent *mcEvent, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelNeutPion, 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 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
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)
Float_t GetDCABetweenPhotons() const
Bool_t fEnableMassCut
flag to enable mass cut
Bool_t MesonIsSelectedMC(TParticle *fMCMother, AliMCEvent *mcEvent, 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)
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 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...