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