]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/macros/ConfigAnalysisPhotonESD.C
adding TPC cosntrained tracks back in for comparison
[u/mrichter/AliRoot.git] / PWG4 / macros / ConfigAnalysisPhotonESD.C
1 /* $Id: $ */
2 /* $Log$ */
3
4 //------------------------------------
5 // Configuration macro example:
6 //
7 // Do photon identification analysis with ESDs
8 // Gamma in PHOS. For EMCAL clusters change 
9 // 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(kFALSE) ;
29   
30   //fidCut->SetSimpleCTSFiducialCut(0.9,0.,360.);
31   //fidCut->SetSimpleEMCALFiducialCut(0.7,80.,190.);
32   //fidCut->SetSimplePHOSFiducialCut(0.13,220.,320.);
33    
34   fidCut->Print("");
35   
36   //-----------------------------------------------------------  
37   // Reader
38   //-----------------------------------------------------------
39   AliCaloTrackESDReader *reader = new AliCaloTrackESDReader();
40   reader->SetDebug(-1);
41
42   //Switch on or off the detectors information that you want
43   reader->SwitchOffEMCAL();
44   reader->SwitchOffCTS();
45   reader->SwitchOnPHOS();
46   
47   //Min particle pT
48   //reader->SetEMCALPtMin(0.5); 
49   reader->SetPHOSPtMin(0.5);
50   //reader->SetCTSPtMin(0.2);
51   reader->SwitchOnStack(); //On by default, remember to SwitchOnMCData() in analysis classes
52   //In case of generating jet events (with PYTHIA), if pt hard bin is small
53   //reject events with large difference between ptHard and triggered jet        
54   //reader->SetPtHardAndJetPtComparison(kTRUE);
55         
56   reader->SetFiducialCut(fidCut);
57
58   // Analysis with tracks, select only tracks with
59   // following bits
60         
61   //     //We want tracks fitted in the detectors:
62   //     ULong_t status=AliAODTrack::kTPCrefit;
63   //     status|=AliAODTrack::kITSrefit;
64     
65   //     We want tracks whose PID bit is set:
66   //     ULong_t status =AliAODTrack::kITSpid;
67   //     status|=AliAODTrack::kTPCpid;  
68         
69   //    reader->SetTrackStatus(status);
70         
71   reader->SwitchOnCleanStdAOD();
72         
73   reader->Print("");
74   
75   
76   //---------------------------------------------------------------------
77   // Analysis algorithm
78   //---------------------------------------------------------------------
79   
80   //Detector Fiducial Cuts for analysis part
81   AliFiducialCut * fidCut2 = new AliFiducialCut();
82   fidCut2->DoCTSFiducialCut(kFALSE) ;
83   fidCut2->DoEMCALFiducialCut(kFALSE) ;
84   fidCut2->DoPHOSFiducialCut(kFALSE) ;
85   
86   //fidCut2->SetSimpleCTSFiducialCut(0.9,0.,360.);
87   //fidCut2->SetSimpleEMCALFiducialCut(0.7,80.,190.);
88   //fidCut2->SetSimplePHOSFiducialCut(0.13,220.,320.);
89
90   fidCut2->Print("");
91
92   AliCaloPID * pid = new AliCaloPID();
93   // use selection with simple weights
94   pid->SetPHOSPhotonWeight(0.7);    pid->SetPHOSPi0Weight(0.7); 
95   // use more complicated selection, particle weight depending on cluster energy
96 //   pid->UsePHOSPIDWeightFormula(kTRUE);
97 //   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))");
98 //   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))");
99 //   pid->SetPHOSPhotonWeightFormula(photonF);
100 //   pid->SetPHOSPi0WeightFormula(pi0F);
101
102   pid->SetDispersionCut(1.5);
103   pid->SetTOFCut(5.e-9);
104   pid->SetDebug(-1);
105   pid->Print("");
106
107   AliAnaPhoton *ana = new AliAnaPhoton();
108   ana->SetDebug(-1);
109   ana->SetMinPt(5.);
110   ana->SetMinDistanceToBadChannel(2, 4, 5);
111   ana->SetCaloPID(pid);
112   ana->SetFiducialCut(fidCut2);
113   ana->SetCalorimeter("PHOS");
114   ana->SwitchOnDataMC() ;//Access MC stack and fill more histograms
115   ana->SwitchOffCaloPID();
116   ana->SwitchOffCaloPIDRecalculation(); //recommended for EMCAL
117   ana->SwitchOnTrackMatchRejection(); //Only in use when OnCaloPID
118   ana->SwitchOffFiducialCut();
119   ana->SetOutputAODName("Photons");
120   ana->SetOutputAODClassName("AliAODPWG4Particle");
121   //Set Histrograms bins and ranges
122 //      ana->SetHistoPtRangeAndNBins(0, 50, 100) ;
123 //      ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
124 //      ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;
125   ana->Print("");
126
127   //---------------------------------------------------------------------
128   // Set  analysis algorithm and reader
129   //---------------------------------------------------------------------
130   maker = new AliAnaPartCorrMaker();
131   maker->SetReader(reader);//pointer to reader
132   maker->AddAnalysis(ana,0);
133   maker->SetAnaDebug(-1)  ;
134   maker->SwitchOnHistogramsMaker()  ;
135   maker->SwitchOnAODsMaker()  ;
136   
137   maker->Print("");
138   //
139   printf("======================== \n");
140   printf("END ConfigAnalysis() \n");
141   printf("======================== \n");
142   return maker ;
143 }