]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/macros/ConfigAnalysisPhotonMC.C
Added OADB as external library dependency to ANALYSISalice. OADB will get automatical...
[u/mrichter/AliRoot.git] / PWG4 / macros / ConfigAnalysisPhotonMC.C
1 /* $Id: $ */
2 /* $Log$ */
3
4 //------------------------------------
5 // Configuration macro example:
6 //
7 // Do photon identification analysis with Generator data
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(kTRUE) ;
27   fidCut->DoEMCALFiducialCut(kTRUE) ;
28   fidCut->DoPHOSFiducialCut(kTRUE) ;
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   AliCaloTrackMCReader *reader = new AliCaloTrackMCReader();
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   //Anaysis of final particles, not pi0/eta etc.
59   TArrayI statusArray(1) ;
60   statusArray.SetAt(1,0); 
61   reader->AddStatusArray(statusArray)  ;
62   reader->SwitchOnStatusSelection() ;
63
64   //Keep pi0 in the list and not the 2 photon if decay angle is small.
65   reader->SwitchOffOverlapCheck();              
66
67   //Remove the temporal AODs we create. 
68   reader->SwitchOnCleanStdAOD();        
69         
70   reader->Print("");
71   
72   
73   //---------------------------------------------------------------------
74   // Analysis algorithm
75   //---------------------------------------------------------------------
76   
77   //Detector Fiducial Cuts for analysis part
78   AliFiducialCut * fidCut2 = new AliFiducialCut();
79   fidCut2->DoCTSFiducialCut(kFALSE) ;
80   fidCut2->DoEMCALFiducialCut(kFALSE) ;
81   fidCut2->DoPHOSFiducialCut(kFALSE) ;
82   
83   //fidCut2->SetSimpleCTSFiducialCut(0.9,0.,360.);
84   //fidCut2->SetSimpleEMCALFiducialCut(0.7,80.,190.);
85   //fidCut2->SetSimplePHOSFiducialCut(0.13,220.,320.);
86
87   fidCut2->Print("");
88
89   AliAnaPhoton *ana = new AliAnaPhoton();
90   ana->SetDebug(-1);
91   ana->SetMinPt(5.);
92   ana->SetMinDistanceToBadChannel(2, 4, 5);
93   ana->SetFiducialCut(fidCut2);
94   ana->SetCalorimeter("PHOS");
95   ana->SwitchOnDataMC() ;//Access MC stack and fill more histograms
96   ana->SwitchOffCaloPID(); //No need with MC reader
97   ana->SwitchOffCaloPIDRecalculation(); //recommended for EMCAL, no need with MC reader
98   ana->SwitchOffTrackMatchRejection(); //Only in use when OnCaloPID
99   ana->SwitchOffFiducialCut();
100   ana->SetOutputAODName("Photons");
101   ana->SetOutputAODClassName("AliAODPWG4Particle");
102   //Set Histrograms bins and ranges
103 //      ana->SetHistoPtRangeAndNBins(0, 50, 100) ;
104 //      ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
105 //      ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;
106   ana->Print("");
107
108   //---------------------------------------------------------------------
109   // Set  analysis algorithm and reader
110   //---------------------------------------------------------------------
111   maker = new AliAnaPartCorrMaker();
112   maker->SetReader(reader);//pointer to reader
113   maker->AddAnalysis(ana,0);
114   maker->SetAnaDebug(-1)  ;
115   maker->SwitchOnHistogramsMaker()  ;
116   maker->SwitchOnAODsMaker()  ;
117   
118   maker->Print("");
119   //
120   printf("======================== \n");
121   printf("END ConfigAnalysis() \n");
122   printf("======================== \n");
123   return maker ;
124 }