AliPhysics  608b256 (608b256)
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 #include "AliDalitzAODESDMC.h"
46 #include "AliDalitzEventMC.h"
47 
48 class iostream;
49 
50 using namespace std;
51 
53 ClassImp(AliConversionMesonCuts)
55 
56 
57 const char* AliConversionMesonCuts::fgkCutNames[AliConversionMesonCuts::kNCuts] = {
58  "MesonKind", //0
59  "BackgroundScheme", //1
60  "NumberOfBGEvents", //2
61  "DegreesForRotationMethod", //3
62  "RapidityMesonCut", //4
63  "PtCut", //5
64  "AlphaMesonCut", //6
65  "SelectionWindow", //7
66  "SharedElectronCuts", //8
67  "RejectToCloseV0s", //9
68  "UseMCPSmearing", //10
69  "DcaGammaGamma", //11
70  "DcaRPrimVtx", //12
71  "DcaZPrimVtx", //13
72  "MinOpanMesonCut", //14
73  "MaxOpanMesonCut" //15
74 };
75 
76 
77 //________________________________________________________________________
79  AliAnalysisCuts(name,title),
80  fRandom(0),
81  fCaloPhotonCuts(NULL),
82  fHistograms(NULL),
83  fCutString(NULL),
84  fCutStringRead(""),
85  fHistoMesonCuts(NULL),
86  fHistoMesonBGCuts(NULL),
87  fHistoDCAGGMesonBefore(NULL),
88  fHistoDCAZMesonPrimVtxBefore(NULL),
89  fHistoDCARMesonPrimVtxBefore(NULL),
90  fHistoDCAGGMesonAfter(NULL),
91  fHistoDCAZMesonPrimVtxAfter(NULL),
92  fHistoDCARMesonPrimVtxAfter(NULL),
93  fHistoInvMassBefore(NULL),
94  fHistoInvMassAfter(NULL),
95  fBrem(NULL),
96  fFAlphaCut(NULL),
97  fFMinOpanCut(NULL),
98  fFMaxOpanCut(NULL),
99  fMaxR(180),
100  fMinPt(0.),
101  fSelectionLow(0.0),
102  fSelectionHigh(4),
103  fAlphaMinCutMeson(0),
104  fAlphaCutMeson(1),
105  fRapidityCutMeson(1),
106  fMinV0Dist(200.),
107  fPBremSmearing(0),
108  fPSigSmearing(0),
109  fPSigSmearingCte(0),
110  fDCAGammaGammaCut(1000),
111  fDCAZMesonPrimVtxCut(1000),
112  fDCARMesonPrimVtxCut(1000),
113  fMinOpanCutMeson(0),
114  fMaxOpanCutMeson(TMath::Pi()),
115  fSidebandMixingLow(0.180),
116  fSidebandMixingHigh(0.300),
117  fSidebandMixingLeftLow(0.05),
118  fSidebandMixingLeftHigh(0.100),
119  fSidebandMixingRightLow(0.180),
120  fSidebandMixingRightHigh(0.300),
121  fOpeningAngle(0.005),
122  fMode(0),
123  fMesonKind(0),
124  fIsMergedClusterCut(0),
125  fSelectionWindowCut(-1),
126  fNDegreeRotationPMForBG(0),
127  fNumberOfBGEvents(0),
128  fElectronLabelArraySize(500),
129  fElectronLabelArray(NULL),
130  fBackgroundHandler(0),
131  fDoLightOutput(kFALSE),
132  fDoMinPtCut(kFALSE),
133  fEnableMassCut(kFALSE),
134  fAcceptMesonMass(kTRUE),
135  fUseRotationMethodInBG(kFALSE),
136  fUsePtmaxMethodForBG(kFALSE),
137  fDoBG(kTRUE),
138  fDoBGProbability(kFALSE),
139  fDoConvCaloMixing(kFALSE),
140  fDoSectorMixing(kFALSE),
141  fDoSectorJetMixing(kFALSE),
142  fDoJetMixing(kFALSE),
143  fDoJetRotateMixing(kFALSE),
144  fDoJetPtMixing(kFALSE),
145  fDoSphericityMixing(kFALSE),
146  fUseTrackMultiplicityForBG(kFALSE),
147  fEnableMinOpeningAngleCut(kTRUE),
148  fEnableOneCellDistCut(kFALSE),
149  fDoToCloseV0sCut(kFALSE),
150  fDoSharedElecCut(kFALSE),
151  fUseMCPSmearing(kFALSE),
152  fAlphaPtDepCut(kFALSE),
153  fDCAGammaGammaCutOn(kFALSE),
154  fDCAZMesonPrimVtxCutOn(kFALSE),
155  fDCARMesonPrimVtxCutOn(kFALSE),
156  fMinOpanPtDepCut(kFALSE),
157  fMaxOpanPtDepCut(kFALSE),
158  fBackgroundUseSideband(kFALSE),
159  fBackgroundUseSidebandBothSides(kFALSE),
160  fBackgroundUseLikeSign(kFALSE),
161  fDoJetAnalysis(kFALSE),
162  fDoJetQA(kFALSE)
163 {
164  for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=0;}
165  fCutString=new TObjString((GetCutNumber()).Data());
167  if (fBrem == NULL){
168  fBrem = new TF1("fBrem","pow(-log(x),[0]/log(2.0)-1.0)/TMath::Gamma([0]/log(2.0))",0.00001,0.999999999);
169  // tests done with 1.0e-14
170  fBrem->SetParameter(0,fPBremSmearing);
171  fBrem->SetNpx(100000);
172  }
173 }
174 
175 //________________________________________________________________________
177  AliAnalysisCuts(ref),
178  fRandom(ref.fRandom),
180  fHistograms(NULL),
181  fCutString(NULL),
182  fCutStringRead(""),
183  fHistoMesonCuts(NULL),
184  fHistoMesonBGCuts(NULL),
188  fHistoDCAGGMesonAfter(NULL),
191  fHistoInvMassBefore(NULL),
192  fHistoInvMassAfter(NULL),
193  fBrem(NULL),
194  fFAlphaCut(NULL),
195  fFMinOpanCut(NULL),
196  fFMaxOpanCut(NULL),
197  fMaxR(ref.fMaxR),
198  fMinPt(ref.fMinPt),
204  fMinV0Dist(ref.fMinV0Dist),
220  fMode(ref.fMode),
221  fMesonKind(ref.fMesonKind),
227  fElectronLabelArray(NULL),
235  fDoBG(ref.fDoBG),
260  fDoJetQA(ref.fDoJetQA)
261 
262 {
263  // Copy Constructor
264  for(Int_t jj=0;jj<kNCuts;jj++){fCuts[jj]=ref.fCuts[jj];}
265  fCutString=new TObjString((GetCutNumber()).Data());
267  if (fBrem == NULL)fBrem = (TF1*)ref.fBrem->Clone("fBrem");
268  // Histograms are not copied, if you need them, call InitCutHistograms
269 }
270 
271 
272 //________________________________________________________________________
274  // Destructor
275  //Deleting fHistograms leads to seg fault it it's added to output collection of a task
276  // if(fHistograms)
277  // delete fHistograms;
278  // fHistograms = NULL;
279  if(fCutString != NULL){
280  delete fCutString;
281  fCutString = NULL;
282  }
284  delete fElectronLabelArray;
285  fElectronLabelArray = NULL;
286  }
287 
288  if(fFAlphaCut != NULL){
289  delete fFAlphaCut;
290  fFAlphaCut = NULL;
291  }
292  if(fBrem != NULL){
293  delete fBrem;
294  fBrem = NULL;
295  }
296  if(fFMinOpanCut != NULL){
297  delete fFMinOpanCut;
298  fFMinOpanCut = NULL;
299  }
300  if(fFMaxOpanCut != NULL){
301  delete fFMaxOpanCut;
302  fFMaxOpanCut = NULL;
303  }
304 }
305 
306 //________________________________________________________________________
308 
309  // Initialize Cut Histograms for QA (only initialized and filled if function is called)
310  TH1::AddDirectory(kFALSE);
311 
312  if(fHistograms != NULL){
313  delete fHistograms;
314  fHistograms=NULL;
315  }
316  if(fHistograms==NULL){
317  fHistograms=new TList();
318  fHistograms->SetOwner(kTRUE);
319  if(name=="")fHistograms->SetName(Form("ConvMesonCuts_%s",GetCutNumber().Data()));
320  else fHistograms->SetName(Form("%s_%s",name.Data(),GetCutNumber().Data()));
321  }
322 
323  // Meson Cuts
324  if (fIsMergedClusterCut == 1){
325  fHistoMesonCuts=new TH2F(Form("MesonCuts %s",GetCutNumber().Data()),"MesonCuts vs Pt",9,-0.5,8.5, 500, 0, 100);
326  fHistoMesonCuts->GetXaxis()->SetBinLabel(1,"in");
327  fHistoMesonCuts->GetXaxis()->SetBinLabel(2,"undef rapidity");
328  fHistoMesonCuts->GetXaxis()->SetBinLabel(3,"rapidity cut");
329  fHistoMesonCuts->GetXaxis()->SetBinLabel(4,"mass cut");
330  fHistoMesonCuts->GetXaxis()->SetBinLabel(5,"opening angle");
331  fHistoMesonCuts->GetXaxis()->SetBinLabel(6,"alpha max");
332  fHistoMesonCuts->GetXaxis()->SetBinLabel(7,"alpha min");
333  fHistoMesonCuts->GetXaxis()->SetBinLabel(8,"pT min");
334  fHistoMesonCuts->GetXaxis()->SetBinLabel(9,"out");
336  } else if (fIsMergedClusterCut == 2){
337  fHistoMesonCuts=new TH2F(Form("MesonCuts %s",GetCutNumber().Data()),"MesonCuts vs Pt",9,-0.5,8.5, 250, 0, 50);
338  fHistoMesonCuts->GetXaxis()->SetBinLabel(1,"in");
339  fHistoMesonCuts->GetXaxis()->SetBinLabel(2,"undef rapidity");
340  fHistoMesonCuts->GetXaxis()->SetBinLabel(3,"rapidity cut");
341  fHistoMesonCuts->GetXaxis()->SetBinLabel(4,"1 cell distance");
342  fHistoMesonCuts->GetXaxis()->SetBinLabel(5,"opening angle");
343  fHistoMesonCuts->GetXaxis()->SetBinLabel(6,"alpha max");
344  fHistoMesonCuts->GetXaxis()->SetBinLabel(7,"alpha min");
345  fHistoMesonCuts->GetXaxis()->SetBinLabel(8,"pT min");
346  fHistoMesonCuts->GetXaxis()->SetBinLabel(9,"out");
348 
349  fHistoMesonBGCuts=new TH2F(Form("MesonBGCuts %s",GetCutNumber().Data()),"MesonBGCuts vs Pt",9,-0.5,8.5, 250, 0, 50);
350  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(1,"in");
351  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(2,"undef rapidity");
352  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(3,"rapidity cut");
353  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(4,"1 cell distance");
354  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(5,"opening angle");
355  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(6,"alpha max");
356  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(7,"alpha min");
357  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(8,"pT min");
358  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(9,"out");
360  } else {
361  fHistoMesonCuts=new TH2F(Form("MesonCuts %s",GetCutNumber().Data()),"MesonCuts vs Pt",11,-0.5,10.5, 250, 0, 50);
362  fHistoMesonCuts->GetXaxis()->SetBinLabel(1,"in");
363  fHistoMesonCuts->GetXaxis()->SetBinLabel(2,"undef rapidity");
364  fHistoMesonCuts->GetXaxis()->SetBinLabel(3,"rapidity cut");
365  fHistoMesonCuts->GetXaxis()->SetBinLabel(4,"opening angle");
366  fHistoMesonCuts->GetXaxis()->SetBinLabel(5,"alpha max");
367  fHistoMesonCuts->GetXaxis()->SetBinLabel(6,"alpha min");
368  fHistoMesonCuts->GetXaxis()->SetBinLabel(7,"dca gamma gamma");
369  fHistoMesonCuts->GetXaxis()->SetBinLabel(8,"dca R prim Vtx");
370  fHistoMesonCuts->GetXaxis()->SetBinLabel(9,"dca Z prim Vtx");
371  fHistoMesonCuts->GetXaxis()->SetBinLabel(10,"pT min");
372  fHistoMesonCuts->GetXaxis()->SetBinLabel(11,"out");
374 
375  fHistoMesonBGCuts=new TH2F(Form("MesonBGCuts %s",GetCutNumber().Data()),"MesonBGCuts vs Pt",11,-0.5,10.5, 250, 0, 50);
376  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(1,"in");
377  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(2,"undef rapidity");
378  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(3,"rapidity cut");
379  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(4,"opening angle");
380  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(5,"alpha max");
381  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(6,"alpha min");
382  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(7,"dca gamma gamma");
383  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(8,"dca R prim Vtx");
384  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(9,"dca Z prim Vtx");
385  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(10,"pT min");
386  fHistoMesonBGCuts->GetXaxis()->SetBinLabel(11,"out");
388  }
389 
390  if(!fDoLightOutput){
391  if (fIsMergedClusterCut == 1){
392  fHistoInvMassBefore=new TH1F(Form("InvMassMeson Before %s",GetCutNumber().Data()),"InvMassMeson Before",1000,0,1);
394  fHistoInvMassAfter=new TH1F(Form("InvMassMeson After %s",GetCutNumber().Data()),"InvMassMeson After",1000,0,1);
396  }
397 
398  if (additionalHists && fIsMergedClusterCut== 0){
399  fHistoDCAGGMesonBefore=new TH1F(Form("DCAGammaGammaMeson Before %s",GetCutNumber().Data()),"DCAGammaGammaMeson Before",200,0,10);
401 
402  fHistoDCARMesonPrimVtxBefore=new TH1F(Form("DCARMesonPrimVtx Before %s",GetCutNumber().Data()),"DCARMesonPrimVtx Before",200,0,10);
404 
405  fHistoDCAZMesonPrimVtxBefore=new TH1F(Form("DCAZMesonPrimVtx Before %s",GetCutNumber().Data()),"DCAZMesonPrimVtx Before",401,-10,10);
407  }
408 
409  if (fIsMergedClusterCut == 0){
410  fHistoDCAGGMesonAfter=new TH1F(Form("DCAGammaGammaMeson After %s",GetCutNumber().Data()),"DCAGammaGammaMeson After",200,0,10);
412 
413  fHistoDCAZMesonPrimVtxAfter=new TH2F(Form("InvMassDCAZMesonPrimVtx After %s",GetCutNumber().Data()),"InvMassDCAZMesonPrimVtx After",800,0,0.8,401,-10,10);
415 
416  fHistoDCARMesonPrimVtxAfter=new TH1F(Form("DCARMesonPrimVtx After %s",GetCutNumber().Data()),"DCARMesonPrimVtx After",200,0,10);
418  }
419  }
420 
421  TH1::AddDirectory(kTRUE);
422 }
423 
424 //________________________________________________________________________
425 Bool_t AliConversionMesonCuts::MesonIsSelectedMC(TParticle *fMCMother,AliMCEvent *mcEvent, Double_t fRapidityShift){
426  // Returns true for all pions within acceptance cuts for decay into 2 photons
427  // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
428 
429  if(!mcEvent)return kFALSE;
430 
431  if(fMCMother->GetPdgCode()==111 || fMCMother->GetPdgCode()==221 || fMCMother->GetPdgCode()==331 ){
432  if(fMCMother->R()>fMaxR) return kFALSE; // cuts on distance from collision point
433 
434  Double_t rapidity = 10.;
435  if(fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0){
436  rapidity=8.-fRapidityShift;
437  } else{
438  rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
439  }
440 
441  // Rapidity Cut
442  if(TMath::Abs(rapidity)>fRapidityCutMeson)return kFALSE;
443 
444  // min Pt Cut
445  if(fDoMinPtCut && (fMCMother->Pt() < fMinPt)) return kFALSE;
446 
447  // Select only -> 2y decay channel
448  if(fMCMother->GetNDaughters()!=2)return kFALSE;
449 
450  for(Int_t i=0;i<2;i++){
451  if(fMCMother->GetDaughter(i) < 0) return kFALSE;
452  TParticle *MDaughter=mcEvent->Particle(fMCMother->GetDaughter(i));
453  // Is Daughter a Photon?
454  if(MDaughter->GetPdgCode()!=22)return kFALSE;
455  // Is Photon in Acceptance?
456  // if(bMCDaughtersInAcceptance){
457  // if(!PhotonIsSelectedMC(MDaughter,mcEvent)){return kFALSE;}
458  // }
459  }
460  return kTRUE;
461  }
462  return kFALSE;
463 }
464 
465 //________________________________________________________________________
466 Bool_t AliConversionMesonCuts::MesonIsSelectedAODMC(AliAODMCParticle *MCMother,TClonesArray *AODMCArray, Double_t fRapidityShift){
467  // Returns true for all pions within acceptance cuts for decay into 2 photons
468  // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
469 
470  if(!AODMCArray)return kFALSE;
471 
472  if(MCMother->GetPdgCode()==111 || MCMother->GetPdgCode()==221 || MCMother->GetPdgCode()==331 ){
473  Double_t rMeson = sqrt( (MCMother->Xv()*MCMother->Xv()) + (MCMother->Yv()*MCMother->Yv()) ) ;
474  if(rMeson>fMaxR) return kFALSE; // cuts on distance from collision point
475 
476  Double_t rapidity = 10.;
477  if(MCMother->E() - MCMother->Pz() == 0 || MCMother->E() + MCMother->Pz() == 0){
478  rapidity=8.-fRapidityShift;
479  } else{
480  rapidity = 0.5*(TMath::Log((MCMother->E()+MCMother->Pz()) / (MCMother->E()-MCMother->Pz())))-fRapidityShift;
481  }
482 
483  // Rapidity Cut
484  if(TMath::Abs(rapidity)>fRapidityCutMeson)return kFALSE;
485 
486  // min Pt Cut
487  if(fDoMinPtCut && (MCMother->Pt() < fMinPt)) return kFALSE;
488 
489  // Select only -> 2y decay channel
490  if(MCMother->GetNDaughters()!=2)return kFALSE;
491 
492  for(Int_t i=0;i<2;i++){
493  AliAODMCParticle *MDaughter=static_cast<AliAODMCParticle*>(AODMCArray->At(MCMother->GetDaughterLabel(i)));
494  // Is Daughter a Photon?
495  if(MDaughter->GetPdgCode()!=22)return kFALSE;
496  // Is Photon in Acceptance?
497  // if(bMCDaughtersInAcceptance){
498  // if(!PhotonIsSelectedMC(MDaughter,mcEvent)){return kFALSE;}
499  // }
500  }
501  return kTRUE;
502  }
503  return kFALSE;
504 }
505 
506 //________________________________________________________________________
508 // Returns true for all pions within acceptance cuts for decay into 2 photons
509 // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
510  if(!mcEvent)return kFALSE;
511 
512  if(fMCMother->GetPdgCodeG()==111 || fMCMother->GetPdgCodeG()==221 || fMCMother->GetPdgCodeG()==331 ){
513  if(fMCMother->GetRatioVxyG()>fMaxR) return kFALSE; // cuts on distance from collision point
514  Double_t rapidity = 10.;
515  if(fMCMother->EnergyG() - fMCMother->PzG() == 0 || fMCMother->EnergyG() + fMCMother->PzG() == 0){
516  rapidity=8.-fRapidityShift;
517  } else{
518  rapidity = 0.5*(TMath::Log((fMCMother->EnergyG()+fMCMother->PzG()) / (fMCMother->EnergyG()-fMCMother->PzG())))-fRapidityShift;
519  }
520 
521  // Rapidity Cut
522  if(TMath::Abs(rapidity)>fRapidityCutMeson)return kFALSE;
523 
524  // min Pt Cut
525  if(fDoMinPtCut && (fMCMother->PtG() < fMinPt)) return kFALSE;
526 
527  // Select only -> 2y decay channel
528  if(fMCMother->GetNDaughtersG()!=2)return kFALSE;
529  if((fMCMother->GetLastDaughterG()<0) || (fMCMother->GetFirstDaughterG()<0)) return kFALSE;
530  AliDalitzAODESDMC *MDaughter0=mcEvent->Particle(fMCMother->GetFirstDaughterG());
531  AliDalitzAODESDMC *MDaughter1=mcEvent->Particle(fMCMother->GetLastDaughterG());
532  if ((MDaughter0->GetPdgCodeG()!=22) || (MDaughter1->GetPdgCodeG()!=22)) return kFALSE;
533  return kTRUE;
534  }
535  return kFALSE;
536 }
537 //________________________________________________________________________
538 Bool_t AliConversionMesonCuts::MesonIsSelectedMCDalitz(TParticle *fMCMother,AliMCEvent *mcEvent, Int_t &labelelectron, Int_t &labelpositron, Int_t &labelgamma, Double_t fRapidityShift){
539 
540  // Returns true for all pions within acceptance cuts for decay into 2 photons
541  // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
542 
543  if( !mcEvent )return kFALSE;
544 
545  if( fMCMother->GetPdgCode() != 111 && fMCMother->GetPdgCode() != 221 && fMCMother->GetPdgCode() != 331) return kFALSE;
546 
547  if( fMCMother->R()>fMaxR ) return kFALSE; // cuts on distance from collision point
548 
549  Double_t rapidity = 10.;
550 
551  if( fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0 ){
552  rapidity=8.-fRapidityShift;
553  }
554  else{
555  rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
556  }
557 
558  // Rapidity Cut
559  if( TMath::Abs(rapidity) > fRapidityCutMeson )return kFALSE;
560 
561  // min Pt Cut
562  if(fDoMinPtCut && (fMCMother->Pt() < fMinPt)) return kFALSE;
563 
564  // Select only -> Dalitz decay channel
565  if( fMCMother->GetNDaughters() != 3 )return kFALSE;
566 
567  TParticle *positron = 0x0;
568  TParticle *electron = 0x0;
569  TParticle *gamma = 0x0;
570 
571  for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
572  if(index < 0) continue;
573  TParticle* temp = (TParticle*)mcEvent->Particle( index );
574 
575  switch( temp->GetPdgCode() ) {
576  case ::kPositron:
577  positron = temp;
578  labelpositron = index;
579  break;
581  electron = temp;
582  labelelectron = index;
583  break;
584  case ::kGamma:
585  gamma = temp;
586  labelgamma = index;
587  break;
588  }
589  }
590 
591  if( positron && electron && gamma) return kTRUE;
592  return kFALSE;
593 }
594 
595 //________________________________________________________________________
596 Bool_t AliConversionMesonCuts::MesonIsSelectedAODMCDalitz(AliAODMCParticle *fMCMother,TClonesArray *AODMCArray, Int_t &labelelectron, Int_t &labelpositron, Int_t &labelgamma, Double_t fRapidityShift){
597 
598  // Returns true for all pions within acceptance cuts for decay into 2 photons
599  // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
600 
601  if( !AODMCArray )return kFALSE;
602 
603  if( fMCMother->GetPdgCode() != 111 && fMCMother->GetPdgCode() != 221 && fMCMother->GetPdgCode() != 331 ) return kFALSE;
604 
605  Double_t rMeson = sqrt( (fMCMother->Xv()*fMCMother->Xv()) + (fMCMother->Yv()*fMCMother->Yv()) ) ;
606  if(rMeson>fMaxR) return kFALSE; // cuts on distance from collision point
607 
608  Double_t rapidity = 10.;
609 
610  if( fMCMother->E() - fMCMother->Pz() == 0 || fMCMother->E() + fMCMother->Pz() == 0 ){
611  rapidity=8.-fRapidityShift;
612  }
613  else{
614  rapidity = 0.5*(TMath::Log((fMCMother->E()+fMCMother->Pz()) / (fMCMother->E()-fMCMother->Pz())))-fRapidityShift;
615  }
616 
617  // Rapidity Cut
618  if( TMath::Abs(rapidity) > fRapidityCutMeson )return kFALSE;
619 
620  // min Pt Cut
621  if(fDoMinPtCut && (fMCMother->Pt() < fMinPt)) return kFALSE;
622 
623  // Select only -> Dalitz decay channel
624  if( fMCMother->GetNDaughters() != 3 )return kFALSE;
625 
626  AliAODMCParticle *positron = 0x0;
627  AliAODMCParticle *electron = 0x0;
628  AliAODMCParticle *gamma = 0x0;
629 
630  for(Int_t index= fMCMother->GetDaughterFirst();index<= fMCMother->GetDaughterLast();index++){
631  if(index < 0) continue;
632  AliAODMCParticle* temp = static_cast<AliAODMCParticle*>(AODMCArray->At(index));
633  if (!temp) continue;
634 
635  switch( temp->GetPdgCode() ) {
636  case ::kPositron:
637  positron = temp;
638  labelpositron = index;
639  break;
641  electron = temp;
642  labelelectron = index;
643  break;
644  case ::kGamma:
645  gamma = temp;
646  labelgamma = index;
647  break;
648  }
649  }
650 
651  if( positron && electron && gamma) return kTRUE;
652  return kFALSE;
653 }
654 
655 //________________________________________________________________________
656  Bool_t AliConversionMesonCuts::MesonIsSelectedMCDalitzAODESD(AliDalitzAODESDMC *fMCMother,AliDalitzEventMC *mcEvent, Int_t &labelelectron, Int_t &labelpositron, Int_t &labelgamma, Double_t fRapidityShift){
657 // Returns true for all pions within acceptance cuts for decay into 2 photons
658 // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
659  if( !mcEvent )return kFALSE;
660 
661  if( fMCMother->GetPdgCodeG() != 111 && fMCMother->GetPdgCodeG() != 221 && fMCMother->GetPdgCodeG() != 331) return kFALSE;
662 
663  if( fMCMother->GetRatioVxyG()>fMaxR ) return kFALSE; // cuts on distance from collision point
664 
665  Double_t rapidity = 10.;
666 
667  if( fMCMother->EnergyG() - fMCMother->PzG() == 0 || fMCMother->EnergyG() + fMCMother->PzG() == 0 ){
668  rapidity=8.-fRapidityShift;
669  }
670  else{
671  rapidity = 0.5*(TMath::Log((fMCMother->EnergyG()+fMCMother->PzG()) / (fMCMother->EnergyG()-fMCMother->PzG())))-fRapidityShift;
672  }
673 
674  // Rapidity Cut
675  if( TMath::Abs(rapidity) > fRapidityCutMeson )return kFALSE;
676 
677  // min Pt Cut
678  if(fDoMinPtCut && (fMCMother->PtG() < fMinPt)) return kFALSE;
679 
680  // Select only -> Dalitz decay channel
681  if( fMCMother->GetNDaughtersG() != 3 )return kFALSE;
682 
683  AliDalitzAODESDMC *positron = 0x0;
684  AliDalitzAODESDMC *electron = 0x0;
685  AliDalitzAODESDMC *gamma = 0x0;
686 
687  for(Int_t index= fMCMother->GetFirstDaughterG();index<= fMCMother->GetLastDaughterG();index++){
688  if(index < 0) continue;
689  AliDalitzAODESDMC* temp = mcEvent->Particle(index);
690  //TParticle* temp = (TParticle*)mcEvent->Particle( index );
691  switch( temp->GetPdgCodeG() ) {
692  case ::kPositron:
693  positron = temp;
694  labelpositron = index;
695  break;
697  electron = temp;
698  labelelectron = index;
699  break;
700  case ::kGamma:
701  gamma = temp;
702  labelgamma = index;
703  break;
704  }
705  }
706  if( positron && electron && gamma) return kTRUE;
707  return kFALSE;
708 }
709 //________________________________________________________________________
710 Bool_t AliConversionMesonCuts::MesonIsSelectedMCEtaPiPlPiMiGamma(TParticle *fMCMother,AliMCEvent *mcEvent, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelGamma, Double_t fRapidityShift){
711 
712  // Returns true for all pions within acceptance cuts for decay into 2 photons
713  // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
714 
715  if( !mcEvent )return kFALSE;
716 
717  if( fMCMother->GetPdgCode() != 221 ) return kFALSE;
718 
719  if( fMCMother->R()>fMaxR ) return kFALSE; // cuts on distance from collision point
720 
721  Double_t rapidity = 10.;
722 
723  if( fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0 ){
724  rapidity=8.-fRapidityShift;
725  }
726  else{
727  rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
728  }
729 
730  // Rapidity Cut
731  if( TMath::Abs(rapidity) > fRapidityCutMeson )return kFALSE;
732 
733  // min Pt Cut
734  if(fDoMinPtCut && (fMCMother->Pt() < fMinPt)) return kFALSE;
735 
736  // Select only -> Dalitz decay channel
737  if( fMCMother->GetNDaughters() != 3 )return kFALSE;
738 
739  TParticle *posPion = 0x0;
740  TParticle *negPion = 0x0;
741  TParticle *gamma = 0x0;
742 
743  for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
744  if(index < 0) continue;
745  TParticle* temp = (TParticle*)mcEvent->Particle( index );
746 
747  switch( temp->GetPdgCode() ) {
748  case 211:
749  posPion = temp;
750  labelPosPion = index;
751  break;
752  case -211:
753  negPion = temp;
754  labelNegPion = index;
755  break;
756  case ::kGamma:
757  gamma = temp;
758  labelGamma = index;
759  break;
760  }
761  }
762 
763  if( posPion && negPion && gamma) return kTRUE;
764  return kFALSE;
765 }
766 
767 //________________________________________________________________________
768 Bool_t AliConversionMesonCuts::MesonIsSelectedAODMCEtaPiPlPiMiGamma(AliAODMCParticle *fMCMother,TClonesArray *AODMCArray, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelGamma, Double_t fRapidityShift){
769 
770  // Returns true for all pions within acceptance cuts for decay into 2 photons
771  // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
772 
773  if( !AODMCArray )return kFALSE;
774 
775  if( fMCMother->GetPdgCode() != 221 ) return kFALSE;
776 
777  Double_t rMeson = sqrt( (fMCMother->Xv()*fMCMother->Xv()) + (fMCMother->Yv()*fMCMother->Yv()) ) ;
778  if(rMeson>fMaxR) return kFALSE; // cuts on distance from collision point
779 
780  Double_t rapidity = 10.;
781 
782  if( fMCMother->E() - fMCMother->Pz() == 0 || fMCMother->E() + fMCMother->Pz() == 0 ){
783  rapidity=8.-fRapidityShift;
784  }
785  else{
786  rapidity = 0.5*(TMath::Log((fMCMother->E()+fMCMother->Pz()) / (fMCMother->E()-fMCMother->Pz())))-fRapidityShift;
787  }
788 
789  // Rapidity Cut
790  if( TMath::Abs(rapidity) > fRapidityCutMeson )return kFALSE;
791 
792  // min Pt Cut
793  if(fDoMinPtCut && (fMCMother->Pt() < fMinPt)) return kFALSE;
794 
795  // Select only -> Dalitz decay channel
796  if( fMCMother->GetNDaughters() != 3 )return kFALSE;
797 
798  AliAODMCParticle *posPion = 0x0;
799  AliAODMCParticle *negPion = 0x0;
800  AliAODMCParticle *gamma = 0x0;
801 
802  for(Int_t index= fMCMother->GetDaughterFirst();index<= fMCMother->GetDaughterLast();index++){
803  if(index < 0) continue;
804  AliAODMCParticle* temp = static_cast<AliAODMCParticle*>(AODMCArray->At(index));
805 
806  switch( temp->GetPdgCode() ) {
807  case 211:
808  posPion = temp;
809  labelPosPion = index;
810  break;
811  case -211:
812  negPion = temp;
813  labelNegPion = index;
814  break;
815  case ::kGamma:
816  gamma = temp;
817  labelGamma = index;
818  break;
819  }
820  }
821 
822  if( posPion && negPion && gamma) return kTRUE;
823  return kFALSE;
824 }
825 
826 //________________________________________________________________________
827 Bool_t AliConversionMesonCuts::MesonIsSelectedMCPiPlPiMiEta(TParticle *fMCMother,AliMCEvent *mcEvent, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelEtaMeson, Double_t fRapidityShift){
828 
829  // Returns true for all pions within acceptance cuts for decay into 2 photons
830  // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
831 
832  if( !mcEvent )return kFALSE;
833 
834  if( !(fMCMother->GetPdgCode() == 331 ) ) return kFALSE;
835 
836  if( fMCMother->R()>fMaxR ) return kFALSE; // cuts on distance from collision point
837 
838  Double_t rapidity = 10.;
839 
840  if( fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0 ){
841  rapidity=8.-fRapidityShift;
842  }
843  else{
844  rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
845  }
846 
847  // Rapidity Cut
848  if( TMath::Abs(rapidity) > fRapidityCutMeson )return kFALSE;
849 
850  // min Pt Cut
851  if(fDoMinPtCut && (fMCMother->Pt() < fMinPt)) return kFALSE;
852 
853  // Select only -> pi+ pi- pi0
854  if( fMCMother->GetNDaughters() != 3 )return kFALSE;
855 
856  TParticle *posPion = 0x0;
857  TParticle *negPion = 0x0;
858  TParticle *etaMeson = 0x0;
859 
860 // cout << "\n"<< fMCMother->GetPdgCode() << "\n" << endl;
861  for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
862  if(index < 0) continue;
863  TParticle* temp = (TParticle*)mcEvent->Particle( index );
864 // cout << temp->GetPdgCode() << endl;
865  switch( temp->GetPdgCode() ) {
866  case 211:
867  posPion = temp;
868  labelPosPion = index;
869  break;
870  case -211:
871  negPion = temp;
872  labelNegPion = index;
873  break;
874  case 221:
875  etaMeson = temp;
876  labelEtaMeson = index;
877  break;
878  }
879  }
880 
881  if( posPion && negPion && etaMeson ) return kTRUE;
882  return kFALSE;
883 }
884 //________________________________________________________________________
885 Bool_t AliConversionMesonCuts::MesonIsSelectedAODMCPiPlPiMiEta(AliAODMCParticle *fMCMother,TClonesArray *AODMCArray, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelEtaMeson, Double_t fRapidityShift){
886 
887  // Returns true for all pions within acceptance cuts for decay into 2 photons
888  // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
889 
890  if( !AODMCArray )return kFALSE;
891 
892  if( !(fMCMother->GetPdgCode() == 331 ) ) return kFALSE;
893 
894  Double_t rMeson = sqrt( (fMCMother->Xv()*fMCMother->Xv()) + (fMCMother->Yv()*fMCMother->Yv()) ) ;
895  if( rMeson >fMaxR ) return kFALSE; // cuts on distance from collision point
896 
897  Double_t rapidity = 10.;
898 
899  if( fMCMother->E() - fMCMother->Pz() == 0 || fMCMother->E() + fMCMother->Pz() == 0 ){
900  rapidity=8.-fRapidityShift;
901  }
902  else{
903  rapidity = 0.5*(TMath::Log((fMCMother->E()+fMCMother->Pz()) / (fMCMother->E()-fMCMother->Pz())))-fRapidityShift;
904  }
905 
906  // Rapidity Cut
907  if( TMath::Abs(rapidity) > fRapidityCutMeson )return kFALSE;
908 
909  // min Pt Cut
910  if(fDoMinPtCut && (fMCMother->Pt() < fMinPt)) return kFALSE;
911 
912  // Select only -> pi+ pi- pi0
913  if( fMCMother->GetNDaughters() != 3 )return kFALSE;
914 
915  AliAODMCParticle *posPion = 0x0;
916  AliAODMCParticle *negPion = 0x0;
917  AliAODMCParticle *etaMeson = 0x0;
918 
919 // cout << "\n"<< fMCMother->GetPdgCode() << "\n" << endl;
920  for(Int_t index= fMCMother->GetDaughterFirst();index<= fMCMother->GetDaughterLast();index++){
921  if(index < 0) continue;
922  AliAODMCParticle* temp = static_cast<AliAODMCParticle*>(AODMCArray->At(index));
923 // cout << temp->GetPdgCode() << endl;
924  switch( temp->GetPdgCode() ) {
925  case 211:
926  posPion = temp;
927  labelPosPion = index;
928  break;
929  case -211:
930  negPion = temp;
931  labelNegPion = index;
932  break;
933  case 221:
934  etaMeson = temp;
935  labelEtaMeson = index;
936  break;
937  }
938  }
939 
940  if( posPion && negPion && etaMeson ) return kTRUE;
941  return kFALSE;
942 }
943 //________________________________________________________________________
944 Bool_t AliConversionMesonCuts::MesonIsSelectedMCPiPlPiMiPiZero(TParticle *fMCMother,AliMCEvent *mcEvent, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelNeutPion, Double_t fRapidityShift){
945 
946  // Returns true for all pions within acceptance cuts for decay into 2 photons
947  // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
948 
949  if( !mcEvent )return kFALSE;
950 
951  if( !(fMCMother->GetPdgCode() == 221 || fMCMother->GetPdgCode() == 223 || fMCMother->GetPdgCode() == 421) ) return kFALSE;
952 
953  if( fMCMother->R()>fMaxR ) return kFALSE; // cuts on distance from collision point
954 
955  Double_t rapidity = 10.;
956 
957  if( fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0 ){
958  rapidity=8.-fRapidityShift;
959  }
960  else{
961  rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
962  }
963 
964  // Rapidity Cut
965  if( TMath::Abs(rapidity) > fRapidityCutMeson )return kFALSE;
966 
967  // min Pt Cut
968  if(fDoMinPtCut && (fMCMother->Pt() < fMinPt)) return kFALSE;
969 
970  // Select only -> pi+ pi- pi0
971  if( fMCMother->GetNDaughters() != 3 )return kFALSE;
972 
973  TParticle *posPion = 0x0;
974  TParticle *negPion = 0x0;
975  TParticle *neutPion = 0x0;
976 
977 // cout << "\n"<< fMCMother->GetPdgCode() << "\n" << endl;
978  for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
979  if(index < 0) continue;
980  TParticle* temp = (TParticle*)mcEvent->Particle( index );
981 // cout << temp->GetPdgCode() << endl;
982  switch( temp->GetPdgCode() ) {
983  case 211:
984  posPion = temp;
985  labelPosPion = index;
986  break;
987  case -211:
988  negPion = temp;
989  labelNegPion = index;
990  break;
991  case 111:
992  neutPion = temp;
993  labelNeutPion = index;
994  break;
995  }
996  }
997 
998  if( posPion && negPion && neutPion ) return kTRUE;
999  return kFALSE;
1000 }
1001 
1002 //________________________________________________________________________
1003 Bool_t AliConversionMesonCuts::MesonIsSelectedAODMCPiPlPiMiPiZero(AliAODMCParticle *fMCMother,TClonesArray *AODMCArray, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelNeutPion, Double_t fRapidityShift){
1004 
1005  // Returns true for all pions within acceptance cuts for decay into 2 photons
1006  // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
1007 
1008  if( !AODMCArray )return kFALSE;
1009 
1010  if( !(fMCMother->GetPdgCode() == 221 || fMCMother->GetPdgCode() == 223 || fMCMother->GetPdgCode() == 421) ) return kFALSE;
1011 
1012  Double_t rMeson = sqrt( (fMCMother->Xv()*fMCMother->Xv()) + (fMCMother->Yv()*fMCMother->Yv()) ) ;
1013  if( rMeson >fMaxR ) return kFALSE; // cuts on distance from collision point
1014 
1015  Double_t rapidity = 10.;
1016 
1017  if( fMCMother->E() - fMCMother->Pz() == 0 || fMCMother->E() + fMCMother->Pz() == 0 ){
1018  rapidity=8.-fRapidityShift;
1019  }
1020  else{
1021  rapidity = 0.5*(TMath::Log((fMCMother->E()+fMCMother->Pz()) / (fMCMother->E()-fMCMother->Pz())))-fRapidityShift;
1022  }
1023 
1024  // Rapidity Cut
1025  if( TMath::Abs(rapidity) > fRapidityCutMeson )return kFALSE;
1026 
1027  // min Pt Cut
1028  if(fDoMinPtCut && (fMCMother->Pt() < fMinPt)) return kFALSE;
1029 
1030  // Select only -> pi+ pi- pi0
1031  if( fMCMother->GetNDaughters() != 3 )return kFALSE;
1032 
1033  AliAODMCParticle *posPion = 0x0;
1034  AliAODMCParticle *negPion = 0x0;
1035  AliAODMCParticle *neutPion = 0x0;
1036 
1037 // cout << "\n"<< fMCMother->GetPdgCode() << "\n" << endl;
1038  for(Int_t index= fMCMother->GetDaughterFirst();index<= fMCMother->GetDaughterLast();index++){
1039  if(index < 0) continue;
1040  AliAODMCParticle* temp = static_cast<AliAODMCParticle*>(AODMCArray->At(index));
1041 // cout << temp->GetPdgCode() << endl;
1042  switch( temp->GetPdgCode() ) {
1043  case 211:
1044  posPion = temp;
1045  labelPosPion = index;
1046  break;
1047  case -211:
1048  negPion = temp;
1049  labelNegPion = index;
1050  break;
1051  case 111:
1052  neutPion = temp;
1053  labelNeutPion = index;
1054  break;
1055  }
1056  }
1057 
1058  if( posPion && negPion && neutPion ) return kTRUE;
1059  return kFALSE;
1060 }
1061 
1062 //________________________________________________________________________
1063 Bool_t AliConversionMesonCuts::MesonIsSelectedMCPiZeroGamma(TParticle *fMCMother, AliMCEvent *mcEvent, Int_t &labelNeutPion, Int_t &labelGamma, Double_t fRapidityShift){
1064  // returns true for omegas decaying into pi0 + gamma within the rapidity window
1065 
1066  if(!mcEvent) return kFALSE;
1067 
1068  if(fMCMother->GetPdgCode()!=223) return kFALSE; // we only want omegas
1069 
1070  Double_t rapidity = 10.;
1071 
1072  if(fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0){
1073  rapidity=8.-fRapidityShift;
1074  }
1075  else{
1076  rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
1077  }
1078 
1079  // Rapidity Cut
1080  if(TMath::Abs(rapidity) > fRapidityCutMeson)return kFALSE;
1081 
1082  // min Pt Cut
1083  if(fDoMinPtCut && (fMCMother->Pt() < fMinPt)) return kFALSE;
1084 
1085  if(fMCMother->GetNDaughters()!=2) return kFALSE;
1086 
1087  TParticle *gamma = 0x0;
1088  TParticle *pi0 = 0x0;
1089 
1090  for(Int_t index = fMCMother->GetFirstDaughter();index <= fMCMother->GetLastDaughter();index++){
1091  if(index < 0) continue;
1092  TParticle *temp = (TParticle*)mcEvent->Particle(index);
1093  switch(temp->GetPdgCode()){
1094  case 22:
1095  gamma = temp;
1096  labelGamma = index;
1097  break;
1098  case 111:
1099  pi0 = temp;
1100  labelNeutPion = index;
1101  break;
1102  }
1103  }
1104 
1105  if(gamma && pi0) return kTRUE;
1106  return kFALSE;
1107 
1108 }
1109 
1110 //________________________________________________________________________
1111 Bool_t AliConversionMesonCuts::MesonIsSelectedAODMCPiZeroGamma(AliAODMCParticle *fMCMother, TClonesArray *AODMCArray, Int_t &labelNeutPion, Int_t &labelGamma, Double_t fRapidityShift){
1112  // returns true for omegas decaying into pi0 + gamma within the rapidity window
1113 
1114  if(!AODMCArray) return kFALSE;
1115 
1116  if(fMCMother->GetPdgCode()!=223) return kFALSE; // we only want omegas
1117 
1118  Double_t rapidity = 10.;
1119 
1120  if(fMCMother->E() - fMCMother->Pz() == 0 || fMCMother->E() + fMCMother->Pz() == 0){
1121  rapidity=8.-fRapidityShift;
1122  }
1123  else{
1124  rapidity = 0.5*(TMath::Log((fMCMother->E()+fMCMother->Pz()) / (fMCMother->E()-fMCMother->Pz())))-fRapidityShift;
1125  }
1126 
1127  // Rapidity Cut
1128  if(TMath::Abs(rapidity) > fRapidityCutMeson)return kFALSE;
1129 
1130  // min Pt Cut
1131  if(fDoMinPtCut && (fMCMother->Pt() < fMinPt)) return kFALSE;
1132 
1133  if(fMCMother->GetNDaughters()!=2) return kFALSE;
1134 
1135  AliAODMCParticle *gamma = 0x0;
1136  AliAODMCParticle *pi0 = 0x0;
1137 
1138  for(Int_t index = fMCMother->GetDaughterFirst();index <= fMCMother->GetDaughterLast();index++){
1139  if(index < 0) continue;
1140  AliAODMCParticle* temp = static_cast<AliAODMCParticle*>(AODMCArray->At(index));
1141  switch(temp->GetPdgCode()){
1142  case 22:
1143  gamma = temp;
1144  labelGamma = index;
1145  break;
1146  case 111:
1147  pi0 = temp;
1148  labelNeutPion = index;
1149  break;
1150  }
1151  }
1152 
1153  if(gamma && pi0) return kTRUE;
1154  return kFALSE;
1155 
1156 }
1157 
1158 //________________________________________________________________________
1160 
1161  if(!DoPiZeroAngleCut) return kTRUE;
1162 
1163  Double_t PiZeroGammaAngle = pi0->Angle(gamma->Vect());
1164  Double_t omegaPt = omega->Pt();
1165 
1166  if(PiZeroGammaAngle > lowerFactor * maxfit->Eval(omegaPt) && PiZeroGammaAngle < upperFactor * maxfit->Eval(omegaPt)) return kTRUE;
1167  return kFALSE;
1168 
1169 }
1170 
1171 //________________________________________________________________________
1172 Bool_t AliConversionMesonCuts::MesonIsSelectedMCChiC(TParticle *fMCMother,AliMCEvent *mcEvent,Int_t & labelelectronChiC, Int_t & labelpositronChiC, Int_t & labelgammaChiC, Double_t fRapidityShift){
1173  // Returns true for all ChiC within acceptance cuts for decay into JPsi + gamma -> e+ + e- + gamma
1174  // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
1175 
1176  if(!mcEvent)return kFALSE;
1177  // if(fMCMother->GetPdgCode()==20443 ){
1178  // return kFALSE;
1179  // }
1180  if(fMCMother->GetPdgCode()==10441 || fMCMother->GetPdgCode()==10443 || fMCMother->GetPdgCode()==445 ){
1181  if(fMCMother->R()>fMaxR) return kFALSE; // cuts on distance from collision point
1182 
1183  Double_t rapidity = 10.;
1184  if(fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0){
1185  rapidity=8.-fRapidityShift;
1186  }
1187  else{
1188  rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
1189  }
1190 
1191  // Rapidity Cut
1192  if(TMath::Abs(rapidity)>fRapidityCutMeson)return kFALSE;
1193 
1194  // min Pt Cut
1195  if(fDoMinPtCut && (fMCMother->Pt() < fMinPt)) return kFALSE;
1196 
1197  // Select only -> ChiC radiative (JPsi+gamma) decay channel
1198  if(fMCMother->GetNDaughters()!=2)return kFALSE;
1199 
1200  TParticle *jpsi = 0x0;
1201  TParticle *gamma = 0x0;
1202  TParticle *positron = 0x0;
1203  TParticle *electron = 0x0;
1204 
1205  //Int_t labeljpsiChiC = -1;
1206 
1207  for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
1208  if(index < 0) continue;
1209  TParticle* temp = (TParticle*)mcEvent->Particle( index );
1210 
1211  switch( temp->GetPdgCode() ) {
1212  case 443:
1213  jpsi = temp;
1214  //labeljpsiChiC = index;
1215  break;
1216  case 22:
1217  gamma = temp;
1218  labelgammaChiC = index;
1219  break;
1220  }
1221  }
1222 
1223  if ( !jpsi || ! gamma) return kFALSE;
1224  if(jpsi->GetNDaughters()!=2)return kFALSE;
1225 
1226 
1227  for(Int_t index= jpsi->GetFirstDaughter();index<= jpsi->GetLastDaughter();index++){
1228  if(index < 0) continue;
1229  TParticle* temp = (TParticle*)mcEvent->Particle( index );
1230  switch( temp->GetPdgCode() ) {
1231  case -11:
1232  electron = temp;
1233  labelelectronChiC = index;
1234  break;
1235  case 11:
1236  positron = temp;
1237  labelpositronChiC = index;
1238  break;
1239  }
1240  }
1241  if( !electron || !positron) return kFALSE;
1242  if( positron && electron && gamma) return kTRUE;
1243  }
1244  return kFALSE;
1245 }
1246 
1247 //________________________________________________________________________
1248 Bool_t AliConversionMesonCuts::MesonIsSelectedAODMCChiC(AliAODMCParticle *fMCMother,TClonesArray *AODMCArray,Int_t & labelelectronChiC, Int_t & labelpositronChiC, Int_t & labelgammaChiC, Double_t fRapidityShift){
1249  // Returns true for all ChiC within acceptance cuts for decay into JPsi + gamma -> e+ + e- + gamma
1250  // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
1251 
1252  if(!AODMCArray)return kFALSE;
1253  // if(fMCMother->GetPdgCode()==20443 ){
1254  // return kFALSE;
1255  // }
1256  if(fMCMother->GetPdgCode()==10441 || fMCMother->GetPdgCode()==10443 || fMCMother->GetPdgCode()==445 ){
1257  Double_t rMeson = sqrt( (fMCMother->Xv()*fMCMother->Xv()) + (fMCMother->Yv()*fMCMother->Yv()) ) ;
1258  if( rMeson >fMaxR ) return kFALSE; // cuts on distance from collision point
1259 
1260  Double_t rapidity = 10.;
1261  if(fMCMother->E() - fMCMother->Pz() == 0 || fMCMother->E() + fMCMother->Pz() == 0){
1262  rapidity=8.-fRapidityShift;
1263  }
1264  else{
1265  rapidity = 0.5*(TMath::Log((fMCMother->E()+fMCMother->Pz()) / (fMCMother->E()-fMCMother->Pz())))-fRapidityShift;
1266  }
1267 
1268  // Rapidity Cut
1269  if(TMath::Abs(rapidity)>fRapidityCutMeson)return kFALSE;
1270 
1271  // min Pt Cut
1272  if(fDoMinPtCut && (fMCMother->Pt() < fMinPt)) return kFALSE;
1273 
1274  // Select only -> ChiC radiative (JPsi+gamma) decay channel
1275  if(fMCMother->GetNDaughters()!=2)return kFALSE;
1276 
1277  AliAODMCParticle *jpsi = 0x0;
1278  AliAODMCParticle *gamma = 0x0;
1279  AliAODMCParticle *positron = 0x0;
1280  AliAODMCParticle *electron = 0x0;
1281 
1282  //Int_t labeljpsiChiC = -1;
1283 
1284  for(Int_t index= fMCMother->GetDaughterFirst();index<= fMCMother->GetDaughterLast();index++){
1285  if(index < 0) continue;
1286  AliAODMCParticle* temp = static_cast<AliAODMCParticle*>(AODMCArray->At(index));
1287 
1288  switch( temp->GetPdgCode() ) {
1289  case 443:
1290  jpsi = temp;
1291  //labeljpsiChiC = index;
1292  break;
1293  case 22:
1294  gamma = temp;
1295  labelgammaChiC = index;
1296  break;
1297  }
1298  }
1299 
1300  if ( !jpsi || ! gamma) return kFALSE;
1301  if(jpsi->GetNDaughters()!=2)return kFALSE;
1302 
1303 
1304  for(Int_t index= jpsi->GetDaughterFirst();index<= jpsi->GetDaughterLast();index++){
1305  if(index < 0) continue;
1306  AliAODMCParticle* temp = static_cast<AliAODMCParticle*>(AODMCArray->At(index));
1307  switch( temp->GetPdgCode() ) {
1308  case -11:
1309  electron = temp;
1310  labelelectronChiC = index;
1311  break;
1312  case 11:
1313  positron = temp;
1314  labelpositronChiC = index;
1315  break;
1316  }
1317  }
1318  if( !electron || !positron) return kFALSE;
1319  if( positron && electron && gamma) return kTRUE;
1320  }
1321  return kFALSE;
1322 }
1323 
1324 //________________________________________________________________________
1325 Bool_t AliConversionMesonCuts::MesonIsSelectedMCChiCAODESD(AliDalitzAODESDMC *fMCMother,AliDalitzEventMC *mcEvent,Int_t & labelelectronChiC, Int_t & labelpositronChiC, Int_t & labelgammaChiC, Double_t fRapidityShift){
1326 // Returns true for all ChiC within acceptance cuts for decay into JPsi + gamma -> e+ + e- + gamma
1327 // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
1328  if(!mcEvent)return kFALSE;
1329  // if(fMCMother->GetPdgCode()==20443 ){
1330  // return kFALSE;
1331  // }
1332  if(fMCMother->GetPdgCodeG()==10441 || fMCMother->GetPdgCodeG()==10443 || fMCMother->GetPdgCodeG()==445 ){
1333  if(fMCMother->GetRatioVxyG()>fMaxR) return kFALSE; // cuts on distance from collision point
1334 
1335  Double_t rapidity = 10.;
1336  if(fMCMother->EnergyG() - fMCMother->PzG() == 0 || fMCMother->EnergyG() + fMCMother->PzG() == 0){
1337  rapidity=8.-fRapidityShift;
1338  }
1339  else{
1340  rapidity = 0.5*(TMath::Log((fMCMother->EnergyG()+fMCMother->PzG()) / (fMCMother->EnergyG()-fMCMother->PzG())))-fRapidityShift;
1341  }
1342 
1343  // Rapidity Cut
1344  if(TMath::Abs(rapidity)>fRapidityCutMeson)return kFALSE;
1345 
1346  // min Pt Cut
1347  if(fDoMinPtCut && (fMCMother->PtG() < fMinPt)) return kFALSE;
1348 
1349  // Select only -> ChiC radiative (JPsi+gamma) decay channel
1350  if(fMCMother->GetNDaughtersG()!=2)return kFALSE;
1351 
1352  AliDalitzAODESDMC *jpsi = 0x0;
1353  AliDalitzAODESDMC *gamma = 0x0;
1354  AliDalitzAODESDMC *positron = 0x0;
1355  AliDalitzAODESDMC *electron = 0x0;
1356 
1357  //Int_t labeljpsiChiC = -1;
1358 
1359  for(Int_t index= fMCMother->GetFirstDaughterG();index<= fMCMother->GetLastDaughterG();index++){
1360  if(index < 0) continue;
1361  AliDalitzAODESDMC* temp = mcEvent->Particle(index);
1362  //TParticle* temp = (TParticle*)mcEvent->Particle( index );
1363 
1364  switch( temp->GetPdgCodeG() ) {
1365  case 443:
1366  jpsi = temp;
1367  //labeljpsiChiC = index;
1368  break;
1369  case 22:
1370  gamma = temp;
1371  labelgammaChiC = index;
1372  break;
1373  }
1374  }
1375  if ( !jpsi || ! gamma) return kFALSE;
1376  if(jpsi->GetNDaughtersG()!=2)return kFALSE;
1377 
1378  for(Int_t index= jpsi->GetFirstDaughterG();index<= jpsi->GetLastDaughterG();index++){
1379  if(index < 0) continue;
1380  AliDalitzAODESDMC* temp = mcEvent->Particle(index);
1381  //TParticle* temp = (TParticle*)mcEvent->Particle( index );
1382  switch( temp->GetPdgCodeG() ) {
1383  case -11:
1384  electron = temp;
1385  labelelectronChiC = index;
1386  break;
1387  case 11:
1388  positron = temp;
1389  labelpositronChiC = index;
1390  break;
1391  }
1392  }
1393  if( !electron || !positron) return kFALSE;
1394  if( positron && electron && gamma) return kTRUE;
1395  }
1396  return kFALSE;
1397 }
1398 //________________________________________________________________________
1399 Bool_t AliConversionMesonCuts::MesonIsSelected(AliAODConversionMother *pi0,Bool_t IsSignal, Double_t fRapidityShift, Int_t leadingCellID1, Int_t leadingCellID2)
1400 {
1401 
1402  // Selection of reconstructed Meson candidates
1403  // Use flag IsSignal in order to fill Fill different
1404  // histograms for Signal and Background
1405  TH2 *hist=0x0;
1406 
1407  if(IsSignal){hist=fHistoMesonCuts;}
1408  else{hist=fHistoMesonBGCuts;}
1409 
1410  Int_t cutIndex=0;
1411 
1412  if(hist)hist->Fill(cutIndex, pi0->Pt());
1413  cutIndex++;
1414 
1415  // Undefined Rapidity -> Floating Point exception
1416  if((pi0->E()+pi0->Pz())/(pi0->E()-pi0->Pz())<=0){
1417  if(hist)hist->Fill(cutIndex, pi0->Pt());
1418  cutIndex++;
1419  if (!IsSignal)cout << "undefined rapidity" << endl;
1420  return kFALSE;
1421  }
1422  else{
1423  // PseudoRapidity Cut --> But we cut on Rapidity !!!
1424  cutIndex++;
1425  if(TMath::Abs(pi0->Rapidity()-fRapidityShift)>fRapidityCutMeson){
1426  if(hist)hist->Fill(cutIndex, pi0->Pt());
1427  return kFALSE;
1428  }
1429  }
1430  cutIndex++;
1431 
1432  if (fHistoInvMassBefore) fHistoInvMassBefore->Fill(pi0->M());
1433  // Mass cut
1434  if (fIsMergedClusterCut == 1 ){
1435  if (fEnableMassCut){
1436  Double_t massMin = FunctionMinMassCut(pi0->E());
1437  Double_t massMax = FunctionMaxMassCut(pi0->E());
1438  // cout << "Min mass: " << massMin << "\t max Mass: " << massMax << "\t mass current: " << pi0->M()<< "\t E current: " << pi0->E() << endl;
1439  if (pi0->M() > massMax || pi0->M() < massMin ){
1440  if(hist)hist->Fill(cutIndex, pi0->Pt());
1441  return kFALSE;
1442  }
1443  }
1444  cutIndex++;
1445  }else if(fIsMergedClusterCut == 2){
1446  if(fEnableOneCellDistCut && ((leadingCellID1 == leadingCellID2) || fCaloPhotonCuts->AreNeighbours(leadingCellID1,leadingCellID2)) ){
1447  if(hist)hist->Fill(cutIndex, pi0->Pt());
1448  return kFALSE;
1449  }
1450  cutIndex++;
1451  }
1452 
1453  // Opening Angle Cut
1454  //fOpeningAngle=2*TMath::ATan(0.134/pi0->P());// physical minimum opening angle
1456  if(hist)hist->Fill(cutIndex, pi0->Pt());
1457  return kFALSE;
1458  }
1459 
1460  // Min Opening Angle
1461  if (fMinOpanPtDepCut == kTRUE) fMinOpanCutMeson = fFMinOpanCut->Eval(pi0->Pt());
1462 
1463  if (pi0->GetOpeningAngle() < fMinOpanCutMeson){
1464  if(hist)hist->Fill(cutIndex, pi0->Pt());
1465  return kFALSE;
1466  }
1467 
1468  // Max Opening Angle
1469  if (fMaxOpanPtDepCut == kTRUE) fMaxOpanCutMeson = fFMaxOpanCut->Eval(pi0->Pt());
1470 
1471  if( pi0->GetOpeningAngle() > fMaxOpanCutMeson){
1472  if(hist)hist->Fill(cutIndex, pi0->Pt());
1473  return kFALSE;
1474  }
1475  cutIndex++;
1476 
1477  // Alpha Max Cut
1478  if (fIsMergedClusterCut == 1 && fAlphaPtDepCut) fAlphaCutMeson = fFAlphaCut->Eval(pi0->E());
1479  else if (fAlphaPtDepCut == kTRUE) fAlphaCutMeson = fFAlphaCut->Eval(pi0->Pt());
1480 
1481  if(TMath::Abs(pi0->GetAlpha())>fAlphaCutMeson){
1482  if(hist)hist->Fill(cutIndex, pi0->Pt());
1483  return kFALSE;
1484  }
1485  cutIndex++;
1486 
1487  // Alpha Min Cut
1488  if(TMath::Abs(pi0->GetAlpha())<fAlphaMinCutMeson){
1489  if(hist)hist->Fill(cutIndex, pi0->Pt());
1490  return kFALSE;
1491  }
1492  cutIndex++;
1493 
1494  if (fHistoInvMassAfter) fHistoInvMassAfter->Fill(pi0->M());
1495 
1496  if (fIsMergedClusterCut == 0){
1499 
1500  if (fDCAGammaGammaCutOn){
1502  if(hist)hist->Fill(cutIndex, pi0->Pt());
1503  return kFALSE;
1504  }
1505  }
1506  cutIndex++;
1507 
1510  if(hist)hist->Fill(cutIndex, pi0->Pt());
1511  return kFALSE;
1512  }
1513  }
1514  cutIndex++;
1515 
1517 
1519  if (TMath::Abs(pi0->GetDCAZMotherPrimVtx()) > fDCAZMesonPrimVtxCut){
1520  if(hist)hist->Fill(cutIndex, pi0->Pt());
1521  return kFALSE;
1522  }
1523  }
1524  cutIndex++;
1525 
1529  }
1530 
1531  //PtCut
1532  if(fDoMinPtCut){
1533  if(pi0->Pt()< fMinPt){
1534  if(hist)hist->Fill(cutIndex, pi0->Pt());
1535  return kFALSE;
1536  }
1537  }
1538  cutIndex++;
1539 
1540  if(hist)hist->Fill(cutIndex, pi0->Pt());
1541  return kTRUE;
1542 }
1543 
1544 
1545 
1546 //________________________________________________________________________
1547 //________________________________________________________________________
1550 
1551  if(fCutString && fCutString->GetString().Length() == kNCuts) {
1552  fCutString->SetString(GetCutNumber());
1553  } else {
1554  return kFALSE;
1555  }
1556  return kTRUE;
1557 }
1558 
1559 //________________________________________________________________________
1561  fCutStringRead = Form("%s",analysisCutSelection.Data());
1562 
1563  // Initialize Cuts from a given Cut string
1564  // AliInfo(Form("Set Meson Cutnumber: %s",analysisCutSelection.Data()));
1565  if(analysisCutSelection.Length()!=kNCuts) {
1566  AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
1567  return kFALSE;
1568  }
1569  if(!analysisCutSelection.IsAlnum()){
1570  AliError("Cut selection is not alphanumeric");
1571  return kFALSE;
1572  }
1573 
1574  TString analysisCutSelectionLowerCase = Form("%s",analysisCutSelection.Data());
1575  analysisCutSelectionLowerCase.ToLower();
1576  const char *cutSelection = analysisCutSelectionLowerCase.Data();
1577  #define ASSIGNARRAY(i) fCuts[i] = ((int)cutSelection[i]>=(int)'a') ? cutSelection[i]-'a'+10 : cutSelection[i]-'0'
1578  for(Int_t ii=0;ii<kNCuts;ii++){
1579  ASSIGNARRAY(ii);
1580  }
1581 
1582  // Set Individual Cuts
1583  for(Int_t ii=0;ii<kNCuts;ii++){
1584  if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
1585  }
1586 
1588  return kTRUE;
1589 }
1590 //________________________________________________________________________
1593 
1594  //cout << "Updating cut " << fgkCutNames[cutID] << " (" << cutID << ") to " << value << endl;
1595  switch (cutID) {
1596  case kMesonKind:
1597  if( SetMesonKind(value)) {
1598  fCuts[kMesonKind] = value;
1599  UpdateCutString();
1600  return kTRUE;
1601  } else return kFALSE;
1602  case kSelectionCut:
1603  if (fIsMergedClusterCut == 1){
1604  if( SetSelectionWindowMergedCut(value)) {
1605  fCuts[kSelectionCut] = value;
1606  UpdateCutString();
1607  return kTRUE;
1608  } else return kFALSE;
1609  } else {
1610  if( SetSelectionWindowCut(value)) {
1611  fCuts[kSelectionCut] = value;
1612  UpdateCutString();
1613  return kTRUE;
1614  } else return kFALSE;
1615  }
1616  case kalphaMesonCut:
1617  if (fIsMergedClusterCut == 1){
1618  if( SetAlphaMesonMergedCut(value)) {
1619  fCuts[kalphaMesonCut] = value;
1620  UpdateCutString();
1621  return kTRUE;
1622  } else return kFALSE;
1623  } else {
1624  if( SetAlphaMesonCut(value)) {
1625  fCuts[kalphaMesonCut] = value;
1626  UpdateCutString();
1627  return kTRUE;
1628  } else return kFALSE;
1629  }
1630  case kPtCut:
1631  if( SetMinPtCut(value)) {
1632  fCuts[kPtCut] = value;
1633  UpdateCutString();
1634  return kTRUE;
1635  } else return kFALSE;
1636 
1637  case kRapidityMesonCut:
1638  if( SetRapidityMesonCut(value)) {
1639  fCuts[kRapidityMesonCut] = value;
1640  UpdateCutString();
1641  return kTRUE;
1642  } else return kFALSE;
1643 
1644  case kBackgroundScheme:
1645  if( SetBackgroundScheme(value)) {
1646  fCuts[kBackgroundScheme] = value;
1647  UpdateCutString();
1648  return kTRUE;
1649  } else return kFALSE;
1650 
1652  if( SetNDegreesForRotationMethod(value)) {
1654  UpdateCutString();
1655  return kTRUE;
1656  } else return kFALSE;
1657 
1658  case kNumberOfBGEvents:
1659  if( SetNumberOfBGEvents(value)) {
1660  fCuts[kNumberOfBGEvents] = value;
1661  UpdateCutString();
1662  return kTRUE;
1663  } else return kFALSE;
1664 
1665  case kuseMCPSmearing:
1666  if( SetMCPSmearing(value)) {
1667  fCuts[kuseMCPSmearing] = value;
1668  UpdateCutString();
1669  return kTRUE;
1670  } else return kFALSE;
1671  case kElecShare:
1672  if( SetSharedElectronCut(value)) {
1673  fCuts[kElecShare] = value;
1674  UpdateCutString();
1675  return kTRUE;
1676  } else return kFALSE;
1677  case kToCloseV0s:
1678  if( SetToCloseV0sCut(value)) {
1679  fCuts[kToCloseV0s] = value;
1680  UpdateCutString();
1681  return kTRUE;
1682  } else return kFALSE;
1683  case kDcaGammaGamma:
1684  if( SetDCAGammaGammaCut(value)) {
1685  fCuts[kDcaGammaGamma] = value;
1686  UpdateCutString();
1687  return kTRUE;
1688  } else return kFALSE;
1689  case kDcaZPrimVtx:
1690  if( SetDCAZMesonPrimVtxCut(value)) {
1691  fCuts[kDcaZPrimVtx] = value;
1692  UpdateCutString();
1693  return kTRUE;
1694  } else return kFALSE;
1695  case kDcaRPrimVtx:
1696  if( SetDCARMesonPrimVtxCut(value)) {
1697  fCuts[kDcaRPrimVtx] = value;
1698  UpdateCutString();
1699  return kTRUE;
1700  } else return kFALSE;
1701  case kMinOpanMesonCut:
1702  if( SetMinOpanMesonCut(value)) {
1703  fCuts[kMinOpanMesonCut] = value;
1704  UpdateCutString();
1705  return kTRUE;
1706  } else return kFALSE;
1707 
1708  case kMaxOpanMesonCut:
1709  if( SetMaxOpanMesonCut(value)) {
1710  fCuts[kMaxOpanMesonCut] = value;
1711  UpdateCutString();
1712  return kTRUE;
1713  } else return kFALSE;
1714 
1715  case kNCuts:
1716  cout << "Error:: Cut id out of range"<< endl;
1717  return kFALSE;
1718  }
1719 
1720  cout << "Error:: Cut id " << cutID << " not recognized "<< endl;
1721  return kFALSE;
1722 
1723 }
1724 
1725 
1726 //________________________________________________________________________
1728  // Print out current Cut Selection
1729  for(Int_t ic = 0; ic < kNCuts; ic++) {
1730  printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
1731  }
1732 }
1733 
1734 //________________________________________________________________________
1736  // Print out current Cut Selection with values
1737  printf("\nMeson cutnumber \n");
1738  for(Int_t ic = 0; ic < kNCuts; ic++) {
1739  printf("%d",fCuts[ic]);
1740  }
1741  printf("\n\n");
1742 
1743  printf("Meson cuts \n");
1744  printf("\t |y| < %3.2f \n", fRapidityCutMeson);
1745  if (fEnableOneCellDistCut) printf("\t Only valid for GammaCalo: one cell distance cut enabled");
1746  if (fEnableMinOpeningAngleCut) printf("\t theta_{open} > %3.4f\n", fOpeningAngle);
1747  if (!fAlphaPtDepCut) printf("\t %3.2f < alpha < %3.2f\n", fAlphaMinCutMeson, fAlphaCutMeson);
1748  else printf("\t alpha pT-dep cut active\n");
1749  if (!fIsMergedClusterCut){
1750  if (fDCAGammaGammaCutOn)printf("\t dca_{gamma,gamma} < %3.2f\n", fDCAGammaGammaCut);
1751  if (fDCARMesonPrimVtxCutOn)printf("\t dca_{R, prim Vtx} < %3.2f\n", fDCARMesonPrimVtxCut);
1752  if (fDCAZMesonPrimVtxCutOn)printf("\t dca_{Z, prim Vtx} < %3.2f\n\n", fDCAZMesonPrimVtxCut);
1753  }
1754  if (fIsMergedClusterCut == 1 && fEnableMassCut){
1755  printf("\t Meson selection energy dependent\n\n");
1756  } else {
1757  if (fAcceptMesonMass)
1758  printf("\t Meson selection window for further analysis %3.3f > M_{gamma,gamma} > %3.3f\n\n", fSelectionLow, fSelectionHigh);
1759  else
1760  printf("\t Meson rejection window has been applied %3.3f > M_{gamma,gamma} > %3.3f\n\n", fSelectionLow, fSelectionHigh);
1761  }
1762  if(fDoMinPtCut) printf("\t pT_{min} > %3.4f\n", fMinPt);
1763  if (!fMinOpanPtDepCut) printf("\t theta_{open} > %3.4f\n", fMinOpanCutMeson);
1764  else printf("\t Min theta_{open} pT-dep cut active\n");
1765  if (!fMaxOpanPtDepCut) printf("\t %3.4f < theta_{open}\n", fMaxOpanCutMeson);
1766  else printf("\t Max theta_{open} pT-dep cut active\n");
1767  printf("\t Running mode for cutselection (0 std, 2 PCM-Calo): %d\n", fMode);
1768 
1769  printf("Meson BG settings \n");
1770  if (!fDoBG){
1771  printf("\t No BG estimation \n");
1772  } else {
1773  if (!fUseRotationMethodInBG & !fUseTrackMultiplicityForBG & !fBackgroundHandler) printf("\t BG scheme: mixing V0 mult \n");
1774  if (!fUseRotationMethodInBG & fUseTrackMultiplicityForBG & !fBackgroundHandler) printf("\t BG scheme: mixing track mult \n");
1775  if (fUseRotationMethodInBG )printf("\t BG scheme: rotation \n");
1776  if (fUsePtmaxMethodForBG )printf("\t BG scheme: Ptmax \n");
1777  if (fDoBGProbability) printf("\t -> use BG probability \n");
1778  if (fBackgroundHandler) printf("\t -> use new BG handler \n");
1779  printf("\t depth of pool: %d\n", fNumberOfBGEvents);
1780  if (fUseRotationMethodInBG )printf("\t degree's for BG rotation: %d\n", fNDegreeRotationPMForBG);
1781  if (!fUseRotationMethodInBG & !fUseTrackMultiplicityForBG & fBackgroundHandler) printf("\t BG scheme: event plane angle with V0 mult \n");
1782  }
1783 }
1784 
1785 
1786 //________________________________________________________________________
1788  // Set Cut
1789  switch(mesonKind){
1790  case 0:
1791  fMesonKind = 0;
1792  break;
1793  case 1:
1794  fMesonKind = 1;
1795  case 2:
1796  fMesonKind = 0;
1797  fDoJetAnalysis = kTRUE;
1798  break;
1799  case 3:
1800  fMesonKind = 0;
1801  fDoJetAnalysis = kTRUE;
1802  fDoJetQA = kTRUE;
1803  break;
1804  default:
1805  cout<<"Warning: Meson kind not defined"<<mesonKind<<endl;
1806  return kFALSE;
1807  }
1808  return kTRUE;
1809 }
1810 
1811 //________________________________________________________________________
1813  // Set Cut on min pT of meson
1814  switch(PtCut){
1815  case 0: // no cut on pT
1816  fMinPt = 0.;
1817  fDoMinPtCut = kFALSE;
1818  break;
1819  case 1:
1820  fMinPt = 0.4;
1821  fDoMinPtCut = kTRUE;
1822  break;
1823  case 2:
1824  fMinPt = 0.7;
1825  fDoMinPtCut = kTRUE;
1826  break;
1827  case 3:
1828  fMinPt = 0.9;
1829  fDoMinPtCut = kTRUE;
1830  break;
1831  case 4:
1832  fMinPt = 1.0;
1833  fDoMinPtCut = kTRUE;
1834  break;
1835  case 5:
1836  fMinPt = 1.2;
1837  fDoMinPtCut = kTRUE;
1838  break;
1839  case 6:
1840  fMinPt = 1.5;
1841  fDoMinPtCut = kTRUE;
1842  break;
1843  case 7:
1844  fMinPt = 0.5;
1845  fDoMinPtCut = kTRUE;
1846  break;
1847  default:
1848  cout<<"Warning: pT cut not defined"<<PtCut<<endl;
1849  return kFALSE;
1850  }
1851  return kTRUE;
1852 }
1853 
1854 //________________________________________________________________________
1856  // Set Cut
1857  switch(selectionCut){
1858  case 0:
1859  fSelectionLow = 0.0;
1860  fSelectionHigh = 4.;
1861  fAcceptMesonMass = kTRUE;
1862  break;
1863  case 1:
1864  fSelectionLow = 0.1;
1865  fSelectionHigh = 0.145;
1866  fAcceptMesonMass = kTRUE;
1867  break;
1868  case 2:
1869  fSelectionLow = 0.11;
1870  fSelectionHigh = 0.145;
1871  fAcceptMesonMass = kTRUE;
1872  break;
1873  case 3:
1874  fSelectionLow = 0.12;
1875  fSelectionHigh = 0.145;
1876  fAcceptMesonMass = kTRUE;
1877  break;
1878  case 4:
1879  fSelectionLow = 0.1;
1880  fSelectionHigh = 0.15;
1881  fAcceptMesonMass = kTRUE;
1882  break;
1883  case 5:
1884  fSelectionLow = 0.11;
1885  fSelectionHigh = 0.15;
1886  fAcceptMesonMass = kTRUE;
1887  break;
1888  case 6:
1889  fSelectionLow = 0.12;
1890  fSelectionHigh = 0.15;
1891  fAcceptMesonMass = kTRUE;
1892  break;
1893  case 7:
1894  fSelectionLow = 0.1;
1895  fSelectionHigh = 0.155;
1896  fAcceptMesonMass = kTRUE;
1897  break;
1898  case 8:
1899  fSelectionLow = 0.125;
1900  fSelectionHigh = 0.145;
1901  fAcceptMesonMass = kTRUE;
1902  break;
1903  case 9:
1904  fSelectionLow = 0.11;
1905  fSelectionHigh = 0.155;
1906  fAcceptMesonMass = kTRUE;
1907  break;
1908  case 10:
1909  fSelectionLow = 0.08;
1910  fSelectionHigh = 0.145;
1911  fAcceptMesonMass = kTRUE;
1912  break;
1913  case 11:
1914  fSelectionLow = 0.08;
1915  fSelectionHigh = 0.145;
1916  fAcceptMesonMass = kFALSE;
1917  break;
1918  case 12:
1919  fSelectionLow = 0.1;
1920  fSelectionHigh = 0.145;
1921  fAcceptMesonMass = kFALSE;
1922  break;
1923  case 13:
1924  fSelectionLow = 0.11;
1925  fSelectionHigh = 0.145;
1926  fAcceptMesonMass = kFALSE;
1927  break;
1928  case 14:
1929  fSelectionLow = 0.12;
1930  fSelectionHigh = 0.145;
1931  fAcceptMesonMass = kFALSE;
1932  break;
1933  case 15:
1934  fSelectionLow = 0.1;
1935  fSelectionHigh = 0.15;
1936  fAcceptMesonMass = kFALSE;
1937  break;
1938  case 16:
1939  fSelectionLow = 0.11;
1940  fSelectionHigh = 0.15;
1941  fAcceptMesonMass = kFALSE;
1942  break;
1943  case 17:
1944  fSelectionLow = 0.12;
1945  fSelectionHigh = 0.15;
1946  fAcceptMesonMass = kFALSE;
1947  break;
1948  case 18:
1949  fSelectionLow = 0.1;
1950  fSelectionHigh = 0.155;
1951  fAcceptMesonMass = kFALSE;
1952  break;
1953  case 19:
1954  fSelectionLow = 0.125;
1955  fSelectionHigh = 0.145;
1956  fAcceptMesonMass = kFALSE;
1957  break;
1958  case 20:
1959  fSelectionLow = 0.11;
1960  fSelectionHigh = 0.155;
1961  fAcceptMesonMass = kFALSE;
1962  break;
1963  case 21: //l
1964  fSelectionLow = 0.500;
1965  fSelectionHigh = 0.600;
1966  fAcceptMesonMass = kTRUE;
1967  break;
1968  case 22: //m
1969  fSelectionLow = 0.400;
1970  fSelectionHigh = 0.700;
1971  fAcceptMesonMass = kTRUE;
1972  break;
1973  case 23: //n
1974  fSelectionLow = 0.120;
1975  fSelectionHigh = 0.160;
1976  fAcceptMesonMass = kTRUE;
1977  break;
1978  default:
1979  cout<<"Warning: SelectionCut not defined "<<selectionCut<<endl;
1980  return kFALSE;
1981  }
1982  return kTRUE;
1983 }
1984 
1986  // Set Cut
1987  fSelectionWindowCut = selectionCut;
1988  switch(fSelectionWindowCut){
1989  case 0:
1990  fEnableMassCut = kFALSE;
1991  break;
1992  case 1: //NLM 1
1993  fEnableMassCut = kTRUE;
1994  break;
1995  case 2: //NLM 2
1996  fEnableMassCut = kTRUE;
1997  break;
1998  case 3: //NLM 1
1999  fEnableMassCut = kTRUE;
2000  break;
2001  case 4: //NLM 2
2002  fEnableMassCut = kTRUE;
2003  break;
2004  case 5: //NLM 1
2005  fEnableMassCut = kTRUE;
2006  break;
2007  case 6: //NLM 2
2008  fEnableMassCut = kTRUE;
2009  break;
2010  case 7: //min mass cut around 0
2011  fEnableMassCut = kTRUE;
2012  break;
2013  case 8: //min mass cut around 0
2014  fEnableMassCut = kTRUE;
2015  break;
2016  case 9: //min mass cut around 0
2017  fEnableMassCut = kTRUE;
2018  break;
2019  default:
2020  cout<<"Warning: SelectionCut merged not defined "<<selectionCut<<endl;
2021  return kFALSE;
2022  }
2023 
2024  return kTRUE;
2025 
2026 }
2027 
2029 
2030  Float_t switchMass = 0;
2031  Float_t aMassLow = 0;
2032  Float_t bMassLow = 0;
2033  Float_t aMassHigh = 0;
2034  Float_t bMassHigh = 0;
2035  Float_t aMass = 0;
2036  Float_t bMass = 0;
2037  Float_t switchSigma = 0.;
2038  Float_t nSigma = 0;
2039  Float_t aSigmaLow = 0.;
2040  Float_t bSigmaLow = 0;
2041  Float_t aSigmaHigh = 0.;
2042  Float_t bSigmaHigh = 0;
2043  Float_t mass = 0;
2044  Float_t sigma = 0;
2045 
2046  switch(fSelectionWindowCut){
2047  case 0:
2048  fEnableMassCut = kFALSE;
2049  break;
2050  case 1: //NLM 1
2051  aMass = 0.044;
2052  bMass = 0.0049;
2053  switchSigma = 19.;
2054  nSigma = 3;
2055  aSigmaLow = 0.012;
2056  bSigmaLow = 0;
2057  aSigmaHigh = 0.0012;
2058  bSigmaHigh = 6e-4;
2059 
2060  mass = aMass + bMass*e;
2061  sigma = 0;
2062  if (e < switchSigma){
2063  sigma = aSigmaLow + bSigmaLow*e;
2064  } else {
2065  sigma = aSigmaHigh + bSigmaHigh*e;
2066  }
2067  return mass + nSigma*sigma;
2068  break;
2069  case 2: //NLM 2
2070  switchMass = 21;
2071  aMassLow = 0.115;
2072  bMassLow = 9.6e-4;
2073  aMassHigh = 0.1;
2074  bMassHigh = 0.0017;
2075  switchSigma = 10.;
2076  nSigma = 3;
2077  aSigmaLow = 0.009;
2078  bSigmaLow = 0;
2079  aSigmaHigh = 0.0023;
2080  bSigmaHigh = 6.7e-4;
2081 
2082  mass = 0;
2083  if (e < switchMass){
2084  mass = aMassLow + bMassLow*e;
2085  } else {
2086  mass = aMassHigh + bMassHigh*e;
2087  }
2088  sigma = 0;
2089  if (e < switchSigma){
2090  sigma = aSigmaLow + bSigmaLow*e;
2091  } else {
2092  sigma = aSigmaHigh + bSigmaHigh*e;
2093  }
2094  return mass + nSigma*sigma;
2095  break;
2096  case 3: //NLM 1
2097  aMass = 0.044;
2098  bMass = 0.0049;
2099  switchSigma = 19.;
2100  nSigma = 2;
2101  aSigmaLow = 0.012;
2102  bSigmaLow = 0;
2103  aSigmaHigh = 0.0012;
2104  bSigmaHigh = 6e-4;
2105 
2106  mass = aMass + bMass*e;
2107  sigma = 0;
2108  if (e < switchSigma){
2109  sigma = aSigmaLow + bSigmaLow*e;
2110  } else {
2111  sigma = aSigmaHigh + bSigmaHigh*e;
2112  }
2113  return mass + nSigma*sigma;
2114  break;
2115  case 4: //NLM 2
2116  switchMass = 21;
2117  aMassLow = 0.115;
2118  bMassLow = 9.6e-4;
2119  aMassHigh = 0.1;
2120  bMassHigh = 0.0017;
2121  switchSigma = 10.;
2122  nSigma = 2;
2123  aSigmaLow = 0.009;
2124  bSigmaLow = 0;
2125  aSigmaHigh = 0.0023;
2126  bSigmaHigh = 6.7e-4;
2127 
2128  mass = 0;
2129  if (e < switchMass){
2130  mass = aMassLow + bMassLow*e;
2131  } else {
2132  mass = aMassHigh + bMassHigh*e;
2133  }
2134  sigma = 0;
2135  if (e < switchSigma){
2136  sigma = aSigmaLow + bSigmaLow*e;
2137  } else {
2138  sigma = aSigmaHigh + bSigmaHigh*e;
2139  }
2140  return mass + nSigma*sigma;
2141  break;
2142  case 5: //NLM 1
2143  aMass = 0.044;
2144  bMass = 0.0049;
2145  switchSigma = 19.;
2146  nSigma = 4;
2147  aSigmaLow = 0.012;
2148  bSigmaLow = 0;
2149  aSigmaHigh = 0.0012;
2150  bSigmaHigh = 6e-4;
2151 
2152  mass = aMass + bMass*e;
2153  sigma = 0;
2154  if (e < switchSigma){
2155  sigma = aSigmaLow + bSigmaLow*e;
2156  } else {
2157  sigma = aSigmaHigh + bSigmaHigh*e;
2158  }
2159  return mass + nSigma*sigma;
2160  break;
2161  case 6: //NLM 2
2162  switchMass = 21;
2163  aMassLow = 0.115;
2164  bMassLow = 9.6e-4;
2165  aMassHigh = 0.1;
2166  bMassHigh = 0.0017;
2167  switchSigma = 10.;
2168  nSigma = 4;
2169  aSigmaLow = 0.009;
2170  bSigmaLow = 0;
2171  aSigmaHigh = 0.0023;
2172  bSigmaHigh = 6.7e-4;
2173 
2174  mass = 0;
2175  if (e < switchMass){
2176  mass = aMassLow + bMassLow*e;
2177  } else {
2178  mass = aMassHigh + bMassHigh*e;
2179  }
2180  sigma = 0;
2181  if (e < switchSigma){
2182  sigma = aSigmaLow + bSigmaLow*e;
2183  } else {
2184  sigma = aSigmaHigh + bSigmaHigh*e;
2185  }
2186  return mass + nSigma*sigma;
2187  break;
2188  case 7: // maximum mass
2189  return 10000.;
2190  break;
2191  case 8: // maximum mass
2192  return 10000.;
2193  break;
2194  case 9: // maximum mass
2195  return 10000.;
2196  break;
2197  default:
2198  cout<<"Warning: SelectionCut merged not defined "<<fSelectionWindowCut<<endl;
2199  return -1;
2200  }
2201  return -1;
2202 
2203 }
2204 
2206 
2207  Float_t switchMass = 0;
2208  Float_t aMassLow = 0;
2209  Float_t bMassLow = 0;
2210  Float_t aMassHigh = 0;
2211  Float_t bMassHigh = 0;
2212  Float_t aMass = 0;
2213  Float_t bMass = 0;
2214  Float_t switchSigma = 0.;
2215  Float_t nSigma = 0;
2216  Float_t aSigmaLow = 0.;
2217  Float_t bSigmaLow = 0;
2218  Float_t aSigmaHigh = 0.;
2219  Float_t bSigmaHigh = 0;
2220  Float_t mass = 0;
2221  Float_t sigma = 0;
2222 
2223  switch(fSelectionWindowCut){
2224  case 0:
2225  fEnableMassCut = kFALSE;
2226  break;
2227  case 1: //NLM 1
2228  aMass = 0.044;
2229  bMass = 0.0049;
2230  switchSigma = 19.;
2231  nSigma = 3;
2232  aSigmaLow = 0.012;
2233  bSigmaLow = 0;
2234  aSigmaHigh = 0.0012;
2235  bSigmaHigh = 6e-4;
2236 
2237  mass = aMass + bMass*e;
2238  sigma = 0;
2239  if (e < switchSigma){
2240  sigma = aSigmaLow + bSigmaLow*e;
2241  } else {
2242  sigma = aSigmaHigh + bSigmaHigh*e;
2243  }
2244  // cout << "E: "<< e << "\t mass: " << mass << "\t sigma: " << sigma<< endl;
2245  return mass - nSigma*sigma;
2246  break;
2247  case 2: //NLM 2
2248  switchMass = 21;
2249  aMassLow = 0.115;
2250  bMassLow = 9.6e-4;
2251  aMassHigh = 0.1;
2252  bMassHigh = 0.0017;
2253  switchSigma = 10.;
2254  nSigma = 3;
2255  aSigmaLow = 0.009;
2256  bSigmaLow = 0;
2257  aSigmaHigh = 0.0023;
2258  bSigmaHigh = 6.7e-4;
2259 
2260  mass = 0;
2261  if (e < switchMass){
2262  mass = aMassLow + bMassLow*e;
2263  } else {
2264  mass = aMassHigh + bMassHigh*e;
2265  }
2266  sigma = 0;
2267  if (e < switchSigma){
2268  sigma = aSigmaLow + bSigmaLow*e;
2269  } else {
2270  sigma = aSigmaHigh + bSigmaHigh*e;
2271  }
2272  // cout << "E: "<< e << "\t mass: " << mass << "\t sigma: "<< sigma << endl;
2273 
2274  return mass - nSigma*sigma;
2275  break;
2276  case 3: //NLM 1
2277  aMass = 0.044;
2278  bMass = 0.0049;
2279  switchSigma = 19.;
2280  nSigma = 2;
2281  aSigmaLow = 0.012;
2282  bSigmaLow = 0;
2283  aSigmaHigh = 0.0012;
2284  bSigmaHigh = 6e-4;
2285 
2286  mass = aMass + bMass*e;
2287  sigma = 0;
2288  if (e < switchSigma){
2289  sigma = aSigmaLow + bSigmaLow*e;
2290  } else {
2291  sigma = aSigmaHigh + bSigmaHigh*e;
2292  }
2293  // cout << "E: "<< e << "\t mass: " << mass << "\t sigma: " << sigma<< endl;
2294  return mass - nSigma*sigma;
2295  break;
2296  case 4: //NLM 2
2297  switchMass = 21;
2298  aMassLow = 0.115;
2299  bMassLow = 9.6e-4;
2300  aMassHigh = 0.1;
2301  bMassHigh = 0.0017;
2302  switchSigma = 10.;
2303  nSigma = 2;
2304  aSigmaLow = 0.009;
2305  bSigmaLow = 0;
2306  aSigmaHigh = 0.0023;
2307  bSigmaHigh = 6.7e-4;
2308 
2309  mass = 0;
2310  if (e < switchMass){
2311  mass = aMassLow + bMassLow*e;
2312  } else {
2313  mass = aMassHigh + bMassHigh*e;
2314  }
2315  sigma = 0;
2316  if (e < switchSigma){
2317  sigma = aSigmaLow + bSigmaLow*e;
2318  } else {
2319  sigma = aSigmaHigh + bSigmaHigh*e;
2320  }
2321  // cout << "E: "<< e << "\t mass: " << mass << "\t sigma: "<< sigma << endl;
2322 
2323  return mass - nSigma*sigma;
2324  break;
2325  case 5: //NLM 1
2326  aMass = 0.044;
2327  bMass = 0.0049;
2328  switchSigma = 19.;
2329  nSigma = 4;
2330  aSigmaLow = 0.012;
2331  bSigmaLow = 0;
2332  aSigmaHigh = 0.0012;
2333  bSigmaHigh = 6e-4;
2334 
2335  mass = aMass + bMass*e;
2336  sigma = 0;
2337  if (e < switchSigma){
2338  sigma = aSigmaLow + bSigmaLow*e;
2339  } else {
2340  sigma = aSigmaHigh + bSigmaHigh*e;
2341  }
2342  // cout << "E: "<< e << "\t mass: " << mass << "\t sigma: " << sigma<< endl;
2343  return mass - nSigma*sigma;
2344  break;
2345  case 6: //NLM 2
2346  switchMass = 21;
2347  aMassLow = 0.115;
2348  bMassLow = 9.6e-4;
2349  aMassHigh = 0.1;
2350  bMassHigh = 0.0017;
2351  switchSigma = 10.;
2352  nSigma = 4;
2353  aSigmaLow = 0.009;
2354  bSigmaLow = 0;
2355  aSigmaHigh = 0.0023;
2356  bSigmaHigh = 6.7e-4;
2357 
2358  mass = 0;
2359  if (e < switchMass){
2360  mass = aMassLow + bMassLow*e;
2361  } else {
2362  mass = aMassHigh + bMassHigh*e;
2363  }
2364  sigma = 0;
2365  if (e < switchSigma){
2366  sigma = aSigmaLow + bSigmaLow*e;
2367  } else {
2368  sigma = aSigmaHigh + bSigmaHigh*e;
2369  }
2370  // cout << "E: "<< e << "\t mass: " << mass << "\t sigma: "<< sigma << endl;
2371  return mass - nSigma*sigma;
2372  break;
2373 
2374  case 7: // just exclude band at 0
2375  return 0.005+0.004*e;
2376  break;
2377  case 8: // just exclude band at 0 looser
2378  return 0.004+0.004*e;
2379  break;
2380  case 9: // just exclude band at 0 tighter
2381  return 0.006+0.004*e;
2382  break;
2383 
2384  default:
2385  cout<<"Warning: SelectionCut merged not defined "<<fSelectionWindowCut<<endl;
2386  return -1;
2387  }
2388  return -1;
2389 }
2390 
2391 //________________________________________________________________________
2393 { // Set Cut
2394  switch(alphaMesonCut){
2395  case 0: // 0- 0.7
2396  fAlphaMinCutMeson = 0.0;
2397  fAlphaCutMeson = 0.7;
2398  fAlphaPtDepCut = kFALSE;
2399  break;
2400  case 1: // Updated 15 May 2015
2401  if (fIsMergedClusterCut == 0){
2402  if( fFAlphaCut ) delete fFAlphaCut;
2403  fFAlphaCut = new TF1("fFAlphaCut","[0]*tanh([1]*x)",0.,100.);
2404  fFAlphaCut->SetParameter(0,0.65);
2405  fFAlphaCut->SetParameter(1,1.8);
2406  fAlphaMinCutMeson = 0.0;
2407  fAlphaCutMeson = -1.0;
2408  fAlphaPtDepCut = kTRUE;
2409  } else {
2410  fAlphaPtDepCut = kFALSE;
2411  fAlphaMinCutMeson = 0.5;
2412  fAlphaCutMeson = 1;
2413  }
2414  break;
2415  case 2: // Updated 31 October 2013 before 0.5-1
2416  if (fIsMergedClusterCut == 0){
2417  if( fFAlphaCut ) delete fFAlphaCut;
2418  fFAlphaCut = new TF1("fFAlphaCut","[0]*tanh([1]*x)",0.,100.);
2419  fFAlphaCut->SetParameter(0,0.8);
2420  fFAlphaCut->SetParameter(1,1.2);
2421  fAlphaMinCutMeson = 0.0;
2422  fAlphaCutMeson = -1.0;
2423  fAlphaPtDepCut = kTRUE;
2424  } else {
2425  fAlphaPtDepCut = kFALSE;
2426  fAlphaMinCutMeson = 0.6;
2427  fAlphaCutMeson = 1;
2428  }
2429  break;
2430  case 3: // 0.0-1
2431  fAlphaMinCutMeson = 0.0;
2432  fAlphaCutMeson = 1.;
2433  fAlphaPtDepCut = kFALSE;
2434  break;
2435  case 4: // 0-0.65
2436  fAlphaMinCutMeson = 0.0;
2437  fAlphaCutMeson = 0.65;
2438  fAlphaPtDepCut = kFALSE;
2439  break;
2440  case 5: // 0-0.75
2441  fAlphaMinCutMeson = 0.0;
2442  fAlphaCutMeson = 0.75;
2443  fAlphaPtDepCut = kFALSE;
2444  break;
2445  case 6: // 0-0.8
2446  fAlphaMinCutMeson = 0.0;
2447  fAlphaCutMeson = 0.8;
2448  fAlphaPtDepCut = kFALSE;
2449  break;
2450  case 7: // 0.0-0.85
2451  fAlphaMinCutMeson = 0.0;
2452  fAlphaCutMeson = 0.85;
2453  fAlphaPtDepCut = kFALSE;
2454  break;
2455  case 8: // 0.0-0.6
2456  fAlphaMinCutMeson = 0.0;
2457  fAlphaCutMeson = 0.6;
2458  fAlphaPtDepCut = kFALSE;
2459  break;
2460  case 9: // Updated 11 November 2013 before 0.0 - 0.3
2461  if (fIsMergedClusterCut == 0){
2462  if( fFAlphaCut ) delete fFAlphaCut;
2463  fFAlphaCut = new TF1("fFAlphaCut","[0]*tanh([1]*x)",0.,100.);
2464  fFAlphaCut->SetParameter(0,0.65);
2465  fFAlphaCut->SetParameter(1,1.2);
2466  fAlphaMinCutMeson = 0.0;
2467  fAlphaCutMeson = -1.0;
2468  fAlphaPtDepCut = kTRUE;
2469  } else {
2470  fAlphaPtDepCut = kFALSE;
2471  fAlphaMinCutMeson = 0.4;
2472  fAlphaCutMeson = 1;
2473  }
2474  break;
2475  case 10: //a 0-0.2
2476  fAlphaMinCutMeson = 0.0;
2477  fAlphaCutMeson = 0.2;
2478  fAlphaPtDepCut = kFALSE;
2479  break;
2480  case 11: //b 0.2-0.6
2481  fAlphaMinCutMeson = 0.2;
2482  fAlphaCutMeson = 0.6;
2483  fAlphaPtDepCut = kFALSE;
2484  break;
2485  case 12: //c 0.6-1.0
2486  fAlphaMinCutMeson = 0.6;
2487  fAlphaCutMeson = 1.0;
2488  fAlphaPtDepCut = kFALSE;
2489  break;
2490  case 13: //d 0-0.1
2491  fAlphaMinCutMeson = 0.0;
2492  fAlphaCutMeson = 0.1;
2493  fAlphaPtDepCut = kFALSE;
2494  break;
2495  default:
2496  cout<<"Warning: AlphaMesonCut not defined "<<alphaMesonCut<<endl;
2497  return kFALSE;
2498  }
2499  return kTRUE;
2500 }
2501 
2502 
2503 //________________________________________________________________________
2505 { // Set Cut
2506  switch(alphaMesonCut){
2507  case 0: // 0- 1
2508  fAlphaMinCutMeson = 0.0;
2509  fAlphaCutMeson = 1;
2510  fAlphaPtDepCut = kFALSE;
2511  break;
2512  case 1: // cut for NLM 1
2513  if( fFAlphaCut ) delete fFAlphaCut;
2514  fFAlphaCut = new TF1("fFAlphaCut","[0]+[1]*x+[2]/(x*x*x)",0.,100.);
2515  fFAlphaCut->SetParameter(0,0.96);
2516  fFAlphaCut->SetParameter(1,0);
2517  fFAlphaCut->SetParameter(2,-879);
2518  fAlphaMinCutMeson = 0.0;
2519  fAlphaCutMeson = -1.0;
2520  fAlphaPtDepCut = kTRUE;
2521  break;
2522  case 2: // cut for NLM 2
2523  if( fFAlphaCut ) delete fFAlphaCut;
2524  fFAlphaCut = new TF1("fFAlphaCut","[0]+[1]*x+[2]/(x*x*x)",0.,100.);
2525  fFAlphaCut->SetParameter(0,0.95);
2526  fFAlphaCut->SetParameter(1,0.0015);
2527  fFAlphaCut->SetParameter(2,-233);
2528  fAlphaMinCutMeson = 0.0;
2529  fAlphaCutMeson = -1.0;
2530  fAlphaPtDepCut = kTRUE;
2531  break;
2532  case 3: // cut for NLM 1 larger
2533  if( fFAlphaCut ) delete fFAlphaCut;
2534  fFAlphaCut = new TF1("fFAlphaCut","[0]+[1]*x+[2]/(x*x*x)",0.,100.);
2535  fFAlphaCut->SetParameter(0,0.975);
2536  fFAlphaCut->SetParameter(1,0);
2537  fFAlphaCut->SetParameter(2,-800);
2538  fAlphaMinCutMeson = 0.0;
2539  fAlphaCutMeson = -1.0;
2540  fAlphaPtDepCut = kTRUE;
2541  break;
2542  case 4: // cut for NLM 2 larger
2543  if( fFAlphaCut ) delete fFAlphaCut;
2544  fFAlphaCut = new TF1("fFAlphaCut","[0]+[1]*x+[2]/(x*x*x)",0.,100.);
2545  fFAlphaCut->SetParameter(0,0.97);
2546  fFAlphaCut->SetParameter(1,0.0015);
2547  fFAlphaCut->SetParameter(2,-200);
2548  fAlphaMinCutMeson = 0.0;
2549  fAlphaCutMeson = -1.0;
2550  fAlphaPtDepCut = kTRUE;
2551  break;
2552  case 5: // cut for NLM 1 smaller
2553  if( fFAlphaCut ) delete fFAlphaCut;
2554  fFAlphaCut = new TF1("fFAlphaCut","[0]+[1]*x+[2]/(x*x*x)",0.,100.);
2555  fFAlphaCut->SetParameter(0,0.94);
2556  fFAlphaCut->SetParameter(1,0);
2557  fFAlphaCut->SetParameter(2,-970);
2558  fAlphaMinCutMeson = 0.0;
2559  fAlphaCutMeson = -1.0;
2560  fAlphaPtDepCut = kTRUE;
2561  break;
2562  case 6: // cut for NLM 2 smaller
2563  if( fFAlphaCut ) delete fFAlphaCut;
2564  fFAlphaCut = new TF1("fFAlphaCut","[0]+[1]*x+[2]/(x*x*x)",0.,100.);
2565  fFAlphaCut->SetParameter(0,0.935);
2566  fFAlphaCut->SetParameter(1,0.0015);
2567  fFAlphaCut->SetParameter(2,-273);
2568  fAlphaMinCutMeson = 0.0;
2569  fAlphaCutMeson = -1.0;
2570  fAlphaPtDepCut = kTRUE;
2571  break;
2572 
2573  default:
2574  cout<<"Warning: AlphaMesonCut for merged clusters not defined "<<alphaMesonCut<<endl;
2575  return kFALSE;
2576  }
2577  return kTRUE;
2578 }
2579 
2580 //________________________________________________________________________
2582  // Set Cut
2583  switch(RapidityMesonCut){
2584  case 0: // changed from 0.9 to 1.35
2585  fRapidityCutMeson = 1.35;
2586  break;
2587  case 1: //
2588  fRapidityCutMeson = 0.8;
2589  break;
2590  case 2: //
2591  fRapidityCutMeson = 0.7;
2592  break;
2593  case 3: //
2594  fRapidityCutMeson = 0.6;
2595  break;
2596  case 4: //
2597  fRapidityCutMeson = 0.5;
2598  break;
2599  case 5: //
2600  fRapidityCutMeson = 0.85;
2601  break;
2602  case 6: //
2603  fRapidityCutMeson = 0.75;
2604  break;
2605  case 7: //
2606  fRapidityCutMeson = 0.3;
2607  break;
2608  case 8: //changed, before 0.35
2609  fRapidityCutMeson = 0.25;
2610  break;
2611  case 9: //
2612  fRapidityCutMeson = 0.4;
2613  break;
2614  default:
2615  cout<<"Warning: RapidityMesonCut not defined "<<RapidityMesonCut<<endl;
2616  return kFALSE;
2617  }
2618  return kTRUE;
2619 }
2620 
2621 
2622 //________________________________________________________________________
2624  // Set Cut
2625  switch(BackgroundScheme){
2626  case 0: //Rotation
2627  fUseRotationMethodInBG = kTRUE;
2628  fDoBGProbability = kFALSE;
2629  break;
2630  case 1: // mixed event with V0 multiplicity
2631  fUseRotationMethodInBG = kFALSE;
2632  fUseTrackMultiplicityForBG = kFALSE;
2633  fDoBGProbability = kFALSE;
2634  break;
2635  case 2: // mixed event with track multiplicity
2636  fUseRotationMethodInBG = kFALSE;
2638  fDoBGProbability = kFALSE;
2639  break;
2640  case 3: //Rotation
2641  fUseRotationMethodInBG = kTRUE;
2642  fDoBGProbability = kTRUE;
2643  break;
2644  case 4: //No BG calculation
2645  cout << "no BG calculation should be done" << endl;
2646  fUseRotationMethodInBG = kFALSE;
2647  fDoBGProbability = kFALSE;
2648  fDoBG = kFALSE;
2649  break;
2650  case 5: //Rotation
2651  fUseRotationMethodInBG = kTRUE;
2652  fDoBGProbability = kFALSE;
2653  fBackgroundHandler = 1;
2654  break;
2655  case 6: // mixed event with V0 multiplicity
2656  fUseRotationMethodInBG = kFALSE;
2657  fUseTrackMultiplicityForBG = kFALSE;
2658  fDoBGProbability = kFALSE;
2659  fBackgroundHandler = 1;
2660  break;
2661  case 7: // mixed event with track multiplicity
2662  fUseRotationMethodInBG = kFALSE;
2664  fDoBGProbability = kFALSE;
2665  fBackgroundHandler = 1;
2666  break;
2667  case 8: //Rotation
2668  fUseRotationMethodInBG = kTRUE;
2669  fDoBGProbability = kTRUE;
2670  fBackgroundHandler = 1;
2671  break;
2672  case 9: // mixed event with Ptmax method
2673  fUseRotationMethodInBG = kFALSE;
2674  fUseTrackMultiplicityForBG = kFALSE;
2675  fDoBGProbability = kFALSE;
2676  fUsePtmaxMethodForBG = kTRUE;
2677  break;
2678  case 10: // a mixed event with likesign mixing
2679  fUseRotationMethodInBG = kFALSE;
2680  fUseTrackMultiplicityForBG = kFALSE;
2681  fDoBGProbability = kFALSE;
2682  fBackgroundUseLikeSign = kTRUE;
2683  fBackgroundUseSideband = kFALSE;
2684  break;
2685  case 11: // b mixed event with pi0 sideband candidates (right side of pi0 peak)
2686  fUseRotationMethodInBG = kFALSE;
2687  fUseTrackMultiplicityForBG = kFALSE;
2688  fDoBGProbability = kFALSE;
2689  fBackgroundUseLikeSign = kFALSE;
2690  fBackgroundUseSideband = kTRUE;
2691  fSidebandMixingLow = 0.180;
2692  fSidebandMixingHigh = 0.220;
2693  break;
2694  case 12: // c mixed event with pi0 sideband candidates (left side of pi0 peak)
2695  fUseRotationMethodInBG = kFALSE;
2696  fUseTrackMultiplicityForBG = kFALSE;
2697  fDoBGProbability = kFALSE;
2698  fBackgroundUseLikeSign = kFALSE;
2699  fBackgroundUseSideband = kTRUE;
2700  fSidebandMixingLow = 0.01;
2701  fSidebandMixingHigh = 0.05;
2702  break;
2703  case 13: // d mixing event with pi0 sideband candidates (both sides of pi0 peak)
2704  fUseRotationMethodInBG = kFALSE;
2705  fUseTrackMultiplicityForBG = kFALSE;
2706  fDoBGProbability = kFALSE;
2707  fBackgroundUseLikeSign = kFALSE;
2708  fBackgroundUseSideband = kFALSE;
2710  fSidebandMixingLeftLow = 0.01;
2711  fSidebandMixingLeftHigh = 0.05;
2712  fSidebandMixingRightLow = 0.180;
2713  fSidebandMixingRightHigh = 0.220;
2714  break;
2715  case 14: //e mixed event with pi0 sideband candidates (right side of pi0 peak)
2716  fUseRotationMethodInBG = kFALSE;
2717  fUseTrackMultiplicityForBG = kFALSE;
2718  fDoBGProbability = kFALSE;
2719  fBackgroundUseLikeSign = kFALSE;
2720  fBackgroundUseSideband = kTRUE;
2721  fSidebandMixingLow = 0.600;
2722  fSidebandMixingHigh = 0.650;
2723  break;
2724  case 15: //f mixed event with pi0 sideband candidates (left side of pi0 peak)
2725  fUseRotationMethodInBG = kFALSE;
2726  fUseTrackMultiplicityForBG = kFALSE;
2727  fDoBGProbability = kFALSE;
2728  fBackgroundUseLikeSign = kFALSE;
2729  fBackgroundUseSideband = kTRUE;
2730  fSidebandMixingLow = 0.42;
2731  fSidebandMixingHigh = 0.47;
2732  break;
2733  case 16: //g mixing event with pi0 sideband candidates (both sides of pi0 peak)
2734  fUseRotationMethodInBG = kFALSE;
2735  fUseTrackMultiplicityForBG = kFALSE;
2736  fDoBGProbability = kFALSE;
2737  fBackgroundUseLikeSign = kFALSE;
2738  fBackgroundUseSideband = kFALSE;
2740  fSidebandMixingLeftLow = 0.42;
2741  fSidebandMixingLeftHigh = 0.47;
2742  fSidebandMixingRightLow = 0.600;
2743  fSidebandMixingRightHigh = 0.650;
2744  break;
2745  case 17: //h mixed event with V0 multiplicity
2746  fUseRotationMethodInBG = kFALSE;
2747  fUseTrackMultiplicityForBG = kFALSE;
2748  fDoBGProbability = kFALSE;
2749  fDoConvCaloMixing = kTRUE;
2750  break;
2751  case 18: //i mixed event with V0 multiplicity
2752  fUseRotationMethodInBG = kFALSE;
2753  fUseTrackMultiplicityForBG = kFALSE;
2754  fDoBGProbability = kFALSE;
2755  fDoSectorMixing = kTRUE;
2756  break;
2757  case 19: //j mixed event with V0 multiplicity
2758  fUseRotationMethodInBG = kFALSE;
2759  fUseTrackMultiplicityForBG = kFALSE;
2760  fDoBGProbability = kFALSE;
2761  fDoSectorJetMixing = kTRUE;
2762  break;
2763  case 20: //k mixed by jet distance
2764  fUseRotationMethodInBG = kFALSE;
2765  fUseTrackMultiplicityForBG = kFALSE;
2766  fDoBGProbability = kFALSE;
2767  fDoJetMixing = kTRUE;
2768  break;
2769  case 21: //l mixed by jet distance and rotation
2770  fUseRotationMethodInBG = kFALSE;
2771  fUseTrackMultiplicityForBG = kFALSE;
2772  fDoBGProbability = kFALSE;
2773  fDoJetMixing = kTRUE;
2774  fDoJetRotateMixing = kTRUE;
2775  break;
2776  case 22: //m mixed by jet distance and jet pt
2777  fUseRotationMethodInBG = kFALSE;
2778  fUseTrackMultiplicityForBG = kFALSE;
2779  fDoBGProbability = kFALSE;
2780  fDoJetMixing = kTRUE;
2781  fDoJetPtMixing = kTRUE;
2782  break;
2783  case 23: //n mixed by jet distance, rotation and jet pt
2784  fUseRotationMethodInBG = kFALSE;
2785  fUseTrackMultiplicityForBG = kFALSE;
2786  fDoBGProbability = kFALSE;
2787  fDoJetMixing = kTRUE;
2788  fDoJetRotateMixing = kTRUE;
2789  fDoJetPtMixing = kTRUE;
2790  break;
2791  default:
2792  cout<<"Warning: BackgroundScheme not defined "<<BackgroundScheme<<endl;
2793  return kFALSE;
2794  }
2795  return kTRUE;
2796 }
2797 
2798 
2799 //________________________________________________________________________
2801  // Set Cut
2802  switch(DegreesForRotationMethod){
2803  case 0:
2805  break;
2806  case 1:
2808  break;
2809  case 2:
2811  break;
2812  case 3:
2814  break;
2815  default:
2816  cout<<"Warning: DegreesForRotationMethod not defined "<<DegreesForRotationMethod<<endl;
2817  return kFALSE;
2818  }
2819  fCuts[kDegreesForRotationMethod]=DegreesForRotationMethod;
2820  return kTRUE;
2821 }
2822 
2823 //________________________________________________________________________
2825  // Set Cut
2826  switch(NumberOfBGEvents){
2827  case 0:
2828  fNumberOfBGEvents = 5;
2829  break;
2830  case 1:
2831  fNumberOfBGEvents = 10;
2832  break;
2833  case 2:
2834  fNumberOfBGEvents = 15;
2835  break;
2836  case 3:
2837  fNumberOfBGEvents = 20;
2838  break;
2839  case 4:
2840  fNumberOfBGEvents = 2;
2841  break;
2842  case 5:
2843  fNumberOfBGEvents = 50;
2844  break;
2845  case 6:
2846  fNumberOfBGEvents = 80;
2847  break;
2848  case 7:
2849  fNumberOfBGEvents = 100;
2850  break;
2851  default:
2852  cout<<"Warning: NumberOfBGEvents not defined "<<NumberOfBGEvents<<endl;
2853  return kFALSE;
2854  }
2855  return kTRUE;
2856 }
2857 //________________________________________________________________________
2859 
2860  switch(sharedElec){
2861  case 0:
2862  fDoSharedElecCut = kFALSE;
2863  break;
2864  case 1:
2865  fDoSharedElecCut = kTRUE;
2866  break;
2867  default:
2868  cout<<"Warning: Shared Electron Cut not defined "<<sharedElec<<endl;
2869  return kFALSE;
2870  }
2871 
2872  return kTRUE;
2873 }
2874 
2875 //________________________________________________________________________
2877 
2878  switch(toClose){
2879  case 0:
2880  fDoToCloseV0sCut = kFALSE;
2881  fMinV0Dist = 250;
2882  break;
2883  case 1:
2884  fDoToCloseV0sCut = kTRUE;
2885  fMinV0Dist = 1;
2886  break;
2887  case 2:
2888  fDoToCloseV0sCut = kTRUE;
2889  fMinV0Dist = 2;
2890  break;
2891  case 3:
2892  fDoToCloseV0sCut = kTRUE;
2893  fMinV0Dist = 3;
2894  break;
2895  default:
2896  cout<<"Warning: Shared Electron Cut not defined "<<toClose<<endl;
2897  return kFALSE;
2898  }
2899  return kTRUE;
2900 }
2901 
2902 //________________________________________________________________________
2904 {// Set Cut
2905  if(fMode == 2){ //PCM-EMCal running
2906  switch(useMCPSmearing){
2907  case 0:
2908  fUseMCPSmearing = 0;
2909  fPBremSmearing = 1.;
2910  fPSigSmearing = 0.;
2911  fPSigSmearingCte = 0.;
2912  break;
2913  case 1:
2914  fUseMCPSmearing = 1;
2915  fPBremSmearing = 1;
2916  fPSigSmearing = 0.010;
2917  fPSigSmearingCte = 0.010;
2918  break;
2919  case 2:
2920  fUseMCPSmearing = 1;
2921  fPBremSmearing = 1;
2922  fPSigSmearing = 0.015;
2923  fPSigSmearingCte = 0.010;
2924  break;
2925  case 3:
2926  fUseMCPSmearing = 1;
2927  fPBremSmearing = 1.;
2928  fPSigSmearing = 0.020;
2929  fPSigSmearingCte = 0.010;
2930  break;
2931  case 4:
2932  fUseMCPSmearing = 1;
2933  fPBremSmearing = 1.;
2934  fPSigSmearing = 0.020;
2935  fPSigSmearingCte = 0.020;
2936  break;
2937  case 5:
2938  fUseMCPSmearing = 1;
2939  fPBremSmearing = 1.;
2940  fPSigSmearing = 0.030;
2941  fPSigSmearingCte = 0.020;
2942  break;
2943  case 6:
2944  fUseMCPSmearing = 1;
2945  fPBremSmearing = 1.;
2946  fPSigSmearing = 0.030;
2947  fPSigSmearingCte = 0.030;
2948  break;
2949  case 7:
2950  fUseMCPSmearing = 1;
2951  fPBremSmearing = 1;
2952  fPSigSmearing = 0.030;
2953  fPSigSmearingCte = 0.050;
2954  break;
2955  case 8:
2956  fUseMCPSmearing = 1;
2957  fPBremSmearing = 1.;
2958  fPSigSmearing = 0.030;
2959  fPSigSmearingCte = 0.060;
2960  break;
2961  case 9:
2962  fUseMCPSmearing = 1;
2963  fPBremSmearing = 1.;
2964  fPSigSmearing = 0.075;
2965  fPSigSmearingCte = 0.050;
2966  break;
2967 
2968  default:
2969  AliError("Warning: UseMCPSmearing not defined");
2970  return kFALSE;
2971  }
2972  }else{
2973  switch(useMCPSmearing){
2974  case 0:
2975  fUseMCPSmearing = 0;
2976  fPBremSmearing = 1.;
2977  fPSigSmearing = 0.;
2978  fPSigSmearingCte = 0.;
2979  break;
2980  case 1:
2981  fUseMCPSmearing = 1;
2982  fPBremSmearing = 1.0e-14;
2983  fPSigSmearing = 0.;
2984  fPSigSmearingCte = 0.;
2985  break;
2986  case 2:
2987  fUseMCPSmearing = 1;
2988  fPBremSmearing = 1.0e-15;
2989  fPSigSmearing = 0.0;
2990  fPSigSmearingCte = 0.;
2991  break;
2992  case 3:
2993  fUseMCPSmearing = 1;
2994  fPBremSmearing = 1.;
2995  fPSigSmearing = 0.003;
2996  fPSigSmearingCte = 0.002;
2997  break;
2998  case 4:
2999  fUseMCPSmearing = 1;
3000  fPBremSmearing = 1.;
3001  fPSigSmearing = 0.003;
3002  fPSigSmearingCte = 0.007;
3003  break;
3004  case 5:
3005  fUseMCPSmearing = 1;
3006  fPBremSmearing = 1.;
3007  fPSigSmearing = 0.003;
3008  fPSigSmearingCte = 0.016;
3009  break;
3010  case 6:
3011  fUseMCPSmearing = 1;
3012  fPBremSmearing = 1.;
3013  fPSigSmearing = 0.007;
3014  fPSigSmearingCte = 0.016;
3015  break;
3016  case 7:
3017  fUseMCPSmearing = 1;
3018  fPBremSmearing = 1.0e-16;
3019  fPSigSmearing = 0.0;
3020  fPSigSmearingCte = 0.;
3021  break;
3022  case 8:
3023  fUseMCPSmearing = 1;
3024  fPBremSmearing = 1.;
3025  fPSigSmearing = 0.007;
3026  fPSigSmearingCte = 0.014;
3027  break;
3028  case 9:
3029  fUseMCPSmearing = 1;
3030  fPBremSmearing = 1.;
3031  fPSigSmearing = 0.007;
3032  fPSigSmearingCte = 0.011;
3033  break;
3034 
3035  default:
3036  AliError("Warning: UseMCPSmearing not defined");
3037  return kFALSE;
3038  }
3039  }
3040  return kTRUE;
3041 }
3042 
3043 
3044 //________________________________________________________________________
3046  // Set Cut
3047  switch(DCAGammaGamma){
3048  case 0: //
3049  fDCAGammaGammaCutOn = kFALSE;
3050  fDCAGammaGammaCut = 1000;
3051  break;
3052  case 1: //
3053  fDCAGammaGammaCutOn = kTRUE;
3054  fDCAGammaGammaCut = 10;
3055  break;
3056  case 2: //
3057  fDCAGammaGammaCutOn = kTRUE;
3058  fDCAGammaGammaCut = 5;
3059  break;
3060  case 3: //
3061  fDCAGammaGammaCutOn = kTRUE;
3062  fDCAGammaGammaCut = 4;
3063  break;
3064  case 4: //
3065  fDCAGammaGammaCutOn = kTRUE;
3066  fDCAGammaGammaCut = 3;
3067  break;
3068  case 5: //
3069  fDCAGammaGammaCutOn = kTRUE;
3070  fDCAGammaGammaCut = 2.5;
3071  break;
3072  case 6: //
3073  fDCAGammaGammaCutOn = kTRUE;
3074  fDCAGammaGammaCut = 2;
3075  break;
3076  case 7: //
3077  fDCAGammaGammaCutOn = kTRUE;
3078  fDCAGammaGammaCut = 1.5;
3079  break;
3080  case 8: //
3081  fDCAGammaGammaCutOn = kTRUE;
3082  fDCAGammaGammaCut = 1;
3083  break;
3084  case 9: //
3085  fDCAGammaGammaCutOn = kTRUE;
3086  fDCAGammaGammaCut = 0.5;
3087  break;
3088  default:
3089  cout<<"Warning: DCAGammaGamma not defined "<<DCAGammaGamma<<endl;
3090  return kFALSE;
3091  }
3092  return kTRUE;
3093 }
3094 
3095 //________________________________________________________________________
3097  // Set Cut
3098  switch(DCAZMesonPrimVtx){
3099  case 0: //
3100  fDCAZMesonPrimVtxCutOn = kFALSE;
3101  fDCAZMesonPrimVtxCut = 1000;
3102  break;
3103  case 1: //
3104  fDCAZMesonPrimVtxCutOn = kTRUE;
3105  fDCAZMesonPrimVtxCut = 10;
3106  break;
3107  case 2: //
3108  fDCAZMesonPrimVtxCutOn = kTRUE;
3110  break;
3111  case 3: //
3112  fDCAZMesonPrimVtxCutOn = kTRUE;
3114  break;
3115  case 4: //
3116  fDCAZMesonPrimVtxCutOn = kTRUE;
3118  break;
3119  case 5: //
3120  fDCAZMesonPrimVtxCutOn = kTRUE;
3121  fDCAZMesonPrimVtxCut = 2.5;
3122  break;
3123  case 6: //
3124  fDCAZMesonPrimVtxCutOn = kTRUE;
3126  break;
3127  case 7: //
3128  fDCAZMesonPrimVtxCutOn = kTRUE;
3129  fDCAZMesonPrimVtxCut = 1.5;
3130  break;
3131  case 8: //
3132  fDCAZMesonPrimVtxCutOn = kTRUE;
3134  break;
3135  case 9: //
3136  fDCAZMesonPrimVtxCutOn = kTRUE;
3137  fDCAZMesonPrimVtxCut = 0.5;
3138  break;
3139  default:
3140  cout<<"Warning: DCAZMesonPrimVtx not defined "<<DCAZMesonPrimVtx<<endl;
3141  return kFALSE;
3142  }
3143  return kTRUE;
3144 }
3145 
3146 //________________________________________________________________________
3148  // Set Cut
3149  switch(DCARMesonPrimVtx){
3150  case 0: //
3151  fDCARMesonPrimVtxCutOn = kFALSE;
3152  fDCARMesonPrimVtxCut = 1000;
3153  break;
3154  case 1: //
3155  fDCARMesonPrimVtxCutOn = kTRUE;
3156  fDCARMesonPrimVtxCut = 10;
3157  break;
3158  case 2: //
3159  fDCARMesonPrimVtxCutOn = kTRUE;
3161  break;
3162  case 3: //
3163  fDCARMesonPrimVtxCutOn = kTRUE;
3165  break;
3166  case 4: //
3167  fDCARMesonPrimVtxCutOn = kTRUE;
3169  break;
3170  case 5: //
3171  fDCARMesonPrimVtxCutOn = kTRUE;
3172  fDCARMesonPrimVtxCut = 2.5;
3173  break;
3174  case 6: //
3175  fDCARMesonPrimVtxCutOn = kTRUE;
3177  break;
3178  case 7: //
3179  fDCARMesonPrimVtxCutOn = kTRUE;
3180  fDCARMesonPrimVtxCut = 1.5;
3181  break;
3182  case 8: //
3183  fDCARMesonPrimVtxCutOn = kTRUE;
3185  break;
3186  case 9: //
3187  fDCARMesonPrimVtxCutOn = kTRUE;
3188  fDCARMesonPrimVtxCut = 0.5;
3189  break;
3190  default:
3191  cout<<"Warning: DCARMesonPrimVtx not defined "<<DCARMesonPrimVtx<<endl;
3192  return kFALSE;
3193  }
3194  return kTRUE;
3195 }
3196 
3197 //________________________________________________________________________
3199  // Set Cut
3200 
3201  switch(minOpanMesonCut){
3202  case 0: //
3203  fMinOpanCutMeson = 0;
3204  fMinOpanPtDepCut = kFALSE;
3205  break;
3206  case 1: //
3207  fMinOpanCutMeson = 0.005;
3208  fMinOpanPtDepCut = kFALSE;
3209  break;
3210  case 2:
3211  if( fFMinOpanCut ) delete fFMinOpanCut;
3212  fFMinOpanCut = new TF1("fFMinOpanCut","[0]*exp(-[1]*x)+[2]",0.,100.);
3213  fFMinOpanCut->SetParameter(0,1.5);
3214  fFMinOpanCut->SetParameter(1,1.35);
3215  fFMinOpanCut->SetParameter(2,0.02);
3216  fMinOpanCutMeson = 0;
3217  fMinOpanPtDepCut = kTRUE;
3218  break;
3219  case 3: //
3220  fMinOpanCutMeson = 0.01;
3221  fMinOpanPtDepCut = kFALSE;
3222  break;
3223  case 4: //
3224  fMinOpanCutMeson = 0.0152; // minimum 0.75 EMCal cell diagonals
3225  fMinOpanPtDepCut = kFALSE;
3226  break;
3227  case 5: //
3228  fMinOpanCutMeson = 0.0202; // minimum 1 EMCal cell diagonal
3229  fMinOpanPtDepCut = kFALSE;
3230  break;
3231  case 6: //
3232  fMinOpanCutMeson = 0.017; // new standard cut for EMCal analyses as of 17.05.2017
3233  fMinOpanPtDepCut = kFALSE;
3234  break;
3235  case 7: //
3236  fMinOpanCutMeson = 0.016;
3237  fMinOpanPtDepCut = kFALSE;
3238  break;
3239  case 8: //
3240  fMinOpanCutMeson = 0.018;
3241  fMinOpanPtDepCut = kFALSE;
3242  break;
3243  case 9: //
3244  fMinOpanCutMeson = 0.019;
3245  fMinOpanPtDepCut = kFALSE;
3246  break;
3247 
3248  //cuts with one cell dist for GammaCalo only
3249  case 10: //a
3250  fMinOpanCutMeson = 0.;
3251  fEnableMinOpeningAngleCut = kFALSE;
3252  fMinOpanPtDepCut = kFALSE;
3253  fEnableOneCellDistCut = kTRUE;
3254  break;
3255  case 11: //b
3256  fMinOpanCutMeson = 0.0152;
3257  fEnableMinOpeningAngleCut = kFALSE;
3258  fMinOpanPtDepCut = kFALSE;
3259  fEnableOneCellDistCut = kTRUE;
3260  break;
3261  case 12: //c
3262  fMinOpanCutMeson = 0.016;
3263  fEnableMinOpeningAngleCut = kFALSE;
3264  fMinOpanPtDepCut = kFALSE;
3265  fEnableOneCellDistCut = kTRUE;
3266  break;
3267  case 13: //d
3268  fMinOpanCutMeson = 0.017;
3269  fEnableMinOpeningAngleCut = kFALSE;
3270  fMinOpanPtDepCut = kFALSE;
3271  fEnableOneCellDistCut = kTRUE;
3272  break;
3273  case 14: //e
3274  fMinOpanCutMeson = 0.018;
3275  fEnableMinOpeningAngleCut = kFALSE;
3276  fMinOpanPtDepCut = kFALSE;
3277  fEnableOneCellDistCut = kTRUE;
3278  break;
3279  case 15: //f
3280  fMinOpanCutMeson = 0.019;
3281  fEnableMinOpeningAngleCut = kFALSE;
3282  fMinOpanPtDepCut = kFALSE;
3283  fEnableOneCellDistCut = kTRUE;
3284  break;
3285  case 16: //g
3286  fMinOpanCutMeson = 0.0202;
3287  fEnableMinOpeningAngleCut = kFALSE;
3288  fMinOpanPtDepCut = kFALSE;
3289  fEnableOneCellDistCut = kTRUE;
3290  break;
3291  case 17: //h - Min opening angle cut for eta reconstruction - EMCEMC
3292  if( fFMinOpanCut ) delete fFMinOpanCut;
3293  fFMinOpanCut = new TF1("fFMinOpanCut","(exp([0]*(x+1))+[1]*(x-1)+[2]-0.05)*(x<[3])+0.017*(x>[3])",0.,100.);
3294  fFMinOpanCut->SetParameter(0,-0.530209);
3295  fFMinOpanCut->SetParameter(1,-0.00536687);
3296  fFMinOpanCut->SetParameter(2,0.168845);
3297  fFMinOpanCut->SetParameter(3,20);
3298  fMinOpanCutMeson = 0;
3299  fMinOpanPtDepCut = kTRUE;
3300  break;
3301  // opening angle cut variations for EMCal related analyses up to 17. May 2017
3302 // case 5: //
3303 // fMinOpanCutMeson = 0.0202; // minimum 1 EMCal cell diagonal
3304 // fMinOpanPtDepCut = kFALSE;
3305 // break;
3306 // case 6: //
3307 // fMinOpanCutMeson = 0.0404; // minimum 2 EMCal cell diagonals
3308 // fMinOpanPtDepCut = kFALSE;
3309 // break;
3310 // case 7: //
3311 // fMinOpanCutMeson = 0.0303; // minimum 1.5 EMCal cell diagonal
3312 // fMinOpanPtDepCut = kFALSE;
3313 // break;
3314 // case 8: //
3315 // fMinOpanCutMeson = 0.02525; // minimum 1.25 EMCal cell diagonal
3316 // fMinOpanPtDepCut = kFALSE;
3317 // break;
3318 // case 9: //
3319 // fMinOpanCutMeson = 0.03535; // minimum 1.75 EMCal cell diagonal
3320 // fMinOpanPtDepCut = kFALSE;
3321 // break;
3322  default:
3323  cout<<"Warning:minOpanMesonCut not defined "<<minOpanMesonCut<<endl;
3324  return kFALSE;
3325  }
3326 
3327  return kTRUE;
3328 }
3329 
3330 //________________________________________________________________________
3332  // Set Cut
3333  switch(maxOpanMesonCut){
3334  case 0: //
3335  fMaxOpanCutMeson = TMath::Pi();
3336  fMaxOpanPtDepCut = kFALSE;
3337  break;
3338  case 1:
3339  if( fFMaxOpanCut ) delete fFMaxOpanCut;
3340  fFMaxOpanCut = new TF1("fFMaxOpanCut","[0]*exp(-[1]*x)+[2]",0.,100.);
3341  fFMaxOpanCut->SetParameter(0,2.5);
3342  fFMaxOpanCut->SetParameter(1,0.85);
3343  fFMaxOpanCut->SetParameter(2,0.35);
3344  fMaxOpanPtDepCut = kTRUE;
3345  fMaxOpanCutMeson = TMath::Pi();
3346  break;
3347  case 2:
3348  if( fFMaxOpanCut ) delete fFMaxOpanCut;
3349  fFMaxOpanCut = new TF1("fFMaxOpanCut","[0]*exp(-[1]*x)+[2]",0.,100.);
3350  fFMaxOpanCut->SetParameter(0,2.3);
3351  fFMaxOpanCut->SetParameter(1,0.85);
3352  fFMaxOpanCut->SetParameter(2,0.35);
3353  fMaxOpanPtDepCut = kTRUE;
3354  fMaxOpanCutMeson = TMath::Pi();
3355  break;
3356  case 3: // - Max opening angle cut for pi0 & eta reconstruction - EMCEMC
3357  if( fFMaxOpanCut ) delete fFMaxOpanCut;
3358  fFMaxOpanCut = new TF1("fFMaxOpanCut","exp([0]*(x-0.5))+[1]*(x-0.5)+[2]+0.15",0.,100.);
3359  fFMaxOpanCut->SetParameter(0,-0.530209);
3360  fFMaxOpanCut->SetParameter(1,-0.00536687);
3361  fFMaxOpanCut->SetParameter(2,0.168845);
3362  fMaxOpanPtDepCut = kTRUE;
3363  fMaxOpanCutMeson = TMath::Pi();
3364  break;
3365  default:
3366  cout<<"Warning: maxOpanMesonCut not defined "<< maxOpanMesonCut<<endl;
3367  return kFALSE;
3368  }
3369  return kTRUE;
3370 }
3371 
3372 //________________________________________________________________________
3374  // returns TString with current cut number
3375  return fCutStringRead;
3376 }
3377 
3378 //________________________________________________________________________
3380 
3381  Int_t posLabel = photon->GetTrackLabelPositive();
3382  Int_t negLabel = photon->GetTrackLabelNegative();
3383 
3384  fElectronLabelArray[nV0*2] = posLabel;
3385  fElectronLabelArray[(nV0*2)+1] = negLabel;
3386 }
3387 
3388 //________________________________________________________________________
3390 
3391  Int_t posLabel = photon->GetTrackLabelPositive();
3392  Int_t negLabel = photon->GetTrackLabelNegative();
3393 
3394  for(Int_t i = 0; i<nV0s*2;i++){
3395  if(i==nV0*2) continue;
3396  if(i==(nV0*2)+1) continue;
3397  if(fElectronLabelArray[i] == posLabel){
3398  return kFALSE;}
3399  if(fElectronLabelArray[i] == negLabel){
3400  return kFALSE;}
3401  }
3402 
3403  return kTRUE;
3404 }
3405 //________________________________________________________________________
3407  Double_t posX = photon->GetConversionX();
3408  Double_t posY = photon->GetConversionY();
3409  Double_t posZ = photon->GetConversionZ();
3410 
3411  for(Int_t i = 0;i<photons->GetEntries();i++){
3412  if(nV0 == i) continue;
3413  AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
3414  Double_t posCompX = photonComp->GetConversionX();
3415  Double_t posCompY = photonComp->GetConversionY();
3416  Double_t posCompZ = photonComp->GetConversionZ();
3417 
3418  Double_t dist = pow((posX - posCompX),2)+pow((posY - posCompY),2)+pow((posZ - posCompZ),2);
3419 
3420  if(dist < fMinV0Dist*fMinV0Dist){
3421  if(photon->GetChi2perNDF() < photonComp->GetChi2perNDF()) return kTRUE;
3422  else {
3423  return kFALSE;}
3424  }
3425 
3426  }
3427  return kTRUE;
3428 }
3429 
3430 //________________________________________________________________________
3432 {
3433 
3434  if (photon==NULL) return;
3435  Double_t facPBrem = 1.;
3436  Double_t facPSig = 0.;
3437 
3438  Double_t phi=0.;
3439  Double_t theta=0.;
3440  Double_t P=0.;
3441 
3442 
3443  P=photon->P();
3444  phi=photon->Phi();
3445  if( photon->P()!=0){
3446  theta=acos( photon->Pz()/ photon->P());
3447  }
3448 
3449  if( fPSigSmearing != 0. || fPSigSmearingCte!=0. ){
3450  facPSig = TMath::Sqrt(fPSigSmearingCte*fPSigSmearingCte+fPSigSmearing*fPSigSmearing*P*P)*fRandom.Gaus(0.,1.);
3451  }
3452 
3453  if( fPBremSmearing != 1.){
3454  if(fBrem!=NULL){
3455  facPBrem = fBrem->GetRandom();
3456  }
3457  }
3458 
3459  photon->SetPx(facPBrem* (1+facPSig)* P*sin(theta)*cos(phi)) ;
3460  photon->SetPy(facPBrem* (1+facPSig)* P*sin(theta)*sin(phi)) ;
3461  photon->SetPz(facPBrem* (1+facPSig)* P*cos(theta)) ;
3462  photon->SetE(photon->P());
3463 }
3464 //________________________________________________________________________
3466 {
3467 
3468  if (photon==NULL) return;
3469  Double_t facPBrem = 1.;
3470  Double_t facPSig = 0.;
3471 
3472  Double_t phi=0.;
3473  Double_t theta=0.;
3474  Double_t P=0.;
3475 
3476 
3477  P=photon->P();
3478  phi=photon->Phi();
3479  if( photon->P()!=0){
3480  theta=acos( photon->Pz()/ photon->P());
3481  }
3482 
3483  if( fPSigSmearing != 0. || fPSigSmearingCte!=0. ){
3484  facPSig = TMath::Sqrt(fPSigSmearingCte*fPSigSmearingCte+fPSigSmearing*fPSigSmearing*P*P)*fRandom.Gaus(0.,1.);
3485  }
3486 
3487  if( fPBremSmearing != 1.){
3488  if(fBrem!=NULL){
3489  facPBrem = fBrem->GetRandom();
3490  }
3491  }
3492 
3493  photon->SetPx(facPBrem* (1+facPSig)* P*sin(theta)*cos(phi)) ;
3494  photon->SetPy(facPBrem* (1+facPSig)* P*sin(theta)*sin(phi)) ;
3495  photon->SetPz(facPBrem* (1+facPSig)* P*cos(theta)) ;
3496 
3497 }
3498 //________________________________________________________________________
3499 TLorentzVector AliConversionMesonCuts::SmearElectron(TLorentzVector particle)
3500 {
3501 
3502  //if (particle==0) return;
3503  Double_t facPBrem = 1.;
3504  Double_t facPSig = 0.;
3505 
3506  Double_t phi=0.;
3507  Double_t theta=0.;
3508  Double_t P=0.;
3509 
3510  P=particle.P();
3511  phi=particle.Phi();
3512  if (phi < 0.) phi += 2. * TMath::Pi();
3513 
3514  if( particle.P()!=0){
3515  theta=acos( particle.Pz()/ particle.P());
3516  }
3517 
3518 
3519  Double_t fPSigSmearingHalf = fPSigSmearing / 2.0; //The parameter was set for gammas with 2 particles and here we have just one electron
3520  Double_t sqrtfPSigSmearingCteHalf = fPSigSmearingCte / 2.0 ; //The parameter was set for gammas with 2 particles and here we have just one electron
3521 
3522 
3523 
3524  if( fPSigSmearingHalf != 0. || sqrtfPSigSmearingCteHalf!=0. ){
3525  facPSig = TMath::Sqrt(sqrtfPSigSmearingCteHalf*sqrtfPSigSmearingCteHalf+fPSigSmearingHalf*fPSigSmearingHalf*P*P)*fRandom.Gaus(0.,1.);
3526  }
3527 
3528  if( fPBremSmearing != 1.){
3529  if(fBrem!=NULL){
3530  facPBrem = fBrem->GetRandom();
3531  }
3532  }
3533 
3534  TLorentzVector SmearedParticle;
3535 
3536  SmearedParticle.SetXYZM( facPBrem* (1+facPSig)* P*sin(theta)*cos(phi) , facPBrem* (1+facPSig)* P*sin(theta)*sin(phi) ,
3537  facPBrem* (1+facPSig)* P*cos(theta) , TDatabasePDG::Instance()->GetParticle( ::kElectron )->Mass()) ;
3538 
3539  //particle.SetPx(facPBrem* (1+facPSig)* P*sin(theta)*cos(phi)) ;
3540  //particle.SetPy(facPBrem* (1+facPSig)* P*sin(theta)*sin(phi)) ;
3541  //particle.SetPz(facPBrem* (1+facPSig)* P*cos(theta)) ;
3542 
3543  return SmearedParticle;
3544 
3545 }
3546 
3547 //________________________________________________________________________
3548 // function to determine whether meson was selected by mass range
3550  if (fAcceptMesonMass){
3551  if (nominalRange == 0){
3552  if (meson->M() > fSelectionLow && meson->M() < fSelectionHigh)
3553  return kTRUE;
3554  else
3555  return kFALSE;
3556  } else if (nominalRange == 1){
3557  if (meson->M() > fSidebandMixingLow && meson->M() < fSidebandMixingHigh)
3558  return kTRUE;
3559  else
3560  return kFALSE;
3561  } else if (nominalRange == 2){
3562  if (meson->M() > fSidebandMixingLeftLow && meson->M() < fSidebandMixingLeftHigh)
3563  return kTRUE;
3564  else
3565  return kFALSE;
3566  } else if (nominalRange == 3){
3567  if (meson->M() > fSidebandMixingRightLow && meson->M() < fSidebandMixingRightHigh)
3568  return kTRUE;
3569  else
3570  return kFALSE;
3571  }
3572  } else {
3573  if (!(meson->M() > fSelectionLow && meson->M() < fSelectionHigh))
3574  return kTRUE;
3575  else
3576  return kFALSE;
3577  }
3578  return kTRUE;
3579 }
Bool_t MesonIsSelectedAODMCPiPlPiMiPiZero(AliAODMCParticle *fMCMother, TClonesArray *AODMCArray, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelNeutPion, Double_t fRapidityShift=0)
Bool_t fAcceptMesonMass
flag to distinguish rejecting and accepting meson mass window for further analysis ...
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)
AliDalitzAODESDMC * Particle(Int_t i)
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 MesonIsSelectedAODMCPiZeroGamma(AliAODMCParticle *fMCMother, TClonesArray *AODMCArray, Int_t &labelNeutPion, Int_t &labelGamma, Double_t fRapidityShift=0)
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 fDoJetAnalysis
switch to run a jet analysis
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 fDoSectorMixing
flag to enable Sectormixing for meson bg estimation
Bool_t SetAlphaMesonCut(Int_t alphaMesonCut)
Double_t fAlphaCutMeson
max value for meson alpha cut
float Float_t
Definition: External.C:68
Bool_t MesonIsSelectedAODMCPiPlPiMiEta(AliAODMCParticle *fMCMother, TClonesArray *AODMCArray, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelNeutPion, Double_t fRapidityShift=0)
Bool_t MesonIsSelectedMCPiPlPiMiEta(TParticle *fMCMother, AliMCEvent *mcEvent, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelNeutPion, Double_t fRapidityShift=0)
void SmearParticle(AliAODConversionPhoton *photon)
Bool_t RejectToCloseV0s(AliAODConversionPhoton *photon, TList *photons, Int_t nV0)
TH2F * fHistoMesonCuts
bookkeeping for meson cuts
Bool_t fUsePtmaxMethodForBG
flag to apply Ptmax method
TObjString * fCutString
cut number used for analysis
rapidity
Definition: HFPtSpectrum.C:49
Bool_t fDoJetMixing
flag to enable mixing by cluster distance to jet axis
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
Bool_t fDoMinPtCut
do min pT cut
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
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 MesonIsSelectedAODMCChiC(AliAODMCParticle *fMCMother, TClonesArray *AODMCArray, Int_t &, Int_t &, Int_t &, Double_t fRapidityShift=0.)
Bool_t SetMaxOpanMesonCut(Int_t maxOpanMesonCut)
Bool_t fDoJetPtMixing
flag to enbale mixing by jet pt bins
Double_t fSelectionLow
lower meson inv mass window for further selection
Bool_t fDoJetQA
switch to run a jet QA analysis
Bool_t MesonIsSelectedMCChiCAODESD(AliDalitzAODESDMC *fMCMother, AliDalitzEventMC *mcEvent, Int_t &, Int_t &, Int_t &, Double_t fRapidityShift=0.)
Bool_t fDCARMesonPrimVtxCutOn
cut flag for the maximum distance in R between the production point of the Meson & the primary vertex...
Bool_t fDoSectorJetMixing
flag to enable Sectormixing with jets for meson bg estimation
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 fDoBGProbability
flag to use probability method for meson bg estimation
Bool_t SetMinOpanMesonCut(Int_t minOpanMesonCut)
Float_t GetDCAZMotherPrimVtx() const
Bool_t MesonIsSelectedAODMCEtaPiPlPiMiGamma(AliAODMCParticle *fMCMother, TClonesArray *AODMCArray, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelGamma, Double_t fRapidityShift=0)
Bool_t fDoJetRotateMixing
flag to enable mixing by rotating calorimeter
Bool_t MesonIsSelectedByMassCut(AliAODConversionMother *meson, Int_t nominalRange)
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.
TString meson
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 fDoConvCaloMixing
flag to use enable convcalo mixing in addition to caloconv mixing
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)
Bool_t fDoSphericityMixing
flag to enable Sphericitymixing for meson bg estimation
Bool_t MesonIsSelectedMCDalitzAODESD(AliDalitzAODESDMC *fMCMother, AliDalitzEventMC *mcEvent, Int_t &labelelectron, Int_t &labelpositron, Int_t &labelgamma, Double_t fRapidityShift=0.)
Double_t fDCAZMesonPrimVtxCut
cut value for the maximum distance in Z between the production point of the Meson & the primary verte...
Bool_t MesonIsSelectedMCAODESD(AliDalitzAODESDMC *fMCMother, AliDalitzEventMC *mcEvent, Double_t fRapidityShift=0.)