]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/macros/ConfigAnalysisPi0.C
bugfix: implementing function SendMLFromDet added as pure virtual in r43691
[u/mrichter/AliRoot.git] / PWG4 / macros / ConfigAnalysisPi0.C
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
14 AliAnaPartCorrMaker*  ConfigAnalysis()
15 {
16         //
17         // Configuration goes here
18         // 
19         printf("======================== \n");
20         printf("ConfigAnalysis() \n");
21         printf("======================== \n");
22         
23         
24         //Detector Fiducial Cuts
25         AliFiducialCut * fidCut = new AliFiducialCut();
26         fidCut->DoCTSFiducialCut(kFALSE) ;
27         fidCut->DoEMCALFiducialCut(kFALSE) ;
28         fidCut->DoPHOSFiducialCut(kTRUE) ;
29         
30         //fidCut->SetSimpleCTSFiducialCut(0.9,0.,360.);
31         //fidCut->SetSimpleEMCALFiducialCut(0.7,80.,190.);
32         fidCut->SetSimplePHOSFiducialCut(0.12,220.,320.);
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();
45         reader->SwitchOffCTS();
46         reader->SwitchOffPHOS();
47         
48         //Min particle pT
49         //reader->SetEMCALPtMin(0.5); 
50         //reader->SetPHOSPtMin(0.5);
51         //reader->SetCTSPtMin(0.2);
52         
53         reader->SetFiducialCut(fidCut);
54         
55         //Remove the temporal AODs we create.   
56         reader->SwitchOnCleanStdAOD();  
57         
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);
85         //anaphoton->SetFiducialCut(fidCut2); //More acceptance selections if needed at this level
86         anaphoton->SetCalorimeter("EMCAL");
87         anaphoton->SwitchOffDataMC() ;//Access MC stack and fill more histograms
88         anaphoton->SwitchOffCaloPID();
89         anaphoton->SwitchOffCaloPIDRecalculation(); //recommended for EMCAL
90         anaphoton->SwitchOffFiducialCut();
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         
98         //Detector Fiducial Cuts
99         AliFiducialCut * fidCut2 = new AliFiducialCut();
100         fidCut2->DoPHOSFiducialCut(kTRUE) ;
101         fidCut2->SetSimplePHOSFiducialCut(0.12,220.,320.);
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
112         anapi0->SetNMaxEvMix(2);//Maximal number of events for mixing
113         anapi0->SetCalorimeter("EMCAL");
114         anapi0->SetFiducialCut(fidCut2); //More acceptance selections if needed at this level. Not used if real geometry
115         anapi0->SwitchOnFiducialCut();
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 }