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