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:
20 * Revision 1.8 2005/12/20 07:08:32 schutz
21 * corrected error in call AliReadESD
23 * Revision 1.6 2005/05/28 14:19:04 schutz
24 * Compilation warnings fixed by T.P.
28 //_________________________________________________________________________
29 // Class for the analysis of gamma-jet correlations
30 // Basically it seaches for a prompt photon in the PHOS acceptance,
31 // if so we construct a jet around the highest pt particle in the opposite
32 // side in azimuth, inside the TPC and EMCAL acceptances. First the leading
33 // particle and then the jet have to fullfill several conditions
34 // (energy, direction ..) to be accepted. Then the fragmentation function
35 // of this jet is constructed
37 //*-- Author: Gustavo Conesa & Yves Schutz (IFIC, CERN)
38 //////////////////////////////////////////////////////////////////////////////
41 // --- ROOT system ---
43 #include "TParticle.h"
45 #include "TPaveLabel.h"
47 #include "AliPHOSGammaJet.h"
48 #include "AliPHOSGetter.h"
50 #include "AliPHOSGeometry.h"
51 #include "AliPHOSFastGlobalReconstruction.h"
53 #include "AliESDtrack.h"
54 #include "Riostream.h"
56 //#include "../PYTHIA6/AliGenPythia.h"
58 ClassImp(AliPHOSGammaJet)
60 //____________________________________________________________________________
61 AliPHOSGammaJet::AliPHOSGammaJet() : TTask()
64 fAngleMaxParam.Set(4) ;
65 fAngleMaxParam.Reset(0.);
72 fJetRatioMaxCut = 0. ;
73 fJetRatioMinCut = 0. ;
74 fJetTPCRatioMaxCut = 0. ;
75 fJetTPCRatioMinCut = 0. ;
91 fTPCCutsLikeEMCAL = 0 ;
98 for(Int_t i = 0; i<10; i++){
102 fPtJetSelectionCut = 0.0 ;
103 fNamePtThres[i] = "" ;
114 fJetSigma1[i] = 0.0 ;
115 fJetSigma2[i] = 0.0 ;
116 fPhiEMCALCut[i] = 0.0 ;
122 fOutputFile = new TFile(gDirectory->GetName()) ;
123 fInputFileName = gDirectory->GetName() ;
124 fOutputFileName = gDirectory->GetName() ;
125 fHIJINGFileName = gDirectory->GetName() ;
134 fListHistos = new TObjArray(100) ;
135 TList * list = gDirectory->GetListOfKeys() ;
139 for (index = 0 ; index < list->GetSize()-1 ; index++) {
140 //-1 to avoid GammaJet Task
141 h = dynamic_cast<TH2F*>(gDirectory->Get(list->At(index)->GetName())) ;
142 fListHistos->Add(h) ;
147 //____________________________________________________________________________
148 AliPHOSGammaJet::AliPHOSGammaJet(const TString inputfilename) :
149 TTask("GammaJet","Analysis of gamma-jet correlations")
152 fInputFileName = inputfilename;
153 fFastRec = new AliPHOSFastGlobalReconstruction(fInputFileName);
154 AliPHOSGetter * gime = AliPHOSGetter::Instance(fInputFileName) ;
155 fNEvent = gime->MaxEvent();
160 //____________________________________________________________________________
161 AliPHOSGammaJet::AliPHOSGammaJet(const AliPHOSGammaJet & gj) : TTask(gj)
164 fAngleMaxParam = gj.fAngleMaxParam;
165 fAnyConeOrPt = gj.fAnyConeOrPt;
166 fESDdata = gj.fESDdata;
167 fEtaCut = gj.fEtaCut ;
168 fInvMassMaxCut = gj.fInvMassMaxCut ;
169 fInvMassMinCut = gj.fInvMassMinCut ;
170 fFastRec = gj.fFastRec ;
171 fOptionGJ = gj.fOptionGJ ;
172 fMinDistance = gj.fMinDistance ;
173 fOptFast = gj.fOptFast ;
174 fOnlyCharged = gj.fOnlyCharged ;
175 fOutputFile = gj.fOutputFile ;
176 fInputFileName = gj.fInputFileName ;
177 fOutputFileName = gj.fOutputFileName ;
178 fHIJINGFileName = gj.fHIJINGFileName ;
179 fHIJING = gj.fHIJING ;
180 fRatioMaxCut = gj.fRatioMaxCut ;
181 fRatioMinCut = gj.fRatioMinCut ;
182 fJetRatioMaxCut = gj.fJetRatioMaxCut ;
183 fJetRatioMinCut = gj.fJetRatioMinCut ;
184 fJetTPCRatioMaxCut = gj.fJetRatioMaxCut ;
185 fJetTPCRatioMinCut = gj.fJetRatioMinCut ;
186 fNEvent = gj.fNEvent ;
189 fResPara1 = gj.fResPara1 ;
190 fResPara2 = gj.fResPara2 ;
191 fResPara3 = gj.fResPara3 ;
193 fNeutralPtCut = gj.fNeutralPtCut ;
194 fChargedPtCut = gj.fChargedPtCut ;
195 fPtJetSelectionCut = gj.fPtJetSelectionCut ;
196 fPhiMaxCut = gj.fPhiMaxCut ;
197 fPhiMinCut = gj.fPhiMinCut ;
198 fPosParaA = gj.fPosParaA ;
199 fPosParaB = gj.fPosParaB ;
200 fSelect = gj.fSelect ;
201 fTPCCutsLikeEMCAL = gj.fTPCCutsLikeEMCAL ;
203 fPtThreshold = gj.fPtThreshold ;
205 fDirName = gj.fDirName ;
206 fESDTree = gj.fESDTree ;
207 fPattern = gj.fPattern ;
209 SetName (gj.GetName()) ;
210 SetTitle(gj.GetTitle()) ;
212 for(Int_t i = 0; i<10; i++){
213 fCones[i] = gj.fCones[i] ;
214 fNameCones[i] = gj.fNameCones[i] ;
215 fPtThres[i] = gj.fPtThres[i] ;
216 fNamePtThres[i] = gj.fNamePtThres[i] ;
218 fJetXMin1[i] = gj.fJetXMin1[i] ;
219 fJetXMin2[i] = gj.fJetXMin2[i] ;
220 fJetXMax1[i] = gj.fJetXMax1[i] ;
221 fJetXMax2[i] = gj.fJetXMax2[i] ;
222 fBkgMean[i] = gj.fBkgMean[i] ;
223 fBkgRMS[i] = gj.fBkgRMS[i] ;
225 fJetE1[i] = gj.fJetE1[i] ;
226 fJetE2[i] = gj.fJetE2[i] ;
227 fJetSigma1[i] = gj.fJetSigma1[i] ;
228 fJetSigma2[i] = gj.fJetSigma2[i] ;
229 fPhiEMCALCut[i] = gj.fPhiEMCALCut[i] ;
235 //____________________________________________________________________________
236 AliPHOSGammaJet::~AliPHOSGammaJet()
238 fOutputFile->Close() ;
242 //____________________________________________________________________________
243 void AliPHOSGammaJet::AddHIJINGToList(Int_t iEvent, TClonesArray * particleList,
246 TClonesArray * plNePHOS)
249 // List of particles copied to a root file.
251 // Char_t sb[] = "bgrd/";
252 // // cout<<sb<<endl;
254 // Char_t sf[] = "/list.root";
255 // // cout<<sf<<endl;
256 // sprintf(si,"%d",iEvent);
258 // // cout<<si<<endl;
260 // // cout<<si<<endl;
261 // TFile * f = TFile::Open(sb) ;
262 // //cout<<f->GetName()<<endl;
265 sprintf(fi,"bgrd/%d/list.root",iEvent);
266 TFile * f = TFile::Open(fi) ;
267 //cout<<f->GetName()<<endl;
269 TParticle *particle = new TParticle();
270 TTree *t = (TTree*) f->Get("T");
271 TBranch *branch = t->GetBranch("primaries");
272 branch->SetAddress(&particle);
274 Int_t index = particleList->GetEntries() ;
275 Int_t indexNe = plNe->GetEntries() ;
276 Int_t indexCh = plCh->GetEntries() ;
277 Int_t indexNePHOS = plNePHOS->GetEntries() ;
278 Double_t charge = 0.;
279 Int_t iParticle = 0 ;
281 Double_t x = 0., z = 0.;
282 // cout<<"bkg entries "<<t->GetEntries()<<endl;
284 AliPHOSGetter * gime = AliPHOSGetter::Instance() ;
285 const AliPHOSGeometry * geom = gime->PHOSGeometry() ;
288 for (iParticle=0 ; iParticle < t->GetEntries() ; iParticle++) {
289 t->GetEvent(iParticle) ;
295 charge = TDatabasePDG::Instance()
296 ->GetParticle(particle->GetPdgCode())->Charge();
298 if((charge != 0) && (particle->Pt() > fChargedPtCut)){
299 if(TMath::Abs(particle->Eta())<fEtaCut){
300 new((*particleList)[index]) TParticle(*particle) ;
301 (dynamic_cast<TParticle*>(particleList->At(index)))
305 new((*plCh)[indexCh]) TParticle(*particle) ;
306 (dynamic_cast<TParticle*>(plCh->At(indexCh)))->SetStatusCode(0) ;
309 if(strstr(fOptionGJ,"deb all")||strstr(fOptionGJ,"deb")){
310 dynamic_cast<TH1F*>(fListHistos->FindObject("PtSpectra"))->
311 Fill(particle->Pt());
314 else if((charge == 0) && (particle->Pt() > fNeutralPtCut) ){
315 geom->ImpactOnEmc(particle->Theta(),particle->Phi(), m,z,x);
319 if(strstr(fOptionGJ,"deb all")|| strstr(fOptionGJ,"deb"))
320 dynamic_cast<TH1F*>(fListHistos->FindObject("PtSpectra"))->
321 Fill(particle->Pt());
323 new((*plNePHOS)[indexNePHOS]) TParticle(*particle) ;
324 (dynamic_cast<TParticle*>(plNePHOS->At(indexNePHOS)))->SetStatusCode(0) ;
328 if((particle->Phi()>fPhiEMCALCut[0]) &&
329 (particle->Phi()<fPhiEMCALCut[1]) && m == 0)
331 if(strstr(fOptionGJ,"deb all")|| strstr(fOptionGJ,"deb"))
332 dynamic_cast<TH1F*>(fListHistos->FindObject("PtSpectra"))->
333 Fill(particle->Pt());
335 new((*particleList)[index]) TParticle(*particle) ;
336 (dynamic_cast<TParticle*>(particleList->At(index)))
339 new((*plNe)[indexNe]) TParticle(*particle) ;
340 (dynamic_cast<TParticle*>(plNe->At(indexNe)))->SetStatusCode(0) ;
349 Double_t mass = TDatabasePDG::Instance()->GetParticle(111)->Mass();
350 TLorentzVector pPi0, pGamma1, pGamma2 ;
351 Double_t angle = 0, cellDistance = 0.;
354 // fFastRec = new AliPHOSFastGlobalReconstruction(fHIJINGFileName);
355 // fFastRec->FastReconstruction(iiEvent);
357 for (iParticle=0 ; iParticle < t->GetEntries() ; iParticle++) {
358 t->GetEvent(iParticle) ;
362 charge = TDatabasePDG::Instance()
363 ->GetParticle(particle->GetPdgCode())->Charge();
365 if((charge != 0) && (particle->Pt() > fChargedPtCut)
366 && (TMath::Abs(particle->Eta())<fEtaCut)){
368 new((*particleList)[index]) TParticle(*particle) ;
369 (dynamic_cast<TParticle*>(particleList->At(index)))
373 new((*plCh)[indexCh]) TParticle(*particle) ;
374 (dynamic_cast<TParticle*>(plCh->At(indexCh)))->SetStatusCode(0) ;
377 else if(charge == 0){
378 geom->ImpactOnEmc(particle->Theta(),particle->Phi(), m,z,x);
379 if((particle->GetPdgCode() != 111) && (particle->Pt() > fNeutralPtCut) &&
380 (TMath::Abs(particle->Eta())<fEtaCut) ){
381 TLorentzVector part(particle->Px(),particle->Py(),
382 particle->Pz(),particle->Energy());
384 if(part.Pt() > fNeutralPtCut){
386 if(particle->Phi()>fPhiEMCALCut[0] &&
387 particle->Phi()<fPhiEMCALCut[1] && m == 0)
389 new((*particleList)[index]) TParticle(*particle) ;
390 (dynamic_cast<TParticle*>(particleList->At(index)))
392 (dynamic_cast<TParticle*>(particleList->At(index)))
393 ->SetMomentum(part.Px(),part.Py(),part.Pz(),part.E());
397 new((*plNe)[indexNe]) TParticle(*particle) ;
398 (dynamic_cast<TParticle*>(plNe->At(indexNe)))
399 ->SetMomentum(part.Px(),part.Py(),part.Pz(),part.E());
400 (dynamic_cast<TParticle*>(plNe->At(indexNe)))->SetStatusCode(0) ;
405 new((*plNePHOS)[indexNePHOS]) TParticle(*particle) ;
406 (dynamic_cast<TParticle*>(plNePHOS->At(indexNePHOS)))
407 ->SetMomentum(part.Px(),part.Py(),part.Pz(),part.E());
408 (dynamic_cast<TParticle*>(plNePHOS->At(indexNePHOS)))->SetStatusCode(0) ;
413 if((particle->GetPdgCode() == 111) && (particle->Pt() > fNeutralPtCut) &&
414 (TMath::Abs(particle->Eta())<fEtaCut+1))
417 pPi0.SetPxPyPzE(particle->Px(),particle->Py(),particle->Pz(),
422 Pi0Decay(mass,pPi0,pGamma1,pGamma2,angle);
423 //Check if decay photons are too close for PHOS
424 cellDistance = angle*460; //cm
425 if (cellDistance < fMinDistance) {
426 if(strstr(fOptionGJ,"deb all")|| strstr(fOptionGJ,"deb"))
427 dynamic_cast<TH1F*>(fListHistos->FindObject("PtSpectra"))->
428 Fill(particle->Pt());
430 //Pi0 inside phi EMCAL acceptance
432 TLorentzVector part(particle->Px(),particle->Py(),
433 particle->Pz(),particle->Energy());
435 if(part.Pt() > fNeutralPtCut){
436 if(particle->Phi()>fPhiEMCALCut[0] &&
437 particle->Phi()<fPhiEMCALCut[1] && m == 0){
439 new((*particleList)[index]) TParticle(*particle) ;
440 (dynamic_cast<TParticle*>(particleList->At(index)))->SetStatusCode(0) ;
441 (dynamic_cast<TParticle*>(particleList->At(index)))
442 ->SetMomentum(part.Px(),part.Py(),part.Pz(),part.E());
445 new((*plNe)[indexNe]) TParticle(*particle) ;
446 (dynamic_cast<TParticle*>(plNe->At(indexNe))) ->SetStatusCode(0) ;
447 (dynamic_cast<TParticle*>(plNe->At(indexNe)))
448 ->SetMomentum(part.Px(),part.Py(),part.Pz(),part.E());
452 if(strstr(fOptionGJ,"deb all")|| strstr(fOptionGJ,"deb"))
453 dynamic_cast<TH1F*>(fListHistos->FindObject("PtSpectra"))->
454 Fill(particle->Pt());
455 new((*plNePHOS)[indexNePHOS]) TParticle(*particle) ;
456 (dynamic_cast<TParticle*>(plNePHOS->At(indexNePHOS))) ->SetStatusCode(0) ;
457 (dynamic_cast<TParticle*>(plNePHOS->At(indexNePHOS)))
458 ->SetMomentum(part.Px(),part.Py(),part.Pz(),part.E());
465 dynamic_cast<TH2F*>(fListHistos->FindObject("AnglePair"))
466 ->Fill(pPi0.E(),angle);
469 if(pGamma1.Pt() > 0. && TMath::Abs(pGamma1.Eta())<fEtaCut){
473 if(pGamma1.Pt() > fNeutralPtCut ){
475 TParticle * photon1 =
476 new TParticle(22,1,0,0,0,0,pGamma1.Px(),pGamma1.Py(),
477 pGamma1.Pz(),pGamma1.E(),0,0,0,0);
478 geom->ImpactOnEmc(photon1->Theta(),photon1->Phi(), m,z,x);
479 if( photon1->Phi()>fPhiEMCALCut[0] && photon1->Phi()<fPhiEMCALCut[1]
481 if(strstr(fOptionGJ,"deb all") || strstr(fOptionGJ,"deb"))
482 dynamic_cast<TH1F*>(fListHistos->FindObject("PtSpectra"))->
484 new((*particleList)[index]) TParticle(*photon1) ;
485 (dynamic_cast<TParticle*>(particleList->At(index)))->SetStatusCode(0) ;
488 new((*plNe)[indexNe]) TParticle(*photon1) ;
489 (dynamic_cast<TParticle*>(plNe->At(indexNe))) ->SetStatusCode(0) ;
494 if(strstr(fOptionGJ,"deb all") || strstr(fOptionGJ,"deb"))
495 dynamic_cast<TH1F*>(fListHistos->FindObject("PtSpectra"))->
497 new((*plNePHOS)[indexNePHOS]) TParticle(*photon1) ;
498 (dynamic_cast<TParticle*>(plNePHOS->At(indexNePHOS)))->SetStatusCode(0) ;
504 if(pGamma2.Pt() > 0. && TMath::Abs(pGamma2.Eta())<fEtaCut){
507 if(pGamma2.Pt() > fNeutralPtCut){
509 TParticle * photon2 =
510 new TParticle(22,1,0,0,0,0,pGamma2.Px(), pGamma2.Py(),
511 pGamma2.Pz(),pGamma2.E(),0,0,0,0);
512 geom->ImpactOnEmc(photon2->Theta(),photon2->Phi(), m,z,x);
513 if(photon2->Phi()>fPhiEMCALCut[0] &&
514 photon2->Phi()<fPhiEMCALCut[1] && m == 0){
515 if(strstr(fOptionGJ,"deb all") || strstr(fOptionGJ,"deb"))
516 dynamic_cast<TH1F*>(fListHistos->FindObject("PtSpectra"))->
518 new((*particleList)[index]) TParticle(*photon2) ;
519 (dynamic_cast<TParticle*>(particleList->At(index)))->SetStatusCode(0) ;
522 new((*plNe)[indexNe]) TParticle(*photon2) ;
523 (dynamic_cast<TParticle*>(plNe->At(indexNe))) ->SetStatusCode(0) ;
527 if(strstr(fOptionGJ,"deb all") || strstr(fOptionGJ,"deb"))
528 dynamic_cast<TH1F*>(fListHistos->FindObject("PtSpectra"))->
530 new((*plNePHOS)[indexNePHOS]) TParticle(*photon2) ;
531 (dynamic_cast<TParticle*>(plNePHOS->At(indexNePHOS))) ->SetStatusCode(0) ;
535 // e = (pGamma1+pGamma2).E();
536 // if(IsAngleInWindow(angle,e))
538 (fListHistos->FindObject("AnglePairAccepted"))->
539 Fill(pPi0.E(),angle);
542 }//photon2 in acceptance
543 }//if angle > mindist
546 }//for (iParticle<nParticle)
549 //Info("AddHIJINGToList","End HIJING");
552 //____________________________________________________________________________
553 Double_t AliPHOSGammaJet::CalculateJetRatioLimit(const Double_t ptg,
557 //Info("CalculateLimit","x1 %f, x2%f",x[0],x[1]);
558 Double_t epp = par[0] + par[1] * ptg ;
559 Double_t spp = par[2] + par[3] * ptg ;
560 Double_t f = x[0] + x[1] * ptg ;
561 Double_t epb = epp + par[4] ;
562 Double_t spb = TMath::Sqrt(spp*spp+ par[5]*par[5]) ;
563 Double_t rat = (epb - spb * f) / ptg ;
564 //Info("CalculateLimit","epp %f, spp %f, f %f", epp, spp, f);
565 //Info("CalculateLimit","epb %f, spb %f, rat %f", epb, spb, rat);
569 //____________________________________________________________________________
570 void AliPHOSGammaJet::CreateParticleList(Int_t iEvent,
571 TClonesArray * particleList,
574 TClonesArray * plNePHOS)
576 //Info("CreateParticleList","Inside");
577 AliPHOSGetter * gime = AliPHOSGetter::Instance(fInputFileName) ;
578 const AliPHOSGeometry * geom = gime->PHOSGeometry() ;
579 gime->Event(iEvent, "X") ;
582 Int_t index = particleList->GetEntries() ;
583 Int_t indexCh = plCh->GetEntries() ;
584 Int_t indexNe = plNe->GetEntries() ;
585 Int_t indexNePHOS = plNePHOS->GetEntries() ;
586 Int_t iParticle = 0 ;
587 Double_t charge = 0.;
589 Double_t x = 0., z = 0.;
592 for (iParticle=0 ; iParticle < gime->NPrimaries() ; iParticle++) {
593 const TParticle * particle = gime->Primary(iParticle) ;
599 //Keep Stable particles within eta range
600 if((particle->GetStatusCode() == 1) &&
601 (particle->Pt() > 0)){
602 if(TMath::Abs(particle->Eta())<fEtaCut){
605 charge = TDatabasePDG::Instance()
606 ->GetParticle(particle->GetPdgCode())->Charge();
607 if((charge != 0) && (particle->Pt() > fChargedPtCut)){
609 if(strstr(fOptionGJ,"deb all")|| strstr(fOptionGJ,"deb"))
610 dynamic_cast<TH1F*>(fListHistos->FindObject("PtSpectra"))->
611 Fill(particle->Pt());
612 new((*plCh)[indexCh++]) TParticle(*particle) ;
613 new((*particleList)[index++]) TParticle(*particle) ;
615 else if((charge == 0) && (particle->Pt() > fNeutralPtCut)){
616 geom->ImpactOnEmc(particle->Theta(),particle->Phi(), m,z,x);
619 if(strstr(fOptionGJ,"deb all")|| strstr(fOptionGJ,"deb"))
620 dynamic_cast<TH1F*>(fListHistos->FindObject("PtSpectra"))->
621 Fill(particle->Pt());
623 new((*plNePHOS)[indexNePHOS++]) TParticle(*particle) ;
625 if((particle->Phi()>fPhiEMCALCut[0]) &&
626 (particle->Phi()<fPhiEMCALCut[1]) && m == 0)
628 if(strstr(fOptionGJ,"deb all")|| strstr(fOptionGJ,"deb"))
629 dynamic_cast<TH1F*>(fListHistos->FindObject("PtSpectra"))->
630 Fill(particle->Pt());
631 new((*plNe)[indexNe++]) TParticle(*particle) ;
632 new((*particleList)[index++]) TParticle(*particle) ;
636 }//final particle, etacut
637 }//for (iParticle<nParticle)
641 Double_t mass = TDatabasePDG::Instance()->GetParticle(111)->Mass();
642 TLorentzVector pPi0, pGamma1, pGamma2 ;
643 Double_t angle = 0, cellDistance = 0.;
645 fFastRec = new AliPHOSFastGlobalReconstruction(fInputFileName);
646 fFastRec->FastReconstruction(iEvent);
648 for (iParticle=0 ; iParticle < gime->NPrimaries() ; iParticle++) {
649 const TParticle * particle = gime->Primary(iParticle) ;
653 //Keep Stable particles within eta range
654 if((particle->GetStatusCode() == 1) && (particle->Pt() > 0)){
658 charge = TDatabasePDG::Instance()
659 ->GetParticle(particle->GetPdgCode())->Charge();
660 if((charge != 0) && (particle->Pt() > fChargedPtCut) && (TMath::Abs(particle->Eta())<fEtaCut)){
661 new((*plCh)[indexCh++]) TParticle(*particle) ;
662 new((*particleList)[index++]) TParticle(*particle) ;
664 else if(charge == 0) {
665 geom->ImpactOnEmc(particle->Theta(),particle->Phi(), m,z,x);
666 if((particle->GetPdgCode() != 111) && particle->Pt() > 0 &&
667 (TMath::Abs(particle->Eta())<fEtaCut))
670 TLorentzVector part(particle->Px(),particle->Py(),
671 particle->Pz(),particle->Energy());
675 if(part.Pt() > fNeutralPtCut){
676 if(particle->Phi()>fPhiEMCALCut[0] &&
677 particle->Phi()<fPhiEMCALCut[1] && m == 0)
679 new((*particleList)[index]) TParticle(*particle) ;
680 (dynamic_cast<TParticle*>(particleList->At(index)))
681 ->SetMomentum(part.Px(),part.Py(),part.Pz(),part.E());
684 new((*plNe)[indexNe]) TParticle(*particle) ;
685 (dynamic_cast<TParticle*>(plNe->At(indexNe)))
686 ->SetMomentum(part.Px(),part.Py(),part.Pz(),part.E());
691 new((*plNePHOS)[indexNePHOS]) TParticle(*particle) ;
692 (dynamic_cast<TParticle*>(plNePHOS->At(indexNePHOS)))
693 ->SetMomentum(part.Px(),part.Py(),part.Pz(),part.E());
698 if((particle->GetPdgCode() == 111) && (particle->Pt() > fNeutralPtCut) &&
699 (TMath::Abs(particle->Eta())<fEtaCut+1))
702 pPi0.SetPxPyPzE(particle->Px(),particle->Py(),particle->Pz(),
707 Pi0Decay(mass,pPi0,pGamma1,pGamma2,angle);
708 //Check if decay photons are too close for PHOS
709 cellDistance = angle*460; //cm
711 if (cellDistance < fMinDistance) {
713 //Pi0 inside phi EMCAL acceptance
716 TLorentzVector part(particle->Px(),particle->Py(),
717 particle->Pz(),particle->Energy());
720 if(part.Pt() > fNeutralPtCut){
721 if(particle->Phi()>fPhiEMCALCut[0] &&
722 particle->Phi()<fPhiEMCALCut[1] && m == 0){
723 if(strstr(fOptionGJ,"deb all")|| strstr(fOptionGJ,"deb"))
724 dynamic_cast<TH1F*>(fListHistos->FindObject("PtSpectra"))->
725 Fill(particle->Pt());
727 new((*plNe)[indexNe]) TParticle(*particle) ;
728 (dynamic_cast<TParticle*>(plNe->At(indexNe)))
729 ->SetMomentum(part.Px(),part.Py(),part.Pz(),part.E());
730 new((*particleList)[index]) TParticle(*particle) ;
731 (dynamic_cast<TParticle*>(particleList->At(index)))
732 ->SetMomentum(part.Px(),part.Py(),part.Pz(),part.E());
737 if(strstr(fOptionGJ,"deb all")|| strstr(fOptionGJ,"deb"))
738 dynamic_cast<TH1F*>(fListHistos->FindObject("PtSpectra"))->
739 Fill(particle->Pt());
740 new((*plNePHOS)[indexNePHOS]) TParticle(*particle) ;
741 (dynamic_cast<TParticle*>(plNePHOS->At(indexNePHOS)))
742 ->SetMomentum(part.Px(),part.Py(),part.Pz(),part.E());
749 dynamic_cast<TH2F*>(fListHistos->FindObject("AnglePair"))
750 ->Fill(pPi0.E(),angle);
754 if(pGamma1.Pt() > 0 && TMath::Abs(pGamma1.Eta())<fEtaCut){
757 if(pGamma1.Pt() > fNeutralPtCut){
758 TParticle * photon1 =
759 new TParticle(22,1,0,0,0,0,pGamma1.Px(),pGamma1.Py(),
760 pGamma1.Pz(),pGamma1.E(),0,0,0,0);
761 geom->ImpactOnEmc(photon1->Theta(),photon1->Phi(), m,z,x);
762 if( photon1->Phi()>fPhiEMCALCut[0] && photon1->Phi()<fPhiEMCALCut[1]
764 if(strstr(fOptionGJ,"deb all") || strstr(fOptionGJ,"deb"))
765 dynamic_cast<TH1F*>(fListHistos->FindObject("PtSpectra"))->
767 new((*plNe)[indexNe++]) TParticle(*photon1) ;
768 new((*particleList)[index++]) TParticle(*photon1) ;
773 if(strstr(fOptionGJ,"deb all") || strstr(fOptionGJ,"deb"))
774 dynamic_cast<TH1F*>(fListHistos->FindObject("PtSpectra"))->
776 new((*plNePHOS)[indexNePHOS++]) TParticle(*photon1) ;
781 if(pGamma2.Pt() > 0 && TMath::Abs(pGamma2.Eta())<fEtaCut){
784 if(pGamma2.Pt() > fNeutralPtCut ){
785 TParticle * photon2 =
786 new TParticle(22,1,0,0,0,0,pGamma2.Px(), pGamma2.Py(),
787 pGamma2.Pz(),pGamma2.E(),0,0,0,0);
788 geom->ImpactOnEmc(photon2->Theta(),photon2->Phi(), m,z,x);
789 if(photon2->Phi()>fPhiEMCALCut[0] &&
790 photon2->Phi()<fPhiEMCALCut[1] && m == 0){
791 if(strstr(fOptionGJ,"deb all") || strstr(fOptionGJ,"deb"))
792 dynamic_cast<TH1F*>(fListHistos->FindObject("PtSpectra"))->
794 new((*plNe)[indexNe++]) TParticle(*photon2) ;
795 new((*particleList)[index++]) TParticle(*photon2) ;
798 if(strstr(fOptionGJ,"deb all") || strstr(fOptionGJ,"deb"))
799 dynamic_cast<TH1F*>(fListHistos->FindObject("PtSpectra"))->
801 new((*plNePHOS)[indexNePHOS++]) TParticle(*photon2) ;
805 // Float_t e = (pGamma1+pGamma2).E();
806 // if(IsAngleInWindow(angle,e))
808 (fListHistos->FindObject("AnglePairAccepted"))->
809 Fill(pPi0.E(),angle);
812 }//photon2 in acceptance
813 }//if angle > mindist
816 }//final particle, etacut
817 }//for (iParticle<nParticle)
821 //____________________________________________________________________________
822 void AliPHOSGammaJet::CreateParticleListFromESD(TClonesArray * pl,
825 TClonesArray * plNePHOS,
828 //Create a list of particles from the ESD. These particles have been measured
829 //by the Central Tracking system (TPC), PHOS and EMCAL
830 //(EMCAL not available for the moment).
831 //Info("CreateParticleListFromESD","Inside");
833 Int_t index = pl->GetEntries() ;
835 Double_t pid[AliPID::kSPECIESN];
837 //########### PHOS ##############
838 //Info("CreateParticleListFromESD","Fill ESD PHOS list");
839 Int_t begphos = esd->GetFirstPHOSParticle();
840 Int_t endphos = esd->GetFirstPHOSParticle() +
841 esd->GetNumberOfPHOSParticles() ;
842 Int_t indexNePHOS = plNePHOS->GetEntries() ;
843 if(strstr(fOptionGJ,"deb all"))
844 Info("CreateParticleListFromESD","PHOS: first particle %d, last particle %d",
847 for (npar = begphos; npar < endphos; npar++) {//////////////PHOS track loop
848 AliESDtrack * track = esd->GetTrack(npar) ; // retrieve track from esd
850 //Create a TParticle to fill the particle list
852 Double_t en = track->GetPHOSsignal() ;
853 Double_t * p = new Double_t();
854 track->GetPHOSposition(p) ;
855 TVector3 pos(p[0],p[1],p[2]) ;
856 Double_t phi = pos.Phi();
857 Double_t theta= pos.Theta();
858 Double_t px = en*TMath::Cos(phi)*TMath::Sin(theta);;
859 Double_t py = en*TMath::Sin(phi)*TMath::Sin(theta);
860 Double_t pz = en*TMath::Cos(theta);
862 TParticle * particle = new TParticle() ;
863 particle->SetMomentum(px,py,pz,en) ;
865 //Select only photons
867 track->GetPHOSpid(pid);
868 //cout<<"pid "<<pid[AliPID::kPhoton]<<endl ;
869 if( pid[AliPID::kPhoton] > 0.75)
870 new((*plNePHOS)[indexNePHOS++]) TParticle(*particle) ;
873 //########### TPC #####################
874 //Info("CreateParticleListFromESD","Fill ESD TPC list");
876 Int_t endtpc = esd->GetNumberOfTracks() ;
877 Int_t indexCh = plCh->GetEntries() ;
878 if(strstr(fOptionGJ,"deb all"))
879 Info("CreateParticleListFromESD","TPC: first particle %d, last particle %d",
882 for (npar = begtpc; npar < endtpc; npar++) {////////////// track loop
883 AliESDtrack * track = esd->GetTrack(npar) ; // retrieve track from esd
885 Double_t en = track ->GetTPCsignal() ;
886 TVector3 mom = track->P3() ;
887 Double_t px = mom.Px();
888 Double_t py = mom.Py();
889 Double_t pz = mom.Pz(); //Check with TPC people if this is correct.
891 //cout<<"TPC signal "<<en<<endl;
892 //cout<<"px "<<px<<"; py "<<py<<"; pz "<<pz<<endl;
893 TParticle * particle = new TParticle() ;
894 particle->SetMomentum(px,py,pz,en) ;
896 new((*plCh)[indexCh++]) TParticle(*particle) ;
897 new((*pl)[index++]) TParticle(*particle) ;
901 //################ EMCAL ##############
902 Double_t v[3] ; //vertex ;
903 esd->GetVertex()->GetXYZ(v) ;
904 //##########Uncomment when ESD for EMCAL works ##########
905 //Info("CreateParticleListFromESD","Fill ESD EMCAL list");
907 Int_t begem = esd->GetFirstEMCALParticle();
908 Int_t endem = esd->GetFirstEMCALParticle() +
909 esd->GetNumberOfEMCALParticles() ;
910 Int_t indexNe = plNe->GetEntries() ;
911 if(strstr(fOptionGJ,"deb all"))
912 Info("CreateParticleListFromESD","EMCAL: first particle %d, last particle %d",
915 for (npar = begem; npar < endem; npar++) {//////////////EMCAL track loop
916 AliESDtrack * track = esd->GetTrack(npar) ; // retrieve track from esd
918 Double_t en = track->GetEMCALsignal() ;
919 Double_t *p = new Double_t();
920 track->GetEMCALposition(p) ;
921 TVector3 pos(p[0],p[1],p[2]) ;
922 Double_t phi = pos.Phi();
923 Double_t theta= pos.Theta();
924 Double_t px = en*TMath::Cos(phi)*TMath::Sin(theta);;
925 Double_t py = en*TMath::Sin(phi)*TMath::Sin(theta);
926 Double_t pz = en*TMath::Cos(theta);
927 //cout<<"EMCAL signal "<<en<<endl;
928 //cout<<"px "<<px<<"; py "<<py<<"; pz "<<pz<<endl;
929 //TParticle * particle = new TParticle() ;
930 //particle->SetMomentum(px,py,pz,en) ;
933 // //Uncomment if PID IS WORKING, photon and pi0 idenitification.
934 // //if( pid[AliPID::kPhoton] > 0.75) //This has to be fixen.
936 // //else if( pid[AliPID::kPi0] > 0.75)
938 pdg = 22; //No PID, assume all photons
939 TParticle * particle = new TParticle(pdg, 1, -1, -1, -1, -1,
940 px, py, pz, en, v[0], v[1], v[2], 0);
942 new((*plNe)[indexNe++]) TParticle(*particle) ;
943 new((*pl)[index++]) TParticle(*particle) ;
946 // Info("CreateParticleListFromESD","End Inside");
952 //____________________________________________________________________________
953 void AliPHOSGammaJet::Exec(Option_t *option)
963 // Create chain of esd trees
964 const UInt_t kNevent = static_cast<const UInt_t>(GetNEvent()) ;
965 t = ReadESD(kNevent, fDirName, fESDTree, fPattern) ;
967 AliError("Could not create the TChain") ;
972 t->SetBranchAddress("ESD",&esd); // point to the container esd where to put the event from the esdTree
977 // AliGenPythia* pyth = (AliGenPythia*) gAlice->Generator();
980 TClonesArray * particleList = new TClonesArray("TParticle",1000);
981 TClonesArray * plCh = new TClonesArray("TParticle",1000);
982 TClonesArray * plNe = new TClonesArray("TParticle",1000);
983 TClonesArray * plNePHOS = new TClonesArray("TParticle",1000);
985 for (Int_t iEvent = 0 ; iEvent < fNEvent ; iEvent++) {
986 if(strstr(fOptionGJ,"deb")||strstr(fOptionGJ,"deb all"))
987 Info("Exec", "Event %d", iEvent) ;
991 Double_t phig = 0., phil = 0., phich = 0 , phipi = 0;
992 Double_t etag = 0., etal = 0., etach = 0., etapi = 0. ;
993 Double_t ptg = 0., ptl = 0., ptch = 0., ptpi = 0.;
995 TLorentzVector jet (0,0,0,0);
996 TLorentzVector jettpc(0,0,0,0);
1000 Int_t iNbytes = t->GetEntry(iEvent); // store event in esd
1001 //cout<<"nbytes "<<iNbytes<<endl;
1002 if ( iNbytes == 0 ) {
1003 AliError("Empty TChain") ;
1006 CreateParticleListFromESD(particleList, plCh,plNe,plNePHOS, esd); //,iEvent);
1009 CreateParticleList(iEvent, particleList, plCh,plNe,plNePHOS);
1011 // TLorentzVector pyjet(0,0,0,0);
1014 // Float_t jets[4][10];
1015 // pyth->SetJetReconstructionMode(1);
1016 // pyth->LoadEvent();
1017 // pyth->GetJets(nJ, nJT, jets);
1019 // Float_t pxJ = jets[0][0];
1020 // Float_t pyJ = jets[1][0];
1021 // Float_t pzJ = jets[2][0];
1022 // Float_t eJ = jets[3][0];
1023 // pyjet.SetPxPyPzE(pxJ,pyJ,pzJ,eJ ) ;
1026 // //Info("Exec",">>>>>>>>>>Number of jets !!!! %d",nJT);
1027 // for (Int_t iJ = 1; iJ < nJT; iJ++) {
1028 // Float_t pxJ = jets[0][iJ];
1029 // Float_t pyJ = jets[1][iJ];
1030 // Float_t pzJ = jets[2][iJ];
1031 // Float_t eJ = jets[3][iJ];
1032 // pyjet.SetPxPyPzE(pxJ,pyJ,pzJ,eJ ) ;
1033 // //Info("Exec",">>>>>Pythia Jet: %d, Phi %f, Eta %f, Pt %f",
1034 // // iJ,pyjet.Phi(),pyjet.Eta(),pyjet.Pt());
1040 AddHIJINGToList(iEvent, particleList, plCh,plNe, plNePHOS);
1043 Bool_t iIsInPHOS = kFALSE ;
1044 GetGammaJet(plNePHOS, ptg, phig, etag, iIsInPHOS) ;
1048 //Info("Exec"," In PHOS") ;
1049 dynamic_cast<TH1F*>(fListHistos->FindObject("NGamma"))->Fill(ptg);
1050 dynamic_cast<TH2F*>(fListHistos->FindObject("PhiGamma"))
1052 dynamic_cast<TH2F*>(fListHistos->FindObject("EtaGamma"))
1054 if(strstr(fOptionGJ,"deb")||strstr(fOptionGJ,"deb all"))
1055 Info("Exec", "Gamma: pt %f, phi %f, eta %f", ptg,
1058 // cout<<"n charged "<<plCh->GetEntries()<<endl;
1059 // cout<<"n neutral "<<plNe->GetEntries()<<endl;
1060 // cout<<"n All "<<particleList->GetEntries()<<endl;
1062 GetLeadingCharge(plCh, ptg, phig, ptch, etach, phich) ;
1063 GetLeadingPi0 (plNe, ptg, phig, ptpi, etapi, phipi) ;
1065 // cout<<"n2 charged "<<plCh->GetEntries()<<endl;
1066 // cout<<"n2 neutral "<<plNe->GetEntries()<<endl;
1067 // cout<<"n2 All "<<particleList->GetEntries()<<endl;
1072 //Is the leading cone inside EMCAL?
1073 Bool_t insidech = kFALSE ;
1074 if((phich - fCone) > fPhiEMCALCut[0] &&
1075 (phich + fCone) < fPhiEMCALCut[1]){
1078 Bool_t insidepi = kFALSE ;
1079 if((phipi - fCone) > fPhiEMCALCut[0] &&
1080 (phipi + fCone) < fPhiEMCALCut[1]){
1084 if ((ptch > 0 || ptpi > 0)){
1085 if((ptch > ptpi) && insidech){
1089 dynamic_cast<TH2F*>(fListHistos->FindObject("ChargeRatio"))
1090 ->Fill(ptg,ptch/ptg);
1091 dynamic_cast<TH2F*>(fListHistos->FindObject("DeltaPhiCharge"))
1092 ->Fill(ptg,phig-phich);
1093 dynamic_cast<TH2F*>(fListHistos->FindObject("DeltaEtaCharge"))
1094 ->Fill(ptg,etag-etach);
1095 if(strstr(fOptionGJ,"deb"))
1096 Info("Exec"," Charged Leading") ;
1098 if((ptpi > ptch) && insidepi){
1103 dynamic_cast<TH2F*>(fListHistos->FindObject("Pi0Ratio"))
1104 ->Fill(ptg,ptpi/ptg);
1105 dynamic_cast<TH2F*>(fListHistos->FindObject("DeltaPhiPi0"))
1106 ->Fill(ptg,phig-phipi);
1107 dynamic_cast<TH2F*>(fListHistos->FindObject("DeltaEtaPi0"))
1108 ->Fill(ptg,etag-etapi);
1110 if(ptpi > 0. && strstr(fOptionGJ,"deb"))
1111 Info("Exec"," Pi0 Leading") ;
1114 if(strstr(fOptionGJ,"deb"))
1115 Info("Exec","Leading pt %f, phi %f",ptl,phil);
1116 if(insidech || insidepi){
1119 MakeJet(particleList, ptg, phig, ptl, phil, etal, "", jet);
1121 if(strstr(fOptionGJ,"deb")){
1122 // Info("Exec","Pythia Jet: Phi %f, Eta %f, Pt %f",
1123 // pyjet.Phi(),pyjet.Eta(),pyjet.Pt());
1124 Info("Exec","TPC+EMCAL Jet: Phi %f, Eta %f, Pt %f",
1125 jet.Phi(),jet.Eta(),jet.Pt());
1127 // dynamic_cast<TH2F*>(fListHistos->FindObject("DeltaPhiJet"))
1128 // ->Fill(ptg,pyjet.Phi()-jet.Phi());
1129 // dynamic_cast<TH2F*>(fListHistos->FindObject("DeltaEtaJet"))
1130 // ->Fill(ptg,pyjet.Eta()-jet.Eta());
1131 // dynamic_cast<TH2F*>(fListHistos->FindObject("DeltaPtJet"))
1132 // ->Fill(ptg,pyjet.Pt()-jet.Pt());
1135 MakeJetAnyConeOrPt(particleList, ptg, phig, ptl, phil, etal, "");
1139 if(fOnlyCharged && ptch > 0.)
1141 if(strstr(fOptionGJ,"deb"))
1142 Info("Exec","Leading TPC pt %f, phi %f",ptch,phich);
1144 dynamic_cast<TH2F*>(fListHistos->FindObject("TPCRatio"))
1145 ->Fill(ptg,ptch/ptg);
1146 dynamic_cast<TH2F*>(fListHistos->FindObject("DeltaPhiTPC"))
1147 ->Fill(ptg,phig-phich);
1148 dynamic_cast<TH2F*>(fListHistos->FindObject("DeltaEtaTPC"))
1149 ->Fill(ptg,etag-etach);
1153 MakeJet(plCh, ptg, phig, ptch, phich, etach, "TPC",jettpc);
1155 if(strstr(fOptionGJ,"deb")){
1156 // Info("Exec","Pythia Jet: Phi %f, Eta %f, Pt %f",
1157 // pyjet.Phi(),pyjet.Eta(),pyjet.Pt());
1158 Info("Exec","TPC Jet: Phi %f, Eta %f, Pt %f",
1159 jettpc.Phi(),jettpc.Eta(),jettpc.Pt());
1161 // dynamic_cast<TH2F*>(fListHistos->FindObject("DeltaPhiTPCJet"))
1162 // ->Fill(ptg,pyjet.Phi()-jettpc.Phi());
1163 // dynamic_cast<TH2F*>(fListHistos->FindObject("DeltaEtaTPCJet"))
1164 // ->Fill(ptg,pyjet.Eta()-jettpc.Eta());
1165 // dynamic_cast<TH2F*>(fListHistos->FindObject("DeltaPtTPCJet"))
1166 // ->Fill(ptg,pyjet.Pt()-jettpc.Pt());
1169 MakeJetAnyConeOrPt(plCh, ptg, phig, ptch, phich, etach, "TPC");
1175 particleList->Delete() ;
1178 plNePHOS->Delete() ;
1183 delete particleList ;
1185 fOutputFile->Write() ;
1190 //____________________________________________________________________________
1191 void AliPHOSGammaJet::FillJetHistos(TClonesArray * pl, Double_t ptg,
1192 TString conf, TString type)
1194 //Fill jet fragmentation histograms if !fAnyCone,
1195 //only for fCone and fPtThres
1196 TParticle * particle = 0 ;
1201 while ( (particle = dynamic_cast<TParticle*>(next())) ) {
1203 Double_t pt = particle->Pt();
1205 charge = TDatabasePDG::Instance()
1206 ->GetParticle(particle->GetPdgCode())->Charge();
1207 if(charge != 0){//Only jet Charged particles
1209 (fListHistos->FindObject(type+conf+"Fragment"))
1212 (fListHistos->FindObject(type+conf+"PtDist"))
1218 (fListHistos->FindObject("NBkg"+conf))->Fill(ipr);
1221 //____________________________________________________________________________
1222 void AliPHOSGammaJet::FillJetHistosAnyConeOrPt(TClonesArray * pl, Double_t ptg,
1223 TString conf, TString type,
1224 TString cone, TString ptcut)
1226 //Fill jet fragmentation histograms if fAnyCone,
1227 //for several cones and pt thresholds
1228 TParticle *particle = 0;
1233 while ( (particle = dynamic_cast<TParticle*>(next())) ) {
1235 Double_t pt = particle->Pt();
1236 charge = TDatabasePDG::Instance()
1237 ->GetParticle(particle->GetPdgCode())->Charge();
1238 if(charge != 0){//Only jet Charged particles
1240 (fListHistos->FindObject(type+conf+"FragmentCone"+cone+"Pt"+ptcut))
1243 (fListHistos->FindObject(type+conf+"PtDistCone"+cone+"Pt"+ptcut))
1250 (fListHistos->FindObject("NBkg"+conf+"Cone"+cone+"Pt"+ptcut))
1255 //____________________________________________________________________________
1256 void AliPHOSGammaJet::GetGammaJet(TClonesArray * pl, Double_t &pt,
1257 Double_t &phi, Double_t &eta, Bool_t &Is) const
1259 //Search for the prompt photon in PHOS with pt > fPtCut
1264 for(Int_t ipr = 0;ipr < pl->GetEntries() ; ipr ++ ){
1265 TParticle * particle = dynamic_cast<TParticle *>(pl->At(ipr)) ;
1267 if((particle->Pt() > fPtCut) && (particle->Pt() > pt)){
1269 pt = particle->Pt();
1270 phi = particle->Phi() ;
1271 eta = particle->Eta() ;
1277 //____________________________________________________________________________
1278 void AliPHOSGammaJet::GetLeadingCharge(TClonesArray * pl,
1279 Double_t ptg, Double_t phig,
1280 Double_t &pt, Double_t &eta, Double_t &phi) const
1282 //Search for the charged particle with highest with
1283 //Phi=Phi_gamma-Pi and pT=0.1E_gamma
1288 for(Int_t ipr = 0;ipr < pl->GetEntries() ; ipr ++ ){
1290 TParticle * particle = dynamic_cast<TParticle *>(pl->At(ipr)) ;
1292 Double_t ptl = particle->Pt();
1293 Double_t rat = ptl/ptg ;
1294 Double_t phil = particle->Phi() ;
1296 if(((phig-phil)> fPhiMinCut) && ((phig-phil)<fPhiMaxCut) &&
1297 (rat > fRatioMinCut) && (rat < fRatioMaxCut) && (ptl > pt)) {
1298 eta = particle->Eta() ;
1301 //printf("GetLeadingCharge: %f %f %f %f \n", pt, eta, phi,rat) ;
1304 //printf("GetLeadingCharge: %f %f %f \n", pt, eta, phi) ;
1309 //____________________________________________________________________________
1310 void AliPHOSGammaJet::GetLeadingPi0(TClonesArray * pl,
1311 Double_t ptg, Double_t phig,
1312 Double_t &pt, Double_t &eta, Double_t &phi)
1315 //Search for the neutral pion with highest with
1316 //Phi=Phi_gamma-Pi and pT=0.1E_gamma
1320 Double_t ptl = -100.;
1321 Double_t rat = -100.;
1322 Double_t phil = -100. ;
1325 TParticle * particle = 0;
1329 while ( (particle = (TParticle*)next()) ) {
1330 if( particle->GetPdgCode() == 111){
1331 ptl = particle->Pt();
1333 phil = particle->Phi() ;
1334 e = particle->Energy();
1336 (fListHistos->FindObject("AnglePairNoCut"))->
1339 (fListHistos->FindObject("InvMassPairNoCut"))->
1342 if(((phig-phil)> fPhiMinCut) && ((phig-phil)<fPhiMaxCut) &&
1343 (rat > fRatioMinCut) && (rat < fRatioMaxCut)) {
1346 (fListHistos->FindObject("AnglePairLeadingCut"))->
1349 (fListHistos->FindObject("InvMassPairLeadingCut"))->
1353 (fListHistos->FindObject("AnglePairAngleCut"))->
1356 (fListHistos->FindObject("InvMassPairAngleCut"))->
1360 (fListHistos->FindObject("InvMassPairAllCut"))->
1363 (fListHistos->FindObject("AnglePairAllCut"))->
1368 eta = particle->Eta() ;
1372 //printf("GetLeadingPi0: %f %f %f %f %f \n", pt, eta, phi, rat, ptg) ;
1378 (fListHistos->FindObject("InvMassPairLeading"))->
1381 (fListHistos->FindObject("AnglePairLeading"))->
1386 Int_t iPrimary = -1;
1387 TLorentzVector gammai,gammaj;
1388 Double_t angle = 0., e = 0., invmass = 0.;
1389 Double_t anglef = 0., ef = 0., invmassf = 0.;
1393 while ( (particle = (TParticle*)next()) ) {
1396 ksPdg = particle->GetPdgCode();
1397 ptl = particle->Pt();
1398 if(ksPdg == 111){ //2 gamma
1400 phil = particle->Phi() ;
1401 if((ptl> pt)&& (rat > fRatioMinCut) && (rat < fRatioMaxCut) &&
1402 ((phig-phil)>fPhiMinCut)&&((phig-phil)<fPhiMaxCut)){
1403 eta = particle->Eta() ;
1408 if(ksPdg == 22){//1 gamma
1409 particle->Momentum(gammai);
1412 while ( (particle = (TParticle*)next2()) ) {
1414 if(jPrimary>iPrimary){
1415 ksPdg = particle->GetPdgCode();
1417 particle->Momentum(gammaj);
1418 //Info("GetLeadingPi0","Egammai %f, Egammaj %f",
1419 //gammai.Pt(),gammaj.Pt());
1421 ptl = (gammai+gammaj).Pt();
1422 phil = (gammai+gammaj).Phi();
1424 phil+=TMath::TwoPi();
1426 invmass = (gammai+gammaj).M();
1427 angle = gammaj.Angle(gammai.Vect());
1428 //Info("GetLeadingPi0","Angle %f", angle);
1429 e = (gammai+gammaj).E();
1432 (fListHistos->FindObject("AnglePairNoCut"))->
1435 (fListHistos->FindObject("InvMassPairNoCut"))->
1438 if((rat > fRatioMinCut) && (rat < fRatioMaxCut) &&
1439 ((phig-phil)>fPhiMinCut)&&((phig-phil)<fPhiMaxCut)){
1442 (fListHistos->FindObject("AnglePairLeadingCut"))->
1445 (fListHistos->FindObject("InvMassPairLeadingCut"))->
1448 if(IsAngleInWindow(angle,e)){
1450 (fListHistos->FindObject("AnglePairAngleCut"))->
1453 (fListHistos->FindObject("InvMassPairAngleCut"))->
1456 //Info("GetLeadingPi0","InvMass %f", invmass);
1457 if((invmass>fInvMassMinCut) && (invmass<fInvMassMaxCut)){
1459 (fListHistos->FindObject("InvMassPairAllCut"))->
1462 (fListHistos->FindObject("AnglePairAllCut"))->
1466 eta = particle->Eta() ;
1470 invmassf = invmass ;
1474 }//(invmass>0.125) && (invmass<0.145)
1475 }//gammaj.Angle(gammai.Vect())<0.04
1477 }//iprimary<jprimary
1485 (fListHistos->FindObject("InvMassPairLeading"))->
1488 (fListHistos->FindObject("AnglePairLeading"))->
1492 // printf("GetLeadingPi0: %f %f %f \n", pt, eta, phi) ;
1496 //____________________________________________________________________________
1497 void AliPHOSGammaJet::InitParameters()
1500 //Initialize the parameters of the analysis.
1502 fAngleMaxParam.Set(4) ;
1503 fAngleMaxParam.AddAt(0.4,0);//={0.4,-0.25,0.025,-2e-4};
1504 fAngleMaxParam.AddAt(-0.25,1) ;
1505 fAngleMaxParam.AddAt(0.025,2) ;
1506 fAngleMaxParam.AddAt(-2e-4,3) ;
1507 fAnyConeOrPt = kFALSE ;
1508 fOutputFileName = "GammaJet.root" ;
1510 fHIJINGFileName = "galice.root" ;
1512 fMinDistance = 3.6 ;
1514 fInvMassMaxCut = 0.15 ;
1515 fInvMassMinCut = 0.12 ;
1516 fOnlyCharged = kFALSE ;
1519 fPhiEMCALCut[0] = 60. *TMath::Pi()/180.;
1520 fPhiEMCALCut[1] = 180.*TMath::Pi()/180.;
1524 fNeutralPtCut = 0.5 ;
1525 fChargedPtCut = 0.5 ;
1526 fTPCCutsLikeEMCAL = kFALSE ;
1527 //Jet selection parameters
1529 fRatioMaxCut = 1.0 ;
1530 fRatioMinCut = 0.1 ;
1531 fJetRatioMaxCut = 1.2 ;
1532 fJetRatioMinCut = 0.8 ;
1533 fJetTPCRatioMaxCut = 1.2 ;
1534 fJetTPCRatioMinCut = 0.3 ;
1538 fESDTree = "esdTree" ;
1541 //Cut depending on gamma energy
1543 fPtJetSelectionCut = 20.; //For Low pt jets+BKG, another limits applyed
1544 //Reconstructed jet energy dependence parameters
1545 //e_jet = a1+e_gamma b2.
1546 //Index 0-> Pt>2 GeV r = 0.3; Index 1-> Pt>0.5 GeV r = 0.3
1547 fJetE1[0] = -5.75; fJetE1[1] = -4.1;
1548 fJetE2[0] = 1.005; fJetE2[1] = 1.05;
1550 //Reconstructed sigma of jet energy dependence parameters
1551 //s_jet = a1+e_gamma b2.
1552 //Index 0-> Pt>2 GeV r = 0.3; Index 1-> Pt>0.5 GeV r = 0.3
1553 fJetSigma1[0] = 2.65; fJetSigma1[1] = 2.75;
1554 fJetSigma2[0] = 0.0018; fJetSigma2[1] = 0.033;
1556 //Background mean energy and RMS
1557 //Index 0-> No BKG; Index 1-> BKG > 2 GeV;
1558 //Index 2-> (low pt jets)BKG > 0.5 GeV;
1559 //Index > 2, same for TPC conf
1560 fBkgMean[0] = 0.; fBkgMean[1] = 8.8 ; fBkgMean[2] = 69.5;
1561 fBkgMean[3] = 0.; fBkgMean[4] = 6.4; fBkgMean[5] = 48.6;
1562 fBkgRMS[0] = 0.; fBkgRMS[1] = 7.5; fBkgRMS[2] = 22.0;
1563 fBkgRMS[3] = 0.; fBkgRMS[4] = 5.4; fBkgRMS[5] = 13.2;
1565 //Factor x of min/max = E -+ x * sigma. Obtained after selecting the
1566 //limits for monoenergetic jets.
1567 //Index 0-> No BKG; Index 1-> BKG > 2 GeV;
1568 //Index 2-> (low pt jets) BKG > 0.5 GeV;
1569 //Index > 2, same for TPC conf
1571 fJetXMin1[0] =-0.69 ; fJetXMin1[1] = 0.39 ; fJetXMin1[2] =-0.88 ;
1572 fJetXMin1[3] =-2.0 ; fJetXMin1[4] =-0.442 ; fJetXMin1[5] =-1.1 ;
1573 fJetXMin2[0] = 0.066; fJetXMin2[1] = 0.038; fJetXMin2[2] = 0.034;
1574 fJetXMin2[3] = 0.25 ; fJetXMin2[4] = 0.113; fJetXMin2[5] = 0.077 ;
1575 fJetXMax1[0] =-3.8 ; fJetXMax1[1] =-0.76 ; fJetXMax1[2] =-3.6 ;
1576 fJetXMax1[3] =-2.7 ; fJetXMax1[4] =-1.21 ; fJetXMax1[5] =-3.7 ;
1577 fJetXMax2[0] =-0.012; fJetXMax2[1] =-0.022; fJetXMax2[2] = 0.016;
1578 fJetXMax2[3] =-0.024; fJetXMax2[4] =-0.008; fJetXMax2[5] = 0.027;
1581 //Photon fast reconstruction
1582 fResPara1 = 0.0255 ; // GeV
1583 fResPara2 = 0.0272 ;
1584 fResPara3 = 0.0129 ;
1586 fPosParaA = 0.096 ; // cm
1589 //Different cones and pt thresholds to construct the jet
1595 fCones[0] = 0.3 ; fNameCones[0] = "03" ;
1596 fPtThres[0] = 0.5 ; fNamePtThres[0] = "05" ;
1600 //__________________________________________________________________________-
1601 Bool_t AliPHOSGammaJet::IsAngleInWindow(const Float_t angle,const Float_t e) {
1602 //Check if the opening angle of the candidate pairs is inside
1603 //our selection windowd
1604 Bool_t result = kFALSE;
1605 Double_t mpi0 = 0.1349766;
1606 Double_t max = fAngleMaxParam.At(0)*TMath::Exp(fAngleMaxParam.At(1)*e)
1607 +fAngleMaxParam.At(2)+fAngleMaxParam.At(3)*e;
1608 Double_t arg = (e*e-2*mpi0*mpi0)/(e*e);
1609 Double_t min = 100. ;
1611 min = TMath::ACos(arg);
1613 if((angle<max)&&(angle>=min))
1619 //__________________________________________________________________________-
1620 Bool_t AliPHOSGammaJet::IsJetSelected(const Double_t ptg, const Double_t ptj,
1621 const TString type ){
1622 //Check if the energy of the reconstructed jet is within an energy window
1630 if(type == "TPC" && !fTPCCutsLikeEMCAL){
1631 iTPC = 3 ;//If(fTPCCutsLikeEMCAL) take jet energy cuts like EMCAL
1636 //Phythia alone, jets with pt_th > 0.2, r = 0.3
1637 par[0] = fJetE1[0]; par[1] = fJetE2[0];
1638 //Energy of the jet peak
1639 //e_jet = fJetE1[0]+fJetE2[0]*e_gamma, simulation fit
1640 par[2] = fJetSigma1[0]; par[3] = fJetSigma2[0];
1641 //Sigma of the jet peak
1642 //sigma_jet = fJetSigma1[0]+fJetSigma2[0]*e_gamma, simulation fit
1643 par[4] = fBkgMean[0 + iTPC]; par[5] = fBkgRMS[0 + iTPC];
1644 //Parameters reserved for HIJING bkg.
1645 xmax[0] = fJetXMax1[0 + iTPC]; xmax[1] = fJetXMax2[0 + iTPC];
1646 xmin[0] = fJetXMin1[0 + iTPC]; xmin[1] = fJetXMin2[0 + iTPC];
1647 //Factor that multiplies sigma to obtain the best limits,
1648 //by observation, of mono jet ratios (ptjet/ptg)
1649 //X_jet = fJetX1[0]+fJetX2[0]*e_gamma
1653 if(ptg > fPtJetSelectionCut){
1654 //Phythia +HIJING with pt_th > 2 GeV/c, r = 0.3
1655 par[0] = fJetE1[0]; par[1] = fJetE2[0];
1656 //Energy of the jet peak, same as in pp
1657 //e_jet = fJetE1[0]+fJetE2[0]*e_gamma, simulation fit
1658 par[2] = fJetSigma1[0]; par[3] = fJetSigma2[0];
1659 //Sigma of the jet peak, same as in pp
1660 //sigma_jet = fJetSigma1[0]+fJetSigma2[0]*e_gamma, simulation fit
1661 par[4] = fBkgMean[1 + iTPC]; par[5] = fBkgRMS[1 + iTPC];
1662 //Mean value and RMS of HIJING Bkg
1663 xmax[0] = fJetXMax1[1 + iTPC]; xmax[1] = fJetXMax2[1 + iTPC];
1664 xmin[0] = fJetXMin1[1 + iTPC]; xmin[1] = fJetXMin2[1 + iTPC];
1665 //Factor that multiplies sigma to obtain the best limits,
1666 //by observation, of mono jet ratios (ptjet/ptg) mixed with HIJING Bkg,
1667 //pt_th > 2 GeV, r = 0.3
1668 //X_jet = fJetX1[0]+fJetX2[0]*e_gamma
1672 //Phythia + HIJING with pt_th > 0.5 GeV/c, r = 0.3
1673 par[0] = fJetE1[1]; par[1] = fJetE2[1];
1674 //Energy of the jet peak, pt_th > 2 GeV/c, r = 0.3
1675 //e_jet = fJetE1[0]+fJetE2[0]*e_gamma, simulation fit
1676 par[2] = fJetSigma1[1]; par[3] = fJetSigma2[1];
1677 //Sigma of the jet peak, pt_th > 2 GeV/c, r = 0.3
1678 //sigma_jet = fJetSigma1[0]+fJetSigma2[0]*e_gamma, simulation fit
1679 par[4] = fBkgMean[2 + iTPC]; par[5] = fBkgRMS[2 + iTPC];
1680 //Mean value and RMS of HIJING Bkg in a 0.3 cone, pt > 2 GeV.
1681 xmax[0] = fJetXMax1[2 + iTPC]; xmax[1] = fJetXMax2[2 + iTPC];
1682 xmin[0] = fJetXMin1[2 + iTPC]; xmin[1] = fJetXMin2[2 + iTPC];
1683 //Factor that multiplies sigma to obtain the best limits,
1684 //by observation, of mono jet ratios (ptjet/ptg) mixed with HIJING Bkg,
1685 //pt_th > 2 GeV, r = 0.3
1686 //X_jet = fJetX1[0]+fJetX2[0]*e_gamma
1688 }//If low pt jet in bkg
1691 //Calculate minimum and maximum limits of the jet ratio.
1692 Double_t min = CalculateJetRatioLimit(ptg, par, xmin);
1693 Double_t max = CalculateJetRatioLimit(ptg, par, xmax);
1695 //Info("IsJetSeleted","%s : Limits min %f, max %f, ptg / ptj %f",
1696 // type.Data(),min,max,ptj/ptg);
1697 if(( min < ptj/ptg ) && ( max > ptj/ptg))
1704 //____________________________________________________________________________
1705 void AliPHOSGammaJet::List() const
1709 Info("List", "%d histograms found", fListHistos->GetEntries() ) ;
1710 TIter next(fListHistos) ;
1712 while ( (h = dynamic_cast<TH2F*>(next())) )
1713 Info("List", "%s", h->GetName()) ;
1716 //____________________________________________________________________________
1717 Double_t AliPHOSGammaJet::MakeEnergy(const Double_t energy)
1719 // Smears the energy according to the energy dependent energy resolution.
1720 // A gaussian distribution is assumed
1722 Double_t sigma = SigmaE(energy) ;
1723 return fRan.Gaus(energy, sigma) ;
1727 //____________________________________________________________________________
1728 void AliPHOSGammaJet::MakeHistos()
1730 // Create histograms to be saved in output file and
1731 // stores them in a TObjectArray
1733 fOutputFile = new TFile(fOutputFileName, "recreate") ;
1735 fListHistos = new TObjArray(10000) ;
1737 // Histos gamma pt vs leading pt
1739 TH1F * hPtSpectra = new TH1F
1740 ("PtSpectra","p_{T i} vs p_{T #gamma}",200,0,200);
1741 hPtSpectra->SetXTitle("p_{T} (GeV/c)");
1742 fListHistos->Add(hPtSpectra) ;
1744 //Histos ratio charged leading pt / gamma pt vs pt
1746 TH2F * hChargeRatio = new TH2F
1747 ("ChargeRatio","p_{T leading charge} /p_{T #gamma} vs p_{T #gamma}",
1749 hChargeRatio->SetYTitle("p_{T lead charge} /p_{T #gamma}");
1750 hChargeRatio->SetXTitle("p_{T #gamma} (GeV/c)");
1751 fListHistos->Add(hChargeRatio) ;
1753 TH2F * hTPCRatio = new TH2F
1754 ("TPCRatio","p_{T leading charge} /p_{T #gamma} vs p_{T #gamma}",
1756 hTPCRatio->SetYTitle("p_{T lead charge} /p_{T #gamma}");
1757 hTPCRatio->SetXTitle("p_{T #gamma} (GeV/c)");
1758 fListHistos->Add(hTPCRatio) ;
1761 TH2F * hPi0Ratio = new TH2F
1762 ("Pi0Ratio","p_{T leading #pi^{0}} /p_{T #gamma} vs p_{T #gamma}",
1764 hPi0Ratio->SetYTitle("p_{T lead #pi^{0}} /p_{T #gamma}");
1765 hPi0Ratio->SetXTitle("p_{T #gamma} (GeV/c)");
1766 fListHistos->Add(hPi0Ratio) ;
1768 TH2F * hPhiGamma = new TH2F
1769 ("PhiGamma","#phi_{#gamma}",200,0,120,200,0,7);
1770 hPhiGamma->SetYTitle("#phi");
1771 hPhiGamma->SetXTitle("p_{T #gamma} (GeV/c)");
1772 fListHistos->Add(hPhiGamma) ;
1774 TH2F * hEtaGamma = new TH2F
1775 ("EtaGamma","#phi_{#gamma}",200,0,120,200,-0.8,0.8);
1776 hEtaGamma->SetYTitle("#eta");
1777 hEtaGamma->SetXTitle("p_{T #gamma} (GeV/c)");
1778 fListHistos->Add(hEtaGamma) ;
1780 // //Jet reconstruction check
1781 // TH2F * hDeltaPhiJet = new TH2F
1782 // ("DeltaPhiJet","#phi_{jet} - #phi_{pyth jet} vs p_{T #gamma}",
1783 // 200,0,120,200,-1.5,1.5);
1784 // hDeltaPhiJet->SetYTitle("#Delta #phi");
1785 // hDeltaPhiJet->SetXTitle("p_{T #gamma} (GeV/c)");
1786 // fListHistos->Add(hDeltaPhiJet) ;
1788 // TH2F * hDeltaPhiTPCJet = new TH2F
1789 // ("DeltaPhiTPCJet","#phi_{jet TPC} - #phi_{pyth jet} vs p_{T #gamma}",
1790 // 200,0,120,200,-1.5,1.5);
1791 // hDeltaPhiTPCJet->SetYTitle("#Delta #phi");
1792 // hDeltaPhiTPCJet->SetXTitle("p_{T #gamma} (GeV/c)");
1793 // fListHistos->Add(hDeltaPhiTPCJet) ;
1795 // TH2F * hDeltaEtaJet = new TH2F
1796 // ("DeltaEtaJet","#phi_{jet} - #phi_{pyth jet} vs p_{T #gamma}",
1797 // 200,0,120,200,-1.5,1.5);
1798 // hDeltaEtaJet->SetYTitle("#Delta #phi");
1799 // hDeltaEtaJet->SetXTitle("p_{T #gamma} (GeV/c)");
1800 // fListHistos->Add(hDeltaEtaJet) ;
1802 // TH2F * hDeltaEtaTPCJet = new TH2F
1803 // ("DeltaEtaTPCJet","#phi_{jet TPC} - #phi_{pyth jet} vs p_{T #gamma}",
1804 // 200,0,120,200,-1.5,1.5);
1805 // hDeltaEtaTPCJet->SetYTitle("#Delta #phi");
1806 // hDeltaEtaTPCJet->SetXTitle("p_{T #gamma} (GeV/c)");
1807 // fListHistos->Add(hDeltaEtaTPCJet) ;
1809 // TH2F * hDeltaPtJet = new TH2F
1810 // ("DeltaPtJet","#phi_{jet} - #phi_{pyth jet} vs p_{T #gamma}",
1811 // 200,0,120,200,0.,100.);
1812 // hDeltaPtJet->SetYTitle("#Delta #phi");
1813 // hDeltaPtJet->SetXTitle("p_{T #gamma} (GeV/c)");
1814 // fListHistos->Add(hDeltaPtJet) ;
1816 // TH2F * hDeltaPtTPCJet = new TH2F
1817 // ("DeltaPtTPCJet","#phi_{jet TPC} - #phi_{pyth jet} vs p_{T #gamma}",
1818 // 200,0,120,200,0.,100.);
1819 // hDeltaPtTPCJet->SetYTitle("#Delta #phi");
1820 // hDeltaPtTPCJet->SetXTitle("p_{T #gamma} (GeV/c)");
1821 // fListHistos->Add(hDeltaPtTPCJet) ;
1824 TH2F * hDeltaPhiCharge = new TH2F
1825 ("DeltaPhiCharge","#phi_{#gamma} - #phi_{charge} vs p_{T #gamma}",
1826 200,0,120,200,0,6.4);
1827 hDeltaPhiCharge->SetYTitle("#Delta #phi");
1828 hDeltaPhiCharge->SetXTitle("p_{T #gamma} (GeV/c)");
1829 fListHistos->Add(hDeltaPhiCharge) ;
1831 TH2F * hDeltaPhiTPC = new TH2F
1832 ("DeltaPhiTPC","#phi_{#gamma} - #phi_{charge} vs p_{T #gamma}",
1833 200,0,120,200,0,6.4);
1834 hDeltaPhiTPC->SetYTitle("#Delta #phi");
1835 hDeltaPhiTPC->SetXTitle("p_{T #gamma} (GeV/c)");
1836 fListHistos->Add(hDeltaPhiTPC) ;
1837 TH2F * hDeltaPhiPi0 = new TH2F
1838 ("DeltaPhiPi0","#phi_{#gamma} - #phi_{ #pi^{0}} vs p_{T #gamma}",
1839 200,0,120,200,0,6.4);
1840 hDeltaPhiPi0->SetYTitle("#Delta #phi");
1841 hDeltaPhiPi0->SetXTitle("p_{T #gamma} (GeV/c)");
1842 fListHistos->Add(hDeltaPhiPi0) ;
1844 TH2F * hDeltaEtaCharge = new TH2F
1845 ("DeltaEtaCharge","#eta_{#gamma} - #eta_{charge} vs p_{T #gamma}",
1846 200,0,120,200,-2,2);
1847 hDeltaEtaCharge->SetYTitle("#Delta #eta");
1848 hDeltaEtaCharge->SetXTitle("p_{T #gamma} (GeV/c)");
1849 fListHistos->Add(hDeltaEtaCharge) ;
1851 TH2F * hDeltaEtaTPC = new TH2F
1852 ("DeltaEtaTPC","#eta_{#gamma} - #eta_{charge} vs p_{T #gamma}",
1853 200,0,120,200,-2,2);
1854 hDeltaEtaTPC->SetYTitle("#Delta #eta");
1855 hDeltaEtaTPC->SetXTitle("p_{T #gamma} (GeV/c)");
1856 fListHistos->Add(hDeltaEtaTPC) ;
1858 TH2F * hDeltaEtaPi0 = new TH2F
1859 ("DeltaEtaPi0","#eta_{#gamma} - #eta_{ #pi^{0}} vs p_{T #gamma}",
1860 200,0,120,200,-2,2);
1861 hDeltaEtaPi0->SetYTitle("#Delta #eta");
1862 hDeltaEtaPi0->SetXTitle("p_{T #gamma} (GeV/c)");
1863 fListHistos->Add(hDeltaEtaPi0) ;
1867 TH2F * hAnglePair = new TH2F
1869 "Angle between #pi^{0} #gamma pair vs p_{T #pi^{0}}",
1870 200,0,50,200,0,0.2);
1871 hAnglePair->SetYTitle("Angle (rad)");
1872 hAnglePair->SetXTitle("E_{ #pi^{0}} (GeV/c)");
1873 fListHistos->Add(hAnglePair) ;
1875 TH2F * hAnglePairAccepted = new TH2F
1876 ("AnglePairAccepted",
1877 "Angle between #pi^{0} #gamma pair vs p_{T #pi^{0}}, both #gamma in eta<0.7, inside window",
1878 200,0,50,200,0,0.2);
1879 hAnglePairAccepted->SetYTitle("Angle (rad)");
1880 hAnglePairAccepted->SetXTitle("E_{ #pi^{0}} (GeV/c)");
1881 fListHistos->Add(hAnglePairAccepted) ;
1883 TH2F * hAnglePairNoCut = new TH2F
1885 "Angle between all #gamma pair vs p_{T #pi^{0}}",200,0,50,200,0,0.2);
1886 hAnglePairNoCut->SetYTitle("Angle (rad)");
1887 hAnglePairNoCut->SetXTitle("E_{ #pi^{0}} (GeV/c)");
1888 fListHistos->Add(hAnglePairNoCut) ;
1890 TH2F * hAnglePairLeadingCut = new TH2F
1891 ("AnglePairLeadingCut",
1892 "Angle between all #gamma pair that have a good phi and pt vs p_{T #pi^{0}}",
1893 200,0,50,200,0,0.2);
1894 hAnglePairLeadingCut->SetYTitle("Angle (rad)");
1895 hAnglePairLeadingCut->SetXTitle("E_{ #pi^{0}} (GeV/c)");
1896 fListHistos->Add(hAnglePairLeadingCut) ;
1898 TH2F * hAnglePairAngleCut = new TH2F
1899 ("AnglePairAngleCut",
1900 "Angle between all #gamma pair (angle + leading cut) vs p_{T #pi^{0}}"
1901 ,200,0,50,200,0,0.2);
1902 hAnglePairAngleCut->SetYTitle("Angle (rad)");
1903 hAnglePairAngleCut->SetXTitle("E_{ #pi^{0}} (GeV/c)");
1904 fListHistos->Add(hAnglePairAngleCut) ;
1906 TH2F * hAnglePairAllCut = new TH2F
1908 "Angle between all #gamma pair (angle + inv mass cut+leading) vs p_{T #pi^{0}}"
1909 ,200,0,50,200,0,0.2);
1910 hAnglePairAllCut->SetYTitle("Angle (rad)");
1911 hAnglePairAllCut->SetXTitle("E_{ #pi^{0}} (GeV/c)");
1912 fListHistos->Add(hAnglePairAllCut) ;
1914 TH2F * hAnglePairLeading = new TH2F
1915 ("AnglePairLeading",
1916 "Angle between all #gamma pair finally selected vs p_{T #pi^{0}}",
1917 200,0,50,200,0,0.2);
1918 hAnglePairLeading->SetYTitle("Angle (rad)");
1919 hAnglePairLeading->SetXTitle("E_{ #pi^{0}} (GeV/c)");
1920 fListHistos->Add(hAnglePairLeading) ;
1923 TH2F * hInvMassPairNoCut = new TH2F
1924 ("InvMassPairNoCut","Invariant Mass of all #gamma pair vs p_{T #gamma}",
1925 120,0,120,360,0,0.5);
1926 hInvMassPairNoCut->SetYTitle("Invariant Mass (GeV/c^{2})");
1927 hInvMassPairNoCut->SetXTitle("p_{T #gamma} (GeV/c)");
1928 fListHistos->Add(hInvMassPairNoCut) ;
1930 TH2F * hInvMassPairLeadingCut = new TH2F
1931 ("InvMassPairLeadingCut",
1932 "Invariant Mass of #gamma pair (leading cuts) vs p_{T #gamma}",
1933 120,0,120,360,0,0.5);
1934 hInvMassPairLeadingCut->SetYTitle("Invariant Mass (GeV/c^{2})");
1935 hInvMassPairLeadingCut->SetXTitle("p_{T #gamma} (GeV/c)");
1936 fListHistos->Add(hInvMassPairLeadingCut) ;
1938 TH2F * hInvMassPairAngleCut = new TH2F
1939 ("InvMassPairAngleCut",
1940 "Invariant Mass of #gamma pair (angle cut) vs p_{T #gamma}",
1941 120,0,120,360,0,0.5);
1942 hInvMassPairAngleCut->SetYTitle("Invariant Mass (GeV/c^{2})");
1943 hInvMassPairAngleCut->SetXTitle("p_{T #gamma} (GeV/c)");
1944 fListHistos->Add(hInvMassPairAngleCut) ;
1947 TH2F * hInvMassPairAllCut = new TH2F
1948 ("InvMassPairAllCut",
1949 "Invariant Mass of #gamma pair (angle+invmass cut+leading) vs p_{T #gamma}",
1950 120,0,120,360,0,0.5);
1951 hInvMassPairAllCut->SetYTitle("Invariant Mass (GeV/c^{2})");
1952 hInvMassPairAllCut->SetXTitle("p_{T #gamma} (GeV/c)");
1953 fListHistos->Add(hInvMassPairAllCut) ;
1955 TH2F * hInvMassPairLeading = new TH2F
1956 ("InvMassPairLeading",
1957 "Invariant Mass of #gamma pair selected vs p_{T #gamma}",
1958 120,0,120,360,0,0.5);
1959 hInvMassPairLeading->SetYTitle("Invariant Mass (GeV/c^{2})");
1960 hInvMassPairLeading->SetXTitle("p_{T #gamma} (GeV/c)");
1961 fListHistos->Add(hInvMassPairLeading) ;
1966 TH1F * hNGamma = new TH1F("NGamma","Number of #gamma over PHOS",240,0,120);
1967 hNGamma->SetYTitle("N");
1968 hNGamma->SetXTitle("p_{T #gamma}(GeV/c)");
1969 fListHistos->Add(hNGamma) ;
1971 TH1F * hNBkg = new TH1F("NBkg","bkg multiplicity",9000,0,9000);
1972 hNBkg->SetYTitle("counts");
1973 hNBkg->SetXTitle("N");
1974 fListHistos->Add(hNBkg) ;
1976 TH2F * hNLeading = new TH2F
1977 ("NLeading","Accepted Jet Leading", 240,0,120,240,0,120);
1978 hNLeading->SetYTitle("p_{T charge} (GeV/c)");
1979 hNLeading->SetXTitle("p_{T #gamma}(GeV/c)");
1980 fListHistos->Add(hNLeading) ;
1983 TH1F * hN = new TH1F("NJet","Accepted jets",240,0,120);
1985 hN->SetXTitle("p_{T #gamma}(GeV/c)");
1986 fListHistos->Add(hN) ;
1989 //Ratios and Pt dist of reconstructed (not selected) jets
1991 TH2F * hJetRatio = new TH2F
1992 ("JetRatio","p_{T jet lead}/p_{T #gamma} vs p_{T #gamma}",
1993 240,0,120,200,0,10);
1994 hJetRatio->SetYTitle("p_{T jet lead #pi^{0}}/p_{T #gamma}");
1995 hJetRatio->SetXTitle("p_{T #gamma} (GeV/c)");
1996 fListHistos->Add(hJetRatio) ;
1999 TH2F * hJetPt = new TH2F
2000 ("JetPt", "p_{T jet lead} vs p_{T #gamma}",240,0,120,400,0,200);
2001 hJetPt->SetYTitle("p_{T jet lead #pi^{0}}/p_{T #gamma}");
2002 hJetPt->SetXTitle("p_{T #gamma} (GeV/c)");
2003 fListHistos->Add(hJetPt) ;
2008 TH2F * hBkgRatio = new TH2F
2009 ("BkgRatio","p_{T bkg lead}/p_{T #gamma} vs p_{T #gamma}",
2010 240,0,120,200,0,10);
2011 hBkgRatio->SetYTitle("p_{T bkg lead charge}/p_{T #gamma}");
2012 hBkgRatio->SetXTitle("p_{T #gamma} (GeV/c)");
2013 fListHistos->Add(hBkgRatio) ;
2016 TH2F * hBkgPt = new TH2F
2017 ("BkgPt","p_{T jet lead} vs p_{T #gamma}",240,0,120,400,0,200);
2018 hBkgPt->SetYTitle("p_{T jet lead charge}/p_{T #gamma}");
2019 hBkgPt->SetXTitle("p_{T #gamma} (GeV/c)");
2020 fListHistos->Add(hBkgPt) ;
2025 TH2F * hJetFragment =
2026 new TH2F("JetFragment","x = p_{T i charged}/p_{T #gamma}",
2027 240,0.,120.,1000,0.,1.2);
2028 hJetFragment->SetYTitle("x_{T}");
2029 hJetFragment->SetXTitle("p_{T #gamma}");
2030 fListHistos->Add(hJetFragment) ;
2032 TH2F * hBkgFragment = new TH2F
2033 ("BkgFragment","x = p_{T i charged}/p_{T #gamma}",
2034 240,0.,120.,1000,0.,1.2);
2035 hBkgFragment->SetYTitle("x_{T}");
2036 hBkgFragment->SetXTitle("p_{T #gamma}");
2037 fListHistos->Add(hBkgFragment) ;
2040 new TH2F("JetPtDist","x = p_{T i charged}",240,0.,120.,400,0.,200.);
2041 hJetPtDist->SetXTitle("p_{T #gamma} (GeV/c)");
2042 fListHistos->Add(hJetPtDist) ;
2044 TH2F * hBkgPtDist = new TH2F
2045 ("BkgPtDist","x = p_{T i charged}",240,0.,120.,400,0.,200.);
2046 hBkgPtDist->SetXTitle("p_{T #gamma} (GeV/c)");
2047 fListHistos->Add(hBkgPtDist) ;
2052 TH1F * hNBkgTPC = new TH1F
2053 ("NBkgTPC","TPC bkg multiplicity ",9000,0,9000);
2054 hNBkgTPC->SetYTitle("counts");
2055 hNBkgTPC->SetXTitle("N");
2056 fListHistos->Add(hNBkgTPC) ;
2058 TH2F * hNTPCLeading = new TH2F
2059 ("NTPCLeading","Accepted TPC jet leading",240,0,120,240,0,120);
2060 hNTPCLeading->SetYTitle("p_{T charge} (GeV/c)");
2061 hNTPCLeading->SetXTitle("p_{T #gamma}(GeV/c)");
2062 fListHistos->Add(hNTPCLeading) ;
2064 TH1F * hNTPC = new TH1F("NTPCJet","Number of TPC jets",240,0,120);
2065 hNTPC->SetYTitle("N");
2066 hNTPC->SetXTitle("p_{T #gamma}(GeV/c)");
2067 fListHistos->Add(hNTPC) ;
2069 TH2F * hJetTPCRatio = new TH2F
2070 ("JetTPCRatio", "p_{T jet lead TPC}/p_{T #gamma} vs p_{T #gamma}",
2071 240,0,120,200,0,10);
2072 hJetTPCRatio->SetYTitle("p_{T jet lead TPC}/p_{T #gamma}");
2073 hJetTPCRatio->SetXTitle("p_{T #gamma} (GeV/c)");
2074 fListHistos->Add(hJetTPCRatio) ;
2076 TH2F * hBkgTPCRatio = new TH2F
2077 ("BkgTPCRatio","p_{T bkg lead TPC}/p_{T #gamma} vs p_{T #gamma}",
2078 240,0,120,200,0,10);
2079 hBkgTPCRatio->SetYTitle("p_{T bkg lead TPC}/p_{T #gamma}");
2080 hBkgTPCRatio->SetXTitle("p_{T #gamma} (GeV/c)");
2081 fListHistos->Add(hBkgTPCRatio) ;
2083 TH2F * hJetTPCPt = new TH2F
2084 ("JetTPCPt", "p_{T jet lead TPC} vs p_{T #gamma}",240,0,120,400,0,200);
2085 hJetTPCPt->SetYTitle("p_{T jet lead TPC}/p_{T #gamma}");
2086 hJetTPCPt->SetXTitle("p_{T #gamma} (GeV/c)");
2087 fListHistos->Add(hJetTPCPt) ;
2089 TH2F * hBkgTPCPt = new TH2F
2090 ("BkgTPCPt", "p_{T bkg lead TPC} vs p_{T #gamma}",240,0,120,400,0,200);
2091 hBkgTPCPt->SetYTitle("p_{T bkg lead TPC}/p_{T #gamma}");
2092 hBkgTPCPt->SetXTitle("p_{T #gamma} (GeV/c)");
2093 fListHistos->Add(hBkgTPCPt) ;
2097 TH2F * hJetTPCFragment =
2098 new TH2F("JetTPCFragment","x = p_{T i charged}/p_{T #gamma}",
2099 240,0.,120.,1000,0.,1.2);
2100 hJetTPCFragment->SetYTitle("x_{T}");
2101 hJetTPCFragment->SetXTitle("p_{T #gamma}");
2102 fListHistos->Add(hJetTPCFragment) ;
2104 TH2F * hBkgTPCFragment = new TH2F
2105 ("BkgTPCFragment","x = p_{T i charged}/p_{T #gamma}",
2106 240,0.,120.,1000,0.,1.2);
2107 hBkgTPCFragment->SetYTitle("x_{T}");
2108 hBkgTPCFragment->SetXTitle("p_{T #gamma}");
2109 fListHistos->Add(hBkgTPCFragment) ;
2112 TH2F * hJetTPCPtDist = new TH2F("JetTPCPtDist",
2113 "x = p_{T i charged}",240,0.,120.,400,0.,200.);
2114 hJetTPCPtDist->SetXTitle("p_{T #gamma} (GeV/c)");
2115 fListHistos->Add(hJetTPCPtDist) ;
2117 TH2F * hBkgTPCPtDist = new TH2F
2118 ("BkgTPCPtDist","x = p_{T i charged}",240,0.,120.,400,0.,200.);
2119 hBkgTPCPtDist->SetXTitle("p_{T #gamma} (GeV/c)");
2120 fListHistos->Add(hBkgTPCPtDist) ;
2126 //If we want to study the jet for different cones and pt. Old version
2128 TH2F * hJetRatios[5][5];
2129 TH2F * hJetTPCRatios[5][5];
2131 TH2F * hJetPts[5][5];
2132 TH2F * hJetTPCPts[5][5];
2134 TH2F * hBkgRatios[5][5];
2135 TH2F * hBkgTPCRatios[5][5];
2137 TH2F * hBkgPts[5][5];
2138 TH2F * hBkgTPCPts[5][5];
2140 TH2F * hNLeadings[5][5];
2141 TH2F * hNTPCLeadings[5][5];
2144 TH1F * hNTPCs[5][5];
2146 TH1F * hNBkgs[5][5];
2147 TH1F * hNBkgTPCs[5][5];
2149 TH2F * hJetFragments[5][5];
2150 TH2F * hBkgFragments[5][5];
2151 TH2F * hJetPtDists[5][5];
2152 TH2F * hBkgPtDists[5][5];
2154 TH2F * hJetTPCFragments[5][5];
2155 TH2F * hBkgTPCFragments[5][5];
2156 TH2F * hJetTPCPtDists[5][5];
2157 TH2F * hBkgTPCPtDists[5][5];
2160 for(Int_t icone = 0; icone<fNCone; icone++){
2161 for(Int_t ipt = 0; ipt<fNPt;ipt++){
2166 hJetRatios[icone][ipt] = new TH2F
2167 ("JetRatioCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
2168 "p_{T jet lead #pi^{0}}/p_{T #gamma} vs p_{T #gamma}, cone ="
2169 +fNameCones[icone]+", pt>" +fNamePtThres[ipt]+" GeV/c",
2170 240,0,120,200,0,10);
2171 hJetRatios[icone][ipt]->
2172 SetYTitle("p_{T jet lead #pi^{0}}/p_{T #gamma}");
2173 hJetRatios[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
2174 fListHistos->Add(hJetRatios[icone][ipt]) ;
2177 hJetPts[icone][ipt] = new TH2F
2178 ("JetPtCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
2179 "p_{T jet lead #pi^{0}}/p_{T #gamma} vs p_{T #gamma}, cone ="
2180 +fNameCones[icone]+", pt>" +fNamePtThres[ipt]+" GeV/c",
2181 240,0,120,400,0,200);
2182 hJetPts[icone][ipt]->
2183 SetYTitle("p_{T jet lead #pi^{0}}/p_{T #gamma}");
2184 hJetPts[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
2185 fListHistos->Add(hJetPts[icone][ipt]) ;
2189 hBkgRatios[icone][ipt] = new TH2F
2190 ("BkgRatioCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
2191 "p_{T bkg lead #pi^{0}}/p_{T #gamma} vs p_{T #gamma}, cone ="
2192 +fNameCones[icone]+", pt>" +fNamePtThres[ipt]+" GeV/c",
2193 240,0,120,200,0,10);
2194 hBkgRatios[icone][ipt]->
2195 SetYTitle("p_{T bkg lead #pi^{0}}/p_{T #gamma}");
2196 hBkgRatios[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
2197 fListHistos->Add(hBkgRatios[icone][ipt]) ;
2201 hBkgPts[icone][ipt] = new TH2F
2202 ("BkgPtCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
2203 "p_{T jet lead #pi^{0}}/p_{T #gamma} vs p_{T #gamma}, cone ="
2204 +fNameCones[icone]+", pt>" +fNamePtThres[ipt]+" GeV/c",
2205 240,0,120,400,0,200);
2206 hBkgPts[icone][ipt]->
2207 SetYTitle("p_{T jet lead #pi^{0}}/p_{T #gamma}");
2208 hBkgPts[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
2209 fListHistos->Add(hBkgPts[icone][ipt]) ;
2214 hJetTPCRatios[icone][ipt] = new TH2F
2215 ("JetTPCRatioCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
2216 "p_{T jet lead TPC}/p_{T #gamma} vs p_{T #gamma}, cone ="
2217 +fNameCones[icone]+", pt>" +fNamePtThres[ipt]+" GeV/c",
2218 240,0,120,200,0,10);
2219 hJetTPCRatios[icone][ipt]->SetYTitle("p_{T jet lead TPC}/p_{T #gamma}");
2220 hJetTPCRatios[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
2221 fListHistos->Add(hJetTPCRatios[icone][ipt]) ;
2223 hBkgTPCRatios[icone][ipt] = new TH2F
2224 ("BkgTPCRatioCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
2225 "p_{T bkg lead TPC}/p_{T #gamma} vs p_{T #gamma}, cone ="
2226 +fNameCones[icone]+", pt>" +fNamePtThres[ipt]+" GeV/c",
2227 240,0,120,200,0,10);
2228 hBkgTPCRatios[icone][ipt]->SetYTitle("p_{T bkg lead TPC}/p_{T #gamma}");
2229 hBkgTPCRatios[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
2230 fListHistos->Add(hBkgTPCRatios[icone][ipt]) ;
2232 hJetTPCPts[icone][ipt] = new TH2F
2233 ("JetTPCPtCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
2234 "p_{T jet lead TPC}/p_{T #gamma} vs p_{T #gamma}, cone ="
2235 +fNameCones[icone]+", pt>" +fNamePtThres[ipt]+" GeV/c",
2236 240,0,120,400,0,200);
2237 hJetTPCPts[icone][ipt]->SetYTitle("p_{T jet lead TPC}/p_{T #gamma}");
2238 hJetTPCPts[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
2239 fListHistos->Add(hJetTPCPts[icone][ipt]) ;
2241 hBkgTPCPts[icone][ipt] = new TH2F
2242 ("BkgTPCPtCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
2243 "p_{T bkg lead TPC}/p_{T #gamma} vs p_{T #gamma}, cone ="
2244 +fNameCones[icone]+", pt>" +fNamePtThres[ipt]+" GeV/c",
2245 240,0,120,400,0,200);
2246 hBkgTPCPts[icone][ipt]->SetYTitle("p_{T bkg lead TPC}/p_{T #gamma}");
2247 hBkgTPCPts[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
2248 fListHistos->Add(hBkgTPCPts[icone][ipt]) ;
2253 hNBkgs[icone][ipt] = new TH1F
2254 ("NBkgCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
2255 "bkg multiplicity cone ="+fNameCones[icone]+", pt>"
2256 +fNamePtThres[ipt]+" GeV/c",9000,0,9000);
2257 hNBkgs[icone][ipt]->SetYTitle("counts");
2258 hNBkgs[icone][ipt]->SetXTitle("N");
2259 fListHistos->Add(hNBkgs[icone][ipt]) ;
2261 hNBkgTPCs[icone][ipt] = new TH1F
2262 ("NBkgTPCCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
2263 "bkg multiplicity cone ="+fNameCones[icone]+", pt>"
2264 +fNamePtThres[ipt]+" GeV/c",9000,0,9000);
2265 hNBkgTPCs[icone][ipt]->SetYTitle("counts");
2266 hNBkgTPCs[icone][ipt]->SetXTitle("N");
2267 fListHistos->Add(hNBkgTPCs[icone][ipt]) ;
2270 hNLeadings[icone][ipt] = new TH2F
2271 ("NLeadingCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
2272 "p_{T #gamma} vs p_{T #pi^{0}} cone ="+fNameCones[icone]+", pt>"
2273 +fNamePtThres[ipt]+" GeV/c",120,0,120,120,0,120);
2274 hNLeadings[icone][ipt]->SetYTitle("p_{T #pi^{0}}(GeV/c)");
2275 hNLeadings[icone][ipt]->SetXTitle("p_{T #gamma}(GeV/c)");
2276 fListHistos->Add(hNLeadings[icone][ipt]) ;
2278 hNs[icone][ipt] = new TH1F
2279 ("NJetCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
2280 "Number of neutral jets, cone ="+fNameCones[icone]+", pt>"
2281 +fNamePtThres[ipt]+" GeV/c",120,0,120);
2282 hNs[icone][ipt]->SetYTitle("N");
2283 hNs[icone][ipt]->SetXTitle("p_{T #gamma}(GeV/c)");
2284 fListHistos->Add(hNs[icone][ipt]) ;
2286 //Fragmentation Function
2287 hJetFragments[icone][ipt] = new TH2F
2288 ("JetFragmentCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
2289 "x_{T} = p_{T i}/p_{T #gamma}, cone ="+fNameCones[icone]+", pt>"
2290 +fNamePtThres[ipt]+" GeV/c",120,0.,120.,240,0.,1.2);
2291 hJetFragments[icone][ipt]->SetYTitle("x_{T}");
2292 hJetFragments[icone][ipt]->SetXTitle("p_{T #gamma}");
2293 fListHistos->Add(hJetFragments[icone][ipt]) ;
2295 hBkgFragments[icone][ipt] = new TH2F
2296 ("BkgFragmentCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
2297 "x_{T} = p_{T i}/p_{T #gamma}, cone ="+fNameCones[icone]+", pt>"
2298 +fNamePtThres[ipt]+" GeV/c",120,0.,120.,240,0.,1.2);
2299 hBkgFragments[icone][ipt]->SetYTitle("x_{T}");
2300 hBkgFragments[icone][ipt]->SetXTitle("p_{T #gamma}");
2301 fListHistos->Add(hBkgFragments[icone][ipt]) ;
2304 //Jet particle distribution
2306 hJetPtDists[icone][ipt] = new TH2F
2307 ("JetPtDistCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
2308 "p_{T i}, cone ="+fNameCones[icone]+", pt>" +fNamePtThres[ipt]+
2309 " GeV/c",120,0.,120.,120,0.,120.);
2310 hJetPtDists[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
2311 fListHistos->Add(hJetPtDists[icone][ipt]) ;
2313 hBkgPtDists[icone][ipt] = new TH2F
2314 ("BkgPtDistCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
2315 "p_{T i}, cone ="+fNameCones[icone]+", pt>" +fNamePtThres[ipt]+
2316 " GeV/c",120,0.,120.,120,0.,120.);
2317 hBkgPtDists[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
2318 fListHistos->Add(hBkgPtDists[icone][ipt]) ;
2322 hNTPCLeadings[icone][ipt] = new TH2F
2323 ("NTPCLeadingCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
2324 "p_{T #gamma} vs p_{T charge} cone ="+fNameCones[icone]+", pt>"
2325 +fNamePtThres[ipt]+" GeV/c",120,0,120,120,0,120);
2326 hNTPCLeadings[icone][ipt]->SetYTitle("p_{T charge} (GeV/c)");
2327 hNTPCLeadings[icone][ipt]->SetXTitle("p_{T #gamma}(GeV/c)");
2328 fListHistos->Add(hNTPCLeadings[icone][ipt]) ;
2330 hNTPCs[icone][ipt] = new TH1F
2331 ("NTPCJetCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
2332 "Number of charged jets, cone ="+fNameCones[icone]+", pt>"
2333 +fNamePtThres[ipt]+" GeV/c",120,0,120);
2334 hNTPCs[icone][ipt]->SetYTitle("N");
2335 hNTPCs[icone][ipt]->SetXTitle("p_{T #gamma}(GeV/c)");
2336 fListHistos->Add(hNTPCs[icone][ipt]) ;
2338 hJetTPCFragments[icone][ipt] = new TH2F
2339 ("JetTPCFragmentCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
2340 "x = p_{T i charged}/p_{T #gamma}, cone ="+fNameCones[icone]+", pt>"
2341 +fNamePtThres[ipt]+" GeV/c",120,0.,120.,240,0.,1.2);
2342 hJetTPCFragments[icone][ipt]->SetYTitle("x_{T}");
2343 hJetTPCFragments[icone][ipt]->SetXTitle("p_{T #gamma}");
2344 fListHistos->Add(hJetTPCFragments[icone][ipt]) ;
2346 hBkgTPCFragments[icone][ipt] = new TH2F
2347 ("BkgTPCFragmentCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
2348 "x = p_{T i charged}/p_{T #gamma}, cone ="+fNameCones[icone]+", pt>"
2349 +fNamePtThres[ipt]+" GeV/c",120,0.,120.,240,0.,1.2);
2350 hBkgTPCFragments[icone][ipt]->SetYTitle("x_{T}");
2351 hBkgTPCFragments[icone][ipt]->SetXTitle("p_{T #gamma}");
2352 fListHistos->Add(hBkgTPCFragments[icone][ipt]) ;
2354 hJetTPCPtDists[icone][ipt] = new TH2F
2355 ("JetTPCPtDistCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
2356 "x = p_{T i charged}, cone ="+fNameCones[icone]+", pt>"
2357 +fNamePtThres[ipt]+" GeV/c",120,0.,120.,120,0.,120.);
2358 hJetTPCPtDists[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
2359 fListHistos->Add(hJetTPCPtDists[icone][ipt]) ;
2361 hBkgTPCPtDists[icone][ipt] = new TH2F
2362 ("BkgTPCPtDistCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
2363 "x = p_{T i charged}, cone ="+fNameCones[icone]+", pt>" +
2364 fNamePtThres[ipt]+" GeV/c",120,0.,120.,120,0.,120.);
2365 hBkgTPCPtDists[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
2366 fListHistos->Add(hBkgTPCPtDists[icone][ipt]) ;
2370 }//If we want to study any cone or pt threshold
2374 //____________________________________________________________________________
2375 void AliPHOSGammaJet::MakeJet(TClonesArray * pl,
2376 Double_t ptg, Double_t phig,
2377 Double_t ptl, Double_t phil, Double_t etal,
2378 TString conf, TLorentzVector & jet)
2380 //Fill the jet with the particles around the leading particle with
2381 //R=fCone and pt_th = fPtThres. Calculate the energy of the jet and
2382 //check if we select it. Fill jet histograms
2383 Float_t ptcut = 0. ;
2385 if(ptg > fPtJetSelectionCut) ptcut = 2. ;
2389 TClonesArray * jetList = new TClonesArray("TParticle",1000);
2390 TClonesArray * bkgList = new TClonesArray("TParticle",1000);
2392 TLorentzVector bkg(0,0,0,0);
2393 TLorentzVector lv (0,0,0,0);
2395 Double_t ptjet = 0.0;
2396 Double_t ptbkg = 0.0;
2403 TParticle * particle = 0 ;
2405 while ( (particle = dynamic_cast<TParticle*>(next())) ) {
2411 SetJet(particle, b0, fCone, etal, phil) ;
2414 new((*jetList)[n0++]) TParticle(*particle) ;
2415 particle->Momentum(lv);
2416 if(particle->Pt() > ptcut ){
2418 ptjet+=particle->Pt();
2422 //Background around (phi_gamma-pi, eta_leading)
2423 SetJet(particle, b1, fCone,etal, phig) ;
2426 new((*bkgList)[n1++]) TParticle(*particle) ;
2427 if(particle->Pt() > ptcut ){
2429 ptbkg+=particle->Pt();
2437 if(strstr(fOptionGJ,"deb") || strstr(fOptionGJ,"deb all"))
2438 Info("MakeJet","Gamma pt %f, Jet pt %f, Bkg pt %f",ptg,ptjet,ptbkg);
2443 Double_t rat = ptjet/ptg ;
2444 Double_t ratbkg = ptbkg/ptg ;
2447 (fListHistos->FindObject("Jet"+conf+"Ratio"))->Fill(ptg,rat);
2449 (fListHistos->FindObject("Jet"+conf+"Pt")) ->Fill(ptg,ptjet);
2451 (fListHistos->FindObject("Bkg"+conf+"Ratio"))->Fill(ptg,ratbkg);
2453 (fListHistos->FindObject("Bkg"+conf+"Pt")) ->Fill(ptg,ptbkg);
2456 if(IsJetSelected(ptg,ptjet,conf) || fSelect){
2457 if(strstr(fOptionGJ,"deb") || strstr(fOptionGJ,"deb all"))
2458 Info("MakeJet","JetSelected");
2459 dynamic_cast<TH1F*>(fListHistos->FindObject("N"+conf+"Jet"))->
2461 dynamic_cast<TH2F*>(fListHistos->FindObject("N"+conf+"Leading"))
2463 FillJetHistos(jetList, ptg, conf, "Jet");
2464 FillJetHistos(bkgList, ptg, conf, "Bkg");
2471 //____________________________________________________________________________
2472 void AliPHOSGammaJet::MakeJetAnyConeOrPt(TClonesArray * pl, Double_t ptg,
2473 Double_t phig, Double_t ptl,
2474 Double_t phil, Double_t etal,
2477 //Fill the jet with the particles around the leading particle with
2478 //R=fCone(i) and pt_th = fPtThres(i). Calculate the energy of the jet and
2479 //check if we select it. Fill jet i histograms
2481 TClonesArray * jetList = new TClonesArray("TParticle",1000);
2482 TClonesArray * bkgList = new TClonesArray("TParticle",1000);
2484 Double_t ptjet = 0.0;
2485 Double_t ptbkg = 0.0;
2492 //Create as many jets as cones and pt thresholds are defined
2493 Double_t maxcut = fJetRatioMaxCut;
2494 Double_t mincut = fJetRatioMinCut;
2497 maxcut = fJetTPCRatioMaxCut;
2498 mincut = fJetTPCRatioMinCut;
2501 Double_t ratjet = 0;
2502 Double_t ratbkg = 0;
2504 for(Int_t icone = 0; icone<fNCone; icone++) {
2505 for(Int_t ipt = 0; ipt<fNPt;ipt++) {
2507 TString cone = fNameCones[icone] ;
2508 TString ptcut = fNamePtThres[ipt] ;
2511 TParticle * particle = 0 ;
2516 while ( (particle = dynamic_cast<TParticle*>(next())) ) {
2520 SetJet(particle, b0, fCones[icone],etal, phil) ;
2521 SetJet(particle, b1, fCones[icone],etal, phig) ;
2524 new((*jetList)[n0++]) TParticle(*particle) ;
2525 if(particle->Pt() > fPtThres[ipt] )
2526 ptjet+=particle->Pt();
2529 new((*bkgList)[n1++]) TParticle(*particle) ;
2530 if(particle->Pt() > fPtThres[ipt] )
2531 ptbkg+=particle->Pt();
2539 if(strstr(fOptionGJ,"deb")){
2540 Info("MakeJetAnyPt","cone %f, ptcut %f",fCones[icone],fPtThres[ipt]);
2541 Info("MakeJetAnyPt","pT: Gamma %f, Jet %f, Bkg %f",ptg,ptjet,ptbkg);
2544 ratjet = ptjet /ptg;
2548 (fListHistos->FindObject("Jet"+conf+"RatioCone"+cone+"Pt"+ptcut))
2551 (fListHistos->FindObject("Jet"+conf+"PtCone"+cone+"Pt"+ptcut))
2555 (fListHistos->FindObject("Bkg"+conf+"RatioCone"+cone+"Pt"+ptcut))
2559 (fListHistos->FindObject("Bkg"+conf+"PtCone"+cone+"Pt"+ptcut))
2564 if((ratjet < maxcut) && (ratjet > mincut)){
2567 (fListHistos->FindObject("N"+conf+"JetCone"+cone+"Pt"+ptcut))->
2570 (fListHistos->FindObject("N"+conf+"LeadingCone"+cone+"Pt"+ptcut))
2573 FillJetHistosAnyConeOrPt
2574 (jetList,ptg,conf,"Jet",fNameCones[icone],fNamePtThres[ipt]);
2575 FillJetHistosAnyConeOrPt
2576 (bkgList,ptg,conf,"Bkg",fNameCones[icone],fNamePtThres[ipt]);
2586 //____________________________________________________________________________
2587 void AliPHOSGammaJet::MakePhoton(TLorentzVector & particle)
2589 //Fast reconstruction for photons
2590 Double_t energy = particle.E() ;
2591 Double_t modenergy = MakeEnergy(energy) ;
2592 //Info("MakePhoton","Energy %f, Modif %f",energy,modenergy);
2594 // get the detected direction
2595 TVector3 pos = particle.Vect();
2597 TVector3 modpos = MakePosition(energy, pos) ;
2598 modpos *= modenergy / 460.;
2600 Float_t modtheta = modpos.Theta();
2601 Float_t modphi = modpos.Phi();
2603 // Set the modified 4-momentum of the reconstructed particle
2604 Float_t py = modenergy*TMath::Sin(modphi)*TMath::Sin(modtheta);
2605 Float_t px = modenergy*TMath::Cos(modphi)*TMath::Sin(modtheta);
2606 Float_t pz = modenergy*TMath::Cos(modtheta);
2608 particle.SetPxPyPzE(px,py,pz,modenergy);
2612 //____________________________________________________________________________
2613 TVector3 AliPHOSGammaJet::MakePosition(const Double_t energy, const TVector3 pos)
2615 // Smears the impact position according to the energy dependent position resolution
2616 // A gaussian position distribution is assumed
2620 Double_t sigma = SigmaP(energy) ;
2621 Double_t x = fRan.Gaus( pos.X(), sigma ) ;
2622 Double_t z = fRan.Gaus( pos.Z(), sigma ) ;
2623 Double_t y = pos.Y() ;
2629 // Info("MakePosition","Theta dif %f",pos.Theta()-newpos.Theta());
2630 // Info("MakePosition","Phi dif %f",pos.Phi()-newpos.Phi());
2634 //____________________________________________________________________________
2635 void AliPHOSGammaJet::Pi0Decay(Double_t mPi0, TLorentzVector &p0,
2636 TLorentzVector &p1, TLorentzVector &p2, Double_t &angle) {
2637 // Perform isotropic decay pi0 -> 2 photons
2638 // p0 is pi0 4-momentum (inut)
2639 // p1 and p2 are photon 4-momenta (output)
2640 // cout<<"Boost vector"<<endl;
2641 TVector3 b = p0.BoostVector();
2642 //cout<<"Parameters"<<endl;
2643 //Double_t mPi0 = p0.M();
2644 Double_t phi = TMath::TwoPi() * gRandom->Rndm();
2645 Double_t cosThe = 2 * gRandom->Rndm() - 1;
2646 Double_t cosPhi = TMath::Cos(phi);
2647 Double_t sinPhi = TMath::Sin(phi);
2648 Double_t sinThe = TMath::Sqrt(1-cosThe*cosThe);
2649 Double_t ePi0 = mPi0/2.;
2650 //cout<<"ePi0 "<<ePi0<<endl;
2651 //cout<<"Components"<<endl;
2652 p1.SetPx(+ePi0*cosPhi*sinThe);
2653 p1.SetPy(+ePi0*sinPhi*sinThe);
2654 p1.SetPz(+ePi0*cosThe);
2656 //cout<<"p1: "<<p1.Px()<<" "<<p1.Py()<<" "<<p1.Pz()<<" "<<p1.E()<<endl;
2657 //cout<<"p1 Mass: "<<p1.Px()*p1.Px()+p1.Py()*p1.Py()+p1.Pz()*p1.Pz()-p1.E()*p1.E()<<endl;
2658 p2.SetPx(-ePi0*cosPhi*sinThe);
2659 p2.SetPy(-ePi0*sinPhi*sinThe);
2660 p2.SetPz(-ePi0*cosThe);
2662 //cout<<"p2: "<<p2.Px()<<" "<<p2.Py()<<" "<<p2.Pz()<<" "<<p2.E()<<endl;
2663 //cout<<"p2 Mass: "<<p2.Px()*p2.Px()+p2.Py()*p2.Py()+p2.Pz()*p2.Pz()-p2.E()*p2.E()<<endl;
2664 //cout<<"Boost "<<b.X()<<" "<<b.Y()<<" "<<b.Z()<<endl;
2666 //cout<<"p1: "<<p1.Px()<<" "<<p1.Py()<<" "<<p1.Pz()<<" "<<p1.E()<<endl;
2668 //cout<<"p2: "<<p2.Px()<<" "<<p2.Py()<<" "<<p2.Pz()<<" "<<p2.E()<<endl;
2669 //cout<<"angle"<<endl;
2670 angle = p1.Angle(p2.Vect());
2671 //cout<<angle<<endl;
2674 //____________________________________________________________________________
2675 void AliPHOSGammaJet::Plot(TString what, Option_t * option) const
2677 //Plot some relevant histograms of the analysis
2678 TH2F * h = dynamic_cast<TH2F*>(fOutputFile->Get(what));
2682 else if (what == "all") {
2683 TCanvas * can = new TCanvas("GammaJet", "Gamma-Jet Study",10,40,1600,1200);
2685 can->Range(0,0,22,20);
2686 TPaveLabel *pl1 = new TPaveLabel(1,18,20,19.5,"Titre","br");
2687 pl1->SetFillColor(18);
2688 pl1->SetTextFont(32);
2689 pl1->SetTextColor(49);
2693 Float_t begx = -0.29, begy = 0., endx = 0., endy = 0.30 ;
2694 for (index = 0 ; index < fListHistos->GetEntries() ; index++) {
2695 TString name("pad") ;
2699 if (begx >= 1.0 || endx >= 1.0) {
2705 printf("%f %f %f %f \n", begx, begy, endx, endy) ;
2706 pad = new TPad(name,"This is a pad",begx,begy,endx,endy,33);
2709 fListHistos->At(index)->Draw(option) ;
2717 Info("Draw", "Histogram %s does not exist or unknown option", what.Data()) ;
2722 //____________________________________________________________________________
2723 void AliPHOSGammaJet::Print(const Option_t * opt) const
2726 //Print some relevant parameters set for the analysis
2730 Info("Print", "%s %s", GetName(), GetTitle() ) ;
2732 printf("Eta cut : %f\n", fEtaCut) ;
2733 printf("D phi max cut : %f\n", fPhiMaxCut) ;
2734 printf("D phi min cut : %f\n", fPhiMinCut) ;
2735 printf("Leading Ratio max cut : %f\n", fRatioMaxCut) ;
2736 printf("Leading Ratio min cut : %f\n", fRatioMinCut) ;
2737 printf("Jet Ratio max cut : %f\n", fJetRatioMaxCut) ;
2738 printf("Jet Ratio min cut : %f\n", fJetRatioMinCut) ;
2739 printf("Jet TPC Ratio max cut : %f\n", fJetTPCRatioMaxCut) ;
2740 printf("Jet TPC Ratio min cut : %f\n", fJetTPCRatioMinCut) ;
2741 printf("Fast recons : %d\n", fOptFast);
2742 printf("Inv Mass max cut : %f\n", fInvMassMaxCut) ;
2743 printf("Inv Mass min cut : %f\n", fInvMassMinCut) ;
2747 //__________________________________________________________________________
2748 TChain * AliPHOSGammaJet::ReadESDfromdisk(const UInt_t eventsToRead,
2749 const TString dirName,
2750 const TString esdTreeName,
2751 const char * pattern)
2753 // Reads ESDs from Disk
2756 AliInfo( Form("\nReading files in %s \nESD tree name is %s \nReading %d events",
2757 dirName.Data(), esdTreeName.Data(), eventsToRead) ) ;
2759 // create a TChain of all the files
2760 TChain * cESDTree = new TChain(esdTreeName) ;
2762 // read from the directory file until the require number of events are collected
2763 void * from = gSystem->OpenDirectory(dirName) ;
2765 AliError( Form("Directory %s does not exist") ) ;
2768 else{ // reading file names from directory
2769 const char * subdir ;
2770 // search all subdirectories witch matching pattern
2771 while( (subdir = gSystem->GetDirEntry(from)) &&
2772 (cESDTree->GetEntries() < eventsToRead)) {
2773 if ( strstr(subdir, pattern) != 0 ) {
2775 sprintf(file, "%s%s/AliESDs.root", dirName.Data(), subdir);
2776 AliInfo( Form("Adding %s\n", file) );
2777 cESDTree->Add(file) ;
2781 AliInfo( Form(" %d events read", cESDTree->GetEntriesFast()) ) ;
2784 } // reading file names from directory
2788 //__________________________________________________________________________
2789 TChain * AliPHOSGammaJet::ReadESD(const UInt_t eventsToRead,
2790 const TString dirName,
2791 const TString esdTreeName,
2792 const char * pattern)
2794 // Read AliESDs files and return a Chain of events
2796 if ( dirName == "" ) {
2797 AliError("Give the name of the DIR where to find files") ;
2800 if ( esdTreeName == "" )
2801 return ReadESDfromdisk(eventsToRead, dirName) ;
2802 else if ( strcmp(pattern, "") == 0 )
2803 return ReadESDfromdisk(eventsToRead, dirName, esdTreeName) ;
2805 return ReadESDfromdisk(eventsToRead, dirName, esdTreeName, pattern) ;
2808 //___________________________________________________________________
2809 void AliPHOSGammaJet::SetJet(TParticle * part, Bool_t & b, Float_t cone,
2810 Double_t eta, Double_t phi)
2813 //Check if the particle is inside the cone defined by the leading particle
2816 if(phi > TMath::TwoPi())
2817 phi-=TMath::TwoPi();
2819 phi+=TMath::TwoPi();
2821 Double_t rad = 10000 + cone;
2823 if(TMath::Abs(part->Phi()-phi) <= (TMath::TwoPi() - cone))
2824 rad = TMath::Sqrt(TMath::Power(part->Eta()-eta,2)+
2825 TMath::Power(part->Phi()-phi,2));
2827 if(part->Phi()-phi > TMath::TwoPi() - cone)
2828 rad = TMath::Sqrt(TMath::Power(part->Eta()-eta,2)+
2829 TMath::Power((part->Phi()-TMath::TwoPi())-phi,2));
2830 if(part->Phi()-phi < -(TMath::TwoPi() - cone))
2831 rad = TMath::Sqrt(TMath::Power(part->Eta()-eta,2)+
2832 TMath::Power((part->Phi()+TMath::TwoPi())-phi,2));
2840 //____________________________________________________________________________
2841 Double_t AliPHOSGammaJet::SigmaE(Double_t energy)
2843 // Calculates the energy dependent energy resolution
2847 rv = TMath::Sqrt( TMath::Power(fResPara1/energy, 2)
2848 + TMath::Power(fResPara2/TMath::Sqrt(energy), 2)
2849 + TMath::Power(fResPara3, 2) ) ;
2851 return rv * energy ;
2854 //____________________________________________________________________________
2855 Double_t AliPHOSGammaJet::SigmaP(Double_t energy)
2857 // Calculates the energy dependent position resolution
2859 Double_t sigma = TMath::Sqrt(TMath::Power(fPosParaA,2) +
2860 TMath::Power(fPosParaB,2) / energy) ;
2863 return sigma ; // in cm