Corrected analysis configuration and execution files after changes in PartCorr frame...
[u/mrichter/AliRoot.git] / PWG4 / macros / ConfigAnalysisESDExample.C
CommitLineData
d92b41ad 1/* $Id: $ */
2/* $Log$ */
3
4//------------------------------------
5// Configuration macro example:
6//
3e0577a2 7// Do example analysis with MC
d92b41ad 8//
9// Author : Gustavo Conesa Balbastre (INFN-LNF)
10//------------------------------------
11
c90ac396 12AliAnaPartCorrMaker* ConfigAnalysis()
d92b41ad 13{
14 //
15 // Configuration goes here
16 //
17 printf("======================== \n");
18 printf("ConfigAnalysis() \n");
19 printf("======================== \n");
20
21
22 //Detector Fidutial Cuts
23 AliFidutialCut * fidCut = new AliFidutialCut();
3e0577a2 24 fidCut->DoCTSFidutialCut(kFALSE) ;
d92b41ad 25 fidCut->DoEMCALFidutialCut(kTRUE) ;
26 fidCut->DoPHOSFidutialCut(kTRUE) ;
27
3e0577a2 28 //fidCut->SetSimpleCTSFidutialCut(0.9,0.,360.);
d92b41ad 29 fidCut->SetSimpleEMCALFidutialCut(0.7,80.,190.);
3e0577a2 30 fidCut->SetSimplePHOSFidutialCut(0.12,220.,320.);
31
32 // //Fidutial cut EMCAL, 5 regions
d92b41ad 33 // Float_t etamax[]={0.67,0.51,0.16,-0.21,-0.61};
34 // TArrayF etamaxarr(5,etamax);
35 // fidCut->AddEMCALFidCutMaxEtaArray(etamaxarr);
36 // Float_t etamin[]={0.61,0.21,-0.16,-0.51,-0.67};
37 // TArrayF etaminarr(5,etamin);
38 // fidCut->AddEMCALFidCutMinEtaArray(etaminarr);
39 // Float_t phimax[]={99.*TMath::DegToRad(), 119.*TMath::DegToRad(), 139.*TMath::DegToRad(),
40 // 159.*TMath::DegToRad(), 179.*TMath::DegToRad(), 189.*TMath::DegToRad()};
41 // TArrayF phimaxarr(6,phimax);
42 // fidCut->AddEMCALFidCutMaxPhiArray(phimaxarr);
43 // Float_t phimin[]={81.*TMath::DegToRad(), 101.*TMath::DegToRad(), 121.*TMath::DegToRad(),
44 // 141.*TMath::DegToRad(), 161.*TMath::DegToRad(), 181.*TMath::DegToRad()};
45 // TArrayF phiminarr(6,phimin);
46 // fidCut->AddEMCALFidCutMinPhiArray(phiminarr);
47
d92b41ad 48 fidCut->Print("");
49
50 //-----------------------------------------------------------
51 // Reader
52 //-----------------------------------------------------------
3e0577a2 53 AliCaloTrackESDReader *reader = new AliCaloTrackESDReader();
d92b41ad 54 reader->SetDebug(-1);
55
3e0577a2 56 //Switch on or off the detectors information that you want
57 reader->SwitchOffEMCAL();
58 reader->SwitchOffCTS();
d92b41ad 59 reader->SwitchOnPHOS();
3e0577a2 60 reader->SwitchOffEMCALCells();
d92b41ad 61 reader->SwitchOnPHOSCells();
d92b41ad 62
63 //Min particle pT
3e0577a2 64 reader->SetEMCALPtMin(0.);
65 reader->SetPHOSPtMin(0.);
66 reader->SetCTSPtMin(.2);
d92b41ad 67
68 reader->SetFidutialCut(fidCut);
d92b41ad 69 reader->Print("");
70
d92b41ad 71 //---------------------------------------------------------------------
72 // Analysis algorithm
73 //---------------------------------------------------------------------
74
d92b41ad 75 //Detector Fidutial Cuts for analysis part
d92b41ad 76 AliFidutialCut * fidCut2 = new AliFidutialCut();
77 fidCut2->DoCTSFidutialCut(kFALSE) ;
78 fidCut2->DoEMCALFidutialCut(kTRUE) ;
79 fidCut2->DoPHOSFidutialCut(kTRUE) ;
80
3e0577a2 81 //fidCut2->SetSimpleCTSFidutialCut(0.9,0.,360.);
82 fidCut2->SetSimpleEMCALFidutialCut(0.5,100.,150.);
83 fidCut2->SetSimplePHOSFidutialCut(0.1,240.,280.);
d92b41ad 84
85 AliCaloPID * pid = new AliCaloPID();
86 // use selection with simple weights
87 pid->SetPHOSPhotonWeight(0.7); pid->SetPHOSPi0Weight(0.7);
88 pid->SetEMCALPhotonWeight(0.7); pid->SetEMCALPi0Weight(0.7);
3e0577a2 89 // use more complicated selection, particle weight depending on cluster energy
90// pid->UsePHOSPIDWeightFormula(kTRUE);
91// TFormula * photonF = new TFormula("photonWeight","0.98*(x<40)+ 0.68*(x>=100)+(x>=40 && x<100)*(0.98+x*(6e-3)-x*x*(2e-04)+x*x*x*(1.1e-06))");
92// TFormula * pi0F = new TFormula("pi0Weight","0.98*(x<65)+ 0.915*(x>=100)+(x>=65 && x-x*(1.95e-3)-x*x*(4.31e-05)+x*x*x*(3.61e-07))");
93// pid->SetPHOSPhotonWeightFormula(photonF);
94// pid->SetPHOSPi0WeightFormula(pi0F);
95
96
d92b41ad 97 AliAnaExample *ana = new AliAnaExample();
98 ana->SetDebug(-1);
d92b41ad 99 ana->SetCaloPID(pid);
d92b41ad 100 ana->SetFidutialCut(fidCut2);
3e0577a2 101 ana->SetDetector("PHOS");
102 //ana->SwitchOnDataMC();
103 ana->SetMinPt(0.);
104 ana->SetOutputAODName("Example");
105 ana->SetOutputAODClassName("AliAODPWG4Particle"); //Or AliAODPWG4ParticleCorrelation
106 //Set Histrograms bins and ranges
107// ana->SetHistoPtRangeAndNBins(0, 50, 100) ;
108// ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
109// ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;
d92b41ad 110
3e0577a2 111//AliAnaExample *ana2 = new AliAnaExample();
d92b41ad 112
113 //---------------------------------------------------------------------
114 // Set analysis algorithm and reader
115 //---------------------------------------------------------------------
c90ac396 116 maker = new AliAnaPartCorrMaker();
d92b41ad 117 maker->SetReader(reader);//pointer to reader
118 maker->AddAnalysis(ana,0);
119 //maker->AddAnalysis(ana2,1);
3e0577a2 120 maker->SetAnaDebug(-1) ;
d92b41ad 121 maker->SwitchOnHistogramsMaker() ;
122 //maker->SwitchOffHistogramsMaker() ;
3e0577a2 123 maker->SwitchOnAODsMaker() ;
124 //maker->SwitchOffAODsMaker() ;
d92b41ad 125
126 maker->Print("");
127 //
128 printf("======================== \n");
129 printf("END ConfigAnalysis() \n");
130 printf("======================== \n");
131 return maker ;
132}