1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
17 /* History of cvs commits:
23 //_________________________________________________________________________
24 // Class for the analysis of gamma-jet correlations
25 // Basically it seaches for a prompt photon in the Calorimeters acceptance,
26 // if so we construct a jet around the highest pt particle in the opposite
27 // side in azimuth, inside the Central Tracking System (ITS+TPC) and
28 // EMCAL acceptances (only when PHOS detects the gamma). First the leading
29 // particle and then the jet have to fullfill several conditions
30 // (energy, direction ..) to be accepted. Then the fragmentation function
31 // of this jet is constructed
32 // Class created from old AliPHOSGammaJet
33 // (see AliRoot versions previous Release 4-09)
35 //*-- Author: Gustavo Conesa (LNF-INFN)
36 //////////////////////////////////////////////////////////////////////////////
39 // --- ROOT system ---
42 #include <TParticle.h>
45 #include "AliAnaGammaJet.h"
47 #include "AliESDtrack.h"
48 #include "AliESDCaloCluster.h"
49 #include "Riostream.h"
52 ClassImp(AliAnaGammaJet)
54 //____________________________________________________________________________
55 AliAnaGammaJet::AliAnaGammaJet(const char *name) :
56 AliAnaGammaDirect(name),
57 fSeveralConeAndPtCuts(0),
60 fEtaEMCALCut(0.),fPhiMaxCut(0.),
62 fInvMassMaxCut(0.), fInvMassMinCut(0.),
63 fJetCTSRatioMaxCut(0.),
64 fJetCTSRatioMinCut(0.), fJetRatioMaxCut(0.),
65 fJetRatioMinCut(0.), fNCone(0),
66 fNPt(0), fCone(0), fPtThreshold(0),
67 fPtJetSelectionCut(0.0),
68 fAngleMaxParam(), fSelect(0)
72 fAngleMaxParam.Set(4) ;
73 fAngleMaxParam.Reset(0.);
75 for(Int_t i = 0; i<10; i++){
79 fNamePtThres[i] = "" ;
92 fPhiEMCALCut[i] = 0.0 ;
97 TList * list = gDirectory->GetListOfKeys() ;
101 for (index = 0 ; index < list->GetSize()-1 ; index++) {
102 //-1 to avoid GammaJet Task
103 h = dynamic_cast<TH2F*>(gDirectory->Get(list->At(index)->GetName())) ;
104 fOutputContainer->Add(h) ;
107 // Input slot #0 works with an Ntuple
108 DefineInput(0, TChain::Class());
109 // Output slot #0 writes into a TH1 container
110 DefineOutput(0, TObjArray::Class()) ;
115 //____________________________________________________________________________
116 AliAnaGammaJet::AliAnaGammaJet(const AliAnaGammaJet & gj) :
117 AliAnaGammaDirect(gj),
118 fSeveralConeAndPtCuts(gj.fSeveralConeAndPtCuts),
119 fPbPb(gj.fPbPb), fJetsOnlyInCTS(gj.fJetsOnlyInCTS),
120 fEtaEMCALCut(gj.fEtaEMCALCut),
121 fPhiMaxCut(gj.fPhiMaxCut), fPhiMinCut(gj.fPhiMinCut),
122 fInvMassMaxCut(gj.fInvMassMaxCut), fInvMassMinCut(gj.fInvMassMinCut),
123 fRatioMinCut(gj.fRatioMinCut),
124 fJetCTSRatioMaxCut(gj.fJetCTSRatioMaxCut),
125 fJetCTSRatioMinCut(gj.fJetCTSRatioMinCut), fJetRatioMaxCut(gj.fJetRatioMaxCut),
126 fJetRatioMinCut(gj.fJetRatioMinCut), fNCone(gj.fNCone),
127 fNPt(gj.fNPt), fCone(gj.fCone), fPtThreshold(gj.fPtThreshold),
128 fPtJetSelectionCut(gj.fPtJetSelectionCut),
129 fOutputContainer(0), fAngleMaxParam(gj.fAngleMaxParam),
133 SetName (gj.GetName()) ;
134 SetTitle(gj.GetTitle()) ;
136 for(Int_t i = 0; i<10; i++){
137 fCones[i] = gj.fCones[i] ;
138 fNameCones[i] = gj.fNameCones[i] ;
139 fPtThres[i] = gj.fPtThres[i] ;
140 fNamePtThres[i] = gj.fNamePtThres[i] ;
142 fJetXMin1[i] = gj.fJetXMin1[i] ;
143 fJetXMin2[i] = gj.fJetXMin2[i] ;
144 fJetXMax1[i] = gj.fJetXMax1[i] ;
145 fJetXMax2[i] = gj.fJetXMax2[i] ;
146 fBkgMean[i] = gj.fBkgMean[i] ;
147 fBkgRMS[i] = gj.fBkgRMS[i] ;
149 fJetE1[i] = gj.fJetE1[i] ;
150 fJetE2[i] = gj.fJetE2[i] ;
151 fJetSigma1[i] = gj.fJetSigma1[i] ;
152 fJetSigma2[i] = gj.fJetSigma2[i] ;
153 fPhiEMCALCut[i] = gj.fPhiEMCALCut[i] ;
159 //____________________________________________________________________________
160 AliAnaGammaJet::~AliAnaGammaJet()
162 // Remove all pointers
163 fOutputContainer->Clear() ;
164 delete fOutputContainer ;
166 delete fhChargeRatio ;
168 delete fhDeltaPhiCharge ;
169 delete fhDeltaPhiPi0 ;
170 delete fhDeltaEtaCharge ;
171 delete fhDeltaEtaPi0 ;
173 delete fhAnglePairAccepted ;
174 delete fhAnglePairNoCut ;
175 delete fhAnglePairLeadingCut ;
176 delete fhAnglePairAngleCut ;
177 delete fhAnglePairAllCut ;
178 delete fhAnglePairLeading ;
179 delete fhInvMassPairNoCut ;
180 delete fhInvMassPairLeadingCut ;
181 delete fhInvMassPairAngleCut ;
182 delete fhInvMassPairAllCut ;
183 delete fhInvMassPairLeading ;
191 delete fhJetFragment ;
192 delete fhBkgFragment ;
196 delete [] fhJetRatios;
198 delete [] fhBkgRatios;
201 delete [] fhNLeadings;
205 delete [] fhJetFragments;
206 delete [] fhBkgFragments;
207 delete [] fhJetPtDists;
208 delete [] fhBkgPtDists;
212 //____________________________________________________________________________
213 Double_t AliAnaGammaJet::CalculateJetRatioLimit(const Double_t ptg,
217 //Parametrized cut for the energy of the jet.
219 Double_t epp = par[0] + par[1] * ptg ;
220 Double_t spp = par[2] + par[3] * ptg ;
221 Double_t f = x[0] + x[1] * ptg ;
222 Double_t epb = epp + par[4] ;
223 Double_t spb = TMath::Sqrt(spp*spp+ par[5]*par[5]) ;
224 Double_t rat = (epb - spb * f) / ptg ;
225 //Info("CalculateLimit","epp %f, spp %f, f %f", epp, spp, f);
226 //Info("CalculateLimit","epb %f, spb %f, rat %f", epb, spb, rat);
231 //____________________________________________________________________________
232 void AliAnaGammaJet::Exec(Option_t *)
235 // Processing of one event
238 Long64_t entry = GetChain()->GetReadEntry() ;
241 AliError("fESD is not connected to the input!") ;
246 AliInfo(Form("%s ----> Processing event # %lld", (dynamic_cast<TChain *>(GetChain()))->GetFile()->GetName(), entry)) ;
248 //CreateTLists with arrays of TParticles. Filled with particles only relevant for the analysis.
250 TClonesArray * particleList = new TClonesArray("TParticle",1000); // All particles refitted in CTS and detected in EMCAL (jet)
251 TClonesArray * plCTS = new TClonesArray("TParticle",1000); // All particles refitted in Central Tracking System (ITS+TPC)
252 TClonesArray * plNe = new TClonesArray("TParticle",1000); // All particles measured in Jet Calorimeter
253 TClonesArray * plCalo = new TClonesArray("TParticle",1000); // All particles measured in Prompt Gamma calorimeter
256 TParticle *pGamma = new TParticle(); //It will contain the kinematics of the found prompt gamma
257 TParticle *pLeading = new TParticle(); //It will contain the kinematics of the found leading particle
259 Bool_t iIsInPHOSorEMCAL = kFALSE ; //To check if Gamma was in any calorimeter
261 //Fill lists with photons, neutral particles and charged particles
262 //look for the highest energy photon in the event inside fCalorimeter
263 AliDebug(2, "Fill particle lists, get prompt gamma");
265 //Fill particle lists
267 if(GetCalorimeter() == "PHOS")
268 CreateParticleList(particleList, plCTS,plNe,plCalo);
269 else if(GetCalorimeter() == "EMCAL")
270 CreateParticleList(particleList, plCTS,plCalo,plNe);
272 AliError("No calorimeter selected");
274 //Search highest energy prompt gamma in calorimeter
275 GetPromptGamma(plCalo, plCTS, pGamma, iIsInPHOSorEMCAL) ;
277 AliDebug(1, Form("Is Gamma in %s? %d",GetCalorimeter().Data(),iIsInPHOSorEMCAL));
278 AliDebug(3,Form("Charged list entries %d, Neutral list entries %d, %s list entries %d",
279 plCTS->GetEntries(),plNe->GetEntries(), GetCalorimeter().Data(), plCalo->GetEntries()));
281 //If there is any prompt photon in fCalorimeter,
282 //search jet leading particle
284 if(iIsInPHOSorEMCAL){
286 AliInfo(Form("Prompt Gamma: pt %f, phi %f, eta %f", pGamma->Pt(),pGamma->Phi(),pGamma->Eta())) ;
288 AliDebug(2, "Get Leading Particles, Make jet");
290 //Search leading particles in CTS and EMCAL
291 if(GetLeadingParticle(plCTS, plNe, pGamma, pLeading)){
293 AliInfo(Form("Leading: pt %f, phi %f, eta %f", pLeading->Pt(),pLeading->Phi(),pLeading->Eta())) ;
296 if(!fSeveralConeAndPtCuts)
297 MakeJet(particleList,pGamma,pLeading,"");
299 for(Int_t icone = 0; icone<fNCone; icone++) {
300 for(Int_t ipt = 0; ipt<fNPt;ipt++) {
301 TString lastname ="Cone"+ fNameCones[icone]+"Pt"+ fNamePtThres[ipt];
302 MakeJet(particleList, pGamma, pLeading,lastname);
305 }//fSeveralConeAndPtCuts
309 AliDebug(2, "End of analysis, delete pointers");
311 particleList->Delete() ;
321 delete particleList ;
325 PostData(0, fOutputContainer);
328 //____________________________________________________________________________
329 void AliAnaGammaJet::FillJetHistos(TClonesArray * pl, Double_t ptg, Double_t ptl, TString type, TString lastname)
331 //Fill histograms wth jet fragmentation
332 //and number of selected jets and leading particles
333 //and the background multiplicity
334 TParticle * particle = 0 ;
339 while ( (particle = dynamic_cast<TParticle*>(next())) ) {
341 Double_t pt = particle->Pt();
343 charge = TDatabasePDG::Instance()
344 ->GetParticle(particle->GetPdgCode())->Charge();
345 if(charge != 0){//Only jet Charged particles
347 (fOutputContainer->FindObject(type+"Fragment"+lastname))
350 (fOutputContainer->FindObject(type+"PtDist"+lastname))
358 (fOutputContainer->FindObject("NBkg"+lastname))
362 (fOutputContainer->FindObject("NJet"+lastname))->
365 (fOutputContainer->FindObject("NLeading"+lastname))
371 //____________________________________________________________________________
372 void AliAnaGammaJet::GetLeadingCharge(TClonesArray * pl, TParticle * pGamma, TParticle * pLeading) const
374 //Search for the charged particle with highest with
375 //Phi=Phi_gamma-Pi and pT=0.1E_gamma
377 Double_t phi = -100.;
379 for(Int_t ipr = 0;ipr < pl->GetEntries() ; ipr ++ ){
381 TParticle * particle = dynamic_cast<TParticle *>(pl->At(ipr)) ;
383 Double_t ptl = particle->Pt();
384 Double_t rat = ptl/pGamma->Pt() ;
385 Double_t phil = particle->Phi() ;
386 Double_t phig = pGamma->Phi();
388 //Selection within angular and energy limits
389 if(((phig-phil)> fPhiMinCut) && ((phig-phil)<fPhiMaxCut) &&
390 (rat > fRatioMinCut) && (rat < fRatioMaxCut) && (ptl > pt)) {
393 pLeading->SetMomentum(particle->Px(),particle->Py(),particle->Pz(),particle->Energy());
394 AliDebug(4,Form("Charge in CTS: pt %f eta %f phi %f pt/Eg %f \n", pt, particle->Eta(), phi,rat)) ;
398 AliDebug(3,Form("Leading in CTS: pt %f eta %f phi %f pt/Eg %f \n", pt, pLeading->Eta(), phi,pt/pGamma->Pt())) ;
403 //____________________________________________________________________________
404 void AliAnaGammaJet::GetLeadingPi0(TClonesArray * pl, TParticle * pGamma, TParticle * pLeading)
407 //Search for the neutral pion with highest with
408 //Phi=Phi_gamma-Pi and pT=0.1E_gamma
410 Double_t phi = -100.;
411 Double_t ptl = -100.;
412 Double_t rat = -100.;
413 Double_t phil = -100. ;
414 Double_t ptg = pGamma->Pt();
415 Double_t phig = pGamma->Phi();
418 TParticle * particle = 0;
421 TLorentzVector gammai,gammaj;
422 Double_t angle = 0., e = 0., invmass = 0.;
423 Double_t anglef = 0., ef = 0., invmassf = 0.;
427 while ( (particle = (TParticle*)next()) ) {
430 ksPdg = particle->GetPdgCode();
431 ptl = particle->Pt();
432 if(ksPdg == 111){ //2 gamma overlapped, found with PID
434 phil = particle->Phi() ;
435 //Selection within angular and energy limits
436 if((ptl> pt)&& (rat > fRatioMinCut) && (rat < fRatioMaxCut) &&
437 ((phig-phil)>fPhiMinCut)&&((phig-phil)<fPhiMaxCut)){
440 pLeading->SetMomentum(particle->Px(),particle->Py(),particle->Pz(),particle->Energy());
441 AliDebug(4,Form("Pi0 candidate: pt %f eta %f phi %f pt/Eg %f \n", pLeading->Pt(), pLeading->Eta(), pLeading->Phi(), pLeading->Pt()/pGamma->Pt())) ;
444 else if(ksPdg == 22){//1 gamma
445 //Search the photon companion in case it comes from a Pi0 decay
446 //Apply several cuts to select the good pair
447 particle->Momentum(gammai);
450 while ( (particle = (TParticle*)next2()) ) {
452 if(jPrimary>iPrimary){
453 ksPdg = particle->GetPdgCode();
456 particle->Momentum(gammaj);
457 //Info("GetLeadingPi0","Egammai %f, Egammaj %f",
458 //gammai.Pt(),gammaj.Pt());
459 ptl = (gammai+gammaj).Pt();
460 phil = (gammai+gammaj).Phi();
462 phil+=TMath::TwoPi();
464 invmass = (gammai+gammaj).M();
465 angle = gammaj.Angle(gammai.Vect());
466 //Info("GetLeadingPi0","Angle %f", angle);
467 e = (gammai+gammaj).E();
468 //Fill histograms with no cuts applied.
469 fhAnglePairNoCut->Fill(e,angle);
470 fhInvMassPairNoCut->Fill(ptg,invmass);
471 //First cut on the energy and azimuth of the pair
472 if((rat > fRatioMinCut) && (rat < fRatioMaxCut) &&
473 ((phig-phil)>fPhiMinCut)&&((phig-phil)<fPhiMaxCut)){
475 fhAnglePairLeadingCut->Fill(e,angle);
476 fhInvMassPairLeadingCut->Fill(ptg,invmass);
477 //Second cut on the aperture of the pair
478 if(IsAngleInWindow(angle,e)){
479 fhAnglePairAngleCut->Fill(e,angle);
480 fhInvMassPairAngleCut->Fill(ptg,invmass);
482 //Info("GetLeadingPi0","InvMass %f", invmass);
483 //Third cut on the invariant mass of the pair
484 if((invmass>fInvMassMinCut) && (invmass<fInvMassMaxCut)){
485 fhInvMassPairAllCut->Fill(ptg,invmass);
486 fhAnglePairAllCut->Fill(e,angle);
493 pLeading->SetMomentum(particle->Px(),particle->Py(),particle->Pz(),particle->Energy());
494 AliDebug(4,Form("Pi0 candidate: pt %f eta %f phi %f pt/Eg %f \n", pLeading->Pt(), pLeading->Eta(), pLeading->Phi(), pLeading->Pt()/pGamma->Pt())) ;
497 }//(invmass>0.125) && (invmass<0.145)
498 }//gammaj.Angle(gammai.Vect())<0.04
506 if(ef > 0.){//Final pi0 found, highest pair energy, fill histograms
507 fhInvMassPairLeading->Fill(ptg,invmassf);
508 fhAnglePairLeading->Fill(ef,anglef);
511 AliDebug(3,Form("Leading EMCAL: pt %f eta %f phi %f pt/Eg %f \n", pLeading->Pt(), pLeading->Eta(), pLeading->Phi(), pLeading->Pt()/pGamma->Pt())) ;
514 //____________________________________________________________________________
515 Bool_t AliAnaGammaJet::GetLeadingParticle(TClonesArray * plCTS, TClonesArray * plNe,
516 TParticle * pGamma, TParticle * pLeading)
518 //Search Charged or Neutral leading particle, select the highest one.
520 TParticle * pLeadingCh = new TParticle();
521 TParticle * pLeadingPi0 = new TParticle();
523 Double_t ptg = pGamma->Pt();
524 Double_t phig = pGamma->Phi();
525 Double_t etag = pGamma->Eta();
527 if(GetCalorimeter() == "PHOS" && !fJetsOnlyInCTS)
529 AliDebug(3, "GetLeadingPi0");
530 GetLeadingPi0 (plNe, pGamma, pLeadingPi0) ;
531 AliDebug(3, "GetLeadingCharge");
532 GetLeadingCharge(plCTS, pGamma, pLeadingCh) ;
534 Double_t ptch = pLeadingCh->Pt();
535 Double_t phich = pLeadingCh->Phi();
536 Double_t etach = pLeadingCh->Eta();
537 Double_t ptpi = pLeadingPi0->Pt();
538 Double_t phipi = pLeadingPi0->Phi();
539 Double_t etapi = pLeadingPi0->Eta();
541 //Is leading cone inside EMCAL acceptance?
543 Bool_t insidech = kFALSE ;
544 if((phich - fCone) > fPhiEMCALCut[0] &&
545 (phich + fCone) < fPhiEMCALCut[1] &&
546 (etach-fCone) < fEtaEMCALCut )
549 Bool_t insidepi = kFALSE ;
550 if((phipi - fCone) > fPhiEMCALCut[0] &&
551 (phipi + fCone) < fPhiEMCALCut[1] &&
552 (etapi-fCone) < fEtaEMCALCut )
555 AliDebug(2,Form("Leading: charged pt %f, pi0 pt %f",ptch,ptpi)) ;
557 if (ptch > 0 || ptpi > 0)
559 if(insidech && (ptch > ptpi))
562 AliInfo("Leading found in CTS");
563 pLeading->SetMomentum(pLeadingCh->Px(),pLeadingCh->Py(),pLeadingCh->Pz(),pLeadingCh->Energy());
564 AliDebug(3,Form("Final leading found in CTS, pt %f, phi %f, eta %f",ptch,phich,etach)) ;
565 fhChargeRatio->Fill(ptg,ptch/pGamma->Pt());
566 fhDeltaPhiCharge->Fill(ptg,pGamma->Phi()-phich);
567 fhDeltaEtaCharge->Fill(ptg,pGamma->Eta()-etach);
571 else if((ptpi > ptch) && insidepi)
574 AliInfo("Leading found in EMCAL");
575 pLeading->SetMomentum(pLeadingPi0->Px(),pLeadingPi0->Py(),pLeadingPi0->Pz(),pLeadingPi0->Energy());
576 AliDebug(3,Form("Final leading found in EMCAL, pt %f, phi %f, eta %f",ptpi,phipi,etapi)) ;
577 fhPi0Ratio ->Fill(ptg,ptpi/ptg);
578 fhDeltaPhiPi0->Fill(ptg,phig-phipi);
579 fhDeltaEtaPi0->Fill(ptg,etag-etapi);
584 AliDebug(3,"NO LEADING PARTICLE FOUND");}
588 AliDebug(3,"NO LEADING PARTICLE FOUND");
595 //No calorimeter present for Leading particle detection
596 GetLeadingCharge(plCTS, pGamma, pLeading) ;
597 Double_t ptch = pLeading->Pt();
598 Double_t phich = pLeading->Phi();
599 Double_t etach = pLeading->Eta();
601 fhChargeRatio->Fill(ptg,ptch/ptg);
602 fhDeltaPhiCharge->Fill(ptg,phig-phich);
603 fhDeltaEtaCharge->Fill(ptg,etag-etach);
604 AliDebug(3,Form("Leading found : pt %f, phi %f, eta %f",ptch,phich,etach)) ;
609 AliDebug(3,"NO LEADING PARTICLE FOUND");
615 //____________________________________________________________________________
616 void AliAnaGammaJet::Init(const Option_t * )
618 // // Initialisation of branch container
619 AliAnaGammaDirect::Init();
621 //Initialize the parameters of the analysis.
622 //fCalorimeter="PHOS";
623 fAngleMaxParam.Set(4) ;
624 fAngleMaxParam.AddAt(0.4,0);//={0.4,-0.25,0.025,-2e-4};
625 fAngleMaxParam.AddAt(-0.25,1) ;
626 fAngleMaxParam.AddAt(0.025,2) ;
627 fAngleMaxParam.AddAt(-2e-4,3) ;
628 fSeveralConeAndPtCuts = kFALSE ;
629 //fPrintInfo = kTRUE;
631 fInvMassMaxCut = 0.16 ;
632 fInvMassMinCut = 0.11 ;
633 //fJetsOnlyInCTS = kTRUE ;
635 fPhiEMCALCut[0] = 80. *TMath::Pi()/180.;
636 fPhiEMCALCut[1] = 190.*TMath::Pi()/180.;
640 //Jet selection parameters
644 fJetRatioMaxCut = 1.2 ;
645 fJetRatioMinCut = 0.3 ;
646 fJetsOnlyInCTS = kFALSE ;
647 fJetCTSRatioMaxCut = 1.2 ;
648 fJetCTSRatioMinCut = 0.3 ;
651 //Cut depending on gamma energy
653 fPtJetSelectionCut = 20.; //For Low pt jets+BKG, another limits applied
654 //Reconstructed jet energy dependence parameters
655 //e_jet = a1+e_gamma b2.
656 //Index 0-> Pt>2 GeV r = 0.3; Index 1-> Pt>0.5 GeV r = 0.3
657 fJetE1[0] = -5.75; fJetE1[1] = -4.1;
658 fJetE2[0] = 1.005; fJetE2[1] = 1.05;
660 //Reconstructed sigma of jet energy dependence parameters
661 //s_jet = a1+e_gamma b2.
662 //Index 0-> Pt>2 GeV r = 0.3; Index 1-> Pt>0.5 GeV r = 0.3
663 fJetSigma1[0] = 2.65; fJetSigma1[1] = 2.75;
664 fJetSigma2[0] = 0.0018; fJetSigma2[1] = 0.033;
666 //Background mean energy and RMS
667 //Index 0-> No BKG; Index 1-> BKG > 2 GeV;
668 //Index 2-> (low pt jets)BKG > 0.5 GeV;
669 //Index > 2, same for CTS conf
670 fBkgMean[0] = 0.; fBkgMean[1] = 8.8 ; fBkgMean[2] = 69.5;
671 fBkgMean[3] = 0.; fBkgMean[4] = 6.4; fBkgMean[5] = 48.6;
672 fBkgRMS[0] = 0.; fBkgRMS[1] = 7.5; fBkgRMS[2] = 22.0;
673 fBkgRMS[3] = 0.; fBkgRMS[4] = 5.4; fBkgRMS[5] = 13.2;
675 //Factor x of min/max = E -+ x * sigma. Obtained after selecting the
676 //limits for monoenergetic jets.
677 //Index 0-> No BKG; Index 1-> BKG > 2 GeV;
678 //Index 2-> (low pt jets) BKG > 0.5 GeV;
679 //Index > 2, same for CTS conf
681 fJetXMin1[0] =-0.69 ; fJetXMin1[1] = 0.39 ; fJetXMin1[2] =-0.88 ;
682 fJetXMin1[3] =-2.0 ; fJetXMin1[4] =-0.442 ; fJetXMin1[5] =-1.1 ;
683 fJetXMin2[0] = 0.066; fJetXMin2[1] = 0.038; fJetXMin2[2] = 0.034;
684 fJetXMin2[3] = 0.25 ; fJetXMin2[4] = 0.113; fJetXMin2[5] = 0.077 ;
685 fJetXMax1[0] =-3.8 ; fJetXMax1[1] =-0.76 ; fJetXMax1[2] =-3.6 ;
686 fJetXMax1[3] =-2.7 ; fJetXMax1[4] =-1.21 ; fJetXMax1[5] =-3.7 ;
687 fJetXMax2[0] =-0.012; fJetXMax2[1] =-0.022; fJetXMax2[2] = 0.016;
688 fJetXMax2[3] =-0.024; fJetXMax2[4] =-0.008; fJetXMax2[5] = 0.027;
691 //Different cones and pt thresholds to construct the jet
697 fCones[1] = 0.2 ; fNameCones[1] = "02" ;
698 fPtThres[0] = 0.0 ; fNamePtThres[0] = "00" ;
699 fCones[0] = 0.3 ; fNameCones[0] = "03" ;
700 fPtThres[1] = 0.5 ; fNamePtThres[1] = "05" ;
701 fCones[2] = 0.4 ; fNameCones[2] = "04" ;
702 fPtThres[2] = 1.0 ; fNamePtThres[2] = "10" ;
703 //Fill particle lists when PID is ok
704 // fEMCALPID = kFALSE;
705 // fPHOSPID = kFALSE;
707 //Initialization of histograms
713 //__________________________________________________________________________-
714 Bool_t AliAnaGammaJet::IsAngleInWindow(const Float_t angle,const Float_t e) {
715 //Check if the opening angle of the candidate pairs is inside
716 //our selection windowd
718 Bool_t result = kFALSE;
719 Double_t mpi0 = 0.1349766;
720 Double_t max = fAngleMaxParam.At(0)*TMath::Exp(fAngleMaxParam.At(1)*e)
721 +fAngleMaxParam.At(2)+fAngleMaxParam.At(3)*e;
722 Double_t arg = (e*e-2*mpi0*mpi0)/(e*e);
723 Double_t min = 100. ;
725 min = TMath::ACos(arg);
727 if((angle<max)&&(angle>=min))
733 //__________________________________________________________________________-
734 Bool_t AliAnaGammaJet::IsJetSelected(const Double_t ptg, const Double_t ptj){
735 //Check if the energy of the reconstructed jet is within an energy window
746 //Phythia alone, jets with pt_th > 0.2, r = 0.3
747 par[0] = fJetE1[0]; par[1] = fJetE2[0];
748 //Energy of the jet peak
749 //e_jet = fJetE1[0]+fJetE2[0]*e_gamma, simulation fit
750 par[2] = fJetSigma1[0]; par[3] = fJetSigma2[0];
751 //Sigma of the jet peak
752 //sigma_jet = fJetSigma1[0]+fJetSigma2[0]*e_gamma, simulation fit
753 par[4] = fBkgMean[0 + iCTS]; par[5] = fBkgRMS[0 + iCTS];
754 //Parameters reserved for PbPb bkg.
755 xmax[0] = fJetXMax1[0 + iCTS]; xmax[1] = fJetXMax2[0 + iCTS];
756 xmin[0] = fJetXMin1[0 + iCTS]; xmin[1] = fJetXMin2[0 + iCTS];
757 //Factor that multiplies sigma to obtain the best limits,
758 //by observation, of mono jet ratios (ptjet/ptg)
759 //X_jet = fJetX1[0]+fJetX2[0]*e_gamma
763 if(ptg > fPtJetSelectionCut){
764 //Phythia +PbPb with pt_th > 2 GeV/c, r = 0.3
765 par[0] = fJetE1[0]; par[1] = fJetE2[0];
766 //Energy of the jet peak, same as in pp
767 //e_jet = fJetE1[0]+fJetE2[0]*e_gamma, simulation fit
768 par[2] = fJetSigma1[0]; par[3] = fJetSigma2[0];
769 //Sigma of the jet peak, same as in pp
770 //sigma_jet = fJetSigma1[0]+fJetSigma2[0]*e_gamma, simulation fit
771 par[4] = fBkgMean[1 + iCTS]; par[5] = fBkgRMS[1 + iCTS];
772 //Mean value and RMS of PbPb Bkg
773 xmax[0] = fJetXMax1[1 + iCTS]; xmax[1] = fJetXMax2[1 + iCTS];
774 xmin[0] = fJetXMin1[1 + iCTS]; xmin[1] = fJetXMin2[1 + iCTS];
775 //Factor that multiplies sigma to obtain the best limits,
776 //by observation, of mono jet ratios (ptjet/ptg) mixed with PbPb Bkg,
777 //pt_th > 2 GeV, r = 0.3
778 //X_jet = fJetX1[0]+fJetX2[0]*e_gamma
782 //Phythia + PbPb with pt_th > 0.5 GeV/c, r = 0.3
783 par[0] = fJetE1[1]; par[1] = fJetE2[1];
784 //Energy of the jet peak, pt_th > 2 GeV/c, r = 0.3
785 //e_jet = fJetE1[0]+fJetE2[0]*e_gamma, simulation fit
786 par[2] = fJetSigma1[1]; par[3] = fJetSigma2[1];
787 //Sigma of the jet peak, pt_th > 2 GeV/c, r = 0.3
788 //sigma_jet = fJetSigma1[0]+fJetSigma2[0]*e_gamma, simulation fit
789 par[4] = fBkgMean[2 + iCTS]; par[5] = fBkgRMS[2 + iCTS];
790 //Mean value and RMS of PbPb Bkg in a 0.3 cone, pt > 2 GeV.
791 xmax[0] = fJetXMax1[2 + iCTS]; xmax[1] = fJetXMax2[2 + iCTS];
792 xmin[0] = fJetXMin1[2 + iCTS]; xmin[1] = fJetXMin2[2 + iCTS];
793 //Factor that multiplies sigma to obtain the best limits,
794 //by observation, of mono jet ratios (ptjet/ptg) mixed with PbPb Bkg,
795 //pt_th > 2 GeV, r = 0.3
796 //X_jet = fJetX1[0]+fJetX2[0]*e_gamma
798 }//If low pt jet in bkg
801 //Calculate minimum and maximum limits of the jet ratio.
802 Double_t min = CalculateJetRatioLimit(ptg, par, xmin);
803 Double_t max = CalculateJetRatioLimit(ptg, par, xmax);
805 AliDebug(3,Form("Jet selection? : Limits min %f, max %f, pt_jet %f, pt_gamma %f, pt_jet / pt_gamma %f",min,max,ptj,ptg,ptj/ptg));
807 if(( min < ptj/ptg ) && ( max > ptj/ptg))
814 //____________________________________________________________________________
815 void AliAnaGammaJet::MakeHistos()
817 // Create histograms to be saved in output file and
818 // stores them in fOutputContainer
820 fOutputContainer = new TObjArray(10000) ;
822 TObjArray * outputContainer =GetOutputContainer();
823 for(Int_t i = 0; i < outputContainer->GetEntries(); i++ )
824 fOutputContainer->Add(outputContainer->At(i)) ;
827 fhChargeRatio = new TH2F
828 ("ChargeRatio","p_{T leading charge} /p_{T #gamma} vs p_{T #gamma}",
830 fhChargeRatio->SetYTitle("p_{T lead charge} /p_{T #gamma}");
831 fhChargeRatio->SetXTitle("p_{T #gamma} (GeV/c)");
832 fOutputContainer->Add(fhChargeRatio) ;
834 fhDeltaPhiCharge = new TH2F
835 ("DeltaPhiCharge","#phi_{#gamma} - #phi_{charge} vs p_{T #gamma}",
836 200,0,120,200,0,6.4);
837 fhDeltaPhiCharge->SetYTitle("#Delta #phi");
838 fhDeltaPhiCharge->SetXTitle("p_{T #gamma} (GeV/c)");
839 fOutputContainer->Add(fhDeltaPhiCharge) ;
841 fhDeltaEtaCharge = new TH2F
842 ("DeltaEtaCharge","#eta_{#gamma} - #eta_{charge} vs p_{T #gamma}",
844 fhDeltaEtaCharge->SetYTitle("#Delta #eta");
845 fhDeltaEtaCharge->SetXTitle("p_{T #gamma} (GeV/c)");
846 fOutputContainer->Add(fhDeltaEtaCharge) ;
850 fhPi0Ratio = new TH2F
851 ("Pi0Ratio","p_{T leading #pi^{0}} /p_{T #gamma} vs p_{T #gamma}",
853 fhPi0Ratio->SetYTitle("p_{T lead #pi^{0}} /p_{T #gamma}");
854 fhPi0Ratio->SetXTitle("p_{T #gamma} (GeV/c)");
855 fOutputContainer->Add(fhPi0Ratio) ;
857 fhDeltaPhiPi0 = new TH2F
858 ("DeltaPhiPi0","#phi_{#gamma} - #phi_{ #pi^{0}} vs p_{T #gamma}",
859 200,0,120,200,0,6.4);
860 fhDeltaPhiPi0->SetYTitle("#Delta #phi");
861 fhDeltaPhiPi0->SetXTitle("p_{T #gamma} (GeV/c)");
862 fOutputContainer->Add(fhDeltaPhiPi0) ;
864 fhDeltaEtaPi0 = new TH2F
865 ("DeltaEtaPi0","#eta_{#gamma} - #eta_{ #pi^{0}} vs p_{T #gamma}",
867 fhDeltaEtaPi0->SetYTitle("#Delta #eta");
868 fhDeltaEtaPi0->SetXTitle("p_{T #gamma} (GeV/c)");
869 fOutputContainer->Add(fhDeltaEtaPi0) ;
872 fhAnglePair = new TH2F
874 "Angle between #pi^{0} #gamma pair vs p_{T #pi^{0}}",
876 fhAnglePair->SetYTitle("Angle (rad)");
877 fhAnglePair->SetXTitle("E_{ #pi^{0}} (GeV/c)");
878 fOutputContainer->Add(fhAnglePair) ;
880 fhAnglePairAccepted = new TH2F
881 ("AnglePairAccepted",
882 "Angle between #pi^{0} #gamma pair vs p_{T #pi^{0}}, both #gamma in eta<0.7, inside window",
884 fhAnglePairAccepted->SetYTitle("Angle (rad)");
885 fhAnglePairAccepted->SetXTitle("E_{ #pi^{0}} (GeV/c)");
886 fOutputContainer->Add(fhAnglePairAccepted) ;
888 fhAnglePairNoCut = new TH2F
890 "Angle between all #gamma pair vs p_{T #pi^{0}}",200,0,50,200,0,0.2);
891 fhAnglePairNoCut->SetYTitle("Angle (rad)");
892 fhAnglePairNoCut->SetXTitle("E_{ #pi^{0}} (GeV/c)");
893 fOutputContainer->Add(fhAnglePairNoCut) ;
895 fhAnglePairLeadingCut = new TH2F
896 ("AnglePairLeadingCut",
897 "Angle between all #gamma pair that have a good phi and pt vs p_{T #pi^{0}}",
899 fhAnglePairLeadingCut->SetYTitle("Angle (rad)");
900 fhAnglePairLeadingCut->SetXTitle("E_{ #pi^{0}} (GeV/c)");
901 fOutputContainer->Add(fhAnglePairLeadingCut) ;
903 fhAnglePairAngleCut = new TH2F
904 ("AnglePairAngleCut",
905 "Angle between all #gamma pair (angle + leading cut) vs p_{T #pi^{0}}"
906 ,200,0,50,200,0,0.2);
907 fhAnglePairAngleCut->SetYTitle("Angle (rad)");
908 fhAnglePairAngleCut->SetXTitle("E_{ #pi^{0}} (GeV/c)");
909 fOutputContainer->Add(fhAnglePairAngleCut) ;
911 fhAnglePairAllCut = new TH2F
913 "Angle between all #gamma pair (angle + inv mass cut+leading) vs p_{T #pi^{0}}"
914 ,200,0,50,200,0,0.2);
915 fhAnglePairAllCut->SetYTitle("Angle (rad)");
916 fhAnglePairAllCut->SetXTitle("E_{ #pi^{0}} (GeV/c)");
917 fOutputContainer->Add(fhAnglePairAllCut) ;
919 fhAnglePairLeading = new TH2F
921 "Angle between all #gamma pair finally selected vs p_{T #pi^{0}}",
923 fhAnglePairLeading->SetYTitle("Angle (rad)");
924 fhAnglePairLeading->SetXTitle("E_{ #pi^{0}} (GeV/c)");
925 fOutputContainer->Add(fhAnglePairLeading) ;
928 fhInvMassPairNoCut = new TH2F
929 ("InvMassPairNoCut","Invariant Mass of all #gamma pair vs p_{T #gamma}",
930 120,0,120,360,0,0.5);
931 fhInvMassPairNoCut->SetYTitle("Invariant Mass (GeV/c^{2})");
932 fhInvMassPairNoCut->SetXTitle("p_{T #gamma} (GeV/c)");
933 fOutputContainer->Add(fhInvMassPairNoCut) ;
935 fhInvMassPairLeadingCut = new TH2F
936 ("InvMassPairLeadingCut",
937 "Invariant Mass of #gamma pair (leading cuts) vs p_{T #gamma}",
938 120,0,120,360,0,0.5);
939 fhInvMassPairLeadingCut->SetYTitle("Invariant Mass (GeV/c^{2})");
940 fhInvMassPairLeadingCut->SetXTitle("p_{T #gamma} (GeV/c)");
941 fOutputContainer->Add(fhInvMassPairLeadingCut) ;
943 fhInvMassPairAngleCut = new TH2F
944 ("InvMassPairAngleCut",
945 "Invariant Mass of #gamma pair (angle cut) vs p_{T #gamma}",
946 120,0,120,360,0,0.5);
947 fhInvMassPairAngleCut->SetYTitle("Invariant Mass (GeV/c^{2})");
948 fhInvMassPairAngleCut->SetXTitle("p_{T #gamma} (GeV/c)");
949 fOutputContainer->Add(fhInvMassPairAngleCut) ;
951 fhInvMassPairAllCut = new TH2F
952 ("InvMassPairAllCut",
953 "Invariant Mass of #gamma pair (angle+invmass cut+leading) vs p_{T #gamma}",
954 120,0,120,360,0,0.5);
955 fhInvMassPairAllCut->SetYTitle("Invariant Mass (GeV/c^{2})");
956 fhInvMassPairAllCut->SetXTitle("p_{T #gamma} (GeV/c)");
957 fOutputContainer->Add(fhInvMassPairAllCut) ;
959 fhInvMassPairLeading = new TH2F
960 ("InvMassPairLeading",
961 "Invariant Mass of #gamma pair selected vs p_{T #gamma}",
962 120,0,120,360,0,0.5);
963 fhInvMassPairLeading->SetYTitle("Invariant Mass (GeV/c^{2})");
964 fhInvMassPairLeading->SetXTitle("p_{T #gamma} (GeV/c)");
965 fOutputContainer->Add(fhInvMassPairLeading) ;
969 if(!fSeveralConeAndPtCuts){
972 fhNBkg = new TH1F("NBkg","bkg multiplicity",9000,0,9000);
973 fhNBkg->SetYTitle("counts");
974 fhNBkg->SetXTitle("N");
975 fOutputContainer->Add(fhNBkg) ;
977 fhNLeading = new TH2F
978 ("NLeading","Accepted Jet Leading", 240,0,120,240,0,120);
979 fhNLeading->SetYTitle("p_{T charge} (GeV/c)");
980 fhNLeading->SetXTitle("p_{T #gamma}(GeV/c)");
981 fOutputContainer->Add(fhNLeading) ;
983 fhNJet = new TH1F("NJet","Accepted jets",240,0,120);
984 fhNJet->SetYTitle("N");
985 fhNJet->SetXTitle("p_{T #gamma}(GeV/c)");
986 fOutputContainer->Add(fhNJet) ;
988 //Ratios and Pt dist of reconstructed (not selected) jets
990 fhJetRatio = new TH2F
991 ("JetRatio","p_{T jet lead}/p_{T #gamma} vs p_{T #gamma}",
993 fhJetRatio->SetYTitle("p_{T jet lead #pi^{0}}/p_{T #gamma}");
994 fhJetRatio->SetXTitle("p_{T #gamma} (GeV/c)");
995 fOutputContainer->Add(fhJetRatio) ;
998 ("JetPt", "p_{T jet lead} vs p_{T #gamma}",240,0,120,400,0,200);
999 fhJetPt->SetYTitle("p_{T jet}");
1000 fhJetPt->SetXTitle("p_{T #gamma} (GeV/c)");
1001 fOutputContainer->Add(fhJetPt) ;
1005 fhBkgRatio = new TH2F
1006 ("BkgRatio","p_{T bkg lead}/p_{T #gamma} vs p_{T #gamma}",
1007 240,0,120,200,0,10);
1008 fhBkgRatio->SetYTitle("p_{T bkg lead charge}/p_{T #gamma}");
1009 fhBkgRatio->SetXTitle("p_{T #gamma} (GeV/c)");
1010 fOutputContainer->Add(fhBkgRatio) ;
1013 ("BkgPt","p_{T jet lead} vs p_{T #gamma}",240,0,120,400,0,200);
1014 fhBkgPt->SetYTitle("p_{T jet lead charge}/p_{T #gamma}");
1015 fhBkgPt->SetXTitle("p_{T #gamma} (GeV/c)");
1016 fOutputContainer->Add(fhBkgPt) ;
1021 new TH2F("JetFragment","x = p_{T i charged}/p_{T #gamma}",
1022 240,0.,120.,1000,0.,1.2);
1023 fhJetFragment->SetYTitle("x_{T}");
1024 fhJetFragment->SetXTitle("p_{T #gamma}");
1025 fOutputContainer->Add(fhJetFragment) ;
1027 fhBkgFragment = new TH2F
1028 ("BkgFragment","x = p_{T i charged}/p_{T #gamma}",
1029 240,0.,120.,1000,0.,1.2);
1030 fhBkgFragment->SetYTitle("x_{T}");
1031 fhBkgFragment->SetXTitle("p_{T #gamma}");
1032 fOutputContainer->Add(fhBkgFragment) ;
1035 new TH2F("JetPtDist","x = p_{T i charged}",240,0.,120.,400,0.,200.);
1036 fhJetPtDist->SetXTitle("p_{T #gamma} (GeV/c)");
1037 fOutputContainer->Add(fhJetPtDist) ;
1039 fhBkgPtDist = new TH2F
1040 ("BkgPtDist","x = p_{T i charged}",240,0.,120.,400,0.,200.);
1041 fhBkgPtDist->SetXTitle("p_{T #gamma} (GeV/c)");
1042 fOutputContainer->Add(fhBkgPtDist) ;
1046 //If we want to study the jet for different cones and pt
1048 for(Int_t icone = 0; icone<fNCone; icone++){
1049 for(Int_t ipt = 0; ipt<fNPt;ipt++){
1053 fhJetRatios[icone][ipt] = new TH2F
1054 ("JetRatioCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
1055 "p_{T jet lead #pi^{0}}/p_{T #gamma} vs p_{T #gamma}, cone ="
1056 +fNameCones[icone]+", pt>" +fNamePtThres[ipt]+" GeV/c",
1057 240,0,120,200,0,10);
1058 fhJetRatios[icone][ipt]->
1059 SetYTitle("p_{T jet lead #pi^{0}}/p_{T #gamma}");
1060 fhJetRatios[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
1061 fOutputContainer->Add(fhJetRatios[icone][ipt]) ;
1064 fhJetPts[icone][ipt] = new TH2F
1065 ("JetPtCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
1066 "p_{T jet lead #pi^{0}}/p_{T #gamma} vs p_{T #gamma}, cone ="
1067 +fNameCones[icone]+", pt>" +fNamePtThres[ipt]+" GeV/c",
1068 240,0,120,400,0,200);
1069 fhJetPts[icone][ipt]->
1070 SetYTitle("p_{T jet lead #pi^{0}}/p_{T #gamma}");
1071 fhJetPts[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
1072 fOutputContainer->Add(fhJetPts[icone][ipt]) ;
1075 fhBkgRatios[icone][ipt] = new TH2F
1076 ("BkgRatioCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
1077 "p_{T bkg lead #pi^{0}}/p_{T #gamma} vs p_{T #gamma}, cone ="
1078 +fNameCones[icone]+", pt>" +fNamePtThres[ipt]+" GeV/c",
1079 240,0,120,200,0,10);
1080 fhBkgRatios[icone][ipt]->
1081 SetYTitle("p_{T bkg lead #pi^{0}}/p_{T #gamma}");
1082 fhBkgRatios[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
1083 fOutputContainer->Add(fhBkgRatios[icone][ipt]) ;
1085 fhBkgPts[icone][ipt] = new TH2F
1086 ("BkgPtCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
1087 "p_{T jet lead #pi^{0}}/p_{T #gamma} vs p_{T #gamma}, cone ="
1088 +fNameCones[icone]+", pt>" +fNamePtThres[ipt]+" GeV/c",
1089 240,0,120,400,0,200);
1090 fhBkgPts[icone][ipt]->
1091 SetYTitle("p_{T jet lead #pi^{0}}/p_{T #gamma}");
1092 fhBkgPts[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
1093 fOutputContainer->Add(fhBkgPts[icone][ipt]) ;
1096 fhNBkgs[icone][ipt] = new TH1F
1097 ("NBkgCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
1098 "bkg multiplicity cone ="+fNameCones[icone]+", pt>"
1099 +fNamePtThres[ipt]+" GeV/c",9000,0,9000);
1100 fhNBkgs[icone][ipt]->SetYTitle("counts");
1101 fhNBkgs[icone][ipt]->SetXTitle("N");
1102 fOutputContainer->Add(fhNBkgs[icone][ipt]) ;
1104 fhNLeadings[icone][ipt] = new TH2F
1105 ("NLeadingCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
1106 "p_{T #gamma} vs p_{T #pi^{0}} cone ="+fNameCones[icone]+", pt>"
1107 +fNamePtThres[ipt]+" GeV/c",120,0,120,120,0,120);
1108 fhNLeadings[icone][ipt]->SetYTitle("p_{T #pi^{0}}(GeV/c)");
1109 fhNLeadings[icone][ipt]->SetXTitle("p_{T #gamma}(GeV/c)");
1110 fOutputContainer->Add(fhNLeadings[icone][ipt]) ;
1112 fhNJets[icone][ipt] = new TH1F
1113 ("NJetCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
1114 "Number of neutral jets, cone ="+fNameCones[icone]+", pt>"
1115 +fNamePtThres[ipt]+" GeV/c",120,0,120);
1116 fhNJets[icone][ipt]->SetYTitle("N");
1117 fhNJets[icone][ipt]->SetXTitle("p_{T #gamma}(GeV/c)");
1118 fOutputContainer->Add(fhNJets[icone][ipt]) ;
1120 //Fragmentation Function
1121 fhJetFragments[icone][ipt] = new TH2F
1122 ("JetFragmentCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
1123 "x_{T} = p_{T i}/p_{T #gamma}, cone ="+fNameCones[icone]+", pt>"
1124 +fNamePtThres[ipt]+" GeV/c",120,0.,120.,240,0.,1.2);
1125 fhJetFragments[icone][ipt]->SetYTitle("x_{T}");
1126 fhJetFragments[icone][ipt]->SetXTitle("p_{T #gamma}");
1127 fOutputContainer->Add(fhJetFragments[icone][ipt]) ;
1129 fhBkgFragments[icone][ipt] = new TH2F
1130 ("BkgFragmentCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
1131 "x_{T} = p_{T i}/p_{T #gamma}, cone ="+fNameCones[icone]+", pt>"
1132 +fNamePtThres[ipt]+" GeV/c",120,0.,120.,240,0.,1.2);
1133 fhBkgFragments[icone][ipt]->SetYTitle("x_{T}");
1134 fhBkgFragments[icone][ipt]->SetXTitle("p_{T #gamma}");
1135 fOutputContainer->Add(fhBkgFragments[icone][ipt]) ;
1137 //Jet particle distribution
1139 fhJetPtDists[icone][ipt] = new TH2F
1140 ("JetPtDistCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
1141 "p_{T i}, cone ="+fNameCones[icone]+", pt>" +fNamePtThres[ipt]+
1142 " GeV/c",120,0.,120.,120,0.,120.);
1143 fhJetPtDists[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
1144 fOutputContainer->Add(fhJetPtDists[icone][ipt]) ;
1146 fhBkgPtDists[icone][ipt] = new TH2F
1147 ("BkgPtDistCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
1148 "p_{T i}, cone ="+fNameCones[icone]+", pt>" +fNamePtThres[ipt]+
1149 " GeV/c",120,0.,120.,120,0.,120.);
1150 fhBkgPtDists[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
1151 fOutputContainer->Add(fhBkgPtDists[icone][ipt]) ;
1155 }//If we want to study any cone or pt threshold
1158 //____________________________________________________________________________
1159 void AliAnaGammaJet::MakeJet(TClonesArray * pl, TParticle * pGamma, TParticle* pLeading,TString lastname)
1161 //Fill the jet with the particles around the leading particle with
1162 //R=fCone and pt_th = fPtThres. Caclulate the energy of the jet and
1163 //check if we select it. Fill jet histograms
1165 TClonesArray * jetList = new TClonesArray("TParticle",1000);
1166 TClonesArray * bkgList = new TClonesArray("TParticle",1000);
1168 TLorentzVector jet (0,0,0,0);
1169 TLorentzVector bkg(0,0,0,0);
1170 TLorentzVector lv (0,0,0,0);
1172 Double_t ptjet = 0.0;
1173 Double_t ptbkg = 0.0;
1179 Double_t ptg = pGamma->Pt();
1180 Double_t phig = pGamma->Phi();
1181 Double_t ptl = pLeading->Pt();
1182 Double_t phil = pLeading->Phi();
1183 Double_t etal = pLeading->Eta();
1185 Float_t ptcut = 0. ;
1187 if(ptg > fPtJetSelectionCut) ptcut = 2. ;
1192 TParticle * particle = 0 ;
1193 while ( (particle = dynamic_cast<TParticle*>(next())) ) {
1199 SetJet(particle, b0, fCone, etal, phil) ;
1202 new((*jetList)[n0++]) TParticle(*particle) ;
1203 particle->Momentum(lv);
1204 if(particle->Pt() > ptcut ){
1206 ptjet+=particle->Pt();
1210 //Background around (phi_gamma-pi, eta_leading)
1211 SetJet(particle, b1, fCone,etal, phig) ;
1214 new((*bkgList)[n1++]) TParticle(*particle) ;
1215 particle->Momentum(lv);
1216 if(particle->Pt() > ptcut ){
1218 ptbkg+=particle->Pt();
1228 AliDebug(2,Form("Gamma pt %f, Jet pt %f, Bkg pt %f",ptg,ptjet,ptbkg));
1232 Double_t ratjet = ptjet/ptg ;
1233 Double_t ratbkg = ptbkg/ptg ;
1236 (fOutputContainer->FindObject("JetRatio"+lastname))
1239 (fOutputContainer->FindObject("JetPt"+lastname))
1243 (fOutputContainer->FindObject("BkgRatio"+lastname))
1247 (fOutputContainer->FindObject("BkgPt"+lastname))
1252 Bool_t kSelect = kFALSE;
1254 kSelect = kTRUE; //Accept all jets, no restriction
1255 else if(fSelect == 1){
1256 //Selection with parametrized cuts
1257 if(IsJetSelected(ptg,ptjet)) kSelect = kTRUE;
1259 else if(fSelect == 2){
1261 if(!fJetsOnlyInCTS){
1262 if((ratjet < fJetRatioMaxCut) && (ratjet > fJetRatioMinCut )) kSelect = kTRUE;
1265 if((ratjet < fJetCTSRatioMaxCut) && (ratjet > fJetCTSRatioMinCut )) kSelect = kTRUE;
1269 AliError("Jet selection option larger than 2, DONT SELECT JETS");
1274 AliInfo(Form("Jet Selected: pt %f ", ptjet)) ;
1276 FillJetHistos(jetList, ptg, ptl,"Jet",lastname);
1277 FillJetHistos(bkgList, ptg, ptl, "Bkg",lastname);
1286 //____________________________________________________________________________
1287 void AliAnaGammaJet::Print(const Option_t * opt) const
1290 //Print some relevant parameters set for the analysis
1294 Info("Print", "%s %s", GetName(), GetTitle() ) ;
1296 printf("EMCAL Acceptance cut : phi min %f, phi max %f, eta %f \n", fPhiEMCALCut[0], fPhiEMCALCut[1], fEtaEMCALCut) ;
1298 printf("Phi_Leading < %f\n", fPhiMaxCut) ;
1299 printf("Phi_Leading > %f\n", fPhiMinCut) ;
1300 printf("pT Leading / pT Gamma < %f\n", fRatioMaxCut) ;
1301 printf("pT Leading / pT Gamma > %f\n", fRatioMinCut) ;
1302 printf("M_pair < %f\n", fInvMassMaxCut) ;
1303 printf("M_pair > %f\n", fInvMassMinCut) ;
1305 printf("pT Jet / pT Gamma < %f\n", fJetRatioMaxCut) ;
1306 printf("pT Jet / pT Gamma > %f\n", fJetRatioMinCut) ;
1307 printf("pT Jet (Only CTS)/ pT Gamma < %f\n", fJetCTSRatioMaxCut) ;
1308 printf("pT Jet (Only CTS)/ pT Gamma > %f\n", fJetCTSRatioMinCut) ;
1314 //___________________________________________________________________
1315 void AliAnaGammaJet::SetJet(TParticle * part, Bool_t & b, Float_t cone,
1316 Double_t eta, Double_t phi)
1319 //Check if the particle is inside the cone defined by the leading particle
1322 if(phi > TMath::TwoPi())
1323 phi-=TMath::TwoPi();
1325 phi+=TMath::TwoPi();
1327 Double_t rad = 10000 + cone;
1329 if(TMath::Abs(part->Phi()-phi) <= (TMath::TwoPi() - cone))
1330 rad = TMath::Sqrt(TMath::Power(part->Eta()-eta,2)+
1331 TMath::Power(part->Phi()-phi,2));
1333 if(part->Phi()-phi > TMath::TwoPi() - cone)
1334 rad = TMath::Sqrt(TMath::Power(part->Eta()-eta,2)+
1335 TMath::Power((part->Phi()-TMath::TwoPi())-phi,2));
1336 if(part->Phi()-phi < -(TMath::TwoPi() - cone))
1337 rad = TMath::Sqrt(TMath::Power(part->Eta()-eta,2)+
1338 TMath::Power((part->Phi()+TMath::TwoPi())-phi,2));
1347 void AliAnaGammaJet::Terminate(Option_t *)
1349 // The Terminate() function is the last function to be called during
1350 // a query. It always runs on the client, it can be used to present
1351 // the results graphically or save the results to file.