adding the option for hybrid tracks global+global constrained as well as global+TPC...
[u/mrichter/AliRoot.git] / PWG4 / macros / ConfigAnalysisPi0.C
CommitLineData
3e0577a2 1/* $Id: $ */
2/* $Log$ */
3
4//------------------------------------
5// Configuration macro example:
6//
7// Do photon identification analysis with ESDs
8// in PHOS, after, pi0 identification with Invariant mass.
9// For EMCAL, change PHOS by EMCAL where necessary
10//
11// Author : Gustavo Conesa Balbastre (INFN-LNF)
12//------------------------------------
13
14AliAnaPartCorrMaker* ConfigAnalysis()
15{
16 //
17 // Configuration goes here
18 //
19 printf("======================== \n");
20 printf("ConfigAnalysis() \n");
21 printf("======================== \n");
22
23
ff45398a 24 //Detector Fiducial Cuts
25 AliFiducialCut * fidCut = new AliFiducialCut();
26 fidCut->DoCTSFiducialCut(kFALSE) ;
27 fidCut->DoEMCALFiducialCut(kFALSE) ;
28 fidCut->DoPHOSFiducialCut(kTRUE) ;
3e0577a2 29
ff45398a 30 //fidCut->SetSimpleCTSFiducialCut(0.9,0.,360.);
31 //fidCut->SetSimpleEMCALFiducialCut(0.7,80.,190.);
32 fidCut->SetSimplePHOSFiducialCut(0.12,220.,320.);
3e0577a2 33
34 fidCut->Print("");
35
36
37 //-----------------------------------------------------------
38 // Reader
39 //-----------------------------------------------------------
40 AliCaloTrackESDReader *reader = new AliCaloTrackESDReader();
41 reader->SetDebug(-1);//10 for lots of messages
42
43 //Switch on or off the detectors information that you want
44 reader->SwitchOnEMCAL();
591cc579 45 reader->SwitchOffCTS();
46 reader->SwitchOffPHOS();
3e0577a2 47
48 //Min particle pT
49 //reader->SetEMCALPtMin(0.5);
591cc579 50 //reader->SetPHOSPtMin(0.5);
3e0577a2 51 //reader->SetCTSPtMin(0.2);
52
ff45398a 53 reader->SetFiducialCut(fidCut);
1caab52d 54
55 //Remove the temporal AODs we create.
08a064bc 56 reader->SwitchOnCleanStdAOD();
1caab52d 57
3e0577a2 58 reader->Print("");
59
60
61 //---------------------------------------------------------------------
62 // Analysis algorithm
63 //---------------------------------------------------------------------
64
65 AliCaloPID * pid = new AliCaloPID();
66 // use selection with simple weights
67 pid->SetPHOSPhotonWeight(0.7); pid->SetPHOSPi0Weight(0.7);
68 // use more complicated selection, particle weight depending on cluster energy
69 // pid->UsePHOSPIDWeightFormula(kTRUE);
70 // 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))");
71 // 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))");
72 // pid->SetPHOSPhotonWeightFormula(photonF);
73 // pid->SetPHOSPi0WeightFormula(pi0F);
74
75 pid->SetDispersionCut(1.5);
76 pid->SetTOFCut(5.e-9);
77 pid->SetDebug(-1);
78 pid->Print("");
79
80 AliAnaPhoton *anaphoton = new AliAnaPhoton();
81 anaphoton->SetDebug(-1); //10 for lots of messages
82 anaphoton->SetMinPt(1);
83 anaphoton->SetMinDistanceToBadChannel(2, 4, 5);
84 anaphoton->SetCaloPID(pid);
ff45398a 85 //anaphoton->SetFiducialCut(fidCut2); //More acceptance selections if needed at this level
591cc579 86 anaphoton->SetCalorimeter("EMCAL");
3e0577a2 87 anaphoton->SwitchOffDataMC() ;//Access MC stack and fill more histograms
88 anaphoton->SwitchOffCaloPID();
89 anaphoton->SwitchOffCaloPIDRecalculation(); //recommended for EMCAL
ff45398a 90 anaphoton->SwitchOffFiducialCut();
3e0577a2 91 anaphoton->SetOutputAODName("Photons");
92 anaphoton->SetOutputAODClassName("AliAODPWG4Particle");
93 //Set Histrograms bins and ranges
94// anaphoton->SetHistoPtRangeAndNBins(0, 50, 100) ;
95// anaphoton->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
96// anaphoton->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ; anaphoton->Print("");
97
ff45398a 98 //Detector Fiducial Cuts
99 AliFiducialCut * fidCut2 = new AliFiducialCut();
100 fidCut2->DoPHOSFiducialCut(kTRUE) ;
101 fidCut2->SetSimplePHOSFiducialCut(0.12,220.,320.);
3e0577a2 102
103 fidCut->Print("");
104
105 AliAnaPi0 *anapi0 = new AliAnaPi0();
106 anapi0->SetDebug(-1);//10 for lots of messages
107 anapi0->SetInputAODName("Photons");
108 anapi0->SetCaloPID(pid);
109// anapi0->SetNCentrBin(5); //number of bins in centrality
110// anapi0->SetNZvertBin(5); //number of bins for vertex position
111// anapi0->SetNRPBin(6); //number of bins in reaction plain
591cc579 112 anapi0->SetNMaxEvMix(2);//Maximal number of events for mixing
113 anapi0->SetCalorimeter("EMCAL");
ff45398a 114 anapi0->SetFiducialCut(fidCut2); //More acceptance selections if needed at this level. Not used if real geometry
115 anapi0->SwitchOnFiducialCut();
3e0577a2 116 anapi0->SwitchOnDataMC() ;//Access MC stack and fill more histograms
117 anapi0->Print("");
118
119 //---------------------------------------------------------------------
120 // Set analysis algorithm and reader
121 //---------------------------------------------------------------------
122 maker = new AliAnaPartCorrMaker();
123 maker->SetReader(reader);//pointer to reader
124 maker->AddAnalysis(anaphoton,0);
125 maker->AddAnalysis(anapi0,1);
126 maker->SetAnaDebug(-1) ;
127 maker->SwitchOnHistogramsMaker() ;
128 maker->SwitchOnAODsMaker() ;
129
130 maker->Print("");
131 //
132 printf("======================== \n");
133 printf("END ConfigAnalysis() \n");
134 printf("======================== \n");
135 return maker ;
136}