Added new background scheeme, did some cleanup. added new bethe block parameters...
[u/mrichter/AliRoot.git] / PWG4 / macros / ConfigAnalysisPi0EbE.C
1 /* $Id: $ */
2 /* $Log$ */
3
4 //------------------------------------
5 // Configuration macro example:
6 //
7 // Do photon identification analysis with ESDs
8 // in EMCAL, after pi0 identification event by event
9 // in photon paris invariant mass and aperture angle widow
10 // For PHOS, change EMCAL by PHOS where necessary
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(kFALSE) ;
28         fidCut->DoEMCALFiducialCut(kFALSE) ;
29         fidCut->DoPHOSFiducialCut(kTRUE) ;
30         
31         //fidCut->SetSimpleCTSFiducialCut(0.9,0.,360.);
32         //fidCut->SetSimpleEMCALFiducialCut(0.7,80.,190.);
33         fidCut->SetSimplePHOSFiducialCut(0.12,220.,320.);
34         
35         fidCut->Print("");
36         
37         
38         //-----------------------------------------------------------  
39         // Reader
40         //-----------------------------------------------------------
41         AliCaloTrackESDReader *reader = new AliCaloTrackESDReader();
42         reader->SetDebug(-1);//10 for lots of messages
43         
44         //Switch on or off the detectors information that you want
45         reader->SwitchOnEMCAL();
46         reader->SwitchOnCTS();
47         reader->SwitchOffPHOS();
48         
49         //Min particle pT
50         //reader->SetEMCALPtMin(0.5); 
51         reader->SetPHOSPtMin(0.5);
52         //reader->SetCTSPtMin(0.2);
53         
54         reader->SetFiducialCut(fidCut);
55         
56         //     //We want tracks fitted in the detectors:
57         //     ULong_t status=AliAODTrack::kTPCrefit;
58         //     status|=AliAODTrack::kITSrefit; //(default settings)
59         
60         //     We want tracks whose PID bit is set:
61         //     ULong_t status =AliAODTrack::kITSpid;
62         //     status|=AliAODTrack::kTPCpid;    
63         
64         //      reader->SetTrackStatus(status);
65         
66         //Remove the temporal AODs we create.   
67         reader->SwitchOnCleanStdAOD();  
68         
69         reader->Print("");
70         
71         
72         //---------------------------------------------------------------------
73         // Analysis algorithm
74         //---------------------------------------------------------------------
75         
76         AliCaloPID * pid = new AliCaloPID();
77         // use selection with simple weights
78         pid->SetEMCALPhotonWeight(0.7);    pid->SetEMCALPi0Weight(0.7);
79         
80         pid->SetDispersionCut(1.5);
81         pid->SetTOFCut(5.e-9);
82         pid->SetDebug(-1);
83         pid->Print("");
84
85         AliAnaPhoton *anaphoton = new AliAnaPhoton();
86         anaphoton->SetDebug(-1); //10 for lots of messages
87         anaphoton->SetMinPt(1);
88         anaphoton->SetMinDistanceToBadChannel(2, 4, 5);
89         anaphoton->SetCaloPID(pid);
90         //anaphoton->SetFiducialCut(fidCut2); //More acceptance selections if needed at this level
91         anaphoton->SetCalorimeter("EMCAL");
92         anaphoton->SwitchOffDataMC() ;//Access MC stack and fill more histograms
93         anaphoton->SwitchOffCaloPID();
94         anaphoton->SwitchOffCaloPIDRecalculation(); //recommended for EMCAL
95         anaphoton->SwitchOffFiducialCut();
96         anaphoton->SetOutputAODName("Photons");
97         anaphoton->SetOutputAODClassName("AliAODPWG4Particle");
98         //Set Histrograms bins and ranges
99 //      anaphoton->SetHistoPtRangeAndNBins(0, 50, 100) ;
100 //      anaphoton->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
101 //      anaphoton->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;   anaphoton->Print("");
102
103         //Detector Fiducial Cuts
104         AliFiducialCut * fidCut2 = new AliFiducialCut();
105         fidCut2->DoPHOSFiducialCut(kTRUE) ;
106         fidCut2->SetSimplePHOSFiducialCut(0.12,220.,320.);
107         
108         fidCut->Print("");
109         
110         // >>> Second Analysis <<<
111         
112         AliNeutralMesonSelection *nms = new AliNeutralMesonSelection();
113         nms->SetInvMassCutRange(0.10, 0.17)     ;
114         nms->KeepNeutralMesonSelectionHistos(kTRUE);
115         //Set Histrograms bins and ranges
116 //      nms->SetHistoERangeAndNBins(0, 50, 100) ;
117 //      nms->SetHistoPtRangeAndNBins(0, 50, 100) ;
118 //      nms->SetHistoAngleRangeAndNBins(0, 0.3, 100) ;
119 //      nsm->SetHistoIMRangeAndNBins(0, 0.4, 100) ;  
120
121         AliAnaPi0EbE *anapi0 = new AliAnaPi0EbE();
122         anapi0->SetDebug(-1);//10 for lots of messages
123         anapi0->SetAnalysisType(AliAnaPi0EbE::kIMCalo);
124         anapi0->SetInputAODName("Photons");
125         anapi0->SetOutputAODName("Pi0s");
126         anapi0->SetOutputAODClassName("AliAODPWG4Particle");
127         anapi0->SwitchOnDataMC() ;//Access MC stack and fill more histograms
128         anapi0->SetNeutralMesonSelection(nms);
129         //Set Histrograms bins and ranges
130 //      anapi0->SetHistoPtRangeAndNBins(0, 50, 100) ;
131 //      anapi0->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
132 //      anapi0->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;
133         anapi0->Print("");
134         
135         //---------------------------------------------------------------------
136         // Set  analysis algorithm and reader
137         //---------------------------------------------------------------------
138         maker = new AliAnaPartCorrMaker();
139         maker->SetReader(reader);//pointer to reader
140         maker->AddAnalysis(anaphoton,0);
141         maker->AddAnalysis(anapi0,1);
142         maker->SetAnaDebug(-1)  ;
143         maker->SwitchOnHistogramsMaker()  ;
144         maker->SwitchOnAODsMaker()  ;
145         
146         maker->Print("");
147         //
148         printf("======================== \n");
149         printf("END ConfigAnalysis() \n");
150         printf("======================== \n");
151         return maker ;
152 }