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