4 //------------------------------------
5 // Configuration macro example:
7 // Do prompt photon analysis with ESDs
9 // for EMCAL, PHOS by EMCAL where necessary
10 // First find photons with AliAnaPhoton, then
11 // isolate them with AliAnaParticleIsolation
13 // Author : Gustavo Conesa Balbastre (INFN-LNF)
14 //------------------------------------
16 AliAnaPartCorrMaker* ConfigAnalysis()
19 // Configuration goes here
21 printf("======================== \n");
22 printf("ConfigAnalysis() \n");
23 printf("======================== \n");
26 //Detector Fiducial Cuts
27 AliFiducialCut * fidCut = new AliFiducialCut();
28 fidCut->DoCTSFiducialCut(kFALSE) ;
29 fidCut->DoEMCALFiducialCut(kFALSE) ;
30 fidCut->DoPHOSFiducialCut(kFALSE) ;
32 //fidCut->SetSimpleCTSFiducialCut(0.9,0.,360.);
33 //fidCut->SetSimpleEMCALFiducialCut(0.7,80.,190.);
34 //fidCut->SetSimplePHOSFiducialCut(0.13,220.,320.);
38 //-----------------------------------------------------------
40 //-----------------------------------------------------------
41 AliCaloTrackESDReader *reader = new AliCaloTrackESDReader();
44 //Switch on or off the detectors information that you want
45 reader->SwitchOffEMCAL();
46 reader->SwitchOnCTS();
47 reader->SwitchOnPHOS();
50 reader->SetEMCALPtMin(0.2);
51 reader->SetPHOSPtMin(0.2);
52 reader->SetCTSPtMin(0.2);
54 reader->SetFiducialCut(fidCut);
56 // //We want tracks fitted in the detectors:
57 // ULong_t status=AliAODTrack::kTPCrefit;
58 // status|=AliAODTrack::kITSrefit; //(default settings)
60 // We want tracks whose PID bit is set:
61 // ULong_t status =AliAODTrack::kITSpid;
62 // status|=AliAODTrack::kTPCpid;
64 // reader->SetTrackStatus(status);
66 //Remove the temporal AODs we create.
67 reader->SwitchOnCleanStdAOD();
72 //---------------------------------------------------------------------
74 //---------------------------------------------------------------------
75 //>>>> First Analysis <<<<
76 //Detector Fiducial Cuts for analysis part
77 AliFiducialCut * fidCut2 = new AliFiducialCut();
78 fidCut2->DoCTSFiducialCut(kFALSE) ;
79 fidCut2->DoEMCALFiducialCut(kFALSE) ;
80 fidCut2->DoPHOSFiducialCut(kFALSE) ;
82 //fidCut2->SetSimpleCTSFiducialCut(0.9,0.,360.);
83 //fidCut2->SetSimpleEMCALFiducialCut(0.7,80.,190.);
84 fidCut2->SetSimplePHOSFiducialCut(0.12,220.,320.);
86 // //Select particles in N regions of the detectors
87 // Float_t etamax[]={0.67,0.51,0.16,-0.21,-0.61};
88 // TArrayF etamaxarr(5,etamax);
89 // fidCut2->AddEMCALFidCutMaxEtaArray(etamaxarr);
90 // Float_t etamin[]={0.61,0.21,-0.16,-0.51,-0.67};
91 // TArrayF etaminarr(5,etamin);
92 // fidCut2->AddEMCALFidCutMinEtaArray(etaminarr);
93 // Float_t phimax[]={99., 119., 139., 159., 179., 189.};
94 // TArrayF phimaxarr(6,phimax);
95 // fidCut2->AddEMCALFidCutMaxPhiArray(phimaxarr);
96 // Float_t phimin[]={81., 101. , 121. , 141. , 161. , 181. };
97 // TArrayF phiminarr(6,phimin);
98 // fidCut2->AddEMCALFidCutMinPhiArray(phiminarr);
99 // fidCut2->Print("");
101 AliCaloPID * pid = new AliCaloPID();
102 // use selection with simple weights
103 pid->SetPHOSPhotonWeight(0.7); pid->SetPHOSPi0Weight(0.7);
104 pid->SetEMCALPhotonWeight(0.7); pid->SetEMCALPi0Weight(0.7);
105 // use more complicated selection, particle weight depending on cluster energy
106 // pid->UsePHOSPIDWeightFormula(kTRUE);
107 // 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))");
108 // 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))");
109 // pid->SetPHOSPhotonWeightFormula(photonF);
110 // pid->SetPHOSPi0WeightFormula(pi0F);
114 AliAnaPhoton *anaphoton = new AliAnaPhoton();
115 anaphoton->SetDebug(-1); //10 for lots of messages
116 anaphoton->SetMinPt(0.2);
117 anaphoton->SetMinDistanceToBadChannel(2, 4, 5);
118 anaphoton->SetCaloPID(pid);
119 anaphoton->SetFiducialCut(fidCut2); //More acceptance selections if needed at this level
120 anaphoton->SetCalorimeter("PHOS");
121 anaphoton->SwitchOffDataMC() ;//Access MC stack and fill more histograms
122 anaphoton->SwitchOnCaloPID();
123 anaphoton->SwitchOffCaloPIDRecalculation(); //recommended for EMCAL
124 anaphoton->SwitchOnFiducialCut();
125 anaphoton->SetOutputAODName("Photons");
126 anaphoton->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
127 //Set Histrograms bins and ranges
128 // anaphoton->SetHistoPtRangeAndNBins(0, 50, 100) ;
129 // anaphoton->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
130 // anaphoton->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;
131 anaphoton->Print("");
133 // >>>> Second Analysis <<<< Isolate the photons
134 AliIsolationCut * ic = new AliIsolationCut();
135 ic->SetConeSize(0.5);
136 ic->SetPtThreshold(1.);
137 ic->SetICMethod(AliIsolationCut::kPtThresIC);
140 AliAnaParticleIsolation *anaisol = new AliAnaParticleIsolation();
141 anaisol->SetDebug(-1);
142 anaisol->SetMinPt(5);
143 anaisol->SetInputAODName("Photons");
144 anaisol->SetCalorimeter("PHOS");
145 anaisol->SwitchOffDataMC() ;//Access MC stack and fill more histograms
146 //Select clusters with no pair, if both clusters with pi0 mass
147 anaisol->SwitchOffInvariantMass();
148 //anaisol->SetNeutralMesonSelection(nms);
150 anaisol->SetIsolationCut(ic);
151 //Do or not do isolation with previously produced AODs.
152 //No effect if use of SwitchOnSeveralIsolation()
153 anaisol->SwitchOffReIsolation();
155 anaisol->SwitchOffSeveralIsolation() ;
160 //---------------------------------------------------------------------
161 // Set analysis algorithm and reader
162 //---------------------------------------------------------------------
163 maker = new AliAnaPartCorrMaker();
164 maker->SetReader(reader);//pointer to reader
165 maker->AddAnalysis(anaphoton,0);
166 maker->AddAnalysis(anaisol,1);
167 maker->SetAnaDebug(-1) ;
168 maker->SwitchOnHistogramsMaker() ;
169 //maker->SwitchOffHistogramsMaker() ;
170 maker->SwitchOnAODsMaker() ;
171 //maker->SwitchOffAODsMaker() ;
175 printf("======================== \n");
176 printf("END ConfigAnalysis() \n");
177 printf("======================== \n");