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