/* History of cvs commits:
*
* $Log$
+ * Revision 1.1 2007/01/23 17:17:29 schutz
+ * New Gamma package
+ *
*
*/
return rat ;
}
-
-//____________________________________________________________________________
-void AliAnaGammaJet::Exec(Option_t *)
-{
-
- // Processing of one event
-
- //Get ESDs
- Long64_t entry = GetChain()->GetReadEntry() ;
-
- if (!GetESD()) {
- AliError("fESD is not connected to the input!") ;
- return ;
- }
-
- if (GetPrintInfo())
- AliInfo(Form("%s ----> Processing event # %lld", (dynamic_cast<TChain *>(GetChain()))->GetFile()->GetName(), entry)) ;
-
- //CreateTLists with arrays of TParticles. Filled with particles only relevant for the analysis.
-
- TClonesArray * particleList = new TClonesArray("TParticle",1000); // All particles refitted in CTS and detected in EMCAL (jet)
- TClonesArray * plCTS = new TClonesArray("TParticle",1000); // All particles refitted in Central Tracking System (ITS+TPC)
- TClonesArray * plNe = new TClonesArray("TParticle",1000); // All particles measured in Jet Calorimeter
- TClonesArray * plCalo = new TClonesArray("TParticle",1000); // All particles measured in Prompt Gamma calorimeter
-
-
- TParticle *pGamma = new TParticle(); //It will contain the kinematics of the found prompt gamma
- TParticle *pLeading = new TParticle(); //It will contain the kinematics of the found leading particle
-
- Bool_t iIsInPHOSorEMCAL = kFALSE ; //To check if Gamma was in any calorimeter
-
- //Fill lists with photons, neutral particles and charged particles
- //look for the highest energy photon in the event inside fCalorimeter
- AliDebug(2, "Fill particle lists, get prompt gamma");
-
- //Fill particle lists
-
- if(GetCalorimeter() == "PHOS")
- CreateParticleList(particleList, plCTS,plNe,plCalo);
- else if(GetCalorimeter() == "EMCAL")
- CreateParticleList(particleList, plCTS,plCalo,plNe);
- else
- AliError("No calorimeter selected");
-
- //Search highest energy prompt gamma in calorimeter
- GetPromptGamma(plCalo, plCTS, pGamma, iIsInPHOSorEMCAL) ;
-
- AliDebug(1, Form("Is Gamma in %s? %d",GetCalorimeter().Data(),iIsInPHOSorEMCAL));
- AliDebug(3,Form("Charged list entries %d, Neutral list entries %d, %s list entries %d",
- plCTS->GetEntries(),plNe->GetEntries(), GetCalorimeter().Data(), plCalo->GetEntries()));
-
- //If there is any prompt photon in fCalorimeter,
- //search jet leading particle
-
- if(iIsInPHOSorEMCAL){
- if (GetPrintInfo())
- AliInfo(Form("Prompt Gamma: pt %f, phi %f, eta %f", pGamma->Pt(),pGamma->Phi(),pGamma->Eta())) ;
-
- AliDebug(2, "Get Leading Particles, Make jet");
-
- //Search leading particles in CTS and EMCAL
- if(GetLeadingParticle(plCTS, plNe, pGamma, pLeading)){
- if (GetPrintInfo())
- AliInfo(Form("Leading: pt %f, phi %f, eta %f", pLeading->Pt(),pLeading->Phi(),pLeading->Eta())) ;
-
- //Search Jet
- if(!fSeveralConeAndPtCuts)
- MakeJet(particleList,pGamma,pLeading,"");
- else{
- for(Int_t icone = 0; icone<fNCone; icone++) {
- for(Int_t ipt = 0; ipt<fNPt;ipt++) {
- TString lastname ="Cone"+ fNameCones[icone]+"Pt"+ fNamePtThres[ipt];
- MakeJet(particleList, pGamma, pLeading,lastname);
- }//icone
- }//ipt
- }//fSeveralConeAndPtCuts
- }//Leading
- }//Gamma in Calo
-
- AliDebug(2, "End of analysis, delete pointers");
-
- particleList->Delete() ;
- plCTS->Delete() ;
- plNe->Delete() ;
- plCalo->Delete() ;
- pLeading->Delete();
- pGamma->Delete();
-
- delete plNe ;
- delete plCalo ;
- delete plCTS ;
- delete particleList ;
- // delete pLeading;
- // delete pGamma;
-
- PostData(0, fOutputContainer);
-}
-
-//____________________________________________________________________________
-void AliAnaGammaJet::FillJetHistos(TClonesArray * pl, Double_t ptg, Double_t ptl, TString type, TString lastname)
+//______________________________________________________________________________
+void AliAnaGammaJet::ConnectInputData(const Option_t*)
{
- //Fill histograms wth jet fragmentation
- //and number of selected jets and leading particles
- //and the background multiplicity
- TParticle * particle = 0 ;
- Int_t ipr = 0;
- Float_t charge = 0;
-
- TIter next(pl) ;
- while ( (particle = dynamic_cast<TParticle*>(next())) ) {
- ipr++ ;
- Double_t pt = particle->Pt();
+ // Initialisation of branch container and histograms
+ AliAnaGammaDirect::ConnectInputData("");
- charge = TDatabasePDG::Instance()
- ->GetParticle(particle->GetPdgCode())->Charge();
- if(charge != 0){//Only jet Charged particles
- dynamic_cast<TH2F*>
- (fOutputContainer->FindObject(type+"Fragment"+lastname))
- ->Fill(ptg,pt/ptg);
- dynamic_cast<TH2F*>
- (fOutputContainer->FindObject(type+"PtDist"+lastname))
- ->Fill(ptg,pt);
- }//charged
-
- }//while
-
- if(type == "Bkg")
- dynamic_cast<TH1F*>
- (fOutputContainer->FindObject("NBkg"+lastname))
- ->Fill(ipr);
- else{
- dynamic_cast<TH1F*>
- (fOutputContainer->FindObject("NJet"+lastname))->
- Fill(ptg);
- dynamic_cast<TH2F*>
- (fOutputContainer->FindObject("NLeading"+lastname))
- ->Fill(ptg,ptl);
- }
-
}
-//____________________________________________________________________________
-void AliAnaGammaJet::GetLeadingCharge(TClonesArray * pl, TParticle * pGamma, TParticle * pLeading) const
+//________________________________________________________________________
+void AliAnaGammaJet::CreateOutputObjects()
{
- //Search for the charged particle with highest with
- //Phi=Phi_gamma-Pi and pT=0.1E_gamma
- Double_t pt = -100.;
- Double_t phi = -100.;
- for(Int_t ipr = 0;ipr < pl->GetEntries() ; ipr ++ ){
-
- TParticle * particle = dynamic_cast<TParticle *>(pl->At(ipr)) ;
-
- Double_t ptl = particle->Pt();
- Double_t rat = ptl/pGamma->Pt() ;
- Double_t phil = particle->Phi() ;
- Double_t phig = pGamma->Phi();
-
- //Selection within angular and energy limits
- if(((phig-phil)> fPhiMinCut) && ((phig-phil)<fPhiMaxCut) &&
- (rat > fRatioMinCut) && (rat < fRatioMaxCut) && (ptl > pt)) {
- phi = phil ;
- pt = ptl ;
- pLeading->SetMomentum(particle->Px(),particle->Py(),particle->Pz(),particle->Energy());
- AliDebug(4,Form("Charge in CTS: pt %f eta %f phi %f pt/Eg %f \n", pt, particle->Eta(), phi,rat)) ;
- }
- }
+ // Init parameteres and create histograms to be saved in output file and
+ // stores them in fOutputContainer
+ InitParameters();
+ AliAnaGammaDirect::CreateOutputObjects();
- AliDebug(3,Form("Leading in CTS: pt %f eta %f phi %f pt/Eg %f \n", pt, pLeading->Eta(), phi,pt/pGamma->Pt())) ;
-
-}
-
-
-//____________________________________________________________________________
-void AliAnaGammaJet::GetLeadingPi0(TClonesArray * pl, TParticle * pGamma, TParticle * pLeading)
-{
-
- //Search for the neutral pion with highest with
- //Phi=Phi_gamma-Pi and pT=0.1E_gamma
- Double_t pt = -100.;
- Double_t phi = -100.;
- Double_t ptl = -100.;
- Double_t rat = -100.;
- Double_t phil = -100. ;
- Double_t ptg = pGamma->Pt();
- Double_t phig = pGamma->Phi();
+ fOutputContainer = new TObjArray(100) ;
+
+ TObjArray * outputContainer =GetOutputContainer();
+ for(Int_t i = 0; i < outputContainer->GetEntries(); i++ )
+ fOutputContainer->Add(outputContainer->At(i)) ;
- TIter next(pl);
- TParticle * particle = 0;
+ //
+ fhChargeRatio = new TH2F
+ ("ChargeRatio","p_{T leading charge} /p_{T #gamma} vs p_{T #gamma}",
+ 120,0,120,120,0,1);
+ fhChargeRatio->SetYTitle("p_{T lead charge} /p_{T #gamma}");
+ fhChargeRatio->SetXTitle("p_{T #gamma} (GeV/c)");
+ fOutputContainer->Add(fhChargeRatio) ;
- Int_t iPrimary = -1;
- TLorentzVector gammai,gammaj;
- Double_t angle = 0., e = 0., invmass = 0.;
- Double_t anglef = 0., ef = 0., invmassf = 0.;
- Int_t ksPdg = 0;
- Int_t jPrimary=-1;
-
- while ( (particle = (TParticle*)next()) ) {
- iPrimary++;
+ fhDeltaPhiCharge = new TH2F
+ ("DeltaPhiCharge","#phi_{#gamma} - #phi_{charge} vs p_{T #gamma}",
+ 200,0,120,200,0,6.4);
+ fhDeltaPhiCharge->SetYTitle("#Delta #phi");
+ fhDeltaPhiCharge->SetXTitle("p_{T #gamma} (GeV/c)");
+ fOutputContainer->Add(fhDeltaPhiCharge) ;
+
+ fhDeltaEtaCharge = new TH2F
+ ("DeltaEtaCharge","#eta_{#gamma} - #eta_{charge} vs p_{T #gamma}",
+ 200,0,120,200,-2,2);
+ fhDeltaEtaCharge->SetYTitle("#Delta #eta");
+ fhDeltaEtaCharge->SetXTitle("p_{T #gamma} (GeV/c)");
+ fOutputContainer->Add(fhDeltaEtaCharge) ;
+
+ //
+ if(!fJetsOnlyInCTS){
+ fhPi0Ratio = new TH2F
+ ("Pi0Ratio","p_{T leading #pi^{0}} /p_{T #gamma} vs p_{T #gamma}",
+ 120,0,120,120,0,1);
+ fhPi0Ratio->SetYTitle("p_{T lead #pi^{0}} /p_{T #gamma}");
+ fhPi0Ratio->SetXTitle("p_{T #gamma} (GeV/c)");
+ fOutputContainer->Add(fhPi0Ratio) ;
- ksPdg = particle->GetPdgCode();
- ptl = particle->Pt();
- if(ksPdg == 111){ //2 gamma overlapped, found with PID
- rat = ptl/ptg ;
- phil = particle->Phi() ;
- //Selection within angular and energy limits
- if((ptl> pt)&& (rat > fRatioMinCut) && (rat < fRatioMaxCut) &&
- ((phig-phil)>fPhiMinCut)&&((phig-phil)<fPhiMaxCut)){
- phi = phil ;
- pt = ptl ;
- pLeading->SetMomentum(particle->Px(),particle->Py(),particle->Pz(),particle->Energy());
- 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())) ;
- }// cuts
- }// pdg = 111
- else if(ksPdg == 22){//1 gamma
- //Search the photon companion in case it comes from a Pi0 decay
- //Apply several cuts to select the good pair
- particle->Momentum(gammai);
- jPrimary=-1;
- TIter next2(pl);
- while ( (particle = (TParticle*)next2()) ) {
- jPrimary++;
- if(jPrimary>iPrimary){
- ksPdg = particle->GetPdgCode();
-
- if(ksPdg == 22){
- particle->Momentum(gammaj);
- //Info("GetLeadingPi0","Egammai %f, Egammaj %f",
- //gammai.Pt(),gammaj.Pt());
- ptl = (gammai+gammaj).Pt();
- phil = (gammai+gammaj).Phi();
- if(phil < 0)
- phil+=TMath::TwoPi();
- rat = ptl/ptg ;
- invmass = (gammai+gammaj).M();
- angle = gammaj.Angle(gammai.Vect());
- //Info("GetLeadingPi0","Angle %f", angle);
- e = (gammai+gammaj).E();
- //Fill histograms with no cuts applied.
- fhAnglePairNoCut->Fill(e,angle);
- fhInvMassPairNoCut->Fill(ptg,invmass);
- //First cut on the energy and azimuth of the pair
- if((rat > fRatioMinCut) && (rat < fRatioMaxCut) &&
- ((phig-phil)>fPhiMinCut)&&((phig-phil)<fPhiMaxCut)){
-
- fhAnglePairLeadingCut->Fill(e,angle);
- fhInvMassPairLeadingCut->Fill(ptg,invmass);
- //Second cut on the aperture of the pair
- if(IsAngleInWindow(angle,e)){
- fhAnglePairAngleCut->Fill(e,angle);
- fhInvMassPairAngleCut->Fill(ptg,invmass);
-
- //Info("GetLeadingPi0","InvMass %f", invmass);
- //Third cut on the invariant mass of the pair
- if((invmass>fInvMassMinCut) && (invmass<fInvMassMaxCut)){
- fhInvMassPairAllCut->Fill(ptg,invmass);
- fhAnglePairAllCut->Fill(e,angle);
- if(ptl > pt ){
- pt = ptl;
- phi = phil ;
- ef = e ;
- anglef = angle ;
- invmassf = invmass ;
- pLeading->SetMomentum(particle->Px(),particle->Py(),particle->Pz(),particle->Energy());
- 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())) ;
- }
- }//cuts
- }//(invmass>0.125) && (invmass<0.145)
- }//gammaj.Angle(gammai.Vect())<0.04
- }//if pdg = 22
- }//iprimary<jprimary
- }//while
- }// if pdg = 22
- // }
- }//while
-
- if(ef > 0.){//Final pi0 found, highest pair energy, fill histograms
- fhInvMassPairLeading->Fill(ptg,invmassf);
- fhAnglePairLeading->Fill(ef,anglef);
+ fhDeltaPhiPi0 = new TH2F
+ ("DeltaPhiPi0","#phi_{#gamma} - #phi_{ #pi^{0}} vs p_{T #gamma}",
+ 200,0,120,200,0,6.4);
+ fhDeltaPhiPi0->SetYTitle("#Delta #phi");
+ fhDeltaPhiPi0->SetXTitle("p_{T #gamma} (GeV/c)");
+ fOutputContainer->Add(fhDeltaPhiPi0) ;
+
+ fhDeltaEtaPi0 = new TH2F
+ ("DeltaEtaPi0","#eta_{#gamma} - #eta_{ #pi^{0}} vs p_{T #gamma}",
+ 200,0,120,200,-2,2);
+ fhDeltaEtaPi0->SetYTitle("#Delta #eta");
+ fhDeltaEtaPi0->SetXTitle("p_{T #gamma} (GeV/c)");
+ fOutputContainer->Add(fhDeltaEtaPi0) ;
+
+ //
+ fhAnglePair = new TH2F
+ ("AnglePair",
+ "Angle between #pi^{0} #gamma pair vs p_{T #pi^{0}}",
+ 200,0,50,200,0,0.2);
+ fhAnglePair->SetYTitle("Angle (rad)");
+ fhAnglePair->SetXTitle("E_{ #pi^{0}} (GeV/c)");
+ fOutputContainer->Add(fhAnglePair) ;
+
+ fhAnglePairAccepted = new TH2F
+ ("AnglePairAccepted",
+ "Angle between #pi^{0} #gamma pair vs p_{T #pi^{0}}, both #gamma in eta<0.7, inside window",
+ 200,0,50,200,0,0.2);
+ fhAnglePairAccepted->SetYTitle("Angle (rad)");
+ fhAnglePairAccepted->SetXTitle("E_{ #pi^{0}} (GeV/c)");
+ fOutputContainer->Add(fhAnglePairAccepted) ;
+
+ fhAnglePairNoCut = new TH2F
+ ("AnglePairNoCut",
+ "Angle between all #gamma pair vs p_{T #pi^{0}}",200,0,50,200,0,0.2);
+ fhAnglePairNoCut->SetYTitle("Angle (rad)");
+ fhAnglePairNoCut->SetXTitle("E_{ #pi^{0}} (GeV/c)");
+ fOutputContainer->Add(fhAnglePairNoCut) ;
+
+ fhAnglePairLeadingCut = new TH2F
+ ("AnglePairLeadingCut",
+ "Angle between all #gamma pair that have a good phi and pt vs p_{T #pi^{0}}",
+ 200,0,50,200,0,0.2);
+ fhAnglePairLeadingCut->SetYTitle("Angle (rad)");
+ fhAnglePairLeadingCut->SetXTitle("E_{ #pi^{0}} (GeV/c)");
+ fOutputContainer->Add(fhAnglePairLeadingCut) ;
+
+ fhAnglePairAngleCut = new TH2F
+ ("AnglePairAngleCut",
+ "Angle between all #gamma pair (angle + leading cut) vs p_{T #pi^{0}}"
+ ,200,0,50,200,0,0.2);
+ fhAnglePairAngleCut->SetYTitle("Angle (rad)");
+ fhAnglePairAngleCut->SetXTitle("E_{ #pi^{0}} (GeV/c)");
+ fOutputContainer->Add(fhAnglePairAngleCut) ;
+
+ fhAnglePairAllCut = new TH2F
+ ("AnglePairAllCut",
+ "Angle between all #gamma pair (angle + inv mass cut+leading) vs p_{T #pi^{0}}"
+ ,200,0,50,200,0,0.2);
+ fhAnglePairAllCut->SetYTitle("Angle (rad)");
+ fhAnglePairAllCut->SetXTitle("E_{ #pi^{0}} (GeV/c)");
+ fOutputContainer->Add(fhAnglePairAllCut) ;
+
+ fhAnglePairLeading = new TH2F
+ ("AnglePairLeading",
+ "Angle between all #gamma pair finally selected vs p_{T #pi^{0}}",
+ 200,0,50,200,0,0.2);
+ fhAnglePairLeading->SetYTitle("Angle (rad)");
+ fhAnglePairLeading->SetXTitle("E_{ #pi^{0}} (GeV/c)");
+ fOutputContainer->Add(fhAnglePairLeading) ;
+
+ //
+ fhInvMassPairNoCut = new TH2F
+ ("InvMassPairNoCut","Invariant Mass of all #gamma pair vs p_{T #gamma}",
+ 120,0,120,360,0,0.5);
+ fhInvMassPairNoCut->SetYTitle("Invariant Mass (GeV/c^{2})");
+ fhInvMassPairNoCut->SetXTitle("p_{T #gamma} (GeV/c)");
+ fOutputContainer->Add(fhInvMassPairNoCut) ;
+
+ fhInvMassPairLeadingCut = new TH2F
+ ("InvMassPairLeadingCut",
+ "Invariant Mass of #gamma pair (leading cuts) vs p_{T #gamma}",
+ 120,0,120,360,0,0.5);
+ fhInvMassPairLeadingCut->SetYTitle("Invariant Mass (GeV/c^{2})");
+ fhInvMassPairLeadingCut->SetXTitle("p_{T #gamma} (GeV/c)");
+ fOutputContainer->Add(fhInvMassPairLeadingCut) ;
+
+ fhInvMassPairAngleCut = new TH2F
+ ("InvMassPairAngleCut",
+ "Invariant Mass of #gamma pair (angle cut) vs p_{T #gamma}",
+ 120,0,120,360,0,0.5);
+ fhInvMassPairAngleCut->SetYTitle("Invariant Mass (GeV/c^{2})");
+ fhInvMassPairAngleCut->SetXTitle("p_{T #gamma} (GeV/c)");
+ fOutputContainer->Add(fhInvMassPairAngleCut) ;
+
+ fhInvMassPairAllCut = new TH2F
+ ("InvMassPairAllCut",
+ "Invariant Mass of #gamma pair (angle+invmass cut+leading) vs p_{T #gamma}",
+ 120,0,120,360,0,0.5);
+ fhInvMassPairAllCut->SetYTitle("Invariant Mass (GeV/c^{2})");
+ fhInvMassPairAllCut->SetXTitle("p_{T #gamma} (GeV/c)");
+ fOutputContainer->Add(fhInvMassPairAllCut) ;
+
+ fhInvMassPairLeading = new TH2F
+ ("InvMassPairLeading",
+ "Invariant Mass of #gamma pair selected vs p_{T #gamma}",
+ 120,0,120,360,0,0.5);
+ fhInvMassPairLeading->SetYTitle("Invariant Mass (GeV/c^{2})");
+ fhInvMassPairLeading->SetXTitle("p_{T #gamma} (GeV/c)");
+ fOutputContainer->Add(fhInvMassPairLeading) ;
}
- 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())) ;
-}
-
-//____________________________________________________________________________
-Bool_t AliAnaGammaJet::GetLeadingParticle(TClonesArray * plCTS, TClonesArray * plNe,
- TParticle * pGamma, TParticle * pLeading)
-{
- //Search Charged or Neutral leading particle, select the highest one.
-
- TParticle * pLeadingCh = new TParticle();
- TParticle * pLeadingPi0 = new TParticle();
-
- Double_t ptg = pGamma->Pt();
- Double_t phig = pGamma->Phi();
- Double_t etag = pGamma->Eta();
- if(GetCalorimeter() == "PHOS" && !fJetsOnlyInCTS)
- {
- AliDebug(3, "GetLeadingPi0");
- GetLeadingPi0 (plNe, pGamma, pLeadingPi0) ;
- AliDebug(3, "GetLeadingCharge");
- GetLeadingCharge(plCTS, pGamma, pLeadingCh) ;
-
- Double_t ptch = pLeadingCh->Pt();
- Double_t phich = pLeadingCh->Phi();
- Double_t etach = pLeadingCh->Eta();
- Double_t ptpi = pLeadingPi0->Pt();
- Double_t phipi = pLeadingPi0->Phi();
- Double_t etapi = pLeadingPi0->Eta();
-
- //Is leading cone inside EMCAL acceptance?
-
- Bool_t insidech = kFALSE ;
- if((phich - fCone) > fPhiEMCALCut[0] &&
- (phich + fCone) < fPhiEMCALCut[1] &&
- (etach-fCone) < fEtaEMCALCut )
- insidech = kTRUE ;
-
- Bool_t insidepi = kFALSE ;
- if((phipi - fCone) > fPhiEMCALCut[0] &&
- (phipi + fCone) < fPhiEMCALCut[1] &&
- (etapi-fCone) < fEtaEMCALCut )
- insidepi = kTRUE ;
-
- AliDebug(2,Form("Leading: charged pt %f, pi0 pt %f",ptch,ptpi)) ;
-
- if (ptch > 0 || ptpi > 0)
- {
- if(insidech && (ptch > ptpi))
- {
- if (GetPrintInfo())
- AliInfo("Leading found in CTS");
- pLeading->SetMomentum(pLeadingCh->Px(),pLeadingCh->Py(),pLeadingCh->Pz(),pLeadingCh->Energy());
- AliDebug(3,Form("Final leading found in CTS, pt %f, phi %f, eta %f",ptch,phich,etach)) ;
- fhChargeRatio->Fill(ptg,ptch/pGamma->Pt());
- fhDeltaPhiCharge->Fill(ptg,pGamma->Phi()-phich);
- fhDeltaEtaCharge->Fill(ptg,pGamma->Eta()-etach);
- return 1;
- }
-
- else if((ptpi > ptch) && insidepi)
- {
- if (GetPrintInfo())
- AliInfo("Leading found in EMCAL");
- pLeading->SetMomentum(pLeadingPi0->Px(),pLeadingPi0->Py(),pLeadingPi0->Pz(),pLeadingPi0->Energy());
- AliDebug(3,Form("Final leading found in EMCAL, pt %f, phi %f, eta %f",ptpi,phipi,etapi)) ;
- fhPi0Ratio ->Fill(ptg,ptpi/ptg);
- fhDeltaPhiPi0->Fill(ptg,phig-phipi);
- fhDeltaEtaPi0->Fill(ptg,etag-etapi);
- return 1;
- }
-
- else{
- AliDebug(3,"NO LEADING PARTICLE FOUND");}
- return 0;
- }
- else{
- AliDebug(3,"NO LEADING PARTICLE FOUND");
- return 0;
- }
- }
-
- else
- {
- //No calorimeter present for Leading particle detection
- GetLeadingCharge(plCTS, pGamma, pLeading) ;
- Double_t ptch = pLeading->Pt();
- Double_t phich = pLeading->Phi();
- Double_t etach = pLeading->Eta();
- if(ptch > 0){
- fhChargeRatio->Fill(ptg,ptch/ptg);
- fhDeltaPhiCharge->Fill(ptg,phig-phich);
- fhDeltaEtaCharge->Fill(ptg,etag-etach);
- AliDebug(3,Form("Leading found : pt %f, phi %f, eta %f",ptch,phich,etach)) ;
- return 1;
- }
- else
- {
- AliDebug(3,"NO LEADING PARTICLE FOUND");
- return 0;
- }
- }
-}
-
- //____________________________________________________________________________
-void AliAnaGammaJet::Init(const Option_t * )
-{
-// // Initialisation of branch container
- AliAnaGammaDirect::Init();
-
- //Initialize the parameters of the analysis.
- //fCalorimeter="PHOS";
- fAngleMaxParam.Set(4) ;
- fAngleMaxParam.AddAt(0.4,0);//={0.4,-0.25,0.025,-2e-4};
- fAngleMaxParam.AddAt(-0.25,1) ;
- fAngleMaxParam.AddAt(0.025,2) ;
- fAngleMaxParam.AddAt(-2e-4,3) ;
- fSeveralConeAndPtCuts = kFALSE ;
- //fPrintInfo = kTRUE;
- fPbPb = kFALSE ;
- fInvMassMaxCut = 0.16 ;
- fInvMassMinCut = 0.11 ;
- //fJetsOnlyInCTS = kTRUE ;
- fEtaEMCALCut = 0.7 ;
- fPhiEMCALCut[0] = 80. *TMath::Pi()/180.;
- fPhiEMCALCut[1] = 190.*TMath::Pi()/180.;
- fPhiMaxCut = 3.4 ;
- fPhiMinCut = 2.9 ;
-
- //Jet selection parameters
- //Fixed cut (old)
- fRatioMaxCut = 1.0 ;
- fRatioMinCut = 0.1 ;
- fJetRatioMaxCut = 1.2 ;
- fJetRatioMinCut = 0.3 ;
- fJetsOnlyInCTS = kFALSE ;
- fJetCTSRatioMaxCut = 1.2 ;
- fJetCTSRatioMinCut = 0.3 ;
- fSelect = 0 ;
-
- //Cut depending on gamma energy
-
- fPtJetSelectionCut = 20.; //For Low pt jets+BKG, another limits applied
- //Reconstructed jet energy dependence parameters
- //e_jet = a1+e_gamma b2.
- //Index 0-> Pt>2 GeV r = 0.3; Index 1-> Pt>0.5 GeV r = 0.3
- fJetE1[0] = -5.75; fJetE1[1] = -4.1;
- fJetE2[0] = 1.005; fJetE2[1] = 1.05;
-
- //Reconstructed sigma of jet energy dependence parameters
- //s_jet = a1+e_gamma b2.
- //Index 0-> Pt>2 GeV r = 0.3; Index 1-> Pt>0.5 GeV r = 0.3
- fJetSigma1[0] = 2.65; fJetSigma1[1] = 2.75;
- fJetSigma2[0] = 0.0018; fJetSigma2[1] = 0.033;
-
- //Background mean energy and RMS
- //Index 0-> No BKG; Index 1-> BKG > 2 GeV;
- //Index 2-> (low pt jets)BKG > 0.5 GeV;
- //Index > 2, same for CTS conf
- fBkgMean[0] = 0.; fBkgMean[1] = 8.8 ; fBkgMean[2] = 69.5;
- fBkgMean[3] = 0.; fBkgMean[4] = 6.4; fBkgMean[5] = 48.6;
- fBkgRMS[0] = 0.; fBkgRMS[1] = 7.5; fBkgRMS[2] = 22.0;
- fBkgRMS[3] = 0.; fBkgRMS[4] = 5.4; fBkgRMS[5] = 13.2;
-
- //Factor x of min/max = E -+ x * sigma. Obtained after selecting the
- //limits for monoenergetic jets.
- //Index 0-> No BKG; Index 1-> BKG > 2 GeV;
- //Index 2-> (low pt jets) BKG > 0.5 GeV;
- //Index > 2, same for CTS conf
+ if(!fSeveralConeAndPtCuts){
+
+ //Count
+ fhNBkg = new TH1F("NBkg","bkg multiplicity",9000,0,9000);
+ fhNBkg->SetYTitle("counts");
+ fhNBkg->SetXTitle("N");
+ fOutputContainer->Add(fhNBkg) ;
+
+ fhNLeading = new TH2F
+ ("NLeading","Accepted Jet Leading", 240,0,120,240,0,120);
+ fhNLeading->SetYTitle("p_{T charge} (GeV/c)");
+ fhNLeading->SetXTitle("p_{T #gamma}(GeV/c)");
+ fOutputContainer->Add(fhNLeading) ;
+
+ fhNJet = new TH1F("NJet","Accepted jets",240,0,120);
+ fhNJet->SetYTitle("N");
+ fhNJet->SetXTitle("p_{T #gamma}(GeV/c)");
+ fOutputContainer->Add(fhNJet) ;
+
+ //Ratios and Pt dist of reconstructed (not selected) jets
+ //Jet
+ fhJetRatio = new TH2F
+ ("JetRatio","p_{T jet lead}/p_{T #gamma} vs p_{T #gamma}",
+ 240,0,120,200,0,10);
+ fhJetRatio->SetYTitle("p_{T jet lead #pi^{0}}/p_{T #gamma}");
+ fhJetRatio->SetXTitle("p_{T #gamma} (GeV/c)");
+ fOutputContainer->Add(fhJetRatio) ;
+
+ fhJetPt = new TH2F
+ ("JetPt", "p_{T jet lead} vs p_{T #gamma}",240,0,120,400,0,200);
+ fhJetPt->SetYTitle("p_{T jet}");
+ fhJetPt->SetXTitle("p_{T #gamma} (GeV/c)");
+ fOutputContainer->Add(fhJetPt) ;
+
+ //Bkg
+
+ fhBkgRatio = new TH2F
+ ("BkgRatio","p_{T bkg lead}/p_{T #gamma} vs p_{T #gamma}",
+ 240,0,120,200,0,10);
+ fhBkgRatio->SetYTitle("p_{T bkg lead charge}/p_{T #gamma}");
+ fhBkgRatio->SetXTitle("p_{T #gamma} (GeV/c)");
+ fOutputContainer->Add(fhBkgRatio) ;
+
+ fhBkgPt = new TH2F
+ ("BkgPt","p_{T jet lead} vs p_{T #gamma}",240,0,120,400,0,200);
+ fhBkgPt->SetYTitle("p_{T jet lead charge}/p_{T #gamma}");
+ fhBkgPt->SetXTitle("p_{T #gamma} (GeV/c)");
+ fOutputContainer->Add(fhBkgPt) ;
+
+ //Jet Distributions
+
+ fhJetFragment =
+ new TH2F("JetFragment","x = p_{T i charged}/p_{T #gamma}",
+ 240,0.,120.,1000,0.,1.2);
+ fhJetFragment->SetYTitle("x_{T}");
+ fhJetFragment->SetXTitle("p_{T #gamma}");
+ fOutputContainer->Add(fhJetFragment) ;
+
+ fhBkgFragment = new TH2F
+ ("BkgFragment","x = p_{T i charged}/p_{T #gamma}",
+ 240,0.,120.,1000,0.,1.2);
+ fhBkgFragment->SetYTitle("x_{T}");
+ fhBkgFragment->SetXTitle("p_{T #gamma}");
+ fOutputContainer->Add(fhBkgFragment) ;
+
+ fhJetPtDist =
+ new TH2F("JetPtDist","x = p_{T i charged}",240,0.,120.,400,0.,200.);
+ fhJetPtDist->SetXTitle("p_{T #gamma} (GeV/c)");
+ fOutputContainer->Add(fhJetPtDist) ;
+
+ fhBkgPtDist = new TH2F
+ ("BkgPtDist","x = p_{T i charged}",240,0.,120.,400,0.,200.);
+ fhBkgPtDist->SetXTitle("p_{T #gamma} (GeV/c)");
+ fOutputContainer->Add(fhBkgPtDist) ;
- fJetXMin1[0] =-0.69 ; fJetXMin1[1] = 0.39 ; fJetXMin1[2] =-0.88 ;
- fJetXMin1[3] =-2.0 ; fJetXMin1[4] =-0.442 ; fJetXMin1[5] =-1.1 ;
- fJetXMin2[0] = 0.066; fJetXMin2[1] = 0.038; fJetXMin2[2] = 0.034;
- fJetXMin2[3] = 0.25 ; fJetXMin2[4] = 0.113; fJetXMin2[5] = 0.077 ;
- fJetXMax1[0] =-3.8 ; fJetXMax1[1] =-0.76 ; fJetXMax1[2] =-3.6 ;
- fJetXMax1[3] =-2.7 ; fJetXMax1[4] =-1.21 ; fJetXMax1[5] =-3.7 ;
- fJetXMax2[0] =-0.012; fJetXMax2[1] =-0.022; fJetXMax2[2] = 0.016;
- fJetXMax2[3] =-0.024; fJetXMax2[4] =-0.008; fJetXMax2[5] = 0.027;
+ }
+ else{
+ //If we want to study the jet for different cones and pt
+
+ for(Int_t icone = 0; icone<fNCone; icone++){
+ for(Int_t ipt = 0; ipt<fNPt;ipt++){
+
+ //Jet
+
+ fhJetRatios[icone][ipt] = new TH2F
+ ("JetRatioCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
+ "p_{T jet lead #pi^{0}}/p_{T #gamma} vs p_{T #gamma}, cone ="
+ +fNameCones[icone]+", pt>" +fNamePtThres[ipt]+" GeV/c",
+ 240,0,120,200,0,10);
+ fhJetRatios[icone][ipt]->
+ SetYTitle("p_{T jet lead #pi^{0}}/p_{T #gamma}");
+ fhJetRatios[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
+ fOutputContainer->Add(fhJetRatios[icone][ipt]) ;
+
+
+ fhJetPts[icone][ipt] = new TH2F
+ ("JetPtCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
+ "p_{T jet lead #pi^{0}}/p_{T #gamma} vs p_{T #gamma}, cone ="
+ +fNameCones[icone]+", pt>" +fNamePtThres[ipt]+" GeV/c",
+ 240,0,120,400,0,200);
+ fhJetPts[icone][ipt]->
+ SetYTitle("p_{T jet lead #pi^{0}}/p_{T #gamma}");
+ fhJetPts[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
+ fOutputContainer->Add(fhJetPts[icone][ipt]) ;
+
+ //Bkg
+ fhBkgRatios[icone][ipt] = new TH2F
+ ("BkgRatioCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
+ "p_{T bkg lead #pi^{0}}/p_{T #gamma} vs p_{T #gamma}, cone ="
+ +fNameCones[icone]+", pt>" +fNamePtThres[ipt]+" GeV/c",
+ 240,0,120,200,0,10);
+ fhBkgRatios[icone][ipt]->
+ SetYTitle("p_{T bkg lead #pi^{0}}/p_{T #gamma}");
+ fhBkgRatios[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
+ fOutputContainer->Add(fhBkgRatios[icone][ipt]) ;
+
+ fhBkgPts[icone][ipt] = new TH2F
+ ("BkgPtCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
+ "p_{T jet lead #pi^{0}}/p_{T #gamma} vs p_{T #gamma}, cone ="
+ +fNameCones[icone]+", pt>" +fNamePtThres[ipt]+" GeV/c",
+ 240,0,120,400,0,200);
+ fhBkgPts[icone][ipt]->
+ SetYTitle("p_{T jet lead #pi^{0}}/p_{T #gamma}");
+ fhBkgPts[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
+ fOutputContainer->Add(fhBkgPts[icone][ipt]) ;
+
+ //Counts
+ fhNBkgs[icone][ipt] = new TH1F
+ ("NBkgCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
+ "bkg multiplicity cone ="+fNameCones[icone]+", pt>"
+ +fNamePtThres[ipt]+" GeV/c",9000,0,9000);
+ fhNBkgs[icone][ipt]->SetYTitle("counts");
+ fhNBkgs[icone][ipt]->SetXTitle("N");
+ fOutputContainer->Add(fhNBkgs[icone][ipt]) ;
+
+ fhNLeadings[icone][ipt] = new TH2F
+ ("NLeadingCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
+ "p_{T #gamma} vs p_{T #pi^{0}} cone ="+fNameCones[icone]+", pt>"
+ +fNamePtThres[ipt]+" GeV/c",120,0,120,120,0,120);
+ fhNLeadings[icone][ipt]->SetYTitle("p_{T #pi^{0}}(GeV/c)");
+ fhNLeadings[icone][ipt]->SetXTitle("p_{T #gamma}(GeV/c)");
+ fOutputContainer->Add(fhNLeadings[icone][ipt]) ;
+
+ fhNJets[icone][ipt] = new TH1F
+ ("NJetCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
+ "Number of neutral jets, cone ="+fNameCones[icone]+", pt>"
+ +fNamePtThres[ipt]+" GeV/c",120,0,120);
+ fhNJets[icone][ipt]->SetYTitle("N");
+ fhNJets[icone][ipt]->SetXTitle("p_{T #gamma}(GeV/c)");
+ fOutputContainer->Add(fhNJets[icone][ipt]) ;
+
+ //Fragmentation Function
+ fhJetFragments[icone][ipt] = new TH2F
+ ("JetFragmentCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
+ "x_{T} = p_{T i}/p_{T #gamma}, cone ="+fNameCones[icone]+", pt>"
+ +fNamePtThres[ipt]+" GeV/c",120,0.,120.,240,0.,1.2);
+ fhJetFragments[icone][ipt]->SetYTitle("x_{T}");
+ fhJetFragments[icone][ipt]->SetXTitle("p_{T #gamma}");
+ fOutputContainer->Add(fhJetFragments[icone][ipt]) ;
+
+ fhBkgFragments[icone][ipt] = new TH2F
+ ("BkgFragmentCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
+ "x_{T} = p_{T i}/p_{T #gamma}, cone ="+fNameCones[icone]+", pt>"
+ +fNamePtThres[ipt]+" GeV/c",120,0.,120.,240,0.,1.2);
+ fhBkgFragments[icone][ipt]->SetYTitle("x_{T}");
+ fhBkgFragments[icone][ipt]->SetXTitle("p_{T #gamma}");
+ fOutputContainer->Add(fhBkgFragments[icone][ipt]) ;
+
+ //Jet particle distribution
+
+ fhJetPtDists[icone][ipt] = new TH2F
+ ("JetPtDistCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
+ "p_{T i}, cone ="+fNameCones[icone]+", pt>" +fNamePtThres[ipt]+
+ " GeV/c",120,0.,120.,120,0.,120.);
+ fhJetPtDists[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
+ fOutputContainer->Add(fhJetPtDists[icone][ipt]) ;
+
+ fhBkgPtDists[icone][ipt] = new TH2F
+ ("BkgPtDistCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
+ "p_{T i}, cone ="+fNameCones[icone]+", pt>" +fNamePtThres[ipt]+
+ " GeV/c",120,0.,120.,120,0.,120.);
+ fhBkgPtDists[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
+ fOutputContainer->Add(fhBkgPtDists[icone][ipt]) ;
+
+ }//ipt
+ } //icone
+ }//If we want to study any cone or pt threshold
+}
- //Different cones and pt thresholds to construct the jet
+//____________________________________________________________________________
+void AliAnaGammaJet::Exec(Option_t *)
+{
+
+ // Processing of one event
- fCone = 0.3 ;
- fPtThreshold = 0. ;
- fNCone = 3 ;
- fNPt = 3 ;
- fCones[1] = 0.2 ; fNameCones[1] = "02" ;
- fPtThres[0] = 0.0 ; fNamePtThres[0] = "00" ;
- fCones[0] = 0.3 ; fNameCones[0] = "03" ;
- fPtThres[1] = 0.5 ; fNamePtThres[1] = "05" ;
- fCones[2] = 0.4 ; fNameCones[2] = "04" ;
- fPtThres[2] = 1.0 ; fNamePtThres[2] = "10" ;
- //Fill particle lists when PID is ok
- // fEMCALPID = kFALSE;
- // fPHOSPID = kFALSE;
+ //Get ESDs
+ Long64_t entry = GetChain()->GetReadEntry() ;
+
+ if (!GetESD()) {
+ AliError("fESD is not connected to the input!") ;
+ return ;
+ }
+
+ if (GetPrintInfo())
+ AliInfo(Form("%s ----> Processing event # %lld", (dynamic_cast<TChain *>(GetChain()))->GetFile()->GetName(), entry)) ;
+
+ //CreateTLists with arrays of TParticles. Filled with particles only relevant for the analysis.
+
+ TClonesArray * particleList = new TClonesArray("TParticle",1000); // All particles refitted in CTS and detected in EMCAL (jet)
+ TClonesArray * plCTS = new TClonesArray("TParticle",1000); // All particles refitted in Central Tracking System (ITS+TPC)
+ TClonesArray * plNe = new TClonesArray("TParticle",1000); // All particles measured in Jet Calorimeter
+ TClonesArray * plCalo = new TClonesArray("TParticle",1000); // All particles measured in Prompt Gamma calorimeter
+
+
+ TParticle *pGamma = new TParticle(); //It will contain the kinematics of the found prompt gamma
+ TParticle *pLeading = new TParticle(); //It will contain the kinematics of the found leading particle
+
+ Bool_t iIsInPHOSorEMCAL = kFALSE ; //To check if Gamma was in any calorimeter
+
+ //Fill lists with photons, neutral particles and charged particles
+ //look for the highest energy photon in the event inside fCalorimeter
+ AliDebug(2, "Fill particle lists, get prompt gamma");
+
+ //Fill particle lists
+
+ if(GetCalorimeter() == "PHOS")
+ CreateParticleList(particleList, plCTS,plNe,plCalo);
+ else if(GetCalorimeter() == "EMCAL")
+ CreateParticleList(particleList, plCTS,plCalo,plNe);
+ else
+ AliError("No calorimeter selected");
+
+ //Search highest energy prompt gamma in calorimeter
+ GetPromptGamma(plCalo, plCTS, pGamma, iIsInPHOSorEMCAL) ;
+
+ AliDebug(1, Form("Is Gamma in %s? %d",GetCalorimeter().Data(),iIsInPHOSorEMCAL));
+ AliDebug(3,Form("Charged list entries %d, Neutral list entries %d, %s list entries %d",
+ plCTS->GetEntries(),plNe->GetEntries(), GetCalorimeter().Data(), plCalo->GetEntries()));
- //Initialization of histograms
+ //If there is any prompt photon in fCalorimeter,
+ //search jet leading particle
+
+ if(iIsInPHOSorEMCAL){
+ if (GetPrintInfo())
+ AliInfo(Form("Prompt Gamma: pt %f, phi %f, eta %f", pGamma->Pt(),pGamma->Phi(),pGamma->Eta())) ;
+
+ AliDebug(2, "Get Leading Particles, Make jet");
- MakeHistos() ;
+ //Search leading particles in CTS and EMCAL
+ if(GetLeadingParticle(plCTS, plNe, pGamma, pLeading)){
+ if (GetPrintInfo())
+ AliInfo(Form("Leading: pt %f, phi %f, eta %f", pLeading->Pt(),pLeading->Phi(),pLeading->Eta())) ;
-}
+ //Search Jet
+ if(!fSeveralConeAndPtCuts)
+ MakeJet(particleList,pGamma,pLeading,"");
+ else{
+ for(Int_t icone = 0; icone<fNCone; icone++) {
+ for(Int_t ipt = 0; ipt<fNPt;ipt++) {
+ TString lastname ="Cone"+ fNameCones[icone]+"Pt"+ fNamePtThres[ipt];
+ MakeJet(particleList, pGamma, pLeading,lastname);
+ }//icone
+ }//ipt
+ }//fSeveralConeAndPtCuts
+ }//Leading
+ }//Gamma in Calo
+
+ AliDebug(2, "End of analysis, delete pointers");
-//__________________________________________________________________________-
-Bool_t AliAnaGammaJet::IsAngleInWindow(const Float_t angle,const Float_t e) {
- //Check if the opening angle of the candidate pairs is inside
- //our selection windowd
+ particleList->Delete() ;
+ plCTS->Delete() ;
+ plNe->Delete() ;
+ plCalo->Delete() ;
+ pLeading->Delete();
+ pGamma->Delete();
- Bool_t result = kFALSE;
- Double_t mpi0 = 0.1349766;
- Double_t max = fAngleMaxParam.At(0)*TMath::Exp(fAngleMaxParam.At(1)*e)
- +fAngleMaxParam.At(2)+fAngleMaxParam.At(3)*e;
- Double_t arg = (e*e-2*mpi0*mpi0)/(e*e);
- Double_t min = 100. ;
- if(arg>0.)
- min = TMath::ACos(arg);
+ delete plNe ;
+ delete plCalo ;
+ delete plCTS ;
+ delete particleList ;
+ // delete pLeading;
+ // delete pGamma;
- if((angle<max)&&(angle>=min))
- result = kTRUE;
-
- return result;
-}
+ PostData(0, fOutputContainer);
+}
-//__________________________________________________________________________-
-Bool_t AliAnaGammaJet::IsJetSelected(const Double_t ptg, const Double_t ptj){
- //Check if the energy of the reconstructed jet is within an energy window
+//____________________________________________________________________________
+void AliAnaGammaJet::FillJetHistos(TClonesArray * pl, Double_t ptg, Double_t ptl, TString type, TString lastname)
+{
+ //Fill histograms wth jet fragmentation
+ //and number of selected jets and leading particles
+ //and the background multiplicity
+ TParticle * particle = 0 ;
+ Int_t ipr = 0;
+ Float_t charge = 0;
- Double_t par[6];
- Double_t xmax[2];
- Double_t xmin[2];
+ TIter next(pl) ;
+ while ( (particle = dynamic_cast<TParticle*>(next())) ) {
+ ipr++ ;
+ Double_t pt = particle->Pt();
- Int_t iCTS = 0;
- if(fJetsOnlyInCTS)
- iCTS = 3 ;
+ charge = TDatabasePDG::Instance()
+ ->GetParticle(particle->GetPdgCode())->Charge();
+ if(charge != 0){//Only jet Charged particles
+ dynamic_cast<TH2F*>
+ (fOutputContainer->FindObject(type+"Fragment"+lastname))
+ ->Fill(ptg,pt/ptg);
+ dynamic_cast<TH2F*>
+ (fOutputContainer->FindObject(type+"PtDist"+lastname))
+ ->Fill(ptg,pt);
+ }//charged
- if(!fPbPb){
- //Phythia alone, jets with pt_th > 0.2, r = 0.3
- par[0] = fJetE1[0]; par[1] = fJetE2[0];
- //Energy of the jet peak
- //e_jet = fJetE1[0]+fJetE2[0]*e_gamma, simulation fit
- par[2] = fJetSigma1[0]; par[3] = fJetSigma2[0];
- //Sigma of the jet peak
- //sigma_jet = fJetSigma1[0]+fJetSigma2[0]*e_gamma, simulation fit
- par[4] = fBkgMean[0 + iCTS]; par[5] = fBkgRMS[0 + iCTS];
- //Parameters reserved for PbPb bkg.
- xmax[0] = fJetXMax1[0 + iCTS]; xmax[1] = fJetXMax2[0 + iCTS];
- xmin[0] = fJetXMin1[0 + iCTS]; xmin[1] = fJetXMin2[0 + iCTS];
- //Factor that multiplies sigma to obtain the best limits,
- //by observation, of mono jet ratios (ptjet/ptg)
- //X_jet = fJetX1[0]+fJetX2[0]*e_gamma
-
- }
- else{
- if(ptg > fPtJetSelectionCut){
- //Phythia +PbPb with pt_th > 2 GeV/c, r = 0.3
- par[0] = fJetE1[0]; par[1] = fJetE2[0];
- //Energy of the jet peak, same as in pp
- //e_jet = fJetE1[0]+fJetE2[0]*e_gamma, simulation fit
- par[2] = fJetSigma1[0]; par[3] = fJetSigma2[0];
- //Sigma of the jet peak, same as in pp
- //sigma_jet = fJetSigma1[0]+fJetSigma2[0]*e_gamma, simulation fit
- par[4] = fBkgMean[1 + iCTS]; par[5] = fBkgRMS[1 + iCTS];
- //Mean value and RMS of PbPb Bkg
- xmax[0] = fJetXMax1[1 + iCTS]; xmax[1] = fJetXMax2[1 + iCTS];
- xmin[0] = fJetXMin1[1 + iCTS]; xmin[1] = fJetXMin2[1 + iCTS];
- //Factor that multiplies sigma to obtain the best limits,
- //by observation, of mono jet ratios (ptjet/ptg) mixed with PbPb Bkg,
- //pt_th > 2 GeV, r = 0.3
- //X_jet = fJetX1[0]+fJetX2[0]*e_gamma
-
- }
- else{
- //Phythia + PbPb with pt_th > 0.5 GeV/c, r = 0.3
- par[0] = fJetE1[1]; par[1] = fJetE2[1];
- //Energy of the jet peak, pt_th > 2 GeV/c, r = 0.3
- //e_jet = fJetE1[0]+fJetE2[0]*e_gamma, simulation fit
- par[2] = fJetSigma1[1]; par[3] = fJetSigma2[1];
- //Sigma of the jet peak, pt_th > 2 GeV/c, r = 0.3
- //sigma_jet = fJetSigma1[0]+fJetSigma2[0]*e_gamma, simulation fit
- par[4] = fBkgMean[2 + iCTS]; par[5] = fBkgRMS[2 + iCTS];
- //Mean value and RMS of PbPb Bkg in a 0.3 cone, pt > 2 GeV.
- xmax[0] = fJetXMax1[2 + iCTS]; xmax[1] = fJetXMax2[2 + iCTS];
- xmin[0] = fJetXMin1[2 + iCTS]; xmin[1] = fJetXMin2[2 + iCTS];
- //Factor that multiplies sigma to obtain the best limits,
- //by observation, of mono jet ratios (ptjet/ptg) mixed with PbPb Bkg,
- //pt_th > 2 GeV, r = 0.3
- //X_jet = fJetX1[0]+fJetX2[0]*e_gamma
-
- }//If low pt jet in bkg
- }//if Bkg
+ }//while
- //Calculate minimum and maximum limits of the jet ratio.
- Double_t min = CalculateJetRatioLimit(ptg, par, xmin);
- Double_t max = CalculateJetRatioLimit(ptg, par, xmax);
+ if(type == "Bkg")
+ dynamic_cast<TH1F*>
+ (fOutputContainer->FindObject("NBkg"+lastname))
+ ->Fill(ipr);
+ else{
+ dynamic_cast<TH1F*>
+ (fOutputContainer->FindObject("NJet"+lastname))->
+ Fill(ptg);
+ dynamic_cast<TH2F*>
+ (fOutputContainer->FindObject("NLeading"+lastname))
+ ->Fill(ptg,ptl);
+ }
- 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));
+}
- if(( min < ptj/ptg ) && ( max > ptj/ptg))
- return kTRUE;
- else
- return kFALSE;
+//____________________________________________________________________________
+void AliAnaGammaJet::GetLeadingCharge(TClonesArray * pl, TParticle * pGamma, TParticle * pLeading) const
+{
+ //Search for the charged particle with highest with
+ //Phi=Phi_gamma-Pi and pT=0.1E_gamma
+ Double_t pt = -100.;
+ Double_t phi = -100.;
+
+ for(Int_t ipr = 0;ipr < pl->GetEntries() ; ipr ++ ){
+
+ TParticle * particle = dynamic_cast<TParticle *>(pl->At(ipr)) ;
+
+ Double_t ptl = particle->Pt();
+ Double_t rat = ptl/pGamma->Pt() ;
+ Double_t phil = particle->Phi() ;
+ Double_t phig = pGamma->Phi();
+
+ //Selection within angular and energy limits
+ if(((phig-phil)> fPhiMinCut) && ((phig-phil)<fPhiMaxCut) &&
+ (rat > fRatioMinCut) && (rat < fRatioMaxCut) && (ptl > pt)) {
+ phi = phil ;
+ pt = ptl ;
+ pLeading->SetMomentum(particle->Px(),particle->Py(),particle->Pz(),particle->Energy());
+ AliDebug(4,Form("Charge in CTS: pt %f eta %f phi %f pt/Eg %f \n", pt, particle->Eta(), phi,rat)) ;
+ }
+ }
+
+ AliDebug(3,Form("Leading in CTS: pt %f eta %f phi %f pt/Eg %f \n", pt, pLeading->Eta(), phi,pt/pGamma->Pt())) ;
}
+
//____________________________________________________________________________
-void AliAnaGammaJet::MakeHistos()
-{
- // Create histograms to be saved in output file and
- // stores them in fOutputContainer
-
- fOutputContainer = new TObjArray(10000) ;
-
- TObjArray * outputContainer =GetOutputContainer();
- for(Int_t i = 0; i < outputContainer->GetEntries(); i++ )
- fOutputContainer->Add(outputContainer->At(i)) ;
+void AliAnaGammaJet::GetLeadingPi0(TClonesArray * pl, TParticle * pGamma, TParticle * pLeading)
+{
- //
- fhChargeRatio = new TH2F
- ("ChargeRatio","p_{T leading charge} /p_{T #gamma} vs p_{T #gamma}",
- 120,0,120,120,0,1);
- fhChargeRatio->SetYTitle("p_{T lead charge} /p_{T #gamma}");
- fhChargeRatio->SetXTitle("p_{T #gamma} (GeV/c)");
- fOutputContainer->Add(fhChargeRatio) ;
-
- fhDeltaPhiCharge = new TH2F
- ("DeltaPhiCharge","#phi_{#gamma} - #phi_{charge} vs p_{T #gamma}",
- 200,0,120,200,0,6.4);
- fhDeltaPhiCharge->SetYTitle("#Delta #phi");
- fhDeltaPhiCharge->SetXTitle("p_{T #gamma} (GeV/c)");
- fOutputContainer->Add(fhDeltaPhiCharge) ;
-
- fhDeltaEtaCharge = new TH2F
- ("DeltaEtaCharge","#eta_{#gamma} - #eta_{charge} vs p_{T #gamma}",
- 200,0,120,200,-2,2);
- fhDeltaEtaCharge->SetYTitle("#Delta #eta");
- fhDeltaEtaCharge->SetXTitle("p_{T #gamma} (GeV/c)");
- fOutputContainer->Add(fhDeltaEtaCharge) ;
+ //Search for the neutral pion with highest with
+ //Phi=Phi_gamma-Pi and pT=0.1E_gamma
+ Double_t pt = -100.;
+ Double_t phi = -100.;
+ Double_t ptl = -100.;
+ Double_t rat = -100.;
+ Double_t phil = -100. ;
+ Double_t ptg = pGamma->Pt();
+ Double_t phig = pGamma->Phi();
+
+ TIter next(pl);
+ TParticle * particle = 0;
- //
- if(!fJetsOnlyInCTS){
- fhPi0Ratio = new TH2F
- ("Pi0Ratio","p_{T leading #pi^{0}} /p_{T #gamma} vs p_{T #gamma}",
- 120,0,120,120,0,1);
- fhPi0Ratio->SetYTitle("p_{T lead #pi^{0}} /p_{T #gamma}");
- fhPi0Ratio->SetXTitle("p_{T #gamma} (GeV/c)");
- fOutputContainer->Add(fhPi0Ratio) ;
-
- fhDeltaPhiPi0 = new TH2F
- ("DeltaPhiPi0","#phi_{#gamma} - #phi_{ #pi^{0}} vs p_{T #gamma}",
- 200,0,120,200,0,6.4);
- fhDeltaPhiPi0->SetYTitle("#Delta #phi");
- fhDeltaPhiPi0->SetXTitle("p_{T #gamma} (GeV/c)");
- fOutputContainer->Add(fhDeltaPhiPi0) ;
-
- fhDeltaEtaPi0 = new TH2F
- ("DeltaEtaPi0","#eta_{#gamma} - #eta_{ #pi^{0}} vs p_{T #gamma}",
- 200,0,120,200,-2,2);
- fhDeltaEtaPi0->SetYTitle("#Delta #eta");
- fhDeltaEtaPi0->SetXTitle("p_{T #gamma} (GeV/c)");
- fOutputContainer->Add(fhDeltaEtaPi0) ;
-
- //
- fhAnglePair = new TH2F
- ("AnglePair",
- "Angle between #pi^{0} #gamma pair vs p_{T #pi^{0}}",
- 200,0,50,200,0,0.2);
- fhAnglePair->SetYTitle("Angle (rad)");
- fhAnglePair->SetXTitle("E_{ #pi^{0}} (GeV/c)");
- fOutputContainer->Add(fhAnglePair) ;
-
- fhAnglePairAccepted = new TH2F
- ("AnglePairAccepted",
- "Angle between #pi^{0} #gamma pair vs p_{T #pi^{0}}, both #gamma in eta<0.7, inside window",
- 200,0,50,200,0,0.2);
- fhAnglePairAccepted->SetYTitle("Angle (rad)");
- fhAnglePairAccepted->SetXTitle("E_{ #pi^{0}} (GeV/c)");
- fOutputContainer->Add(fhAnglePairAccepted) ;
-
- fhAnglePairNoCut = new TH2F
- ("AnglePairNoCut",
- "Angle between all #gamma pair vs p_{T #pi^{0}}",200,0,50,200,0,0.2);
- fhAnglePairNoCut->SetYTitle("Angle (rad)");
- fhAnglePairNoCut->SetXTitle("E_{ #pi^{0}} (GeV/c)");
- fOutputContainer->Add(fhAnglePairNoCut) ;
-
- fhAnglePairLeadingCut = new TH2F
- ("AnglePairLeadingCut",
- "Angle between all #gamma pair that have a good phi and pt vs p_{T #pi^{0}}",
- 200,0,50,200,0,0.2);
- fhAnglePairLeadingCut->SetYTitle("Angle (rad)");
- fhAnglePairLeadingCut->SetXTitle("E_{ #pi^{0}} (GeV/c)");
- fOutputContainer->Add(fhAnglePairLeadingCut) ;
-
- fhAnglePairAngleCut = new TH2F
- ("AnglePairAngleCut",
- "Angle between all #gamma pair (angle + leading cut) vs p_{T #pi^{0}}"
- ,200,0,50,200,0,0.2);
- fhAnglePairAngleCut->SetYTitle("Angle (rad)");
- fhAnglePairAngleCut->SetXTitle("E_{ #pi^{0}} (GeV/c)");
- fOutputContainer->Add(fhAnglePairAngleCut) ;
-
- fhAnglePairAllCut = new TH2F
- ("AnglePairAllCut",
- "Angle between all #gamma pair (angle + inv mass cut+leading) vs p_{T #pi^{0}}"
- ,200,0,50,200,0,0.2);
- fhAnglePairAllCut->SetYTitle("Angle (rad)");
- fhAnglePairAllCut->SetXTitle("E_{ #pi^{0}} (GeV/c)");
- fOutputContainer->Add(fhAnglePairAllCut) ;
-
- fhAnglePairLeading = new TH2F
- ("AnglePairLeading",
- "Angle between all #gamma pair finally selected vs p_{T #pi^{0}}",
- 200,0,50,200,0,0.2);
- fhAnglePairLeading->SetYTitle("Angle (rad)");
- fhAnglePairLeading->SetXTitle("E_{ #pi^{0}} (GeV/c)");
- fOutputContainer->Add(fhAnglePairLeading) ;
-
- //
- fhInvMassPairNoCut = new TH2F
- ("InvMassPairNoCut","Invariant Mass of all #gamma pair vs p_{T #gamma}",
- 120,0,120,360,0,0.5);
- fhInvMassPairNoCut->SetYTitle("Invariant Mass (GeV/c^{2})");
- fhInvMassPairNoCut->SetXTitle("p_{T #gamma} (GeV/c)");
- fOutputContainer->Add(fhInvMassPairNoCut) ;
-
- fhInvMassPairLeadingCut = new TH2F
- ("InvMassPairLeadingCut",
- "Invariant Mass of #gamma pair (leading cuts) vs p_{T #gamma}",
- 120,0,120,360,0,0.5);
- fhInvMassPairLeadingCut->SetYTitle("Invariant Mass (GeV/c^{2})");
- fhInvMassPairLeadingCut->SetXTitle("p_{T #gamma} (GeV/c)");
- fOutputContainer->Add(fhInvMassPairLeadingCut) ;
-
- fhInvMassPairAngleCut = new TH2F
- ("InvMassPairAngleCut",
- "Invariant Mass of #gamma pair (angle cut) vs p_{T #gamma}",
- 120,0,120,360,0,0.5);
- fhInvMassPairAngleCut->SetYTitle("Invariant Mass (GeV/c^{2})");
- fhInvMassPairAngleCut->SetXTitle("p_{T #gamma} (GeV/c)");
- fOutputContainer->Add(fhInvMassPairAngleCut) ;
-
- fhInvMassPairAllCut = new TH2F
- ("InvMassPairAllCut",
- "Invariant Mass of #gamma pair (angle+invmass cut+leading) vs p_{T #gamma}",
- 120,0,120,360,0,0.5);
- fhInvMassPairAllCut->SetYTitle("Invariant Mass (GeV/c^{2})");
- fhInvMassPairAllCut->SetXTitle("p_{T #gamma} (GeV/c)");
- fOutputContainer->Add(fhInvMassPairAllCut) ;
+ Int_t iPrimary = -1;
+ TLorentzVector gammai,gammaj;
+ Double_t angle = 0., e = 0., invmass = 0.;
+ Double_t anglef = 0., ef = 0., invmassf = 0.;
+ Int_t ksPdg = 0;
+ Int_t jPrimary=-1;
+
+ while ( (particle = (TParticle*)next()) ) {
+ iPrimary++;
- fhInvMassPairLeading = new TH2F
- ("InvMassPairLeading",
- "Invariant Mass of #gamma pair selected vs p_{T #gamma}",
- 120,0,120,360,0,0.5);
- fhInvMassPairLeading->SetYTitle("Invariant Mass (GeV/c^{2})");
- fhInvMassPairLeading->SetXTitle("p_{T #gamma} (GeV/c)");
- fOutputContainer->Add(fhInvMassPairLeading) ;
+ ksPdg = particle->GetPdgCode();
+ ptl = particle->Pt();
+ if(ksPdg == 111){ //2 gamma overlapped, found with PID
+ rat = ptl/ptg ;
+ phil = particle->Phi() ;
+ //Selection within angular and energy limits
+ if((ptl> pt)&& (rat > fRatioMinCut) && (rat < fRatioMaxCut) &&
+ ((phig-phil)>fPhiMinCut)&&((phig-phil)<fPhiMaxCut)){
+ phi = phil ;
+ pt = ptl ;
+ pLeading->SetMomentum(particle->Px(),particle->Py(),particle->Pz(),particle->Energy());
+ 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())) ;
+ }// cuts
+ }// pdg = 111
+ else if(ksPdg == 22){//1 gamma
+ //Search the photon companion in case it comes from a Pi0 decay
+ //Apply several cuts to select the good pair
+ particle->Momentum(gammai);
+ jPrimary=-1;
+ TIter next2(pl);
+ while ( (particle = (TParticle*)next2()) ) {
+ jPrimary++;
+ if(jPrimary>iPrimary){
+ ksPdg = particle->GetPdgCode();
+
+ if(ksPdg == 22){
+ particle->Momentum(gammaj);
+ //Info("GetLeadingPi0","Egammai %f, Egammaj %f",
+ //gammai.Pt(),gammaj.Pt());
+ ptl = (gammai+gammaj).Pt();
+ phil = (gammai+gammaj).Phi();
+ if(phil < 0)
+ phil+=TMath::TwoPi();
+ rat = ptl/ptg ;
+ invmass = (gammai+gammaj).M();
+ angle = gammaj.Angle(gammai.Vect());
+ //Info("GetLeadingPi0","Angle %f", angle);
+ e = (gammai+gammaj).E();
+ //Fill histograms with no cuts applied.
+ fhAnglePairNoCut->Fill(e,angle);
+ fhInvMassPairNoCut->Fill(ptg,invmass);
+ //First cut on the energy and azimuth of the pair
+ if((rat > fRatioMinCut) && (rat < fRatioMaxCut) &&
+ ((phig-phil)>fPhiMinCut)&&((phig-phil)<fPhiMaxCut)){
+
+ fhAnglePairLeadingCut->Fill(e,angle);
+ fhInvMassPairLeadingCut->Fill(ptg,invmass);
+ //Second cut on the aperture of the pair
+ if(IsAngleInWindow(angle,e)){
+ fhAnglePairAngleCut->Fill(e,angle);
+ fhInvMassPairAngleCut->Fill(ptg,invmass);
+
+ //Info("GetLeadingPi0","InvMass %f", invmass);
+ //Third cut on the invariant mass of the pair
+ if((invmass>fInvMassMinCut) && (invmass<fInvMassMaxCut)){
+ fhInvMassPairAllCut->Fill(ptg,invmass);
+ fhAnglePairAllCut->Fill(e,angle);
+ if(ptl > pt ){
+ pt = ptl;
+ phi = phil ;
+ ef = e ;
+ anglef = angle ;
+ invmassf = invmass ;
+ pLeading->SetMomentum(particle->Px(),particle->Py(),particle->Pz(),particle->Energy());
+ 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())) ;
+ }
+ }//cuts
+ }//(invmass>0.125) && (invmass<0.145)
+ }//gammaj.Angle(gammai.Vect())<0.04
+ }//if pdg = 22
+ }//iprimary<jprimary
+ }//while
+ }// if pdg = 22
+ // }
+ }//while
+
+ if(ef > 0.){//Final pi0 found, highest pair energy, fill histograms
+ fhInvMassPairLeading->Fill(ptg,invmassf);
+ fhAnglePairLeading->Fill(ef,anglef);
}
+ 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())) ;
+}
+
+//____________________________________________________________________________
+Bool_t AliAnaGammaJet::GetLeadingParticle(TClonesArray * plCTS, TClonesArray * plNe,
+ TParticle * pGamma, TParticle * pLeading)
+{
+ //Search Charged or Neutral leading particle, select the highest one.
- if(!fSeveralConeAndPtCuts){
-
- //Count
- fhNBkg = new TH1F("NBkg","bkg multiplicity",9000,0,9000);
- fhNBkg->SetYTitle("counts");
- fhNBkg->SetXTitle("N");
- fOutputContainer->Add(fhNBkg) ;
-
- fhNLeading = new TH2F
- ("NLeading","Accepted Jet Leading", 240,0,120,240,0,120);
- fhNLeading->SetYTitle("p_{T charge} (GeV/c)");
- fhNLeading->SetXTitle("p_{T #gamma}(GeV/c)");
- fOutputContainer->Add(fhNLeading) ;
-
- fhNJet = new TH1F("NJet","Accepted jets",240,0,120);
- fhNJet->SetYTitle("N");
- fhNJet->SetXTitle("p_{T #gamma}(GeV/c)");
- fOutputContainer->Add(fhNJet) ;
-
- //Ratios and Pt dist of reconstructed (not selected) jets
- //Jet
- fhJetRatio = new TH2F
- ("JetRatio","p_{T jet lead}/p_{T #gamma} vs p_{T #gamma}",
- 240,0,120,200,0,10);
- fhJetRatio->SetYTitle("p_{T jet lead #pi^{0}}/p_{T #gamma}");
- fhJetRatio->SetXTitle("p_{T #gamma} (GeV/c)");
- fOutputContainer->Add(fhJetRatio) ;
-
- fhJetPt = new TH2F
- ("JetPt", "p_{T jet lead} vs p_{T #gamma}",240,0,120,400,0,200);
- fhJetPt->SetYTitle("p_{T jet}");
- fhJetPt->SetXTitle("p_{T #gamma} (GeV/c)");
- fOutputContainer->Add(fhJetPt) ;
-
- //Bkg
-
- fhBkgRatio = new TH2F
- ("BkgRatio","p_{T bkg lead}/p_{T #gamma} vs p_{T #gamma}",
- 240,0,120,200,0,10);
- fhBkgRatio->SetYTitle("p_{T bkg lead charge}/p_{T #gamma}");
- fhBkgRatio->SetXTitle("p_{T #gamma} (GeV/c)");
- fOutputContainer->Add(fhBkgRatio) ;
-
- fhBkgPt = new TH2F
- ("BkgPt","p_{T jet lead} vs p_{T #gamma}",240,0,120,400,0,200);
- fhBkgPt->SetYTitle("p_{T jet lead charge}/p_{T #gamma}");
- fhBkgPt->SetXTitle("p_{T #gamma} (GeV/c)");
- fOutputContainer->Add(fhBkgPt) ;
-
- //Jet Distributions
-
- fhJetFragment =
- new TH2F("JetFragment","x = p_{T i charged}/p_{T #gamma}",
- 240,0.,120.,1000,0.,1.2);
- fhJetFragment->SetYTitle("x_{T}");
- fhJetFragment->SetXTitle("p_{T #gamma}");
- fOutputContainer->Add(fhJetFragment) ;
-
- fhBkgFragment = new TH2F
- ("BkgFragment","x = p_{T i charged}/p_{T #gamma}",
- 240,0.,120.,1000,0.,1.2);
- fhBkgFragment->SetYTitle("x_{T}");
- fhBkgFragment->SetXTitle("p_{T #gamma}");
- fOutputContainer->Add(fhBkgFragment) ;
-
- fhJetPtDist =
- new TH2F("JetPtDist","x = p_{T i charged}",240,0.,120.,400,0.,200.);
- fhJetPtDist->SetXTitle("p_{T #gamma} (GeV/c)");
- fOutputContainer->Add(fhJetPtDist) ;
-
- fhBkgPtDist = new TH2F
- ("BkgPtDist","x = p_{T i charged}",240,0.,120.,400,0.,200.);
- fhBkgPtDist->SetXTitle("p_{T #gamma} (GeV/c)");
- fOutputContainer->Add(fhBkgPtDist) ;
+ TParticle * pLeadingCh = new TParticle();
+ TParticle * pLeadingPi0 = new TParticle();
+
+ Double_t ptg = pGamma->Pt();
+ Double_t phig = pGamma->Phi();
+ Double_t etag = pGamma->Eta();
+
+ if(GetCalorimeter() == "PHOS" && !fJetsOnlyInCTS)
+ {
+ AliDebug(3, "GetLeadingPi0");
+ GetLeadingPi0 (plNe, pGamma, pLeadingPi0) ;
+ AliDebug(3, "GetLeadingCharge");
+ GetLeadingCharge(plCTS, pGamma, pLeadingCh) ;
+
+ Double_t ptch = pLeadingCh->Pt();
+ Double_t phich = pLeadingCh->Phi();
+ Double_t etach = pLeadingCh->Eta();
+ Double_t ptpi = pLeadingPi0->Pt();
+ Double_t phipi = pLeadingPi0->Phi();
+ Double_t etapi = pLeadingPi0->Eta();
+
+ //Is leading cone inside EMCAL acceptance?
+
+ Bool_t insidech = kFALSE ;
+ if((phich - fCone) > fPhiEMCALCut[0] &&
+ (phich + fCone) < fPhiEMCALCut[1] &&
+ (etach-fCone) < fEtaEMCALCut )
+ insidech = kTRUE ;
+
+ Bool_t insidepi = kFALSE ;
+ if((phipi - fCone) > fPhiEMCALCut[0] &&
+ (phipi + fCone) < fPhiEMCALCut[1] &&
+ (etapi-fCone) < fEtaEMCALCut )
+ insidepi = kTRUE ;
+
+ AliDebug(2,Form("Leading: charged pt %f, pi0 pt %f",ptch,ptpi)) ;
+
+ if (ptch > 0 || ptpi > 0)
+ {
+ if(insidech && (ptch > ptpi))
+ {
+ if (GetPrintInfo())
+ AliInfo("Leading found in CTS");
+ pLeading->SetMomentum(pLeadingCh->Px(),pLeadingCh->Py(),pLeadingCh->Pz(),pLeadingCh->Energy());
+ AliDebug(3,Form("Final leading found in CTS, pt %f, phi %f, eta %f",ptch,phich,etach)) ;
+ fhChargeRatio->Fill(ptg,ptch/pGamma->Pt());
+ fhDeltaPhiCharge->Fill(ptg,pGamma->Phi()-phich);
+ fhDeltaEtaCharge->Fill(ptg,pGamma->Eta()-etach);
+ return 1;
+ }
+
+ else if((ptpi > ptch) && insidepi)
+ {
+ if (GetPrintInfo())
+ AliInfo("Leading found in EMCAL");
+ pLeading->SetMomentum(pLeadingPi0->Px(),pLeadingPi0->Py(),pLeadingPi0->Pz(),pLeadingPi0->Energy());
+ AliDebug(3,Form("Final leading found in EMCAL, pt %f, phi %f, eta %f",ptpi,phipi,etapi)) ;
+ fhPi0Ratio ->Fill(ptg,ptpi/ptg);
+ fhDeltaPhiPi0->Fill(ptg,phig-phipi);
+ fhDeltaEtaPi0->Fill(ptg,etag-etapi);
+ return 1;
+ }
+
+ else{
+ AliDebug(3,"NO LEADING PARTICLE FOUND");}
+ return 0;
+ }
+ else{
+ AliDebug(3,"NO LEADING PARTICLE FOUND");
+ return 0;
+ }
+ }
+
+ else
+ {
+ //No calorimeter present for Leading particle detection
+ GetLeadingCharge(plCTS, pGamma, pLeading) ;
+ Double_t ptch = pLeading->Pt();
+ Double_t phich = pLeading->Phi();
+ Double_t etach = pLeading->Eta();
+ if(ptch > 0){
+ fhChargeRatio->Fill(ptg,ptch/ptg);
+ fhDeltaPhiCharge->Fill(ptg,phig-phich);
+ fhDeltaEtaCharge->Fill(ptg,etag-etach);
+ AliDebug(3,Form("Leading found : pt %f, phi %f, eta %f",ptch,phich,etach)) ;
+ return 1;
+ }
+ else
+ {
+ AliDebug(3,"NO LEADING PARTICLE FOUND");
+ return 0;
+ }
+ }
+}
+
+ //____________________________________________________________________________
+void AliAnaGammaJet::InitParameters()
+{
+// // Initialisation of branch container
+ //AliAnaGammaDirect::InitParameters();
+
+ //Initialize the parameters of the analysis.
+ //fCalorimeter="PHOS";
+ fAngleMaxParam.Set(4) ;
+ fAngleMaxParam.AddAt(0.4,0);//={0.4,-0.25,0.025,-2e-4};
+ fAngleMaxParam.AddAt(-0.25,1) ;
+ fAngleMaxParam.AddAt(0.025,2) ;
+ fAngleMaxParam.AddAt(-2e-4,3) ;
+ fSeveralConeAndPtCuts = kFALSE ;
+ //fPrintInfo = kTRUE;
+ fPbPb = kFALSE ;
+ fInvMassMaxCut = 0.16 ;
+ fInvMassMinCut = 0.11 ;
+ //fJetsOnlyInCTS = kTRUE ;
+ fEtaEMCALCut = 0.7 ;
+ fPhiEMCALCut[0] = 80. *TMath::Pi()/180.;
+ fPhiEMCALCut[1] = 190.*TMath::Pi()/180.;
+ fPhiMaxCut = 3.4 ;
+ fPhiMinCut = 2.9 ;
+
+ //Jet selection parameters
+ //Fixed cut (old)
+ fRatioMaxCut = 1.0 ;
+ fRatioMinCut = 0.1 ;
+ fJetRatioMaxCut = 1.2 ;
+ fJetRatioMinCut = 0.3 ;
+ fJetsOnlyInCTS = kFALSE ;
+ fJetCTSRatioMaxCut = 1.2 ;
+ fJetCTSRatioMinCut = 0.3 ;
+ fSelect = 0 ;
+
+ //Cut depending on gamma energy
+
+ fPtJetSelectionCut = 20.; //For Low pt jets+BKG, another limits applied
+ //Reconstructed jet energy dependence parameters
+ //e_jet = a1+e_gamma b2.
+ //Index 0-> Pt>2 GeV r = 0.3; Index 1-> Pt>0.5 GeV r = 0.3
+ fJetE1[0] = -5.75; fJetE1[1] = -4.1;
+ fJetE2[0] = 1.005; fJetE2[1] = 1.05;
+ //Reconstructed sigma of jet energy dependence parameters
+ //s_jet = a1+e_gamma b2.
+ //Index 0-> Pt>2 GeV r = 0.3; Index 1-> Pt>0.5 GeV r = 0.3
+ fJetSigma1[0] = 2.65; fJetSigma1[1] = 2.75;
+ fJetSigma2[0] = 0.0018; fJetSigma2[1] = 0.033;
+
+ //Background mean energy and RMS
+ //Index 0-> No BKG; Index 1-> BKG > 2 GeV;
+ //Index 2-> (low pt jets)BKG > 0.5 GeV;
+ //Index > 2, same for CTS conf
+ fBkgMean[0] = 0.; fBkgMean[1] = 8.8 ; fBkgMean[2] = 69.5;
+ fBkgMean[3] = 0.; fBkgMean[4] = 6.4; fBkgMean[5] = 48.6;
+ fBkgRMS[0] = 0.; fBkgRMS[1] = 7.5; fBkgRMS[2] = 22.0;
+ fBkgRMS[3] = 0.; fBkgRMS[4] = 5.4; fBkgRMS[5] = 13.2;
+
+ //Factor x of min/max = E -+ x * sigma. Obtained after selecting the
+ //limits for monoenergetic jets.
+ //Index 0-> No BKG; Index 1-> BKG > 2 GeV;
+ //Index 2-> (low pt jets) BKG > 0.5 GeV;
+ //Index > 2, same for CTS conf
+
+ fJetXMin1[0] =-0.69 ; fJetXMin1[1] = 0.39 ; fJetXMin1[2] =-0.88 ;
+ fJetXMin1[3] =-2.0 ; fJetXMin1[4] =-0.442 ; fJetXMin1[5] =-1.1 ;
+ fJetXMin2[0] = 0.066; fJetXMin2[1] = 0.038; fJetXMin2[2] = 0.034;
+ fJetXMin2[3] = 0.25 ; fJetXMin2[4] = 0.113; fJetXMin2[5] = 0.077 ;
+ fJetXMax1[0] =-3.8 ; fJetXMax1[1] =-0.76 ; fJetXMax1[2] =-3.6 ;
+ fJetXMax1[3] =-2.7 ; fJetXMax1[4] =-1.21 ; fJetXMax1[5] =-3.7 ;
+ fJetXMax2[0] =-0.012; fJetXMax2[1] =-0.022; fJetXMax2[2] = 0.016;
+ fJetXMax2[3] =-0.024; fJetXMax2[4] =-0.008; fJetXMax2[5] = 0.027;
+
+
+ //Different cones and pt thresholds to construct the jet
+
+ fCone = 0.3 ;
+ fPtThreshold = 0. ;
+ fNCone = 3 ;
+ fNPt = 3 ;
+ fCones[1] = 0.2 ; fNameCones[1] = "02" ;
+ fPtThres[0] = 0.0 ; fNamePtThres[0] = "00" ;
+ fCones[0] = 0.3 ; fNameCones[0] = "03" ;
+ fPtThres[1] = 0.5 ; fNamePtThres[1] = "05" ;
+ fCones[2] = 0.4 ; fNameCones[2] = "04" ;
+ fPtThres[2] = 1.0 ; fNamePtThres[2] = "10" ;
+ //Fill particle lists when PID is ok
+ // fEMCALPID = kFALSE;
+ // fPHOSPID = kFALSE;
+
+}
+
+//__________________________________________________________________________-
+Bool_t AliAnaGammaJet::IsAngleInWindow(const Float_t angle,const Float_t e) {
+ //Check if the opening angle of the candidate pairs is inside
+ //our selection windowd
+
+ Bool_t result = kFALSE;
+ Double_t mpi0 = 0.1349766;
+ Double_t max = fAngleMaxParam.At(0)*TMath::Exp(fAngleMaxParam.At(1)*e)
+ +fAngleMaxParam.At(2)+fAngleMaxParam.At(3)*e;
+ Double_t arg = (e*e-2*mpi0*mpi0)/(e*e);
+ Double_t min = 100. ;
+ if(arg>0.)
+ min = TMath::ACos(arg);
+
+ if((angle<max)&&(angle>=min))
+ result = kTRUE;
+
+ return result;
+}
+
+//__________________________________________________________________________-
+Bool_t AliAnaGammaJet::IsJetSelected(const Double_t ptg, const Double_t ptj){
+ //Check if the energy of the reconstructed jet is within an energy window
+
+ Double_t par[6];
+ Double_t xmax[2];
+ Double_t xmin[2];
+
+ Int_t iCTS = 0;
+ if(fJetsOnlyInCTS)
+ iCTS = 3 ;
+
+ if(!fPbPb){
+ //Phythia alone, jets with pt_th > 0.2, r = 0.3
+ par[0] = fJetE1[0]; par[1] = fJetE2[0];
+ //Energy of the jet peak
+ //e_jet = fJetE1[0]+fJetE2[0]*e_gamma, simulation fit
+ par[2] = fJetSigma1[0]; par[3] = fJetSigma2[0];
+ //Sigma of the jet peak
+ //sigma_jet = fJetSigma1[0]+fJetSigma2[0]*e_gamma, simulation fit
+ par[4] = fBkgMean[0 + iCTS]; par[5] = fBkgRMS[0 + iCTS];
+ //Parameters reserved for PbPb bkg.
+ xmax[0] = fJetXMax1[0 + iCTS]; xmax[1] = fJetXMax2[0 + iCTS];
+ xmin[0] = fJetXMin1[0 + iCTS]; xmin[1] = fJetXMin2[0 + iCTS];
+ //Factor that multiplies sigma to obtain the best limits,
+ //by observation, of mono jet ratios (ptjet/ptg)
+ //X_jet = fJetX1[0]+fJetX2[0]*e_gamma
+
}
else{
- //If we want to study the jet for different cones and pt
-
- for(Int_t icone = 0; icone<fNCone; icone++){
- for(Int_t ipt = 0; ipt<fNPt;ipt++){
-
- //Jet
-
- fhJetRatios[icone][ipt] = new TH2F
- ("JetRatioCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
- "p_{T jet lead #pi^{0}}/p_{T #gamma} vs p_{T #gamma}, cone ="
- +fNameCones[icone]+", pt>" +fNamePtThres[ipt]+" GeV/c",
- 240,0,120,200,0,10);
- fhJetRatios[icone][ipt]->
- SetYTitle("p_{T jet lead #pi^{0}}/p_{T #gamma}");
- fhJetRatios[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
- fOutputContainer->Add(fhJetRatios[icone][ipt]) ;
-
-
- fhJetPts[icone][ipt] = new TH2F
- ("JetPtCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
- "p_{T jet lead #pi^{0}}/p_{T #gamma} vs p_{T #gamma}, cone ="
- +fNameCones[icone]+", pt>" +fNamePtThres[ipt]+" GeV/c",
- 240,0,120,400,0,200);
- fhJetPts[icone][ipt]->
- SetYTitle("p_{T jet lead #pi^{0}}/p_{T #gamma}");
- fhJetPts[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
- fOutputContainer->Add(fhJetPts[icone][ipt]) ;
-
- //Bkg
- fhBkgRatios[icone][ipt] = new TH2F
- ("BkgRatioCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
- "p_{T bkg lead #pi^{0}}/p_{T #gamma} vs p_{T #gamma}, cone ="
- +fNameCones[icone]+", pt>" +fNamePtThres[ipt]+" GeV/c",
- 240,0,120,200,0,10);
- fhBkgRatios[icone][ipt]->
- SetYTitle("p_{T bkg lead #pi^{0}}/p_{T #gamma}");
- fhBkgRatios[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
- fOutputContainer->Add(fhBkgRatios[icone][ipt]) ;
-
- fhBkgPts[icone][ipt] = new TH2F
- ("BkgPtCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
- "p_{T jet lead #pi^{0}}/p_{T #gamma} vs p_{T #gamma}, cone ="
- +fNameCones[icone]+", pt>" +fNamePtThres[ipt]+" GeV/c",
- 240,0,120,400,0,200);
- fhBkgPts[icone][ipt]->
- SetYTitle("p_{T jet lead #pi^{0}}/p_{T #gamma}");
- fhBkgPts[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
- fOutputContainer->Add(fhBkgPts[icone][ipt]) ;
-
- //Counts
- fhNBkgs[icone][ipt] = new TH1F
- ("NBkgCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
- "bkg multiplicity cone ="+fNameCones[icone]+", pt>"
- +fNamePtThres[ipt]+" GeV/c",9000,0,9000);
- fhNBkgs[icone][ipt]->SetYTitle("counts");
- fhNBkgs[icone][ipt]->SetXTitle("N");
- fOutputContainer->Add(fhNBkgs[icone][ipt]) ;
-
- fhNLeadings[icone][ipt] = new TH2F
- ("NLeadingCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
- "p_{T #gamma} vs p_{T #pi^{0}} cone ="+fNameCones[icone]+", pt>"
- +fNamePtThres[ipt]+" GeV/c",120,0,120,120,0,120);
- fhNLeadings[icone][ipt]->SetYTitle("p_{T #pi^{0}}(GeV/c)");
- fhNLeadings[icone][ipt]->SetXTitle("p_{T #gamma}(GeV/c)");
- fOutputContainer->Add(fhNLeadings[icone][ipt]) ;
-
- fhNJets[icone][ipt] = new TH1F
- ("NJetCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
- "Number of neutral jets, cone ="+fNameCones[icone]+", pt>"
- +fNamePtThres[ipt]+" GeV/c",120,0,120);
- fhNJets[icone][ipt]->SetYTitle("N");
- fhNJets[icone][ipt]->SetXTitle("p_{T #gamma}(GeV/c)");
- fOutputContainer->Add(fhNJets[icone][ipt]) ;
-
- //Fragmentation Function
- fhJetFragments[icone][ipt] = new TH2F
- ("JetFragmentCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
- "x_{T} = p_{T i}/p_{T #gamma}, cone ="+fNameCones[icone]+", pt>"
- +fNamePtThres[ipt]+" GeV/c",120,0.,120.,240,0.,1.2);
- fhJetFragments[icone][ipt]->SetYTitle("x_{T}");
- fhJetFragments[icone][ipt]->SetXTitle("p_{T #gamma}");
- fOutputContainer->Add(fhJetFragments[icone][ipt]) ;
-
- fhBkgFragments[icone][ipt] = new TH2F
- ("BkgFragmentCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
- "x_{T} = p_{T i}/p_{T #gamma}, cone ="+fNameCones[icone]+", pt>"
- +fNamePtThres[ipt]+" GeV/c",120,0.,120.,240,0.,1.2);
- fhBkgFragments[icone][ipt]->SetYTitle("x_{T}");
- fhBkgFragments[icone][ipt]->SetXTitle("p_{T #gamma}");
- fOutputContainer->Add(fhBkgFragments[icone][ipt]) ;
-
- //Jet particle distribution
-
- fhJetPtDists[icone][ipt] = new TH2F
- ("JetPtDistCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
- "p_{T i}, cone ="+fNameCones[icone]+", pt>" +fNamePtThres[ipt]+
- " GeV/c",120,0.,120.,120,0.,120.);
- fhJetPtDists[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
- fOutputContainer->Add(fhJetPtDists[icone][ipt]) ;
-
- fhBkgPtDists[icone][ipt] = new TH2F
- ("BkgPtDistCone"+fNameCones[icone]+"Pt"+fNamePtThres[ipt],
- "p_{T i}, cone ="+fNameCones[icone]+", pt>" +fNamePtThres[ipt]+
- " GeV/c",120,0.,120.,120,0.,120.);
- fhBkgPtDists[icone][ipt]->SetXTitle("p_{T #gamma} (GeV/c)");
- fOutputContainer->Add(fhBkgPtDists[icone][ipt]) ;
-
- }//ipt
- } //icone
- }//If we want to study any cone or pt threshold
+ if(ptg > fPtJetSelectionCut){
+ //Phythia +PbPb with pt_th > 2 GeV/c, r = 0.3
+ par[0] = fJetE1[0]; par[1] = fJetE2[0];
+ //Energy of the jet peak, same as in pp
+ //e_jet = fJetE1[0]+fJetE2[0]*e_gamma, simulation fit
+ par[2] = fJetSigma1[0]; par[3] = fJetSigma2[0];
+ //Sigma of the jet peak, same as in pp
+ //sigma_jet = fJetSigma1[0]+fJetSigma2[0]*e_gamma, simulation fit
+ par[4] = fBkgMean[1 + iCTS]; par[5] = fBkgRMS[1 + iCTS];
+ //Mean value and RMS of PbPb Bkg
+ xmax[0] = fJetXMax1[1 + iCTS]; xmax[1] = fJetXMax2[1 + iCTS];
+ xmin[0] = fJetXMin1[1 + iCTS]; xmin[1] = fJetXMin2[1 + iCTS];
+ //Factor that multiplies sigma to obtain the best limits,
+ //by observation, of mono jet ratios (ptjet/ptg) mixed with PbPb Bkg,
+ //pt_th > 2 GeV, r = 0.3
+ //X_jet = fJetX1[0]+fJetX2[0]*e_gamma
+
+ }
+ else{
+ //Phythia + PbPb with pt_th > 0.5 GeV/c, r = 0.3
+ par[0] = fJetE1[1]; par[1] = fJetE2[1];
+ //Energy of the jet peak, pt_th > 2 GeV/c, r = 0.3
+ //e_jet = fJetE1[0]+fJetE2[0]*e_gamma, simulation fit
+ par[2] = fJetSigma1[1]; par[3] = fJetSigma2[1];
+ //Sigma of the jet peak, pt_th > 2 GeV/c, r = 0.3
+ //sigma_jet = fJetSigma1[0]+fJetSigma2[0]*e_gamma, simulation fit
+ par[4] = fBkgMean[2 + iCTS]; par[5] = fBkgRMS[2 + iCTS];
+ //Mean value and RMS of PbPb Bkg in a 0.3 cone, pt > 2 GeV.
+ xmax[0] = fJetXMax1[2 + iCTS]; xmax[1] = fJetXMax2[2 + iCTS];
+ xmin[0] = fJetXMin1[2 + iCTS]; xmin[1] = fJetXMin2[2 + iCTS];
+ //Factor that multiplies sigma to obtain the best limits,
+ //by observation, of mono jet ratios (ptjet/ptg) mixed with PbPb Bkg,
+ //pt_th > 2 GeV, r = 0.3
+ //X_jet = fJetX1[0]+fJetX2[0]*e_gamma
+
+ }//If low pt jet in bkg
+ }//if Bkg
+
+ //Calculate minimum and maximum limits of the jet ratio.
+ Double_t min = CalculateJetRatioLimit(ptg, par, xmin);
+ Double_t max = CalculateJetRatioLimit(ptg, par, xmax);
+
+ 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));
+
+ if(( min < ptj/ptg ) && ( max > ptj/ptg))
+ return kTRUE;
+ else
+ return kFALSE;
+
}
//____________________________________________________________________________