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