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