]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/macros/ConfigAnalysisGammaHadronCorrelation.C
Add the efficiency estimation to common FF task.
[u/mrichter/AliRoot.git] / PWG4 / macros / ConfigAnalysisGammaHadronCorrelation.C
1 /* $Id: $ */
2 /* $Log$ */
3
4 //------------------------------------
5 // Configuration macro example:
6 //
7 // Do prompt photon - hadron correlation analysis with ESDs
8 // First find photons with AliAnaPhoton, then
9 // isolate them with AliAnaParticleIsolation and finally correlate 
10 // them with AliAnaParticleHadronCorrelation
11 //
12 // Author : Gustavo Conesa Balbastre (INFN-LNF)
13 //------------------------------------
14
15 AliAnaPartCorrMaker*  ConfigAnalysis()
16 {
17         //
18         // Configuration goes here
19         // 
20         printf("======================== \n");
21         printf("ConfigAnalysis() \n");
22         printf("======================== \n");
23         
24         
25         //Detector Fiducial Cuts
26         AliFiducialCut * fidCut = new AliFiducialCut();
27         fidCut->DoCTSFiducialCut(kTRUE) ;
28         fidCut->DoEMCALFiducialCut(kTRUE) ;
29         fidCut->DoPHOSFiducialCut(kTRUE) ;
30         
31         fidCut->SetSimpleCTSFiducialCut(0.9,0.,360.);
32         fidCut->SetSimpleEMCALFiducialCut(0.7,80.,190.);
33         fidCut->SetSimplePHOSFiducialCut(0.13,220.,320.);
34         
35         fidCut->Print("");
36         
37         //-----------------------------------------------------------  
38         // Reader
39         //-----------------------------------------------------------
40         AliCaloTrackESDReader *reader = new AliCaloTrackESDReader();
41         reader->SetDebug(-1);
42         
43         //Switch on or off the detectors information that you want
44         reader->SwitchOnEMCAL();
45         reader->SwitchOnCTS();
46         reader->SwitchOnPHOS();
47         reader->SwitchOffEMCALCells();
48         reader->SwitchOffPHOSCells();
49         
50         
51         //Min particle pT
52         reader->SetEMCALPtMin(0.5); 
53         reader->SetPHOSPtMin(0.5);
54         reader->SetCTSPtMin(0.2);
55         
56         reader->SetFiducialCut(fidCut);
57         
58         //     //We want tracks fitted in the detectors:
59         //     ULong_t status=AliAODTrack::kTPCrefit;
60         //     status|=AliAODTrack::kITSrefit; //(default settings)
61         
62         //     We want tracks whose PID bit is set:
63         //     ULong_t status =AliAODTrack::kITSpid;
64         //     status|=AliAODTrack::kTPCpid;    
65         
66         //      reader->SetTrackStatus(status);
67         
68         //Remove the temporal AODs we create.   
69         reader->SwitchOnCleanStdAOD();  
70         
71         reader->Print("");
72         
73         
74         //---------------------------------------------------------------------
75         // Analysis algorithm
76         //---------------------------------------------------------------------
77         //<<<< first analysis >>> select the photons
78         //Detector Fiducial Cuts for analysis part
79         AliFiducialCut * fidCut2 = new AliFiducialCut();
80         fidCut2->DoCTSFiducialCut(kFALSE) ;
81         fidCut2->DoEMCALFiducialCut(kTRUE) ;
82         fidCut2->DoPHOSFiducialCut(kFALSE) ;
83         
84         fidCut2->SetSimpleCTSFiducialCut(0.9,0.,360.);
85         fidCut2->SetSimpleEMCALFiducialCut(0.7,80.,190.);
86         fidCut2->SetSimplePHOSFiducialCut(0.13,220.,320.);
87         fidCut2->Print("");
88         
89         AliCaloPID * pid = new AliCaloPID();
90         // use selection with simple weights
91         pid->SetPHOSPhotonWeight(0.7);    pid->SetPHOSPi0Weight(0.7); 
92         pid->SetEMCALPhotonWeight(0.7);    pid->SetEMCALPi0Weight(0.7);
93         
94         pid->Print("");
95         
96         
97         AliAnaPhoton *anaphoton = new AliAnaPhoton();
98         anaphoton->SetDebug(-1); //10 for lots of messages
99         anaphoton->SetMinPt(0.2);
100         anaphoton->SetMinDistanceToBadChannel(2, 4, 5);
101         anaphoton->SetCaloPID(pid);
102         anaphoton->SetFiducialCut(fidCut2); //More acceptance selections if needed at this level
103         anaphoton->SetCalorimeter("PHOS");
104         anaphoton->SwitchOffDataMC() ;//Access MC stack and fill more histograms
105         anaphoton->SwitchOnCaloPID();
106         anaphoton->SwitchOffCaloPIDRecalculation(); //recommended for EMCAL
107         anaphoton->SwitchOnFiducialCut();
108         anaphoton->SetOutputAODName("Photons");
109         anaphoton->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
110         //Set Histrograms bins and ranges
111         //      anaphoton->SetHistoPtRangeAndNBins(0, 50, 100) ;
112         //      anaphoton->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
113         //      anaphoton->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;
114         anaphoton->Print("");
115         
116         // >>>> Second Analysis <<<< Isolate the photons
117         AliIsolationCut * ic = new AliIsolationCut();
118         ic->SetConeSize(0.5);
119         ic->SetPtThreshold(1.);
120         ic->SetICMethod(AliIsolationCut::kPtThresIC);
121         ic->Print("");
122         
123         AliAnaParticleIsolation *anaisol = new AliAnaParticleIsolation();
124         anaisol->SetDebug(-1);
125         anaisol->SetMinPt(5);
126         anaisol->SetInputAODName("Photons");
127         anaisol->SetCalorimeter("PHOS");
128         anaisol->SwitchOffDataMC() ;//Access MC stack and fill more histograms
129         //Select clusters with no pair, if both clusters with pi0 mass
130         anaisol->SwitchOffInvariantMass();
131         //anaisol->SetNeutralMesonSelection(nms);
132         //Do isolation cut
133         anaisol->SetIsolationCut(ic);   
134         //Do or not do isolation with previously produced AODs.
135         //No effect if use of SwitchOnSeveralIsolation()
136         anaisol->SwitchOffReIsolation();
137         //Multiple IC
138         anaisol->SwitchOffSeveralIsolation() ;
139                 
140         anaisol->Print("");
141         
142         //<<<Third analysis>>> Isolated Photon- hadron correlation
143         AliAnaParticleHadronCorrelation *anacorr = new AliAnaParticleHadronCorrelation();
144         anacorr->SetInputAODName("Photons");
145         anacorr->SetOutputAODName("CorrelatedPi0s"+calorimeter);
146         anacorr->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
147         anacorr->SetDebug(-1);
148         anacorr->SetCaloPID(pid);
149         anacorr->SwitchOnCaloPID();
150         anacorr->SwitchOnCaloPIDRecalculation(); //recommended for EMCAL
151         anacorr->SwitchOffFiducialCut();
152         anacorr->SetPtCutRange(1,100);
153         anacorr->SetDeltaPhiCutRange(1.5,4.5);
154         //Set Histrograms bins and ranges
155         //      anaphoton->SetHistoPtRangeAndNBins(0, 50, 100) ;
156         //      anaphoton->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
157         //      anaphoton->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;   
158         anacorr->Print("");
159         
160         //---------------------------------------------------------------------
161         // Set  analysis algorithm and reader
162         //---------------------------------------------------------------------
163         maker = new AliAnaPartCorrMaker();
164         maker->SetReader(reader);//pointer to reader
165         maker->AddAnalysis(anaphoton,0);
166         maker->AddAnalysis(anaisol,1);
167         maker->AddAnalysis(anacorr,2);
168         maker->SetAnaDebug(-1)  ;
169         maker->SwitchOnHistogramsMaker()  ;
170         maker->SwitchOnAODsMaker()  ;
171         
172         maker->Print("");
173         //
174         printf("======================== \n");
175         printf("END ConfigAnalysis() \n");
176         printf("======================== \n");
177         return maker ;
178 }
179