]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/macros/ConfigAnalysisGammaDirect.C
New more general analysis implemention for particle identification and correlation...
[u/mrichter/AliRoot.git] / PWG4 / macros / ConfigAnalysisGammaDirect.C
1 /* $Id: $ */
2 /* $Log$ */
3
4 //------------------------------------
5 // Configuration macro example:
6 //
7 // Do prompt photon analysis with ESDs
8 // Gamma in PHOS, 
9 // for EMCAL, PHOS by EMCAL where necessary
10 //
11 // Author : Gustavo Conesa Balbastre (INFN-LNF)
12 //------------------------------------
13
14 AliAnaMaker*  ConfigAnalysis()
15 {
16   //
17   // Configuration goes here
18   // 
19   printf("======================== \n");
20   printf("ConfigAnalysis() \n");
21   printf("======================== \n");
22   
23   
24   //Detector Fidutial Cuts
25   AliFidutialCut * fidCut = new AliFidutialCut();
26   fidCut->DoCTSFidutialCut(kTRUE) ;
27   //fidCut->DoEMCALFidutialCut(kFALSE) ;
28   fidCut->DoPHOSFidutialCut(kTRUE) ;
29   
30   fidCut->SetSimpleCTSFidutialCut(0.9,0.,360.);
31   f//idCut->SetSimpleEMCALFidutialCut(0.7,80.,190.);
32   fidCut->SetSimplePHOSFidutialCut(0.13,220.,320.);
33    
34   fidCut->Print("");
35   
36   //-----------------------------------------------------------  
37   // Reader
38   //-----------------------------------------------------------
39   AliCaloTrackReader *reader = new AliCaloTrackESDReader();
40   reader->SetDebug(-1);
41
42   //Switch on or off the detectors information that you want
43   reader->SwitchOffEMCAL();
44   reader->SwitchOnCTS();
45   reader->SwitchOnPHOS();
46   
47   //Min particle pT
48   //reader->SetEMCALPtMin(0.5); 
49   reader->SetPHOSPtMin(0.5);
50   reader->SetCTSPtMin(0.2);
51   
52   reader->SetFidutialCut(fidCut);
53   reader->Print("");
54   
55   
56   //---------------------------------------------------------------------
57   // Analysis algorithm
58   //---------------------------------------------------------------------
59   
60   //Detector Fidutial Cuts for analysis part
61   AliFidutialCut * fidCut2 = new AliFidutialCut();
62   fidCut2->DoCTSFidutialCut(kFALSE) ;
63   //fidCut2->DoEMCALFidutialCut(kTRUE) ;
64   fidCut2->DoPHOSFidutialCut(kFALSE) ;
65   
66   fidCut2->SetSimpleCTSFidutialCut(0.9,0.,360.);
67   //fidCut2->SetSimpleEMCALFidutialCut(0.7,80.,190.);
68   fidCut2->SetSimplePHOSFidutialCut(0.13,220.,320.);
69   fidCut2->Print("");
70
71   AliCaloPID * pid = new AliCaloPID();
72   // use selection with simple weights
73   pid->SetPHOSPhotonWeight(0.7);    pid->SetPHOSPi0Weight(0.7); 
74   pid->SetEMCALPhotonWeight(0.7);    pid->SetEMCALPi0Weight(0.7);
75   // use more complicated selection, particle weight depending on cluster energy
76 //   pid->UsePHOSPIDWeightFormula(kTRUE);
77 //   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))");
78 //   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))");
79 //   pid->SetPHOSPhotonWeightFormula(photonF);
80 //   pid->SetPHOSPi0WeightFormula(pi0F);
81   pid->Print("");
82
83   AliIsolationCut * ic = new AliIsolationCut();
84   ic->SetConeSize(0.4);
85   ic->SetPtThreshold(1.);
86   ic->SetICMethod(AliIsolationCut::kPtThresIC);
87   ic->Print("");
88
89   AliAnaGammaDirect *ana = new AliAnaGammaDirect();
90   ana->SetDebug(-1);
91   ana->SetMinPt(5.);
92   ana->SetCaloPID(pid);
93   ana->SetFidutialCut(fidCut2);
94   ana->SetIsolationCut(ic) ;
95   ana->SetDetector("PHOS");
96   ana->SwitchOnDataMC() ;//Access MC stack and fill more histograms
97
98   ana->SwitchOnCaloPID();
99   ana->SwitchOffCaloPIDRecalculation(); //recommended for EMCAL
100   ana->SwitchOnFidutialCut();
101   //Select clusters with no pair, if both clusters with pi0 mass
102   ana->SwitchOffInvariantMass();
103   //Do isolation cut
104   ana->SwitchOnIsolation();
105
106   //Do or not do isolation with previously produced AODs.
107   //No effect if use of SwitchOnSeveralIsolation()
108   ana->SwitchOffReIsolation();
109
110   //Multiple IC
111   ana->SwitchOffSeveralIsolation() ;
112 //   ana->SwitchOnSeveralIsolation() ;
113 //   ana->SetNCones(2) ;     
114 //   ana->SetNPtThresFrac(2) ;     
115 //   ana->SetConeSizes(0, 0.3) ; ana->SetConeSizes(1, 0.4) ;    
116 //   ana->SetPtThresholds(0, 0.5) ;     ana->SetPtThresholds(1, 1.) ;   
117 //   ana->SetPtFractions(0, 1.) ;   ana->SetPtFractions(1, 1.5) ;  
118
119   ana->Print("");
120
121   //---------------------------------------------------------------------
122   // Set  analysis algorithm and reader
123   //---------------------------------------------------------------------
124   maker = new AliAnaMaker();
125   maker->SetReader(reader);//pointer to reader
126   maker->AddAnalysis(ana,0);
127   maker->SetAODBranchName("Photon");
128   maker->SetAnaDebug(1)  ;
129   maker->SwitchOnHistogramsMaker()  ;
130   //maker->SwitchOffHistogramsMaker() ;  
131   maker->SwitchOnAODsMaker()  ;
132   //maker->SwitchOffAODsMaker() ; 
133   
134   maker->Print("");
135   //
136   printf("======================== \n");
137   printf("END ConfigAnalysis() \n");
138   printf("======================== \n");
139   return maker ;
140 }