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