AliPhysics  88b7ad0 (88b7ad0)
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::MesonIsSelectedMCPiPlPiMiPiZero(TParticle *fMCMother,AliMCEvent *mcEvent, Int_t &labelNegPion, Int_t &labelPosPion, Int_t &labelNeutPion, 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() == 221 || fMCMother->GetPdgCode() == 223) ) 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 *neutPion = 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 111:
711  neutPion = temp;
712  labelNeutPion = index;
713  break;
714  }
715  }
716 
717  if( posPion && negPion && neutPion ) return kTRUE;
718  return kFALSE;
719 }
720 
721 //________________________________________________________________________
722 Bool_t AliConversionMesonCuts::MesonIsSelectedMCPiZeroGamma(TParticle *fMCMother, AliMCEvent *mcEvent, Int_t &labelNeutPion, Int_t &labelGamma, Double_t fRapidityShift){
723  // returns true for omegas decaying into pi0 + gamma within the rapidity window
724 
725  if(!mcEvent) return kFALSE;
726 
727  if(fMCMother->GetPdgCode()!=223) return kFALSE; // we only want omegas
728 
729  Double_t rapidity = 10.;
730 
731  if(fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0){
732  rapidity=8.-fRapidityShift;
733  }
734  else{
735  rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
736  }
737 
738  // Rapidity Cut
739  if(TMath::Abs(rapidity) > fRapidityCutMeson)return kFALSE;
740 
741  // min Pt Cut
742  if(fDoMinPtCut && (fMCMother->Pt() < fMinPt)) return kFALSE;
743 
744  if(fMCMother->GetNDaughters()!=2) return kFALSE;
745 
746  TParticle *gamma = 0x0;
747  TParticle *pi0 = 0x0;
748 
749  for(Int_t index = fMCMother->GetFirstDaughter();index <= fMCMother->GetLastDaughter();index++){
750  if(index < 0) continue;
751  TParticle *temp = (TParticle*)mcEvent->Particle(index);
752  switch(temp->GetPdgCode()){
753  case 22:
754  gamma = temp;
755  labelGamma = index;
756  break;
757  case 111:
758  pi0 = temp;
759  labelNeutPion = index;
760  break;
761  }
762  }
763 
764  if(gamma && pi0) return kTRUE;
765  return kFALSE;
766 
767 }
768 
769 //________________________________________________________________________
771 
772  if(!DoPiZeroAngleCut) return kTRUE;
773 
774  Double_t PiZeroGammaAngle = pi0->Angle(gamma->Vect());
775  Double_t omegaPt = omega->Pt();
776 
777  if(PiZeroGammaAngle > lowerFactor * maxfit->Eval(omegaPt) && PiZeroGammaAngle < upperFactor * maxfit->Eval(omegaPt)) return kTRUE;
778  return kFALSE;
779 
780 }
781 
782 //________________________________________________________________________
783 Bool_t AliConversionMesonCuts::MesonIsSelectedMCChiC(TParticle *fMCMother,AliMCEvent *mcEvent,Int_t & labelelectronChiC, Int_t & labelpositronChiC, Int_t & labelgammaChiC, Double_t fRapidityShift){
784  // Returns true for all ChiC within acceptance cuts for decay into JPsi + gamma -> e+ + e- + gamma
785  // If bMCDaughtersInAcceptance is selected, it requires in addition that both daughter photons are within acceptance cuts
786 
787  if(!mcEvent)return kFALSE;
788  // if(fMCMother->GetPdgCode()==20443 ){
789  // return kFALSE;
790  // }
791  if(fMCMother->GetPdgCode()==10441 || fMCMother->GetPdgCode()==10443 || fMCMother->GetPdgCode()==445 ){
792  if(fMCMother->R()>fMaxR) return kFALSE; // cuts on distance from collision point
793 
794  Double_t rapidity = 10.;
795  if(fMCMother->Energy() - fMCMother->Pz() == 0 || fMCMother->Energy() + fMCMother->Pz() == 0){
796  rapidity=8.-fRapidityShift;
797  }
798  else{
799  rapidity = 0.5*(TMath::Log((fMCMother->Energy()+fMCMother->Pz()) / (fMCMother->Energy()-fMCMother->Pz())))-fRapidityShift;
800  }
801 
802  // Rapidity Cut
803  if(TMath::Abs(rapidity)>fRapidityCutMeson)return kFALSE;
804 
805  // min Pt Cut
806  if(fDoMinPtCut && (fMCMother->Pt() < fMinPt)) return kFALSE;
807 
808  // Select only -> ChiC radiative (JPsi+gamma) decay channel
809  if(fMCMother->GetNDaughters()!=2)return kFALSE;
810 
811  TParticle *jpsi = 0x0;
812  TParticle *gamma = 0x0;
813  TParticle *positron = 0x0;
814  TParticle *electron = 0x0;
815 
816  //Int_t labeljpsiChiC = -1;
817 
818  for(Int_t index= fMCMother->GetFirstDaughter();index<= fMCMother->GetLastDaughter();index++){
819  if(index < 0) continue;
820  TParticle* temp = (TParticle*)mcEvent->Particle( index );
821 
822  switch( temp->GetPdgCode() ) {
823  case 443:
824  jpsi = temp;
825  //labeljpsiChiC = index;
826  break;
827  case 22:
828  gamma = temp;
829  labelgammaChiC = index;
830  break;
831  }
832  }
833 
834  if ( !jpsi || ! gamma) return kFALSE;
835  if(jpsi->GetNDaughters()!=2)return kFALSE;
836 
837 
838  for(Int_t index= jpsi->GetFirstDaughter();index<= jpsi->GetLastDaughter();index++){
839  if(index < 0) continue;
840  TParticle* temp = (TParticle*)mcEvent->Particle( index );
841  switch( temp->GetPdgCode() ) {
842  case -11:
843  electron = temp;
844  labelelectronChiC = index;
845  break;
846  case 11:
847  positron = temp;
848  labelpositronChiC = index;
849  break;
850  }
851  }
852  if( !electron || !positron) return kFALSE;
853  if( positron && electron && gamma) return kTRUE;
854  }
855  return kFALSE;
856 }
857 
858 //________________________________________________________________________
859 Bool_t AliConversionMesonCuts::MesonIsSelected(AliAODConversionMother *pi0,Bool_t IsSignal, Double_t fRapidityShift, Int_t leadingCellID1, Int_t leadingCellID2)
860 {
861 
862  // Selection of reconstructed Meson candidates
863  // Use flag IsSignal in order to fill Fill different
864  // histograms for Signal and Background
865  TH2 *hist=0x0;
866 
867  if(IsSignal){hist=fHistoMesonCuts;}
868  else{hist=fHistoMesonBGCuts;}
869 
870  Int_t cutIndex=0;
871 
872  if(hist)hist->Fill(cutIndex, pi0->Pt());
873  cutIndex++;
874 
875  // Undefined Rapidity -> Floating Point exception
876  if((pi0->E()+pi0->Pz())/(pi0->E()-pi0->Pz())<=0){
877  if(hist)hist->Fill(cutIndex, pi0->Pt());
878  cutIndex++;
879  if (!IsSignal)cout << "undefined rapidity" << endl;
880  return kFALSE;
881  }
882  else{
883  // PseudoRapidity Cut --> But we cut on Rapidity !!!
884  cutIndex++;
885  if(TMath::Abs(pi0->Rapidity()-fRapidityShift)>fRapidityCutMeson){
886  if(hist)hist->Fill(cutIndex, pi0->Pt());
887  return kFALSE;
888  }
889  }
890  cutIndex++;
891 
892  if (fHistoInvMassBefore) fHistoInvMassBefore->Fill(pi0->M());
893  // Mass cut
894  if (fIsMergedClusterCut == 1 ){
895  if (fEnableMassCut){
896  Double_t massMin = FunctionMinMassCut(pi0->E());
897  Double_t massMax = FunctionMaxMassCut(pi0->E());
898  // cout << "Min mass: " << massMin << "\t max Mass: " << massMax << "\t mass current: " << pi0->M()<< "\t E current: " << pi0->E() << endl;
899  if (pi0->M() > massMax || pi0->M() < massMin ){
900  if(hist)hist->Fill(cutIndex, pi0->Pt());
901  return kFALSE;
902  }
903  }
904  cutIndex++;
905  }else if(fIsMergedClusterCut == 2){
906  if(fEnableOneCellDistCut && ((leadingCellID1 == leadingCellID2) || fCaloPhotonCuts->AreNeighbours(leadingCellID1,leadingCellID2)) ){
907  if(hist)hist->Fill(cutIndex, pi0->Pt());
908  return kFALSE;
909  }
910  cutIndex++;
911  }
912 
913  // Opening Angle Cut
914  //fOpeningAngle=2*TMath::ATan(0.134/pi0->P());// physical minimum opening angle
916  if(hist)hist->Fill(cutIndex, pi0->Pt());
917  return kFALSE;
918  }
919 
920  // Min Opening Angle
921  if (fMinOpanPtDepCut == kTRUE) fMinOpanCutMeson = fFMinOpanCut->Eval(pi0->Pt());
922 
923  if (pi0->GetOpeningAngle() < fMinOpanCutMeson){
924  if(hist)hist->Fill(cutIndex, pi0->Pt());
925  return kFALSE;
926  }
927 
928  // Max Opening Angle
929  if (fMaxOpanPtDepCut == kTRUE) fMaxOpanCutMeson = fFMaxOpanCut->Eval(pi0->Pt());
930 
931  if( pi0->GetOpeningAngle() > fMaxOpanCutMeson){
932  if(hist)hist->Fill(cutIndex, pi0->Pt());
933  return kFALSE;
934  }
935  cutIndex++;
936 
937  // Alpha Max Cut
938  if (fIsMergedClusterCut == 1 && fAlphaPtDepCut) fAlphaCutMeson = fFAlphaCut->Eval(pi0->E());
939  else if (fAlphaPtDepCut == kTRUE) fAlphaCutMeson = fFAlphaCut->Eval(pi0->Pt());
940 
941  if(TMath::Abs(pi0->GetAlpha())>fAlphaCutMeson){
942  if(hist)hist->Fill(cutIndex, pi0->Pt());
943  return kFALSE;
944  }
945  cutIndex++;
946 
947  // Alpha Min Cut
948  if(TMath::Abs(pi0->GetAlpha())<fAlphaMinCutMeson){
949  if(hist)hist->Fill(cutIndex, pi0->Pt());
950  return kFALSE;
951  }
952  cutIndex++;
953 
954  if (fHistoInvMassAfter) fHistoInvMassAfter->Fill(pi0->M());
955 
956  if (fIsMergedClusterCut == 0){
959 
960  if (fDCAGammaGammaCutOn){
962  if(hist)hist->Fill(cutIndex, pi0->Pt());
963  return kFALSE;
964  }
965  }
966  cutIndex++;
967 
970  if(hist)hist->Fill(cutIndex, pi0->Pt());
971  return kFALSE;
972  }
973  }
974  cutIndex++;
975 
977 
979  if (TMath::Abs(pi0->GetDCAZMotherPrimVtx()) > fDCAZMesonPrimVtxCut){
980  if(hist)hist->Fill(cutIndex, pi0->Pt());
981  return kFALSE;
982  }
983  }
984  cutIndex++;
985 
989  }
990 
991  //PtCut
992  if(fDoMinPtCut){
993  if(pi0->Pt()< fMinPt){
994  if(hist)hist->Fill(cutIndex, pi0->Pt());
995  return kFALSE;
996  }
997  }
998  cutIndex++;
999 
1000  if(hist)hist->Fill(cutIndex, pi0->Pt());
1001  return kTRUE;
1002 }
1003 
1004 
1005 
1006 //________________________________________________________________________
1007 //________________________________________________________________________
1010 
1011  if(fCutString && fCutString->GetString().Length() == kNCuts) {
1012  fCutString->SetString(GetCutNumber());
1013  } else {
1014  return kFALSE;
1015  }
1016  return kTRUE;
1017 }
1018 
1019 //________________________________________________________________________
1021  fCutStringRead = Form("%s",analysisCutSelection.Data());
1022 
1023  // Initialize Cuts from a given Cut string
1024  AliInfo(Form("Set Meson Cutnumber: %s",analysisCutSelection.Data()));
1025  if(analysisCutSelection.Length()!=kNCuts) {
1026  AliError(Form("Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(), kNCuts));
1027  return kFALSE;
1028  }
1029  if(!analysisCutSelection.IsAlnum()){
1030  AliError("Cut selection is not alphanumeric");
1031  return kFALSE;
1032  }
1033 
1034  TString analysisCutSelectionLowerCase = Form("%s",analysisCutSelection.Data());
1035  analysisCutSelectionLowerCase.ToLower();
1036  const char *cutSelection = analysisCutSelectionLowerCase.Data();
1037  #define ASSIGNARRAY(i) fCuts[i] = ((int)cutSelection[i]>=(int)'a') ? cutSelection[i]-'a'+10 : cutSelection[i]-'0'
1038  for(Int_t ii=0;ii<kNCuts;ii++){
1039  ASSIGNARRAY(ii);
1040  }
1041 
1042  // Set Individual Cuts
1043  for(Int_t ii=0;ii<kNCuts;ii++){
1044  if(!SetCut(cutIds(ii),fCuts[ii]))return kFALSE;
1045  }
1046 
1048  return kTRUE;
1049 }
1050 //________________________________________________________________________
1053 
1054  //cout << "Updating cut " << fgkCutNames[cutID] << " (" << cutID << ") to " << value << endl;
1055  switch (cutID) {
1056  case kMesonKind:
1057  if( SetMesonKind(value)) {
1058  fCuts[kMesonKind] = value;
1059  UpdateCutString();
1060  return kTRUE;
1061  } else return kFALSE;
1062  case kSelectionCut:
1063  if (fIsMergedClusterCut == 1){
1064  if( SetSelectionWindowMergedCut(value)) {
1065  fCuts[kSelectionCut] = value;
1066  UpdateCutString();
1067  return kTRUE;
1068  } else return kFALSE;
1069  } else {
1070  if( SetSelectionWindowCut(value)) {
1071  fCuts[kSelectionCut] = value;
1072  UpdateCutString();
1073  return kTRUE;
1074  } else return kFALSE;
1075  }
1076  case kalphaMesonCut:
1077  if (fIsMergedClusterCut == 1){
1078  if( SetAlphaMesonMergedCut(value)) {
1079  fCuts[kalphaMesonCut] = value;
1080  UpdateCutString();
1081  return kTRUE;
1082  } else return kFALSE;
1083  } else {
1084  if( SetAlphaMesonCut(value)) {
1085  fCuts[kalphaMesonCut] = value;
1086  UpdateCutString();
1087  return kTRUE;
1088  } else return kFALSE;
1089  }
1090  case kPtCut:
1091  if( SetMinPtCut(value)) {
1092  fCuts[kPtCut] = value;
1093  UpdateCutString();
1094  return kTRUE;
1095  } else return kFALSE;
1096 
1097  case kRapidityMesonCut:
1098  if( SetRapidityMesonCut(value)) {
1099  fCuts[kRapidityMesonCut] = value;
1100  UpdateCutString();
1101  return kTRUE;
1102  } else return kFALSE;
1103 
1104  case kBackgroundScheme:
1105  if( SetBackgroundScheme(value)) {
1106  fCuts[kBackgroundScheme] = value;
1107  UpdateCutString();
1108  return kTRUE;
1109  } else return kFALSE;
1110 
1112  if( SetNDegreesForRotationMethod(value)) {
1114  UpdateCutString();
1115  return kTRUE;
1116  } else return kFALSE;
1117 
1118  case kNumberOfBGEvents:
1119  if( SetNumberOfBGEvents(value)) {
1120  fCuts[kNumberOfBGEvents] = value;
1121  UpdateCutString();
1122  return kTRUE;
1123  } else return kFALSE;
1124 
1125  case kuseMCPSmearing:
1126  if( SetMCPSmearing(value)) {
1127  fCuts[kuseMCPSmearing] = value;
1128  UpdateCutString();
1129  return kTRUE;
1130  } else return kFALSE;
1131  case kElecShare:
1132  if( SetSharedElectronCut(value)) {
1133  fCuts[kElecShare] = value;
1134  UpdateCutString();
1135  return kTRUE;
1136  } else return kFALSE;
1137  case kToCloseV0s:
1138  if( SetToCloseV0sCut(value)) {
1139  fCuts[kToCloseV0s] = value;
1140  UpdateCutString();
1141  return kTRUE;
1142  } else return kFALSE;
1143  case kDcaGammaGamma:
1144  if( SetDCAGammaGammaCut(value)) {
1145  fCuts[kDcaGammaGamma] = value;
1146  UpdateCutString();
1147  return kTRUE;
1148  } else return kFALSE;
1149  case kDcaZPrimVtx:
1150  if( SetDCAZMesonPrimVtxCut(value)) {
1151  fCuts[kDcaZPrimVtx] = value;
1152  UpdateCutString();
1153  return kTRUE;
1154  } else return kFALSE;
1155  case kDcaRPrimVtx:
1156  if( SetDCARMesonPrimVtxCut(value)) {
1157  fCuts[kDcaRPrimVtx] = value;
1158  UpdateCutString();
1159  return kTRUE;
1160  } else return kFALSE;
1161  case kMinOpanMesonCut:
1162  if( SetMinOpanMesonCut(value)) {
1163  fCuts[kMinOpanMesonCut] = value;
1164  UpdateCutString();
1165  return kTRUE;
1166  } else return kFALSE;
1167 
1168  case kMaxOpanMesonCut:
1169  if( SetMaxOpanMesonCut(value)) {
1170  fCuts[kMaxOpanMesonCut] = value;
1171  UpdateCutString();
1172  return kTRUE;
1173  } else return kFALSE;
1174 
1175  case kNCuts:
1176  cout << "Error:: Cut id out of range"<< endl;
1177  return kFALSE;
1178  }
1179 
1180  cout << "Error:: Cut id " << cutID << " not recognized "<< endl;
1181  return kFALSE;
1182 
1183 }
1184 
1185 
1186 //________________________________________________________________________
1188  // Print out current Cut Selection
1189  for(Int_t ic = 0; ic < kNCuts; ic++) {
1190  printf("%-30s : %d \n", fgkCutNames[ic], fCuts[ic]);
1191  }
1192 }
1193 
1194 //________________________________________________________________________
1196  // Print out current Cut Selection with values
1197  printf("\nMeson cutnumber \n");
1198  for(Int_t ic = 0; ic < kNCuts; ic++) {
1199  printf("%d",fCuts[ic]);
1200  }
1201  printf("\n\n");
1202 
1203  printf("Meson cuts \n");
1204  printf("\t |y| < %3.2f \n", fRapidityCutMeson);
1205  if (fEnableOneCellDistCut) printf("\t Only valid for GammaCalo: one cell distance cut enabled");
1206  if (fEnableMinOpeningAngleCut) printf("\t theta_{open} > %3.4f\n", fOpeningAngle);
1207  if (!fAlphaPtDepCut) printf("\t %3.2f < alpha < %3.2f\n", fAlphaMinCutMeson, fAlphaCutMeson);
1208  else printf("\t alpha pT-dep cut active\n");
1209  if (!fIsMergedClusterCut){
1210  if (fDCAGammaGammaCutOn)printf("\t dca_{gamma,gamma} < %3.2f\n", fDCAGammaGammaCut);
1211  if (fDCARMesonPrimVtxCutOn)printf("\t dca_{R, prim Vtx} < %3.2f\n", fDCARMesonPrimVtxCut);
1212  if (fDCAZMesonPrimVtxCutOn)printf("\t dca_{Z, prim Vtx} < %3.2f\n\n", fDCAZMesonPrimVtxCut);
1213  }
1214  if (fIsMergedClusterCut == 1 && fEnableMassCut){
1215  printf("\t Meson selection energy dependent\n\n");
1216  } else {
1217  if (fAcceptMesonMass)
1218  printf("\t Meson selection window for further analysis %3.3f > M_{gamma,gamma} > %3.3f\n\n", fSelectionLow, fSelectionHigh);
1219  else
1220  printf("\t Meson rejection window has been applied %3.3f > M_{gamma,gamma} > %3.3f\n\n", fSelectionLow, fSelectionHigh);
1221  }
1222  if(fDoMinPtCut) printf("\t pT_{min} > %3.4f\n", fMinPt);
1223  if (!fMinOpanPtDepCut) printf("\t theta_{open} > %3.4f\n", fMinOpanCutMeson);
1224  else printf("\t Min theta_{open} pT-dep cut active\n");
1225  if (!fMaxOpanPtDepCut) printf("\t %3.4f < theta_{open}\n", fMaxOpanCutMeson);
1226  else printf("\t Max theta_{open} pT-dep cut active\n");
1227  printf("\t Running mode for cutselection (0 std, 2 PCM-Calo): %d\n", fMode);
1228 
1229  printf("Meson BG settings \n");
1230  if (!fDoBG){
1231  printf("\t No BG estimation \n");
1232  } else {
1233  if (!fUseRotationMethodInBG & !fUseTrackMultiplicityForBG & !fBackgroundHandler) printf("\t BG scheme: mixing V0 mult \n");
1234  if (!fUseRotationMethodInBG & fUseTrackMultiplicityForBG & !fBackgroundHandler) printf("\t BG scheme: mixing track mult \n");
1235  if (fUseRotationMethodInBG )printf("\t BG scheme: rotation \n");
1236  if (fUsePtmaxMethodForBG )printf("\t BG scheme: Ptmax \n");
1237  if (fDoBGProbability) printf("\t -> use BG probability \n");
1238  if (fBackgroundHandler) printf("\t -> use new BG handler \n");
1239  printf("\t depth of pool: %d\n", fNumberOfBGEvents);
1240  if (fUseRotationMethodInBG )printf("\t degree's for BG rotation: %d\n", fNDegreeRotationPMForBG);
1241  if (!fUseRotationMethodInBG & !fUseTrackMultiplicityForBG & fBackgroundHandler) printf("\t BG scheme: event plane angle with V0 mult \n");
1242  }
1243 }
1244 
1245 
1246 //________________________________________________________________________
1248  // Set Cut
1249  switch(mesonKind){
1250  case 0:
1251  fMesonKind = 0;
1252  break;
1253  case 1:
1254  fMesonKind = 1;
1255  break;
1256  default:
1257  cout<<"Warning: Meson kind not defined"<<mesonKind<<endl;
1258  return kFALSE;
1259  }
1260  return kTRUE;
1261 }
1262 
1263 //________________________________________________________________________
1265  // Set Cut on min pT of meson
1266  switch(PtCut){
1267  case 0: // no cut on pT
1268  fMinPt = 0.;
1269  fDoMinPtCut = kFALSE;
1270  break;
1271  case 1:
1272  fMinPt = 0.4;
1273  fDoMinPtCut = kTRUE;
1274  break;
1275  case 2:
1276  fMinPt = 0.7;
1277  fDoMinPtCut = kTRUE;
1278  break;
1279  case 3:
1280  fMinPt = 0.9;
1281  fDoMinPtCut = kTRUE;
1282  break;
1283  case 4:
1284  fMinPt = 1.0;
1285  fDoMinPtCut = kTRUE;
1286  break;
1287  case 5:
1288  fMinPt = 1.2;
1289  fDoMinPtCut = kTRUE;
1290  break;
1291  case 6:
1292  fMinPt = 1.5;
1293  fDoMinPtCut = kTRUE;
1294  break;
1295  case 7:
1296  fMinPt = 0.5;
1297  fDoMinPtCut = kTRUE;
1298  break;
1299  default:
1300  cout<<"Warning: pT cut not defined"<<PtCut<<endl;
1301  return kFALSE;
1302  }
1303  return kTRUE;
1304 }
1305 
1306 //________________________________________________________________________
1308  // Set Cut
1309  switch(selectionCut){
1310  case 0:
1311  fSelectionLow = 0.0;
1312  fSelectionHigh = 4.;
1313  fAcceptMesonMass = kTRUE;
1314  break;
1315  case 1:
1316  fSelectionLow = 0.1;
1317  fSelectionHigh = 0.145;
1318  fAcceptMesonMass = kTRUE;
1319  break;
1320  case 2:
1321  fSelectionLow = 0.11;
1322  fSelectionHigh = 0.145;
1323  fAcceptMesonMass = kTRUE;
1324  break;
1325  case 3:
1326  fSelectionLow = 0.12;
1327  fSelectionHigh = 0.145;
1328  fAcceptMesonMass = kTRUE;
1329  break;
1330  case 4:
1331  fSelectionLow = 0.1;
1332  fSelectionHigh = 0.15;
1333  fAcceptMesonMass = kTRUE;
1334  break;
1335  case 5:
1336  fSelectionLow = 0.11;
1337  fSelectionHigh = 0.15;
1338  fAcceptMesonMass = kTRUE;
1339  break;
1340  case 6:
1341  fSelectionLow = 0.12;
1342  fSelectionHigh = 0.15;
1343  fAcceptMesonMass = kTRUE;
1344  break;
1345  case 7:
1346  fSelectionLow = 0.1;
1347  fSelectionHigh = 0.155;
1348  fAcceptMesonMass = kTRUE;
1349  break;
1350  case 8:
1351  fSelectionLow = 0.125;
1352  fSelectionHigh = 0.145;
1353  fAcceptMesonMass = kTRUE;
1354  break;
1355  case 9:
1356  fSelectionLow = 0.11;
1357  fSelectionHigh = 0.155;
1358  fAcceptMesonMass = kTRUE;
1359  break;
1360  case 10:
1361  fSelectionLow = 0.08;
1362  fSelectionHigh = 0.145;
1363  fAcceptMesonMass = kTRUE;
1364  break;
1365  case 11:
1366  fSelectionLow = 0.08;
1367  fSelectionHigh = 0.145;
1368  fAcceptMesonMass = kFALSE;
1369  break;
1370  case 12:
1371  fSelectionLow = 0.1;
1372  fSelectionHigh = 0.145;
1373  fAcceptMesonMass = kFALSE;
1374  break;
1375  case 13:
1376  fSelectionLow = 0.11;
1377  fSelectionHigh = 0.145;
1378  fAcceptMesonMass = kFALSE;
1379  break;
1380  case 14:
1381  fSelectionLow = 0.12;
1382  fSelectionHigh = 0.145;
1383  fAcceptMesonMass = kFALSE;
1384  break;
1385  case 15:
1386  fSelectionLow = 0.1;
1387  fSelectionHigh = 0.15;
1388  fAcceptMesonMass = kFALSE;
1389  break;
1390  case 16:
1391  fSelectionLow = 0.11;
1392  fSelectionHigh = 0.15;
1393  fAcceptMesonMass = kFALSE;
1394  break;
1395  case 17:
1396  fSelectionLow = 0.12;
1397  fSelectionHigh = 0.15;
1398  fAcceptMesonMass = kFALSE;
1399  break;
1400  case 18:
1401  fSelectionLow = 0.1;
1402  fSelectionHigh = 0.155;
1403  fAcceptMesonMass = kFALSE;
1404  break;
1405  case 19:
1406  fSelectionLow = 0.125;
1407  fSelectionHigh = 0.145;
1408  fAcceptMesonMass = kFALSE;
1409  break;
1410  case 20:
1411  fSelectionLow = 0.11;
1412  fSelectionHigh = 0.155;
1413  fAcceptMesonMass = kFALSE;
1414  break;
1415 
1416  default:
1417  cout<<"Warning: SelectionCut not defined "<<selectionCut<<endl;
1418  return kFALSE;
1419  }
1420  return kTRUE;
1421 }
1422 
1424  // Set Cut
1425  fSelectionWindowCut = selectionCut;
1426  switch(fSelectionWindowCut){
1427  case 0:
1428  fEnableMassCut = kFALSE;
1429  break;
1430  case 1: //NLM 1
1431  fEnableMassCut = kTRUE;
1432  break;
1433  case 2: //NLM 2
1434  fEnableMassCut = kTRUE;
1435  break;
1436  case 3: //NLM 1
1437  fEnableMassCut = kTRUE;
1438  break;
1439  case 4: //NLM 2
1440  fEnableMassCut = kTRUE;
1441  break;
1442  case 5: //NLM 1
1443  fEnableMassCut = kTRUE;
1444  break;
1445  case 6: //NLM 2
1446  fEnableMassCut = kTRUE;
1447  break;
1448  case 7: //min mass cut around 0
1449  fEnableMassCut = kTRUE;
1450  break;
1451  case 8: //min mass cut around 0
1452  fEnableMassCut = kTRUE;
1453  break;
1454  case 9: //min mass cut around 0
1455  fEnableMassCut = kTRUE;
1456  break;
1457  default:
1458  cout<<"Warning: SelectionCut merged not defined "<<selectionCut<<endl;
1459  return kFALSE;
1460  }
1461 
1462  return kTRUE;
1463 
1464 }
1465 
1467 
1468  Float_t switchMass = 0;
1469  Float_t aMassLow = 0;
1470  Float_t bMassLow = 0;
1471  Float_t aMassHigh = 0;
1472  Float_t bMassHigh = 0;
1473  Float_t aMass = 0;
1474  Float_t bMass = 0;
1475  Float_t switchSigma = 0.;
1476  Float_t nSigma = 0;
1477  Float_t aSigmaLow = 0.;
1478  Float_t bSigmaLow = 0;
1479  Float_t aSigmaHigh = 0.;
1480  Float_t bSigmaHigh = 0;
1481  Float_t mass = 0;
1482  Float_t sigma = 0;
1483 
1484  switch(fSelectionWindowCut){
1485  case 0:
1486  fEnableMassCut = kFALSE;
1487  break;
1488  case 1: //NLM 1
1489  aMass = 0.044;
1490  bMass = 0.0049;
1491  switchSigma = 19.;
1492  nSigma = 3;
1493  aSigmaLow = 0.012;
1494  bSigmaLow = 0;
1495  aSigmaHigh = 0.0012;
1496  bSigmaHigh = 6e-4;
1497 
1498  mass = aMass + bMass*e;
1499  sigma = 0;
1500  if (e < switchSigma){
1501  sigma = aSigmaLow + bSigmaLow*e;
1502  } else {
1503  sigma = aSigmaHigh + bSigmaHigh*e;
1504  }
1505  return mass + nSigma*sigma;
1506  break;
1507  case 2: //NLM 2
1508  switchMass = 21;
1509  aMassLow = 0.115;
1510  bMassLow = 9.6e-4;
1511  aMassHigh = 0.1;
1512  bMassHigh = 0.0017;
1513  switchSigma = 10.;
1514  nSigma = 3;
1515  aSigmaLow = 0.009;
1516  bSigmaLow = 0;
1517  aSigmaHigh = 0.0023;
1518  bSigmaHigh = 6.7e-4;
1519 
1520  mass = 0;
1521  if (e < switchMass){
1522  mass = aMassLow + bMassLow*e;
1523  } else {
1524  mass = aMassHigh + bMassHigh*e;
1525  }
1526  sigma = 0;
1527  if (e < switchSigma){
1528  sigma = aSigmaLow + bSigmaLow*e;
1529  } else {
1530  sigma = aSigmaHigh + bSigmaHigh*e;
1531  }
1532  return mass + nSigma*sigma;
1533  break;
1534  case 3: //NLM 1
1535  aMass = 0.044;
1536  bMass = 0.0049;
1537  switchSigma = 19.;
1538  nSigma = 2;
1539  aSigmaLow = 0.012;
1540  bSigmaLow = 0;
1541  aSigmaHigh = 0.0012;
1542  bSigmaHigh = 6e-4;
1543 
1544  mass = aMass + bMass*e;
1545  sigma = 0;
1546  if (e < switchSigma){
1547  sigma = aSigmaLow + bSigmaLow*e;
1548  } else {
1549  sigma = aSigmaHigh + bSigmaHigh*e;
1550  }
1551  return mass + nSigma*sigma;
1552  break;
1553  case 4: //NLM 2
1554  switchMass = 21;
1555  aMassLow = 0.115;
1556  bMassLow = 9.6e-4;
1557  aMassHigh = 0.1;
1558  bMassHigh = 0.0017;
1559  switchSigma = 10.;
1560  nSigma = 2;
1561  aSigmaLow = 0.009;
1562  bSigmaLow = 0;
1563  aSigmaHigh = 0.0023;
1564  bSigmaHigh = 6.7e-4;
1565 
1566  mass = 0;
1567  if (e < switchMass){
1568  mass = aMassLow + bMassLow*e;
1569  } else {
1570  mass = aMassHigh + bMassHigh*e;
1571  }
1572  sigma = 0;
1573  if (e < switchSigma){
1574  sigma = aSigmaLow + bSigmaLow*e;
1575  } else {
1576  sigma = aSigmaHigh + bSigmaHigh*e;
1577  }
1578  return mass + nSigma*sigma;
1579  break;
1580  case 5: //NLM 1
1581  aMass = 0.044;
1582  bMass = 0.0049;
1583  switchSigma = 19.;
1584  nSigma = 4;
1585  aSigmaLow = 0.012;
1586  bSigmaLow = 0;
1587  aSigmaHigh = 0.0012;
1588  bSigmaHigh = 6e-4;
1589 
1590  mass = aMass + bMass*e;
1591  sigma = 0;
1592  if (e < switchSigma){
1593  sigma = aSigmaLow + bSigmaLow*e;
1594  } else {
1595  sigma = aSigmaHigh + bSigmaHigh*e;
1596  }
1597  return mass + nSigma*sigma;
1598  break;
1599  case 6: //NLM 2
1600  switchMass = 21;
1601  aMassLow = 0.115;
1602  bMassLow = 9.6e-4;
1603  aMassHigh = 0.1;
1604  bMassHigh = 0.0017;
1605  switchSigma = 10.;
1606  nSigma = 4;
1607  aSigmaLow = 0.009;
1608  bSigmaLow = 0;
1609  aSigmaHigh = 0.0023;
1610  bSigmaHigh = 6.7e-4;
1611 
1612  mass = 0;
1613  if (e < switchMass){
1614  mass = aMassLow + bMassLow*e;
1615  } else {
1616  mass = aMassHigh + bMassHigh*e;
1617  }
1618  sigma = 0;
1619  if (e < switchSigma){
1620  sigma = aSigmaLow + bSigmaLow*e;
1621  } else {
1622  sigma = aSigmaHigh + bSigmaHigh*e;
1623  }
1624  return mass + nSigma*sigma;
1625  break;
1626  case 7: // maximum mass
1627  return 10000.;
1628  break;
1629  case 8: // maximum mass
1630  return 10000.;
1631  break;
1632  case 9: // maximum mass
1633  return 10000.;
1634  break;
1635  default:
1636  cout<<"Warning: SelectionCut merged not defined "<<fSelectionWindowCut<<endl;
1637  return -1;
1638  }
1639  return -1;
1640 
1641 }
1642 
1644 
1645  Float_t switchMass = 0;
1646  Float_t aMassLow = 0;
1647  Float_t bMassLow = 0;
1648  Float_t aMassHigh = 0;
1649  Float_t bMassHigh = 0;
1650  Float_t aMass = 0;
1651  Float_t bMass = 0;
1652  Float_t switchSigma = 0.;
1653  Float_t nSigma = 0;
1654  Float_t aSigmaLow = 0.;
1655  Float_t bSigmaLow = 0;
1656  Float_t aSigmaHigh = 0.;
1657  Float_t bSigmaHigh = 0;
1658  Float_t mass = 0;
1659  Float_t sigma = 0;
1660 
1661  switch(fSelectionWindowCut){
1662  case 0:
1663  fEnableMassCut = kFALSE;
1664  break;
1665  case 1: //NLM 1
1666  aMass = 0.044;
1667  bMass = 0.0049;
1668  switchSigma = 19.;
1669  nSigma = 3;
1670  aSigmaLow = 0.012;
1671  bSigmaLow = 0;
1672  aSigmaHigh = 0.0012;
1673  bSigmaHigh = 6e-4;
1674 
1675  mass = aMass + bMass*e;
1676  sigma = 0;
1677  if (e < switchSigma){
1678  sigma = aSigmaLow + bSigmaLow*e;
1679  } else {
1680  sigma = aSigmaHigh + bSigmaHigh*e;
1681  }
1682  // cout << "E: "<< e << "\t mass: " << mass << "\t sigma: " << sigma<< endl;
1683  return mass - nSigma*sigma;
1684  break;
1685  case 2: //NLM 2
1686  switchMass = 21;
1687  aMassLow = 0.115;
1688  bMassLow = 9.6e-4;
1689  aMassHigh = 0.1;
1690  bMassHigh = 0.0017;
1691  switchSigma = 10.;
1692  nSigma = 3;
1693  aSigmaLow = 0.009;
1694  bSigmaLow = 0;
1695  aSigmaHigh = 0.0023;
1696  bSigmaHigh = 6.7e-4;
1697 
1698  mass = 0;
1699  if (e < switchMass){
1700  mass = aMassLow + bMassLow*e;
1701  } else {
1702  mass = aMassHigh + bMassHigh*e;
1703  }
1704  sigma = 0;
1705  if (e < switchSigma){
1706  sigma = aSigmaLow + bSigmaLow*e;
1707  } else {
1708  sigma = aSigmaHigh + bSigmaHigh*e;
1709  }
1710  // cout << "E: "<< e << "\t mass: " << mass << "\t sigma: "<< sigma << endl;
1711 
1712  return mass - nSigma*sigma;
1713  break;
1714  case 3: //NLM 1
1715  aMass = 0.044;
1716  bMass = 0.0049;
1717  switchSigma = 19.;
1718  nSigma = 2;
1719  aSigmaLow = 0.012;
1720  bSigmaLow = 0;
1721  aSigmaHigh = 0.0012;
1722  bSigmaHigh = 6e-4;
1723 
1724  mass = aMass + bMass*e;
1725  sigma = 0;
1726  if (e < switchSigma){
1727  sigma = aSigmaLow + bSigmaLow*e;
1728  } else {
1729  sigma = aSigmaHigh + bSigmaHigh*e;
1730  }
1731  // cout << "E: "<< e << "\t mass: " << mass << "\t sigma: " << sigma<< endl;
1732  return mass - nSigma*sigma;
1733  break;
1734  case 4: //NLM 2
1735  switchMass = 21;
1736  aMassLow = 0.115;
1737  bMassLow = 9.6e-4;
1738  aMassHigh = 0.1;
1739  bMassHigh = 0.0017;
1740  switchSigma = 10.;
1741  nSigma = 2;
1742  aSigmaLow = 0.009;
1743  bSigmaLow = 0;
1744  aSigmaHigh = 0.0023;
1745  bSigmaHigh = 6.7e-4;
1746 
1747  mass = 0;
1748  if (e < switchMass){
1749  mass = aMassLow + bMassLow*e;
1750  } else {
1751  mass = aMassHigh + bMassHigh*e;
1752  }
1753  sigma = 0;
1754  if (e < switchSigma){
1755  sigma = aSigmaLow + bSigmaLow*e;
1756  } else {
1757  sigma = aSigmaHigh + bSigmaHigh*e;
1758  }
1759  // cout << "E: "<< e << "\t mass: " << mass << "\t sigma: "<< sigma << endl;
1760 
1761  return mass - nSigma*sigma;
1762  break;
1763  case 5: //NLM 1
1764  aMass = 0.044;
1765  bMass = 0.0049;
1766  switchSigma = 19.;
1767  nSigma = 4;
1768  aSigmaLow = 0.012;
1769  bSigmaLow = 0;
1770  aSigmaHigh = 0.0012;
1771  bSigmaHigh = 6e-4;
1772 
1773  mass = aMass + bMass*e;
1774  sigma = 0;
1775  if (e < switchSigma){
1776  sigma = aSigmaLow + bSigmaLow*e;
1777  } else {
1778  sigma = aSigmaHigh + bSigmaHigh*e;
1779  }
1780  // cout << "E: "<< e << "\t mass: " << mass << "\t sigma: " << sigma<< endl;
1781  return mass - nSigma*sigma;
1782  break;
1783  case 6: //NLM 2
1784  switchMass = 21;
1785  aMassLow = 0.115;
1786  bMassLow = 9.6e-4;
1787  aMassHigh = 0.1;
1788  bMassHigh = 0.0017;
1789  switchSigma = 10.;
1790  nSigma = 4;
1791  aSigmaLow = 0.009;
1792  bSigmaLow = 0;
1793  aSigmaHigh = 0.0023;
1794  bSigmaHigh = 6.7e-4;
1795 
1796  mass = 0;
1797  if (e < switchMass){
1798  mass = aMassLow + bMassLow*e;
1799  } else {
1800  mass = aMassHigh + bMassHigh*e;
1801  }
1802  sigma = 0;
1803  if (e < switchSigma){
1804  sigma = aSigmaLow + bSigmaLow*e;
1805  } else {
1806  sigma = aSigmaHigh + bSigmaHigh*e;
1807  }
1808  // cout << "E: "<< e << "\t mass: " << mass << "\t sigma: "<< sigma << endl;
1809  return mass - nSigma*sigma;
1810  break;
1811 
1812  case 7: // just exclude band at 0
1813  return 0.005+0.004*e;
1814  break;
1815  case 8: // just exclude band at 0 looser
1816  return 0.004+0.004*e;
1817  break;
1818  case 9: // just exclude band at 0 tighter
1819  return 0.006+0.004*e;
1820  break;
1821 
1822  default:
1823  cout<<"Warning: SelectionCut merged not defined "<<fSelectionWindowCut<<endl;
1824  return -1;
1825  }
1826  return -1;
1827 }
1828 
1829 //________________________________________________________________________
1831 { // Set Cut
1832  switch(alphaMesonCut){
1833  case 0: // 0- 0.7
1834  fAlphaMinCutMeson = 0.0;
1835  fAlphaCutMeson = 0.7;
1836  fAlphaPtDepCut = kFALSE;
1837  break;
1838  case 1: // Updated 15 May 2015
1839  if (fIsMergedClusterCut == 0){
1840  if( fFAlphaCut ) delete fFAlphaCut;
1841  fFAlphaCut = new TF1("fFAlphaCut","[0]*tanh([1]*x)",0.,100.);
1842  fFAlphaCut->SetParameter(0,0.65);
1843  fFAlphaCut->SetParameter(1,1.8);
1844  fAlphaMinCutMeson = 0.0;
1845  fAlphaCutMeson = -1.0;
1846  fAlphaPtDepCut = kTRUE;
1847  } else {
1848  fAlphaPtDepCut = kFALSE;
1849  fAlphaMinCutMeson = 0.5;
1850  fAlphaCutMeson = 1;
1851  }
1852  break;
1853  case 2: // Updated 31 October 2013 before 0.5-1
1854  if (fIsMergedClusterCut == 0){
1855  if( fFAlphaCut ) delete fFAlphaCut;
1856  fFAlphaCut = new TF1("fFAlphaCut","[0]*tanh([1]*x)",0.,100.);
1857  fFAlphaCut->SetParameter(0,0.8);
1858  fFAlphaCut->SetParameter(1,1.2);
1859  fAlphaMinCutMeson = 0.0;
1860  fAlphaCutMeson = -1.0;
1861  fAlphaPtDepCut = kTRUE;
1862  } else {
1863  fAlphaPtDepCut = kFALSE;
1864  fAlphaMinCutMeson = 0.6;
1865  fAlphaCutMeson = 1;
1866  }
1867  break;
1868  case 3: // 0.0-1
1869  fAlphaMinCutMeson = 0.0;
1870  fAlphaCutMeson = 1.;
1871  fAlphaPtDepCut = kFALSE;
1872  break;
1873  case 4: // 0-0.65
1874  fAlphaMinCutMeson = 0.0;
1875  fAlphaCutMeson = 0.65;
1876  fAlphaPtDepCut = kFALSE;
1877  break;
1878  case 5: // 0-0.75
1879  fAlphaMinCutMeson = 0.0;
1880  fAlphaCutMeson = 0.75;
1881  fAlphaPtDepCut = kFALSE;
1882  break;
1883  case 6: // 0-0.8
1884  fAlphaMinCutMeson = 0.0;
1885  fAlphaCutMeson = 0.8;
1886  fAlphaPtDepCut = kFALSE;
1887  break;
1888  case 7: // 0.0-0.85
1889  fAlphaMinCutMeson = 0.0;
1890  fAlphaCutMeson = 0.85;
1891  fAlphaPtDepCut = kFALSE;
1892  break;
1893  case 8: // 0.0-0.6
1894  fAlphaMinCutMeson = 0.0;
1895  fAlphaCutMeson = 0.6;
1896  fAlphaPtDepCut = kFALSE;
1897  break;
1898  case 9: // Updated 11 November 2013 before 0.0 - 0.3
1899  if (fIsMergedClusterCut == 0){
1900  if( fFAlphaCut ) delete fFAlphaCut;
1901  fFAlphaCut = new TF1("fFAlphaCut","[0]*tanh([1]*x)",0.,100.);
1902  fFAlphaCut->SetParameter(0,0.65);
1903  fFAlphaCut->SetParameter(1,1.2);
1904  fAlphaMinCutMeson = 0.0;
1905  fAlphaCutMeson = -1.0;
1906  fAlphaPtDepCut = kTRUE;
1907  } else {
1908  fAlphaPtDepCut = kFALSE;
1909  fAlphaMinCutMeson = 0.4;
1910  fAlphaCutMeson = 1;
1911  }
1912  break;
1913  case 10: //a 0-0.2
1914  fAlphaMinCutMeson = 0.0;
1915  fAlphaCutMeson = 0.2;
1916  fAlphaPtDepCut = kFALSE;
1917  break;
1918  case 11: //b 0.2-0.6
1919  fAlphaMinCutMeson = 0.2;
1920  fAlphaCutMeson = 0.6;
1921  fAlphaPtDepCut = kFALSE;
1922  break;
1923  case 12: //c 0.6-1.0
1924  fAlphaMinCutMeson = 0.6;
1925  fAlphaCutMeson = 1.0;
1926  fAlphaPtDepCut = kFALSE;
1927  break;
1928  default:
1929  cout<<"Warning: AlphaMesonCut not defined "<<alphaMesonCut<<endl;
1930  return kFALSE;
1931  }
1932  return kTRUE;
1933 }
1934 
1935 
1936 //________________________________________________________________________
1938 { // Set Cut
1939  switch(alphaMesonCut){
1940  case 0: // 0- 1
1941  fAlphaMinCutMeson = 0.0;
1942  fAlphaCutMeson = 1;
1943  fAlphaPtDepCut = kFALSE;
1944  break;
1945  case 1: // cut for NLM 1
1946  if( fFAlphaCut ) delete fFAlphaCut;
1947  fFAlphaCut = new TF1("fFAlphaCut","[0]+[1]*x+[2]/(x*x*x)",0.,100.);
1948  fFAlphaCut->SetParameter(0,0.96);
1949  fFAlphaCut->SetParameter(1,0);
1950  fFAlphaCut->SetParameter(2,-879);
1951  fAlphaMinCutMeson = 0.0;
1952  fAlphaCutMeson = -1.0;
1953  fAlphaPtDepCut = kTRUE;
1954  break;
1955  case 2: // cut for NLM 2
1956  if( fFAlphaCut ) delete fFAlphaCut;
1957  fFAlphaCut = new TF1("fFAlphaCut","[0]+[1]*x+[2]/(x*x*x)",0.,100.);
1958  fFAlphaCut->SetParameter(0,0.95);
1959  fFAlphaCut->SetParameter(1,0.0015);
1960  fFAlphaCut->SetParameter(2,-233);
1961  fAlphaMinCutMeson = 0.0;
1962  fAlphaCutMeson = -1.0;
1963  fAlphaPtDepCut = kTRUE;
1964  break;
1965  case 3: // cut for NLM 1 larger
1966  if( fFAlphaCut ) delete fFAlphaCut;
1967  fFAlphaCut = new TF1("fFAlphaCut","[0]+[1]*x+[2]/(x*x*x)",0.,100.);
1968  fFAlphaCut->SetParameter(0,0.975);
1969  fFAlphaCut->SetParameter(1,0);
1970  fFAlphaCut->SetParameter(2,-800);
1971  fAlphaMinCutMeson = 0.0;
1972  fAlphaCutMeson = -1.0;
1973  fAlphaPtDepCut = kTRUE;
1974  break;
1975  case 4: // cut for NLM 2 larger
1976  if( fFAlphaCut ) delete fFAlphaCut;
1977  fFAlphaCut = new TF1("fFAlphaCut","[0]+[1]*x+[2]/(x*x*x)",0.,100.);
1978  fFAlphaCut->SetParameter(0,0.97);
1979  fFAlphaCut->SetParameter(1,0.0015);
1980  fFAlphaCut->SetParameter(2,-200);
1981  fAlphaMinCutMeson = 0.0;
1982  fAlphaCutMeson = -1.0;
1983  fAlphaPtDepCut = kTRUE;
1984  break;
1985  case 5: // cut for NLM 1 smaller
1986  if( fFAlphaCut ) delete fFAlphaCut;
1987  fFAlphaCut = new TF1("fFAlphaCut","[0]+[1]*x+[2]/(x*x*x)",0.,100.);
1988  fFAlphaCut->SetParameter(0,0.94);
1989  fFAlphaCut->SetParameter(1,0);
1990  fFAlphaCut->SetParameter(2,-970);
1991  fAlphaMinCutMeson = 0.0;
1992  fAlphaCutMeson = -1.0;
1993  fAlphaPtDepCut = kTRUE;
1994  break;
1995  case 6: // cut for NLM 2 smaller
1996  if( fFAlphaCut ) delete fFAlphaCut;
1997  fFAlphaCut = new TF1("fFAlphaCut","[0]+[1]*x+[2]/(x*x*x)",0.,100.);
1998  fFAlphaCut->SetParameter(0,0.935);
1999  fFAlphaCut->SetParameter(1,0.0015);
2000  fFAlphaCut->SetParameter(2,-273);
2001  fAlphaMinCutMeson = 0.0;
2002  fAlphaCutMeson = -1.0;
2003  fAlphaPtDepCut = kTRUE;
2004  break;
2005 
2006  default:
2007  cout<<"Warning: AlphaMesonCut for merged clusters not defined "<<alphaMesonCut<<endl;
2008  return kFALSE;
2009  }
2010  return kTRUE;
2011 }
2012 
2013 //________________________________________________________________________
2015  // Set Cut
2016  switch(RapidityMesonCut){
2017  case 0: // changed from 0.9 to 1.35
2018  fRapidityCutMeson = 1.35;
2019  break;
2020  case 1: //
2021  fRapidityCutMeson = 0.8;
2022  break;
2023  case 2: //
2024  fRapidityCutMeson = 0.7;
2025  break;
2026  case 3: //
2027  fRapidityCutMeson = 0.6;
2028  break;
2029  case 4: //
2030  fRapidityCutMeson = 0.5;
2031  break;
2032  case 5: //
2033  fRapidityCutMeson = 0.85;
2034  break;
2035  case 6: //
2036  fRapidityCutMeson = 0.75;
2037  break;
2038  case 7: //
2039  fRapidityCutMeson = 0.3;
2040  break;
2041  case 8: //changed, before 0.35
2042  fRapidityCutMeson = 0.25;
2043  break;
2044  case 9: //
2045  fRapidityCutMeson = 0.4;
2046  break;
2047  default:
2048  cout<<"Warning: RapidityMesonCut not defined "<<RapidityMesonCut<<endl;
2049  return kFALSE;
2050  }
2051  return kTRUE;
2052 }
2053 
2054 
2055 //________________________________________________________________________
2057  // Set Cut
2058  switch(BackgroundScheme){
2059  case 0: //Rotation
2060  fUseRotationMethodInBG = kTRUE;
2061  fDoBGProbability = kFALSE;
2062  break;
2063  case 1: // mixed event with V0 multiplicity
2064  fUseRotationMethodInBG = kFALSE;
2065  fUseTrackMultiplicityForBG = kFALSE;
2066  fDoBGProbability = kFALSE;
2067  break;
2068  case 2: // mixed event with track multiplicity
2069  fUseRotationMethodInBG = kFALSE;
2071  fDoBGProbability = kFALSE;
2072  break;
2073  case 3: //Rotation
2074  fUseRotationMethodInBG = kTRUE;
2075  fDoBGProbability = kTRUE;
2076  break;
2077  case 4: //No BG calculation
2078  cout << "no BG calculation should be done" << endl;
2079  fUseRotationMethodInBG = kFALSE;
2080  fDoBGProbability = kFALSE;
2081  fDoBG = kFALSE;
2082  break;
2083  case 5: //Rotation
2084  fUseRotationMethodInBG = kTRUE;
2085  fDoBGProbability = kFALSE;
2086  fBackgroundHandler = 1;
2087  break;
2088  case 6: // mixed event with V0 multiplicity
2089  fUseRotationMethodInBG = kFALSE;
2090  fUseTrackMultiplicityForBG = kFALSE;
2091  fDoBGProbability = kFALSE;
2092  fBackgroundHandler = 1;
2093  break;
2094  case 7: // mixed event with track multiplicity
2095  fUseRotationMethodInBG = kFALSE;
2097  fDoBGProbability = kFALSE;
2098  fBackgroundHandler = 1;
2099  break;
2100  case 8: //Rotation
2101  fUseRotationMethodInBG = kTRUE;
2102  fDoBGProbability = kTRUE;
2103  fBackgroundHandler = 1;
2104  break;
2105  case 9: // mixed event with Ptmax method
2106  fUseRotationMethodInBG = kFALSE;
2107  fUseTrackMultiplicityForBG = kFALSE;
2108  fDoBGProbability = kFALSE;
2109  fUsePtmaxMethodForBG = kTRUE;
2110  break;
2111  case 10: // mixed event with likesign mixing
2112  fUseRotationMethodInBG = kFALSE;
2113  fUseTrackMultiplicityForBG = kFALSE;
2114  fDoBGProbability = kFALSE;
2115  fBackgroundUseLikeSign = kTRUE;
2116  fBackgroundUseSideband = kFALSE;
2117  break;
2118  case 11: // mixed event with pi0 sideband candidates (right side of pi0 peak)
2119  fUseRotationMethodInBG = kFALSE;
2120  fUseTrackMultiplicityForBG = kFALSE;
2121  fDoBGProbability = kFALSE;
2122  fBackgroundUseLikeSign = kFALSE;
2123  fBackgroundUseSideband = kTRUE;
2124  fSidebandMixingLow = 0.180;
2125  fSidebandMixingHigh = 0.220;
2126  break;
2127  case 12: // mixed event with pi0 sideband candidates (left side of pi0 peak)
2128  fUseRotationMethodInBG = kFALSE;
2129  fUseTrackMultiplicityForBG = kFALSE;
2130  fDoBGProbability = kFALSE;
2131  fBackgroundUseLikeSign = kFALSE;
2132  fBackgroundUseSideband = kTRUE;
2133  fSidebandMixingLow = 0.01;
2134  fSidebandMixingHigh = 0.05;
2135  break;
2136  case 13: // mixing event with pi0 sideband candidates (both sides of pi0 peak)
2137  fUseRotationMethodInBG = kFALSE;
2138  fUseTrackMultiplicityForBG = kFALSE;
2139  fDoBGProbability = kFALSE;
2140  fBackgroundUseLikeSign = kFALSE;
2141  fBackgroundUseSideband = kFALSE;
2143  fSidebandMixingLeftLow = 0.01;
2144  fSidebandMixingLeftHigh = 0.05;
2145  fSidebandMixingRightLow = 0.180;
2146  fSidebandMixingRightHigh = 0.220;
2147  break;
2148  default:
2149  cout<<"Warning: BackgroundScheme not defined "<<BackgroundScheme<<endl;
2150  return kFALSE;
2151  }
2152  return kTRUE;
2153 }
2154 
2155 
2156 //________________________________________________________________________
2158  // Set Cut
2159  switch(DegreesForRotationMethod){
2160  case 0:
2162  break;
2163  case 1:
2165  break;
2166  case 2:
2168  break;
2169  case 3:
2171  break;
2172  default:
2173  cout<<"Warning: DegreesForRotationMethod not defined "<<DegreesForRotationMethod<<endl;
2174  return kFALSE;
2175  }
2176  fCuts[kDegreesForRotationMethod]=DegreesForRotationMethod;
2177  return kTRUE;
2178 }
2179 
2180 //________________________________________________________________________
2182  // Set Cut
2183  switch(NumberOfBGEvents){
2184  case 0:
2185  fNumberOfBGEvents = 5;
2186  break;
2187  case 1:
2188  fNumberOfBGEvents = 10;
2189  break;
2190  case 2:
2191  fNumberOfBGEvents = 15;
2192  break;
2193  case 3:
2194  fNumberOfBGEvents = 20;
2195  break;
2196  case 4:
2197  fNumberOfBGEvents = 2;
2198  break;
2199  case 5:
2200  fNumberOfBGEvents = 50;
2201  break;
2202  case 6:
2203  fNumberOfBGEvents = 80;
2204  break;
2205  case 7:
2206  fNumberOfBGEvents = 100;
2207  break;
2208  default:
2209  cout<<"Warning: NumberOfBGEvents not defined "<<NumberOfBGEvents<<endl;
2210  return kFALSE;
2211  }
2212  return kTRUE;
2213 }
2214 //________________________________________________________________________
2216 
2217  switch(sharedElec){
2218  case 0:
2219  fDoSharedElecCut = kFALSE;
2220  break;
2221  case 1:
2222  fDoSharedElecCut = kTRUE;
2223  break;
2224  default:
2225  cout<<"Warning: Shared Electron Cut not defined "<<sharedElec<<endl;
2226  return kFALSE;
2227  }
2228 
2229  return kTRUE;
2230 }
2231 
2232 //________________________________________________________________________
2234 
2235  switch(toClose){
2236  case 0:
2237  fDoToCloseV0sCut = kFALSE;
2238  fMinV0Dist = 250;
2239  break;
2240  case 1:
2241  fDoToCloseV0sCut = kTRUE;
2242  fMinV0Dist = 1;
2243  break;
2244  case 2:
2245  fDoToCloseV0sCut = kTRUE;
2246  fMinV0Dist = 2;
2247  break;
2248  case 3:
2249  fDoToCloseV0sCut = kTRUE;
2250  fMinV0Dist = 3;
2251  break;
2252  default:
2253  cout<<"Warning: Shared Electron Cut not defined "<<toClose<<endl;
2254  return kFALSE;
2255  }
2256  return kTRUE;
2257 }
2258 
2259 //________________________________________________________________________
2261 {// Set Cut
2262  if(fMode == 2){ //PCM-EMCal running
2263  switch(useMCPSmearing){
2264  case 0:
2265  fUseMCPSmearing = 0;
2266  fPBremSmearing = 1.;
2267  fPSigSmearing = 0.;
2268  fPSigSmearingCte = 0.;
2269  break;
2270  case 1:
2271  fUseMCPSmearing = 1;
2272  fPBremSmearing = 1;
2273  fPSigSmearing = 0.010;
2274  fPSigSmearingCte = 0.010;
2275  break;
2276  case 2:
2277  fUseMCPSmearing = 1;
2278  fPBremSmearing = 1;
2279  fPSigSmearing = 0.015;
2280  fPSigSmearingCte = 0.010;
2281  break;
2282  case 3:
2283  fUseMCPSmearing = 1;
2284  fPBremSmearing = 1.;
2285  fPSigSmearing = 0.020;
2286  fPSigSmearingCte = 0.010;
2287  break;
2288  case 4:
2289  fUseMCPSmearing = 1;
2290  fPBremSmearing = 1.;
2291  fPSigSmearing = 0.020;
2292  fPSigSmearingCte = 0.020;
2293  break;
2294  case 5:
2295  fUseMCPSmearing = 1;
2296  fPBremSmearing = 1.;
2297  fPSigSmearing = 0.030;
2298  fPSigSmearingCte = 0.020;
2299  break;
2300  case 6:
2301  fUseMCPSmearing = 1;
2302  fPBremSmearing = 1.;
2303  fPSigSmearing = 0.030;
2304  fPSigSmearingCte = 0.030;
2305  break;
2306  case 7:
2307  fUseMCPSmearing = 1;
2308  fPBremSmearing = 1;
2309  fPSigSmearing = 0.030;
2310  fPSigSmearingCte = 0.050;
2311  break;
2312  case 8:
2313  fUseMCPSmearing = 1;
2314  fPBremSmearing = 1.;
2315  fPSigSmearing = 0.030;
2316  fPSigSmearingCte = 0.060;
2317  break;
2318  case 9:
2319  fUseMCPSmearing = 1;
2320  fPBremSmearing = 1.;
2321  fPSigSmearing = 0.075;
2322  fPSigSmearingCte = 0.050;
2323  break;
2324 
2325  default:
2326  AliError("Warning: UseMCPSmearing not defined");
2327  return kFALSE;
2328  }
2329  }else{
2330  switch(useMCPSmearing){
2331  case 0:
2332  fUseMCPSmearing = 0;
2333  fPBremSmearing = 1.;
2334  fPSigSmearing = 0.;
2335  fPSigSmearingCte = 0.;
2336  break;
2337  case 1:
2338  fUseMCPSmearing = 1;
2339  fPBremSmearing = 1.0e-14;
2340  fPSigSmearing = 0.;
2341  fPSigSmearingCte = 0.;
2342  break;
2343  case 2:
2344  fUseMCPSmearing = 1;
2345  fPBremSmearing = 1.0e-15;
2346  fPSigSmearing = 0.0;
2347  fPSigSmearingCte = 0.;
2348  break;
2349  case 3:
2350  fUseMCPSmearing = 1;
2351  fPBremSmearing = 1.;
2352  fPSigSmearing = 0.003;
2353  fPSigSmearingCte = 0.002;
2354  break;
2355  case 4:
2356  fUseMCPSmearing = 1;
2357  fPBremSmearing = 1.;
2358  fPSigSmearing = 0.003;
2359  fPSigSmearingCte = 0.007;
2360  break;
2361  case 5:
2362  fUseMCPSmearing = 1;
2363  fPBremSmearing = 1.;
2364  fPSigSmearing = 0.003;
2365  fPSigSmearingCte = 0.016;
2366  break;
2367  case 6:
2368  fUseMCPSmearing = 1;
2369  fPBremSmearing = 1.;
2370  fPSigSmearing = 0.007;
2371  fPSigSmearingCte = 0.016;
2372  break;
2373  case 7:
2374  fUseMCPSmearing = 1;
2375  fPBremSmearing = 1.0e-16;
2376  fPSigSmearing = 0.0;
2377  fPSigSmearingCte = 0.;
2378  break;
2379  case 8:
2380  fUseMCPSmearing = 1;
2381  fPBremSmearing = 1.;
2382  fPSigSmearing = 0.007;
2383  fPSigSmearingCte = 0.014;
2384  break;
2385  case 9:
2386  fUseMCPSmearing = 1;
2387  fPBremSmearing = 1.;
2388  fPSigSmearing = 0.007;
2389  fPSigSmearingCte = 0.011;
2390  break;
2391 
2392  default:
2393  AliError("Warning: UseMCPSmearing not defined");
2394  return kFALSE;
2395  }
2396  }
2397  return kTRUE;
2398 }
2399 
2400 
2401 //________________________________________________________________________
2403  // Set Cut
2404  switch(DCAGammaGamma){
2405  case 0: //
2406  fDCAGammaGammaCutOn = kFALSE;
2407  fDCAGammaGammaCut = 1000;
2408  break;
2409  case 1: //
2410  fDCAGammaGammaCutOn = kTRUE;
2411  fDCAGammaGammaCut = 10;
2412  break;
2413  case 2: //
2414  fDCAGammaGammaCutOn = kTRUE;
2415  fDCAGammaGammaCut = 5;
2416  break;
2417  case 3: //
2418  fDCAGammaGammaCutOn = kTRUE;
2419  fDCAGammaGammaCut = 4;
2420  break;
2421  case 4: //
2422  fDCAGammaGammaCutOn = kTRUE;
2423  fDCAGammaGammaCut = 3;
2424  break;
2425  case 5: //
2426  fDCAGammaGammaCutOn = kTRUE;
2427  fDCAGammaGammaCut = 2.5;
2428  break;
2429  case 6: //
2430  fDCAGammaGammaCutOn = kTRUE;
2431  fDCAGammaGammaCut = 2;
2432  break;
2433  case 7: //
2434  fDCAGammaGammaCutOn = kTRUE;
2435  fDCAGammaGammaCut = 1.5;
2436  break;
2437  case 8: //
2438  fDCAGammaGammaCutOn = kTRUE;
2439  fDCAGammaGammaCut = 1;
2440  break;
2441  case 9: //
2442  fDCAGammaGammaCutOn = kTRUE;
2443  fDCAGammaGammaCut = 0.5;
2444  break;
2445  default:
2446  cout<<"Warning: DCAGammaGamma not defined "<<DCAGammaGamma<<endl;
2447  return kFALSE;
2448  }
2449  return kTRUE;
2450 }
2451 
2452 //________________________________________________________________________
2454  // Set Cut
2455  switch(DCAZMesonPrimVtx){
2456  case 0: //
2457  fDCAZMesonPrimVtxCutOn = kFALSE;
2458  fDCAZMesonPrimVtxCut = 1000;
2459  break;
2460  case 1: //
2461  fDCAZMesonPrimVtxCutOn = kTRUE;
2462  fDCAZMesonPrimVtxCut = 10;
2463  break;
2464  case 2: //
2465  fDCAZMesonPrimVtxCutOn = kTRUE;
2467  break;
2468  case 3: //
2469  fDCAZMesonPrimVtxCutOn = kTRUE;
2471  break;
2472  case 4: //
2473  fDCAZMesonPrimVtxCutOn = kTRUE;
2475  break;
2476  case 5: //
2477  fDCAZMesonPrimVtxCutOn = kTRUE;
2478  fDCAZMesonPrimVtxCut = 2.5;
2479  break;
2480  case 6: //
2481  fDCAZMesonPrimVtxCutOn = kTRUE;
2483  break;
2484  case 7: //
2485  fDCAZMesonPrimVtxCutOn = kTRUE;
2486  fDCAZMesonPrimVtxCut = 1.5;
2487  break;
2488  case 8: //
2489  fDCAZMesonPrimVtxCutOn = kTRUE;
2491  break;
2492  case 9: //
2493  fDCAZMesonPrimVtxCutOn = kTRUE;
2494  fDCAZMesonPrimVtxCut = 0.5;
2495  break;
2496  default:
2497  cout<<"Warning: DCAZMesonPrimVtx not defined "<<DCAZMesonPrimVtx<<endl;
2498  return kFALSE;
2499  }
2500  return kTRUE;
2501 }
2502 
2503 //________________________________________________________________________
2505  // Set Cut
2506  switch(DCARMesonPrimVtx){
2507  case 0: //
2508  fDCARMesonPrimVtxCutOn = kFALSE;
2509  fDCARMesonPrimVtxCut = 1000;
2510  break;
2511  case 1: //
2512  fDCARMesonPrimVtxCutOn = kTRUE;
2513  fDCARMesonPrimVtxCut = 10;
2514  break;
2515  case 2: //
2516  fDCARMesonPrimVtxCutOn = kTRUE;
2518  break;
2519  case 3: //
2520  fDCARMesonPrimVtxCutOn = kTRUE;
2522  break;
2523  case 4: //
2524  fDCARMesonPrimVtxCutOn = kTRUE;
2526  break;
2527  case 5: //
2528  fDCARMesonPrimVtxCutOn = kTRUE;
2529  fDCARMesonPrimVtxCut = 2.5;
2530  break;
2531  case 6: //
2532  fDCARMesonPrimVtxCutOn = kTRUE;
2534  break;
2535  case 7: //
2536  fDCARMesonPrimVtxCutOn = kTRUE;
2537  fDCARMesonPrimVtxCut = 1.5;
2538  break;
2539  case 8: //
2540  fDCARMesonPrimVtxCutOn = kTRUE;
2542  break;
2543  case 9: //
2544  fDCARMesonPrimVtxCutOn = kTRUE;
2545  fDCARMesonPrimVtxCut = 0.5;
2546  break;
2547  default:
2548  cout<<"Warning: DCARMesonPrimVtx not defined "<<DCARMesonPrimVtx<<endl;
2549  return kFALSE;
2550  }
2551  return kTRUE;
2552 }
2553 
2554 //________________________________________________________________________
2556  // Set Cut
2557 
2558  switch(minOpanMesonCut){
2559  case 0: //
2560  fMinOpanCutMeson = 0;
2561  fMinOpanPtDepCut = kFALSE;
2562  break;
2563  case 1: //
2564  fMinOpanCutMeson = 0.005;
2565  fMinOpanPtDepCut = kFALSE;
2566  break;
2567  case 2:
2568  if( fFMinOpanCut ) delete fFMinOpanCut;
2569  fFMinOpanCut = new TF1("fFMinOpanCut","[0]*exp(-[1]*x)+[2]",0.,100.);
2570  fFMinOpanCut->SetParameter(0,1.5);
2571  fFMinOpanCut->SetParameter(1,1.35);
2572  fFMinOpanCut->SetParameter(2,0.02);
2573  fMinOpanCutMeson = 0;
2574  fMinOpanPtDepCut = kTRUE;
2575  break;
2576  case 3: //
2577  fMinOpanCutMeson = 0.01;
2578  fMinOpanPtDepCut = kFALSE;
2579  break;
2580  case 4: //
2581  fMinOpanCutMeson = 0.0152; // minimum 0.75 EMCal cell diagonals
2582  fMinOpanPtDepCut = kFALSE;
2583  break;
2584  case 5: //
2585  fMinOpanCutMeson = 0.0202; // minimum 1 EMCal cell diagonal
2586  fMinOpanPtDepCut = kFALSE;
2587  break;
2588  case 6: //
2589  fMinOpanCutMeson = 0.017; // new standard cut for EMCal analyses as of 17.05.2017
2590  fMinOpanPtDepCut = kFALSE;
2591  break;
2592  case 7: //
2593  fMinOpanCutMeson = 0.016;
2594  fMinOpanPtDepCut = kFALSE;
2595  break;
2596  case 8: //
2597  fMinOpanCutMeson = 0.018;
2598  fMinOpanPtDepCut = kFALSE;
2599  break;
2600  case 9: //
2601  fMinOpanCutMeson = 0.019;
2602  fMinOpanPtDepCut = kFALSE;
2603  break;
2604 
2605  //cuts with one cell dist for GammaCalo only
2606  case 10: //a
2607  fMinOpanCutMeson = 0.;
2608  fEnableMinOpeningAngleCut = kFALSE;
2609  fMinOpanPtDepCut = kFALSE;
2610  fEnableOneCellDistCut = kTRUE;
2611  break;
2612  case 11: //b
2613  fMinOpanCutMeson = 0.0152;
2614  fEnableMinOpeningAngleCut = kFALSE;
2615  fMinOpanPtDepCut = kFALSE;
2616  fEnableOneCellDistCut = kTRUE;
2617  break;
2618  case 12: //c
2619  fMinOpanCutMeson = 0.016;
2620  fEnableMinOpeningAngleCut = kFALSE;
2621  fMinOpanPtDepCut = kFALSE;
2622  fEnableOneCellDistCut = kTRUE;
2623  break;
2624  case 13: //d
2625  fMinOpanCutMeson = 0.017;
2626  fEnableMinOpeningAngleCut = kFALSE;
2627  fMinOpanPtDepCut = kFALSE;
2628  fEnableOneCellDistCut = kTRUE;
2629  break;
2630  case 14: //e
2631  fMinOpanCutMeson = 0.018;
2632  fEnableMinOpeningAngleCut = kFALSE;
2633  fMinOpanPtDepCut = kFALSE;
2634  fEnableOneCellDistCut = kTRUE;
2635  break;
2636  case 15: //f
2637  fMinOpanCutMeson = 0.019;
2638  fEnableMinOpeningAngleCut = kFALSE;
2639  fMinOpanPtDepCut = kFALSE;
2640  fEnableOneCellDistCut = kTRUE;
2641  break;
2642  case 16: //g
2643  fMinOpanCutMeson = 0.0202;
2644  fEnableMinOpeningAngleCut = kFALSE;
2645  fMinOpanPtDepCut = kFALSE;
2646  fEnableOneCellDistCut = kTRUE;
2647  break;
2648  // opening angle cut variations for EMCal related analyses up to 17. May 2017
2649 // case 5: //
2650 // fMinOpanCutMeson = 0.0202; // minimum 1 EMCal cell diagonal
2651 // fMinOpanPtDepCut = kFALSE;
2652 // break;
2653 // case 6: //
2654 // fMinOpanCutMeson = 0.0404; // minimum 2 EMCal cell diagonals
2655 // fMinOpanPtDepCut = kFALSE;
2656 // break;
2657 // case 7: //
2658 // fMinOpanCutMeson = 0.0303; // minimum 1.5 EMCal cell diagonal
2659 // fMinOpanPtDepCut = kFALSE;
2660 // break;
2661 // case 8: //
2662 // fMinOpanCutMeson = 0.02525; // minimum 1.25 EMCal cell diagonal
2663 // fMinOpanPtDepCut = kFALSE;
2664 // break;
2665 // case 9: //
2666 // fMinOpanCutMeson = 0.03535; // minimum 1.75 EMCal cell diagonal
2667 // fMinOpanPtDepCut = kFALSE;
2668 // break;
2669  default:
2670  cout<<"Warning:minOpanMesonCut not defined "<<minOpanMesonCut<<endl;
2671  return kFALSE;
2672  }
2673 
2674  return kTRUE;
2675 }
2676 
2677 //________________________________________________________________________
2679  // Set Cut
2680  switch(maxOpanMesonCut){
2681  case 0: //
2682  fMaxOpanCutMeson = TMath::Pi();
2683  fMaxOpanPtDepCut = kFALSE;
2684  break;
2685  case 1:
2686  if( fFMaxOpanCut ) delete fFMaxOpanCut;
2687  fFMaxOpanCut = new TF1("fFMaxOpanCut","[0]*exp(-[1]*x)+[2]",0.,100.);
2688  fFMaxOpanCut->SetParameter(0,2.5);
2689  fFMaxOpanCut->SetParameter(1,0.85);
2690  fFMaxOpanCut->SetParameter(2,0.35);
2691  fMaxOpanPtDepCut = kTRUE;
2692  fMaxOpanCutMeson = TMath::Pi();
2693  break;
2694  case 2:
2695  if( fFMaxOpanCut ) delete fFMaxOpanCut;
2696  fFMaxOpanCut = new TF1("fFMaxOpanCut","[0]*exp(-[1]*x)+[2]",0.,100.);
2697  fFMaxOpanCut->SetParameter(0,2.3);
2698  fFMaxOpanCut->SetParameter(1,0.85);
2699  fFMaxOpanCut->SetParameter(2,0.35);
2700  fMaxOpanPtDepCut = kTRUE;
2701  fMaxOpanCutMeson = TMath::Pi();
2702  break;
2703  default:
2704  cout<<"Warning: maxOpanMesonCut not defined "<< maxOpanMesonCut<<endl;
2705  return kFALSE;
2706  }
2707  return kTRUE;
2708 }
2709 
2710 //________________________________________________________________________
2712  // returns TString with current cut number
2713  return fCutStringRead;
2714 }
2715 
2716 //________________________________________________________________________
2718 
2719  Int_t posLabel = photon->GetTrackLabelPositive();
2720  Int_t negLabel = photon->GetTrackLabelNegative();
2721 
2722  fElectronLabelArray[nV0*2] = posLabel;
2723  fElectronLabelArray[(nV0*2)+1] = negLabel;
2724 }
2725 
2726 //________________________________________________________________________
2728 
2729  Int_t posLabel = photon->GetTrackLabelPositive();
2730  Int_t negLabel = photon->GetTrackLabelNegative();
2731 
2732  for(Int_t i = 0; i<nV0s*2;i++){
2733  if(i==nV0*2) continue;
2734  if(i==(nV0*2)+1) continue;
2735  if(fElectronLabelArray[i] == posLabel){
2736  return kFALSE;}
2737  if(fElectronLabelArray[i] == negLabel){
2738  return kFALSE;}
2739  }
2740 
2741  return kTRUE;
2742 }
2743 //________________________________________________________________________
2745  Double_t posX = photon->GetConversionX();
2746  Double_t posY = photon->GetConversionY();
2747  Double_t posZ = photon->GetConversionZ();
2748 
2749  for(Int_t i = 0;i<photons->GetEntries();i++){
2750  if(nV0 == i) continue;
2751  AliAODConversionPhoton *photonComp = (AliAODConversionPhoton*) photons->At(i);
2752  Double_t posCompX = photonComp->GetConversionX();
2753  Double_t posCompY = photonComp->GetConversionY();
2754  Double_t posCompZ = photonComp->GetConversionZ();
2755 
2756  Double_t dist = pow((posX - posCompX),2)+pow((posY - posCompY),2)+pow((posZ - posCompZ),2);
2757 
2758  if(dist < fMinV0Dist*fMinV0Dist){
2759  if(photon->GetChi2perNDF() < photonComp->GetChi2perNDF()) return kTRUE;
2760  else {
2761  return kFALSE;}
2762  }
2763 
2764  }
2765  return kTRUE;
2766 }
2767 
2768 //________________________________________________________________________
2770 {
2771 
2772  if (photon==NULL) return;
2773  Double_t facPBrem = 1.;
2774  Double_t facPSig = 0.;
2775 
2776  Double_t phi=0.;
2777  Double_t theta=0.;
2778  Double_t P=0.;
2779 
2780 
2781  P=photon->P();
2782  phi=photon->Phi();
2783  if( photon->P()!=0){
2784  theta=acos( photon->Pz()/ photon->P());
2785  }
2786 
2787  if( fPSigSmearing != 0. || fPSigSmearingCte!=0. ){
2788  facPSig = TMath::Sqrt(fPSigSmearingCte*fPSigSmearingCte+fPSigSmearing*fPSigSmearing*P*P)*fRandom.Gaus(0.,1.);
2789  }
2790 
2791  if( fPBremSmearing != 1.){
2792  if(fBrem!=NULL){
2793  facPBrem = fBrem->GetRandom();
2794  }
2795  }
2796 
2797  photon->SetPx(facPBrem* (1+facPSig)* P*sin(theta)*cos(phi)) ;
2798  photon->SetPy(facPBrem* (1+facPSig)* P*sin(theta)*sin(phi)) ;
2799  photon->SetPz(facPBrem* (1+facPSig)* P*cos(theta)) ;
2800  photon->SetE(photon->P());
2801 }
2802 //________________________________________________________________________
2804 {
2805 
2806  if (photon==NULL) return;
2807  Double_t facPBrem = 1.;
2808  Double_t facPSig = 0.;
2809 
2810  Double_t phi=0.;
2811  Double_t theta=0.;
2812  Double_t P=0.;
2813 
2814 
2815  P=photon->P();
2816  phi=photon->Phi();
2817  if( photon->P()!=0){
2818  theta=acos( photon->Pz()/ photon->P());
2819  }
2820 
2821  if( fPSigSmearing != 0. || fPSigSmearingCte!=0. ){
2822  facPSig = TMath::Sqrt(fPSigSmearingCte*fPSigSmearingCte+fPSigSmearing*fPSigSmearing*P*P)*fRandom.Gaus(0.,1.);
2823  }
2824 
2825  if( fPBremSmearing != 1.){
2826  if(fBrem!=NULL){
2827  facPBrem = fBrem->GetRandom();
2828  }
2829  }
2830 
2831  photon->SetPx(facPBrem* (1+facPSig)* P*sin(theta)*cos(phi)) ;
2832  photon->SetPy(facPBrem* (1+facPSig)* P*sin(theta)*sin(phi)) ;
2833  photon->SetPz(facPBrem* (1+facPSig)* P*cos(theta)) ;
2834 
2835 }
2836 //________________________________________________________________________
2837 TLorentzVector AliConversionMesonCuts::SmearElectron(TLorentzVector particle)
2838 {
2839 
2840  //if (particle==0) return;
2841  Double_t facPBrem = 1.;
2842  Double_t facPSig = 0.;
2843 
2844  Double_t phi=0.;
2845  Double_t theta=0.;
2846  Double_t P=0.;
2847 
2848  P=particle.P();
2849  phi=particle.Phi();
2850  if (phi < 0.) phi += 2. * TMath::Pi();
2851 
2852  if( particle.P()!=0){
2853  theta=acos( particle.Pz()/ particle.P());
2854  }
2855 
2856 
2857  Double_t fPSigSmearingHalf = fPSigSmearing / 2.0; //The parameter was set for gammas with 2 particles and here we have just one electron
2858  Double_t sqrtfPSigSmearingCteHalf = fPSigSmearingCte / 2.0 ; //The parameter was set for gammas with 2 particles and here we have just one electron
2859 
2860 
2861 
2862  if( fPSigSmearingHalf != 0. || sqrtfPSigSmearingCteHalf!=0. ){
2863  facPSig = TMath::Sqrt(sqrtfPSigSmearingCteHalf*sqrtfPSigSmearingCteHalf+fPSigSmearingHalf*fPSigSmearingHalf*P*P)*fRandom.Gaus(0.,1.);
2864  }
2865 
2866  if( fPBremSmearing != 1.){
2867  if(fBrem!=NULL){
2868  facPBrem = fBrem->GetRandom();
2869  }
2870  }
2871 
2872  TLorentzVector SmearedParticle;
2873 
2874  SmearedParticle.SetXYZM( facPBrem* (1+facPSig)* P*sin(theta)*cos(phi) , facPBrem* (1+facPSig)* P*sin(theta)*sin(phi) ,
2875  facPBrem* (1+facPSig)* P*cos(theta) , TDatabasePDG::Instance()->GetParticle( ::kElectron )->Mass()) ;
2876 
2877  //particle.SetPx(facPBrem* (1+facPSig)* P*sin(theta)*cos(phi)) ;
2878  //particle.SetPy(facPBrem* (1+facPSig)* P*sin(theta)*sin(phi)) ;
2879  //particle.SetPz(facPBrem* (1+facPSig)* P*cos(theta)) ;
2880 
2881  return SmearedParticle;
2882 
2883 }
2884 
2885 //________________________________________________________________________
2886 // function to determine whether meson was selected by mass range
2888  if (fAcceptMesonMass){
2889  if (nominalRange == 0){
2890  if (meson->M() > fSelectionLow && meson->M() < fSelectionHigh)
2891  return kTRUE;
2892  else
2893  return kFALSE;
2894  } else if (nominalRange == 1){
2895  if (meson->M() > fSidebandMixingLow && meson->M() < fSidebandMixingHigh)
2896  return kTRUE;
2897  else
2898  return kFALSE;
2899  } else if (nominalRange == 2){
2900  if (meson->M() > fSidebandMixingLeftLow && meson->M() < fSidebandMixingLeftHigh)
2901  return kTRUE;
2902  else
2903  return kFALSE;
2904  } else if (nominalRange == 3){
2905  if (meson->M() > fSidebandMixingRightLow && meson->M() < fSidebandMixingRightHigh)
2906  return kTRUE;
2907  else
2908  return kFALSE;
2909  }
2910  } else {
2911  if (!(meson->M() > fSelectionLow && meson->M() < fSelectionHigh))
2912  return kTRUE;
2913  else
2914  return kFALSE;
2915  }
2916  return kTRUE;
2917 }
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
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...