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