]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/macros/ConfigAnalysisGammaHadronCorrelation.C
1) Added protection in correlation analysis classes, input AOD must be of the type...
[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 Fidutial Cuts
26         AliFidutialCut * fidCut = new AliFidutialCut();
27         fidCut->DoCTSFidutialCut(kTRUE) ;
28         fidCut->DoEMCALFidutialCut(kTRUE) ;
29         fidCut->DoPHOSFidutialCut(kTRUE) ;
30         
31         fidCut->SetSimpleCTSFidutialCut(0.9,0.,360.);
32         fidCut->SetSimpleEMCALFidutialCut(0.7,80.,190.);
33         fidCut->SetSimplePHOSFidutialCut(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->SetFidutialCut(fidCut);
57         reader->Print("");
58         
59         
60         //---------------------------------------------------------------------
61         // Analysis algorithm
62         //---------------------------------------------------------------------
63         //<<<< first analysis >>> select the photons
64         //Detector Fidutial Cuts for analysis part
65         AliFidutialCut * fidCut2 = new AliFidutialCut();
66         fidCut2->DoCTSFidutialCut(kFALSE) ;
67         fidCut2->DoEMCALFidutialCut(kTRUE) ;
68         fidCut2->DoPHOSFidutialCut(kFALSE) ;
69         
70         fidCut2->SetSimpleCTSFidutialCut(0.9,0.,360.);
71         fidCut2->SetSimpleEMCALFidutialCut(0.7,80.,190.);
72         fidCut2->SetSimplePHOSFidutialCut(0.13,220.,320.);
73         fidCut2->Print("");
74         
75         AliCaloPID * pid = new AliCaloPID();
76         // use selection with simple weights
77         pid->SetPHOSPhotonWeight(0.7);    pid->SetPHOSPi0Weight(0.7); 
78         pid->SetEMCALPhotonWeight(0.7);    pid->SetEMCALPi0Weight(0.7);
79         
80         pid->Print("");
81         
82         
83         AliAnaPhoton *anaphoton = new AliAnaPhoton();
84         anaphoton->SetDebug(-1); //10 for lots of messages
85         anaphoton->SetMinPt(0.2);
86         anaphoton->SetMinDistanceToBadChannel(2, 4, 5);
87         anaphoton->SetCaloPID(pid);
88         anaphoton->SetFidutialCut(fidCut2); //More acceptance selections if needed at this level
89         anaphoton->SetCalorimeter("PHOS");
90         anaphoton->SwitchOffDataMC() ;//Access MC stack and fill more histograms
91         anaphoton->SwitchOnCaloPID();
92         anaphoton->SwitchOffCaloPIDRecalculation(); //recommended for EMCAL
93         anaphoton->SwitchOnFidutialCut();
94         anaphoton->SetOutputAODName("Photons");
95         anaphoton->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
96         //Set Histrograms bins and ranges
97         //      anaphoton->SetHistoPtRangeAndNBins(0, 50, 100) ;
98         //      anaphoton->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
99         //      anaphoton->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;
100         anaphoton->Print("");
101         
102         // >>>> Second Analysis <<<< Isolate the photons
103         AliIsolationCut * ic = new AliIsolationCut();
104         ic->SetConeSize(0.5);
105         ic->SetPtThreshold(1.);
106         ic->SetICMethod(AliIsolationCut::kPtThresIC);
107         ic->Print("");
108         
109         AliAnaParticleIsolation *anaisol = new AliAnaParticleIsolation();
110         anaisol->SetDebug(-1);
111         anaisol->SetMinPt(5);
112         anaisol->SetInputAODName("Photons");
113         anaisol->SetCalorimeter("PHOS");
114         anaisol->SwitchOffDataMC() ;//Access MC stack and fill more histograms
115         //Select clusters with no pair, if both clusters with pi0 mass
116         anaisol->SwitchOffInvariantMass();
117         //anaisol->SetNeutralMesonSelection(nms);
118         //Do isolation cut
119         anaisol->SetIsolationCut(ic);   
120         //Do or not do isolation with previously produced AODs.
121         //No effect if use of SwitchOnSeveralIsolation()
122         anaisol->SwitchOffReIsolation();
123         //Multiple IC
124         anaisol->SwitchOffSeveralIsolation() ;
125                 
126         anaisol->Print("");
127         
128         //<<<Third analysis>>> Isolated Photon- hadron correlation
129         AliAnaParticleHadronCorrelation *anacorr = new AliAnaParticleHadronCorrelation();
130         anacorr->SetInputAODName("Photons");
131         anacorr->SetOutputAODName("CorrelatedPi0s"+calorimeter);
132         anacorr->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
133         anacorr->SetDebug(-1);
134         anacorr->SetCaloPID(pid);
135         anacorr->SwitchOnCaloPID();
136         anacorr->SwitchOnCaloPIDRecalculation(); //recommended for EMCAL
137         anacorr->SwitchOffFidutialCut();
138         anacorr->SetPtCutRange(1,100);
139         anacorr->SetDeltaPhiCutRange(1.5,4.5);
140         //Set Histrograms bins and ranges
141         //      anaphoton->SetHistoPtRangeAndNBins(0, 50, 100) ;
142         //      anaphoton->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
143         //      anaphoton->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;   
144         anacorr->Print("");
145         
146         //---------------------------------------------------------------------
147         // Set  analysis algorithm and reader
148         //---------------------------------------------------------------------
149         maker = new AliAnaPartCorrMaker();
150         maker->SetReader(reader);//pointer to reader
151         maker->AddAnalysis(anaphoton,0);
152         maker->AddAnalysis(anaisol,1);
153         maker->AddAnalysis(anacorr,2);
154         maker->SetAnaDebug(-1)  ;
155         maker->SwitchOnHistogramsMaker()  ;
156         maker->SwitchOnAODsMaker()  ;
157         
158         maker->Print("");
159         //
160         printf("======================== \n");
161         printf("END ConfigAnalysis() \n");
162         printf("======================== \n");
163         return maker ;
164 }
165