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