+++ /dev/null
-# -*- mode: cmake -*-
-
-set(SRCS
- PartCorr/AliAnaCaloTrigger.cxx PartCorr/AliAnaCaloTriggerMC.cxx
- PartCorr/AliAODParticleCorrelation.cxx PartCorr/AliAnalysisTaskPHOSExample.cxx
- PartCorr/AliNeutralMesonSelection.cxx PartCorr/AliFidutialCut.cxx PartCorr/AliCaloPID.cxx PartCorr/AliIsolationCut.cxx
- PartCorr/AliAnaScale.cxx PartCorr/AliAnaPartCorrMaker.cxx
- PartCorr/AliAnaPartCorrBaseClass.cxx PartCorr/AliAnaExample.cxx PartCorr/AliAnaGammaDirect.cxx
- PartCorr/AliAnaParticlePartonCorrelation.cxx PartCorr/AliAnaParticleHadronCorrelation.cxx
- PartCorr/AliAnaParticleJetFinderCorrelation.cxx
- PartCorr/AliAnaParticleJetLeadingConeCorrelation.cxx PartCorr/AliAnalysisTaskParticleCorrelation.cxx
- PartCorr/AliCaloTrackReader.cxx PartCorr/AliCaloTrackESDReader.cxx
- PartCorr/AliCaloTrackAODReader.cxx PartCorr/AliCaloTrackMCReader.cxx
- PartCorr/AliCaloPhoton.cxx PartCorr/AliAnaPi0.cxx
-)
-
-# fill list of header files from list of source files
-# by exchanging the file extension
-String(REPLACE ".cxx" ".h" HDRS "${SRCS}")
-
-AddLibrary(PWG4PartCorr "${SRCS}" "${HDRS}")
-
+++ /dev/null
-#! /bin/sh
-
-make
+++ /dev/null
-void SETUP()
-{
-
- // Load the ESD library
- gSystem->Load("libPWG4PartCorr");
-
- // Set the Include paths
- gSystem->SetIncludePath("-I$ROOTSYS/include -IPWG4PartCorr");
- gROOT->ProcessLine(".include PWG4PartCorr/PartCorr");
-
- // Set our location, so that other packages can find us
- gSystem->Setenv("PWG4PartCorr_INCLUDE", "PWG4PartCorr/PartCorr");
-}
+++ /dev/null
-#ifdef __CINT__
-
-#pragma link off all globals;
-#pragma link off all classes;
-#pragma link off all functions;
-
-#pragma link C++ class AliAnaCaloTrigger+;
-#pragma link C++ class AliAnaCaloTriggerMC+;
-#pragma link C++ class AliAODParticleCorrelation+;
-#pragma link C++ class AliAnalysisTaskPHOSExample+;
-#pragma link C++ class AliAnaScale+;
-#pragma link C++ class AliNeutralMesonSelection+;
-#pragma link C++ class AliFidutialCut+;
-#pragma link C++ class AliCaloPID+;
-#pragma link C++ class AliIsolationCut+;
-#pragma link C++ class AliAnaPartCorrMaker+;
-#pragma link C++ class AliAnaPartCorrBaseClass+;
-#pragma link C++ class AliAnaExample+;
-#pragma link C++ class AliCaloPhoton+;
-#pragma link C++ class AliAnaPi0+;
-#pragma link C++ class AliAnaGammaDirect+;
-#pragma link C++ class AliAnaParticlePartonCorrelation+;
-#pragma link C++ class AliAnaParticleHadronCorrelation+;
-#pragma link C++ class AliAnaParticleJetFinderCorrelation+;
-#pragma link C++ class AliAnaParticleJetLeadingConeCorrelation+;
-#pragma link C++ class AliAnalysisTaskParticleCorrelation+;
-#pragma link C++ class AliCaloTrackReader+;
-#pragma link C++ class AliCaloTrackESDReader+;
-#pragma link C++ class AliCaloTrackAODReader+;
-#pragma link C++ class AliCaloTrackMCReader+;
-
-#endif
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-/* $Id: AliAODParticleCorrelation.h $ */
-
-//-------------------------------------------------------------------------
-// AOD class for photon and other particles storage and
-// correlation studies
-// Author: Yves Schutz, CERN, Gustavo Conesa, INFN
-//-------------------------------------------------------------------------
-
-//-- ROOT system --
-
-//-- Analysis system
-#include "AliAODParticleCorrelation.h"
-
-ClassImp(AliAODParticleCorrelation)
-
-
-//______________________________________________________________________________
-AliAODParticleCorrelation::AliAODParticleCorrelation() :
- AliVParticle(),
- fMomentum(0),fPdg(-1), fTag(-1),fLabel(-1),fDetector(""),fR(0),
- fRefTracks(new TRefArray()), fRefClusters(new TRefArray()),
- fRefIsolationConeTracks(new TRefArray()), fRefIsolationConeClusters(new TRefArray()),
- fRefBackgroundTracks(new TRefArray()), fRefBackgroundClusters(new TRefArray()),
- fLeadingDetector(""), fLeading(), fCorrJet(), fCorrBkg(), fRefJet(0)
-{
- // constructor
-}
-
-//______________________________________________________________________________
-AliAODParticleCorrelation::AliAODParticleCorrelation(Double_t px, Double_t py, Double_t pz, Double_t e):
- AliVParticle(),
- fMomentum(0),fPdg(-1), fTag(-1),fLabel(-1),fDetector(""),fR(0),
- fRefTracks(new TRefArray()), fRefClusters(new TRefArray()),
- fRefIsolationConeTracks(new TRefArray()), fRefIsolationConeClusters(new TRefArray()),
- fRefBackgroundTracks(new TRefArray()), fRefBackgroundClusters(new TRefArray()),
- fLeadingDetector(""), fLeading(), fCorrJet(),
- fCorrBkg(), fRefJet(0)
-{
- // constructor
- fMomentum = new TLorentzVector(px, py, pz, e);
-}
-
-//______________________________________________________________________________
-AliAODParticleCorrelation::AliAODParticleCorrelation(TLorentzVector & p):
- AliVParticle(),
- fMomentum(0),fPdg(-1), fTag(-1),fLabel(-1),fDetector(""),fR(0),
- fRefTracks(new TRefArray()), fRefClusters(new TRefArray()),
- fRefIsolationConeTracks(new TRefArray()), fRefIsolationConeClusters(new TRefArray()),
- fRefBackgroundTracks(new TRefArray()), fRefBackgroundClusters(new TRefArray()),
- fLeadingDetector(""), fLeading(), fCorrJet(), fCorrBkg(),fRefJet(0)
-{
- // constructor
- fMomentum = new TLorentzVector(p);
-}
-
-
-//______________________________________________________________________________
-AliAODParticleCorrelation::~AliAODParticleCorrelation()
-{
- // destructor
- delete fMomentum;
- delete fRefTracks;
- delete fRefClusters;
- delete fRefIsolationConeTracks;
- delete fRefIsolationConeClusters;
- delete fRefBackgroundTracks;
- delete fRefBackgroundClusters;
-
-}
-
-//______________________________________________________________________________
-AliAODParticleCorrelation::AliAODParticleCorrelation(const AliAODParticleCorrelation& part) :
- AliVParticle(part),
- fMomentum(0) ,fPdg(part.fPdg), fTag(part.fTag),fLabel(part.fLabel),
- fDetector(part.fDetector),
- fR(part.fR),
- fRefTracks(), fRefClusters(),
- fRefIsolationConeTracks(), fRefIsolationConeClusters(),
- fRefBackgroundTracks(), fRefBackgroundClusters(),
- fLeadingDetector(part.fLeadingDetector), fLeading(part.fLeading),
- fCorrJet(part.fCorrJet), fCorrBkg(part.fCorrBkg), fRefJet(part.fRefJet)
-{
- // Copy constructor
- fMomentum = new TLorentzVector(*part.fMomentum);
- fRefTracks = new TRefArray(*part.fRefTracks);
- fRefClusters = new TRefArray(*part.fRefClusters);
- fRefIsolationConeTracks = new TRefArray(*part.fRefIsolationConeTracks);
- fRefIsolationConeClusters = new TRefArray(*part.fRefIsolationConeClusters);
- fRefBackgroundTracks = new TRefArray(*part.fRefBackgroundTracks);
- fRefBackgroundClusters = new TRefArray(*part.fRefBackgroundClusters);
-}
-
-//______________________________________________________________________________
-AliAODParticleCorrelation& AliAODParticleCorrelation::operator=(const AliAODParticleCorrelation& part)
-{
- // Assignment operator
- if(this!=&part) {
- }
-
- fPdg = part.fPdg;
- fTag = part.fTag;
- fLabel = part.fLabel;
- fR = part.fR;
- fRefJet = part.fRefJet ;
- fDetector =part.fDetector;
- fLeadingDetector =part.fLeadingDetector;
- fLeading = part.fLeading;
- fCorrJet = part.fCorrJet ;
- fCorrBkg = part.fCorrBkg;
-
- if (fMomentum ) delete fMomentum;
- if( fRefTracks ) delete fRefTracks ;
- if( fRefClusters) delete fRefClusters ;
- if( fRefIsolationConeTracks ) delete fRefIsolationConeTracks ;
- if( fRefIsolationConeClusters) delete fRefIsolationConeClusters ;
- if( fRefBackgroundTracks ) delete fRefBackgroundTracks ;
- if( fRefBackgroundClusters ) delete fRefBackgroundClusters ;
-
- fMomentum = new TLorentzVector(*part.fMomentum);
- fRefTracks = new TRefArray(*part.fRefTracks);
- fRefClusters = new TRefArray(*part.fRefClusters);
- fRefIsolationConeTracks = new TRefArray(*part.fRefIsolationConeTracks);
- fRefIsolationConeClusters = new TRefArray(*part.fRefIsolationConeClusters);
- fRefBackgroundTracks = new TRefArray(*part.fRefBackgroundTracks);
- fRefBackgroundClusters = new TRefArray(*part.fRefBackgroundClusters);
-
- return *this;
-}
-
-void AliAODParticleCorrelation::Print(Option_t* /*option*/) const
-{
- // Print information of all data members
- printf("Particle 4-vector:\n");
- printf(" E = %13.3f\n", E() );
- printf(" Px = %13.3f\n", Px());
- printf(" Py = %13.3f\n", Py());
- printf(" Pz = %13.3f\n", Pz());
- printf("pdg : %d\n",fPdg);
- printf("tag : %d\n",fTag);
- printf("R : %2.2f\n",fR);
- printf("Trigger Detector : %s\n",fDetector.Data());
- printf("Leading Detector : %s\n",fLeadingDetector.Data());
- // if(fRefJet) fRefJet.Print();
-
-}
+++ /dev/null
-#ifndef AliAODParticleCorrelation_H
-#define AliAODParticleCorrelation_H
-/* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id: AliAODParticleCorrelation.h $ */
-
-//-------------------------------------------------------------------------
-// Copy of AOD photon class, adapted for particle identification
-// and correlations analysis
-// Author: Yves Schutz, CERN, Gustavo Conesa, INFN
-//-------------------------------------------------------------------------
-
-//-- ROOT system --
-#include <TLorentzVector.h>
-class TString;
-
-//-- Analysis system
-#include "AliAODJet.h"
-#include "AliVParticle.h"
-
-class AliAODParticleCorrelation : public AliVParticle {
-
- public:
- AliAODParticleCorrelation();
- AliAODParticleCorrelation(Double_t px, Double_t py, Double_t pz, Double_t e);
- AliAODParticleCorrelation(TLorentzVector & p);
- virtual ~AliAODParticleCorrelation();
- AliAODParticleCorrelation(const AliAODParticleCorrelation& photon);
- AliAODParticleCorrelation& operator=(const AliAODParticleCorrelation& photon);
-
- // AliVParticle methods
- virtual Double_t Px() const { return fMomentum->Px(); }
- virtual Double_t Py() const { return fMomentum->Py(); }
- virtual Double_t Pz() const { return fMomentum->Pz(); }
- virtual Double_t Pt() const { return fMomentum->Pt(); }
- virtual Double_t P() const { return fMomentum->P(); }
- virtual Bool_t PxPyPz(Double_t p[3]) const { p[0] = Px(); p[1] = Py(); p[2] = Pz(); return kTRUE; }
- virtual Double_t OneOverPt() const { return 1. / fMomentum->Pt(); }
- virtual Double_t Phi() const;
- virtual Double_t Theta() const { return fMomentum->Theta(); }
- virtual Double_t E() const { return fMomentum->E(); }
- virtual Double_t M() const { return fMomentum->M(); }
- virtual Double_t Eta() const { return fMomentum->Eta(); }
- virtual Double_t Y() const { return fMomentum->Rapidity();}
- virtual Double_t Xv() const {return -999.;} // put reasonable values here
- virtual Double_t Yv() const {return -999.;} //
- virtual Double_t Zv() const {return -999.;} //
- virtual Bool_t XvYvZv(Double_t x[3]) const { x[0] = Xv(); x[1] = Yv(); x[2] = Zv(); return kTRUE; }
- virtual void Print(Option_t* /*option*/) const;
-
- //
- //Dummy
- virtual Short_t Charge() const { return 0;}
- virtual const Double_t* PID() const { return NULL;}
- //
-
- virtual Float_t GetR() const {return fR ; }
- virtual Int_t GetPdg() const {return fPdg ; }
- virtual Int_t GetTag() const {return fTag ; }
- virtual Int_t GetLabel() const {return fLabel ; }
- virtual TString GetDetector() const {return fDetector ; }
-
- virtual void SetR(Float_t r) {fR = r ; }
- virtual void SetPdg(Int_t pdg) {fPdg = pdg ; }
- virtual void SetTag(Int_t tag) {fTag = tag ; }
- virtual void SetLabel(Int_t l) {fLabel = l ; }
- virtual void SetDetector(TString d) {fDetector = d ; }
-
- virtual TRefArray* GetRefTracks() const { return fRefTracks;}
- virtual void AddTrack(TObject *tr) {fRefTracks->Add(tr);}
- TObject* GetTrack(Int_t i) {return fRefTracks->At(i);}
-
- virtual TRefArray* GetRefClusters() const { return fRefClusters;}
- virtual void AddCluster(TObject *tr) {fRefClusters->Add(tr);}
- TObject* GetCluster(Int_t i) {return fRefClusters->At(i);}
-
- virtual TRefArray* GetRefIsolationConeTracks() const { return fRefIsolationConeTracks;}
- virtual void AddIsolationConeTrack(TObject *tr) {fRefIsolationConeTracks->Add(tr);}
- TObject* GetIsolationConeTrack(Int_t i) {return fRefIsolationConeTracks->At(i);}
-
- virtual TRefArray* GetRefIsolationConeClusters() const { return fRefIsolationConeClusters;}
- virtual void AddIsolationConeCluster(TObject *tr) {fRefIsolationConeClusters->Add(tr);}
- TObject* GetIsolationConeCluster(Int_t i) {return fRefIsolationConeClusters->At(i);}
-
- virtual TRefArray* GetRefBackgroundTracks() const { return fRefBackgroundTracks;}
- virtual void AddBackgroundTrack(TObject *tr) {fRefBackgroundTracks->Add(tr);}
- TObject* GetBackgroundTrack(Int_t i) {return fRefBackgroundTracks->At(i);}
-
- virtual TRefArray* GetRefBackgroundClusters() const { return fRefBackgroundClusters;}
- virtual void AddBackgroundCluster(TObject *tr) {fRefBackgroundClusters->Add(tr);}
- TObject* GetBackgroundCluster(Int_t i) {return fRefBackgroundClusters->At(i);}
-
- virtual void SetLeadingDetector(TString d) {fLeadingDetector = d ; }
- virtual TString GetLeadingDetector() const {return fLeadingDetector ; }
-
- virtual TLorentzVector GetLeading() const { return fLeading;}
- virtual void SetLeading(TLorentzVector lead) {fLeading = lead;}
-
- virtual TLorentzVector GetCorrelatedJet() const { return fCorrJet;}
- virtual void SetCorrelatedJet(TLorentzVector jet) {fCorrJet = jet;}
-
- virtual TLorentzVector GetCorrelatedBackground() const { return fCorrBkg;}
- virtual void SetCorrelatedBackground(TLorentzVector bkg) {fCorrBkg = bkg;}
-
- void SetRefJet(AliAODJet* jet) { fRefJet = jet;}
- AliAODJet* GetJet() {return ((AliAODJet*) fRefJet.GetObject());}
- TRef GetRefJet() {return fRefJet;}
-
- private:
- TLorentzVector* fMomentum; // Photon 4-momentum vector
- Int_t fPdg; // id of particle
- Int_t fTag; // tag of particle (decay, fragment, prompt photon)
- Int_t fLabel; // MC label
- TString fDetector; // Detector where particle was measured.
- Float_t fR ; // Isolation cone size
- TRefArray* fRefTracks; // array of references to the tracks belonging to the jet / all selected hadrons
- TRefArray* fRefClusters; // array of references to the clusters belonging to the jet / all selected hadrons
-
- TRefArray* fRefIsolationConeTracks; // array of references to the tracks belonging to the cone around direct particle candidate
- TRefArray* fRefIsolationConeClusters; // array of references to the clusters belonging to the cone around direct particle candidate
-
- TRefArray* fRefBackgroundTracks; // array of references to the tracks for background stimation
- TRefArray* fRefBackgroundClusters; // array of references to the clusters for background stimation
-
- TString fLeadingDetector; // Detector where leading particle was measured.
- TLorentzVector fLeading; // Leading Particle 4-momentum vector
-
- TLorentzVector fCorrJet; // Jet 4-momentum vector
- TLorentzVector fCorrBkg; // Background 4-momentum vector
-
- TRef fRefJet; // Rerence to jet found with JETAN and correlated with particle
-
- ClassDef(AliAODParticleCorrelation,1);
-};
-
-inline Double_t AliAODParticleCorrelation::Phi() const
-{
- // Return phi
- Double_t phi = fMomentum->Phi();
- if (phi < 0.) phi += 2. * TMath::Pi();
- return phi;
-}
-
-#endif
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-//_________________________________________________________________________
-// An analysis task to check the trigger data in ESD
-// Creates an ntuple for 2x2 and NxN triggers
-// Each ntuple connects the maximum trigger amplitudes
-// and its positions with reconstructed clusters
-//
-//*-- Yves Schutz (CERN) & Gustavo Conesa Balbastre (INFN-LNF)
-//////////////////////////////////////////////////////////////////////////////
-
-#include <TChain.h>
-#include <TFile.h>
-#include <TNtuple.h>
-#include <TVector3.h>
-
-#include "AliAnaCaloTrigger.h"
-#include "AliAnalysisManager.h"
-#include "AliESDEvent.h"
-#include "AliLog.h"
-#include "AliESDCaloCluster.h"
-
-//______________________________________________________________________________
-AliAnaCaloTrigger::AliAnaCaloTrigger() :
- fChain(0),
- fESD(0),
- fOutputContainer(0),
- fCalorimeter("PHOS"),
- fNtTrigger22(0),
- fNtTriggerNN(0)
-
-{
- // Default Constructor.
-
-}
-
-//______________________________________________________________________________
-AliAnaCaloTrigger::AliAnaCaloTrigger(const char *name) :
- AliAnalysisTask(name,"AnaCaloTrigger"),
- fChain(0),
- fESD(0),
- fOutputContainer(0),
- fCalorimeter("PHOS"),
- fNtTrigger22(0),
- fNtTriggerNN(0)
-
-{
- // Constructor.
- // Input slot #0 works with an Ntuple
- DefineInput(0, TChain::Class());
- // Output slot #0 writes into a TH1 container
- DefineOutput(0, TObjArray::Class()) ;
-}
-//____________________________________________________________________________
-AliAnaCaloTrigger::AliAnaCaloTrigger(const AliAnaCaloTrigger & ct) :
- AliAnalysisTask(ct), fChain(ct.fChain), fESD(ct.fESD),
- fOutputContainer(ct.fOutputContainer), fCalorimeter(ct. fCalorimeter),
- fNtTrigger22(ct.fNtTrigger22), fNtTriggerNN(ct.fNtTriggerNN)
-{
-
- // cpy ctor
- SetName (ct.GetName()) ;
- SetTitle(ct.GetTitle()) ;
-
-}
-
-//_________________________________________________________________________
-AliAnaCaloTrigger & AliAnaCaloTrigger::operator = (const AliAnaCaloTrigger & source)
-{
- // assignment operator
-
- if(&source == this) return *this;
-
- fChain = source.fChain ;
- fESD = source.fESD ;
- fOutputContainer = source.fOutputContainer ;
- fCalorimeter = source. fCalorimeter ;
- fNtTrigger22 = source.fNtTrigger22 ;
- fNtTriggerNN = source.fNtTriggerNN ;
-
- return *this;
-
-}
-
-//______________________________________________________________________________
-AliAnaCaloTrigger::~AliAnaCaloTrigger()
-{
- // dtor
- //fOutputContainer->Clear() ;
- //delete fOutputContainer ;
-
-}
-
-
-//______________________________________________________________________________
-void AliAnaCaloTrigger::ConnectInputData(const Option_t*)
-{
- // Initialisation of branch container and histograms
-
- AliInfo(Form("*** Initialization of %s", GetName())) ;
-
- // Get input data
- fChain = dynamic_cast<TChain *>(GetInputData(0)) ;
- if (!fChain) {
- AliError(Form("Input 0 for %s not found\n", GetName()));
- return ;
- }
-
- fESD = new AliESDEvent();
- fESD->ReadFromTree(fChain);
-
-}
-
-//________________________________________________________________________
-
-void AliAnaCaloTrigger::CreateOutputObjects()
-{
-
- // Create the outputs containers
- OpenFile(0) ;
-
- // create histograms
- fNtTrigger22 = new TNtuple(fCalorimeter+"trigger22", "Trigger data 2x2 patch", "a22:a220:enMax:phEnMax:eta22:phi22:etaMax:phiMax:phEtaMax:phPhiMax");
- fNtTriggerNN = new TNtuple(fCalorimeter+"triggerNN", "Trigger data NxN patch", "aNN:aNN0:enMax:phEnMax:etaNN:phiNN:etaMax:phiMax:phEtaMax:phPhiMax");
-
- // create output container
-
- fOutputContainer = new TObjArray(2) ;
- fOutputContainer->SetName(GetName()) ;
-
- fOutputContainer->AddAt(fNtTrigger22, 0) ;
- fOutputContainer->AddAt(fNtTriggerNN, 1) ;
-
-}
-
-//______________________________________________________________________________
-void AliAnaCaloTrigger::Exec(Option_t *)
-{
- // Processing of one event
-
- Long64_t entry = fChain->GetReadEntry() ;
-
- if (!fESD) {
- AliError("fESD is not connected to the input!") ;
- return ;
- }
-
- if ( !((entry-1)%100) )
- AliInfo(Form("%s ----> Processing event # %lld", (dynamic_cast<TChain *>(fChain))->GetFile()->GetName(), entry)) ;
-
- // Get trigger information of fCalorimeter
- TArrayF * triggerAmplitudes = 0x0 ;
- TArrayF * triggerPosition = 0x0 ;
- Int_t numberOfCaloClusters = fESD->GetNumberOfCaloClusters() ;
-
- if(fCalorimeter == "PHOS"){
- triggerAmplitudes = fESD->GetPHOSTriggerAmplitudes();
- triggerPosition = fESD->GetPHOSTriggerPosition();
- }
- else if(fCalorimeter == "EMCAL"){
- triggerAmplitudes = fESD->GetEMCALTriggerAmplitudes();
- triggerPosition = fESD->GetEMCALTriggerPosition();
- }
-
- if( triggerAmplitudes && triggerPosition ){
- // trigger amplitudes
- const Float_t ka22 = static_cast<Float_t>(triggerAmplitudes->At(0)) ;
- const Float_t ka22O = static_cast<Float_t>(triggerAmplitudes->At(1)) ;
- const Float_t kaNN = static_cast<Float_t>(triggerAmplitudes->At(2)) ;
- const Float_t kaNNO = static_cast<Float_t>(triggerAmplitudes->At(3)) ;
-
- // trigger position
- const Float_t kx22 = static_cast<Float_t>(triggerPosition->At(0)) ;
- const Float_t ky22 = static_cast<Float_t>(triggerPosition->At(1)) ;
- const Float_t kz22 = static_cast<Float_t>(triggerPosition->At(2)) ;
- const Float_t kxNN = static_cast<Float_t>(triggerPosition->At(3)) ;
- const Float_t kyNN = static_cast<Float_t>(triggerPosition->At(4)) ;
- const Float_t kzNN = static_cast<Float_t>(triggerPosition->At(5)) ;
-
- Float_t enMax = 0. ;
- Float_t phEnMax = 0. ;
- Float_t etaMax = 0.5 ;
- Float_t phiMax = 0. ;
- Float_t phEtaMax = 0.5 ;
- Float_t phPhiMax = 0. ;
-
- TVector3 vpos22(kx22, ky22, kz22) ;
- TVector3 vposNN(kxNN, kyNN, kzNN) ;
- Float_t eta22 = vpos22.Eta() ;
- Float_t phi22 = vpos22.Phi() * TMath::RadToDeg() + 360. ;
- Float_t etaNN = vposNN.Eta() ;
- Float_t phiNN = vposNN.Phi() * TMath::RadToDeg() + 360. ;
-
- Int_t icaloCluster ;
-
- // loop over the Calorimeters Clusters
-
- for(icaloCluster = 0 ; icaloCluster < numberOfCaloClusters ; icaloCluster++) {
-
- AliESDCaloCluster * cluster = fESD->GetCaloCluster(icaloCluster) ;
-
- if (cluster && ( (fCalorimeter == "PHOS" && cluster->IsPHOS()) ||
- (fCalorimeter == "EMCAL" && cluster->IsEMCAL()))) {
-
- Float_t cluEnergy = cluster->E() ;
- Float_t pos[3] ;
- TVector3 vpos ;
-
- cluster->GetPosition( pos ) ;
-
- if ( cluEnergy > enMax) {
- enMax = cluEnergy ;
- vpos.SetXYZ(pos[0], pos[1], pos[2]) ;
- etaMax = vpos.Eta() ;
- phiMax = vpos.Phi() ;
- }
-
- Double_t * pid = cluster->GetPid() ;
-
- if(pid[AliPID::kPhoton] > 0.9) {
- if ( cluEnergy > phEnMax) {
- phEnMax = cluEnergy ;
- vpos.SetXYZ(pos[0], pos[1], pos[2]) ;
- phEtaMax = vpos.Eta() ;
- phPhiMax = vpos.Phi() ;
- }
- }
- }//if cluster
-
- fNtTrigger22->Fill(ka22, ka22O, enMax, phEnMax, eta22, phi22, etaMax, phiMax * TMath::RadToDeg() + 360., phEtaMax, phPhiMax * TMath::RadToDeg() + 360.);
- fNtTriggerNN->Fill(kaNN, kaNNO, enMax, phEnMax, etaNN, phiNN, etaMax, phiMax * TMath::RadToDeg() + 360., phEtaMax, phPhiMax * TMath::RadToDeg() + 360.);
- }//CaloCluster loop
-
- }//If trigger arrays filled
-
- PostData(0, fOutputContainer);
-
-}
-
-//______________________________________________________________________________
-void AliAnaCaloTrigger::Terminate(Option_t *)
-{
- // Processing when the event loop is ended
-
-}
+++ /dev/null
-#ifndef ALIANACALOTRIGGER_H
-#define ALIANACALOTRIGGER_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-//______________________________________________________________________________
-// An analysis task to check the trigger data in ESD
-// Creates an ntuple for 2x2 and NxN triggers
-// Each ntuple connects the maximum trigger amplitudes
-// and its positions with reconstructed clusters
-//
-//*-- Yves Schutz (CERN) & Gustavo Conesa Balbastre (INFN-LNF)
-//////////////////////////////////////////////////////////////////////////////
-
-
-#include "AliAnalysisTask.h"
-class TFile ;
-class TNtuple ;
-class TH1D ;
-class TH1I ;
-class TChain;
-
-class AliAnalysisManager ;
-class AliESDEvent ;
-
-class AliAnaCaloTrigger : public AliAnalysisTask {
-
-public:
- AliAnaCaloTrigger() ;
- AliAnaCaloTrigger(const char *name) ;
- AliAnaCaloTrigger(const AliAnaCaloTrigger & trig) ;
- AliAnaCaloTrigger & operator=(const AliAnaCaloTrigger& source);
- virtual ~AliAnaCaloTrigger() ;
-
- virtual void Exec(Option_t * opt = "") ;
- virtual void ConnectInputData(Option_t *);
- virtual void CreateOutputObjects();
- virtual void Terminate(Option_t * opt = "") ;
-
- TString GetCalorimeter() const {return fCalorimeter ; }
- void SetCalorimeter(TString calo) {fCalorimeter = calo ; }
-
-private:
- TChain * fChain ; //!pointer to the analyzed TTree or TChain
- AliESDEvent * fESD ; //! Declaration of leave types
-
- TObjArray * fOutputContainer ; //! output data container
-
- TString fCalorimeter ; // "PHOS" or "EMCAL"
-
- // Histograms
- TNtuple * fNtTrigger22 ; //Ntuple with 2x2 max dig amplitude and cluster energy, and positions.
- TNtuple * fNtTriggerNN ; //Ntuple with NxN max dig amplitude and cluster energy, and positions.
-
- ClassDef(AliAnaCaloTrigger, 1); // a photon analysis task
-};
-#endif // ALIANACALOTRIGGER_H
+++ /dev/null
-
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-//_________________________________________________________________________
-// An analysis task to check the trigger data in ESD with MC data
-// Creates an ntuple for 2x2 and NxN triggers
-// Each ntuple connects the maximum trigger amplitudes
-// and its positions with reconstructed clusters and MC
-//
-//*-- Yves Schutz (CERN) & Gustavo Conesa Balbastre (INFN-LNF)
-//////////////////////////////////////////////////////////////////////////////
-
-#include <TChain.h>
-#include <TFile.h>
-#include <TNtuple.h>
-#include <TVector3.h>
-
-#include "AliAnalysisManager.h"
-#include "AliMCEventHandler.h"
-#include "AliMCEvent.h"
-#include "AliAnaCaloTriggerMC.h"
-#include "AliESDEvent.h"
-#include "AliESDCaloCluster.h"
-#include "AliLog.h"
-#include "AliStack.h"
-#include "TParticle.h"
-
-//______________________________________________________________________________
-AliAnaCaloTriggerMC::AliAnaCaloTriggerMC() :
- fChain(0),
- fESD(0),
- fOutputContainer(0),
- fCalorimeter("PHOS"),
- fNtTrigger22(0),
- fNtTriggerNN(0)
-
-{
- // Default constructor.
-
-}
-//______________________________________________________________________________
-AliAnaCaloTriggerMC::AliAnaCaloTriggerMC(const char *name) :
- AliAnalysisTask(name, "AnaCaloTriggerMC"),
- fChain(0),
- fESD(0),
- fOutputContainer(0),
- fCalorimeter("PHOS"),
- fNtTrigger22(0),
- fNtTriggerNN(0)
-
-{
- // Constructor.
- // Input slot #0 works with an Ntuple
- DefineInput(0, TChain::Class());
- // Output slot #0 writes into a TH1 container
- DefineOutput(0, TObjArray::Class()) ;
-}
-//____________________________________________________________________________
-AliAnaCaloTriggerMC::AliAnaCaloTriggerMC(const AliAnaCaloTriggerMC & ct) :
- AliAnalysisTask(ct),fChain(ct.fChain), fESD(ct.fESD),
- fOutputContainer(ct.fOutputContainer), fCalorimeter(ct. fCalorimeter),
- fNtTrigger22(ct.fNtTrigger22), fNtTriggerNN(ct.fNtTriggerNN)
-{
-
- // cpy ctor
- SetName (ct.GetName()) ;
- SetTitle(ct.GetTitle()) ;
-
-}
-
-//_________________________________________________________________________
-AliAnaCaloTriggerMC & AliAnaCaloTriggerMC::operator = (const AliAnaCaloTriggerMC & source)
-{
- // assignment operator
-
- if(&source == this) return *this;
-
- fChain = source.fChain ;
- fESD = source.fESD ;
- fOutputContainer = source.fOutputContainer ;
- fCalorimeter = source. fCalorimeter ;
- fNtTrigger22 = source.fNtTrigger22 ;
- fNtTriggerNN = source.fNtTriggerNN ;
-
- return *this;
-
-}
-
-//______________________________________________________________________________
-AliAnaCaloTriggerMC::~AliAnaCaloTriggerMC()
-{
- // dtor
- // fOutputContainer->Clear() ;
- // delete fOutputContainer ;
-
-}
-
-
-//______________________________________________________________________________
-void AliAnaCaloTriggerMC::ConnectInputData(const Option_t*)
-{
- // Initialisation of branch container and histograms
-
- AliInfo(Form("*** Initialization of %s", GetName())) ;
-
- // Get input data
- fChain = dynamic_cast<TChain *>(GetInputData(0)) ;
- if (!fChain) {
- AliError(Form("Input 0 for %s not found\n", GetName()));
- return ;
- }
-
- fESD = new AliESDEvent();
- fESD->ReadFromTree(fChain);
-
-}
-
-//________________________________________________________________________
-
-void AliAnaCaloTriggerMC::CreateOutputObjects()
-{
-
- // Create the output container
- OpenFile(0);
-
- // create histograms
- fNtTrigger22 = new TNtuple(fCalorimeter+"trigger22", "Trigger data 2x2 patch", "a22:a220:enMax:phEnMax:eta22:phi22:etaMax:phiMax:phEtaMax:phPhiMax");
- fNtTriggerNN = new TNtuple(fCalorimeter+"triggerNN", "Trigger data NxN patch", "aNN:aNN0:enMax:phEnMax:etaNN:phiNN:etaMax:phiMax:phEtaMax:phPhiMax");
-
- // create output container
-
- fOutputContainer = new TObjArray(2) ;
- fOutputContainer->SetName(GetName()) ;
-
- fOutputContainer->AddAt(fNtTrigger22, 0) ;
- fOutputContainer->AddAt(fNtTriggerNN, 1) ;
-
-}
-
-//______________________________________________________________________________
-void AliAnaCaloTriggerMC::Exec(Option_t *)
-{
-
- // Processing of one event
-
- Long64_t entry = fChain->GetReadEntry() ;
-
- if (!fESD) {
- AliError("fESD is not connected to the input!") ;
- return ;
- }
-
- if ( !((entry-1)%100) )
- AliInfo(Form("%s ----> Processing event # %lld", (dynamic_cast<TChain *>(fChain))->GetFile()->GetName(), entry)) ;
-
- //Get MC data
- AliStack* stack = 0x0;
- AliMCEventHandler* mctruth = (AliMCEventHandler*)
- ((AliAnalysisManager::GetAnalysisManager())->GetMCtruthEventHandler());
-
- if(mctruth)
- stack = mctruth->MCEvent()->Stack();
-
- if (!stack) {
- AliError("Stack not found") ;
- return ;
- }
-
- // Get trigger information of fCalorimeter
- TArrayF * triggerAmplitudes = 0x0 ;
- TArrayF * triggerPosition = 0x0 ;
- Int_t numberOfCaloClusters = 0 ;
-
- if(fCalorimeter == "PHOS"){
- triggerAmplitudes = fESD->GetPHOSTriggerAmplitudes();
- triggerPosition = fESD->GetPHOSTriggerPosition();
- }
- else if(fCalorimeter == "EMCAL"){
- triggerAmplitudes = fESD->GetEMCALTriggerAmplitudes();
- triggerPosition = fESD->GetEMCALTriggerPosition();
- }
-
- if( triggerAmplitudes && triggerPosition ){
- // trigger amplitudes
- const Float_t ka22 = static_cast<Float_t>(triggerAmplitudes->At(0)) ;
- const Float_t ka22O = static_cast<Float_t>(triggerAmplitudes->At(1)) ;
- const Float_t kaNN = static_cast<Float_t>(triggerAmplitudes->At(2)) ;
- const Float_t kaNNO = static_cast<Float_t>(triggerAmplitudes->At(3)) ;
-
- // trigger position
- const Float_t kx22 = static_cast<Float_t>(triggerPosition->At(0)) ;
- const Float_t ky22 = static_cast<Float_t>(triggerPosition->At(1)) ;
- const Float_t kz22 = static_cast<Float_t>(triggerPosition->At(2)) ;
- const Float_t kxNN = static_cast<Float_t>(triggerPosition->At(3)) ;
- const Float_t kyNN = static_cast<Float_t>(triggerPosition->At(4)) ;
- const Float_t kzNN = static_cast<Float_t>(triggerPosition->At(5)) ;
-
- Float_t enMax = 0. ;
- Float_t phEnMax = 0. ;
- Float_t etaMax = 0.5 ;
- Float_t phiMax = 0. ;
- Float_t phEtaMax = 0.5 ;
- Float_t phPhiMax = 0. ;
-
- TVector3 vpos22(kx22, ky22, kz22) ;
- TVector3 vposNN(kxNN, kyNN, kzNN) ;
- Float_t eta22 = vpos22.Eta() ;
- Float_t phi22 = vpos22.Phi() * TMath::RadToDeg() + 360. ;
- Float_t etaNN = vposNN.Eta() ;
- Float_t phiNN = vposNN.Phi() * TMath::RadToDeg() + 360. ;
-
- Int_t icaloCluster ;
-
- // loop over the Calorimeters Clusters
- Float_t cluEnergy = 0;
- Int_t labelmax = -5;
- for(icaloCluster = 0 ; icaloCluster < numberOfCaloClusters ; icaloCluster++) {
-
- AliESDCaloCluster * cluster = fESD->GetCaloCluster(icaloCluster) ;
-
- if (cluster && ( (fCalorimeter == "PHOS" && cluster->IsPHOS()) ||
- (fCalorimeter == "EMCAL" && cluster->IsEMCAL()))) {
-
- cluEnergy = cluster->E() ;
- Float_t pos[3] ;
- TVector3 vpos ;
-
- cluster->GetPosition( pos ) ;
-
- if ( cluEnergy > enMax) {
- enMax = cluEnergy ;
- vpos.SetXYZ(pos[0], pos[1], pos[2]) ;
- etaMax = vpos.Eta() ;
- phiMax = vpos.Phi() ;
- labelmax = cluster->GetLabel();
- }
-
- Double_t * pid = cluster->GetPid() ;
-
- if(pid[AliPID::kPhoton] > 0.9) {
- if ( cluEnergy > phEnMax) {
- phEnMax = cluEnergy ;
- vpos.SetXYZ(pos[0], pos[1], pos[2]) ;
- phEtaMax = vpos.Eta() ;
- phPhiMax = vpos.Phi() ;
- }
- }
- }//if cluster
- }//CaloCluster loop
-
- if(labelmax < stack->GetNtrack() && labelmax >= 0 ){
- TParticle * particle = stack->Particle(labelmax);
- Float_t ptgen = particle->Energy();
- fNtTrigger22->Fill(ka22, ka22O, ptgen, enMax, phEnMax, eta22, phi22, etaMax, phiMax * TMath::RadToDeg() + 360., phEtaMax, phPhiMax * TMath::RadToDeg() + 360.);
- fNtTriggerNN->Fill(kaNN, kaNNO, ptgen, enMax, phEnMax, etaNN, phiNN, etaMax, phiMax * TMath::RadToDeg() + 360., phEtaMax, phPhiMax * TMath::RadToDeg() + 360.);
- }
- else AliDebug(1, Form("Wrong label %d, ntrack %d, Emax %f ",labelmax, stack->GetNtrack(), phEnMax));
- }//If trigger arrays filled
-
- PostData(0, fOutputContainer);
-
-}
-
-
-//______________________________________________________________________________
-void AliAnaCaloTriggerMC::Terminate(Option_t *)
-{
- // Processing when the event loop is ended
-
-}
+++ /dev/null
-#ifndef ALIANACALOTRIGGERMC_H
-#define ALIANACALOTRIGGERMC_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-//______________________________________________________________________________
-// An analysis task to check the trigger data in ESD with MC data
-// Creates an ntuple for 2x2 and NxN triggers
-// Each ntuple connects the maximum trigger amplitudes
-// and its positions with reconstructed clusters and MC
-//
-//*-- Yves Schutz (CERN) & Gustavo Conesa Balbastre (INFN-LNF)
-//////////////////////////////////////////////////////////////////////////////
-
-#include "AliAnalysisTask.h"
-
-class TFile ;
-class TNtuple ;
-class TH1D ;
-class TH1I ;
-class TChain;
-
-class AliMCEvent ;
-class AliESDEvent ;
-
-class AliAnaCaloTriggerMC : public AliAnalysisTask {
-
-public:
- AliAnaCaloTriggerMC();
- AliAnaCaloTriggerMC(const char *name) ;
- AliAnaCaloTriggerMC(const AliAnaCaloTriggerMC & trig) ;
- AliAnaCaloTriggerMC & operator=(const AliAnaCaloTriggerMC& source);
- virtual ~AliAnaCaloTriggerMC() ;
-
- virtual void Exec(Option_t * opt = "") ;
- virtual void ConnectInputData(Option_t *);
- virtual void CreateOutputObjects();
- virtual void Terminate(Option_t * opt = "") ;
-
- TString GetCalorimeter() const {return fCalorimeter ; }
- void SetCalorimeter(TString calo) {fCalorimeter = calo ; }
-
-private:
- TChain * fChain ; //!pointer to the analyzed TTree or TChain
- AliESDEvent * fESD ; //! Declaration of leave types
-
- TObjArray * fOutputContainer ; //! output data container
-
- TString fCalorimeter ; // "PHOS" or "EMCAL"
-
- // Histograms
- TNtuple * fNtTrigger22 ; //Ntuple with 2x2 max dig amplitude and MC particle and cluster energy, and positions.
- TNtuple * fNtTriggerNN ; //Ntuple with NxN max dig amplitude and MC particle and cluster energy, and positions.
-
- ClassDef(AliAnaCaloTriggerMC, 1); // a photon analysis task
-};
-#endif // ALIANACALOTRIGGERMC_H
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-/* $Id: $ */
-
-//_________________________________________________________________________
-// Example class on how to read AODCaloClusters, ESDCaloCells and AODTracks and how
-// fill AODs with PWG4PartCorr analysis frame
-// Select the type of detector information that you want to analyze, CTS (tracking), PHOS or EMCAL
-// Select the PID custer type of the calorimeters
-// Set min momentum of the cluster/tracks
-// Fill few histograms
-//
-//-- Author: Gustavo Conesa (INFN-LNF)
-//-- Author: Gustavo Conesa (LNF-INFN)
-//_________________________________________________________________________
-
-
-// --- ROOT system ---
-#include "Riostream.h"
-#include "TClonesArray.h"
-#include "TH2F.h"
-#include "TParticle.h"
-
-//---- AliRoot system ----
-#include "AliAnaExample.h"
-#include "AliCaloTrackReader.h"
-#include "AliLog.h"
-#include "AliAODParticleCorrelation.h"
-#include "AliESDCaloCells.h"
-
-ClassImp(AliAnaExample)
-
-//____________________________________________________________________________
- AliAnaExample::AliAnaExample() :
- AliAnaPartCorrBaseClass(),fPdg(0), fDetector(""), fhPt(0),fhPhi(0),fhEta(0), fh2Pt(0),fh2Phi(0),fh2Eta(0),
- fhNCells(0), fhAmplitude(0)
-{
- //Default Ctor
-
- //Initialize parameters
- InitParameters();
-}
-
-//____________________________________________________________________________
-AliAnaExample::AliAnaExample(const AliAnaExample & ex) :
- AliAnaPartCorrBaseClass(ex), fPdg(ex.fPdg), fDetector(ex.fDetector), fhPt(ex.fhPt), fhPhi(ex.fhPhi),fhEta(ex.fhEta),
- fh2Pt(ex.fh2Pt), fh2Phi(ex.fh2Phi),fh2Eta(ex.fh2Eta), fhNCells(ex.fhNCells), fhAmplitude(ex.fhAmplitude)
-{
- // cpy ctor
-
-}
-
-//_________________________________________________________________________
-AliAnaExample & AliAnaExample::operator = (const AliAnaExample & ex)
-{
- // assignment operator
-
- if(this == &ex)return *this;
- ((AliAnaPartCorrBaseClass *)this)->operator=(ex);
-
- fPdg = ex.fPdg;
- fDetector = ex.fDetector;
- fhPt = ex.fhPt;
- fhPhi = ex.fhPhi;
- fhEta = ex.fhEta;
- fh2Pt = ex.fh2Pt;
- fh2Phi = ex.fh2Phi;
- fh2Eta = ex.fh2Eta;
- fhNCells = ex.fhNCells;
- fhAmplitude = ex.fhAmplitude;
-
- return *this;
-
-}
-
-// //____________________________________________________________________________
-// AliAnaExample::~AliAnaExample()
-// {
-// // Remove all pointers except analysis output pointers.
-
-// ;
-// }
-
-
-//________________________________________________________________________
-TList * AliAnaExample::GetCreateOutputObjects()
-{
- // Create histograms to be saved in output file and
- // store them in fOutputContainer
-
- AliDebug(1,"Init parton histograms");
-
- TList * outputContainer = new TList() ;
- outputContainer->SetName("ExampleHistos") ;
-
- fhPt = new TH1F ("hPt","p_T distribution", 100,0,100);
- fhPt->SetXTitle("p_{T} (GeV/c)");
- outputContainer->Add(fhPt);
-
- fhPhi = new TH1F ("hPhi","#phi distribution", 100,0,TMath::TwoPi());
- fhPhi->SetXTitle("#phi (rad)");
- outputContainer->Add(fhPhi);
-
- fhEta = new TH1F ("hEta","#eta distribution", 100,-2,2);
- fhEta->SetXTitle("#eta ");
- outputContainer->Add(fhEta);
-
- if(GetReader()->GetDataType()!= AliCaloTrackReader::kMC) {
- //Calo cells
- fhNCells = new TH1F ("hNCells","# cells per event", 100,0,1000);
- fhNCells->SetXTitle("n cells");
- outputContainer->Add(fhNCells);
-
- fhAmplitude = new TH1F ("hAmplitude","#eta distribution", 100,0,1000);
- fhAmplitude->SetXTitle("Amplitude ");
- outputContainer->Add(fhAmplitude);
- }
-
- if(IsDataMC()){
- fh2Pt = new TH2F ("h2Pt","p_T distribution, reconstructed vs generated", 100,0,100,100,0,100);
- fh2Pt->SetXTitle("p_{T,rec} (GeV/c)");
- fh2Pt->SetYTitle("p_{T,gen} (GeV/c)");
- outputContainer->Add(fh2Pt);
-
- fh2Phi = new TH2F ("h2Phi","#phi distribution, reconstructed vs generated", 100,0,TMath::TwoPi(), 100,0,TMath::TwoPi());
- fh2Phi->SetXTitle("#phi_{rec} (rad)");
- fh2Phi->SetYTitle("#phi_{gen} (rad)");
- outputContainer->Add(fh2Phi);
-
- fh2Eta = new TH2F ("h2Eta","#eta distribution, reconstructed vs generated", 100,-1,1,100,-1,1);
- fh2Eta->SetXTitle("#eta_{rec} ");
- fh2Eta->SetYTitle("#eta_{gen} ");
- outputContainer->Add(fh2Eta);
-
- }
- return outputContainer;
-}
-
- //__________________________________________________
-void AliAnaExample::InitParameters()
-{
- //Initialize the parameters of the analysis.
-
- fPdg = 22; //Keep photons
- fDetector = "PHOS";
-
-}
-
-//__________________________________________________________________
-void AliAnaExample::Print(const Option_t * opt) const
-{
- //Print some relevant parameters set for the analysis
- if(! opt)
- return;
-
- printf("Min Pt = %3.2f\n", GetMinPt());
- printf("Max Pt = %3.2f\n", GetMaxPt());
- printf("Select clusters with pdg %d \n",fPdg);
- printf("Select detector %s \n",fDetector.Data());
-
-}
-
-//__________________________________________________________________
-void AliAnaExample::MakeAnalysisFillAOD()
-{
- //Do analysis and fill aods
-
- //Some prints
- if(GetDebug() > 0){
- if(fDetector == "EMCAL" && GetAODEMCAL())printf("Example : in emcal aod entries %d\n", GetAODEMCAL()->GetEntriesFast());
- if(fDetector == "CTS" && GetAODCTS())printf("Example : in CTS aod entries %d\n", GetAODCTS()->GetEntriesFast());
- if(fDetector == "PHOS" && GetAODPHOS())printf("Example : in PHOS aod entries %d\n", GetAODPHOS()->GetEntriesFast());
- }
-
- //Get List with tracks or clusters
- TClonesArray * partList = new TClonesArray;
- if(fDetector == "CTS") partList = GetAODCTS();
- else if(fDetector == "EMCAL") partList = GetAODEMCAL();
- else if(fDetector == "PHOS") partList = GetAODPHOS();
-
- if(!partList || partList->GetEntriesFast() == 0) return ;
-
- //Fill AODCaloClusters and AODParticleCorrelation with PHOS/EMCAL aods
- if(fDetector == "EMCAL" || fDetector == "PHOS"){
-
- //WORK WITH CALOCLUSTERS
- if(GetReader()->GetDataType()!= AliCaloTrackReader::kMC)
- ConnectAODCaloClusters(); //Do Only when filling AODCaloClusters
- if(GetDebug() > 0) printf("Example: in calo clusters aod entries %d\n", GetAODCaloClusters()->GetEntriesFast());
-
- //Get vertex for photon momentum calculation
- Double_t v[3] ; //vertex ;
- GetReader()->GetVertex(v);
-
- TLorentzVector mom ;
- for(Int_t i = 0; i < partList->GetEntriesFast(); i++){
-
- AliAODCaloCluster * calo = dynamic_cast<AliAODCaloCluster*> (partList->At(i));
-
- //Fill AODCaloClusters
- if(GetReader()->GetDataType()!= AliCaloTrackReader::kMC)
- AddAODCaloCluster(AliAODCaloCluster(*(calo)));
-
- //Fill AODParticleCorrelation after some selection
- calo->GetMomentum(mom,v);
- Int_t pdg = fPdg;
-
- if(IsCaloPIDOn()){
- Double_t pid[13];
- calo->GetPID(pid);
- pdg = GetCaloPID()->GetPdg(fDetector,pid,mom.E());
- cout<<"PDG "<<pdg<<endl;
- //pdg = GetCaloPID()->GetPdg(fDetector,mom,
- // calo->GetM02(), calo->GetM02(),
- // calo->GetDispersion(), 0, 0);
- }
-
- //Acceptance selection
- Bool_t in = kTRUE;
- if(IsFidutialCutOn())
- in = GetFidutialCut()->IsInFidutialCut(mom,fDetector) ;
-
- if(GetDebug() > 1) printf("cluster pt %2.2f, phi %2.2f, pdg %d, in fidutial cut %d \n",mom.Pt(), mom.Phi(), pdg, in);
-
- //Select cluster if momentum, pdg and acceptance are good
- if(mom.Pt() > GetMinPt() && pdg ==fPdg && in) {
- AliAODParticleCorrelation ph = AliAODParticleCorrelation(mom);
- //AddAODParticleCorrelation(AliAODParticleCorrelation(mom));
- ph.SetLabel(calo->GetLabel(0));
- ph.SetPdg(pdg);
- ph.SetDetector(fDetector);
- AddAODParticleCorrelation(ph);
- }//selection
- }//loop
-
- if(GetReader()->GetDataType()!= AliCaloTrackReader::kMC) {
- //WORK WITH ESDCALOCELLS
- //Don't connect in the same analysis PHOS and EMCAL cells.
-
- AliESDCaloCells * esdCell = new AliESDCaloCells ;
- if(fDetector == "PHOS") {
- ConnectAODPHOSCells(); //Do Only when filling AODCaloCells
- esdCell = (AliESDCaloCells *) GetPHOSCells();
- }
- else {
- ConnectAODEMCALCells(); //Do Only when filling AODCaloCells
- esdCell = (AliESDCaloCells *) GetEMCALCells();
- }
- //Some prints
- if(GetDebug() > 0 && esdCell )
- printf("Example : in ESD %s cell entries %d\n", fDetector.Data(), esdCell->GetNumberOfCells());
-
- //Fill AODCells in file
- Int_t ncells = esdCell->GetNumberOfCells() ;
- GetAODCaloCells()->CreateContainer(ncells);
-
- GetAODCaloCells()->SetType((AliAODCaloCells::AODCells_t) esdCell->GetType());
-
- for (Int_t iCell = 0; iCell < ncells; iCell++) {
- if(GetDebug() > 2) printf("cell : amp %f, absId %d, time %f\n", esdCell->GetAmplitude(iCell), esdCell->GetCellNumber(iCell), esdCell->GetTime(iCell));
-
- GetAODCaloCells()->SetCell(iCell,esdCell->GetCellNumber(iCell),esdCell->GetAmplitude(iCell));
- }
- GetAODCaloCells()->Sort();
- }
- }//cluster-cell analysis
- else if(fDetector == "CTS"){ //Track analysis
- //Fill AODParticleCorrelation with CTS aods
- TVector3 p3;
- for(Int_t i = 0; i < GetAODCTS()->GetEntriesFast(); i++){
-
- AliAODTrack * track = dynamic_cast<AliAODTrack*> (GetAODCTS()->At(i));
-
- //Fill AODParticleCorrelation after some selection
- Double_t mom[3] = {track->Px(),track->Py(),track->Pz()};
- p3.SetXYZ(mom[0],mom[1],mom[2]);
-
- //Acceptance selection
- Bool_t in = GetFidutialCut()->IsInFidutialCut(mom,"CTS") ;
- if(GetDebug() > 1) printf("track pt %2.2f, phi %2.2f, in fidutial cut %d\n",p3.Pt(), p3.Phi(), in);
- if(p3.Pt() > GetMinPt() && in) {
- AliAODParticleCorrelation tr = AliAODParticleCorrelation(mom[0],mom[1],mom[2],0);
- //AddAODParticleCorrelation(AliAODParticleCorrelation(mom));
- tr.SetDetector("CTS");
- AddAODParticleCorrelation(tr);
-
- }//selection
- }//loop
- }//CTS analysis
-
- if(GetDebug() > 0) {
- printf("Example: final aod calocluster entries %d\n", GetAODCaloClusters()->GetEntriesFast());
- printf("Example: final aod branch entries %d\n", GetAODBranch()->GetEntriesFast());
- printf("Example: final aod cell entries %d\n", GetAODCaloCells()->GetNumberOfCells());
- }
-}
-
-//__________________________________________________________________
-void AliAnaExample::MakeAnalysisFillHistograms()
-{
- //Do analysis and fill histograms
-
- //Loop on stored AODParticles
- Int_t naod = GetAODBranch()->GetEntriesFast();
- if(GetDebug() > 0) printf("histo aod branch entries %d\n", naod);
- for(Int_t iaod = 0; iaod < naod ; iaod++){
- AliAODParticleCorrelation* ph = dynamic_cast<AliAODParticleCorrelation*> (GetAODBranch()->At(iaod));
-
- fhPt->Fill(ph->Pt());
- fhPhi->Fill(ph->Phi());
- fhEta->Fill(ph->Eta());
-
- if(IsDataMC()){
- //Play with the MC stack if available
- AliStack * stack = GetMCStack() ;
-
- if(ph->GetLabel() < 0 || !stack) {
- printf("*** bad label or no stack ***: label %d \n", ph->GetLabel());
- continue;
- }
-
- if(ph->GetLabel() >= stack->GetNtrack()) {
- printf("*** large label ***: label %d, n tracks %d \n", ph->GetLabel(), stack->GetNtrack());
- continue ;
- }
-
- TParticle * mom = GetMCStack()->Particle(ph->GetLabel());
-
- fh2Pt->Fill(ph->Pt(), mom->Pt());
- fh2Phi->Fill(ph->Phi(), mom->Phi());
- fh2Eta->Fill(ph->Eta(), mom->Eta());
- }//Work with stack also
- }// aod branch loop
-
- // CaloCells histograms
- if(GetReader()->GetDataType()!= AliCaloTrackReader::kMC) {
- if(GetAODCaloCells()){
-
- Int_t ncells = GetAODCaloCells()->GetNumberOfCells();
- fhNCells->Fill(ncells) ;
-
- for (Int_t iCell = 0; iCell < ncells; iCell++) {
- if(GetDebug() > 2) printf("cell : amp %f, absId %d \n", GetAODCaloCells()->GetAmplitude(iCell), GetAODCaloCells()->GetCellNumber(iCell));
- fhAmplitude->Fill(GetAODCaloCells()->GetAmplitude(iCell));
- }
- }//calo cells container exist
- }
-}
+++ /dev/null
-#ifndef ALIANAEXAMPLE_H
-#define ALIANAEXAMPLE_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-/* $Id: $ */
-
-//_________________________________________________________________________
-// Example class on how to read AODCaloClusters, ESDCaloCells and AODTracks and how
-// fill AODs with PWG4PartCorr analysis frame
-// Select the type of detector information that you want to analyze, CTS (tracking), PHOS or EMCAL
-// Select the PID custer type of the calorimeters
-// Set min momentum of the cluster/tracks
-// Fill few histograms
-//
-//-- Author: Gustavo Conesa (INFN-LNF)
-
-class TH1F ;
-
-#include "AliAnaPartCorrBaseClass.h"
-
-class AliAnaExample : public AliAnaPartCorrBaseClass {
-
- public:
-
- AliAnaExample() ; // default ctor
- AliAnaExample(const AliAnaExample & g) ; // cpy ctor
- AliAnaExample & operator = (const AliAnaExample & g) ;//cpy assignment
- virtual ~AliAnaExample() {;} //virtual dtor
-
- TList * GetCreateOutputObjects();
-
- void InitParameters();
-
- void Print(const Option_t * opt) const;
-
- void MakeAnalysisFillAOD() ;
-
- void MakeAnalysisFillHistograms() ;
-
- Int_t GetPdg() const {return fPdg ;}
- void SetPdg( Int_t pdg ) {fPdg = pdg; }
-
- TString GetDetector() const {return fDetector ;}
- void SetDetector( TString calo ) {fDetector = calo; }
-
- private:
-
- Int_t fPdg ; //identified particle id
- TString fDetector ; //detector selection
- //Histograms
- //CaloClusters
- TH1F * fhPt; //! pT distribution
- TH1F * fhPhi; //! phi distribution
- TH1F * fhEta; //! eta distribution
- TH2F * fh2Pt; //!pT distribution, reconstructed vs generated
- TH2F * fh2Phi; //! phi distribution, reconstructed vs generated
- TH2F * fh2Eta; //! eta distribution, reconstructed vs generated
- //Calo Cells
- TH1F * fhNCells; //! Number of towers/crystals with signal
- TH1F * fhAmplitude; //! Amplitude measured in towers/crystals
- ClassDef(AliAnaExample,1)
- } ;
-
-
-#endif //ALIANAEXAMPLE_H
-
-
-
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes iGetEntriesFast(s hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-/* $Id: AliAnaGammaDirect.cxx 28688 2008-09-11 15:04:07Z gconesab $ */
-
-//_________________________________________________________________________
-// Class for the prompt gamma analysis, isolation cut
-//
-// Class created from old AliPHOSGammaJet
-// (see AliRoot versions previous Release 4-09)
-//
-// -- Author: Gustavo Conesa (LNF-INFN)
-//////////////////////////////////////////////////////////////////////////////
-
-
-// --- ROOT system ---
-#include <TParticle.h>
-#include <TH2.h>
-#include <TList.h>
-#include "Riostream.h"
-
-// --- Analysis system ---
-#include "AliAnaGammaDirect.h"
-#include "AliLog.h"
-#include "AliCaloTrackReader.h"
-#include "AliIsolationCut.h"
-#include "AliNeutralMesonSelection.h"
-
-ClassImp(AliAnaGammaDirect)
-
-//____________________________________________________________________________
- AliAnaGammaDirect::AliAnaGammaDirect() :
- AliAnaPartCorrBaseClass(), fDetector(""), fMakeIC(0), fReMakeIC(0),
- fMakeSeveralIC(0), fMakeInvMass(0),
- fhPtGamma(0),fhPhiGamma(0),fhEtaGamma(0), fhConeSumPt(0),
- //Several IC
- fNCones(0),fNPtThresFrac(0), fConeSizes(), fPtThresholds(), fPtFractions(),
- fhPtThresIsolated(), fhPtFracIsolated(), fhPtSumIsolated(),
- //MC
- fhPtPrompt(0),fhPhiPrompt(0),fhEtaPrompt(0),
- fhPtThresIsolatedPrompt(), fhPtFracIsolatedPrompt(), fhPtSumIsolatedPrompt(),
- fhPtFragmentation(0),fhPhiFragmentation(0),fhEtaFragmentation(0),
- fhPtThresIsolatedFragmentation(), fhPtFracIsolatedFragmentation(), fhPtSumIsolatedFragmentation(),
- fhPtPi0Decay(0),fhPhiPi0Decay(0),fhEtaPi0Decay(0),
- fhPtThresIsolatedPi0Decay(), fhPtFracIsolatedPi0Decay(), fhPtSumIsolatedPi0Decay(),
- fhPtOtherDecay(0),fhPhiOtherDecay(0),fhEtaOtherDecay(0),
- fhPtThresIsolatedOtherDecay(), fhPtFracIsolatedOtherDecay(), fhPtSumIsolatedOtherDecay(),
- fhPtConversion(0),fhPhiConversion(0),fhEtaConversion(0),
- fhPtThresIsolatedConversion(), fhPtFracIsolatedConversion(), fhPtSumIsolatedConversion(),
- fhPtUnknown(0),fhPhiUnknown(0),fhEtaUnknown(0),
- fhPtThresIsolatedUnknown(), fhPtFracIsolatedUnknown(), fhPtSumIsolatedUnknown()
-{
- //default ctor
-
- //Initialize parameters
- InitParameters();
-
- for(Int_t i = 0; i < 5 ; i++){
- fConeSizes[i] = 0 ;
- fhPtSumIsolated[i] = 0 ;
-
- fhPtSumIsolatedPrompt[i] = 0 ;
- fhPtSumIsolatedFragmentation[i] = 0 ;
- fhPtSumIsolatedPi0Decay[i] = 0 ;
- fhPtSumIsolatedOtherDecay[i] = 0 ;
- fhPtSumIsolatedConversion[i] = 0 ;
- fhPtSumIsolatedUnknown[i] = 0 ;
-
- for(Int_t j = 0; j < 5 ; j++){
- fhPtThresIsolated[i][j] = 0 ;
- fhPtFracIsolated[i][j] = 0 ;
-
- fhPtThresIsolatedPrompt[i][j] = 0 ;
- fhPtThresIsolatedFragmentation[i][j] = 0 ;
- fhPtThresIsolatedPi0Decay[i][j] = 0 ;
- fhPtThresIsolatedOtherDecay[i][j] = 0 ;
- fhPtThresIsolatedConversion[i][j] = 0 ;
- fhPtThresIsolatedUnknown[i][j] = 0 ;
-
- fhPtFracIsolatedPrompt[i][j] = 0 ;
- fhPtFracIsolatedFragmentation[i][j] = 0 ;
- fhPtFracIsolatedPi0Decay[i][j] = 0 ;
- fhPtFracIsolatedOtherDecay[i][j] = 0 ;
- fhPtFracIsolatedConversion[i][j] = 0 ;
- fhPtFracIsolatedUnknown[i][j] = 0 ;
-
- }
- }
-
- for(Int_t i = 0; i < 5 ; i++){
- fPtFractions[i]= 0 ;
- fPtThresholds[i]= 0 ;
- }
-
-
-}
-
-//____________________________________________________________________________
-AliAnaGammaDirect::AliAnaGammaDirect(const AliAnaGammaDirect & g) :
- AliAnaPartCorrBaseClass(g), fDetector(g.fDetector),
- fMakeIC(g.fMakeIC), fReMakeIC(g.fReMakeIC),
- fMakeSeveralIC(g.fMakeSeveralIC), fMakeInvMass(g.fMakeInvMass),
- fhPtGamma(g.fhPtGamma),fhPhiGamma(g.fhPhiGamma),
- fhEtaGamma(g.fhEtaGamma), fhConeSumPt(g.fhConeSumPt),
- //Several IC
- fNCones(g.fNCones),fNPtThresFrac(g.fNPtThresFrac), fConeSizes(), fPtThresholds(), fPtFractions(),
- fhPtThresIsolated(), fhPtFracIsolated(), fhPtSumIsolated(),
- //MC
- fhPtPrompt(g.fhPtPrompt),fhPhiPrompt(g.fhPhiPrompt),fhEtaPrompt(g.fhEtaPrompt),
- fhPtThresIsolatedPrompt(), fhPtFracIsolatedPrompt(), fhPtSumIsolatedPrompt(),
- fhPtFragmentation(g.fhPtFragmentation),fhPhiFragmentation(g.fhPhiFragmentation),fhEtaFragmentation(g.fhEtaFragmentation),
- fhPtThresIsolatedFragmentation(), fhPtFracIsolatedFragmentation(), fhPtSumIsolatedFragmentation(),
- fhPtPi0Decay(g.fhPtPi0Decay),fhPhiPi0Decay(g.fhPhiPi0Decay),fhEtaPi0Decay(g.fhEtaPi0Decay),
- fhPtThresIsolatedPi0Decay(), fhPtFracIsolatedPi0Decay(), fhPtSumIsolatedPi0Decay(),
- fhPtOtherDecay(g.fhPtOtherDecay),fhPhiOtherDecay(g.fhPhiOtherDecay),fhEtaOtherDecay(g.fhEtaOtherDecay),
- fhPtThresIsolatedOtherDecay(), fhPtFracIsolatedOtherDecay(), fhPtSumIsolatedOtherDecay(),
- fhPtConversion(g. fhPtConversion),fhPhiConversion(g.fhPhiConversion),fhEtaConversion(g.fhEtaConversion),
- fhPtThresIsolatedConversion(), fhPtFracIsolatedConversion(), fhPtSumIsolatedConversion(),
- fhPtUnknown(g.fhPtUnknown),fhPhiUnknown(g.fhPhiUnknown),fhEtaUnknown(g.fhEtaUnknown),
- fhPtThresIsolatedUnknown(), fhPtFracIsolatedUnknown(), fhPtSumIsolatedUnknown()
-{
- // cpy ctor
-
- //Several IC
- for(Int_t i = 0; i < fNCones ; i++){
- fConeSizes[i] = g.fConeSizes[i];
- fhPtSumIsolated[i] = g.fhPtSumIsolated[i];
-
- fhPtSumIsolatedPrompt[i] = g.fhPtSumIsolatedPrompt[i];
- fhPtSumIsolatedFragmentation[i] = g.fhPtSumIsolatedFragmentation[i];
- fhPtSumIsolatedPi0Decay[i] = g.fhPtSumIsolatedPi0Decay[i];
- fhPtSumIsolatedOtherDecay[i] = g.fhPtSumIsolatedOtherDecay[i];
- fhPtSumIsolatedConversion[i] = g.fhPtSumIsolatedConversion[i];
- fhPtSumIsolatedUnknown[i] = g.fhPtSumIsolatedUnknown[i];
-
- for(Int_t j = 0; j < fNPtThresFrac ; j++){
- fhPtThresIsolated[i][j] = g.fhPtThresIsolated[i][j];
- fhPtFracIsolated[i][j] = g.fhPtFracIsolated[i][j];
-
- fhPtThresIsolatedPrompt[i][j] = g.fhPtThresIsolatedPrompt[i][j];
- fhPtThresIsolatedFragmentation[i][j] = g.fhPtThresIsolatedFragmentation[i][j];
- fhPtThresIsolatedPi0Decay[i][j] = g.fhPtThresIsolatedPi0Decay[i][j];
- fhPtThresIsolatedOtherDecay[i][j] = g.fhPtThresIsolatedOtherDecay[i][j];
- fhPtThresIsolatedConversion[i][j] = g.fhPtThresIsolatedConversion[i][j];
- fhPtThresIsolatedUnknown[i][j] = g.fhPtThresIsolatedUnknown[i][j];
-
- fhPtFracIsolatedPrompt[i][j] = g.fhPtFracIsolatedPrompt[i][j];
- fhPtFracIsolatedFragmentation[i][j] = g.fhPtFracIsolatedFragmentation[i][j];
- fhPtFracIsolatedPi0Decay[i][j] = g.fhPtFracIsolatedPi0Decay[i][j];
- fhPtFracIsolatedOtherDecay[i][j] = g.fhPtFracIsolatedOtherDecay[i][j];
- fhPtFracIsolatedConversion[i][j] = g.fhPtFracIsolatedConversion[i][j];
- fhPtFracIsolatedUnknown[i][j] = g.fhPtFracIsolatedUnknown[i][j];
-
- }
- }
-
- for(Int_t i = 0; i < fNPtThresFrac ; i++){
- fPtFractions[i]= g.fPtFractions[i];
- fPtThresholds[i]= g.fPtThresholds[i];
- }
-
-}
-
-//_________________________________________________________________________
-AliAnaGammaDirect & AliAnaGammaDirect::operator = (const AliAnaGammaDirect & g)
-{
- // assignment operator
-
- if(&g == this) return *this;
-
- fMakeIC = g.fMakeIC ;
- fReMakeIC = g.fReMakeIC ;
- fMakeSeveralIC = g.fMakeSeveralIC ;
- fMakeInvMass = g.fMakeInvMass ;
- fDetector = g.fDetector ;
-
- fhPtGamma = g.fhPtGamma ;
- fhPhiGamma = g.fhPhiGamma ;
- fhEtaGamma = g.fhEtaGamma ;
- fhConeSumPt = g.fhConeSumPt ;
-
- fhPtPrompt = g.fhPtPrompt;
- fhPhiPrompt = g.fhPhiPrompt;
- fhEtaPrompt = g.fhEtaPrompt;
- fhPtFragmentation = g.fhPtFragmentation;
- fhPhiFragmentation = g.fhPhiFragmentation;
- fhEtaFragmentation = g.fhEtaFragmentation;
- fhPtPi0Decay = g.fhPtPi0Decay;
- fhPhiPi0Decay = g.fhPhiPi0Decay;
- fhEtaPi0Decay = g.fhEtaPi0Decay;
- fhPtOtherDecay = g.fhPtOtherDecay;
- fhPhiOtherDecay = g.fhPhiOtherDecay;
- fhEtaOtherDecay = g.fhEtaOtherDecay;
- fhPtConversion = g. fhPtConversion;
- fhPhiConversion = g.fhPhiConversion;
- fhEtaConversion = g.fhEtaConversion;
- fhPtUnknown = g.fhPtUnknown;
- fhPhiUnknown = g.fhPhiUnknown;
- fhEtaUnknown = g.fhEtaUnknown;
-
- //Several IC
- fNCones = g.fNCones ;
- fNPtThresFrac = g.fNPtThresFrac ;
-
- for(Int_t i = 0; i < fNCones ; i++){
- fConeSizes[i] = g.fConeSizes[i];
- fhPtSumIsolated[i] = g.fhPtSumIsolated[i] ;
-
- fhPtSumIsolatedPrompt[i] = g.fhPtSumIsolatedPrompt[i];
- fhPtSumIsolatedFragmentation[i] = g.fhPtSumIsolatedFragmentation[i];
- fhPtSumIsolatedPi0Decay[i] = g.fhPtSumIsolatedPi0Decay[i];
- fhPtSumIsolatedOtherDecay[i] = g.fhPtSumIsolatedOtherDecay[i];
- fhPtSumIsolatedConversion[i] = g.fhPtSumIsolatedConversion[i];
- fhPtSumIsolatedUnknown[i] = g.fhPtSumIsolatedUnknown[i];
-
- for(Int_t j = 0; j < fNPtThresFrac ; j++){
- fhPtThresIsolated[i][j] = g.fhPtThresIsolated[i][j] ;
- fhPtFracIsolated[i][j] = g.fhPtFracIsolated[i][j] ;
-
- fhPtThresIsolatedPrompt[i][j] = g.fhPtThresIsolatedPrompt[i][j];
- fhPtThresIsolatedFragmentation[i][j] = g.fhPtThresIsolatedFragmentation[i][j];
- fhPtThresIsolatedPi0Decay[i][j] = g.fhPtThresIsolatedPi0Decay[i][j];
- fhPtThresIsolatedOtherDecay[i][j] = g.fhPtThresIsolatedOtherDecay[i][j];
- fhPtThresIsolatedConversion[i][j] = g.fhPtThresIsolatedConversion[i][j];
- fhPtThresIsolatedUnknown[i][j] = g.fhPtThresIsolatedUnknown[i][j];
-
- fhPtFracIsolatedPrompt[i][j] = g.fhPtFracIsolatedPrompt[i][j];
- fhPtFracIsolatedFragmentation[i][j] = g.fhPtFracIsolatedFragmentation[i][j];
- fhPtFracIsolatedPi0Decay[i][j] = g.fhPtFracIsolatedPi0Decay[i][j];
- fhPtFracIsolatedOtherDecay[i][j] = g.fhPtFracIsolatedOtherDecay[i][j];
- fhPtFracIsolatedConversion[i][j] = g.fhPtFracIsolatedConversion[i][j];
- fhPtFracIsolatedUnknown[i][j] = g.fhPtFracIsolatedUnknown[i][j];
-
- }
- }
-
- for(Int_t i = 0; i < fNPtThresFrac ; i++){
- fPtThresholds[i]= g.fPtThresholds[i];
- fPtFractions[i]= g.fPtFractions[i];
- }
-
- return *this;
-
-}
-
-//____________________________________________________________________________
-AliAnaGammaDirect::~AliAnaGammaDirect()
-{
- //dtor
- //do not delete histograms
-
- delete [] fConeSizes ;
- delete [] fPtThresholds ;
- delete [] fPtFractions ;
-
-}
-//_________________________________________________________________________
-Bool_t AliAnaGammaDirect::CheckInvMass(const Int_t icalo,const TLorentzVector mom, Double_t *vertex, TClonesArray * pl){
- //Search if there is a companion decay photon to the candidate
- // and discard it in such case
- TLorentzVector mom2 ;
- for(Int_t jcalo = 0; jcalo < pl->GetEntriesFast(); jcalo++){
- if(icalo==jcalo) continue ;
- AliAODCaloCluster * calo = dynamic_cast<AliAODCaloCluster*> (pl->At(jcalo));
-
- //Cluster selection, not charged, with photon id and in fidutial cut, fill TLorentz
- if(!SelectCluster(calo, vertex, mom2)) continue ;
-
- //Select good pair (good phit, pt cuts, aperture and invariant mass)
- if(GetNeutralMesonSelection()->SelectPair(mom, mom2)){
- if(GetDebug()>1)printf("Selected gamma pair: pt %f, phi %f, eta%f",(mom+mom2).Pt(), (mom+mom2).Phi(), (mom+mom2).Eta());
- return kTRUE ;
- }
- }//loop
-
- return kFALSE;
-
-}
-//_________________________________________________________________________
-Int_t AliAnaGammaDirect::CheckOrigin(const Int_t label){
- //Play with the MC stack if available
- //Check origin of the candidates, good for PYTHIA
-
- AliStack * stack = GetMCStack() ;
- if(!stack) AliFatal("Stack is not available, check analysis settings in configuration file, STOP!!");
-
- if(label >= 0 && label < stack->GetNtrack()){
- //Mother
- TParticle * mom = stack->Particle(label);
- Int_t mPdg = TMath::Abs(mom->GetPdgCode());
- Int_t mStatus = mom->GetStatusCode() ;
- Int_t iParent = mom->GetFirstMother() ;
- if(label < 8 ) printf("Mother is parton %d\n",iParent);
-
- //GrandParent
- TParticle * parent = new TParticle ;
- Int_t pPdg = -1;
- Int_t pStatus =-1;
- if(iParent > 0){
- parent = stack->Particle(iParent);
- pPdg = TMath::Abs(parent->GetPdgCode());
- pStatus = parent->GetStatusCode();
- }
- else
- printf("Parent with label %d\n",iParent);
-
- //return tag
- if(mPdg == 22){
- if(mStatus == 1){
- if(iParent < 8) {
- if(pPdg == 22) return kPrompt;
- else return kFragmentation;
- }
- else if(pStatus == 11){
- if(pPdg == 111) return kPi0Decay ;
- else if (pPdg == 321) return kEtaDecay ;
- else return kOtherDecay ;
- }
- }//Status 1 : Pythia generated
- else if(mStatus == 0){
- if(pPdg ==22 || pPdg ==11) return kConversion ;
- if(pPdg == 111) return kPi0Decay ;
- else if (pPdg == 221) return kEtaDecay ;
- else return kOtherDecay ;
- }//status 0 : geant generated
- }//Mother gamma
- else if(mPdg == 111) return kPi0 ;
- else if(mPdg == 221) return kEta ;
- else if(mPdg ==11){
- if(mStatus == 0) return kConversion ;
- else return kElectron ;
- }
- else return kUnknown;
- }//Good label value
- else{
- if(label < 0 ) printf("*** bad label or no stack ***: label %d \n", label);
- if(label >= stack->GetNtrack()) printf("*** large label ***: label %d, n tracks %d \n", label, stack->GetNtrack());
- return kUnknown;
- }//Bad label
-
- return kUnknown;
-
-}
-
-//________________________________________________________________________
-TList * AliAnaGammaDirect::GetCreateOutputObjects()
-{
- // Create histograms to be saved in output file and
- // store them in outputContainer
- TList * outputContainer = new TList() ;
- outputContainer->SetName("DirectGammaHistos") ;
-
- //Histograms of highest gamma identified in Event
- fhPtGamma = new TH1F("hPtGamma","Number of #gamma over calorimeter",240,0,120);
- fhPtGamma->SetYTitle("N");
- fhPtGamma->SetXTitle("p_{T #gamma}(GeV/c)");
- outputContainer->Add(fhPtGamma) ;
-
- fhPhiGamma = new TH2F
- ("hPhiGamma","#phi_{#gamma}",200,0,120,200,0,7);
- fhPhiGamma->SetYTitle("#phi");
- fhPhiGamma->SetXTitle("p_{T #gamma} (GeV/c)");
- outputContainer->Add(fhPhiGamma) ;
-
- fhEtaGamma = new TH2F
- ("hEtaGamma","#phi_{#gamma}",200,0,120,200,-0.8,0.8);
- fhEtaGamma->SetYTitle("#eta");
- fhEtaGamma->SetXTitle("p_{T #gamma} (GeV/c)");
- outputContainer->Add(fhEtaGamma) ;
-
- if(!fMakeSeveralIC){
- fhConeSumPt = new TH2F
- ("hConePtSum","#Sigma p_{T} in cone ",200,0,120,100,0,100);
- fhConeSumPt->SetYTitle("#Sigma p_{T}");
- fhConeSumPt->SetXTitle("p_{T #gamma} (GeV/c)");
- outputContainer->Add(fhConeSumPt) ;
- }
-
- if(IsDataMC()){
-
- fhPtPrompt = new TH1F("hPtPrompt","Number of #gamma over calorimeter",240,0,120);
- fhPtPrompt->SetYTitle("N");
- fhPtPrompt->SetXTitle("p_{T #gamma}(GeV/c)");
- outputContainer->Add(fhPtPrompt) ;
-
- fhPhiPrompt = new TH2F
- ("hPhiPrompt","#phi_{#gamma}",200,0,120,200,0,7);
- fhPhiPrompt->SetYTitle("#phi");
- fhPhiPrompt->SetXTitle("p_{T #gamma} (GeV/c)");
- outputContainer->Add(fhPhiPrompt) ;
-
- fhEtaPrompt = new TH2F
- ("hEtaPrompt","#phi_{#gamma}",200,0,120,200,-0.8,0.8);
- fhEtaPrompt->SetYTitle("#eta");
- fhEtaPrompt->SetXTitle("p_{T #gamma} (GeV/c)");
- outputContainer->Add(fhEtaPrompt) ;
-
- fhPtFragmentation = new TH1F("hPtFragmentation","Number of #gamma over calorimeter",240,0,120);
- fhPtFragmentation->SetYTitle("N");
- fhPtFragmentation->SetXTitle("p_{T #gamma}(GeV/c)");
- outputContainer->Add(fhPtFragmentation) ;
-
- fhPhiFragmentation = new TH2F
- ("hPhiFragmentation","#phi_{#gamma}",200,0,120,200,0,7);
- fhPhiFragmentation->SetYTitle("#phi");
- fhPhiFragmentation->SetXTitle("p_{T #gamma} (GeV/c)");
- outputContainer->Add(fhPhiFragmentation) ;
-
- fhEtaFragmentation = new TH2F
- ("hEtaFragmentation","#phi_{#gamma}",200,0,120,200,-0.8,0.8);
- fhEtaFragmentation->SetYTitle("#eta");
- fhEtaFragmentation->SetXTitle("p_{T #gamma} (GeV/c)");
- outputContainer->Add(fhEtaFragmentation) ;
-
- fhPtPi0Decay = new TH1F("hPtPi0Decay","Number of #gamma over calorimeter",240,0,120);
- fhPtPi0Decay->SetYTitle("N");
- fhPtPi0Decay->SetXTitle("p_{T #gamma}(GeV/c)");
- outputContainer->Add(fhPtPi0Decay) ;
-
- fhPhiPi0Decay = new TH2F
- ("hPhiPi0Decay","#phi_{#gamma}",200,0,120,200,0,7);
- fhPhiPi0Decay->SetYTitle("#phi");
- fhPhiPi0Decay->SetXTitle("p_{T #gamma} (GeV/c)");
- outputContainer->Add(fhPhiPi0Decay) ;
-
- fhEtaPi0Decay = new TH2F
- ("hEtaPi0Decay","#phi_{#gamma}",200,0,120,200,-0.8,0.8);
- fhEtaPi0Decay->SetYTitle("#eta");
- fhEtaPi0Decay->SetXTitle("p_{T #gamma} (GeV/c)");
- outputContainer->Add(fhEtaPi0Decay) ;
-
- fhPtOtherDecay = new TH1F("hPtOtherDecay","Number of #gamma over calorimeter",240,0,120);
- fhPtOtherDecay->SetYTitle("N");
- fhPtOtherDecay->SetXTitle("p_{T #gamma}(GeV/c)");
- outputContainer->Add(fhPtOtherDecay) ;
-
- fhPhiOtherDecay = new TH2F
- ("hPhiOtherDecay","#phi_{#gamma}",200,0,120,200,0,7);
- fhPhiOtherDecay->SetYTitle("#phi");
- fhPhiOtherDecay->SetXTitle("p_{T #gamma} (GeV/c)");
- outputContainer->Add(fhPhiOtherDecay) ;
-
- fhEtaOtherDecay = new TH2F
- ("hEtaOtherDecay","#phi_{#gamma}",200,0,120,200,-0.8,0.8);
- fhEtaOtherDecay->SetYTitle("#eta");
- fhEtaOtherDecay->SetXTitle("p_{T #gamma} (GeV/c)");
- outputContainer->Add(fhEtaOtherDecay) ;
-
- fhPtConversion = new TH1F("hPtConversion","Number of #gamma over calorimeter",240,0,120);
- fhPtConversion->SetYTitle("N");
- fhPtConversion->SetXTitle("p_{T #gamma}(GeV/c)");
- outputContainer->Add(fhPtConversion) ;
-
- fhPhiConversion = new TH2F
- ("hPhiConversion","#phi_{#gamma}",200,0,120,200,0,7);
- fhPhiConversion->SetYTitle("#phi");
- fhPhiConversion->SetXTitle("p_{T #gamma} (GeV/c)");
- outputContainer->Add(fhPhiConversion) ;
-
- fhEtaConversion = new TH2F
- ("hEtaConversion","#phi_{#gamma}",200,0,120,200,-0.8,0.8);
- fhEtaConversion->SetYTitle("#eta");
- fhEtaConversion->SetXTitle("p_{T #gamma} (GeV/c)");
- outputContainer->Add(fhEtaConversion) ;
-
- fhPtUnknown = new TH1F("hPtUnknown","Number of #gamma over calorimeter",240,0,120);
- fhPtUnknown->SetYTitle("N");
- fhPtUnknown->SetXTitle("p_{T #gamma}(GeV/c)");
- outputContainer->Add(fhPtUnknown) ;
-
- fhPhiUnknown = new TH2F
- ("hPhiUnknown","#phi_{#gamma}",200,0,120,200,0,7);
- fhPhiUnknown->SetYTitle("#phi");
- fhPhiUnknown->SetXTitle("p_{T #gamma} (GeV/c)");
- outputContainer->Add(fhPhiUnknown) ;
-
- fhEtaUnknown = new TH2F
- ("hEtaUnknown","#phi_{#gamma}",200,0,120,200,-0.8,0.8);
- fhEtaUnknown->SetYTitle("#eta");
- fhEtaUnknown->SetXTitle("p_{T #gamma} (GeV/c)");
- outputContainer->Add(fhEtaUnknown) ;
- }//Histos with MC
-
- if(fMakeSeveralIC){
- char name[128];
- char title[128];
- for(Int_t icone = 0; icone<fNCones; icone++){
- sprintf(name,"hPtSumIsolated_Cone_%d",icone);
- sprintf(title,"Candidate cone sum p_{T} for cone size %d vs candidate p_{T}",icone);
- fhPtSumIsolated[icone] = new TH2F(name, title,240,0,120,120,0,10);
- fhPtSumIsolated[icone]->SetYTitle("#Sigma p_{T} (GeV/c)");
- fhPtSumIsolated[icone]->SetXTitle("p_{T} (GeV/c)");
- outputContainer->Add(fhPtSumIsolated[icone]) ;
-
- if(IsDataMC()){
- sprintf(name,"hPtSumIsolatedPrompt_Cone_%d",icone);
- sprintf(title,"Candidate Prompt cone sum p_{T} for cone size %d vs candidate p_{T}",icone);
- fhPtSumIsolatedPrompt[icone] = new TH2F(name, title,240,0,120,120,0,10);
- fhPtSumIsolatedPrompt[icone]->SetYTitle("#Sigma p_{T} (GeV/c)");
- fhPtSumIsolatedPrompt[icone]->SetXTitle("p_{T} (GeV/c)");
- outputContainer->Add(fhPtSumIsolatedPrompt[icone]) ;
-
- sprintf(name,"hPtSumIsolatedFragmentation_Cone_%d",icone);
- sprintf(title,"Candidate Fragmentation cone sum p_{T} for cone size %d vs candidate p_{T}",icone);
- fhPtSumIsolatedFragmentation[icone] = new TH2F(name, title,240,0,120,120,0,10);
- fhPtSumIsolatedFragmentation[icone]->SetYTitle("#Sigma p_{T} (GeV/c)");
- fhPtSumIsolatedFragmentation[icone]->SetXTitle("p_{T} (GeV/c)");
- outputContainer->Add(fhPtSumIsolatedFragmentation[icone]) ;
-
- sprintf(name,"hPtSumIsolatedPi0Decay_Cone_%d",icone);
- sprintf(title,"Candidate Pi0Decay cone sum p_{T} for cone size %d vs candidate p_{T}",icone);
- fhPtSumIsolatedPi0Decay[icone] = new TH2F(name, title,240,0,120,120,0,10);
- fhPtSumIsolatedPi0Decay[icone]->SetYTitle("#Sigma p_{T} (GeV/c)");
- fhPtSumIsolatedPi0Decay[icone]->SetXTitle("p_{T} (GeV/c)");
- outputContainer->Add(fhPtSumIsolatedPi0Decay[icone]) ;
-
- sprintf(name,"hPtSumIsolatedOtherDecay_Cone_%d",icone);
- sprintf(title,"Candidate OtherDecay cone sum p_{T} for cone size %d vs candidate p_{T}",icone);
- fhPtSumIsolatedOtherDecay[icone] = new TH2F(name, title,240,0,120,120,0,10);
- fhPtSumIsolatedOtherDecay[icone]->SetYTitle("#Sigma p_{T} (GeV/c)");
- fhPtSumIsolatedOtherDecay[icone]->SetXTitle("p_{T} (GeV/c)");
- outputContainer->Add(fhPtSumIsolatedOtherDecay[icone]) ;
-
- sprintf(name,"hPtSumIsolatedConversion_Cone_%d",icone);
- sprintf(title,"Candidate Conversion cone sum p_{T} for cone size %d vs candidate p_{T}",icone);
- fhPtSumIsolatedConversion[icone] = new TH2F(name, title,240,0,120,120,0,10);
- fhPtSumIsolatedConversion[icone]->SetYTitle("#Sigma p_{T} (GeV/c)");
- fhPtSumIsolatedConversion[icone]->SetXTitle("p_{T} (GeV/c)");
- outputContainer->Add(fhPtSumIsolatedConversion[icone]) ;
-
- sprintf(name,"hPtSumIsolatedUnknown_Cone_%d",icone);
- sprintf(title,"Candidate Unknown cone sum p_{T} for cone size %d vs candidate p_{T}",icone);
- fhPtSumIsolatedUnknown[icone] = new TH2F(name, title,240,0,120,120,0,10);
- fhPtSumIsolatedUnknown[icone]->SetYTitle("#Sigma p_{T} (GeV/c)");
- fhPtSumIsolatedUnknown[icone]->SetXTitle("p_{T} (GeV/c)");
- outputContainer->Add(fhPtSumIsolatedUnknown[icone]) ;
-
- }//Histos with MC
-
- for(Int_t ipt = 0; ipt<fNPtThresFrac;ipt++){
- sprintf(name,"hPtThresIsol_Cone_%d_Pt%d",icone,ipt);
- sprintf(title,"Isolated candidate p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt);
- fhPtThresIsolated[icone][ipt] = new TH1F(name, title,240,0,120);
- fhPtThresIsolated[icone][ipt]->SetXTitle("p_{T} (GeV/c)");
- outputContainer->Add(fhPtThresIsolated[icone][ipt]) ;
-
- sprintf(name,"hPtFracIsol_Cone_%d_Pt%d",icone,ipt);
- sprintf(title,"Isolated candidate p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt);
- fhPtFracIsolated[icone][ipt] = new TH1F(name, title,240,0,120);
- fhPtFracIsolated[icone][ipt]->SetXTitle("p_{T} (GeV/c)");
- outputContainer->Add(fhPtFracIsolated[icone][ipt]) ;
-
- if(IsDataMC()){
- sprintf(name,"hPtThresIsolPrompt_Cone_%d_Pt%d",icone,ipt);
- sprintf(title,"Isolated candidate Prompt p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt);
- fhPtThresIsolatedPrompt[icone][ipt] = new TH1F(name, title,240,0,120);
- fhPtThresIsolatedPrompt[icone][ipt]->SetXTitle("p_{T} (GeV/c)");
- outputContainer->Add(fhPtThresIsolatedPrompt[icone][ipt]) ;
-
- sprintf(name,"hPtFracIsolPrompt_Cone_%d_Pt%d",icone,ipt);
- sprintf(title,"Isolated candidate Prompt p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt);
- fhPtFracIsolatedPrompt[icone][ipt] = new TH1F(name, title,240,0,120);
- fhPtFracIsolatedPrompt[icone][ipt]->SetXTitle("p_{T} (GeV/c)");
- outputContainer->Add(fhPtFracIsolatedPrompt[icone][ipt]) ;
-
- sprintf(name,"hPtThresIsolFragmentation_Cone_%d_Pt%d",icone,ipt);
- sprintf(title,"Isolated candidate Fragmentation p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt);
- fhPtThresIsolatedFragmentation[icone][ipt] = new TH1F(name, title,240,0,120);
- fhPtThresIsolatedFragmentation[icone][ipt]->SetXTitle("p_{T} (GeV/c)");
- outputContainer->Add(fhPtThresIsolatedFragmentation[icone][ipt]) ;
-
- sprintf(name,"hPtFracIsolFragmentation_Cone_%d_Pt%d",icone,ipt);
- sprintf(title,"Isolated candidate Fragmentation p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt);
- fhPtFracIsolatedFragmentation[icone][ipt] = new TH1F(name, title,240,0,120);
- fhPtFracIsolatedFragmentation[icone][ipt]->SetXTitle("p_{T} (GeV/c)");
- outputContainer->Add(fhPtFracIsolatedFragmentation[icone][ipt]) ;
-
- sprintf(name,"hPtThresIsolPi0Decay_Cone_%d_Pt%d",icone,ipt);
- sprintf(title,"Isolated candidate Pi0Decay p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt);
- fhPtThresIsolatedPi0Decay[icone][ipt] = new TH1F(name, title,240,0,120);
- fhPtThresIsolatedPi0Decay[icone][ipt]->SetXTitle("p_{T} (GeV/c)");
- outputContainer->Add(fhPtThresIsolatedPi0Decay[icone][ipt]) ;
-
- sprintf(name,"hPtFracIsolPi0Decay_Cone_%d_Pt%d",icone,ipt);
- sprintf(title,"Isolated candidate Pi0Decay p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt);
- fhPtFracIsolatedPi0Decay[icone][ipt] = new TH1F(name, title,240,0,120);
- fhPtFracIsolatedPi0Decay[icone][ipt]->SetXTitle("p_{T} (GeV/c)");
- outputContainer->Add(fhPtFracIsolatedPi0Decay[icone][ipt]) ;
-
- sprintf(name,"hPtThresIsolOtherDecay_Cone_%d_Pt%d",icone,ipt);
- sprintf(title,"Isolated candidate OtherDecay p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt);
- fhPtThresIsolatedOtherDecay[icone][ipt] = new TH1F(name, title,240,0,120);
- fhPtThresIsolatedOtherDecay[icone][ipt]->SetXTitle("p_{T} (GeV/c)");
- outputContainer->Add(fhPtThresIsolatedOtherDecay[icone][ipt]) ;
-
- sprintf(name,"hPtFracIsolOtherDecay_Cone_%d_Pt%d",icone,ipt);
- sprintf(title,"Isolated candidate OtherDecay p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt);
- fhPtFracIsolatedOtherDecay[icone][ipt] = new TH1F(name, title,240,0,120);
- fhPtFracIsolatedOtherDecay[icone][ipt]->SetXTitle("p_{T} (GeV/c)");
- outputContainer->Add(fhPtFracIsolatedOtherDecay[icone][ipt]) ;
-
- sprintf(name,"hPtThresIsolConversion_Cone_%d_Pt%d",icone,ipt);
- sprintf(title,"Isolated candidate Conversion p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt);
- fhPtThresIsolatedConversion[icone][ipt] = new TH1F(name, title,240,0,120);
- fhPtThresIsolatedConversion[icone][ipt]->SetXTitle("p_{T} (GeV/c)");
- outputContainer->Add(fhPtThresIsolatedConversion[icone][ipt]) ;
-
- sprintf(name,"hPtFracIsolConversion_Cone_%d_Pt%d",icone,ipt);
- sprintf(title,"Isolated candidate Conversion p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt);
- fhPtFracIsolatedConversion[icone][ipt] = new TH1F(name, title,240,0,120);
- fhPtFracIsolatedConversion[icone][ipt]->SetXTitle("p_{T} (GeV/c)");
- outputContainer->Add(fhPtFracIsolatedConversion[icone][ipt]) ;
-
- sprintf(name,"hPtThresIsolUnknown_Cone_%d_Pt%d",icone,ipt);
- sprintf(title,"Isolated candidate Unknown p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt);
- fhPtThresIsolatedUnknown[icone][ipt] = new TH1F(name, title,240,0,120);
- fhPtThresIsolatedUnknown[icone][ipt]->SetXTitle("p_{T} (GeV/c)");
- outputContainer->Add(fhPtThresIsolatedUnknown[icone][ipt]) ;
-
- sprintf(name,"hPtFracIsolUnknown_Cone_%d_Pt%d",icone,ipt);
- sprintf(title,"Isolated candidate Unknown p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt);
- fhPtFracIsolatedUnknown[icone][ipt] = new TH1F(name, title,240,0,120);
- fhPtFracIsolatedUnknown[icone][ipt]->SetXTitle("p_{T} (GeV/c)");
- outputContainer->Add(fhPtFracIsolatedUnknown[icone][ipt]) ;
-
- }//Histos with MC
-
- }//icone loop
- }//ipt loop
- }
-
- //Keep neutral meson selection histograms if requiered
- //Setting done in AliNeutralMesonSelection
- if(fMakeInvMass && GetNeutralMesonSelection()){
- TList * nmsHistos = GetNeutralMesonSelection()->GetCreateOutputObjects() ;
- cout<<"NMSHistos "<< nmsHistos<<endl;
- if(GetNeutralMesonSelection()->AreNeutralMesonSelectionHistosKept())
- for(Int_t i = 0; i < nmsHistos->GetEntries(); i++) outputContainer->Add(nmsHistos->At(i)) ;
- }
-
- return outputContainer ;
-
-}
-
-//__________________________________________________________________
-void AliAnaGammaDirect::MakeAnalysisFillAOD()
-{
- //Do analysis and fill aods
- //Search for the isolated photon in fDetector with pt > GetMinPt()
-
- //Fill CaloClusters if working with ESDs
- //if(GetReader()->GetDataType() == AliCaloTrackReader::kESD) ConnectAODCaloClusters();
-
- Int_t n = 0, nfrac = 0;
- Bool_t isolated = kFALSE ;
- Float_t coneptsum = 0 ;
- TClonesArray * pl = new TClonesArray;
-
- //Get vertex for photon momentum calculation
- Double_t vertex[]={0,0,0} ; //vertex ;
- if(!GetReader()->GetDataType()== AliCaloTrackReader::kMC) GetReader()->GetVertex(vertex);
-
- //Select the detector of the photon
- if(fDetector == "PHOS")
- pl = GetAODPHOS();
- else if (fDetector == "EMCAL")
- pl = GetAODEMCAL();
- //cout<<"Number of entries "<<pl->GetEntriesFast()<<endl;
-
- //Fill AODCaloClusters and AODParticleCorrelation with PHOS aods
- TLorentzVector mom ;
- for(Int_t icalo = 0; icalo < pl->GetEntriesFast(); icalo++){
- AliAODCaloCluster * calo = dynamic_cast<AliAODCaloCluster*> (pl->At(icalo));
-
- //Cluster selection, not charged, with photon id and in fidutial cut
- if(!SelectCluster(calo,vertex,mom)) continue ;
-
- //If too small pt, skip
- if(mom.Pt() < GetMinPt() || mom.Pt() > GetMaxPt() ) continue ;
-
- //Play with the MC stack if available
- Int_t tag =-1;
- if(IsDataMC()){
- //Check origin of the candidates
- tag = CheckOrigin(calo->GetLabel(0));
- if(GetDebug() > 0) printf("Origin of candidate %d\n",tag);
- }//Work with stack also
-
- //Check invariant mass
- Bool_t decay = kFALSE ;
- if(fMakeInvMass) decay = CheckInvMass(icalo,mom,vertex,pl);
- if(decay) continue ;
-
- //Create AOD for analysis
- AliAODParticleCorrelation ph = AliAODParticleCorrelation(mom);
- ph.SetLabel(calo->GetLabel(0));
- ph.SetPdg(AliCaloPID::kPhoton);
- ph.SetDetector(fDetector);
- ph.SetTag(tag);
- if(fMakeIC){
- n=0; nfrac = 0; isolated = kFALSE; coneptsum = 0;
- GetIsolationCut()->MakeIsolationCut((TSeqCollection*)GetAODCTS(), (TSeqCollection*)pl,
- vertex, kTRUE, &ph,icalo,-1,
- n,nfrac,coneptsum, isolated);
- if(isolated){
- //cout<<"Isolated : E "<<mom.E()<<" ; Phi"<<mom.Phi()<< " ; Eta "<<mom.Eta()<<endl;
- AddAODParticleCorrelation(ph);
- }
- }
- else //Fill all if not isolation requested
- AddAODParticleCorrelation(ph);
-
- }//loop
-
- if(GetDebug() > 1) printf("End fill AODs ");
-
-}
-
-//__________________________________________________________________
-void AliAnaGammaDirect::MakeAnalysisFillHistograms()
-{
- //Do analysis and fill histograms
- Int_t n = 0, nfrac = 0;
- Bool_t isolated = kFALSE ;
- Float_t coneptsum = 0 ;
- //cout<<"MakeAnalysisFillHistograms"<<endl;
-
- //Get vertex for photon momentum calculation
- Double_t v[]={0,0,0} ; //vertex ;
- if(!GetReader()->GetDataType()== AliCaloTrackReader::kMC) GetReader()->GetVertex(v);
-
- //Loop on stored AOD photons
- Int_t naod = GetAODBranch()->GetEntriesFast();
- if(GetDebug() > 0) printf("histo aod branch entries %d\n", naod);
- for(Int_t iaod = 0; iaod < naod ; iaod++){
- AliAODParticleCorrelation* ph = dynamic_cast<AliAODParticleCorrelation*> (GetAODBranch()->At(iaod));
- Int_t pdg = ph->GetPdg();
-
- //Only isolate photons in detector fDetector
- if(pdg != AliCaloPID::kPhoton || ph->GetDetector() != fDetector) continue;
-
- if(fMakeSeveralIC) {
- //Analysis of multiple IC at same time
- MakeSeveralICAnalysis(ph,v);
- continue;
- }
- else if(fReMakeIC){
- //In case a more strict IC is needed in the produced AOD
- n=0; nfrac = 0; isolated = kFALSE; coneptsum = 0;
- GetIsolationCut()->MakeIsolationCut((TSeqCollection*)ph->GetRefIsolationConeTracks(),
- (TSeqCollection*)ph->GetRefIsolationConeClusters(),
- v, kFALSE, ph,-1,-1,
- n,nfrac,coneptsum, isolated);
- }
-
- //Fill histograms (normal case)
- if(!fReMakeIC || (fReMakeIC && isolated)){
-
- //printf("Isolated Gamma: pt %f, phi %f, eta %f", ph->Pt(),ph->Phi(),ph->Eta()) ;
-
- //Fill prompt gamma histograms
- Float_t ptcluster = ph->Pt();
- Float_t phicluster = ph->Phi();
- Float_t etacluster = ph->Eta();
-
- fhPtGamma ->Fill(ptcluster);
- fhPhiGamma ->Fill(ptcluster,phicluster);
- fhEtaGamma ->Fill(ptcluster,etacluster);
- fhConeSumPt->Fill(ptcluster,coneptsum);
-
- if(IsDataMC()){
- Int_t tag =ph->GetTag();
-
- if(tag == kPrompt){
- fhPtPrompt ->Fill(ptcluster);
- fhPhiPrompt ->Fill(ptcluster,phicluster);
- fhEtaPrompt ->Fill(ptcluster,etacluster);
- }
- else if(tag==kFragmentation)
- {
- fhPtFragmentation ->Fill(ptcluster);
- fhPhiFragmentation ->Fill(ptcluster,phicluster);
- fhEtaFragmentation ->Fill(ptcluster,etacluster);
- }
- else if(tag==kPi0Decay)
- {
- fhPtPi0Decay ->Fill(ptcluster);
- fhPhiPi0Decay ->Fill(ptcluster,phicluster);
- fhEtaPi0Decay ->Fill(ptcluster,etacluster);
- }
- else if(tag==kEtaDecay || tag==kOtherDecay)
- {
- fhPtOtherDecay ->Fill(ptcluster);
- fhPhiOtherDecay ->Fill(ptcluster,phicluster);
- fhEtaOtherDecay ->Fill(ptcluster,etacluster);
- }
- else if(tag==kConversion)
- {
- fhPtConversion ->Fill(ptcluster);
- fhPhiConversion ->Fill(ptcluster,phicluster);
- fhEtaConversion ->Fill(ptcluster,etacluster);
- }
- else{
-
- fhPtUnknown ->Fill(ptcluster);
- fhPhiUnknown ->Fill(ptcluster,phicluster);
- fhEtaUnknown ->Fill(ptcluster,etacluster);
- }
- }//Histograms with MC
-
- }
- }// aod loop
-
-}
-
-//____________________________________________________________________________
-void AliAnaGammaDirect::InitParameters()
-{
-
- //Initialize the parameters of the analysis.
-
- fDetector = "PHOS" ;
- fMakeIC = kTRUE;
- fReMakeIC = kFALSE ;
- fMakeSeveralIC = kFALSE ;
- fMakeInvMass = kFALSE ;
-
- //----------- Several IC-----------------
- fNCones = 5 ;
- fNPtThresFrac = 6 ;
- fConeSizes[0] = 0.1; fConeSizes[1] = 0.2; fConeSizes[2] = 0.3; fConeSizes[3] = 0.4; fConeSizes[4] = 0.5;
- fPtThresholds[0]=0.; fPtThresholds[1]=1.; fPtThresholds[2]=2.; fPtThresholds[3]=3.; fPtThresholds[4]=4.;fPtThresholds[5]=5.;
- fPtFractions[0]=0.05; fPtFractions[1]=0.075; fPtFractions[2]=0.1; fPtFractions[3]=1.25; fPtFractions[4]=1.5;fPtFractions[5]=2.;
-
-}
-
-//__________________________________________________________________
-void AliAnaGammaDirect::MakeSeveralICAnalysis(AliAODParticleCorrelation* ph, Double_t v[3])
-{
- //Isolation Cut Analysis for both methods and different pt cuts and cones
- Float_t ptC = ph->Pt();
- Float_t phiC = ph->Phi();
- Float_t etaC = ph->Eta();
-
- fhPtGamma->Fill(ptC);
- fhPhiGamma->Fill(ptC,ph->Phi());
- fhEtaGamma->Fill(ptC,ph->Eta());
- Int_t tag =ph->GetTag();
-
- if(IsDataMC()){
- if(tag == kPrompt){
- fhPtPrompt ->Fill(ptC);
- fhPhiPrompt ->Fill(ptC,phiC);
- fhEtaPrompt ->Fill(ptC,etaC);
- }
- else if(tag==kFragmentation)
- {
- fhPtFragmentation ->Fill(ptC);
- fhPhiFragmentation ->Fill(ptC,phiC);
- fhEtaFragmentation ->Fill(ptC,etaC);
- }
- else if(tag==kPi0Decay)
- {
- fhPtPi0Decay ->Fill(ptC);
- fhPhiPi0Decay ->Fill(ptC,phiC);
- fhEtaPi0Decay ->Fill(ptC,etaC);
- }
- else if(tag==kEtaDecay || tag==kOtherDecay)
- {
- fhPtOtherDecay ->Fill(ptC);
- fhPhiOtherDecay ->Fill(ptC,phiC);
- fhEtaOtherDecay ->Fill(ptC,etaC);
- }
- else if(tag==kConversion)
- {
- fhPtConversion ->Fill(ptC);
- fhPhiConversion ->Fill(ptC,phiC);
- fhEtaConversion ->Fill(ptC,etaC);
- }
- else{
-
- fhPtUnknown ->Fill(ptC);
- fhPhiUnknown ->Fill(ptC,phiC);
- fhEtaUnknown ->Fill(ptC,etaC);
- }
- }//Histograms with MC
- //Keep original setting used when filling AODs, reset at end of analysis
- Float_t ptthresorg = GetIsolationCut()->GetPtThreshold();
- Float_t ptfracorg = GetIsolationCut()->GetPtFraction();
- Float_t rorg = GetIsolationCut()->GetConeSize();
-
- Float_t coneptsum = 0 ;
- Int_t n[10][10];//[fNCones][fNPtThresFrac];
- Int_t nfrac[10][10];//[fNCones][fNPtThresFrac];
- Bool_t isolated = kFALSE;
-
- for(Int_t icone = 0; icone<fNCones; icone++){
- GetIsolationCut()->SetConeSize(fConeSizes[icone]);
- coneptsum = 0 ;
- for(Int_t ipt = 0; ipt<fNPtThresFrac ;ipt++){
- n[icone][ipt]=0;
- nfrac[icone][ipt]=0;
- GetIsolationCut()->SetPtThreshold(fPtThresholds[ipt]);
- GetIsolationCut()->MakeIsolationCut((TSeqCollection*)ph->GetRefIsolationConeTracks(),
- (TSeqCollection*)ph->GetRefIsolationConeClusters(),
- v, kFALSE, ph,-1,-1,
- n[icone][ipt],nfrac[icone][ipt],coneptsum, isolated);
- if(n[icone][ipt] == 0) {
- fhPtThresIsolated[icone][ipt]->Fill(ptC);
- if(IsDataMC()){
- if(tag==kPrompt) fhPtThresIsolatedPrompt[icone][ipt]->Fill(ptC,coneptsum) ;
- else if(tag==kConversion) fhPtThresIsolatedConversion[icone][ipt]->Fill(ptC,coneptsum) ;
- else if(tag==kFragmentation) fhPtThresIsolatedFragmentation[icone][ipt]->Fill(ptC,coneptsum) ;
- else if(tag==kPi0Decay) fhPtThresIsolatedPi0Decay[icone][ipt]->Fill(ptC,coneptsum) ;
- else if(tag==kOtherDecay || tag==kEtaDecay) fhPtThresIsolatedOtherDecay[icone][ipt]->Fill(ptC,coneptsum) ;
- else fhPtThresIsolatedUnknown[icone][ipt]->Fill(ptC,coneptsum) ;
- }
- }
- if(nfrac[icone][ipt] == 0) {
- fhPtFracIsolated[icone][ipt]->Fill(ptC);
- if(IsDataMC()){
- if(tag==kPrompt) fhPtFracIsolatedPrompt[icone][ipt]->Fill(ptC,coneptsum) ;
- else if(tag==kConversion) fhPtFracIsolatedConversion[icone][ipt]->Fill(ptC,coneptsum) ;
- else if(tag==kFragmentation) fhPtFracIsolatedFragmentation[icone][ipt]->Fill(ptC,coneptsum) ;
- else if(tag==kPi0Decay) fhPtFracIsolatedPi0Decay[icone][ipt]->Fill(ptC,coneptsum) ;
- else if(tag==kOtherDecay || tag==kEtaDecay) fhPtFracIsolatedOtherDecay[icone][ipt]->Fill(ptC,coneptsum) ;
- else fhPtFracIsolatedUnknown[icone][ipt]->Fill(ptC,coneptsum) ;
- }
- }
- }//pt thresh loop
- fhPtSumIsolated[icone]->Fill(ptC,coneptsum) ;
- if(IsDataMC()){
- if(tag==kPrompt) fhPtSumIsolatedPrompt[icone]->Fill(ptC,coneptsum) ;
- else if(tag==kConversion) fhPtSumIsolatedConversion[icone]->Fill(ptC,coneptsum) ;
- else if(tag==kFragmentation) fhPtSumIsolatedFragmentation[icone]->Fill(ptC,coneptsum) ;
- else if(tag==kPi0Decay) fhPtSumIsolatedPi0Decay[icone]->Fill(ptC,coneptsum) ;
- else if(tag==kOtherDecay || tag==kEtaDecay) fhPtSumIsolatedOtherDecay[icone]->Fill(ptC,coneptsum) ;
- else fhPtSumIsolatedUnknown[icone]->Fill(ptC,coneptsum) ;
- }
-
- }//cone size loop
-
- //Reset original parameters for AOD analysis
- GetIsolationCut()->SetPtThreshold(ptthresorg);
- GetIsolationCut()->SetPtFraction(ptfracorg);
- GetIsolationCut()->SetConeSize(rorg);
-
-}
-
-//__________________________________________________________________
-void AliAnaGammaDirect::Print(const Option_t * opt) const
-{
-
- //Print some relevant parameters set for the analysis
- if(! opt)
- return;
-
- printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
-
- printf("Min Gamma pT = %2.2f\n", GetMinPt()) ;
- printf("Max Gamma pT = %3.2f\n", GetMaxPt()) ;
-
-// if(IsCaloPIDOn())printf("Check PID \n") ;
-// if(IsCaloPIDRecalculationOn())printf("Recalculate PID \n") ;
-// if(IsFidutialCutOn())printf("Check Fidutial cut \n") ;
- printf("Make Isolation = %d \n", fMakeIC) ;
- printf("ReMake Isolation = %d \n", fReMakeIC) ;
- printf("Make Several Isolation = %d \n", fMakeSeveralIC) ;
-
- if(fMakeSeveralIC){
- printf("N Cone Sizes = %d\n", fNCones) ;
- printf("Cone Sizes = \n") ;
- for(Int_t i = 0; i < fNCones; i++)
- printf(" %1.2f;", fConeSizes[i]) ;
- printf(" \n") ;
-
- printf("N pT thresholds/fractions = %d\n", fNPtThresFrac) ;
- printf(" pT thresholds = \n") ;
- for(Int_t i = 0; i < fNPtThresFrac; i++)
- printf(" %2.2f;", fPtThresholds[i]) ;
-
- printf(" \n") ;
-
- printf(" pT fractions = \n") ;
- for(Int_t i = 0; i < fNPtThresFrac; i++)
- printf(" %2.2f;", fPtFractions[i]) ;
-
- }
-
- printf(" \n") ;
-
-}
-
-//____________________________________________________________________________
-Bool_t AliAnaGammaDirect::SelectCluster(AliAODCaloCluster * calo, Double_t vertex[3], TLorentzVector & mom){
- //Select cluster depending on its pid and acceptance selections
-
- //Skip matched clusters with tracks
- if(calo->GetNTracksMatched() > 0) return kFALSE ;
-
- //Check PID
- calo->GetMomentum(mom,vertex);//Assume that come from vertex in straight line
- Int_t pdg = AliCaloPID::kPhoton;
- if(IsCaloPIDOn()){
- //Get most probable PID, 2 options check PID weights (in MC this option is mandatory)
- //or redo PID, recommended option for EMCal.
- if(!IsCaloPIDRecalculationOn() || GetReader()->GetDataType() == AliCaloTrackReader::kMC )
- pdg = GetCaloPID()->GetPdg(fDetector,calo->PID(),mom.E());//PID with weights
- else
- pdg = GetCaloPID()->GetPdg(fDetector,mom,calo->GetM02(),0,0,0,0);//PID recalculated
-
- if(GetDebug() > 1) printf("PDG of identified particle %d\n",pdg);
-
- //If it does not pass pid, skip
- if(pdg != AliCaloPID::kPhoton) return kFALSE ;
- }
-
- //Check acceptance selection
- if(IsFidutialCutOn()){
- Bool_t in = GetFidutialCut()->IsInFidutialCut(mom,fDetector) ;
- if(! in ) return kFALSE ;
- }
-
- if(GetDebug() > 1) printf("Correlation photon selection cuts passed: pT %3.2f, pdg %d\n",mom.Pt(), pdg);
-
- return kTRUE;
-
- }
+++ /dev/null
-#ifndef AliAnaGammaDirect_H
-#define AliAnaGammaDirect_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-/* $Id: AliAnaGammaDirect.h 27413 2008-07-18 13:28:12Z gconesab $ */
-
-//_________________________________________________________________________
-
-// Class for the analysis of prompt gamma, isolation cut.
-//
-// Class created from old AliPHOSGammaJet
-// (see AliRoot versions previous Release 4-09)
-
-//-- Author: Gustavo Conesa (INFN-LNF)
-
-// --- ROOT system ---
-#include <TParticle.h>
-#include <TClonesArray.h>
-#include <TH2F.h>
-#include <TString.h>
-
-// --- ANALYSIS system ---
-#include "AliAnaPartCorrBaseClass.h"
-class AliAODParticleCorrelations ;
-
-class TList ;
-
-class AliAnaGammaDirect : public AliAnaPartCorrBaseClass {
-
-public:
-
- AliAnaGammaDirect() ; // default ctor
- AliAnaGammaDirect(const AliAnaGammaDirect & g) ; // cpy ctor
- AliAnaGammaDirect & operator = (const AliAnaGammaDirect & g) ;//cpy assignment
- virtual ~AliAnaGammaDirect() ; //virtual dtor
-
- enum mcTypes {kPrompt, kFragmentation, kPi0Decay, kEtaDecay, kOtherDecay, kPi0, kEta, kElectron, kConversion, kUnknown};
-
- Bool_t CheckInvMass(const Int_t icalo,const TLorentzVector mom, Double_t *v, TClonesArray * pl);
- Int_t CheckOrigin(const Int_t label);
-
- TList * GetCreateOutputObjects();
-
- void MakeAnalysisFillAOD() ;
-
- void MakeAnalysisFillHistograms() ;
-
- void MakeSeveralICAnalysis(AliAODParticleCorrelation * ph, Double_t v[3]);
-
- void Print(const Option_t * opt)const;
-
- TString GetDetector() const {return fDetector ; }
- void SetDetector(TString det) {fDetector = det ; }
-
- Int_t GetNCones() const {return fNCones ; }
- Int_t GetNPtThresFrac() const {return fNPtThresFrac ; }
- Float_t GetConeSizes(Int_t i) const {return fConeSizes[i] ; }
- Float_t GetPtThresholds(Int_t i) const {return fPtThresholds[i] ; }
- Float_t GetPtFractions(Int_t i) const {return fPtFractions[i] ; }
-
- void InitParameters();
-
- void SetNCones(Int_t ncs) {fNCones = ncs ; }
- void SetNPtThresFrac(Int_t npt) {fNPtThresFrac = npt; }
- void SetConeSizes(Int_t i, Float_t r) {fConeSizes[i] = r ; }
- void SetPtThresholds(Int_t i, Float_t pt) {fPtThresholds[i] = pt; }
- void SetPtFractions(Int_t i, Float_t pt) {fPtFractions[i] = pt; }
-
- Bool_t IsIsolationOn() {return fMakeIC ; }
- void SwitchOnIsolation() { fMakeIC = kTRUE;}
- void SwitchOffIsolation() { fMakeIC = kFALSE;}
-
- Bool_t IsReIsolationOn() {return fReMakeIC ; }
- void SwitchOnReIsolation() { fReMakeIC = kTRUE;}
- void SwitchOffReIsolation() { fReMakeIC = kFALSE;}
-
- Bool_t IsSeveralIsolationOn() {return fMakeSeveralIC ; }
- void SwitchOnSeveralIsolation() { fMakeSeveralIC = kTRUE;}
- void SwitchOffSeveralIsolation() { fMakeSeveralIC = kFALSE;}
-
- Bool_t IsInvariantMassOn() {return fMakeInvMass ; }
- void SwitchOnInvariantMass() { fMakeInvMass = kTRUE;}
- void SwitchOffInvariantMass() { fMakeInvMass = kFALSE;}
-
- Bool_t SelectCluster(AliAODCaloCluster * calo, Double_t vertex[3], TLorentzVector & mom);
-
- private:
-
- TString fDetector ; // Detector where the gamma is searched;
- Bool_t fMakeIC ; //Do isolation analysis
- Bool_t fReMakeIC ; //Do isolation analysis
- Bool_t fMakeSeveralIC ; //Do analysis for different IC
- Bool_t fMakeInvMass; //Select candidate if no pair from decay
-
- //Histograms
- TH1F * fhPtGamma ; //!Number of identified (isolated) gamma
- TH2F * fhPhiGamma ; //! Phi of identified (isolated) gamma
- TH2F * fhEtaGamma ; //! eta of identified (isolated) gamma
- TH2F * fhConeSumPt ; //! Sum Pt in the cone
-
- //Prompt photon analysis data members for multiple cones and pt thresholds
- Int_t fNCones ; //!Number of cone sizes to test
- Int_t fNPtThresFrac ; //!Number of ptThres and ptFrac to test
- Float_t fConeSizes[5] ; //! Array with cones to test
- Float_t fPtThresholds[5] ; //! Array with pt thresholds to test
- Float_t fPtFractions[5] ; //! Array with pt thresholds to test
-
- TH1F* fhPtThresIsolated[5][5]; //! Isolated gamma with pt threshold
- TH1F* fhPtFracIsolated[5][5]; //! Isolated gamma with pt threshold
- TH2F* fhPtSumIsolated[5] ; //! Isolated gamma with threshold on cone pt sume
-
- //MC
- TH1F * fhPtPrompt; //!Number of identified (isolated) prompt gamma
- TH2F * fhPhiPrompt; //! Phi of identified (isolated) prompt gamma
- TH2F * fhEtaPrompt; //! eta of identified (isolated) prompt gamma
- TH1F * fhPtThresIsolatedPrompt[5][5]; //! Isolated prompt gamma with pt threshold
- TH1F * fhPtFracIsolatedPrompt[5][5]; //! Isolated prompt gamma with pt frac
- TH2F * fhPtSumIsolatedPrompt[5]; //! Isolated prompt gamma with threshold on cone pt sume
- TH1F * fhPtFragmentation; //!Number of identified (isolated) fragmentation gamma
- TH2F * fhPhiFragmentation; //! Phi of identified (isolated) fragmentation gamma
- TH2F * fhEtaFragmentation; //! eta of identified (isolated) fragmentation gamma
- TH1F * fhPtThresIsolatedFragmentation[5][5]; //! Isolated fragmentation gamma with pt threshold
- TH1F * fhPtFracIsolatedFragmentation[5][5]; //! Isolated fragmentation gamma with pt frac
- TH2F * fhPtSumIsolatedFragmentation[5]; //! Isolated fragmentation gamma with threshold on cone pt sume
- TH1F * fhPtPi0Decay; //!Number of identified (isolated) Pi0Decay gamma
- TH2F * fhPhiPi0Decay; //! Phi of identified (isolated) Pi0Decay gamma
- TH2F * fhEtaPi0Decay; //! eta of identified (isolated) Pi0Decay gamma
- TH1F * fhPtThresIsolatedPi0Decay[5][5]; //! Isolated Pi0Decay gamma with pt threshold
- TH1F * fhPtFracIsolatedPi0Decay[5][5]; //! Isolated Pi0Decay gamma with pt frac
- TH2F * fhPtSumIsolatedPi0Decay[5]; //! Isolated Pi0Decay gamma with threshold on cone pt sume
- TH1F * fhPtOtherDecay; //!Number of identified (isolated) OtherDecay gamma
- TH2F * fhPhiOtherDecay; //! Phi of identified (isolated) OtherDecay gamma
- TH2F * fhEtaOtherDecay; //! eta of identified (isolated) OtherDecay gamma
- TH1F * fhPtThresIsolatedOtherDecay[5][5]; //! Isolated OtherDecay gamma with pt threshold
- TH1F * fhPtFracIsolatedOtherDecay[5][5]; //! Isolated OtherDecay gamma with pt frac
- TH2F * fhPtSumIsolatedOtherDecay[5]; //! Isolated OtherDecay gamma with threshold on cone pt sume
- TH1F * fhPtConversion; //!Number of identified (isolated) Conversion gamma
- TH2F * fhPhiConversion; //! Phi of identified (isolated) Conversion gamma
- TH2F * fhEtaConversion; //! eta of identified (isolated) Conversion gamma
- TH1F * fhPtThresIsolatedConversion[5][5]; //! Isolated Conversion gamma with pt threshold
- TH1F * fhPtFracIsolatedConversion[5][5]; //! Isolated Conversion gamma with pt frac
- TH2F * fhPtSumIsolatedConversion[5]; //! Isolated Conversion gamma with threshold on cone pt sume
- TH1F * fhPtUnknown; //!Number of identified (isolated) Unknown gamma
- TH2F * fhPhiUnknown; //! Phi of identified (isolated) Unknown gamma
- TH2F * fhEtaUnknown; //! eta of identified (isolated) Unknown gamma
- TH1F * fhPtThresIsolatedUnknown[5][5]; //! Isolated Unknown gamma with pt threshold
- TH1F * fhPtFracIsolatedUnknown[5][5]; //! Isolated Unknown gamma with pt frac
- TH2F * fhPtSumIsolatedUnknown[5]; //! Isolated Unknown gamma with threshold on cone pt sume
-
- ClassDef(AliAnaGammaDirect,1)
-} ;
-
-
-#endif //AliAnaGammaDirect_H
-
-
-
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *GetEntriesFast(
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-/* $Id: $ */
-
-//_________________________________________________________________________
-// Base class for analysis algorithms
-//-- Author: Gustavo Conesa (LNF-INFN)
-//_________________________________________________________________________
-
-
-// --- ROOT system ---
-#include <TClonesArray.h>
-#include <Riostream.h>
-
-//---- AliRoot system ----
-#include "AliAODParticleCorrelation.h"
-#include "AliAODCaloCluster.h"
-#include "AliAODCaloCells.h"
-#include "AliAODTrack.h"
-#include "AliAnaPartCorrBaseClass.h"
-#include "AliCaloTrackReader.h"
-#include "AliFidutialCut.h"
-#include "AliIsolationCut.h"
-#include "AliNeutralMesonSelection.h"
-#include "AliLog.h"
-// #include "AliStack.h"
-// #include "AliHeader.h"
-// #include "AliGenEventHeader.h"
-
-ClassImp(AliAnaPartCorrBaseClass)
-
-
-//_______________________________________________
- AliAnaPartCorrBaseClass::AliAnaPartCorrBaseClass() :
- TObject(), fDataMC(0), fDebug(0), fCheckFidCut(0),
- fCheckCaloPID(0), fRecalculateCaloPID(0), fMinPt(0), fMaxPt(0),
- fReader(0x0), fAODBranch(0x0), fAODCaloClusters(0x0), fAODCaloCells(0x0),
- fCaloPID(0x0), fFidCut(0x0), fIC(0x0),fNMS(0x0)
-{
- //Default Ctor
-
- fReader = new AliCaloTrackReader();
- fCaloPID = new AliCaloPID();
- fFidCut = new AliFidutialCut();
- fIC = new AliIsolationCut();
-
- //Initialize parameters
- InitParameters();
-}
-
-//___________________________________________________________
-AliAnaPartCorrBaseClass::AliAnaPartCorrBaseClass(const AliAnaPartCorrBaseClass & abc) :
- TObject(), fDataMC(abc.fDataMC), fDebug(abc.fDebug),
- fCheckFidCut(abc.fCheckFidCut), fCheckCaloPID(abc. fCheckCaloPID),
- fRecalculateCaloPID(abc.fRecalculateCaloPID),
- fMinPt(abc.fMinPt), fMaxPt(abc.fMaxPt), fReader(abc.fReader),
- fAODBranch(new TClonesArray(*abc.fAODBranch)),
- fAODCaloClusters(new TClonesArray(*abc.fAODCaloClusters)),
- fAODCaloCells(new AliAODCaloCells(*abc.fAODCaloCells)),
- fCaloPID(abc.fCaloPID), fFidCut(abc.fFidCut), fIC(abc.fIC),fNMS(abc.fNMS)
-{
- // cpy ctor
-
-}
-
-//_________________________________________________________________________
-AliAnaPartCorrBaseClass & AliAnaPartCorrBaseClass::operator = (const AliAnaPartCorrBaseClass & abc)
-{
- // assignment operator
-
- if(this == &abc) return *this;
- ((TObject *)this)->operator=(abc);
-
- fDataMC = abc.fDataMC;
- fDebug = abc.fDebug ;
- fRecalculateCaloPID = abc.fRecalculateCaloPID ;
- fCheckCaloPID = abc. fCheckCaloPID ;
- fCheckFidCut = abc.fCheckFidCut ;
-
- fReader = abc.fReader ;
-
- fAODBranch = new TClonesArray(*abc.fAODBranch) ;
- fAODCaloClusters = new TClonesArray(*abc.fAODCaloClusters) ;
- fAODCaloCells = new AliAODCaloCells(*abc.fAODCaloCells) ;
-
- fMinPt = abc.fMinPt;
- fMaxPt = abc.fMaxPt;
-
- fCaloPID = abc.fCaloPID;
- fFidCut = abc.fFidCut;
- fIC = abc.fIC;
- fNMS = abc.fNMS;
-
- return *this;
-
-}
-
-//____________________________________________________________________________
-AliAnaPartCorrBaseClass::~AliAnaPartCorrBaseClass()
-{
- // Remove all pointers except analysis output pointers.
-
- if(fAODBranch){
- fAODBranch->Clear() ;
- delete fAODBranch ;
- }
-
- if(fAODCaloClusters){
- fAODCaloClusters->Clear() ;
- delete fAODCaloClusters ;
- }
-
- if(fAODCaloCells){
- fAODCaloCells->Clear() ;
- delete fAODCaloCells ;
- }
-
- if(fReader) delete fReader ;
- if(fCaloPID) delete fCaloPID ;
- if(fFidCut) delete fFidCut ;
- if(fIC) delete fIC ;
- if(fNMS) delete fNMS ;
-
-}
-
-//____________________________________________________________________________
-void AliAnaPartCorrBaseClass::AddAODCaloCluster(AliAODCaloCluster calo) {
- //Put AOD calo cluster in the CaloClusters array
-
- Int_t i = fAODCaloClusters->GetEntriesFast();
- new((*fAODCaloClusters)[i]) AliAODCaloCluster(calo);
-
-}
-
-//____________________________________________________________________________
-void AliAnaPartCorrBaseClass::AddAODParticleCorrelation(AliAODParticleCorrelation pc) {
- //Put AOD calo cluster in the AODParticleCorrelation array
-
- Int_t i = fAODBranch->GetEntriesFast();
- new((*fAODBranch)[i]) AliAODParticleCorrelation(pc);
-
-}
-
-//___________________________________________________
-void AliAnaPartCorrBaseClass::ConnectAODCaloClusters() {
- //Recover the list of AODCaloClusters
-
- fAODCaloClusters = fReader->GetAOD()->GetCaloClusters();
-
-}
-
-//___________________________________________________
-void AliAnaPartCorrBaseClass::ConnectAODPHOSCells() {
- //Recover the list of PHOS AODCaloCells
-
- fAODCaloCells = fReader->GetAOD()->GetPHOSCells();
-
-}
-
-//___________________________________________________
-void AliAnaPartCorrBaseClass::ConnectAODEMCALCells() {
- //Recover the list of EMCAL AODCaloCells
-
- fAODCaloCells = fReader->GetAOD()->GetEMCALCells();
-
-}
-
-//__________________________________________________
-TClonesArray * AliAnaPartCorrBaseClass::GetAODCTS() const {
- //Get list of tracks from reader
-
- return fReader->GetAODCTS();
-
-}
-
-//__________________________________________________
-TClonesArray * AliAnaPartCorrBaseClass::GetAODPHOS() const {
- //Get list of PHOS calo clusters from reader
-
- return fReader->GetAODPHOS();
-
-}
-
-
-//__________________________________________________
-TClonesArray * AliAnaPartCorrBaseClass::GetAODEMCAL() const {
- //Get list of emcal caloclusters from reader
-
- return fReader->GetAODEMCAL();
-
-}
-
-//__________________________________________________
-TNamed * AliAnaPartCorrBaseClass::GetPHOSCells() const {
- //Get list of PHOS calo cells (ESD or AOD) from reader
-
- return fReader->GetPHOSCells();
-
-}
-
-
-//__________________________________________________
-TNamed * AliAnaPartCorrBaseClass::GetEMCALCells() const {
- //Get list of emcal calo cells (ESD or AOD) from reader
-
- return fReader->GetEMCALCells();
-
-}
-
-//__________________________________________________
-AliStack * AliAnaPartCorrBaseClass::GetMCStack() const {
- //Get stack pointer from reader
-
- return fReader->GetStack();
-
-}
-//__________________________________________________
-AliHeader * AliAnaPartCorrBaseClass::GetMCHeader() const {
- //Get header pointer from reader
-
- return fReader->GetHeader();
-
-}
-
-//__________________________________________________
-AliGenEventHeader * AliAnaPartCorrBaseClass::GetMCGenEventHeader() const {
- //Get GenEventHeader pointer from reader
-
- return fReader->GetGenEventHeader();
-
-}
-
-
-void AliAnaPartCorrBaseClass::InitParameters()
-{
- //Initialize the parameters of the analysis.
- fDataMC = kFALSE;
- fDebug = -1;
- fCheckCaloPID = kTRUE ;
- fCheckFidCut = kFALSE ;
- fRecalculateCaloPID = kFALSE ;
- fMinPt = 0.2 ; //Min pt in particle analysis
- fMaxPt = 300. ; //Max pt in particle analysis
-
- fCaloPID = new AliCaloPID ;
- fFidCut = new AliFidutialCut;
- fIC = new AliIsolationCut;
- fNMS = new AliNeutralMesonSelection;
-
-}
-
+++ /dev/null
-#ifndef AliAnaPartCorrBaseClass_H
-#define AliAnaPartCorrBaseClass_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-/* $Id: $ */
-
-//_________________________________________________________________________
-// Base class for analysis algorithms
-//-- Author: Gustavo Conesa (INFN-LNF)
-
-//ROOT
-class TClonesArray ;
-#include <TList.h>
-#include <TObject.h>
-
-//Analysis
-class AliAODCaloCluster;
-class AliAODCaloCells;
-#include "AliAODParticleCorrelation.h"
-class AliCaloTrackReader ;
-#include "AliCaloPID.h"
-class AliFidutialCut ;
-class AliIsolationCut ;
-class AliNeutralMesonSelection ;
-/* class AliStack ; */
-/* class AliHeader ; */
-/* class AliGenEventHeader ; */
-#include "AliStack.h"
-#include "AliHeader.h"
-#include "AliGenEventHeader.h"
-
-class AliAnaPartCorrBaseClass : public TObject {
-
- public:
-
- AliAnaPartCorrBaseClass() ; // default ctor
- AliAnaPartCorrBaseClass(const AliAnaPartCorrBaseClass & g) ; // cpy ctor
- AliAnaPartCorrBaseClass & operator = (const AliAnaPartCorrBaseClass & g) ;//cpy assignment
- virtual ~AliAnaPartCorrBaseClass() ; //virtual dtor
-
- virtual void AddAODCaloCluster(AliAODCaloCluster calo) ;
- virtual void AddAODParticleCorrelation(AliAODParticleCorrelation pc) ;
-
- virtual void ConnectAODCaloClusters();
- virtual void ConnectAODPHOSCells();
- virtual void ConnectAODEMCALCells();
-
- virtual TList * GetCreateOutputObjects(){ return (new TList) ;}
-
- virtual void Print(const Option_t * ) const {;}
-
- virtual void MakeAnalysisFillAOD() {;}
-
- virtual void MakeAnalysisFillHistograms() {;}
-
- virtual Int_t GetDebug() const { return fDebug ; }
- virtual void SetDebug(Int_t d) { fDebug = d ; }
-
- virtual AliCaloTrackReader * GetReader() const {return fReader ; }
- virtual void SetReader(AliCaloTrackReader * reader) { fReader = reader ; }
-
- virtual TClonesArray* GetAODBranch() const {return fAODBranch ;}
- virtual TClonesArray* GetAODCaloClusters() const {return fAODCaloClusters ;}
- virtual AliAODCaloCells* GetAODCaloCells() const {return fAODCaloCells ;}
-
- virtual TClonesArray* GetAODCTS() const ;
- virtual TClonesArray* GetAODEMCAL() const ;
- virtual TClonesArray* GetAODPHOS() const ;
-
- virtual TNamed * GetEMCALCells() const ;
- virtual TNamed * GetPHOSCells() const ;
-
- virtual AliStack * GetMCStack() const ;
- virtual AliHeader* GetMCHeader() const ;
- virtual AliGenEventHeader* GetMCGenEventHeader() const ;
-
- virtual void SetAODBranch(TClonesArray * tca) { fAODBranch = tca ; }
-
- virtual AliCaloPID * GetCaloPID() const {return fCaloPID ;}
- virtual void SetCaloPID(AliCaloPID * pid) { fCaloPID = pid ;}
-
- virtual AliFidutialCut * GetFidutialCut() const {return fFidCut ;}
- virtual void SetFidutialCut(AliFidutialCut * fc) { fFidCut = fc ;}
-
- virtual AliIsolationCut * GetIsolationCut() const {return fIC ;}
- virtual void SetIsolationCut(AliIsolationCut * fc) { fIC = fc ;}
-
- virtual AliNeutralMesonSelection * GetNeutralMesonSelection() const {return fNMS ;}
- virtual void SetNeutralMesonSelection(AliNeutralMesonSelection * nms) { fNMS = nms ;}
-
- virtual Bool_t IsDataMC() const {return fDataMC ; }
- virtual void SwitchOnDataMC() {fDataMC = kTRUE ; }
- virtual void SwitchOffDataMC() {fDataMC = kFALSE ; }
-
- virtual Bool_t IsFidutialCutOn() {return fCheckFidCut ; }
- virtual void SwitchOnFidutialCut() { fCheckFidCut = kTRUE;}
- virtual void SwitchOffFidutialCut() { fCheckFidCut = kFALSE;}
-
- virtual Bool_t IsCaloPIDOn() {return fCheckCaloPID ; }
- virtual void SwitchOnCaloPID() { fCheckCaloPID = kTRUE;}
- virtual void SwitchOffCaloPID() { fCheckCaloPID = kFALSE;}
-
- virtual Bool_t IsCaloPIDRecalculationOn() {return fRecalculateCaloPID ; }
- virtual void SwitchOnCaloPIDRecalculation() { fRecalculateCaloPID = kTRUE;}
- virtual void SwitchOffCaloPIDRecalculation() { fRecalculateCaloPID = kFALSE;}
-
- virtual Float_t GetMaxPt() const {return fMaxPt ; }
- virtual Float_t GetMinPt() const {return fMinPt ; }
- virtual void SetMaxPt(Float_t pt) {fMaxPt = pt ; }
- virtual void SetMinPt(Float_t pt) {fMinPt = pt ; }
- void SetPtCutRange(Double_t ptmin, Double_t ptmax)
- { fMaxPt=ptmax; fMinPt=ptmin;}
-
- virtual void InitParameters() ;
-
- private:
-
- Bool_t fDataMC ; //Flag to access MC data when using ESD or AOD
- Int_t fDebug ; // Debug level
- Bool_t fCheckFidCut ; // Do analysis for clusters in defined region
- Bool_t fCheckCaloPID ; // Do analysis for calorimeters
- Bool_t fRecalculateCaloPID ; //Recalculate PID or use PID weights in calorimeters
- Float_t fMinPt ; //Maximum pt of (trigger) particles in the analysis
- Float_t fMaxPt ; //Minimum pt of (trigger) particles in the analysis
-
- AliCaloTrackReader * fReader; //Acces to ESD/AOD/MC data
-
- TClonesArray* fAODBranch ; //! selected particles branch
- TClonesArray* fAODCaloClusters ; //! selected PHOS/EMCAL CaloClusters
- AliAODCaloCells * fAODCaloCells ; //! selected PHOS/EMCAL CaloCells
- AliCaloPID * fCaloPID; // PID calculation
- AliFidutialCut * fFidCut; //Acceptance cuts
- AliIsolationCut * fIC; // Isolation cut
- AliNeutralMesonSelection * fNMS; // Neutral Meson Selection
-
- ClassDef(AliAnaPartCorrBaseClass,1)
- } ;
-
-
-#endif //AliAnaPartCorrBaseClass_H
-
-
-
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-/* $Id: $ */
-
-//_________________________________________________________________________
-// Steering class for particle (gamma, hadron) identification and correlation analysis
-// It is called by the task class AliAnalysisTaskParticleCorrelation and it connects the input
-// (ESD/AOD/MonteCarlo) got with AliCaloTrackReader (produces TClonesArrays of AODs
-// (TParticles in MC case if requested)), with the
-// analysis classes that derive from AliAnaPartCorrBaseClass
-//
-// -- Author: Gustavo Conesa (INFN-LNF)
-
-// --- ROOT system ---
-#include <TClonesArray.h>
-#include <TString.h>
-
-//---- AliRoot system ----
-#include "AliAnaPartCorrBaseClass.h"
-#include "AliAnaPartCorrMaker.h"
-#include "AliCaloTrackReader.h"
-#include "AliLog.h"
-
-
-ClassImp(AliAnaPartCorrMaker)
-
-
-//____________________________________________________________________________
- AliAnaPartCorrMaker::AliAnaPartCorrMaker() :
- TObject(),
- fOutputContainer(new TList ), fAnalysisContainer(new TList ),
- fMakeHisto(0), fMakeAOD(0), fAnaDebug(0),
- fReader(0x0), fAODBranch(0x0), fAODBranchName("")
-{
- //Default Ctor
- if(fAnaDebug > 1 ) printf("*** Analysis Maker Constructor *** \n");
-
- //Initialize parameters, pointers and histograms
- if(!fReader)
- fReader = new AliCaloTrackReader();
-
- InitParameters();
-}
-
-//____________________________________________________________________________
-AliAnaPartCorrMaker::AliAnaPartCorrMaker(const AliAnaPartCorrMaker & g) :
- TObject(),
- fOutputContainer(g. fOutputContainer), fAnalysisContainer(g.fAnalysisContainer),
- fMakeHisto(g.fMakeHisto), fMakeAOD(fMakeAOD), fAnaDebug(g. fAnaDebug),
- fReader(g.fReader), fAODBranch(g.fAODBranch),
- fAODBranchName(g.fAODBranchName)
-{
- // cpy ctor
-
-}
-
-//_________________________________________________________________________
-AliAnaPartCorrMaker & AliAnaPartCorrMaker::operator = (const AliAnaPartCorrMaker & source)
-{
- // assignment operator
-
- if(this == &source)return *this;
- ((TObject *)this)->operator=(source);
-
- fOutputContainer = source.fOutputContainer ;
- fAnalysisContainer = source.fAnalysisContainer ;
- fAnaDebug = source.fAnaDebug;
- fMakeHisto = source.fMakeHisto;
- fMakeAOD = source.fMakeAOD;
-
- fAODBranchName = source.fAODBranchName;
- fAODBranch = source.fAODBranch;
-
- fReader = source.fReader ;
-
- return *this;
-
-}
-
-//____________________________________________________________________________
-AliAnaPartCorrMaker::~AliAnaPartCorrMaker()
-{
- // Remove all pointers.
-
- // Protection added in case of NULL pointers (MG)
- if (fOutputContainer) {
- fOutputContainer->Clear();
- delete fOutputContainer ;
- }
-
- if (fAnalysisContainer) {
- fAnalysisContainer->Clear();
- delete fAnalysisContainer ;
- }
-
- if (fReader) delete fReader ;
-
- if (fAODBranch) {
- fAODBranch->Clear();
- delete fAODBranch ;
- }
-
-}
-
-//________________________________________________________________________
-void AliAnaPartCorrMaker::Init()
-{
- //Init container histograms and other common variables
-
- if(fMakeHisto){// Analysis with histograms as output on
-
- //Fill container with appropriate histograms
-
- if(!fAnalysisContainer || fAnalysisContainer->GetEntries()==0)
- AliFatal("Analysis job list not initailized");
-
- for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++){
- TList * templist = ((AliAnaPartCorrBaseClass *) fAnalysisContainer->At(iana)) -> GetCreateOutputObjects();
-
- for(Int_t i = 0; i < templist->GetEntries(); i++)
- fOutputContainer->Add(templist->At(i)) ;
-
- }
- }// Analysis with histograms as output on
-}
-
-//____________________________________________________________________________
-void AliAnaPartCorrMaker::InitParameters()
-{
-
- //Init data members
- fMakeHisto = kTRUE;
- fMakeAOD = kTRUE;
- fAnaDebug = 0; // No debugging info displayed by default
- fAODBranchName = "Photons" ;
-
-}
-
-//__________________________________________________________________
-void AliAnaPartCorrMaker::Print(const Option_t * opt) const
-{
-
- //Print some relevant parameters set for the analysis
- if(! opt)
- return;
-
- printf("***** Print: %s %s ******\n", GetName(), GetTitle() ) ;
- printf("Debug level = %d\n", fAnaDebug) ;
- printf("New AOD branch = %s\n", fAODBranchName.Data()) ;
- printf("Produce Histo = %d\n", fMakeHisto) ;
- printf("Produce AOD = %d\n", fMakeAOD) ;
-
-}
-
-
-//____________________________________________________________________________
-Bool_t AliAnaPartCorrMaker::ProcessEvent(Int_t iEntry){
- //Process analysis for this event
-
- if(fMakeHisto && !fOutputContainer)
- AliFatal("Histograms not initialized");
-
- if(fAnaDebug >= 0 ) printf("*** Event %d *** \n",iEntry);
-
- //Each event needs an empty branch
- fAODBranch->Clear();
-
- //Tell the reader to fill the data in the 3 detector lists
- fReader->FillInputEvent();
-
- //Loop on analysis algorithms
- if(fAnaDebug > 0 ) printf("*** Begin analysis *** \n");
- Int_t nana = fAnalysisContainer->GetEntries() ;
- for(Int_t iana = 0; iana < nana; iana++){
-
- AliAnaPartCorrBaseClass * ana = ((AliAnaPartCorrBaseClass *) fAnalysisContainer->At(iana)) ;
-
- //Set reader and aod branch for each analysis
- ana->SetReader(fReader);
- ana->SetAODBranch(fAODBranch);
-
- //Make analysis, create aods in aod branch or AODCaloClusters
- if(fMakeAOD) ana->MakeAnalysisFillAOD() ;
- //Make further analysis with aod branch and fill histograms
- if(fMakeHisto) ana->MakeAnalysisFillHistograms() ;
-
- }
-
- if(fAnaDebug > 0 ) printf("*** End analysis *** \n");
-
- fReader->ResetLists();
-
- return kTRUE ;
-
-}
+++ /dev/null
-#ifndef AliAnaPartCorrMaker_H
-#define AliAnaPartCorrMaker_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-/* $Id: $ */
-
-//_________________________________________________________________________
-// Steering class for particle (gamma, hadron) identification and correlation analysis
-// It is called by the task class AliAnalysisTaskParticleCorrelation and it connects the input
-// (ESD/AOD/MonteCarlo) got with AliCaloTrackReader (produces TClonesArrays of AODs
-// (TParticles in MC case if requested)), with the
-// analysis classes that derive from AliAnaPartCorrBaseClass
-//
-// -- Author: Gustavo Conesa (INFN-LNF)
-
-// --- ROOT system ---
-class TList;
-class TClonesArray;
-#include<TObject.h>
-class TString;
-
-// --- Analysis system ---
-#include "AliLog.h"
-class AliCaloTrackReader ;
-
-class AliAnaPartCorrMaker : public TObject {
-
-public:
-
- AliAnaPartCorrMaker() ; // default ctor
- AliAnaPartCorrMaker(const AliAnaPartCorrMaker & g) ; // cpy ctor
- AliAnaPartCorrMaker & operator = (const AliAnaPartCorrMaker & g) ;//cpy assignment
- virtual ~AliAnaPartCorrMaker() ; //virtual dtor
-
- //Setter and getters
- TList * GetOutputContainer() const {return fOutputContainer ; }
-
- Int_t GetAnaDebug() const { return fAnaDebug ; }
- void SetAnaDebug(Int_t d) { fAnaDebug = d ; }
-
- Bool_t AreHistogramsMade() const { return fMakeHisto ; }
- void SwitchOnHistogramsMaker() { fMakeHisto = kTRUE ; }
- void SwitchOffHistogramsMaker() { fMakeHisto = kFALSE ; }
-
- Bool_t AreAODsMade() const { return fMakeAOD ; }
- void SwitchOnAODsMaker() { fMakeAOD = kTRUE ; }
- void SwitchOffAODsMaker() { fMakeAOD = kFALSE ; }
-
- void SetAODBranch(TClonesArray* aodbranch) {fAODBranch = aodbranch;}
-
- void AddAnalysis(TObject* ana, Int_t n) {if ( fAnalysisContainer) fAnalysisContainer->AddAt(ana,n);
- else AliFatal("AnalysisContainer not initialized");}
-
- TString GetAODBranchName() const {return fAODBranchName;}
- void SetAODBranchName(TString name) {fAODBranchName = name ;}
-
- AliCaloTrackReader * GetReader() const {return fReader ; }
- void SetReader(AliCaloTrackReader * reader) { fReader = reader ; }
-
- //Others
- void Init();
- void InitParameters();
-
- void Print(const Option_t * opt) const;
-
- Bool_t ProcessEvent(Int_t iEntry) ;
-
- private:
-
- //General Data members
-
- TList * fOutputContainer ; // output histograms container
- TList * fAnalysisContainer ; // List with analysis pointers
- Bool_t fMakeHisto ; // If true makes final analysis with histograms as output
- Bool_t fMakeAOD ; // If true makes analysis generating AODs
- Int_t fAnaDebug; // Debugging info.
-
- AliCaloTrackReader * fReader ; // Pointer to reader
- TClonesArray* fAODBranch ; //! selected particles branch
- TString fAODBranchName; // New AOD branch name
-
- ClassDef(AliAnaPartCorrMaker,1)
-} ;
-
-
-#endif //AliAnaPartCorrMaker_H
-
-
-
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-/* $Id: $ */
-
-//_________________________________________________________________________
-// Class for the analysis of particle - hadron correlations
-// Particle (for example direct gamma) must be found in a previous analysis
-//-- Author: Gustavo Conesa (LNF-INFN)
-//////////////////////////////////////////////////////////////////////////////
-
-
-// --- ROOT system ---
-#include "Riostream.h"
-#include "TH2F.h"
-
-//---- ANALYSIS system ----
-#include "AliLog.h"
-#include "AliNeutralMesonSelection.h"
-#include "AliAnaParticleHadronCorrelation.h"
-#include "AliCaloTrackReader.h"
-
-ClassImp(AliAnaParticleHadronCorrelation)
-
-
-//____________________________________________________________________________
- AliAnaParticleHadronCorrelation::AliAnaParticleHadronCorrelation() :
- AliAnaPartCorrBaseClass(),
- fDeltaPhiMaxCut(0.), fDeltaPhiMinCut(0.),
- fhPhiCharged(0), fhPhiNeutral(0), fhEtaCharged(0), fhEtaNeutral(0),
- fhDeltaPhiCharged(0), fhDeltaPhiNeutral(0),
- fhDeltaEtaCharged(0), fhDeltaEtaNeutral(0),
- fhDeltaPhiChargedPt(0), fhDeltaPhiNeutralPt(0),
- fhPtImbalanceNeutral(0), fhPtImbalanceCharged(0)
-{
- //Default Ctor
-
- //Initialize parameters
- InitParameters();
-}
-
-//____________________________________________________________________________
-AliAnaParticleHadronCorrelation::AliAnaParticleHadronCorrelation(const AliAnaParticleHadronCorrelation & g) :
- AliAnaPartCorrBaseClass(g),
- fDeltaPhiMaxCut(g.fDeltaPhiMaxCut), fDeltaPhiMinCut(g.fDeltaPhiMinCut),
- fhPhiCharged(g.fhPhiCharged), fhPhiNeutral(g.fhPhiNeutral),
- fhEtaCharged(g.fhEtaCharged), fhEtaNeutral(g.fhEtaNeutral),
- fhDeltaPhiCharged(g.fhDeltaPhiCharged),
- fhDeltaPhiNeutral(g.fhDeltaPhiNeutral),
- fhDeltaEtaCharged(g.fhDeltaEtaCharged),
- fhDeltaEtaNeutral(g.fhDeltaEtaNeutral),
- fhDeltaPhiChargedPt(g.fhDeltaPhiChargedPt),
- fhDeltaPhiNeutralPt(g.fhDeltaPhiNeutralPt),
- fhPtImbalanceNeutral(g.fhPtImbalanceNeutral),
- fhPtImbalanceCharged(g.fhPtImbalanceCharged)
-{
- // cpy ctor
-
-}
-
-//_________________________________________________________________________
-AliAnaParticleHadronCorrelation & AliAnaParticleHadronCorrelation::operator = (const AliAnaParticleHadronCorrelation & source)
-{
- // assignment operator
-
- if(this == &source)return *this;
- ((AliAnaPartCorrBaseClass *)this)->operator=(source);
-
- fDeltaPhiMaxCut = source.fDeltaPhiMaxCut ;
- fDeltaPhiMinCut = source.fDeltaPhiMinCut ;
-
- fhPhiCharged = source.fhPhiCharged ; fhPhiNeutral = source.fhPhiNeutral ;
- fhEtaCharged = source.fhEtaCharged ; fhEtaNeutral = source.fhEtaNeutral ;
- fhDeltaPhiCharged = source.fhDeltaPhiCharged ;
- fhDeltaPhiNeutral = source.fhDeltaPhiNeutral ;
- fhDeltaPhiNeutralPt = source.fhDeltaPhiNeutralPt ;
- fhDeltaEtaCharged = source.fhDeltaEtaCharged ;
- fhDeltaEtaNeutral = source.fhDeltaEtaNeutral ;
- fhDeltaPhiChargedPt = source.fhDeltaPhiChargedPt ;
-
- fhPtImbalanceNeutral = source.fhPtImbalanceNeutral ;
- fhPtImbalanceCharged = source.fhPtImbalanceCharged ;
-
- return *this;
-
-}
-
-//________________________________________________________________________
-TList * AliAnaParticleHadronCorrelation::GetCreateOutputObjects()
-{
-
- // Create histograms to be saved in output file and
- // store them in fOutputContainer
- TList * outputContainer = new TList() ;
- outputContainer->SetName("CorrelationHistos") ;
-
- //Correlation with charged hadrons
- if(GetReader()->IsCTSSwitchedOn()) {
- fhPhiCharged = new TH2F
- ("PhiCharged","#phi_{h^{#pm}} vs p_{T trigger}",
- 120,0,120,120,0,7);
- fhPhiCharged->SetYTitle("#phi_{h^{#pm}} (rad)");
- fhPhiCharged->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhEtaCharged = new TH2F
- ("EtaCharged","#eta_{h^{#pm}} vs p_{T trigger}",
- 120,0,120,120,-1,1);
- fhEtaCharged->SetYTitle("#eta_{h^{#pm}} (rad)");
- fhEtaCharged->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhDeltaPhiCharged = new TH2F
- ("DeltaPhiCharged","#phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}",
- 200,0,120,200,0,6.4);
- fhDeltaPhiCharged->SetYTitle("#Delta #phi");
- fhDeltaPhiCharged->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhDeltaPhiChargedPt = new TH2F
- ("DeltaPhiChargedPt","#phi_{trigger} - #phi_{#p^{#pm}i} vs p_{T h^{#pm}}",
- 200,0,120,200,0,6.4);
- fhDeltaPhiChargedPt->SetYTitle("#Delta #phi");
- fhDeltaPhiChargedPt->SetXTitle("p_{T h^{#pm}} (GeV/c)");
-
- fhDeltaEtaCharged = new TH2F
- ("DeltaEtaCharged","#eta_{trigger} - #eta_{h^{#pm}} vs p_{T trigger}",
- 200,0,120,200,-2,2);
- fhDeltaEtaCharged->SetYTitle("#Delta #eta");
- fhDeltaEtaCharged->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhPtImbalanceCharged =
- new TH2F("CorrelationCharged","z_{trigger h^{#pm}} = p_{T h^{#pm}} / p_{T trigger}",
- 240,0.,120.,1000,0.,1.2);
- fhPtImbalanceCharged->SetYTitle("z_{trigger h^{#pm}}");
- fhPtImbalanceCharged->SetXTitle("p_{T trigger}");
-
- outputContainer->Add(fhPhiCharged) ;
- outputContainer->Add(fhEtaCharged) ;
- outputContainer->Add(fhDeltaPhiCharged) ;
- outputContainer->Add(fhDeltaEtaCharged) ;
- outputContainer->Add(fhPtImbalanceCharged) ;
- outputContainer->Add(fhDeltaPhiChargedPt) ;
- } //Correlation with charged hadrons
-
- //Correlation with neutral hadrons
- if(GetReader()->IsEMCALSwitchedOn() || GetReader()->IsPHOSSwitchedOn()){
-
- fhPhiNeutral = new TH2F
- ("PhiNeutral","#phi_{#pi^{0}} vs p_{T trigger}",
- 120,0,120,120,0,7);
- fhPhiNeutral->SetYTitle("#phi_{#pi^{0}} (rad)");
- fhPhiNeutral->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhEtaNeutral = new TH2F
- ("EtaNeutral","#eta_{#pi^{0}} vs p_{T trigger}",
- 120,0,120,120,-1,1);
- fhEtaNeutral->SetYTitle("#eta_{#pi^{0}} (rad)");
- fhEtaNeutral->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhDeltaPhiNeutral = new TH2F
- ("DeltaPhiNeutral","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T trigger}",
- 200,0,120,200,0,6.4);
- fhDeltaPhiNeutral->SetYTitle("#Delta #phi");
- fhDeltaPhiNeutral->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhDeltaPhiNeutralPt = new TH2F
- ("DeltaPhiNeutralPt","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T #pi^{0}}}",
- 200,0,120,200,0,6.4);
- fhDeltaPhiNeutralPt->SetYTitle("#Delta #phi");
- fhDeltaPhiNeutralPt->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhDeltaEtaNeutral = new TH2F
- ("DeltaEtaNeutral","#eta_{trigger} - #eta_{#pi^{0}} vs p_{T trigger}",
- 200,0,120,200,-2,2);
- fhDeltaEtaNeutral->SetYTitle("#Delta #eta");
- fhDeltaEtaNeutral->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhPtImbalanceNeutral =
- new TH2F("CorrelationNeutral","z_{trigger #pi} = p_{T #pi^{0}} / p_{T trigger}",
- 240,0.,120.,1000,0.,1.2);
- fhPtImbalanceNeutral->SetYTitle("z_{trigger #pi^{0}}");
- fhPtImbalanceNeutral->SetXTitle("p_{T trigger}");
-
- outputContainer->Add(fhPhiNeutral) ;
- outputContainer->Add(fhEtaNeutral) ;
- outputContainer->Add(fhDeltaPhiNeutral) ;
- outputContainer->Add(fhDeltaEtaNeutral) ;
- outputContainer->Add(fhPtImbalanceNeutral) ;
-
-
- //Keep neutral meson selection histograms if requiered
- //Setting done in AliNeutralMesonSelection
- if(GetNeutralMesonSelection()){
- TList * nmsHistos = GetNeutralMesonSelection()->GetCreateOutputObjects() ;
- cout<<"NMSHistos "<< nmsHistos<<endl;
- if(GetNeutralMesonSelection()->AreNeutralMesonSelectionHistosKept())
- for(Int_t i = 0; i < nmsHistos->GetEntries(); i++) outputContainer->Add(nmsHistos->At(i)) ;
- }
-
- }//Correlation with neutral hadrons
-
- return outputContainer;
-}
-
- //____________________________________________________________________________
-void AliAnaParticleHadronCorrelation::InitParameters()
-{
-
- //Initialize the parameters of the analysis.
-
- SetPtCutRange(2,300);
- fDeltaPhiMinCut = 1.5 ;
- fDeltaPhiMaxCut = 4.5 ;
-
-}
-
-//__________________________________________________________________
-void AliAnaParticleHadronCorrelation::Print(const Option_t * opt) const
-{
-
- //Print some relevant parameters set for the analysis
- if(! opt)
- return;
-
- Info("*** Print *** ", "%s %s", GetName(), GetTitle() ) ;
- printf("pT Hadron > %2.2f\n", GetMinPt()) ;
- printf("pT Hadron < %2.2f\n", GetMaxPt()) ;
- printf("Phi trigger particle-Hadron < %3.2f\n", fDeltaPhiMaxCut) ;
- printf("Phi trigger particle-Hadron > %3.2f\n", fDeltaPhiMinCut) ;
-
-
-}
-
-//____________________________________________________________________________
-void AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD()
-{
- //Particle-Hadron Correlation Analysis, fill AODs
- if(GetDebug() > 1){
- printf("Begin hadron correlation analysis, fill AODs \n");
- printf("In particle branch aod entries %d\n", GetAODBranch()->GetEntriesFast());
- printf("In CTS aod entries %d\n", GetAODCTS()->GetEntriesFast());
- printf("In EMCAL aod entries %d\n", GetAODEMCAL()->GetEntriesFast());
- printf("In PHOS aod entries %d\n", GetAODPHOS()->GetEntriesFast());
- }
-
- //Loop on stored AOD particles, trigger
- Int_t naod = GetAODBranch()->GetEntriesFast();
- for(Int_t iaod = 0; iaod < naod ; iaod++){
- AliAODParticleCorrelation* particle = dynamic_cast<AliAODParticleCorrelation*> (GetAODBranch()->At(iaod));
- //Make correlation with charged hadrons
- if(GetReader()->IsCTSSwitchedOn() )
- MakeChargedCorrelation(particle, (TSeqCollection*)GetAODCTS(),kFALSE);
-
- //Make correlation with neutral pions
- //Trigger particle in PHOS, correlation with EMCAL
- if(particle->GetDetector()=="PHOS" && GetReader()->IsEMCALSwitchedOn() && GetAODEMCAL()->GetEntriesFast() > 0)
- MakeNeutralCorrelation(particle,(TSeqCollection*)GetAODEMCAL(),kFALSE);
- //Trigger particle in EMCAL, correlation with PHOS
- else if(particle->GetDetector()=="EMCAL" && GetReader()->IsPHOSSwitchedOn() && GetAODPHOS()->GetEntriesFast() > 0)
- MakeNeutralCorrelation(particle,(TSeqCollection*)GetAODPHOS(),kFALSE);
- //Trigger particle in CTS, correlation with PHOS, EMCAL and CTS
- else if(particle->GetDetector()=="CTS" ){
- if(GetReader()->IsPHOSSwitchedOn() && GetAODPHOS()->GetEntriesFast() > 0)
- MakeNeutralCorrelation(particle,(TSeqCollection*)GetAODPHOS(),kFALSE);
- if(GetReader()->IsEMCALSwitchedOn() && GetAODEMCAL()->GetEntriesFast() > 0)
- MakeNeutralCorrelation(particle,(TSeqCollection*)GetAODEMCAL(),kFALSE);
- }
-
- }//Aod branch loop
-
- if(GetDebug() > 1) printf("End hadron correlation analysis, fill AODs \n");
-
-}
-
-//____________________________________________________________________________
-void AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms()
-{
- //Particle-Hadron Correlation Analysis, fill AODs
- if(GetDebug() > 1){
- printf("Begin hadron correlation analysis, fill histograms \n");
- printf("In particle branch aod entries %d\n", GetAODBranch()->GetEntriesFast());
- }
-
- //Loop on stored AOD particles
- Int_t naod = GetAODBranch()->GetEntriesFast();
- for(Int_t iaod = 0; iaod < naod ; iaod++){
- AliAODParticleCorrelation* particle = dynamic_cast<AliAODParticleCorrelation*> (GetAODBranch()->At(iaod));
-
- if(GetDebug() > 1){
- printf("Particle %d, In Track Refs entries %d\n", iaod, (particle->GetRefTracks())->GetEntriesFast());
- printf("Particle %d, In Cluster Refs entries %d\n",iaod, (particle->GetRefClusters())->GetEntriesFast());
- }
-
- //Make correlation with charged hadrons
- if((particle->GetRefTracks())->GetEntriesFast() > 0)
- MakeChargedCorrelation(particle, (TSeqCollection*) (particle->GetRefTracks()),kTRUE);
-
- //Make correlation with neutral pions
- if((particle->GetRefClusters())->GetEntriesFast() > 0)
- MakeNeutralCorrelation(particle, (TSeqCollection*) (particle->GetRefClusters()), kTRUE);
-
- }//Aod branch loop
-
- if(GetDebug() > 1) printf("End hadron correlation analysis, fill histograms \n");
-
-}
-
-//____________________________________________________________________________
-void AliAnaParticleHadronCorrelation::MakeChargedCorrelation(AliAODParticleCorrelation *aodParticle, TSeqCollection* pl, const Bool_t bFillHisto)
-{
- // Charged Hadron Correlation Analysis
- if(GetDebug() > 1)printf("Make trigger particle - charged hadron correlation \n");
-
- Double_t ptTrig = aodParticle->Pt();
- Double_t phiTrig = aodParticle->Phi();
- Double_t pt = -100.;
- Double_t rat = -100.;
- Double_t phi = -100. ;
- Double_t eta = -100. ;
- Double_t p[3];
-
- //Track loop, select tracks with good pt, phi and fill AODs or histograms
- for(Int_t ipr = 0;ipr < pl->GetEntries() ; ipr ++ ){
- AliAODTrack * track = dynamic_cast<AliAODTrack *>(pl->At(ipr)) ;
- track->GetPxPyPz(p) ;
- TLorentzVector mom(p[0],p[1],p[2],0);
- pt = mom.Pt();
- eta = mom.Eta();
- phi = mom.Phi() ;
- if(phi<0) phi+=TMath::TwoPi();
- rat = pt/ptTrig ;
-
- if(IsFidutialCutOn()){
- Bool_t in = GetFidutialCut()->IsInFidutialCut(mom,"CTS") ;
- if(! in ) continue ;
- }
-
- //Select only hadrons in pt range
- if(pt < GetMinPt() || pt > GetMaxPt()) continue ;
-
- if(GetDebug() > 2)
- printf("charged hadron: pt %f, phi %f, phi trigger %f. Cuts: delta phi min %2.2f, max%2.2f, pT min %2.2f \n",
- pt,phi,phiTrig,fDeltaPhiMinCut, fDeltaPhiMaxCut, GetMinPt());
-
- if(bFillHisto){
- // Fill Histograms
- fhEtaCharged->Fill(ptTrig,eta);
- fhPhiCharged->Fill(ptTrig,phi);
- fhDeltaEtaCharged->Fill(ptTrig,aodParticle->Eta()-eta);
- fhDeltaPhiCharged->Fill(ptTrig,phiTrig-phi);
- fhDeltaPhiChargedPt->Fill(pt,phiTrig-phi);
- //Selection within angular range
- if(((phiTrig-phi)> fDeltaPhiMinCut) && ((phiTrig-phi)<fDeltaPhiMaxCut) ){
- if(GetDebug() > 2 ) printf("Selected charge for momentum imbalance: pt %2.2f, phi %2.2f, eta %2.2f ",pt,phi,eta);
- fhPtImbalanceCharged->Fill(ptTrig,rat);
- }
- }
- else{
- //Fill AODs
- aodParticle->AddTrack(track);
-
- }//aod particle loop
- }// track loop
-
-}
-//____________________________________________________________________________
-void AliAnaParticleHadronCorrelation::MakeNeutralCorrelation(AliAODParticleCorrelation * aodParticle,TSeqCollection* pl, const Bool_t bFillHisto)
-{
- // Neutral Pion Correlation Analysis
- if(GetDebug() > 1) printf("Make trigger particle - neutral hadron correlation \n");
-
- Double_t pt = -100.;
- Double_t rat = -100.;
- Double_t phi = -100. ;
- Double_t eta = -100. ;
- Double_t ptTrig = aodParticle->Pt();
- Double_t phiTrig = aodParticle->Phi();
- Double_t etaTrig = aodParticle->Eta();
-
- TLorentzVector gammai;
- TLorentzVector gammaj;
-
- Double_t vertex[] = {0,0,0};
-
- if(!GetReader()->GetDataType()== AliCaloTrackReader::kMC) GetReader()->GetVertex(vertex);
-
- //Cluster loop, select pairs with good pt, phi and fill AODs or histograms
- for(Int_t iclus = 0;iclus < pl->GetEntries() ; iclus ++ ){
- AliAODCaloCluster * calo = dynamic_cast< AliAODCaloCluster *>(pl->At(iclus)) ;
- if(!bFillHisto){
-
- //Cluster selection, not charged, with photon or pi0 id and in fidutial cut
- Int_t pdg=0;
- if(!SelectCluster(calo, vertex, gammai, pdg)) continue ;
-
- if(GetDebug() > 2)
- printf("neutral cluster: pt %f, phi %f, phi trigger %f. Cuts: delta phi min %2.2f, max%2.2f, pT min %2.2f \n",
- gammai.Pt(),gammai.Phi(),phiTrig,fDeltaPhiMinCut, fDeltaPhiMaxCut, GetMinPt());
-
- //2 gamma overlapped, found with PID
- if(pdg == AliCaloPID::kPi0){
-
- //Select only hadrons in pt range
- if(gammai.Pt() < GetMinPt() || gammai.Pt() > GetMaxPt()) continue ;
-
- aodParticle->AddCluster(calo);
- if(GetDebug() > 2) printf("Correlated with selected pi0 (pid): pt %f, phi %f",gammai.Pt(),gammai.Phi());
-
- }// pdg = 111
-
- //Make invariant mass analysis
- else if(pdg == AliCaloPID::kPhoton){
- //Search the photon companion in case it comes from a Pi0 decay
- //Apply several cuts to select the good pair;
- for(Int_t jclus = iclus+1; jclus < pl->GetEntries() ; jclus ++ ){
- AliAODCaloCluster * calo2 = dynamic_cast< AliAODCaloCluster *>(pl->At(jclus)) ;
-
- //Cluster selection, not charged with photon or pi0 id and in fidutial cut
- Int_t pdgj=0;
- if(!SelectCluster(calo2,vertex, gammaj, pdgj)) continue ;
-
- if(pdgj == AliCaloPID::kPhoton ){
-
- if((gammai+gammaj).Pt() < GetMinPt() || (gammai+gammaj).Pt() > GetMaxPt()) continue ;
-
- //Select good pair (aperture and invariant mass)
- if(GetNeutralMesonSelection()->SelectPair(gammai, gammaj)){
-
- if(GetDebug() > 2 ) printf("Neutral Hadron Correlation: AOD Selected gamma pair: pt %2.2f, phi %2.2f, eta %2.2f, M %2.3f",
- (gammai+gammaj).Pt(),(gammai+gammaj).Phi(),(gammai+gammaj).Eta(), (gammai+gammaj).M());
- Int_t labels[]={calo->GetLabel(0),calo2->GetLabel(0)};
- Float_t pid[]={0,0,0,0,0,0,1,0,0,0,0,0,0};//Pi0 weight 1
- Float_t pos[]={(gammai+gammaj).X(), (gammai+gammaj).Y(), (gammai+gammaj).Z()};
-
- AliAODCaloCluster *caloCluster = new AliAODCaloCluster(0,2,labels,(gammai+gammaj).E(), pos, pid,calo->GetType(),0);
- aodParticle->AddCluster(caloCluster);
- }//Pair selected
- }//if pair of gammas
- }//2nd loop
- }// if pdg = 22
- }// Fill AODs
- else{ //Fill histograms
-
- calo->GetMomentum(gammai,vertex);//Assume that come from vertex in straight line
- pt = gammai.Pt();
-
- if(pt < GetMinPt() || pt > GetMaxPt()) continue ;
-
- rat = pt/ptTrig ;
- phi = gammai.Phi() ;
- eta = gammai.Eta() ;
-
- if(GetDebug() > 2 ) printf("Neutral Hadron Correlation: Histograms selected gamma pair: pt %2.2f, phi %2.2f, eta %2.2f",pt,phi,eta);
-
- fhEtaNeutral->Fill(ptTrig,eta);
- fhPhiNeutral->Fill(ptTrig,phi);
- fhDeltaEtaNeutral->Fill(ptTrig,etaTrig-eta);
- fhDeltaPhiNeutral->Fill(ptTrig,phiTrig-phi);
- fhDeltaPhiNeutralPt->Fill(pt,phiTrig-phi);
- //Selection within angular range
- if(((phiTrig-phi)> fDeltaPhiMinCut) && ((phiTrig-phi)<fDeltaPhiMaxCut) ){
- if(GetDebug() > 2 ) printf("Selected neutral for momentum imbalance: pt %2.2f, phi %2.2f, eta %2.2f ",pt,phi,eta);
- fhPtImbalanceNeutral->Fill(ptTrig,rat);
- }
- }//Fill histograms
- }//1st loop
-
-}
-
-//____________________________________________________________________________
-Bool_t AliAnaParticleHadronCorrelation::SelectCluster(AliAODCaloCluster * calo, Double_t *vertex, TLorentzVector & mom, Int_t & pdg){
- //Select cluster depending on its pid and acceptance selections
-
- //Skip matched clusters with tracks
- if(calo->GetNTracksMatched() > 0) {
- return kFALSE;}
-
- //Check PID
- calo->GetMomentum(mom,vertex);//Assume that come from vertex in straight line
- pdg = AliCaloPID::kPhoton;
- if(IsCaloPIDOn()){
- //Get most probable PID, 2 options check PID weights (in MC this option is mandatory)
- //or redo PID, recommended option for EMCal.
- TString detector = "";
- if(calo->IsPHOSCluster()) detector= "PHOS";
- else if(calo->IsEMCALCluster()) detector= "EMCAL";
-
- if(!IsCaloPIDRecalculationOn() || GetReader()->GetDataType() == AliCaloTrackReader::kMC )
- pdg = GetCaloPID()->GetPdg(detector,calo->PID(),mom.E());//PID with weights
- else
- pdg = GetCaloPID()->GetPdg(detector,mom,calo->GetM02(),0,0,0,0);//PID recalculated
-
- if(GetDebug() > 1) printf("PDG of identified particle %d\n",pdg);
-
- //If it does not pass pid, skip
- if(pdg != AliCaloPID::kPhoton || pdg != AliCaloPID::kPi0) {
- return kFALSE ;
- }
- }
-
- //Check acceptance selection
- if(IsFidutialCutOn()){
- Bool_t in = kFALSE;
- if(calo->IsPHOSCluster())
- in = GetFidutialCut()->IsInFidutialCut(mom,"PHOS") ;
- else if(calo->IsEMCALCluster())
- in = GetFidutialCut()->IsInFidutialCut(mom,"EMCAL") ;
- if(! in ) { return kFALSE ;}
- }
-
- if(GetDebug() > 1) printf("Correlation photon selection cuts passed: pT %3.2f, pdg %d\n",mom.Pt(), pdg);
-
- return kTRUE;
-
- }
+++ /dev/null
-#ifndef AliAnaParticleHadronCorrelation_H
-#define AliAnaParticleHadronCorrelation_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-/* $Id: $ */
-
-//_________________________________________________________________________
-// Class that contains the algorithm for the analysis of particle - hadron correlations
-// Particle (for example direct gamma) must be found in a previous analysis
-//-- Author: Gustavo Conesa (INFN-LNF)
-
-// --- ROOT system ---
-class TH2F;
-
-// --- Analysis system ---
-#include "AliAnaPartCorrBaseClass.h"
-
-class AliAnaParticleHadronCorrelation : public AliAnaPartCorrBaseClass {
-
-public:
-
- AliAnaParticleHadronCorrelation() ; // default ctor
- AliAnaParticleHadronCorrelation(const AliAnaParticleHadronCorrelation & ph) ; // cpy ctor
- AliAnaParticleHadronCorrelation & operator = (const AliAnaParticleHadronCorrelation & ph) ;//cpy assignment
- virtual ~AliAnaParticleHadronCorrelation() {;} //virtual dtor
-
- TList * GetCreateOutputObjects();
-
- Double_t GetDeltaPhiMaxCut() const {return fDeltaPhiMaxCut ; }
- Double_t GetDeltaPhiMinCut() const {return fDeltaPhiMinCut ; }
- void SetDeltaPhiCutRange(Double_t phimin, Double_t phimax)
- {fDeltaPhiMaxCut =phimax; fDeltaPhiMinCut =phimin;}
-
- void InitParameters();
-
- void Print(const Option_t * opt) const;
-
- void MakeChargedCorrelation(AliAODParticleCorrelation * aodParticle,TSeqCollection* pl, const Bool_t bFillHisto) ;
- void MakeNeutralCorrelation(AliAODParticleCorrelation * aodParticle,TSeqCollection* pl, const Bool_t bFillHisto) ;
-
- void MakeAnalysisFillAOD() ;
-
- void MakeAnalysisFillHistograms() ;
-
- Bool_t SelectCluster(AliAODCaloCluster * calo, Double_t *vertex, TLorentzVector & mom, Int_t & pdg);
-
- private:
-
- Double_t fDeltaPhiMaxCut ; // Minimum Delta Phi Gamma-Hadron
- Double_t fDeltaPhiMinCut ; // Maximum Delta Phi Gamma-Hadron
-
- //Histograms
- TH2F * fhPhiCharged ; //! Phi distribution of selected charged particles
- TH2F * fhPhiNeutral ; //! Phi distribution of selected neutral particles
- TH2F * fhEtaCharged ; //! Eta distribution of selected charged particles
- TH2F * fhEtaNeutral ; //! Eta distribution of selected neutral particles
- TH2F * fhDeltaPhiCharged ; //! Difference of charged particle phi and trigger particle phi as function of trigger particle pT
- TH2F * fhDeltaPhiNeutral ; //! Difference of neutral particle phi and trigger particle phi as function of trigger particle pT
- TH2F * fhDeltaEtaCharged ; //! Difference of charged particle eta and trigger particle eta as function of trigger particle pT
- TH2F * fhDeltaEtaNeutral ; //! Difference of neutral particle eta and trigger particle eta as function of trigger particle pT
- TH2F * fhDeltaPhiChargedPt ; //! Difference of charged particle phi and trigger particle phi as function of charged particle pT
- TH2F * fhDeltaPhiNeutralPt ; //! Difference of neutral particle phi and trigger particle phi as function of neutral particle particle pT
-
- TH2F * fhPtImbalanceNeutral ; //! Trigger particle - neutral hadron momentum imbalance histogram
- TH2F * fhPtImbalanceCharged ; //! Trigger particle -charged hadron momentim imbalance histogram
-
- ClassDef(AliAnaParticleHadronCorrelation,1)
-} ;
-
-
-#endif //AliAnaParticleHadronCorrelation_H
-
-
-
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-/* $Id: AliAnaParticleJetFinderCorrelation.cxx 22232 2007-11-17 16:39:49Z gustavo $ */
-
-//_________________________________________________________________________
-// Class for the analysis of particle (direct gamma) -jet (jet found with finder) correlations
-//*-- Author: Gustavo Conesa (LNF-INFN)
-//////////////////////////////////////////////////////////////////////////////
-
-
-// --- ROOT system ---
-#include "TH2F.h"
-#include "Riostream.h"
-
-//---- AliRoot system ----
-#include "AliCaloTrackReader.h"
-#include "AliAODJet.h"
-#include "AliAnaParticleJetFinderCorrelation.h"
-#include "AliLog.h"
-
- ClassImp(AliAnaParticleJetFinderCorrelation)
-
-
-//____________________________________________________________________________
- AliAnaParticleJetFinderCorrelation::AliAnaParticleJetFinderCorrelation() :
- AliAnaPartCorrBaseClass(),
- fDeltaPhiMaxCut(0.), fDeltaPhiMinCut(0.), fRatioMaxCut(0.), fRatioMinCut(0.),
- fConeSize(0), fPtThresholdInCone(0),fUseJetRefTracks(0), fMakeCorrelationInHistoMaker(0),
- fhDeltaEta(0), fhDeltaPhi(0), fhDeltaPt(0), fhPtRatio(0), fhPt(0),
- fhFFz(0),fhFFxi(0),fhFFpt(0),fhNTracksInCone(0)
-{
- //Default Ctor
-
- //Initialize parameters
- InitParameters();
-}
-
-//____________________________________________________________________________
-AliAnaParticleJetFinderCorrelation::AliAnaParticleJetFinderCorrelation(const AliAnaParticleJetFinderCorrelation & pjf) :
- AliAnaPartCorrBaseClass(pjf),
- fDeltaPhiMaxCut(pjf.fDeltaPhiMaxCut), fDeltaPhiMinCut(pjf.fDeltaPhiMinCut),
- fRatioMaxCut(pjf.fRatioMaxCut), fRatioMinCut(pjf.fRatioMinCut),
- fConeSize(pjf.fConeSize), fPtThresholdInCone(pjf.fPtThresholdInCone),
- fUseJetRefTracks(pjf.fUseJetRefTracks), fMakeCorrelationInHistoMaker(pjf.fMakeCorrelationInHistoMaker),
- fhDeltaEta(pjf.fhDeltaEta), fhDeltaPhi(pjf.fhDeltaPhi),
- fhDeltaPt(pjf.fhDeltaPt), fhPtRatio(pjf.fhPtRatio), fhPt(pjf.fhPt),
- fhFFz(pjf.fhFFz),fhFFxi(pjf.fhFFxi),fhFFpt(pjf.fhFFpt),
- fhNTracksInCone(pjf.fhNTracksInCone)
-{
- // cpy ctor
-
-}
-
-//_________________________________________________________________________
-AliAnaParticleJetFinderCorrelation & AliAnaParticleJetFinderCorrelation::operator = (const AliAnaParticleJetFinderCorrelation & pjf)
-{
- // assignment operator
-
- if(this == &pjf)return *this;
- ((AliAnaPartCorrBaseClass *)this)->operator=(pjf);
-
- fDeltaPhiMaxCut = pjf.fDeltaPhiMaxCut ;
- fDeltaPhiMinCut = pjf.fDeltaPhiMinCut ;
- fRatioMaxCut = pjf.fRatioMaxCut ;
- fRatioMinCut = pjf.fRatioMinCut ;
- fConeSize = pjf.fConeSize ;
- fPtThresholdInCone = pjf.fPtThresholdInCone ;
- fUseJetRefTracks = pjf.fUseJetRefTracks ;
- fMakeCorrelationInHistoMaker = pjf.fMakeCorrelationInHistoMaker ;
-
- //Histograms
- fhDeltaEta = pjf.fhDeltaEta;
- fhDeltaPhi = pjf.fhDeltaPhi;
- fhDeltaPt = pjf.fhDeltaPt;
- fhPtRatio = pjf.fhPtRatio;
- fhPt = pjf.fhPt;
-
- fhFFz = pjf.fhFFz;
- fhFFxi = pjf.fhFFxi;
- fhFFpt = pjf.fhFFpt;
- fhNTracksInCone = pjf.fhNTracksInCone;
-
- return *this;
-
-}
-
-//____________________________________________________________________________
-//AliAnaParticleJetFinderCorrelation::~AliAnaParticleJetFinderCorrelation()
-//{
-// // Remove all pointers except analysis output pointers.
-//
-//}
-
-
-//________________________________________________________________________
-TList * AliAnaParticleJetFinderCorrelation::GetCreateOutputObjects()
-{
- // Create histograms to be saved in output file and
- // store them in fOutputContainer
-
- if(GetDebug()>1) printf("Init histograms \n");
-
- TList * outputContainer = new TList() ;
- outputContainer->SetName("ParticleJetFinderHistos") ;
-
- fhDeltaPhi = new TH2F("DeltaPhi","#phi_{jet} - #phi_{trigger} vs p_{T trigger}",120,0,120,200,-4,4);
- fhDeltaPhi->SetYTitle("#Delta #phi");
- fhDeltaPhi->SetXTitle("p_{T trigger} (GeV/c)");
- outputContainer->Add(fhDeltaPhi);
-
- fhDeltaEta = new TH2F("DeltaEta","#eta_{jet} - #eta_{trigger} vs p_{T trigger}",120,0,120,200,-5,5);
- fhDeltaEta->SetYTitle("#Delta #eta");
- fhDeltaEta->SetXTitle("p_{T trigger} (GeV/c)");
- outputContainer->Add(fhDeltaEta);
-
- fhDeltaPt = new TH2F("DeltaPt","#p_{T trigger} - #p_{T jet} vs p_{T trigger}",120,0,120,200,-100,100);
- fhDeltaPt->SetYTitle("#Delta #p_{T}");
- fhDeltaPt->SetXTitle("p_{T trigger} (GeV/c)");
- outputContainer->Add(fhDeltaPt);
-
- fhPtRatio = new TH2F("PtRatio","#p_{T jet} / #p_{T trigger} vs p_{T trigger}",120,0,120,200,0,2.);
- fhPtRatio->SetYTitle("ratio");
- fhPtRatio->SetXTitle("p_{T trigger} (GeV/c)");
- outputContainer->Add(fhPtRatio);
-
- fhPt = new TH2F("Pt","#p_{T jet} vs p_{T trigger}",120,0,120,120,0,120);
- fhPt->SetYTitle("#p_{T jet}(GeV/c)");
- fhPt->SetXTitle("p_{T trigger} (GeV/c)");
- outputContainer->Add(fhPt);
-
- fhFFz = new TH2F("FFz","z = p_{T i charged}/p_{T trigger} vs p_{T trigger}", 120,0.,120.,200,0.,2);
- fhFFz->SetYTitle("z");
- fhFFz->SetXTitle("p_{T trigger}");
- outputContainer->Add(fhFFz) ;
-
- fhFFxi = new TH2F("FFxi","#xi = ln(p_{T trigger}/p_{T i charged}) vs p_{T trigger}", 120,0.,120.,100,0.,10.);
- fhFFxi->SetYTitle("#xi");
- fhFFxi->SetXTitle("p_{T trigger}");
- outputContainer->Add(fhFFxi) ;
-
- fhFFpt = new TH2F("FFpt","#xi = p_{T i charged}) vs p_{T trigger}", 120,0.,120.,200,0.,50.);
- fhFFpt->SetYTitle("p_{T charged hadron}");
- fhFFpt->SetXTitle("p_{T trigger}");
- outputContainer->Add(fhFFpt) ;
-
- fhNTracksInCone = new TH2F("NTracksInCone","#xi = p_{T i charged}) vs p_{T trigger}", 120,0.,120.,200,0.,50.);
- fhNTracksInCone->SetYTitle("p_{T charged hadron}");
- fhNTracksInCone->SetXTitle("p_{T trigger}");
- outputContainer->Add(fhNTracksInCone) ;
-
- return outputContainer;
-}
-
- //____________________________________________________________________________
-void AliAnaParticleJetFinderCorrelation::InitParameters()
-{
-
- //Initialize the parameters of the analysis.
-
- fDeltaPhiMinCut = 1.5 ;
- fDeltaPhiMaxCut = 4.5 ;
- fRatioMaxCut = 1.2 ;
- fRatioMinCut = 0.3 ;
- fConeSize = 0.3 ;
- fPtThresholdInCone = 0.5 ;
- fUseJetRefTracks = kFALSE ;
- fMakeCorrelationInHistoMaker = kFALSE ;
- }
-
-//__________________________________________________________________
-Int_t AliAnaParticleJetFinderCorrelation::SelectJet(AliAODParticleCorrelation * particle)
-{
- //Returns the index of the jet that is opposite to the particle
-
- Int_t njets = (GetReader()->GetAOD())->GetNJets() ;
- cout<<">> Loop on Jets"<<endl;
- AliAODJet * jet = new AliAODJet ;
- Int_t index = -1;
- for(Int_t ijet = 0; ijet < njets ; ijet++){
- jet = (GetReader()->GetAOD())->GetJet(ijet) ;
- Float_t dphi = TMath::Abs(particle->Phi()-jet->Phi());
- Float_t ratio = jet->Pt()/particle->Pt();
- if(GetDebug() > 3)
- printf("Jet %d, Ratio pT %2.3f, Delta phi %2.3f\n",ijet,ratio,dphi);
- Float_t dphiprev= 10000;
- if((dphi > fDeltaPhiMinCut) && (dphi<fDeltaPhiMaxCut) &&
- (ratio > fRatioMinCut) && (ratio < fRatioMaxCut) &&
- (TMath::Abs(dphi-3.14159) < TMath::Abs(dphiprev-3.14159))){//In case there is more than one jet select the most opposite.
- dphiprev = dphi;
- index = ijet ;
- }//Selection cuts
- }//AOD Jet loop
-
- return index ;
-
-}
-
-//__________________________________________________________________
-void AliAnaParticleJetFinderCorrelation::MakeAnalysisFillAOD()
-{
- //Particle-Jet Correlation Analysis, fill AODs
-
- Int_t ntrig = GetAODBranch()->GetEntriesFast() ;
- if(GetDebug() > -3){
- printf("Begin jet finder correlation analysis, fill AODs \n");
- printf("In particle branch aod entries %d\n", ntrig);
- printf("In jet branch aod entries %d\n", (GetReader()->GetAOD())->GetNJets());
- }
-
- //Loop on stored AOD particles, trigger
- for(Int_t iaod = 0; iaod < ntrig ; iaod++){
- AliAODParticleCorrelation* particle = dynamic_cast<AliAODParticleCorrelation*> (GetAODBranch()->At(iaod));
- //cout<<">> Test reference "<<particle->GetRefJet()<<endl;
- //Correlate with jets
- Int_t ijet = SelectJet(particle);
- if(ijet > -1){
- if(GetDebug() > 2) printf ("Jet with index %d selected \n",ijet);
- AliAODJet *jet = (GetReader()->GetAOD())->GetJet(ijet);
- particle->SetRefJet(jet);
- }
- }
-
- if(GetDebug() >1)printf("End of jet leading cone analysis, fill AODs \n");
-}
-
-//__________________________________________________________________
-void AliAnaParticleJetFinderCorrelation::MakeAnalysisFillHistograms()
-{
- //Particle-Jet Correlation Analysis, fill histograms
- Int_t ntrig = GetAODBranch()->GetEntriesFast() ;
- if(GetDebug() > 1){
- printf("Begin jet finder correlation analysis, fill histograms \n");
- printf("In particle branch aod entries %d\n", ntrig);
- printf("In jet branch aod entries %d\n", (GetReader()->GetAOD())->GetNJets());
- }
-
- //Loop on stored AOD particles, trigger
- for(Int_t iaod = 0; iaod < ntrig ; iaod++){
- AliAODParticleCorrelation* particle = dynamic_cast<AliAODParticleCorrelation*> (GetAODBranch()->At(iaod));
- //cout<<">> Test reference "<<particle->GetRefJet()<<endl;
-
- //Recover the jet correlated, found previously.
- AliAODJet * jet = particle->GetJet();
- //If correlation not made before, do it now.
- if(fMakeCorrelationInHistoMaker){
- //Correlate with jets
- Int_t ijet = SelectJet(particle);
- if(ijet > -1){
- if(GetDebug() > 2) printf ("Jet with index %d selected \n",ijet);
- jet = (GetReader()->GetAOD())->GetJet(ijet);
- particle->SetRefJet(jet);
- }
- }
-
- if (!jet) continue ;
-
- //Fill Histograms
-
- Double_t ptTrig = particle->Pt();
- Double_t ptJet = jet->Pt();
- Double_t phiTrig = particle->Phi();
- Double_t phiJet = jet->Phi();
- Double_t etaTrig = particle->Eta();
- Double_t etaJet = jet->Eta();
- //printf("pT trigger %2.3f, pT jet %2.3f, Delta phi %2.3f, Delta eta %2.3f, Delta pT %2.3f, ratio %2.3f \n",
- // ptTrig,ptJet, phiJet-phiTrig, etaJet-etaTrig, ptTrig-ptJet, ptJet/ptTrig);
- fhDeltaPt ->Fill(ptTrig, ptTrig-ptJet);
- fhDeltaPhi->Fill(ptTrig, phiJet-phiTrig);
- fhDeltaEta->Fill(ptTrig, etaJet-etaTrig);
- fhPtRatio ->Fill(ptTrig, ptJet/ptTrig);
- fhPt ->Fill(ptTrig, ptJet);
-
- //Fragmentation function
- Float_t rad = 0, pt = 0, eta = 0, phi = 0;
- Int_t npartcone = 0;
- TVector3 p3;
- AliAODTrack* track = new AliAODTrack ;
-
- Int_t ntracks = 0;
- if(!fUseJetRefTracks)
- ntracks =GetAODCTS()->GetEntriesFast();
- else //If you want to use jet tracks from JETAN
- ntracks = (jet->GetRefTracks())->GetEntriesFast();
-
- for(Int_t ipr = 0;ipr < ntracks ; ipr ++ ){
- if(!fUseJetRefTracks)
- track = dynamic_cast<AliAODTrack *>(GetAODCTS()->At(ipr)) ;
- else //If you want to use jet tracks from JETAN
- track = dynamic_cast<AliAODTrack *>((jet->GetRefTracks())->At(ipr));
-
- p3.SetXYZ(track->Px(),track->Py(),track->Pz());
- pt = p3.Pt();
- eta = p3.Eta();
- phi = p3.Phi() ;
- if(phi < 0) phi+=TMath::TwoPi();
-
- //Check if there is any particle inside cone with pt larger than fPtThreshold
- rad = TMath::Sqrt((eta-etaJet)*(eta-etaJet)+ (phi-phiJet)*(phi-phiJet));
- if(rad < fConeSize && pt > fPtThresholdInCone){
- //printf("charged in jet cone pt %f, phi %f, eta %f, R %f \n",pt,phi,eta,rad);
- npartcone++;
- fhFFz ->Fill(ptTrig, pt/ptTrig);
- fhFFxi->Fill(ptTrig, TMath::Log(ptTrig/pt));
- fhFFpt->Fill(ptTrig, pt);
- }
- }//Tracks
- fhNTracksInCone->Fill(ptTrig, npartcone);
- }//AOD trigger particle loop
- if(GetDebug() >1) printf("End of jet leading cone analysis, fill histograms \n");
-}
-
-
-//__________________________________________________________________
-void AliAnaParticleJetFinderCorrelation::Print(const Option_t * opt) const
-{
-
- //Print some relevant parameters set for the analysis
- if(! opt)
- return;
-
- printf("Phi trigger-jet < %3.2f\n", fDeltaPhiMaxCut) ;
- printf("Phi trigger-jet > %3.2f\n", fDeltaPhiMinCut) ;
- printf("pT Ratio trigger/jet < %3.2f\n", fRatioMaxCut) ;
- printf("pT Ratio trigger/jet > %3.2f\n", fRatioMinCut) ;
- printf("fConeSize = %3.2f\n", fConeSize) ;
- printf("fPtThresholdInCone = %3.2f\n", fPtThresholdInCone) ;
- printf("fUseJetRefTracks = %d\n", fUseJetRefTracks) ;
- printf("fMakeCorrelationInHistoMaker = %d\n", fMakeCorrelationInHistoMaker) ;
-}
-
+++ /dev/null
-#ifndef AliAnaParticleJetFinderCorrelation_H
-#define AliAnaParticleJetFinderCorrelation_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-/* $Id: AliAnaParticleJetFinderCorrelation.h 21839 2007-10-29 13:49:42Z gustavo $ */
-
-
-//_________________________________________________________________________
-// Class that contains the algorithm for the analysis of particle (direct gamma) - jet
-// (standard jet found with JETAN) correlation
-// Particle and jet for correlation found by independent algorithms.
-// For Example direct isolated photon found in AliAnaGammaDirect and the jet with JETAN
-//
-//-- Author: Gustavo Conesa (INFN-LNF)
-
-// --- ROOT system ---
-class TH2F;
-
-//---- Analysis system ----
-class AliLog;
-#include "AliAnaPartCorrBaseClass.h"
-
-class AliAnaParticleJetFinderCorrelation : public AliAnaPartCorrBaseClass {
-
- public:
-
- AliAnaParticleJetFinderCorrelation() ; // default ctor
- AliAnaParticleJetFinderCorrelation(const AliAnaParticleJetFinderCorrelation & g) ; // cpy ctor
- AliAnaParticleJetFinderCorrelation & operator = (const AliAnaParticleJetFinderCorrelation & g) ;//cpy assignment
- virtual ~AliAnaParticleJetFinderCorrelation() {;} //virtual dtor
-
- TList * GetCreateOutputObjects();
-
- void InitParameters();
-
- void Print(const Option_t * opt) const;
-
- Float_t GetConeSize() const {return fConeSize ; }
- Float_t GetPtThresholdInCone() const {return fPtThresholdInCone ; }
- Double_t GetDeltaPhiMaxCut() const {return fDeltaPhiMaxCut ; }
- Double_t GetDeltaPhiMinCut() const {return fDeltaPhiMinCut ; }
- Double_t GetRatioMaxCut() const {return fRatioMaxCut ; }
- Double_t GetRatioMinCut() const {return fRatioMinCut ; }
- Bool_t AreJetRefTracks() const {return fUseJetRefTracks ; }
- Bool_t IsCorrelationMadeInHistoMaker() const {return fMakeCorrelationInHistoMaker ;}
-
- void SetConeSize(Float_t cone) {fConeSize = cone; }
- void SetPtThresholdInCone(Float_t pt){fPtThresholdInCone = pt; };
- void SetDeltaPhiCutRange(Double_t phimin, Double_t phimax)
- {fDeltaPhiMaxCut =phimax; fDeltaPhiMinCut =phimin;}
- void SetRatioCutRange(Double_t ratiomin, Double_t ratiomax)
- {fRatioMaxCut =ratiomax; fRatioMinCut = ratiomin ; }
- void UseJetRefTracks(Bool_t use) {fUseJetRefTracks = use ; }
- void SetMakeCorrelationInHistoMaker(Bool_t make) {fMakeCorrelationInHistoMaker = make ;}
-
- private:
-
- Int_t SelectJet(AliAODParticleCorrelation * particle) ;
-
- void MakeAnalysisFillAOD() ;
- void MakeAnalysisFillHistograms() ;
-
- private:
-
- //selection parameters
- Double_t fDeltaPhiMaxCut ; //! Minimum Delta Phi Gamma-Leading
- Double_t fDeltaPhiMinCut ; //! Maximum Delta Phi Gamma-Leading
- Double_t fRatioMaxCut ; //! Jet/ particle Ratio cut maximum
- Double_t fRatioMinCut ; //! Jet/particle Ratio cut minimum
-
- Double_t fConeSize ; //! Jet cone size
- Double_t fPtThresholdInCone ; //! Jet pT threshold in jet cone
- Bool_t fUseJetRefTracks ; //! Use track references from JETAN not the AOD tracks
- Bool_t fMakeCorrelationInHistoMaker ; //!Make particle-jet correlation in histogram maker
-
- TH2F * fhDeltaEta; //! Difference of jet eta and trigger particle eta as function of trigger particle pT
- TH2F * fhDeltaPhi; //! Difference of jet phi and trigger particle phi as function of trigger particle pT
- TH2F * fhDeltaPt; //! Difference of jet pT and trigger particle pT as function of trigger particle pT
- TH2F * fhPtRatio; //! Ratio of jet pT and trigger particle pT as function of trigger particle pT
- TH2F * fhPt; //! jet pT vs trigger particle pT
-
- TH2F * fhFFz ; //! Accepted reconstructed jet fragmentation function, z=ptjet/pttrig
- TH2F * fhFFxi; //! Accepted reconstructed jet fragmentation function, xsi = ln(pttrig/ptjet)
- TH2F * fhFFpt; //! Jet particle pt distribution in cone
- TH2F * fhNTracksInCone ; //! jet multiplicity in cone
-
- ClassDef(AliAnaParticleJetFinderCorrelation,1)
- } ;
-
-
-#endif //AliAnaParticleJetFinderCorrelation_H
-
-
-
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-/* $Id: $ */
-
-//_________________________________________________________________________
-// Class that contains the algorithm for the reconstruction of jet, cone around leading particle
-// The seed is a backward particle (direct photon)
-// 1)Take the trigger particle stored in AliAODParticleCorrelation,
-// 2) Search for the highest pt leading particle opposite to the photon within a phi, pt window
-// 3) Take all particles around leading in a cone R with pt larger than threshold and construct the jet
-//
-// Class created from old AliPHOSGammaJet
-// (see AliRoot versions previous Release 4-09)
-//
-//*-- Author: Gustavo Conesa (LNF-INFN)
-//////////////////////////////////////////////////////////////////////////////
-
-
-// --- ROOT system ---
-#include "TH2F.h"
-
-//---- Analysis system ----
-#include "AliAODTrack.h"
-#include "AliAODCaloCluster.h"
-#include "AliCaloTrackReader.h"
-#include "AliNeutralMesonSelection.h"
-#include "AliLog.h"
-#include "AliAnaParticleJetLeadingConeCorrelation.h"
-
-
-ClassImp(AliAnaParticleJetLeadingConeCorrelation)
-
-
-//____________________________________________________________________________
- AliAnaParticleJetLeadingConeCorrelation::AliAnaParticleJetLeadingConeCorrelation() :
- AliAnaPartCorrBaseClass(), fJetsOnlyInCTS(kFALSE), fPbPb(kFALSE),
- fSeveralConeAndPtCuts(0), fReMakeJet(0),
- fDeltaPhiMaxCut(0.), fDeltaPhiMinCut(0.),
- fLeadingRatioMaxCut(0.), fLeadingRatioMinCut(0.),
- fJetCTSRatioMaxCut(0.), fJetCTSRatioMinCut(0.),
- fJetRatioMaxCut(0.), fJetRatioMinCut(0.),
- fJetNCone(0),fJetNPt(0), fJetCone(0),
- fJetPtThreshold(0),fJetPtThresPbPb(0),
- fPtTriggerSelectionCut(0.0), fSelect(0),
- //Histograms
- fOutCont(0x0),
- fhChargedLeadingPt(0),fhChargedLeadingPhi(0),fhChargedLeadingEta(0),
- fhChargedLeadingDeltaPt(0),fhChargedLeadingDeltaPhi(0),fhChargedLeadingDeltaEta(0),
- fhChargedLeadingRatioPt(0),
- fhNeutralLeadingPt(0),fhNeutralLeadingPhi(0),fhNeutralLeadingEta(0),
- fhNeutralLeadingDeltaPt(0),fhNeutralLeadingDeltaPhi(0),fhNeutralLeadingDeltaEta(0),
- fhNeutralLeadingRatioPt(0),
- fhJetPt(0),fhJetRatioPt(0),fhJetDeltaPhi(0), fhJetDeltaEta(0),
- fhJetLeadingRatioPt(0),fhJetLeadingDeltaPhi(0),fhJetLeadingDeltaEta(0),
- fhJetFFz(0),fhJetFFxi(0),fhJetFFpt(0),fhJetNTracksInCone(0),
- fhBkgPt(0),fhBkgRatioPt(0),fhBkgDeltaPhi(0), fhBkgDeltaEta(0),
- fhBkgLeadingRatioPt(0),fhBkgLeadingDeltaPhi(0),fhBkgLeadingDeltaEta(0),
- fhBkgFFz(0),fhBkgFFxi(0),fhBkgFFpt(0),fhBkgNTracksInCone(0),
- //Several cones and thres histograms
- fhJetPts(),fhJetRatioPts(),fhJetDeltaPhis(), fhJetDeltaEtas(),
- fhJetLeadingRatioPts(),fhJetLeadingDeltaPhis(),fhJetLeadingDeltaEtas(),
- fhJetFFzs(),fhJetFFxis(),fhJetFFpts(),fhJetNTracksInCones(),
- fhBkgPts(),fhBkgRatioPts(),fhBkgDeltaPhis(), fhBkgDeltaEtas(),
- fhBkgLeadingRatioPts(),fhBkgLeadingDeltaPhis(),fhBkgLeadingDeltaEtas(),
- fhBkgFFzs(),fhBkgFFxis(),fhBkgFFpts(),fhBkgNTracksInCones()
-{
- //Default Ctor
-
- //Initialize parameters
-
- for(Int_t i = 0; i<6; i++){
- fJetXMin1[i] = 0.0 ;
- fJetXMin2[i] = 0.0 ;
- fJetXMax1[i] = 0.0 ;
- fJetXMax2[i] = 0.0 ;
- fBkgMean[i] = 0.0 ;
- fBkgRMS[i] = 0.0 ;
- if( i < 2 ){
- fJetE1[i] = 0.0 ;
- fJetE2[i] = 0.0 ;
- fJetSigma1[i] = 0.0 ;
- fJetSigma2[i] = 0.0 ;
- }
- }
-
- //Several cones and thres histograms
- for(Int_t i = 0; i<5; i++){
- fJetCones[i] = 0.0 ;
- fJetNameCones[i] = "" ;
- fJetPtThres[i] = 0.0 ;
- fJetNamePtThres[i] = "" ;
- for(Int_t j = 0; j<5; j++){
- fhJetPts[i][j]=0 ;
- fhJetRatioPts[i][j]=0 ;
- fhJetDeltaPhis[i][j]=0 ;
- fhJetDeltaEtas[i][j]=0 ;
- fhJetLeadingRatioPts[i][j]=0 ;
- fhJetLeadingDeltaPhis[i][j]=0 ;
- fhJetLeadingDeltaEtas[i][j]=0 ;
- fhJetFFzs[i][j]=0 ;
- fhJetFFxis[i][j]=0 ;
- fhJetFFpts[i][j]=0 ;
- fhJetNTracksInCones[i][j]=0 ;
- fhBkgPts[i][j]=0 ;
- fhBkgRatioPts[i][j]=0 ;
- fhBkgDeltaPhis[i][j]=0 ;
- fhBkgDeltaEtas[i][j]=0 ;
- fhBkgLeadingRatioPts[i][j]=0 ;
- fhBkgLeadingDeltaPhis[i][j]=0 ;
- fhBkgLeadingDeltaEtas[i][j]=0 ;
- fhBkgFFzs[i][j]=0 ;
- fhBkgFFxis[i][j]=0 ;
- fhBkgFFpts[i][j]=0 ;
- fhBkgNTracksInCones[i][j]=0 ;
- }
- }
-
- InitParameters();
-
-}
-
-//____________________________________________________________________________
-AliAnaParticleJetLeadingConeCorrelation::AliAnaParticleJetLeadingConeCorrelation(const AliAnaParticleJetLeadingConeCorrelation & jetlc) :
- AliAnaPartCorrBaseClass(jetlc), fJetsOnlyInCTS(jetlc.fJetsOnlyInCTS), fPbPb(jetlc.fPbPb),
- fSeveralConeAndPtCuts(jetlc.fSeveralConeAndPtCuts), fReMakeJet(jetlc. fReMakeJet),
- fDeltaPhiMaxCut(jetlc. fDeltaPhiMaxCut), fDeltaPhiMinCut(jetlc.fDeltaPhiMinCut),
- fLeadingRatioMaxCut(jetlc.fLeadingRatioMaxCut), fLeadingRatioMinCut(jetlc.fLeadingRatioMinCut),
- fJetCTSRatioMaxCut(jetlc.fJetCTSRatioMaxCut),
- fJetCTSRatioMinCut(jetlc.fJetCTSRatioMinCut), fJetRatioMaxCut(jetlc.fJetRatioMaxCut),
- fJetRatioMinCut(jetlc.fJetRatioMinCut), fJetNCone(jetlc.fJetNCone),
- fJetNPt(jetlc.fJetNPt), fJetCone(jetlc.fJetCone),
- fJetPtThreshold(jetlc.fJetPtThreshold),fJetPtThresPbPb(jetlc.fJetPtThresPbPb),
- fPtTriggerSelectionCut(jetlc.fPtTriggerSelectionCut), fSelect(jetlc.fSelect),
- //Histograms
- fOutCont(jetlc. fOutCont),
- fhChargedLeadingPt(jetlc.fhChargedLeadingPt), fhChargedLeadingPhi(jetlc.fhChargedLeadingPhi),
- fhChargedLeadingEta(jetlc.fhChargedLeadingEta), fhChargedLeadingDeltaPt(jetlc.fhChargedLeadingDeltaPt),
- fhChargedLeadingDeltaPhi(jetlc.fhChargedLeadingDeltaPhi),fhChargedLeadingDeltaEta(jetlc.fhChargedLeadingDeltaEta),
- fhChargedLeadingRatioPt(jetlc.fhChargedLeadingRatioPt),
- fhNeutralLeadingPt(jetlc.fhNeutralLeadingPt),fhNeutralLeadingPhi(jetlc.fhNeutralLeadingPhi),
- fhNeutralLeadingEta(jetlc.fhNeutralLeadingEta), fhNeutralLeadingDeltaPt(jetlc.fhNeutralLeadingDeltaPt),
- fhNeutralLeadingDeltaPhi(jetlc.fhNeutralLeadingDeltaPhi),fhNeutralLeadingDeltaEta(jetlc.fhNeutralLeadingDeltaEta),
- fhNeutralLeadingRatioPt(jetlc.fhNeutralLeadingRatioPt),
- fhJetPt(jetlc.fhJetPt),fhJetRatioPt(jetlc.fhJetRatioPt),fhJetDeltaPhi(jetlc.fhJetDeltaPhi),
- fhJetDeltaEta(jetlc.fhJetDeltaEta), fhJetLeadingRatioPt(jetlc.fhJetLeadingRatioPt),
- fhJetLeadingDeltaPhi(jetlc.fhJetLeadingDeltaPhi),fhJetLeadingDeltaEta(jetlc.fhJetLeadingDeltaEta),
- fhJetFFz(jetlc.fhJetFFz),fhJetFFxi(jetlc.fhJetFFxi),fhJetFFpt(jetlc.fhJetFFpt),
- fhJetNTracksInCone(jetlc.fhJetNTracksInCone),
- fhBkgPt(jetlc.fhBkgPt),fhBkgRatioPt(jetlc.fhBkgRatioPt),fhBkgDeltaPhi(jetlc.fhBkgDeltaPhi),
- fhBkgDeltaEta(jetlc.fhBkgDeltaEta), fhBkgLeadingRatioPt(jetlc.fhBkgLeadingRatioPt),
- fhBkgLeadingDeltaPhi(jetlc.fhBkgLeadingDeltaPhi),fhBkgLeadingDeltaEta(jetlc.fhBkgLeadingDeltaEta),
- fhBkgFFz(jetlc.fhBkgFFz),fhBkgFFxi(jetlc.fhBkgFFxi),fhBkgFFpt(jetlc.fhBkgFFpt),
- fhBkgNTracksInCone(jetlc.fhBkgNTracksInCone),
- //Several cones and thres histograms
- fhJetPts(),fhJetRatioPts(),fhJetDeltaPhis(), fhJetDeltaEtas(),
- fhJetLeadingRatioPts(),fhJetLeadingDeltaPhis(),fhJetLeadingDeltaEtas(),
- fhJetFFzs(),fhJetFFxis(),fhJetFFpts(),fhJetNTracksInCones(),
- fhBkgPts(),fhBkgRatioPts(),fhBkgDeltaPhis(), fhBkgDeltaEtas(),
- fhBkgLeadingRatioPts(),fhBkgLeadingDeltaPhis(),fhBkgLeadingDeltaEtas(),
- fhBkgFFzs(),fhBkgFFxis(),fhBkgFFpts(),fhBkgNTracksInCones()
-{
- // cpy ctor
-
- for(Int_t i = 0; i<6; i++){
- fJetXMin1[i] = jetlc.fJetXMin1[i] ;
- fJetXMin2[i] = jetlc.fJetXMin2[i] ;
- fJetXMax1[i] = jetlc.fJetXMax1[i] ;
- fJetXMax2[i] = jetlc.fJetXMax2[i] ;
- fBkgMean[i] = jetlc.fBkgMean[i] ;
- fBkgRMS[i] = jetlc.fBkgRMS[i] ;
- if( i < 2 ){
- fJetE1[i] = jetlc.fJetE1[i] ;
- fJetE2[i] = jetlc.fJetE2[i] ;
- fJetSigma1[i] = jetlc.fJetSigma1[i] ;
- fJetSigma2[i] = jetlc.fJetSigma2[i] ;
- }
- }
-
- //Several cones and thres histograms
- for(Int_t i = 0; i<5; i++){
- fJetCones[i] = jetlc.fJetCones[i] ;
- fJetNameCones[i] = jetlc.fJetNameCones[i] ;
- fJetPtThres[i] = jetlc.fJetPtThres[i] ;
- fJetNamePtThres[i] = jetlc.fJetNamePtThres[i] ;
- for(Int_t j = 0; j<5; j++){
- fhJetPts[i][j] = jetlc.fhJetPts[i][j] ;
- fhJetRatioPts[i][j] = jetlc.fhJetRatioPts[i][j] ;
- fhJetDeltaPhis[i][j] = jetlc.fhJetDeltaPhis[i][j] ;
- fhJetDeltaEtas[i][j] = jetlc.fhJetDeltaEtas[i][j] ;
- fhJetLeadingRatioPts[i][j] = jetlc.fhJetLeadingRatioPts[i][j] ;
- fhJetLeadingDeltaPhis[i][j] = jetlc.fhJetLeadingDeltaPhis[i][j] ;
- fhJetLeadingDeltaEtas[i][j] = jetlc.fhJetLeadingDeltaEtas[i][j] ;
- fhJetFFzs[i][j] = jetlc.fhJetFFzs[i][j] ;
- fhJetFFxis[i][j] = jetlc.fhJetFFxis[i][j] ;
- fhJetFFpts[i][j] = jetlc.fhJetFFpts[i][j] ;
- fhJetNTracksInCones[i][j] = fhJetNTracksInCones[i][j] ;
- fhBkgPts[i][j] = jetlc.fhBkgPts[i][j] ;
- fhBkgRatioPts[i][j] = jetlc.fhBkgRatioPts[i][j] ;
- fhBkgDeltaPhis[i][j] = jetlc.fhBkgDeltaPhis[i][j] ;
- fhBkgDeltaEtas[i][j] = jetlc.fhBkgDeltaEtas[i][j] ;
- fhBkgLeadingRatioPts[i][j] = jetlc.fhBkgLeadingRatioPts[i][j] ;
- fhBkgLeadingDeltaPhis[i][j] = jetlc.fhBkgLeadingDeltaPhis[i][j] ;
- fhBkgLeadingDeltaEtas[i][j] = jetlc.fhBkgLeadingDeltaEtas[i][j] ;
- fhBkgFFzs[i][j] = jetlc.fhBkgFFzs[i][j] ;
- fhBkgFFxis[i][j] = jetlc.fhBkgFFxis[i][j] ;
- fhBkgFFpts[i][j] = jetlc.fhBkgFFpts[i][j] ;
- fhBkgNTracksInCones[i][j] = jetlc.fhBkgNTracksInCones[i][j] ;
- }
- }
-}
-
-//_________________________________________________________________________
-AliAnaParticleJetLeadingConeCorrelation & AliAnaParticleJetLeadingConeCorrelation::operator = (const AliAnaParticleJetLeadingConeCorrelation & jetlc)
-{
- // assignment operator
-
- if(this == &jetlc)return *this;
- ((AliAnaPartCorrBaseClass *)this)->operator=(jetlc);
-
- fSeveralConeAndPtCuts = jetlc.fSeveralConeAndPtCuts ;
- fPbPb = jetlc.fPbPb ;
- fReMakeJet = jetlc.fReMakeJet ;
- fJetsOnlyInCTS = jetlc.fJetsOnlyInCTS;
-
- fDeltaPhiMaxCut = jetlc.fDeltaPhiMaxCut ;
- fDeltaPhiMinCut = jetlc.fDeltaPhiMinCut ;
- fLeadingRatioMaxCut = jetlc.fLeadingRatioMaxCut ;
- fLeadingRatioMinCut = jetlc.fLeadingRatioMinCut ;
-
- fJetCTSRatioMaxCut = jetlc.fJetCTSRatioMaxCut ;
- fJetCTSRatioMinCut = jetlc.fJetCTSRatioMinCut ;
- fJetRatioMaxCut = jetlc.fJetRatioMaxCut ;
- fJetRatioMinCut = jetlc.fJetRatioMinCut ;
-
- fJetNCone = jetlc.fJetNCone ;
- fJetNPt = jetlc.fJetNPt ; fJetCone = jetlc.fJetCone ;
- fJetPtThreshold = jetlc.fJetPtThreshold ;
- fJetPtThresPbPb = jetlc.fJetPtThresPbPb ;
- fPtTriggerSelectionCut = jetlc.fPtTriggerSelectionCut ;
- fSelect = jetlc.fSelect ;
-
- for(Int_t i = 0; i<6; i++){
- fJetXMin1[i] = jetlc.fJetXMin1[i] ;
- fJetXMin2[i] = jetlc.fJetXMin2[i] ;
- fJetXMax1[i] = jetlc.fJetXMax1[i] ;
- fJetXMax2[i] = jetlc.fJetXMax2[i] ;
- fBkgMean[i] = jetlc.fBkgMean[i] ;
- fBkgRMS[i] = jetlc.fBkgRMS[i] ;
- if( i < 2 ){
- fJetE1[i] = jetlc.fJetE1[i] ;
- fJetE2[i] = jetlc.fJetE2[i] ;
- fJetSigma1[i] = jetlc.fJetSigma1[i] ;
- fJetSigma2[i] = jetlc.fJetSigma2[i] ;
- }
- }
-
- //Histograms
- fOutCont = jetlc. fOutCont ;
- fhChargedLeadingPt = jetlc.fhChargedLeadingPt; fhChargedLeadingPhi = jetlc.fhChargedLeadingPhi;
- fhChargedLeadingEta = jetlc.fhChargedLeadingEta; fhChargedLeadingDeltaPt = jetlc.fhChargedLeadingDeltaPt;
- fhChargedLeadingDeltaPhi = jetlc.fhChargedLeadingDeltaPhi;fhChargedLeadingDeltaEta = jetlc.fhChargedLeadingDeltaEta;
- fhChargedLeadingRatioPt = jetlc.fhChargedLeadingRatioPt;
- fhNeutralLeadingPt = jetlc.fhNeutralLeadingPt;fhNeutralLeadingPhi = jetlc.fhNeutralLeadingPhi;
- fhNeutralLeadingEta = jetlc.fhNeutralLeadingEta; fhNeutralLeadingDeltaPt = jetlc.fhNeutralLeadingDeltaPt;
- fhNeutralLeadingDeltaPhi = jetlc.fhNeutralLeadingDeltaPhi;fhNeutralLeadingDeltaEta = jetlc.fhNeutralLeadingDeltaEta;
- fhNeutralLeadingRatioPt = jetlc.fhNeutralLeadingRatioPt;
- fhJetPt = jetlc.fhJetPt;fhJetRatioPt = jetlc.fhJetRatioPt;fhJetDeltaPhi = jetlc.fhJetDeltaPhi;
- fhJetDeltaEta = jetlc.fhJetDeltaEta; fhJetLeadingRatioPt = jetlc.fhJetLeadingRatioPt;
- fhJetLeadingDeltaPhi = jetlc.fhJetLeadingDeltaPhi;fhJetLeadingDeltaEta = jetlc.fhJetLeadingDeltaEta;
- fhJetFFz = jetlc.fhJetFFz;fhJetFFxi = jetlc.fhJetFFxi;fhJetFFpt = jetlc.fhJetFFpt;
- fhJetNTracksInCone = jetlc.fhJetNTracksInCone;
- fhBkgPt = jetlc.fhBkgPt;fhBkgRatioPt = jetlc.fhBkgRatioPt;fhBkgDeltaPhi = jetlc.fhBkgDeltaPhi;
- fhBkgDeltaEta = jetlc.fhBkgDeltaEta; fhBkgLeadingRatioPt = jetlc.fhBkgLeadingRatioPt;
- fhBkgLeadingDeltaPhi = jetlc.fhBkgLeadingDeltaPhi;fhBkgLeadingDeltaEta = jetlc.fhBkgLeadingDeltaEta;
- fhBkgFFz = jetlc.fhBkgFFz;fhBkgFFxi = jetlc.fhBkgFFxi;fhBkgFFpt = jetlc.fhBkgFFpt;
- fhBkgNTracksInCone = jetlc.fhBkgNTracksInCone;
-
-
- //Several cones and thres histograms
- for(Int_t i = 0; i<5; i++){
- fJetCones[i] = jetlc.fJetCones[i] ;
- fJetNameCones[i] = jetlc.fJetNameCones[i] ;
- fJetPtThres[i] = jetlc.fJetPtThres[i] ;
- fJetNamePtThres[i] = jetlc.fJetNamePtThres[i] ;
-
- for(Int_t j = 0; j<5; j++){
- fhJetPts[i][j] = jetlc.fhJetPts[i][j] ;
- fhJetRatioPts[i][j] = jetlc.fhJetRatioPts[i][j] ;
- fhJetDeltaPhis[i][j] = jetlc.fhJetDeltaPhis[i][j] ;
- fhJetDeltaEtas[i][j] = jetlc.fhJetDeltaEtas[i][j] ;
- fhJetLeadingRatioPts[i][j] = jetlc.fhJetLeadingRatioPts[i][j] ;
- fhJetLeadingDeltaPhis[i][j] = jetlc.fhJetLeadingDeltaPhis[i][j] ;
- fhJetLeadingDeltaEtas[i][j] = jetlc.fhJetLeadingDeltaEtas[i][j] ;
- fhJetFFzs[i][j] = jetlc.fhJetFFzs[i][j] ;
- fhJetFFxis[i][j] = jetlc.fhJetFFxis[i][j] ;
- fhJetFFpts[i][j] = jetlc.fhJetFFpts[i][j] ;
- fhJetNTracksInCones[i][j] = fhJetNTracksInCones[i][j] ;
- fhBkgPts[i][j] = jetlc.fhBkgPts[i][j] ;
- fhBkgRatioPts[i][j] = jetlc.fhBkgRatioPts[i][j] ;
- fhBkgDeltaPhis[i][j] = jetlc.fhBkgDeltaPhis[i][j] ;
- fhBkgDeltaEtas[i][j] = jetlc.fhBkgDeltaEtas[i][j] ;
- fhBkgLeadingRatioPts[i][j] = jetlc.fhBkgLeadingRatioPts[i][j] ;
- fhBkgLeadingDeltaPhis[i][j] = jetlc.fhBkgLeadingDeltaPhis[i][j] ;
- fhBkgLeadingDeltaEtas[i][j] = jetlc.fhBkgLeadingDeltaEtas[i][j] ;
- fhBkgFFzs[i][j] = jetlc.fhBkgFFzs[i][j] ;
- fhBkgFFxis[i][j] = jetlc.fhBkgFFxis[i][j] ;
- fhBkgFFpts[i][j] = jetlc.fhBkgFFpts[i][j] ;
- fhBkgNTracksInCones[i][j] = jetlc.fhBkgNTracksInCones[i][j] ;
- }
- }
-
- return *this;
-
-}
-
-//____________________________________________________________________________
-AliAnaParticleJetLeadingConeCorrelation::~AliAnaParticleJetLeadingConeCorrelation()
-{
- // Remove all pointers except analysis output pointers.
- delete [] fJetE1;
- delete [] fJetE2;
- delete [] fJetSigma1;
- delete [] fJetSigma2;
- delete [] fBkgMean;
- delete [] fBkgRMS;
- delete [] fJetXMin1;
- delete [] fJetXMin2;
- delete [] fJetXMax1;
- delete [] fJetXMax2;
- delete [] fJetCones;
- delete [] fJetNameCones;
- delete [] fJetPtThres;
- delete [] fJetNamePtThres;
-}
-
-//____________________________________________________________________________
-Double_t AliAnaParticleJetLeadingConeCorrelation::CalculateJetRatioLimit(const Double_t ptg, const Double_t *par, const Double_t *x) {
- //Calculate the ratio of the jet and trigger particle limit for the selection
- //WARNING: need to check what it does
- //Info("CalculateLimit","x1 %f, x2%f",x[0],x[1]);
- Double_t Epp = par[0] + par[1] * ptg ;
- Double_t Spp = par[2] + par[3] * ptg ;
- Double_t f = x[0] + x[1] * ptg ;
- Double_t Epb = Epp + par[4] ;
- Double_t Spb = TMath::Sqrt(Spp*Spp+ par[5]*par[5]) ;
- Double_t rat = (Epb - Spb * f) / ptg ;
- //Info("CalculateLimit","Epp %f, Spp %f, f %f", Epp, Spp, f);
- //Info("CalculateLimit","Epb %f, Spb %f, rat %f", Epb, Spb, rat);
- return rat ;
-}
-
-//____________________________________________________________________________
-void AliAnaParticleJetLeadingConeCorrelation::FillJetHistos(AliAODParticleCorrelation * particle, const TLorentzVector leading, const TLorentzVector jet, const TString type, const TString lastname)
-{
- //Fill jet and background histograms
- Double_t ptTrig = particle->Pt();
- Double_t ptJet = jet.Pt();
- Double_t ptLead = leading.Pt();
- Double_t phiTrig = particle->Phi();
- Double_t phiJet = jet.Phi();
- Double_t phiLead = leading.Phi();
- Double_t etaTrig = particle->Eta();
- Double_t etaJet = jet.Eta();
- Double_t etaLead = leading.Eta();
-
- dynamic_cast<TH2F*>(GetOutputContainer()->FindObject(type+"Pt"+lastname))->
- Fill(ptTrig,ptJet);
- dynamic_cast<TH2F*>(GetOutputContainer()->FindObject(type+"RatioPt"+lastname))->
- Fill(ptTrig,ptJet/ptTrig);
- dynamic_cast<TH2F*>(GetOutputContainer()->FindObject(type+"LeadingRatioPt"+lastname))->
- Fill(ptTrig,ptLead/ptJet);
-// dynamic_cast<TH2F*>(GetOutputContainer()->FindObject(type+"Phi"+lastname))->
-// Fill(ptTrig,phiJet);
- dynamic_cast<TH2F*>(GetOutputContainer()->FindObject(type+"DeltaPhi"+lastname))->
- Fill(ptTrig,phiJet-phiTrig);
- dynamic_cast<TH2F*>(GetOutputContainer()->FindObject(type+"LeadingDeltaPhi"+lastname))->
- Fill(ptTrig,phiJet-phiLead);
-
- // dynamic_cast<TH2F*>(GetOutputContainer()->FindObject(type+"Eta"+lastname))->
- // Fill(ptTrig,etaJet);
- dynamic_cast<TH2F*>(GetOutputContainer()->FindObject(type+"DeltaEta"+lastname))->
- Fill(ptTrig,etaJet-etaTrig);
- dynamic_cast<TH2F*>(GetOutputContainer()->FindObject(type+"LeadingDeltaEta"+lastname))->
- Fill(ptTrig,etaJet-etaLead);
-
- //Construct fragmentation function
- TRefArray * pl = new TRefArray;
- if(type == "Jet") pl = particle->GetRefTracks();
- else if(type == "Bkg") pl = particle->GetRefBackgroundTracks();
-
- //Different pt cut for jet particles in different collisions systems
- //Only needed when jet is recalculated from AODs
- Float_t ptcut = fJetPtThreshold;
- if(fPbPb && !fSeveralConeAndPtCuts && ptTrig > fPtTriggerSelectionCut) ptcut = fJetPtThresPbPb ;
-
- TVector3 p3;
- Int_t nTracksInCone = 0;
- for(Int_t ipr = 0;ipr < pl->GetEntriesFast() ; ipr ++ ){
- AliAODTrack* track = dynamic_cast<AliAODTrack *>(pl->At(ipr)) ;
- p3.SetXYZ(track->Px(),track->Py(),track->Pz());
-
- //Recheck if particle is in jet cone
- if(fReMakeJet || fSeveralConeAndPtCuts)
- if(!IsParticleInJetCone(p3.Eta(), p3.Phi(), leading.Eta(), leading.Phi()) ) continue ;
-
- nTracksInCone++;
-
- dynamic_cast<TH2F*>(GetOutputContainer()->FindObject(type+"FFz"+lastname))
- ->Fill(ptTrig,p3.Pt()/ptTrig);
- dynamic_cast<TH2F*>(GetOutputContainer()->FindObject(type+"FFxi"+lastname))
- ->Fill(ptTrig,TMath::Log(ptTrig/p3.Pt()));
- dynamic_cast<TH2F*>(GetOutputContainer()->FindObject(type+"FFpt"+lastname))
- ->Fill(ptTrig,p3.Pt());
-
- }//track loop
-
- if(nTracksInCone > 0) dynamic_cast<TH2F*>(GetOutputContainer()->FindObject(type+"NTracksInCone"+lastname))
- ->Fill(ptTrig, nTracksInCone);
-
-}
-
-//________________________________________________________________________
-TList * AliAnaParticleJetLeadingConeCorrelation::GetCreateOutputObjects()
-{
- // Create histograms to be saved in output file and
- // store them in fOutCont
-
- if(GetDebug()>1) printf("Init histograms \n");
-
- fOutCont = new TList() ;
- fOutCont->SetName("ParticleJetLeadingInConeCorrelationHistograms") ;
-
- fhChargedLeadingPt = new TH2F("ChargedLeadingPt","p_{T leading charge} vs p_{T trigger}",120,0,120,120,0,120);
- fhChargedLeadingPt->SetYTitle("p_{T leading charge} /p_{T trigger}");
- fhChargedLeadingPt->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhChargedLeadingPhi = new TH2F("ChargedLeadingPhi","#phi_{h^{#pm}} vs p_{T trigger}", 120,0,120,120,0,TMath::TwoPi());
- fhChargedLeadingPhi->SetYTitle("#phi_{h^{#pm}} (rad)");
- fhChargedLeadingPhi->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhChargedLeadingEta = new TH2F("ChargedLeadingEta","#eta_{h^{#pm}} vs p_{T trigger}",120,0,120,120,-1,1);
- fhChargedLeadingEta->SetYTitle("#eta_{h^{#pm}} ");
- fhChargedLeadingEta->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhChargedLeadingDeltaPt = new TH2F("ChargedLeadingDeltaPt","#p_{T trigger} - #p_{T h^{#pm}} vs p_{T trigger}",120,0,120,120,0,120);
- fhChargedLeadingDeltaPt->SetYTitle("#Delta p_{T} (GeV/c)");
- fhChargedLeadingDeltaPt->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhChargedLeadingDeltaPhi = new TH2F("ChargedLeadingDeltaPhi","#phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}",120,0,120,120,0,TMath::TwoPi());
- fhChargedLeadingDeltaPhi->SetYTitle("#Delta #phi (rad)");
- fhChargedLeadingDeltaPhi->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhChargedLeadingDeltaEta = new TH2F("ChargedLeadingDeltaEta","#eta_{trigger} - #eta_{h^{#pm}} vs p_{T trigger}",120,0,120,120,-2,2);
- fhChargedLeadingDeltaEta->SetYTitle("#Delta #eta");
- fhChargedLeadingDeltaEta->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhChargedLeadingRatioPt = new TH2F("ChargedLeadingRatioPt","p_{T leading charge} /p_{T trigger} vs p_{T trigger}",120,0,120,120,0,2);
- fhChargedLeadingRatioPt->SetYTitle("p_{T lead charge} /p_{T trigger}");
- fhChargedLeadingRatioPt->SetXTitle("p_{T trigger} (GeV/c)");
-
- fOutCont->Add(fhChargedLeadingPt) ;
- fOutCont->Add(fhChargedLeadingPhi) ;
- fOutCont->Add(fhChargedLeadingEta) ;
- fOutCont->Add(fhChargedLeadingDeltaPt) ;
- fOutCont->Add(fhChargedLeadingDeltaPhi) ;
- fOutCont->Add(fhChargedLeadingDeltaEta) ;
- fOutCont->Add(fhChargedLeadingRatioPt) ;
-
- if(!fJetsOnlyInCTS){
-
- fhNeutralLeadingPt = new TH2F("NeutralLeadingPt","p_{T leading #pi^{0}} vs p_{T trigger}",120,0,120,120,0,120);
- fhNeutralLeadingPt->SetYTitle("p_{T leading #pi^{0}} /p_{T trigger}");
- fhNeutralLeadingPt->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhNeutralLeadingPhi = new TH2F("NeutralLeadingPhi","#phi_{#pi^{0}} vs p_{T trigger}", 120,0,120,120,0,TMath::TwoPi());
- fhNeutralLeadingPhi->SetYTitle("#phi_{#pi^{0}} (rad)");
- fhNeutralLeadingPhi->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhNeutralLeadingEta = new TH2F("NeutralLeadingEta","#eta_{#pi^{0}} vs p_{T trigger}",120,0,120,120,-1,1);
- fhNeutralLeadingEta->SetYTitle("#eta_{#pi^{0}} ");
- fhNeutralLeadingEta->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhNeutralLeadingDeltaPt = new TH2F("NeutralLeadingDeltaPt","#p_{T trigger} - #p_{T #pi^{0}} vs p_{T trigger}",120,0,120,120,0,120);
- fhNeutralLeadingDeltaPt->SetYTitle("#Delta p_{T} (GeV/c)");
- fhNeutralLeadingDeltaPt->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhNeutralLeadingDeltaPhi = new TH2F("NeutralLeadingDeltaPhi","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T trigger}",120,0,120,120,0,TMath::TwoPi());
- fhNeutralLeadingDeltaPhi->SetYTitle("#Delta #phi (rad)");
- fhNeutralLeadingDeltaPhi->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhNeutralLeadingDeltaEta = new TH2F("NeutralLeadingDeltaEta","#eta_{trigger} - #eta_{#pi^{0}} vs p_{T trigger}",120,0,120,120,-2,2);
- fhNeutralLeadingDeltaEta->SetYTitle("#Delta #eta");
- fhNeutralLeadingDeltaEta->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhNeutralLeadingRatioPt = new TH2F("NeutralLeadingRatioPt","p_{T leading #pi^{0}} /p_{T trigger} vs p_{T trigger}",120,0,120,120,0,2);
- fhNeutralLeadingRatioPt->SetYTitle("p_{T lead #pi^{0}} /p_{T trigger}");
- fhNeutralLeadingRatioPt->SetXTitle("p_{T trigger} (GeV/c)");
-
- fOutCont->Add(fhNeutralLeadingPt) ;
- fOutCont->Add(fhNeutralLeadingPhi) ;
- fOutCont->Add(fhNeutralLeadingEta) ;
- fOutCont->Add(fhNeutralLeadingDeltaPt) ;
- fOutCont->Add(fhNeutralLeadingDeltaPhi) ;
- fOutCont->Add(fhNeutralLeadingDeltaEta) ;
- fOutCont->Add(fhNeutralLeadingRatioPt) ;
-
- }
-
- if(!fSeveralConeAndPtCuts){// not several cones
-
- //Jet Distributions
- fhJetPt = new TH2F("JetPt","p_{T jet} vs p_{T trigger}",120,0,120,120,0,120);
- fhJetPt->SetYTitle("p_{T jet}");
- fhJetPt->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhJetRatioPt = new TH2F("JetRatioPt","p_{T jet}/p_{T trigger} vs p_{T trigger}",120,0,120,120,0,2);
- fhJetRatioPt->SetYTitle("p_{T jet}/p_{T trigger}");
- fhJetRatioPt->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhJetDeltaPhi = new TH2F("JetDeltaPhi","#phi_{jet} - #phi_{trigger} vs p_{T trigger}",120,0,120,120,0,TMath::TwoPi());
- fhJetDeltaPhi->SetYTitle("#Delta #phi (rad)");
- fhJetDeltaPhi->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhJetDeltaEta = new TH2F("JetDeltaEta","#eta_{jet} - #eta_{trigger} vs p_{T trigger}",120,0,120,120,-2,2);
- fhJetDeltaEta->SetYTitle("#Delta #eta");
- fhJetDeltaEta->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhJetLeadingRatioPt = new TH2F("JetLeadingRatioPt","p_{T jet} vs p_{T trigger}",120,0,120,120,0,2);
- fhJetLeadingRatioPt->SetYTitle("p_{T leading}/p_{T jet}");
- fhJetLeadingRatioPt->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhJetLeadingDeltaPhi = new TH2F("JetLeadingDeltaPhi","#phi_{jet} - #phi_{leading} vs p_{T trigger}",120,0,120,120,0,TMath::TwoPi());
- fhJetLeadingDeltaPhi->SetYTitle("#Delta #phi (rad)");
- fhJetLeadingDeltaPhi->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhJetLeadingDeltaEta = new TH2F("JetLeadingDeltaEta","#eta_{jet} - #eta_{leading} vs p_{T trigger}",120,0,120,120,-2,2);
- fhJetLeadingDeltaEta->SetYTitle("#Delta #eta");
- fhJetLeadingDeltaEta->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhJetFFz = new TH2F("JetFFz","z = p_{T i charged}/p_{T trigger} vs p_{T trigger}", 120,0.,120.,200,0.,2);
- fhJetFFz->SetYTitle("z");
- fhJetFFz->SetXTitle("p_{T trigger}");
-
- fhJetFFxi = new TH2F("JetFFxi","#xi = ln(p_{T trigger}/p_{T i charged}) vs p_{T trigger}", 120,0.,120.,100,0.,10.);
- fhJetFFxi->SetYTitle("#xi");
- fhJetFFxi->SetXTitle("p_{T trigger}");
-
- fhJetFFpt = new TH2F("JetFFpt","#xi = p_{T i charged}) vs p_{T trigger}", 120,0.,120.,200,0.,50.);
- fhJetFFpt->SetYTitle("p_{T charged hadron}");
- fhJetFFpt->SetXTitle("p_{T trigger}");
-
- fhJetNTracksInCone = new TH2F("JetNTracksInCone","N particles in cone vs p_{T trigger}",120,0,120,5000,0, 5000);
- fhJetNTracksInCone->SetYTitle("N tracks in jet cone");
- fhJetNTracksInCone->SetXTitle("p_{T trigger} (GeV/c)");
-
- fOutCont->Add(fhJetPt) ;
- fOutCont->Add(fhJetRatioPt) ;
- fOutCont->Add(fhJetDeltaPhi) ;
- fOutCont->Add(fhJetDeltaEta) ;
- fOutCont->Add(fhJetLeadingRatioPt) ;
- fOutCont->Add(fhJetLeadingDeltaPhi) ;
- fOutCont->Add(fhJetLeadingDeltaEta) ;
- fOutCont->Add(fhJetFFz) ;
- fOutCont->Add(fhJetFFxi) ;
- fOutCont->Add(fhJetFFpt) ;
- fOutCont->Add(fhJetNTracksInCone) ;
-
- //Bkg Distributions
- fhBkgPt = new TH2F("BkgPt","p_{T bkg} vs p_{T trigger}",120,0,120,120,0,120);
- fhBkgPt->SetYTitle("p_{T bkg}");
- fhBkgPt->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhBkgRatioPt = new TH2F("BkgRatioPt","p_{T bkg}/p_{T trigger} vs p_{T trigger}",120,0,120,120,0,2);
- fhBkgRatioPt->SetYTitle("p_{T bkg}/p_{T trigger}");
- fhBkgRatioPt->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhBkgDeltaPhi = new TH2F("BkgDeltaPhi","#phi_{bkg} - #phi_{trigger} vs p_{T trigger}",120,0,120,120,0,TMath::TwoPi());
- fhBkgDeltaPhi->SetYTitle("#Delta #phi (rad)");
- fhBkgDeltaPhi->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhBkgDeltaEta = new TH2F("BkgDeltaEta","#eta_{bkg} - #eta_{trigger} vs p_{T trigger}",120,0,120,120,-2,2);
- fhBkgDeltaEta->SetYTitle("#Delta #eta");
- fhBkgDeltaEta->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhBkgLeadingRatioPt = new TH2F("BkgLeadingRatioPt","p_{T bkg} vs p_{T trigger}",120,0,120,120,0,2);
- fhBkgLeadingRatioPt->SetYTitle("p_{T leading}/p_{T bkg}");
- fhBkgLeadingRatioPt->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhBkgLeadingDeltaPhi = new TH2F("BkgLeadingDeltaPhi","#phi_{bkg} - #phi_{leading} vs p_{T trigger}",120,0,120,120,0,TMath::TwoPi());
- fhBkgLeadingDeltaPhi->SetYTitle("#Delta #phi (rad)");
- fhBkgLeadingDeltaPhi->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhBkgLeadingDeltaEta = new TH2F("BkgLeadingDeltaEta","#eta_{bkg} - #eta_{leading} vs p_{T trigger}",120,0,120,120,-2,2);
- fhBkgLeadingDeltaEta->SetYTitle("#Delta #eta");
- fhBkgLeadingDeltaEta->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhBkgFFz = new TH2F("BkgFFz","z = p_{T i charged}/p_{T trigger} vs p_{T trigger}", 120,0.,120.,200,0.,2);
- fhBkgFFz->SetYTitle("z");
- fhBkgFFz->SetXTitle("p_{T trigger}");
-
- fhBkgFFxi = new TH2F("BkgFFxi","#xi = ln(p_{T trigger}/p_{T i charged}) vs p_{T trigger}", 120,0.,120.,100,0.,10.);
- fhBkgFFxi->SetYTitle("#xi");
- fhBkgFFxi->SetXTitle("p_{T trigger}");
-
- fhBkgFFpt = new TH2F("BkgFFpt","p_{T charged hadron } vs p_{T trigger}", 120,0.,120.,200,0.,50.);
- fhBkgFFpt->SetYTitle("p_{T charged} hadron");
- fhBkgFFpt->SetXTitle("p_{T trigger}");
-
- fhBkgNTracksInCone = new TH2F("BkgNTracksInCone","N particles in cone vs p_{T trigger}",120,0,120,5000,0, 5000);
- fhBkgNTracksInCone->SetYTitle("N tracks in bkg cone");
- fhBkgNTracksInCone->SetXTitle("p_{T trigger} (GeV/c)");
-
- fOutCont->Add(fhBkgPt) ;
- fOutCont->Add(fhBkgRatioPt) ;
- fOutCont->Add(fhBkgDeltaPhi) ;
- fOutCont->Add(fhBkgDeltaEta) ;
- fOutCont->Add(fhBkgLeadingRatioPt) ;
- fOutCont->Add(fhBkgLeadingDeltaPhi) ;
- fOutCont->Add(fhBkgLeadingDeltaEta) ;
- fOutCont->Add(fhBkgFFz) ;
- fOutCont->Add(fhBkgFFxi) ;
- fOutCont->Add(fhBkgFFpt) ;
- fOutCont->Add(fhBkgNTracksInCone) ;
-
- }//not several cones
- else{ //If we want to study the jet for different cones and pt
- for(Int_t icone = 0; icone<fJetNCone; icone++){//icone
- for(Int_t ipt = 0; ipt<fJetNPt;ipt++){ //ipt
-
- TString lastnamehist ="Cone"+ fJetNameCones[icone]+"Pt"+ fJetNamePtThres[ipt];
- TString lastnametitle =", cone ="+fJetNameCones[icone]+", pt > " +fJetNamePtThres[ipt]+" GeV/c";
-
- //Jet Distributions
- fhJetPts[icone][ipt] = new TH2F("JetPt"+lastnamehist,"p_{T jet} vs p_{T trigger}"+lastnametitle,120,0,120,120,0,120);
- fhJetPts[icone][ipt]->SetYTitle("p_{T jet}");
- fhJetPts[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhJetRatioPts[icone][ipt] = new TH2F("JetRatioPt"+lastnamehist,"p_{T jet}/p_{T trigger} vs p_{T trigger}"+lastnametitle,120,0,120,120,0,2);
- fhJetRatioPts[icone][ipt]->SetYTitle("p_{T jet}/p_{T trigger}");
- fhJetRatioPts[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhJetDeltaPhis[icone][ipt] = new TH2F("JetDeltaPhi"+lastnamehist,"#phi_{jet} - #phi_{trigger} vs p_{T trigger}"+lastnametitle,120,0,120,120,0,TMath::TwoPi());
- fhJetDeltaPhis[icone][ipt]->SetYTitle("#Delta #phi (rad)");
- fhJetDeltaPhis[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhJetDeltaEtas[icone][ipt] = new TH2F("JetDeltaEta"+lastnamehist,"#eta_{jet} - #eta_{trigger} vs p_{T trigger}"+lastnametitle,120,0,120,120,-2,2);
- fhJetDeltaEtas[icone][ipt]->SetYTitle("#Delta #eta");
- fhJetDeltaEtas[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhJetLeadingRatioPts[icone][ipt] = new TH2F("JetLeadingRatioPt"+lastnamehist,"p_{T jet} vs p_{T trigger}"+lastnametitle,120,0,120,120,0,2);
- fhJetLeadingRatioPts[icone][ipt]->SetYTitle("p_{T leading}/p_{T jet}");
- fhJetLeadingRatioPts[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhJetLeadingDeltaPhis[icone][ipt] = new TH2F("JetLeadingDeltaPhi"+lastnamehist,"#phi_{jet} - #phi_{leading} vs p_{T trigger}"+lastnametitle,120,0,120,120,0,TMath::TwoPi());
- fhJetLeadingDeltaPhis[icone][ipt]->SetYTitle("#Delta #phi (rad)");
- fhJetLeadingDeltaPhis[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhJetLeadingDeltaEtas[icone][ipt] = new TH2F("JetLeadingDeltaEta"+lastnamehist,"#eta_{jet} - #eta_{leading} vs p_{T trigger}"+lastnametitle,120,0,120,120,-2,2);
- fhJetLeadingDeltaEtas[icone][ipt]->SetYTitle("#Delta #eta");
- fhJetLeadingDeltaEtas[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhJetFFzs[icone][ipt] = new TH2F("JetFFz"+lastnamehist,"z = p_{T i charged}/p_{T trigger} vs p_{T trigger}", 120,0.,120.,200,0.,2);
- fhJetFFzs[icone][ipt]->SetYTitle("z");
- fhJetFFzs[icone][ipt]->SetXTitle("p_{T trigger}");
-
- fhJetFFxis[icone][ipt] = new TH2F("JetFFxi"+lastnamehist,"#xi = ln(p_{T trigger}/p_{T i charged}) vs p_{T trigger}", 120,0.,120.,100,0.,10.);
- fhJetFFxis[icone][ipt]->SetYTitle("#xi");
- fhJetFFxis[icone][ipt]->SetXTitle("p_{T trigger}");
-
- fhJetFFpts[icone][ipt] = new TH2F("JetFFpt"+lastnamehist,"p_{T charged hadron } in jet vs p_{T trigger}", 120,0.,120.,200,0.,50.);
- fhJetFFpts[icone][ipt]->SetYTitle("p_{T charged hadron}");
- fhJetFFpts[icone][ipt]->SetXTitle("p_{T trigger}");
-
- fhJetNTracksInCones[icone][ipt] = new TH2F("JetNTracksInCone"+lastnamehist,"N particles in cone vs p_{T trigger}"+lastnametitle,120,0,120,5000,0, 5000);
- fhJetNTracksInCones[icone][ipt]->SetYTitle("N tracks in jet cone");
- fhJetNTracksInCones[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)");
-
- fOutCont->Add(fhJetPts[icone][ipt]) ;
- fOutCont->Add(fhJetRatioPts[icone][ipt]) ;
- fOutCont->Add(fhJetDeltaPhis[icone][ipt]) ;
- fOutCont->Add(fhJetDeltaEtas[icone][ipt]) ;
- fOutCont->Add(fhJetLeadingRatioPts[icone][ipt]) ;
- fOutCont->Add(fhJetLeadingDeltaPhis[icone][ipt]) ;
- fOutCont->Add(fhJetLeadingDeltaEtas[icone][ipt]) ;
- fOutCont->Add(fhJetFFzs[icone][ipt]) ;
- fOutCont->Add(fhJetFFxis[icone][ipt]) ;
- fOutCont->Add(fhJetFFpts[icone][ipt]) ;
- fOutCont->Add(fhJetNTracksInCones[icone][ipt]) ;
-
- //Bkg Distributions
- fhBkgPts[icone][ipt] = new TH2F("BkgPt"+lastnamehist,"p_{T bkg} vs p_{T trigger}"+lastnametitle,120,0,120,120,0,120);
- fhBkgPts[icone][ipt]->SetYTitle("p_{T bkg}");
- fhBkgPts[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhBkgRatioPts[icone][ipt] = new TH2F("BkgRatioPt"+lastnamehist,"p_{T bkg}/p_{T trigger} vs p_{T trigger}"+lastnametitle,120,0,120,120,0,2);
- fhBkgRatioPts[icone][ipt]->SetYTitle("p_{T bkg}/p_{T trigger}");
- fhBkgRatioPts[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhBkgDeltaPhis[icone][ipt] = new TH2F("BkgDeltaPhi"+lastnamehist,"#phi_{bkg} - #phi_{trigger} vs p_{T trigger}"+lastnametitle,120,0,120,120,0,TMath::TwoPi());
- fhBkgDeltaPhis[icone][ipt]->SetYTitle("#Delta #phi (rad)");
- fhBkgDeltaPhis[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhBkgDeltaEtas[icone][ipt] = new TH2F("BkgDeltaEta"+lastnamehist,"#eta_{bkg} - #eta_{trigger} vs p_{T trigger}"+lastnametitle,120,0,120,120,-2,2);
- fhBkgDeltaEtas[icone][ipt]->SetYTitle("#Delta #eta");
- fhBkgDeltaEtas[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhBkgLeadingRatioPts[icone][ipt] = new TH2F("BkgLeadingRatioPt"+lastnamehist,"p_{T bkg} vs p_{T trigger}"+lastnametitle,120,0,120,120,0,2);
- fhBkgLeadingRatioPts[icone][ipt]->SetYTitle("p_{T leading}/p_{T bkg}");
- fhBkgLeadingRatioPts[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhBkgLeadingDeltaPhis[icone][ipt] = new TH2F("BkgLeadingDeltaPhi"+lastnamehist,"#phi_{bkg} - #phi_{leading} vs p_{T trigger}"+lastnametitle,120,0,120,120,0,TMath::TwoPi());
- fhBkgLeadingDeltaPhis[icone][ipt]->SetYTitle("#Delta #phi (rad)");
- fhBkgLeadingDeltaPhis[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhBkgLeadingDeltaEtas[icone][ipt] = new TH2F("BkgLeadingDeltaEta"+lastnamehist,"#eta_{bkg} - #eta_{leading} vs p_{T trigger}"+lastnametitle,120,0,120,120,-2,2);
- fhBkgLeadingDeltaEtas[icone][ipt]->SetYTitle("#Delta #eta");
- fhBkgLeadingDeltaEtas[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)");
-
- fhBkgFFzs[icone][ipt] = new TH2F("BkgFFz"+lastnamehist,"z = p_{T i charged}/p_{T trigger} vs p_{T trigger}", 120,0.,120.,200,0.,2);
- fhBkgFFzs[icone][ipt]->SetYTitle("z");
- fhBkgFFzs[icone][ipt]->SetXTitle("p_{T trigger}");
-
- fhBkgFFxis[icone][ipt] = new TH2F("BkgFFxi"+lastnamehist,"#xi = ln(p_{T trigger}/p_{T i charged}) vs p_{T trigger}", 120,0.,120.,100,0.,10.);
- fhBkgFFxis[icone][ipt]->SetYTitle("#xi");
- fhBkgFFxis[icone][ipt]->SetXTitle("p_{T trigger}");
-
- fhBkgFFpts[icone][ipt] = new TH2F("BkgFFpt"+lastnamehist,"p_{T charged hadron} in jet vs p_{T trigger}", 120,0.,120.,200,0.,50.);
- fhBkgFFpts[icone][ipt]->SetYTitle("p_{T charged hadron}");
- fhBkgFFpts[icone][ipt]->SetXTitle("p_{T trigger}");
-
- fhBkgNTracksInCones[icone][ipt] = new TH2F("BkgNTracksInCone"+lastnamehist,"N particles in cone vs p_{T trigger}"+lastnametitle,120,0,120,5000,0, 5000);
- fhBkgNTracksInCones[icone][ipt]->SetYTitle("N tracks in bkg cone");
- fhBkgNTracksInCones[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)");
-
- fOutCont->Add(fhBkgPts[icone][ipt]) ;
- fOutCont->Add(fhBkgRatioPts[icone][ipt]) ;
- fOutCont->Add(fhBkgDeltaPhis[icone][ipt]) ;
- fOutCont->Add(fhBkgDeltaEtas[icone][ipt]) ;
- fOutCont->Add(fhBkgLeadingRatioPts[icone][ipt]) ;
- fOutCont->Add(fhBkgLeadingDeltaPhis[icone][ipt]) ;
- fOutCont->Add(fhBkgLeadingDeltaEtas[icone][ipt]) ;
- fOutCont->Add(fhBkgFFzs[icone][ipt]) ;
- fOutCont->Add(fhBkgFFxis[icone][ipt]) ;
- fOutCont->Add(fhBkgFFpts[icone][ipt]) ;
- fOutCont->Add(fhBkgNTracksInCones[icone][ipt]) ;
-
- }//ipt
- } //icone
- }//If we want to study any cone or pt threshold
-
- if(GetDebug()>2){
- printf("All histograms names \n");
-
- for(Int_t i = 0 ; i< fOutCont->GetEntries(); i++)
- printf("Histo i %d name %s",i,((fOutCont->At(i))->GetName()));
- //cout<< (fOutCont->At(i))->GetName()<<endl;
- }
-
- return fOutCont;
-}
-
-//____________________________________________________________________________
-Bool_t AliAnaParticleJetLeadingConeCorrelation::GetLeadingParticle(AliAODParticleCorrelation *particle, TLorentzVector & pLeading)
-{
- //Search Charged or Neutral leading particle, select the highest one and fill AOD
-
- TLorentzVector pLeadingCh(0,0,0,0) ;
- TLorentzVector pLeadingPi0(0,0,0,0) ;
-
- GetLeadingCharge(particle, pLeadingCh) ;
- if(!fJetsOnlyInCTS) GetLeadingPi0(particle, pLeadingPi0) ;
-
- Double_t ptch = pLeadingCh.Pt();
- Double_t ptpi = pLeadingPi0.Pt();
-
- if (ptch > 0 || ptpi > 0){
- if((ptch >= ptpi)){
- if(GetDebug() > 1)printf("Leading found in CTS \n");
- pLeading = pLeadingCh;
- if(GetDebug() > 1) printf("Found Leading: pt %f, phi %f deg, eta %f\n", pLeading.Pt(),pLeading.Phi()*TMath::RadToDeg(),pLeading.Eta()) ;
- //Put leading in AOD
- particle->SetLeading(pLeadingCh);
- particle->SetLeadingDetector("CTS");
- return kTRUE;
- }
- else{
- if(GetDebug() > 1)printf("Leading found in EMCAL \n");
- pLeading = pLeadingPi0;
- if(GetDebug() > 1) printf("Found Leading: pt %f, phi %f, eta %f\n", pLeading.Pt(),pLeading.Phi()*TMath::RadToDeg(),pLeading.Eta()) ;
- //Put leading in AOD
- particle->SetLeading(pLeadingPi0);
- particle->SetLeadingDetector("EMCAL");
- return kTRUE;
- }
- }
-
- if(GetDebug() > 1)printf ("NO LEADING PARTICLE FOUND \n");
-
- return kFALSE;
-
-}
-
-//____________________________________________________________________________
-void AliAnaParticleJetLeadingConeCorrelation::GetLeadingCharge(AliAODParticleCorrelation * particle, TLorentzVector & pLeading)
-{
- //Search for the charged particle with highest pt and with
- //Phi=Phi_trigger-Pi and pT=0.1E_gamma
-
- if(GetAODCTS()){
- Double_t ptTrig = particle->Pt();
- Double_t phiTrig = particle->Phi();
- Double_t rat = -100 ;
- Double_t ptl = -100 ;
- Double_t phil = -100 ;
- Double_t pt = -100.;
- Double_t phi = -100.;
- TVector3 p3;
-
- for(Int_t ipr = 0;ipr < GetAODCTS()->GetEntriesFast() ; ipr ++ ){
- AliAODTrack* track = dynamic_cast<AliAODTrack *>(GetAODCTS()->At(ipr)) ;
- p3.SetXYZ(track->Px(),track->Py(),track->Pz());
- pt = p3.Pt();
- phi = p3.Phi() ;
- if(phi<0) phi+=TMath::TwoPi();
- rat = pt/ptTrig ;
-
- //Selection within angular and energy limits
- if(((phiTrig-phi) > fDeltaPhiMinCut) && ((phiTrig-phi)<fDeltaPhiMaxCut) &&
- (rat > fLeadingRatioMinCut) && (rat < fLeadingRatioMaxCut) && (pt > ptl)) {
- phil = phi ;
- ptl = pt ;
- pLeading.SetVect(p3);
- }
- }// track loop
-
- if(GetDebug() > 1&& ptl>0 ) printf("Leading in CTS: pt %f eta %f phi %f pt/ptTrig %f \n", ptl, pLeading.Eta(), phil,ptl/ptTrig) ;
-
- }//CTS list exist
-}
-
-//____________________________________________________________________________
-void AliAnaParticleJetLeadingConeCorrelation::GetLeadingPi0(AliAODParticleCorrelation * particle, TLorentzVector & pLeading)
-{
- //Search for the neutral pion with highest pt and with
- //Phi=Phi_trigger-Pi and pT=0.1E_gamma
-
- if(GetAODEMCAL()){
- Double_t ptTrig = particle->Pt();
- Double_t phiTrig = particle->Phi();
- Double_t rat = -100 ;
- Double_t ptl = -100 ;
- Double_t phil = -100 ;
- Double_t pt = -100.;
- Double_t phi = -100.;
-
- TLorentzVector gammai;
- TLorentzVector gammaj;
-
- Double_t vertex[] = {0,0,0};
- if(!GetReader()->GetDataType()== AliCaloTrackReader::kMC) GetReader()->GetVertex(vertex);
-
- //Cluster loop, select pairs with good pt, phi and fill AODs or histograms
- for(Int_t iclus = 0;iclus < GetAODEMCAL()->GetEntriesFast() ; iclus ++ ){
- AliAODCaloCluster * calo = dynamic_cast< AliAODCaloCluster *>(GetAODEMCAL()->At(iclus)) ;
-
- //Cluster selection, not charged, with photon or pi0 id and in fidutial cut
- Int_t pdgi=0;
- if(!SelectCluster(calo,vertex, gammai, pdgi)) continue ;
-
- if(GetDebug() > 2) printf("neutral cluster: pt %f, phi %f \n", gammai.Pt(),gammai.Phi());
-
- //2 gamma overlapped, found with PID
- if(pdgi == AliCaloPID::kPi0){
- pt = gammai.Pt();
- rat = pt/ptTrig;
- phi = gammai.Phi();
- if(phi<0) phi+=TMath::TwoPi();
-
- //Selection within angular and energy limits
- if(ptl > pt && rat > fLeadingRatioMinCut && rat < fLeadingRatioMaxCut &&
- (phiTrig-phil) > fDeltaPhiMinCut && (phiTrig-phil) < fDeltaPhiMaxCut )
- {
- phi = phil ;
- pt = ptl ;
- pLeading.SetPxPyPzE(gammai.Px(),gammai.Py(),gammai.Pz(),gammai.E());
- }// cuts
- }// pdg = AliCaloPID::kPi0
- //Make invariant mass analysis
- else if(pdgi == AliCaloPID::kPhoton){
- //Search the photon companion in case it comes from a Pi0 decay
- //Apply several cuts to select the good pair
- for(Int_t jclus = iclus+1; jclus < GetAODEMCAL()->GetEntriesFast() ; jclus ++ ){
- AliAODCaloCluster * calo2 = dynamic_cast< AliAODCaloCluster *>(GetAODEMCAL()->At(jclus)) ;
-
- //Cluster selection, not charged with photon or pi0 id and in fidutial cut
- Int_t pdgj=0;
- if(!SelectCluster(calo2,vertex, gammaj, pdgj)) continue ;
-
- if(pdgj == AliCaloPID::kPhoton ){
-
- pt = (gammai+gammaj).Pt();
- phi = (gammai+gammaj).Phi();
- rat = pt/ptTrig;
-
- //Selection within angular and energy limits
- if(ptl > pt && rat > fLeadingRatioMinCut && rat < fLeadingRatioMaxCut &&
- (phiTrig-phil) > fDeltaPhiMinCut && (phiTrig-phil) < fDeltaPhiMaxCut ){
- //Select good pair (aperture and invariant mass)
- if(GetNeutralMesonSelection()->SelectPair(gammai, gammaj)){
- phi = phil ;
- pt = ptl ;
- pLeading=(gammai+gammaj);
- }//pi0 selection
-
- if(GetDebug() > 3 ) printf("Neutral Hadron Correlation: Selected gamma pair: pt %2.2f, phi %2.2f, eta %2.2f, M %2.3f\n",
- (gammai+gammaj).Pt(),(gammai+gammaj).Phi(),(gammai+gammaj).Eta(), (gammai+gammaj).M());
- }//Pair selected as leading
- }//if pair of gammas
- }//2nd loop
- }// if pdg = 22
- }// 1st Loop
-
- if(GetDebug()>2 && pLeading.Pt() >0 ) printf("Leading EMCAL: pt %f eta %f phi %f pt/Eg %f \n", pLeading.Pt(), pLeading.Eta(), pLeading.Phi(), pLeading.Pt()/ptTrig) ;
-
- }//EMCAL list exists
-
-}
-
-//____________________________________________________________________________
-void AliAnaParticleJetLeadingConeCorrelation::InitParameters()
-{
-
- //Initialize the parameters of the analysis.
- fJetsOnlyInCTS = kFALSE ;
- fPbPb = kFALSE ;
- fReMakeJet = kFALSE ;
-
- //Leading selection parameters
- fDeltaPhiMinCut = 2.9 ;
- fDeltaPhiMaxCut = 3.4 ;
- fLeadingRatioMinCut = 0.1;
- fLeadingRatioMaxCut = 1.5;
-
- //Jet selection parameters
- //Fixed cut
- fJetRatioMaxCut = 1.2 ;
- fJetRatioMinCut = 0.3 ;
- fJetCTSRatioMaxCut = 1.2 ;
- fJetCTSRatioMinCut = 0.3 ;
- fSelect = 0 ; //0, Accept all jets, 1, selection depends on energy, 2 fixed selection
-
- //Cut depending on gamma energy
- fPtTriggerSelectionCut = 10.; //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
-
- fJetCone = 0.3 ;
- fJetPtThreshold = 0.5 ;
- fJetPtThresPbPb = 2. ;
- fJetNCone = 4 ;
- fJetNPt = 4 ;
- fJetCones[0] = 0.2 ; fJetNameCones[0] = "02" ;
- fJetCones[1] = 0.3 ; fJetNameCones[1] = "03" ;
- fJetCones[2] = 0.4 ; fJetNameCones[2] = "04" ;
- fJetCones[2] = 0.5 ; fJetNameCones[2] = "05" ;
-
- fJetPtThres[0] = 0.0 ; fJetNamePtThres[0] = "00" ;
- fJetPtThres[1] = 0.5 ; fJetNamePtThres[1] = "05" ;
- fJetPtThres[2] = 1.0 ; fJetNamePtThres[2] = "10" ;
- fJetPtThres[3] = 2.0 ; fJetNamePtThres[3] = "20" ;
-}
-
-//__________________________________________________________________________-
-Bool_t AliAnaParticleJetLeadingConeCorrelation::IsJetSelected(const Double_t ptTrig, const Double_t ptjet){
- //Given the pt of the jet and the trigger particle, select the jet or not
- //3 options, fSelect=0 accepts all, fSelect=1 selects jets depending on a
- //function energy dependent and fSelect=2 selects on simple fixed cuts
-
- if(ptjet == 0) return kFALSE;
-
- Double_t rat = ptTrig / ptjet ;
-
- //###############################################################
- if(fSelect == 0)
- return kTRUE; //Accept all jets, no restriction
- //###############################################################
- else if(fSelect == 1){
- //Check if the energy of the reconstructed jet is within an energy window
- //WARNING: to be rechecked, don't remember what all the steps mean
- 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/ptTrig)
- //X_jet = fJetX1[0]+fJetX2[0]*e_gamma
-
- }
- else{
- if(ptTrig > fPtTriggerSelectionCut){
- //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/ptTrig) 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/ptTrig) 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(ptTrig, par, xmin);
- Double_t max = CalculateJetRatioLimit(ptTrig, 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,ptjet,ptTrig,rat));
-
- if(( min < rat ) && ( max > ptjet/rat))
- return kTRUE;
- else
- return kFALSE;
- }//fSelect = 1
- //###############################################################
- else if(fSelect == 2){
- //Simple selection
- if(!fJetsOnlyInCTS){
- if((rat < fJetRatioMaxCut) && (rat > fJetRatioMinCut )) return kTRUE;
- }
- else{
- if((rat < fJetCTSRatioMaxCut) && (rat > fJetCTSRatioMinCut )) return kTRUE;
- }
- }// fSelect = 2
- //###############################################################
- else{
- AliError("Jet selection option larger than 2, DON'T SELECT JETS");
- return kFALSE ;
- }
-
- return kFALSE;
-
-}
-
-//___________________________________________________________________
-Bool_t AliAnaParticleJetLeadingConeCorrelation::IsParticleInJetCone(const Double_t eta, Double_t phi, const Double_t etal, Double_t phil)
-{
- //Check if the particle is inside the cone defined by the leading particle
- //WARNING: To be rechecked
-
- if(phi < 0) phi+=TMath::TwoPi();
- if(phil < 0) phil+=TMath::TwoPi();
- Double_t rad = 10000 + fJetCone;
-
- if(TMath::Abs(phi-phil) <= (TMath::TwoPi() - fJetCone))
- rad = TMath::Sqrt(TMath::Power(eta-etal,2)+TMath::Power(phi-phil,2));
- else{
- if(phi-phil > TMath::TwoPi() - fJetCone)
- rad = TMath::Sqrt(TMath::Power(eta-etal,2)+TMath::Power((phi-TMath::TwoPi())-phil,2));
- if(phi-phil < -(TMath::TwoPi() - fJetCone))
- rad = TMath::Sqrt(TMath::Power(eta-etal,2)+TMath::Power((phi+TMath::TwoPi())-phil,2));
- }
-
- if(rad < fJetCone) return kTRUE ;
- else return kFALSE ;
-
-}
-
-//__________________________________________________________________
-void AliAnaParticleJetLeadingConeCorrelation::MakeAnalysisFillAOD()
-{
- //Particle-Hadron Correlation Analysis, fill AODs
- if(GetDebug() > 1){
- printf("Begin jet leading cone correlation analysis, fill AODs \n");
- printf("In particle branch aod entries %d\n", GetAODBranch()->GetEntriesFast());
- printf("In CTS aod entries %d\n", GetAODCTS()->GetEntriesFast());
- printf("In EMCAL aod entries %d\n", GetAODEMCAL()->GetEntriesFast());
- }
-
- TLorentzVector pLeading(0,0,0,0); //It will contain the kinematics of the found leading particle
-
- //Loop on stored AOD particles, trigger
- Int_t naod = GetAODBranch()->GetEntriesFast();
- for(Int_t iaod = 0; iaod < naod ; iaod++){
- AliAODParticleCorrelation* particle = dynamic_cast<AliAODParticleCorrelation*> (GetAODBranch()->At(iaod));
-
- //Search leading particles in CTS and EMCAL
- if(GetLeadingParticle(particle, pLeading)){
-
- //Construct the jet around the leading, Fill AOD jet particle list, select jet
- //and fill AOD with jet and background
- MakeAODJet(particle, pLeading);
-
- }//Leading found
- }//AOD trigger particle loop
-
- if(GetDebug() >1)printf("End of jet leading cone analysis, fill AODs \n");
-
-}
-
-//__________________________________________________________________
-void AliAnaParticleJetLeadingConeCorrelation::MakeAnalysisFillHistograms()
-{
-
- //Particle-Hadron Correlation Analysis, fill AODs
- if(GetDebug() > 1){
- printf("Begin jet leading cone correlation analysis, fill histograms \n");
- printf("In particle branch aod entries %d\n", GetAODBranch()->GetEntriesFast());
- printf("In CTS aod entries %d\n", GetAODCTS()->GetEntriesFast());
- printf("In EMCAL aod entries %d\n", GetAODEMCAL()->GetEntriesFast());
- }
-
- TLorentzVector pLeading(0,0,0,0) ;
-
- //Loop on stored AOD particles, trigger
- Int_t naod = GetAODBranch()->GetEntriesFast();
- for(Int_t iaod = 0; iaod < naod ; iaod++){
- AliAODParticleCorrelation* particle = dynamic_cast<AliAODParticleCorrelation*> (GetAODBranch()->At(iaod));
-
- Double_t pt = particle->Pt();
- Double_t phi = particle->Phi();
- Double_t eta = particle->Eta();
-
- //Get leading particle, fill histograms
- pLeading = particle->GetLeading();
- TString det = particle->GetLeadingDetector();
-
- if(det!="" && pLeading.Pt() > 0){
- Double_t ptL = pLeading.Pt();
- Double_t phiL = pLeading.Phi();
- if(phiL < 0 ) phiL+=TMath::TwoPi();
- Double_t etaL = pLeading.Eta();
-
- if(GetDebug() > 1) printf("Leading found in %s, with pt %3.2f, phi %2.2f, eta %2.2f\n",det.Data(), ptL, phiL, etaL);
- if(det == "CTS"){
- fhChargedLeadingPt->Fill(pt,ptL);
- fhChargedLeadingPhi->Fill(pt,phiL);
- fhChargedLeadingEta->Fill(pt,etaL);
- fhChargedLeadingDeltaPt->Fill(pt,pt-ptL);
- fhChargedLeadingDeltaPhi->Fill(pt,phi-phiL);
- fhChargedLeadingDeltaEta->Fill(pt,eta-etaL);
- fhChargedLeadingRatioPt->Fill(pt,ptL/pt);
- }
- else if(det== "EMCAL"){
- fhNeutralLeadingPt->Fill(pt,ptL);
- fhNeutralLeadingPhi->Fill(pt,phiL);
- fhNeutralLeadingEta->Fill(pt,etaL);
- fhNeutralLeadingDeltaPt->Fill(pt,pt-ptL);
- fhNeutralLeadingDeltaPhi->Fill(pt,phi-phiL);
- fhNeutralLeadingDeltaEta->Fill(pt,eta-etaL);
- fhNeutralLeadingRatioPt->Fill(pt,ptL/pt);
- }
-
- //Fill Jet histograms
- TLorentzVector bkg(0,0,0,0);
- TLorentzVector jet(0,0,0,0);
- if(!fSeveralConeAndPtCuts){//just fill histograms
- if(!fReMakeJet){
- jet=particle->GetCorrelatedJet();
- bkg=particle->GetCorrelatedBackground();
- }
- else MakeJetFromAOD(particle, pLeading, jet,bkg);
-
- if(jet.Pt() > 0){//Jet was found
- FillJetHistos(particle, pLeading, jet,"Jet","");
- FillJetHistos(particle, pLeading, bkg,"Bkg","");
- }
- }
- else if(fSeveralConeAndPtCuts){
- for(Int_t icone = 0; icone<fJetNCone; icone++) {
- fJetCone=fJetCones[icone];
- for(Int_t ipt = 0; ipt<fJetNPt;ipt++) {
- TString lastname ="Cone"+ fJetNameCones[icone]+"Pt"+ fJetNamePtThres[ipt];
- fJetPtThreshold=fJetPtThres[ipt];
- MakeJetFromAOD(particle, pLeading, jet,bkg);
- if(jet.Pt() > 0) {//Jet was found
- FillJetHistos(particle, pLeading, jet,"Jet",lastname);
- FillJetHistos(particle, pLeading, bkg,"Bkg",lastname);
- }
- }//icone
- }//ipt
- }//fSeveralConeAndPtCuts
- }//Leading
- }//AOD trigger particle loop
-
- if(GetDebug() >1)printf("End of jet leading cone analysis, fill histograms \n");
-
-}
-
-//____________________________________________________________________________
-void AliAnaParticleJetLeadingConeCorrelation::MakeAODJet(AliAODParticleCorrelation *particle, const TLorentzVector pLeading)
-{
- //Fill the jet with the particles around the leading particle with
- //R=fJetCone and pt_th = fJetPtThres. Calculate the energy of the jet and
- //fill aod with found information
-
- TLorentzVector bkg(0,0,0,0);
- TLorentzVector jet(0,0,0,0);
- TLorentzVector lv (0,0,0,0); //Temporal container for jet particles kinematics
-
- Double_t ptTrig = particle->Pt();
- Double_t phiTrig = particle->Phi();
- Double_t phil = pLeading.Phi();
- if(phil<0) phil+=TMath::TwoPi();
- Double_t etal = pLeading.Eta();
-
- //Different pt cut for jet particles in different collisions systems
- Float_t ptcut = fJetPtThreshold;
- if(fPbPb && !fSeveralConeAndPtCuts && ptTrig > fPtTriggerSelectionCut) ptcut = fJetPtThresPbPb ;
-
- //Add charged particles to jet if they are in cone around the leading particle
- if(!GetAODCTS()) {
- AliFatal("Cannot construct jets without tracks, STOP analysis");
- return;
- }
-
- //Fill jet with tracks
- TVector3 p3;
- for(Int_t ipr = 0;ipr < (GetAODCTS())->GetEntriesFast() ; ipr ++ ){
- AliAODTrack* track = dynamic_cast<AliAODTrack *>((GetAODCTS())->At(ipr)) ;
- p3.SetXYZ(track->Px(),track->Py(),track->Pz());
-
- //Particles in jet
- if(IsParticleInJetCone(p3.Eta(), p3.Phi(), etal, phil)){
- particle->AddTrack(track);
- if(p3.Pt() > ptcut ){
- lv.SetVect(p3);
- jet+=lv;
- }
- }
- //Background around (phi_gamma-pi, eta_leading)
- else if(IsParticleInJetCone(p3.Eta(),p3.Phi(),etal, phiTrig)) {
- particle->AddBackgroundTrack(track);
- if(p3.Pt() > ptcut ){
- lv.SetVect(p3);
- bkg+=lv;
- }
- }
- }//Track loop
-
- //Add neutral particles to jet
- if(!fJetsOnlyInCTS && GetAODEMCAL()){
-
- Double_t vertex[] = {0,0,0};
- if(!GetReader()->GetDataType()== AliCaloTrackReader::kMC) GetReader()->GetVertex(vertex);
-
- for(Int_t iclus = 0;iclus < (GetAODEMCAL())->GetEntriesFast() ; iclus ++ ){
- AliAODCaloCluster * calo = dynamic_cast< AliAODCaloCluster *>(GetAODEMCAL()->At(iclus)) ;
-
- //Cluster selection, not charged
- if(calo->GetNTracksMatched() > 0) continue ;
-
- calo->GetMomentum(lv,vertex);
- //Particles in jet
- if(IsParticleInJetCone(lv.Eta(),lv.Phi(), etal, phil)){
- particle->AddCluster(calo);
- if(lv.Pt() > ptcut ) jet+=lv;
- }
- //Background around (phi_gamma-pi, eta_leading)
- else if(IsParticleInJetCone(lv.Eta(),lv.Phi(),etal, phiTrig)){
- particle->AddBackgroundCluster(calo);
- if(lv.Pt() > ptcut ) bkg+=lv;
- }
- }//cluster loop
- }//jets with neutral particles
-
- //If there is any jet found, select after some criteria and
- //and fill AOD with corresponding TLorentzVector kinematics
- if(IsJetSelected(particle->Pt(), jet.Pt())) {
- particle->SetCorrelatedJet(jet);
- particle->SetCorrelatedBackground(bkg);
- if(GetDebug()>1) printf("Found jet: Trigger pt %f, Jet pt %f, Bkg pt %f\n",ptTrig,jet.Pt(),bkg.Pt());
- }
-
-}
-
-//____________________________________________________________________________
-void AliAnaParticleJetLeadingConeCorrelation::MakeJetFromAOD(AliAODParticleCorrelation *particle, const TLorentzVector pLeading, TLorentzVector & jet, TLorentzVector & bkg)
-{
- //Fill the jet with the particles around the leading particle with
- //R=fJetCone and pt_th = fJetPtThres. Calculate the energy of the jet and
- //fill aod tlorentzvectors with jet and bakcground found
-
- TLorentzVector lv (0,0,0,0); //Temporal container for jet particles kinematics
-
- Double_t ptTrig = particle->Pt();
- Double_t phiTrig = particle->Phi();
- Double_t phil = pLeading.Phi();
- Double_t etal = pLeading.Eta();
-
- //Different pt cut for jet particles in different collisions systems
- Float_t ptcut = fJetPtThreshold;
- if(fPbPb && !fSeveralConeAndPtCuts && ptTrig > fPtTriggerSelectionCut) ptcut = fJetPtThresPbPb ;
-
- //Fill jet with tracks
- //Particles in jet
- TVector3 p3;
- for(Int_t ipr = 0;ipr < (particle->GetRefTracks())->GetEntriesFast() ; ipr ++ ){
- AliAODTrack* track = dynamic_cast<AliAODTrack *>((particle-> GetRefTracks())->At(ipr)) ;
- p3.SetXYZ(track->Px(),track->Py(),track->Pz());
- if(p3.Pt() > ptcut && IsParticleInJetCone(p3.Eta(), p3.Phi(), etal, phil) ){
- lv.SetVect(p3);
- jet+=lv;
- }
- }//jet Track loop
-
- //Particles in background
- for(Int_t ipr = 0;ipr < (particle-> GetRefBackgroundTracks())->GetEntriesFast() ; ipr ++ ){
- AliAODTrack* track = dynamic_cast<AliAODTrack *>((particle->GetRefBackgroundTracks())->At(ipr)) ;
- p3.SetXYZ(track->Px(),track->Py(),track->Pz());
- if(p3.Pt() > ptcut && IsParticleInJetCone(p3.Eta(),p3.Phi(),etal, phiTrig) ) {
- lv.SetVect(p3);
- bkg+=lv;
- }
- }//background Track loop
-
- //Add neutral particles to jet
- if(!fJetsOnlyInCTS && (particle->GetRefClusters())){
-
- Double_t vertex[] = {0,0,0};
- if(!GetReader()->GetDataType()== AliCaloTrackReader::kMC) GetReader()->GetVertex(vertex);
-
- //Loop on jet particles
- for(Int_t iclus = 0;iclus < (particle->GetRefClusters())->GetEntriesFast() ; iclus ++ ){
- AliAODCaloCluster * calo = dynamic_cast< AliAODCaloCluster *>((particle->GetRefClusters())->At(iclus)) ;
- calo->GetMomentum(lv,vertex);
- if(lv.Pt() > ptcut && IsParticleInJetCone(lv.Eta(),lv.Phi(), etal, phil)) jet+=lv;
- }//jet cluster loop
-
- //Loop on background particles
- for(Int_t iclus = 0;iclus < (particle->GetRefClusters())->GetEntriesFast() ; iclus ++ ){
- AliAODCaloCluster * calo = dynamic_cast< AliAODCaloCluster *>((particle->GetRefClusters())->At(iclus)) ;
- calo->GetMomentum(lv,vertex);
- if( lv.Pt() > ptcut &&IsParticleInJetCone(lv.Eta(),lv.Phi(),etal, phiTrig)) bkg+=lv;
- }//background cluster loop
- }//clusters in jet
-
- //If there is any jet found, leave jet and bkg as they are,
- //if not set them to 0.
- if(!IsJetSelected(particle->Pt(), jet.Pt())) {
- jet.SetPxPyPzE(0.,0.,0.,0.);
- bkg.SetPxPyPzE(0.,0.,0.,0.);
- }
- else
- if(GetDebug()>1) printf("Found jet: Trigger pt %f, Jet pt %f, Bkg pt %f\n",ptTrig,jet.Pt(),bkg.Pt());
-
-}
-
-//____________________________________________________________________________
-Bool_t AliAnaParticleJetLeadingConeCorrelation::SelectCluster(AliAODCaloCluster * calo, Double_t *vertex, TLorentzVector & mom, Int_t & pdg){
- //Select cluster depending on its pid and acceptance selections
-
- //Skip matched clusters with tracks
- if(calo->GetNTracksMatched() > 0) return kFALSE;
-
- //Check PID
- calo->GetMomentum(mom,vertex);//Assume that come from vertex in straight line
- pdg = AliCaloPID::kPhoton;
- if(IsCaloPIDOn()){
- //Get most probable PID, 2 options check PID weights (in MC this option is mandatory)
- //or redo PID, recommended option for EMCal.
- if(!IsCaloPIDRecalculationOn() || GetReader()->GetDataType() == AliCaloTrackReader::kMC )
- pdg = GetCaloPID()->GetPdg("EMCAL",calo->PID(),mom.E());//PID with weights
- else
- pdg = GetCaloPID()->GetPdg("EMCAL",mom,calo->GetM02(),0,0,0,0);//PID recalculated
-
- if(GetDebug() > 1) printf("PDG of identified particle %d\n",pdg);
- //If it does not pass pid, skip
- if(pdg != AliCaloPID::kPhoton || pdg != AliCaloPID::kPi0)
- return kFALSE ;
- }//CaloPID
-
- //Check acceptance selection
- if(IsFidutialCutOn()){
- Bool_t in = GetFidutialCut()->IsInFidutialCut(mom,"EMCAL") ;
- if(! in ) return kFALSE ;
- }
-
- if(GetDebug() > 1) printf("cluster selection cuts passed: pT %3.2f, pdg %d\n",mom.Pt(), pdg);
-
- return kTRUE;
-
-}
-
-//__________________________________________________________________
-void AliAnaParticleJetLeadingConeCorrelation::Print(const Option_t * opt) const
-{
-
- //Print some relevant parameters set for the analysis
- if(! opt)
- return;
-
- Info("Print", "%s %s", GetName(), GetTitle() ) ;
-
- if(fJetsOnlyInCTS)printf("Jets reconstructed in CTS \n");
- else printf("Jets reconstructed in CTS+EMCAL \n");
-
- if(fPbPb) printf("PbPb events, pT cut in jet cone energy reconstruction %2.1f \n", fJetPtThreshold);
- else printf("pp events, pT cut in jet cone energy reconstruction %2.1f \n", fJetPtThresPbPb);
-
- printf("If pT of trigger < %f, select jets as in pp? \n", fPtTriggerSelectionCut);
-
- printf("Phi gamma-Leading < %3.2f\n", fDeltaPhiMaxCut) ;
- printf("Phi gamma-Leading > %3.2f\n", fDeltaPhiMinCut) ;
- printf("pT Leading / pT Trigger < %3.2f\n", fLeadingRatioMaxCut) ;
- printf("pT Leading / pT Trigger > %3.2f\n", fLeadingRatioMinCut) ;
-
- if(fSelect == 2){
- printf("pT Jet / pT Gamma < %3.2f\n", fJetRatioMaxCut) ;
- printf("pT Jet / pT Gamma > %3.2f\n", fJetRatioMinCut) ;
- printf("pT Jet (Only CTS)/ pT Trigger < %3.2f\n", fJetCTSRatioMaxCut) ;
- printf("pT Jet (Only CTS)/ pT Trigger > %3.2f\n", fJetCTSRatioMinCut) ;
- }
- else if(fSelect == 0)
- printf("Accept all reconstructed jets \n") ;
- else if(fSelect == 1)
- printf("Accept jets depending on trigger energy \n") ;
- else
- printf("Wrong jet selection option: %d \n", fSelect) ;
-
-}
+++ /dev/null
-#ifndef AliAnaParticleJetLeadingConeCorrelation_H
-#define AliAnaParticleJetLeadingConeCorrelation_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-/* $Id: $ */
-
-//_________________________________________________________________________
-// Class that contains the algorithm for the reconstruction of jet, cone around leading particle
-// The seed is a backward particle (direct photon)
-// 1)Take the a trigger particle found stored in AliAODParticleCorrelation,
-// 2) Search for the highest pt leading particle opposite to the trigger within a phi, pt window
-// 3) Take all particles around leading in a cone R with pt larger than threshold and construct the jet
-//
-// Class created from old AliPHOSGammaJet
-// (see AliRoot versions previous Release 4-09)
-//
-//-- Author: Gustavo Conesa (INFN-LNF)
-
-// --- ROOT system ---
-class TH2F;
-
-//---- Analysis system ----
-class AliAODTrack;
-class AliAODCaloCluster;
-class AliCaloTrackReader;
-class AliNeutralMesonSelection;
-class AliLog;
-
-#include "AliAnaPartCorrBaseClass.h"
-
-class AliAnaParticleJetLeadingConeCorrelation : public AliAnaPartCorrBaseClass {
-
-public:
-
- AliAnaParticleJetLeadingConeCorrelation() ; // default ctor
- AliAnaParticleJetLeadingConeCorrelation(const AliAnaParticleJetLeadingConeCorrelation & g) ; // cpy ctor
- AliAnaParticleJetLeadingConeCorrelation & operator = (const AliAnaParticleJetLeadingConeCorrelation & g) ;//cpy assignment
- virtual ~AliAnaParticleJetLeadingConeCorrelation() ; //virtual dtor
-
- TList * GetCreateOutputObjects();
-
- void InitParameters();
-
- void Print(const Option_t * opt) const;
-
- Bool_t AreJetsRecalculated() const {return fReMakeJet ; }
- void SwitchOnJetsRecalculation(){fReMakeJet = kTRUE; }
- void SwitchOffJetsRecalculation(){fReMakeJet = kFALSE; }
-
- Bool_t AreJetsOnlyInCTS() const {return fJetsOnlyInCTS ; }
- void SwitchOnJetsOnlyInCTS(){fJetsOnlyInCTS = kTRUE; }
- void SwitchOffJetsOnlyInCTS(){fJetsOnlyInCTS = kFALSE; }
-
- Bool_t AreSeveralConeAndPtCuts() const {return fSeveralConeAndPtCuts ; }
- void SwitchOnSeveralConeAndPtCuts(){fSeveralConeAndPtCuts = kTRUE ;}
- void SwitchOffSeveralConeAndPtCuts(){fSeveralConeAndPtCuts = kFALSE ;}
-
- Bool_t IsPbPb() const {return fPbPb ; }
- void SetppCollisions(){fPbPb = kFALSE; }
- void SetPbPbCollisions(){fPbPb = kTRUE; }
-
- Double_t GetDeltaPhiMaxCut() const {return fDeltaPhiMaxCut ; }
- Double_t GetDeltaPhiMinCut() const {return fDeltaPhiMinCut ; }
- Double_t GetLeadingRatioMaxCut() const {return fLeadingRatioMaxCut ; }
- Double_t GetLeadingRatioMinCut() const {return fLeadingRatioMinCut ; }
-
- Double_t GetPtTriggerSelectionCut() const {return fPtTriggerSelectionCut ; }
- Double_t GetJetRatioMaxCut() const {return fJetRatioMaxCut ; }
- Double_t GetJetRatioMinCut() const {return fJetRatioMinCut ; }
-
- void SetPtTriggerSelectionCut(Double_t cut){fPtTriggerSelectionCut = cut; }
- void SetJetSelectionMode(UInt_t select){ fSelect= select ; }
-
- Int_t GetJetNCones() const {return fJetNCone ; }
- Int_t GetJetNPtThres() const {return fJetNPt ; }
- Float_t GetJetCone() const {return fJetCone ; }
- Float_t GetJetPtThreshold() const {return fJetPtThreshold ; }
- Float_t GetJetPtThresPbPb() const {return fJetPtThresPbPb ; }
- Float_t GetJetCones(Int_t i) const {return fJetCones[i] ; }
- Float_t GetJetPtThreshold(Int_t i) const {return fJetPtThres[i] ; }
- TString GetJetConeName(Int_t i) const {return fJetNameCones[i] ; }
- TString GetJetPtThresName(Int_t i) const {return fJetNamePtThres[i] ; }
-
-
- void SetDeltaPhiCutRange(Double_t phimin, Double_t phimax)
- {fDeltaPhiMaxCut =phimax; fDeltaPhiMinCut =phimin;}
- void SetLeadingRatioCutRange(Double_t ratiomin, Double_t ratiomax)
- {fLeadingRatioMaxCut =ratiomax; fLeadingRatioMinCut = ratiomin ; }
-
- void SetJetNCones(Int_t n){fJetNCone = n ; }
- void SetJetNPtThresholds(Int_t n){fJetNPt = n ; }
- void SetJetCones(Int_t i, Float_t cone, TString sc)
- {fJetCones[i] = cone ; fJetNameCones[i] = sc; };
- void SetCone(Float_t cone)
- {fJetCone = cone; }
- void SetJetPtThreshold(Float_t pt){fJetPtThreshold = pt; };
- void SetJetPtThresPbPb(Float_t pt){fJetPtThresPbPb = pt; };
- void SetJetPtThresholds(Int_t i,Float_t pt, TString spt){fJetPtThres[i] = pt ;
- fJetNamePtThres[i] = spt; };
-
- void SetJetRatioCutRange(Double_t ratiomin, Double_t ratiomax)
- {fJetRatioMaxCut =ratiomax; fJetRatioMinCut = ratiomin ; }
- void SetJetCTSRatioCutRange(Double_t ratiomin, Double_t ratiomax)
- {fJetCTSRatioMaxCut =ratiomax; fJetCTSRatioMinCut = ratiomin ; }
-
- private:
-
- Double_t CalculateJetRatioLimit(const Double_t ptTrig, const Double_t *param, const Double_t *x);
-
- void FillJetHistos(AliAODParticleCorrelation * particle, const TLorentzVector leading, const TLorentzVector jet, const TString type, const TString lastname);
-
- TList * GetOutputContainer() {return fOutCont; }
-
- Bool_t IsJetSelected(const Double_t ptTrig, const Double_t ptjet);
- Bool_t IsParticleInJetCone(const Double_t eta, Double_t phi, const Double_t etal, Double_t phil);
-
- void GetLeadingCharge(AliAODParticleCorrelation *particle, TLorentzVector & pLeading) ;
- void GetLeadingPi0 (AliAODParticleCorrelation *particle, TLorentzVector & pLeading) ;
- Bool_t GetLeadingParticle(AliAODParticleCorrelation *particle, TLorentzVector & pLeading) ;
-
- void MakeAnalysisFillAOD();
- void MakeAnalysisFillHistograms();
- void MakeAODJet(AliAODParticleCorrelation * particle, const TLorentzVector pLeading);
- void MakeJetFromAOD(AliAODParticleCorrelation * particle, const TLorentzVector pLeading,
- TLorentzVector & jet, TLorentzVector & bkg);
-
- Bool_t SelectCluster(AliAODCaloCluster * calo, Double_t *vertex, TLorentzVector & mom, Int_t & pdg) ;
-
- private:
-
- Bool_t fJetsOnlyInCTS ; // Jets measured only in TPC+ITS.
- Bool_t fPbPb; // PbPb event
- Bool_t fSeveralConeAndPtCuts; // To play with the jet cone size and pt th.
- Bool_t fReMakeJet ; //Re make the jet reconstruction from AODParticleCorrelation input
-
- //Leading particle selection parameters
- Double_t fDeltaPhiMaxCut ; // Minimum Delta Phi Gamma-Leading
- Double_t fDeltaPhiMinCut ; // Maximum Delta Phi Gamma-Leading
- Double_t fLeadingRatioMaxCut ; // Leading /gamma Ratio cut maximum
- Double_t fLeadingRatioMinCut ; // Leading/gamma Ratio cut minimum
-
- //Jet selection parameters
- //Fixed cuts (old)
- Double_t fJetCTSRatioMaxCut ; // Jet(CTS) /gamma Ratio cut maximum
- Double_t fJetCTSRatioMinCut ; // Jet(CTS) /gamma Ratio cut maximum
- Double_t fJetRatioMaxCut ; // Jet(EMCAL+CTS)/gamma Ratio cut maximum
- Double_t fJetRatioMinCut ; // Jet(EMCAL+CTS)/gamma Ratio cut minimum
-
- //Cuts depending on jet pt
- Double_t fJetE1[2]; //Rec. jet energy parameters
- Double_t fJetE2[2]; //Rec. jet energy parameters
- Double_t fJetSigma1[2];//Rec. sigma of jet energy parameters
- Double_t fJetSigma2[2];//Rec. sigma of jet energy parameters
- Double_t fBkgMean[6]; //Background mean energy
- Double_t fBkgRMS[6]; //Background RMS
- Double_t fJetXMin1[6]; //X Factor to set jet min limit for pp
- Double_t fJetXMin2[6]; //X Factor to set jet min limit for PbPb
- Double_t fJetXMax1[6]; //X Factor to set jet max limit for pp
- Double_t fJetXMax2[6]; //X Factor to set jet max limit for PbPb
-
- Int_t fJetNCone ; // Number of jet cones sizes, maximum 5
- Int_t fJetNPt ; // Number of jet particle pT threshold, maximum 5
- Double_t fJetCone ; // Jet cone sizes under study (!fSeveralConeAndPtCuts)
- Double_t fJetCones[5]; // Jet cone sizes under study (fSeveralConeAndPtCuts)
- TString fJetNameCones[5]; // String name of cone to append to histos
- Double_t fJetPtThreshold; // Jet pT threshold under study(!fSeveralConeAndPtCuts)
- Double_t fJetPtThresPbPb; // Jet pT threshold under study(!fSeveralConeAndPtCuts)
- Double_t fJetPtThres[5]; // Jet pT threshold under study(fSeveralConeAndPtCuts)
- TString fJetNamePtThres[5]; // String name of pt th to append to histos
- Double_t fPtTriggerSelectionCut; // Jet pt to change to low pt jets analysis
- UInt_t fSelect ; //kTRUE: Selects all jets, no limits.
-
- //Histograms
- //Leading particle distributions
- TList * fOutCont ; //! Container for histograms
-
- TH2F * fhChargedLeadingPt ; //! Pt(Pt trigger) distribution of charged hadrons
- TH2F * fhChargedLeadingPhi ; //! Phi(Pt trigger) distribution of charged hadrons
- TH2F * fhChargedLeadingEta ; //! Eta(Pt trigger) distribution of charged hadrons
- TH2F * fhChargedLeadingDeltaPt ; //! Difference of charged hadron and trigger pT as function of trigger p
- TH2F * fhChargedLeadingDeltaPhi ; //! Difference of charged hadron and trigger phi as function of trigger pT
- TH2F * fhChargedLeadingDeltaEta ; //! Difference of charged particle and trigger eta as function of trigger pT
- TH2F * fhChargedLeadingRatioPt ; //! Ratio of Pt leading charge and trigger
-
- TH2F * fhNeutralLeadingPt ; //! Pt(Pt trigger) distribution of neutral hadrons
- TH2F * fhNeutralLeadingPhi ; //! Phi(Pt trigger) distribution of neutral hadrons
- TH2F * fhNeutralLeadingEta ; //! Eta(Pt trigger) distribution of neutral hadrons
- TH2F * fhNeutralLeadingDeltaPt ; //! Difference of neutral hadron and trigger pT as function of trigger pT
- TH2F * fhNeutralLeadingDeltaPhi ; //! Difference of neutral hadron and trigger phi as function of trigger pT
- TH2F * fhNeutralLeadingDeltaEta ; //! Difference of charged particle and trigger eta as function of trigger pT
- TH2F * fhNeutralLeadingRatioPt ; //! Ratio of Pt leading neutral and trigger
-
- // Jet distributions
- // Fixed cone and pt threshold
- TH2F * fhJetPt ; //! leading pt jet vs pt trigger
- TH2F * fhJetRatioPt ; //! Ratio of pt jet and pt trigger
- TH2F * fhJetDeltaPhi ; //! Delta phi jet-trigger
- TH2F * fhJetDeltaEta ; //! Delta eta jet-trigger
- TH2F * fhJetLeadingRatioPt ; //! Ratio of pt leading and pt jet
- TH2F * fhJetLeadingDeltaPhi ; //! Delta phi jet-leading
- TH2F * fhJetLeadingDeltaEta ; //! Delta eta jet-leading
- TH2F * fhJetFFz; //! Accepted reconstructed jet fragmentation function, z=ptjet/pttrig
- TH2F * fhJetFFxi; //! Accepted reconstructed jet fragmentation function, xsi = ln(pttrig/ptjet)
- TH2F * fhJetFFpt; //! Jet particle pt distribution in cone
- TH2F * fhJetNTracksInCone ; //! jet multiplicity in cone
-
- TH2F * fhBkgPt ; //! leading pt bakground vs pt trigger
- TH2F * fhBkgRatioPt ; //! Ratio of pt background and pt trigger
- TH2F * fhBkgDeltaPhi ; //! Delta phi background-trigger
- TH2F * fhBkgDeltaEta ; //! Delta eta background-trigger
- TH2F * fhBkgLeadingRatioPt ; //! Ratio of pt leading and pt background
- TH2F * fhBkgLeadingDeltaPhi ; //! Delta phi background-leading
- TH2F * fhBkgLeadingDeltaEta ; //! Delta eta background-leading
- TH2F * fhBkgFFz; //! Accepted reconstructed background fragmentation function, z=ptjet/pttrig
- TH2F * fhBkgFFxi; //! Accepted reconstructed background fragmentation function, xsi = ln(pttrig/ptjet)
- TH2F * fhBkgFFpt; //! Background particle pt distribution in cone
- TH2F * fhBkgNTracksInCone ; //! Background multiplicity in cone
-
- // Variable cone and pt threshold
-
- TH2F * fhJetPts[5][5]; //! leading pt jet vs pt trigger
- TH2F * fhJetRatioPts[5][5]; //! Ratio of pt jet and pt trigger
- TH2F * fhJetDeltaPhis[5][5]; //! Delta phi jet-trigger
- TH2F * fhJetDeltaEtas[5][5]; //! Delta eta jet-trigger
- TH2F * fhJetLeadingRatioPts[5][5]; //! Ratio of pt leading and pt jet
- TH2F * fhJetLeadingDeltaPhis[5][5]; //! Delta phi jet-leading
- TH2F * fhJetLeadingDeltaEtas[5][5]; //! Delta eta jet-leading
- TH2F * fhJetFFzs[5][5]; //! Accepted reconstructed jet fragmentation function, z=ptjet/pttrig
- TH2F * fhJetFFxis[5][5]; //! Accepted reconstructed jet fragmentation function, xsi = ln(pttrig/ptjet)
- TH2F * fhJetFFpts[5][5]; //! Jet particle pt distribution in cone
- TH2F * fhJetNTracksInCones[5][5]; //! jet multiplicity in cone
-
- TH2F * fhBkgPts[5][5]; //! leading pt bakground vs pt trigger
- TH2F * fhBkgRatioPts[5][5]; //! Ratio of pt background and pt trigger
- TH2F * fhBkgDeltaPhis[5][5]; //! Delta phi background-trigger
- TH2F * fhBkgDeltaEtas[5][5]; //! Delta eta background-trigger
- TH2F * fhBkgLeadingRatioPts[5][5]; //! Ratio of pt leading and pt background
- TH2F * fhBkgLeadingDeltaPhis[5][5]; //! Delta phi background-leading
- TH2F * fhBkgLeadingDeltaEtas[5][5]; //! Delta eta background-leading
- TH2F * fhBkgFFzs[5][5]; //! Accepted reconstructed background fragmentation function, z=ptjet/pttrig
- TH2F * fhBkgFFxis[5][5]; //! Accepted reconstructed background fragmentation function, xsi = ln(pttrig/ptjet)
- TH2F * fhBkgFFpts[5][5]; //! Background particle pt distribution in cone
- TH2F * fhBkgNTracksInCones[5][5]; //! Background multiplicity in cone
-
-
- ClassDef(AliAnaParticleJetLeadingConeCorrelation,1)
- } ;
-
-
-#endif //AliAnaParticleJetLeadingConeCorrelation_H
-
-
-
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-/* $Id: $ */
-
-//_________________________________________________________________________
-// Class for the analysis of particle-parton correlations
-// Particle (for example direct gamma) must be found in a previous analysis
-// -- Author: Gustavo Conesa (LNF-INFN)
-//////////////////////////////////////////////////////////////////////////////
-
-// --- ROOT system ---
-#include "Riostream.h"
-#include "TH2F.h"
-#include "TParticle.h"
-
-//---- ANALYSIS system ----
-#include "AliAnaParticlePartonCorrelation.h"
-#include "AliLog.h"
-#include "AliStack.h"
-
- ClassImp(AliAnaParticlePartonCorrelation)
-
-
-//____________________________________________________________________________
- AliAnaParticlePartonCorrelation::AliAnaParticlePartonCorrelation() :
- AliAnaPartCorrBaseClass(),
- fhDeltaEtaNearParton(0), fhDeltaPhiNearParton(0),
- fhDeltaPtNearParton(0), fhPtRatNearParton(0),
- fhDeltaEtaAwayParton(0), fhDeltaPhiAwayParton(0),
- fhDeltaPtAwayParton(0), fhPtRatAwayParton(0)
-{
- //Default Ctor
-
- //Initialize parameters
- InitParameters();
-}
-
-//____________________________________________________________________________
-AliAnaParticlePartonCorrelation::AliAnaParticlePartonCorrelation(const AliAnaParticlePartonCorrelation & g) :
- AliAnaPartCorrBaseClass(g),
- fhDeltaEtaNearParton(g.fhDeltaEtaNearParton), fhDeltaPhiNearParton(g.fhDeltaPhiNearParton),
- fhDeltaPtNearParton(g.fhDeltaPtNearParton), fhPtRatNearParton(g.fhPtRatNearParton),
- fhDeltaEtaAwayParton(g.fhDeltaEtaAwayParton), fhDeltaPhiAwayParton(g.fhDeltaPhiAwayParton),
- fhDeltaPtAwayParton(g.fhDeltaPtAwayParton), fhPtRatAwayParton(g.fhPtRatAwayParton)
-{
- // cpy ctor
-
-}
-
-//_________________________________________________________________________
-AliAnaParticlePartonCorrelation & AliAnaParticlePartonCorrelation::operator = (const AliAnaParticlePartonCorrelation & source)
-{
- // assignment operator
-
- if(this == &source)return *this;
- ((AliAnaPartCorrBaseClass *)this)->operator=(source);
-
- fhDeltaEtaAwayParton = source.fhDeltaEtaAwayParton;
- fhDeltaPhiAwayParton = source.fhDeltaPhiAwayParton;
- fhDeltaPtAwayParton = source.fhDeltaPtAwayParton;
- fhPtRatAwayParton = source.fhPtRatAwayParton;
- fhDeltaEtaNearParton = source.fhDeltaEtaNearParton;
- fhDeltaPhiNearParton = source.fhDeltaPhiNearParton;
- fhDeltaPtNearParton = source.fhDeltaPtNearParton;
- fhPtRatNearParton = source.fhPtRatNearParton;
-
- return *this;
-
-}
-
-
-//________________________________________________________________________
-TList * AliAnaParticlePartonCorrelation::GetCreateOutputObjects()
-{
- // Create histograms to be saved in output file
-
- AliDebug(1,"Init parton histograms");
-
- TList * outputContainer = new TList() ;
- outputContainer->SetName("ParticlePartonHistos") ;
-
- fhDeltaPhiNearParton = new TH2F
- ("DeltaPhiNearParton","#phi_{particle} - #phi_{parton} vs p_{T particle}",
- 200,0,120,200,0,6.4);
- fhDeltaPhiNearParton->SetYTitle("#Delta #phi");
- fhDeltaPhiNearParton->SetXTitle("p_{T particle} (GeV/c)");
- outputContainer->Add(fhDeltaPhiNearParton);
-
- fhDeltaEtaNearParton = new TH2F
- ("DeltaEtaNearParton","#eta_{particle} - #eta_{parton} vs p_{T particle}",
- 200,0,120,200,-2,2);
- fhDeltaEtaNearParton->SetYTitle("#Delta #eta");
- fhDeltaEtaNearParton->SetXTitle("p_{T particle} (GeV/c)");
- outputContainer->Add(fhDeltaEtaNearParton);
-
- fhDeltaPtNearParton = new TH2F
- ("DeltaPtNearParton","#p_{T particle} - #p_{T parton} vs p_{T particle}",
- 200,0,120,100,-10,10);
- fhDeltaPtNearParton->SetYTitle("#Delta #p_{T}");
- fhDeltaPtNearParton->SetXTitle("p_{T particle} (GeV/c)");
- outputContainer->Add(fhDeltaPtNearParton);
-
- fhPtRatNearParton = new TH2F
- ("PtRatNearParton","#p_{T parton} / #p_{T particle} vs p_{T particle}",
- 200,0,120,200,0,5);
- fhPtRatNearParton->SetYTitle("ratio");
- fhPtRatNearParton->SetXTitle("p_{T particle} (GeV/c)");
- outputContainer->Add(fhPtRatNearParton);
-
- fhDeltaPhiAwayParton = new TH2F
- ("DeltaPhiAwayParton","#phi_{particle} - #phi_{parton} vs p_{T particle}",
- 200,0,120,200,0,6.4);
- fhDeltaPhiAwayParton->SetYTitle("#Delta #phi");
- fhDeltaPhiAwayParton->SetXTitle("p_{T particle} (GeV/c)");
- outputContainer->Add(fhDeltaPhiAwayParton);
-
- fhDeltaEtaAwayParton = new TH2F
- ("DeltaEtaAwayParton","#eta_{particle} - #eta_{parton} vs p_{T particle}",
- 200,0,120,200,-2,2);
- fhDeltaEtaAwayParton->SetYTitle("#Delta #eta");
- fhDeltaEtaAwayParton->SetXTitle("p_{T particle} (GeV/c)");
- outputContainer->Add(fhDeltaEtaAwayParton);
-
- fhDeltaPtAwayParton = new TH2F
- ("DeltaPtAwayParton","#p_{T particle} - #p_{T parton} vs p_{T particle}",
- 200,0,120,100,-10,10);
- fhDeltaPtAwayParton->SetYTitle("#Delta #p_{T}");
- fhDeltaPtAwayParton->SetXTitle("p_{T particle} (GeV/c)");
- outputContainer->Add(fhDeltaPtAwayParton);
-
- fhPtRatAwayParton = new TH2F
- ("PtRatAwayParton","#p_{T parton} / #p_{T particle} vs p_{T particle}",
- 200,0,120,200,0,5);
- fhPtRatAwayParton->SetYTitle("ratio");
- fhPtRatAwayParton->SetXTitle("p_{T particle} (GeV/c)");
- outputContainer->Add(fhPtRatAwayParton);
-
- return outputContainer;
-}
-
-//____________________________________________________________________________
-void AliAnaParticlePartonCorrelation::InitParameters()
-{
-
- //Initialize the parameters of the analysis.
- ;
-
-}
-
-//__________________________________________________________________
-void AliAnaParticlePartonCorrelation::Print(const Option_t * opt) const
-{
-
- //Print some relevant parameters set for the analysis
- if(! opt)
- return;
-
-}
-
-//__________________________________________________________________
-void AliAnaParticlePartonCorrelation::MakeAnalysisFillAOD()
-{
- //Particle-Parton Correlation Analysis, create AODs
- //Add partons to the reference list of the trigger particle
- //Partons are considered those in the first eight possitions in the stack
- //being 0, and 1 the 2 protons, and 6 and 7 the outgoing final partons.
-
- if(GetDebug() > 1){
- printf("Begin parton correlation analysis, fill AODs \n");
- printf("In particle branch aod entries %d\n", GetAODBranch()->GetEntriesFast());
- }
-
- //Loop on stored AOD particles
- Int_t naod = GetAODBranch()->GetEntriesFast();
- for(Int_t iaod = 0; iaod < naod ; iaod++){
- AliAODParticleCorrelation* particle = dynamic_cast<AliAODParticleCorrelation*> (GetAODBranch()->At(iaod));
-
- AliStack * stack = GetMCStack() ;
- if(!stack) AliFatal("No Stack available, STOP");
-
- if(stack->GetNtrack() < 8) {
- printf("*** small number of particles, not a PYTHIA simulation? ***: n tracks %d \n", stack->GetNprimary());
- continue ;
- }
-
- //Fill AOD reference only with partons
- TParticle * parton = new TParticle ;
-
- for(Int_t ipr = 0;ipr < 8; ipr ++ ){
- parton = stack->Particle(ipr) ;
- particle->AddTrack(parton);
- //parton->Print();
- }
-
- }//Aod branch loop
-
- if(GetDebug() > 1) printf("End parton correlation analysis, fill AODs \n");
-}
-
-//__________________________________________________________________
-void AliAnaParticlePartonCorrelation::MakeAnalysisFillHistograms()
-{
- //Particle-Parton Correlation Analysis, fill histograms
- if(GetDebug() > 1){
- printf("Begin parton correlation analysis, fill histograms \n");
- printf("In particle branch aod entries %d\n", GetAODBranch()->GetEntriesFast());
- }
-
- AliStack * stack = GetMCStack() ;
- if(!stack) AliFatal("No Stack available, STOP");
-
- //Loop on stored AOD particles
- Int_t naod = GetAODBranch()->GetEntriesFast();
- TParticle * mom =new TParticle ;
-
- for(Int_t iaod = 0; iaod < naod ; iaod++){
- AliAODParticleCorrelation* particle = dynamic_cast<AliAODParticleCorrelation*> (GetAODBranch()->At(iaod));
-
- Float_t ptTrigg = particle->Pt();
- Float_t phiTrigg = particle->Phi();
- Float_t etaTrigg = particle->Eta();
- Int_t imom = particle->GetLabel();
- Int_t iparent = 2000;
- Int_t iawayparent = -1;
-
- if(!(particle->GetRefTracks()) || (particle->GetRefTracks())->GetEntriesFast() < 7) AliFatal("Reference list with partons not filled, STOP analysis");
-
- //Check and get indeces of mother and parton
- if(imom < 8 ) iparent = imom ; //mother is already a parton
- else if (imom < stack->GetNtrack()) {
- mom = stack->Particle(imom);
- iparent=mom->GetFirstMother();
- cout<<" iparent "<<iparent<<endl;
- while(iparent > 7 ){
- mom = stack->Particle(iparent);
- imom = iparent ; //Mother label is of the inmediate parton daughter
- iparent = mom->GetFirstMother();
- cout<<" while iparent "<<iparent<<endl;
- }
- }
-
- if(GetDebug() > 1) printf("N reference partons %d; labels: mother %d, parent %d \n", (particle->GetRefTracks())->GetEntriesFast(), imom, iparent);
-
-
- if(iparent < 0 || iparent > 8) {
- if(GetDebug() > 0 ) printf("Failed to find appropriate parton, index %d", iparent);
- continue ;
- }
-
- //Near parton is the parton that fragmented and created the mother
- TParticle * nearParton = (TParticle*) (particle->GetRefTracks())->At(iparent);
- Float_t ptNearParton = nearParton->Pt();
- Float_t phiNearParton = nearParton->Phi() ;
- Float_t etaNearParton = nearParton->Eta() ;
-
- fhDeltaEtaNearParton->Fill(ptTrigg,etaTrigg-etaNearParton);
- fhDeltaPhiNearParton->Fill(ptTrigg,phiTrigg-phiNearParton);
- fhDeltaPtNearParton->Fill(ptTrigg,ptTrigg-ptNearParton);
- fhPtRatNearParton->Fill(ptTrigg,ptNearParton/ptTrigg);
-
- if(iparent == 7) iawayparent =6;
- else if(iparent == 6) iawayparent =7;
- else{
- printf("Parent parton is not final state, skip \n");
- continue;
- }
-
- //Away parton is the other final parton.
- TParticle * awayParton = (TParticle*) (particle->GetRefTracks())->At(iawayparent);
- Float_t ptAwayParton = awayParton->Pt();
- Float_t phiAwayParton = awayParton->Phi() ;
- Float_t etaAwayParton = awayParton->Eta() ;
- fhDeltaEtaAwayParton->Fill(ptTrigg,etaTrigg-etaAwayParton);
- fhDeltaPhiAwayParton->Fill(ptTrigg,phiTrigg-phiAwayParton);
- fhDeltaPtAwayParton->Fill(ptTrigg,ptTrigg-ptAwayParton);
- fhPtRatAwayParton->Fill(ptTrigg,ptAwayParton/ptTrigg);
-
-
- }
-
- if(GetDebug() > 1) printf("End parton correlation analysis, fill histograms \n");
-
-}
+++ /dev/null
-#ifndef AliAnaParticlePartonCorrelation_H
-#define AliAnaParticlePartonCorrelation_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-/* $Id: */
-
-//_________________________________________________________________________
-// Class that contains the algorithm for the analysis of particle-parton correlation
-// Particle (for example direct gamma) must be found in a previous analysis
-//-- Author: Gustavo Conesa (INFN-LNF)
-
-// --- ROOT ---
-class TH2F ;
-
-// --- ANALYSIS ---
-#include "AliAnaPartCorrBaseClass.h"
-
-class AliAnaParticlePartonCorrelation : public AliAnaPartCorrBaseClass {
-
- public:
-
- AliAnaParticlePartonCorrelation() ; // default ctor
- AliAnaParticlePartonCorrelation(const AliAnaParticlePartonCorrelation & g) ; // cpy ctor
- AliAnaParticlePartonCorrelation & operator = (const AliAnaParticlePartonCorrelation & g) ;//cpy assignment
- virtual ~AliAnaParticlePartonCorrelation() {;} //virtual dtor
-
- TList * GetCreateOutputObjects();
-
- void InitParameters();
-
- void Print(const Option_t * opt) const;
-
- void MakeAnalysisFillAOD() ;
-
- void MakeAnalysisFillHistograms() ;
-
- private:
-
- TH2F * fhDeltaEtaNearParton; //! Difference of parton eta and prompt trigger particle eta
- TH2F * fhDeltaPhiNearParton; //! Difference of parton phi and prompt trigger particle phi
- TH2F * fhDeltaPtNearParton; //! Difference of parton pT and prompt trigger particle pT
- TH2F * fhPtRatNearParton; //! Ratio of parton pT and prompt trigger particle pT
-
- TH2F * fhDeltaEtaAwayParton; //! Difference of parton eta and prompt trigger particle eta
- TH2F * fhDeltaPhiAwayParton; //! Difference of parton phi and prompt trigger particle phi
- TH2F * fhDeltaPtAwayParton; //! Difference of parton pT and prompt trigger particle pT
- TH2F * fhPtRatAwayParton; //! Ratio of parton pT and prompt trigger particle pT
-
- ClassDef(AliAnaParticlePartonCorrelation,1)
- } ;
-
-
-#endif //AliAnaParticlePartonCorrelation_H
-
-
-
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-/* $Id: $ */
-
-//_________________________________________________________________________
-// Class to collect two-photon invariant mass distributions for
-// extractin raw pi0 yield.
-//
-//-- Author: Dmitri Peressounko (RRC "KI")
-//_________________________________________________________________________
-
-
-// --- ROOT system ---
-#include "TClonesArray.h"
-#include "TRefArray.h"
-#include "TH3.h"
-
-//---- AliRoot system ----
-#include "AliAnaPi0.h"
-#include "AliLog.h"
-#include "AliCaloPhoton.h"
-#include "AliESDEvent.h"
-#include "AliAODEvent.h"
-#include "AliESDVertex.h"
-#include "AliAODVertex.h"
-#include "AliESDCaloCluster.h"
-#include "AliAODCaloCluster.h"
-
-ClassImp(AliAnaPi0)
-
-//____________________________________________________________________________
- AliAnaPi0::AliAnaPi0() : AliAnalysisTaskSE(),
- fNCentrBin(1),fNZvertBin(1),fNrpBin(1),fNPID(2),fNmaxMixEv(10),
- fCurCentrBin(0),fCurZvertBin(0),fCurRPBin(0),fPtMin(0.),fZvtxCut(40.),
- fMinDist(2.),fMinDist2(4.),fMinDist3(5.),fDispCut(1.5),fTOFCut(5.e-9),fPhotPID(0.6),
- fEventsList(0x0),fCurrentEvent(0x0),fOutputList(0x0),fhEtalon(0x0),
- fhRe1(0x0),fhMi1(0x0),fhRe2(0x0),fhMi2(0x0),fhRe3(0x0),fhMi3(0x0),fhEvents(0x0)
-{
- //Default Ctor
-
-}
-//____________________________________________________________________________
- AliAnaPi0::AliAnaPi0(const char *name): AliAnalysisTaskSE(name),
- fNCentrBin(1),fNZvertBin(1),fNrpBin(1),fNPID(9),fNmaxMixEv(10),
- fCurCentrBin(0),fCurZvertBin(0),fCurRPBin(0),fPtMin(0.),fZvtxCut(40.),
- fMinDist(2.),fMinDist2(4.),fMinDist3(5.),fDispCut(1.5),fTOFCut(5.e-9),fPhotPID(0.6),
- fEventsList(0x0),fCurrentEvent(0x0),fOutputList(0x0),fhEtalon(0x0),
- fhRe1(0x0),fhMi1(0x0),fhRe2(0x0),fhMi2(0x0),fhRe3(0x0),fhMi3(0x0),fhEvents(0x0)
-{
- //Ctor
- DefineOutput(1,TList::Class());
-}
-
-//____________________________________________________________________________
-AliAnaPi0::AliAnaPi0(const AliAnaPi0 & ex) : AliAnalysisTaskSE(ex),
- fNCentrBin(1),fNZvertBin(1),fNrpBin(1),fNPID(9),fNmaxMixEv(10),
- fCurCentrBin(0),fCurZvertBin(0),fCurRPBin(0),fPtMin(0.),fZvtxCut(40.),
- fMinDist(2.),fMinDist2(4.),fMinDist3(5.),fDispCut(1.5),fTOFCut(5.e-9),fPhotPID(0.6),
- fEventsList(0x0),fCurrentEvent(0x0),fOutputList(0x0),fhEtalon(0x0),
- fhRe1(0x0),fhMi1(0x0),fhRe2(0x0),fhMi2(0x0),fhRe3(0x0),fhMi3(0x0),fhEvents(0x0)
-{
- // cpy ctor
- //Do not need it
-}
-//_________________________________________________________________________
-AliAnaPi0 & AliAnaPi0::operator = (const AliAnaPi0 & ex)
-{
- // assignment operator
-
- if(this == &ex)return *this;
- ((AliAnalysisTaskSE *)this)->operator=(ex);
-
- return *this;
-
-}
-//____________________________________________________________________________
-AliAnaPi0::~AliAnaPi0() {
- // Remove event containers
- if(fEventsList){
- for(Int_t ic=0; ic<fNCentrBin; ic++){
- for(Int_t iz=0; iz<fNZvertBin; iz++){
- for(Int_t irp=0; irp<fNrpBin; irp++){
- fEventsList[ic*fNZvertBin*fNrpBin+iz*fNrpBin+irp]->Delete() ;
- delete fEventsList[ic*fNZvertBin*fNrpBin+iz*fNrpBin+irp] ;
- }
- }
- }
- delete[] fEventsList;
- fEventsList=0 ;
- }
-
- if(fhEtalon){
- delete fhEtalon ;
- fhEtalon = 0;
- }
- if(fhRe1) delete[] fhRe1 ; //Do not delete histograms!
- if(fhRe2) delete[] fhRe2 ; //Do not delete histograms!
- if(fhRe3) delete[] fhRe3 ; //Do not delete histograms!
- if(fhMi1) delete[] fhMi1 ; //Do not delete histograms!
- if(fhMi2) delete[] fhMi2 ; //Do not delete histograms!
- if(fhMi3) delete[] fhMi3 ; //Do not delete histograms!
-
-}
-//________________________________________________________________________
-void AliAnaPi0::UserCreateOutputObjects()
-{
- // Create histograms to be saved in output file and
- // store them in fOutputContainer
-
- AliDebug(1,"Init inv. mass histograms");
- OpenFile(1) ;
-
- //create event containers
- fEventsList = new TList*[fNCentrBin*fNZvertBin*fNrpBin] ;
- for(Int_t ic=0; ic<fNCentrBin; ic++){
- for(Int_t iz=0; iz<fNZvertBin; iz++){
- for(Int_t irp=0; irp<fNrpBin; irp++){
- fEventsList[ic*fNZvertBin*fNrpBin+iz*fNrpBin+irp] = new TList() ;
- }
- }
- }
-
- fOutputList = new TList() ;
- fOutputList->SetName(GetName()) ;
-
- fhRe1=new TH3D*[fNCentrBin*fNPID] ;
- fhRe2=new TH3D*[fNCentrBin*fNPID] ;
- fhRe3=new TH3D*[fNCentrBin*fNPID] ;
- fhMi1=new TH3D*[fNCentrBin*fNPID] ;
- fhMi2=new TH3D*[fNCentrBin*fNPID] ;
- fhMi3=new TH3D*[fNCentrBin*fNPID] ;
-
- char key[255] ;
- char title[255] ;
- for(Int_t ic=0; ic<fNCentrBin; ic++){
- for(Int_t ipid=0; ipid<fNPID; ipid++){
- //Distance to bad module 1
- sprintf(key,"hRe_cen%d_pid%d_dist1",ic,ipid) ;
- sprintf(title,"Real m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ;
- fhRe1[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ;
- fhRe1[ic*fNPID+ipid]->SetName(key) ;
- fhRe1[ic*fNPID+ipid]->SetTitle(title) ;
- fOutputList->Add(fhRe1[ic*fNPID+ipid]) ;
-
- sprintf(key,"hMi_cen%d_pid%d_dist1",ic,ipid) ;
- sprintf(title,"Mixed m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ;
- fhMi1[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ;
- fhMi1[ic*fNPID+ipid]->SetName(key) ;
- fhMi1[ic*fNPID+ipid]->SetTitle(title) ;
- fOutputList->Add(fhMi1[ic*fNPID+ipid]) ;
-
- //Distance to bad module 2
- sprintf(key,"hRe_cen%d_pid%d_dist2",ic,ipid) ;
- sprintf(title,"Real m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ;
- fhRe2[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ;
- fhRe2[ic*fNPID+ipid]->SetName(key) ;
- fhRe2[ic*fNPID+ipid]->SetTitle(title) ;
- fOutputList->Add(fhRe2[ic*fNPID+ipid]) ;
-
- sprintf(key,"hMi_cen%d_pid%d_dist2",ic,ipid) ;
- sprintf(title,"Mixed m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ;
- fhMi2[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ;
- fhMi2[ic*fNPID+ipid]->SetName(key) ;
- fhMi2[ic*fNPID+ipid]->SetTitle(title) ;
- fOutputList->Add(fhMi2[ic*fNPID+ipid]) ;
-
- //Distance to bad module 3
- sprintf(key,"hRe_cen%d_pid%d_dist3",ic,ipid) ;
- sprintf(title,"Real m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ;
- fhRe3[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ;
- fhRe3[ic*fNPID+ipid]->SetName(key) ;
- fhRe3[ic*fNPID+ipid]->SetTitle(title) ;
- fOutputList->Add(fhRe3[ic*fNPID+ipid]) ;
-
- sprintf(key,"hMi_cen%d_pid%d_dist3",ic,ipid) ;
- sprintf(title,"Mixed m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ;
- fhMi3[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ;
- fhMi3[ic*fNPID+ipid]->SetName(key) ;
- fhMi3[ic*fNPID+ipid]->SetTitle(title) ;
- fOutputList->Add(fhMi3[ic*fNPID+ipid]) ;
- }
- }
-
- fhEvents=new TH3D("hEvents","Number of events",fNCentrBin,0.,1.*fNCentrBin,
- fNZvertBin,0.,1.*fNZvertBin,fNrpBin,0.,1.*fNrpBin) ;
- fOutputList->Add(fhEvents) ;
-
- //Save parameters used for analysis
- TString parList ; //this will be list of parameters used for this analysis.
- char onePar[255] ;
- sprintf(onePar,"Number of bins in Centrality: %d \n",fNCentrBin) ;
- parList+=onePar ;
- sprintf(onePar,"Number of bins in Z vert. pos: %d \n",fNZvertBin) ;
- parList+=onePar ;
- sprintf(onePar,"Number of bins in Reac. Plain: %d \n",fNrpBin) ;
- parList+=onePar ;
- sprintf(onePar,"Depth of event buffer: %d \n",fNmaxMixEv) ;
- parList+=onePar ;
- sprintf(onePar,"Number of different PID used: %d \n",fNPID) ;
- parList+=onePar ;
- sprintf(onePar,"Cuts: \n") ;
- parList+=onePar ;
- sprintf(onePar,"Z vertex position: -%f < z < %f \n",fZvtxCut,fZvtxCut) ;
- parList+=onePar ;
- sprintf(onePar,"Minimal P_t: %f \n", fPtMin) ;
- parList+=onePar ;
- sprintf(onePar,"fMinDist =%f (Minimal distance to bad channel to accept cluster) \n",fMinDist) ;
- parList+=onePar ;
- sprintf(onePar,"fMinDist2=%f (Cuts on Minimal distance to study acceptance evaluation) \n",fMinDist2) ;
- parList+=onePar ;
- sprintf(onePar,"fMinDist3=%f (One more cut on distance used for acceptance-efficiency study) \n",fMinDist3) ;
- parList+=onePar ;
- sprintf(onePar,"fDispCut =%f (Cut on dispersion, used in PID evaluation) \n",fDispCut) ;
- parList+=onePar ;
- sprintf(onePar,"fTOFCut =%e (Cut on TOF, used in PID evaluation) \n",fTOFCut) ;
- parList+=onePar ;
- sprintf(onePar,"fPhotPID =%f (limit for Baesian PID for photon) \n",fPhotPID) ;
- parList+=onePar ;
-
- TObjString *oString= new TObjString(parList) ;
- fOutputList->Add(oString);
-
-}
-//__________________________________________________
-void AliAnaPi0::InitParameters()
-{
- //Initialize the parameters of the analysis.
-
-}
- //__________________________________________________
-void AliAnaPi0::Init()
-{
- //Make here all memory allocations
- //create etalon histo for all later histograms
- if(!fhEtalon){ // p_T alpha d m_gg
- fhEtalon = new TH3D("hEtalon","Histo with binning parameters",20,0.,10.,10,0.,1.,200,0.,1.) ;
- fhEtalon->SetXTitle("P_{T} (GeV)") ;
- fhEtalon->SetYTitle("#alpha") ;
- fhEtalon->SetZTitle("m_{#gamma#gamma} (GeV)") ;
- }
-
-}
-//__________________________________________________________________
-void AliAnaPi0::Print(const Option_t * /*opt*/) const
-{
- //Print some relevant parameters set for the analysis
- printf("Class AliAnaPi0 for gamma-gamma inv.mass construction \n") ;
- printf("Number of bins in Centrality: %d \n",fNCentrBin) ;
- printf("Number of bins in Z vert. pos: %d \n",fNZvertBin) ;
- printf("Number of bins in Reac. Plain: %d \n",fNrpBin) ;
- printf("Depth of event buffer: %d \n",fNmaxMixEv) ;
- printf("Number of different PID used: %d \n",fNPID) ;
- printf("Cuts: \n") ;
- printf("Z vertex position: -%f < z < %f \n",fZvtxCut,fZvtxCut) ;
- printf("Minimal P_t: %f \n", fPtMin) ;
- printf("fMinDist =%f (Minimal distance to bad channel to accept cluster) \n",fMinDist) ;
- printf("fMinDist2=%f (Cuts on Minimal distance to study acceptance evaluation) \n",fMinDist2) ;
- printf("fMinDist3=%f (One more cut on distance used for acceptance-efficiency study) \n",fMinDist3) ;
- printf("fDispCut =%f (Cut on dispersion, used in PID evaluation) \n",fDispCut) ;
- printf("fTOFCut =%e (Cut on TOF, used in PID evaluation) \n",fTOFCut) ;
- printf("fPhotPID =%f (limit for Baesian PID for photon) \n",fPhotPID) ;
- printf("------------------------------------------------------\n") ;
-
-}
-//__________________________________________________________________
-void AliAnaPi0::UserExec(Option_t *)
-{
- //Process one event and extract photons
- //impose cuts on bad modules and bad runs
- //fill internal storage for subsequent histo filling
-
- AliVEvent* event = InputEvent();
-
- //Apply some cuts on event: vertex position and centrality range
- Int_t iRun=event->GetRunNumber() ;
- if(IsBadRun(iRun))
- return ;
-
- AliESDEvent* esd = dynamic_cast<AliESDEvent*>(event) ;
- AliAODEvent* aod = dynamic_cast<AliAODEvent*>(event) ;
- if(esd){
- if(!FillFromESD(esd))
- return ; //Event can not be used (vertex, centrality,... cuts not fulfilled)
- }
- else if(aod){
- if(!FillFromAOD(aod))
- return ; //Event can not be used (vertex, centrality,... cuts not fulfilled)
- }
- else{
- printf("Input neither ESD nor AOD, do nothing \n") ;
- return ;
- }
-
-
- fhEvents->Fill(fCurCentrBin+0.5,fCurZvertBin+0.5,fCurRPBin+0.5) ;
-
- if(fCurrentEvent->GetEntriesFast()>0){
- //Reduce size for storing
- fCurrentEvent->Expand(fCurrentEvent->GetEntriesFast()) ;
- FillHistograms() ;
- }
-
- PostData(1, fOutputList);
-
-}
-//__________________________________________________________________
-Bool_t AliAnaPi0::FillFromESD(AliESDEvent * esd){
- //Fill photon list from ESD applying
- //some cut should be applyed
-
- //Impose cut on vertex and calculate Zvertex bin
- const AliESDVertex *esdV = esd->GetVertex() ;
- esdV->GetXYZ(fVert);
- if(fVert[2]<-fZvtxCut || fVert[2]> fZvtxCut)
- return kFALSE ;
- fCurZvertBin=(Int_t)(0.5*fNZvertBin*(fVert[2]+fZvtxCut)/fZvtxCut) ;
-
- //Get Centrality and calculate centrality bin
- //Does not exist in ESD yet???????
- fCurCentrBin=0 ;
-
- //Get Reaction Plain position and calculate RP bin
- //does not exist in ESD yet????
- fCurRPBin=0 ;
-
- //************************ PHOS *************************************
- TRefArray * caloClustersArr = new TRefArray();
- esd->GetPHOSClusters(caloClustersArr);
-
- const Int_t kNumberOfPhosClusters = caloClustersArr->GetEntries() ;
- //if fCurrentEvent!=0 it was not filled in previous event, still empty and can be used
- if(!fCurrentEvent)
- fCurrentEvent = new TClonesArray("AliCaloPhoton",kNumberOfPhosClusters) ;
- Int_t inList=0 ;
-
- // loop over the PHOS Cluster
- for(Int_t i = 0 ; i < kNumberOfPhosClusters ; i++) {
- AliESDCaloCluster * calo = (AliESDCaloCluster *) caloClustersArr->At(i) ;
-
- //Make some tests
- if(calo->E()<fPtMin)
- continue ;
-
- Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad in cm
- if(distBad<0.)distBad=9999. ; //workout strange convension dist = -1. ;
- if(distBad<fMinDist) //In bad channel (cristall size 2.2x2.2 cm)
- continue ;
-
- new((*fCurrentEvent)[inList])AliCaloPhoton() ;
- AliCaloPhoton * ph = static_cast<AliCaloPhoton*>(fCurrentEvent->At(inList)) ;
- inList++ ;
-
- //Set Momentum
- calo->GetMomentum(*ph,fVert);
-
- //Dispersion/lambdas
- Double_t disp=calo->GetClusterDisp() ;
-// Double_t m20=calo->GetM20() ;
-// Double_t m02=calo->GetM02() ;
- ph->SetDispBit(disp<fDispCut) ;
-
- //TOF
- Double_t tof=calo->GetTOF() ;
- ph->SetTOFBit(TMath::Abs(tof)<fTOFCut) ;
-
- //Charged veto
-// Double_t cpvR=calo->GetEmcCpvDistance() ;
- Int_t itr=calo->GetNTracksMatched(); //number of track matched
- ph->SetCPVBit(itr>0) ; //Temporary cut, should we evaluate distance?
-
- //Overall PID
- Double_t *pid=calo->GetPid();
- ph->SetPCAPID(pid[AliPID::kPhoton]>fPhotPID) ;
-
- //Set Distance to Bad channel
- if(distBad>fMinDist3)
- ph->SetDistToBad(2) ;
- else if(distBad>fMinDist2)
- ph->SetDistToBad(1) ;
- else
- ph->SetDistToBad(0) ;
-
- }//loop
- return kTRUE ;
-}
-//__________________________________________________________________
-Bool_t AliAnaPi0::FillFromAOD(AliAODEvent * aod){
- //Fill photon list from AOD applying
- //some cuts
-
- //Impose cut on vertex and calculate Zvertex bin
- const AliAODVertex *aodV = aod->GetPrimaryVertex() ;
- fVert[0]=aodV->GetX();
- fVert[1]=aodV->GetY();
- fVert[2]=aodV->GetZ();
- if(fVert[2]<-fZvtxCut || fVert[2]> fZvtxCut)
- return kFALSE ;
- fCurZvertBin=(Int_t)(0.5*fNZvertBin*(fVert[2]+fZvtxCut)/fZvtxCut) ;
-
- //Get Centrality and calculate centrality bin
- //Does not exist in ESD yet???????
- fCurCentrBin=0 ;
-
- //Get Reaction Plain position and calculate RP bin
- //does not exist in ESD yet????
- fCurRPBin=0 ;
-
- //************************ PHOS *************************************
- const Int_t kNumberOfPhosClusters = aod->GetNCaloClusters() ;
- if(!fCurrentEvent)
- fCurrentEvent = new TClonesArray("AliCaloPhoton",kNumberOfPhosClusters) ;
- Int_t inList=0 ;
-
- // loop over the PHOS Cluster
- for(Int_t i = 0 ; i < kNumberOfPhosClusters ; i++) {
- AliAODCaloCluster * calo = aod->GetCaloCluster(i);
-
- //Make some tests
- if(calo->E()<fPtMin)
- continue ;
-
- Double_t distBad=calo->GetDistToBadChannel() ;
- if(distBad<fMinDist) //In bad channel
- continue ;
-
- new((*fCurrentEvent)[inList])AliCaloPhoton() ;
- AliCaloPhoton * ph = static_cast<AliCaloPhoton*>(fCurrentEvent->At(inList)) ;
- inList++ ;
-
- //Set Momentum
- calo->GetMomentum(*ph,fVert);
-
- //Dispersion/lambdas
- Double_t disp=calo->GetDispersion() ;
-// Double_t m20=calo->GetM20() ;
-// Double_t m02=calo->GetM02() ;
- ph->SetDispBit(disp<fDispCut) ;
-
- //TOF
- Double_t tof=calo->GetTOF() ;
- ph->SetTOFBit(TMath::Abs(tof)<fTOFCut) ;
-
- //Charged veto
-// Double_t cpvR=calo->GetEmcCpvDistance() ;
- Int_t itr=calo->GetNTracksMatched(); //number of track matched
- ph->SetCPVBit(itr>0) ; //Temporary cut !!!!
-
- //Overall PID
- Double_t pid[13];
- calo->GetPID(pid);
- ph->SetPCAPID(pid[AliAODCluster::kPhoton]>fPhotPID) ;
-
- //Distance to Bad
- if(distBad>fMinDist3)
- ph->SetDistToBad(2) ;
- else if(distBad>fMinDist2)
- ph->SetDistToBad(1) ;
- else
- ph->SetDistToBad(0) ;
-
-
- }//loop
- return kTRUE ;
-}
-//__________________________________________________________________
-void AliAnaPi0::FillHistograms()
-{
- //Fill Real and Mixed invariant mass histograms
- //then add current event to the buffer and
- //remove redundant events from buffer if necessary
-
- //Fill histograms only if list of particles for current event was created
- if(fCurrentEvent==0)
- return ;
-
- //Fill Real distribution
- Int_t nPhot = fCurrentEvent->GetEntriesFast() ;
- for(Int_t i1=0; i1<nPhot-1; i1++){
- AliCaloPhoton * p1 = static_cast<AliCaloPhoton*>(fCurrentEvent->At(i1)) ;
- for(Int_t i2=i1+1; i2<nPhot; i2++){
- AliCaloPhoton * p2 = static_cast<AliCaloPhoton*>(fCurrentEvent->At(i2)) ;
- Double_t m =(*p1 + *p2).M() ;
- Double_t pt=(*p1 + *p2).Pt();
- Double_t a = TMath::Abs(p1->Energy()-p2->Energy())/(p1->Energy()+p2->Energy()) ;
- for(Int_t ipid=0; ipid<fNPID; ipid++){
- if(p1->IsPIDOK(ipid)&&p2->IsPIDOK(ipid)){
- fhRe1[fCurCentrBin*fNPID+ipid]->Fill(pt,a,m) ;
- if(p1->DistToBad()>0 && p2->DistToBad()>0){
- fhRe2[fCurCentrBin*fNPID+ipid]->Fill(pt,a,m) ;
- if(p1->DistToBad()>1 && p2->DistToBad()>1){
- fhRe3[fCurCentrBin*fNPID+ipid]->Fill(pt,a,m) ;
- }
- }
- }
- }
- }
- }
-
- //Fill mixed
- TList * evMixList=fEventsList[fCurCentrBin*fNZvertBin*fNrpBin+fCurZvertBin*fNrpBin+fCurRPBin] ;
- Int_t nMixed = evMixList->GetSize() ;
- for(Int_t ii=0; ii<nMixed; ii++){
- TClonesArray* ev2=dynamic_cast<TClonesArray*>(evMixList->At(ii));
- Int_t nPhot2=ev2->GetEntriesFast() ;
- for(Int_t i1=0; i1<nPhot; i1++){
- AliCaloPhoton * p1 = static_cast<AliCaloPhoton*>(fCurrentEvent->At(i1)) ;
- for(Int_t i2=0; i2<nPhot2; i2++){
- AliCaloPhoton * p2 = static_cast<AliCaloPhoton*>(ev2->At(i2)) ;
- Double_t m =(*p1 + *p2).M() ;
- Double_t pt=(*p1 + *p2).Pt();
- Double_t a = TMath::Abs(p1->Energy()-p2->Energy())/(p1->Energy()+p2->Energy()) ;
- for(Int_t ipid=0; ipid<fNPID; ipid++){
- if(p1->IsPIDOK(ipid)&&p2->IsPIDOK(ipid)){
- fhMi1[fCurCentrBin*fNPID+ipid]->Fill(pt,a,m) ;
- if(p1->DistToBad()>0 && p2->DistToBad()>0){
- fhMi2[fCurCentrBin*fNPID+ipid]->Fill(pt,a,m) ;
- if(p1->DistToBad()>1 && p2->DistToBad()>1){
- fhMi3[fCurCentrBin*fNPID+ipid]->Fill(pt,a,m) ;
- }
- }
- }
- }
- }
- }
- }
-
- //Add current event to buffer and Remove redandant events
- if(fCurrentEvent->GetEntriesFast()>0){
- evMixList->AddFirst(fCurrentEvent) ;
- fCurrentEvent=0 ; //Now list of particles belongs to buffer and it will be deleted with buffer
- if(evMixList->GetSize()>=fNmaxMixEv){
- TClonesArray * tmp = dynamic_cast<TClonesArray*>(evMixList->Last()) ;
- evMixList->RemoveLast() ;
- delete tmp ;
- }
- }
- else{ //empty event
- delete fCurrentEvent ;
- fCurrentEvent=0 ;
- }
-}
-//______________________________________________________________________________
-void AliAnaPi0::Terminate(Option_t *)
-{
-}
+++ /dev/null
-#ifndef ALIANAPI0_H
-#define ALIANAPI0_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-/* $Id: $ */
-
-//_________________________________________________________________________
-// Class to fill two-photon invariant mass hisograms
-// to be used to extract pi0 raw yield.
-//
-//-- Author: Dmitri Peressounko (RRC "KI")
-
-class TH3D ;
-class AliAODEvent ;
-class AliESDEvent ;
-
-#include "AliAnalysisTaskSE.h"
-
-class AliAnaPi0 : public AliAnalysisTaskSE {
-
- public:
-
- AliAnaPi0() ; // default ctor
- AliAnaPi0(const char *name) ; // default ctor
- AliAnaPi0(const AliAnaPi0 & g) ; // cpy ctor
- AliAnaPi0 & operator = (const AliAnaPi0 & api0) ;//cpy assignment
- virtual ~AliAnaPi0() ;//virtual dtor
-
- //obligatory methods
- virtual void UserCreateOutputObjects();
- virtual void Init() ;
- virtual void LocalInit() { Init() ; }
- virtual void UserExec(Option_t * opt = "") ;
- virtual void Terminate(Option_t * opt = "") ;
-
- void InitParameters();
- void Print(const Option_t * opt) const;
-
- void SetBadRunsList(){} ; //Set list of runs which can be used for this analysis
- void SetEtalonHisto(TH3D * h);//Provide etalon of binning for histograms
-
- //Setters for parameters of event buffers
- void SetNCentrBin(Int_t n=5){fNCentrBin=n ;} //number of bins in centrality
- void SetNZvertBin(Int_t n=5){fNZvertBin=n ;} //number of bins for vertex position
- void SetNRPBin(Int_t n=6) {fNrpBin=n ;} //number of bins in reaction plain
- void SetNMaxEvMix(Int_t n=20){fNmaxMixEv=n ;}//Maximal number of events for mixing
-
- //Setters for event selection
- void SetZvertexCut(Float_t zcut=40.){fZvtxCut=zcut ;} //cut on vertex position
- void SetPtMin(Float_t pt = 0.2) {fPtMin=pt ;} //Cut on minimal pt of photon
-
- private:
- void FillHistograms() ; //fill invariant mass distributions
- Bool_t FillFromAOD(AliAODEvent * aod) ;
- Bool_t FillFromESD(AliESDEvent * esd) ;
-
- Bool_t IsBadRun(Int_t /*iRun*/) {return kFALSE;} //Tests if this run bad according to private list
-
- private:
-
- Int_t fNCentrBin ; //number of bins in event container for centrality
- Int_t fNZvertBin ; //number of bins in event container for vertex position
- Int_t fNrpBin ; //number of bins in event container for reaction plain
- Int_t fNPID ; //Number of possible PID combinations
- Int_t fNmaxMixEv ; //Maximal number of events stored in buffer for mixing
-
- Int_t fCurCentrBin ; //! bin for current event (centrality)
- Int_t fCurZvertBin ; //! bin for current event (z position)
- Int_t fCurRPBin ; //! bin for current event (reaction plain)
-
- Float_t fPtMin ; //Cut on minimum photon Pt
- Float_t fZvtxCut ; //Cut on vertex position
- Float_t fMinDist ; //Minimal distance to bad channel to accept cluster
- Float_t fMinDist2; //Cuts on Minimal distance to study acceptance evaluation
- Float_t fMinDist3; //One more cut on distance used for acceptance-efficiency study
- Float_t fDispCut; //Cut on dispersion, used in PID evaluation
- Float_t fTOFCut; //Cut on TOF, used in PID evaluation
- Float_t fPhotPID; //Baesian PID for photon
-
- Double_t fVert[3] ; //Currecnt vertex position
- TList ** fEventsList ; //! containers for photons in stored events
- TClonesArray * fCurrentEvent ; //!Container with latest event
-
- TList * fOutputList ; //list of output objects
-
- //Histograms
- TH3D * fhEtalon ; //Etalon histo, all distributions will have same binning as this one
-
- TH3D ** fhRe1 ; //!REAL two-photon invariant mass distribution for different centralities and PID
- TH3D ** fhMi1 ; //!MIXED two-photon invariant mass distribution for different centralities and PID
- TH3D ** fhRe2 ; //!REAL two-photon invariant mass distribution for different centralities and PID
- TH3D ** fhMi2 ; //!MIXED two-photon invariant mass distribution for different centralities and PID
- TH3D ** fhRe3 ; //!REAL two-photon invariant mass distribution for different centralities and PID
- TH3D ** fhMi3 ; //!MIXED two-photon invariant mass distribution for different centralities and PID
- TH3D * fhEvents; //!Number of events per centrality, RP, zbin
-
- //Calo Cells
- ClassDef(AliAnaPi0,2)
- } ;
-
-
-#endif //ALIANAPI0_H
-
-
-
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-/* $Id: */
-
-//_________________________________________________________________________
-// A basic analysis task to analyse photon detected by PHOS
-//
-//*-- Yves Schutz
-//////////////////////////////////////////////////////////////////////////////
-
-#include <TFile.h>
-#include <TH1.h>
-#include <TH1F.h>
-#include <TH1I.h>
-#include <TCanvas.h>
-
-#include "AliAnaScale.h"
-#include "AliAnalysisManager.h"
-
-//______________________________________________________________________________
-AliAnaScale::AliAnaScale() :
- fDebug(0),
- fScale(1.0),
- fInputList(0x0),
- fOutputList(0x0),
- fSumw2(0),
- fhCount()
-{
- //Default constructor
-}
-//______________________________________________________________________________
-AliAnaScale::AliAnaScale(const char *name) :
- AliAnalysisTask(name,""),
- fDebug(0),
- fScale(1.0),
- fInputList(0x0),
- fOutputList(0x0),
- fSumw2(0),
- fhCount(0)
-{
- // Constructor.
- // Called only after the event loop
- SetPostEventLoop(kTRUE);
- // Input slot #0
- DefineInput(0, TList::Class()) ;
- // Output slot
- DefineOutput(0, TList::Class()) ;
-}
-
-//______________________________________________________________________________
-AliAnaScale::~AliAnaScale()
-{
- // dtor
-
-}
-
-
-//______________________________________________________________________________
-void AliAnaScale::ConnectInputData(const Option_t*)
-{
- // Initialisation of branch container and histograms
-
- if(fDebug > 1) printf("*** Initialization of %s \n", GetName()) ;
- fInputList = dynamic_cast<TList*>(GetInputData(0)) ;
-}
-//________________________________________________________________________
-void AliAnaScale::CreateOutputObjects()
-{
- // Create the outputs containers
-
- fOutputList = new TList() ;
- fOutputList->SetName(GetName()) ;
-
- fhCount =new TH1F("hCount","count files",1,0,1);
- fOutputList->Add(fhCount);
-
-}
-
-//______________________________________________________________________________
-void AliAnaScale::Exec(Option_t *)
-{
- // Do the Scaling
-
- if(fDebug > 0 ) printf(">>>>> Scaling factor %e, do Sumw2 %d <<<<< \n",fScale,fSumw2) ;
-
- TIter next(fInputList) ;
- TObject * h ;
- while ( (h = next()) ) {
- if(h){
- if ( strcmp(h->ClassName(),"TNtuple") ) {
- char name[128] ;
- sprintf(name, "%sScaled", h->GetName()) ;
- TH1 * hout = dynamic_cast<TH1*> (h->Clone(name)) ;
-
- if(fSumw2) hout->Sumw2();
- hout->Scale(fScale) ;
- fOutputList->Add(hout) ;
- }
- else fOutputList->Add(h) ;
- }
- }
- // number of files
-
- //File scaled, needed for file merging on grid
- fhCount->Fill(0);
-
- PostData(0, fOutputList);
-}
-
-
-//______________________________________________________________________________
-void AliAnaScale::Init()
-{
- // Intialisation of parameters
- if(fDebug > 0 )printf("No initialization in scale class \n") ;
-
-}
-
-//______________________________________________________________________________
-void AliAnaScale::Terminate(Option_t *)
-{
- // Processing when the event loop is ended
-
-
-}
+++ /dev/null
-#ifndef ALIANASCALE_H
-#define ALIANASCALE_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-//______________________________________________________________________________
-// An post event loop analysis task that scales the input histograms
-//
-//*-- Yves Schutz
-//////////////////////////////////////////////////////////////////////////////
-
-#include "AliAnalysisTask.h"
-
-class TH1D ;
-class TH1I ;
-class TH1F ;
-
-class AliAnaScale : public AliAnalysisTask {
-
-public:
- AliAnaScale() ;
- AliAnaScale(const char *name) ;
- virtual ~AliAnaScale() ;
-
- virtual void ConnectInputData(Option_t * = "");
- virtual void CreateOutputObjects();
- virtual void Init() ;
- virtual void LocalInit() { Init() ; }
- virtual void Exec(Option_t * opt = "") ;
- void Set(const Double_t val) { fScale = val ; }
- void SetDebugLevel(Int_t level) { fDebug = level ; }
- virtual void Terminate(Option_t * opt = "") ;
-
- void MakeSumw2(Bool_t sum) {fSumw2 = sum;}
-
-private:
- AliAnaScale(const AliAnaScale&); // Not implemented
- AliAnaScale& operator=(const AliAnaScale&); // Not implemented
-
-
- // input and output
- Int_t fDebug ; // Debug flag
- // task parameters
- Float_t fScale ; // Scaling factor
-
- // Histograms
- TList * fInputList ; //! input data list
- TList * fOutputList ; //! output data list
- Bool_t fSumw2; //compute sum of squares of weights for bin content error calculation
- TH1F * fhCount; //! counter histogram for file merging
-
- ClassDef(AliAnaScale, 2); // a post event loop scaling
-};
-#endif // ALIANASCALE_H
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-/* $Id: */
-
-//_________________________________________________________________________
-// A basic analysis task to analyse photon detected by PHOS
-// A basic analysis task to analyse photon detected by PHOS
-// A basic analysis task to analyse photon detected by PHOS
-// Adapted for AliAnalysisTaskSE and AOD production
-// by Gustavo Conesa
-//
-//*-- Yves Schutz
-//////////////////////////////////////////////////////////////////////////////
-
-#include <TCanvas.h>
-#include <TH1.h>
-#include <TROOT.h>
-#include <TLegend.h>
-#include <TNtuple.h>
-#include <TVector3.h>
-
-#include "AliAnalysisTaskPHOSExample.h"
-#include "AliAnalysisManager.h"
-#include "AliESDEvent.h"
-#include "AliESDCaloCluster.h"
-#include "AliAODEvent.h"
-#include "AliAODPhoton.h"
-#include "AliLog.h"
-#include "AliESDVertex.h"
-
-//______________________________________________________________________________
-AliAnalysisTaskPHOSExample::AliAnalysisTaskPHOSExample() :
- fDebug(0),
- fAODPhotons(0x0),
- fPhotonsInPhos(0),
- fPhotonId(1.0),
- fOutputList(0x0),
- fhPHOSPos(0),
- fhPHOS(0),
- fhPHOSEnergy(0),
- fhPHOSDigits(0),
- fhPHOSRecParticles(0),
- fhPHOSPhotons(0),
- fhPHOSInvariantMass(0),
- fhPHOSDigitsEvent(0)
-{
- //Default constructor
-}
-//______________________________________________________________________________
-AliAnalysisTaskPHOSExample::AliAnalysisTaskPHOSExample(const char *name) :
- AliAnalysisTaskSE(name),
- fDebug(0),
- fAODPhotons(0x0),
- fPhotonsInPhos(0),
- fPhotonId(1.0),
- fOutputList(0x0),
- fhPHOSPos(0),
- fhPHOS(0),
- fhPHOSEnergy(0),
- fhPHOSDigits(0),
- fhPHOSRecParticles(0),
- fhPHOSPhotons(0),
- fhPHOSInvariantMass(0),
- fhPHOSDigitsEvent(0)
-{
- // Constructor.
-
- // Output slots
- DefineOutput(1, TList::Class()) ;
-}
-
-//____________________________________________________________________________
-AliAnalysisTaskPHOSExample::AliAnalysisTaskPHOSExample(const AliAnalysisTaskPHOSExample& ap) :
- AliAnalysisTaskSE(ap.GetName()),
- fDebug(ap.fDebug),
- fAODPhotons(ap.fAODPhotons),
- fPhotonsInPhos(ap.fPhotonsInPhos),
- fPhotonId(ap.fPhotonId),
- fOutputList(ap.fOutputList),
- fhPHOSPos(ap.fhPHOSPos),
- fhPHOS(ap.fhPHOS),
- fhPHOSEnergy(ap.fhPHOSEnergy),
- fhPHOSDigits(ap.fhPHOSDigits),
- fhPHOSRecParticles(ap.fhPHOSRecParticles),
- fhPHOSPhotons(ap.fhPHOSPhotons),
- fhPHOSInvariantMass(ap.fhPHOSInvariantMass),
- fhPHOSDigitsEvent(ap.fhPHOSDigitsEvent)
-{
- // cpy ctor
-}
-
-//_____________________________________________________________________________
-AliAnalysisTaskPHOSExample& AliAnalysisTaskPHOSExample::operator = (const AliAnalysisTaskPHOSExample& ap)
-{
-// assignment operator
-
- this->~AliAnalysisTaskPHOSExample();
- new(this) AliAnalysisTaskPHOSExample(ap);
- return *this;
-}
-
-//______________________________________________________________________________
-AliAnalysisTaskPHOSExample::~AliAnalysisTaskPHOSExample()
-{
- // dtor
- if(fOutputList) {
- fOutputList->Clear() ;
- delete fOutputList ;
- }
-}
-
-
-//________________________________________________________________________
-void AliAnalysisTaskPHOSExample::UserCreateOutputObjects()
-{
- // Create the outputs containers
- //AODs
- fAODPhotons = new TClonesArray("AliAODPhoton", 0);
- fAODPhotons->SetName("Photons");
- AddAODBranch("TClonesArray", &fAODPhotons);
-
- OpenFile(1) ;
-
- fhPHOSPos = new TNtuple("PHOSPos" , "Position in PHOS" , "x:y:z");
- fhPHOS = new TNtuple("PHOS" , "PHOS" , "event:digits:clusters:photons");
- fhPHOSEnergy = new TH1D("PHOSEnergy" , "PHOSEnergy" , 100, 0., 100. ) ;
- fhPHOSDigits = new TH1I("PHOSDigitsCluster" , "PHOSDigits" , 20 , 0 , 20 ) ;
- fhPHOSRecParticles = new TH1D("PHOSRecParticles" , "PHOSRecParticles" , 20 , 0., 20. ) ;
- fhPHOSPhotons = new TH1I("PHOSPhotons" , "PHOSPhotons" , 20 , 0 , 20 ) ;
- fhPHOSInvariantMass = new TH1D("PHOSInvariantMass" , "PHOSInvariantMass" , 400, 0., 400.) ;
- fhPHOSDigitsEvent = new TH1I("PHOSDigitsEvent" , "PHOSDigitsEvent" , 30 , 0 , 30 ) ;
-
- // create output container
-
- fOutputList = new TList() ;
- fOutputList->SetName(GetName()) ;
-
- fOutputList->AddAt(fhPHOSPos, 0) ;
- fOutputList->AddAt(fhPHOS, 1) ;
- fOutputList->AddAt(fhPHOSEnergy, 2) ;
- fOutputList->AddAt(fhPHOSDigits, 3) ;
- fOutputList->AddAt(fhPHOSRecParticles, 4) ;
- fOutputList->AddAt(fhPHOSPhotons, 5) ;
- fOutputList->AddAt(fhPHOSInvariantMass, 6) ;
- fOutputList->AddAt(fhPHOSDigitsEvent, 7) ;
-
-
-}
-
-//______________________________________________________________________________
-void AliAnalysisTaskPHOSExample::UserExec(Option_t *)
-{
- // Processing of one event
-
- // if ( !((Entry()-1)%100) )
- AliInfo(Form(" Processing event # %lld", Entry())) ;
- AliESDEvent* esd = (AliESDEvent*)InputEvent();
-
- //************************ PHOS *************************************
- TRefArray * caloClustersArr = new TRefArray();
- esd->GetPHOSClusters(caloClustersArr);
-
- const Int_t kNumberOfPhosClusters = caloClustersArr->GetEntries() ;
-
- TVector3 ** phosVector = new TVector3*[kNumberOfPhosClusters] ;
- Float_t * phosPhotonsEnergy = new Float_t[kNumberOfPhosClusters] ;
- Int_t phosCluster ;
- Int_t numberOfDigitsInPhos = 0 ;
- Double_t v[3] ; //vertex ;
- esd->GetVertex()->GetXYZ(v) ;
-
- fPhotonsInPhos = 0 ;
- // loop over the PHOS Cluster
- for(phosCluster = 0 ; phosCluster < kNumberOfPhosClusters ; phosCluster++) {
- AliESDCaloCluster * caloCluster = (AliESDCaloCluster *) caloClustersArr->At(phosCluster) ;
-
- //AliESDCaloCluster * caloCluster = fESD->GetCaloCluster(phosCluster) ;
- if (caloCluster) {
- Float_t pos[3] ;
- caloCluster->GetPosition( pos ) ;
- fhPHOSEnergy->Fill( caloCluster->E() ) ;
- fhPHOSPos->Fill( pos[0], pos[1], pos[2] ) ;
- fhPHOSDigits->Fill(Entry(), caloCluster->GetNCells() ) ;
- numberOfDigitsInPhos += caloCluster->GetNCells() ;
- Double_t * pid = caloCluster->GetPid() ;
- if(pid[AliPID::kPhoton] > GetPhotonId() ) {
- phosVector[fPhotonsInPhos] = new TVector3(pos[0],pos[1],pos[2]) ;
- phosPhotonsEnergy[fPhotonsInPhos]=caloCluster->E() ;
- TLorentzVector momentum ;
- caloCluster->GetMomentum(momentum, v);
- new ((*fAODPhotons)[fPhotonsInPhos++]) AliAODPhoton (momentum);
- }
- }
- } //PHOS clusters
-
- fhPHOSRecParticles->Fill(kNumberOfPhosClusters);
- fhPHOSPhotons->Fill(fPhotonsInPhos);
- fhPHOSDigitsEvent->Fill(numberOfDigitsInPhos);
- fhPHOS->Fill(Entry(), numberOfDigitsInPhos, kNumberOfPhosClusters, fPhotonsInPhos) ;
-
- // invariant Mass
- if (fPhotonsInPhos > 1 ) {
- Int_t phosPhoton1, phosPhoton2 ;
- for(phosPhoton1 = 0 ; phosPhoton1 < fPhotonsInPhos ; phosPhoton1++) {
- for(phosPhoton2 = phosPhoton1 + 1 ; phosPhoton2 < fPhotonsInPhos ; phosPhoton2++) {
- Float_t tempMass = TMath::Sqrt( 2 * phosPhotonsEnergy[phosPhoton1] * phosPhotonsEnergy[phosPhoton2] *
- ( 1 - TMath::Cos(phosVector[phosPhoton1]->Angle(*phosVector[phosPhoton2])) )
- );
- fhPHOSInvariantMass->Fill(tempMass*1000.);
- }
- }
- }
-
- PostData(1, fOutputList);
-
- delete [] phosVector ;
- delete [] phosPhotonsEnergy ;
-
-}
-
-
-//______________________________________________________________________________
-void AliAnalysisTaskPHOSExample::Init()
-{
- // Intialisation of parameters
- AliInfo("Doing initialisation") ;
- SetPhotonId(0.9) ;
-}
-
-//______________________________________________________________________________
-void AliAnalysisTaskPHOSExample::Terminate(Option_t *)
-{
- // Processing when the event loop is ended
-
- Bool_t problem = kFALSE ;
- AliInfo(Form(" *** %s Report:", GetName())) ;
- printf(" PHOSEnergy Mean : %5.3f , RMS : %5.3f \n", fhPHOSEnergy->GetMean(), fhPHOSEnergy->GetRMS() ) ;
- printf(" PHOSDigits Mean : %5.3f , RMS : %5.3f \n", fhPHOSDigits->GetMean(), fhPHOSDigits->GetRMS() ) ;
- printf(" PHOSRecParticles Mean : %5.3f , RMS : %5.3f \n", fhPHOSRecParticles->GetMean(), fhPHOSRecParticles->GetRMS() ) ;
- printf(" PHOSPhotons Mean : %5.3f , RMS : %5.3f \n", fhPHOSPhotons->GetMean(), fhPHOSPhotons->GetRMS() ) ;
- printf(" PHOSInvariantMass Mean : %5.3f , RMS : %5.3f \n", fhPHOSInvariantMass->GetMean(), fhPHOSInvariantMass->GetRMS() ) ;
- printf(" PHOSDigitsEvent Mean : %5.3f , RMS : %5.3f \n", fhPHOSDigitsEvent->GetMean(), fhPHOSDigitsEvent->GetRMS() ) ;
-
- TCanvas * cPHOS = new TCanvas("cPHOS", "PHOS ESD Test", 400, 10, 600, 700) ;
- cPHOS->Divide(3, 2);
-
- cPHOS->cd(1) ;
- if ( fhPHOSEnergy->GetMaximum() > 0. )
- gPad->SetLogy();
- fhPHOSEnergy->SetAxisRange(0, 25.);
- fhPHOSEnergy->SetLineColor(2);
- fhPHOSEnergy->Draw();
-
- cPHOS->cd(2) ;
- fhPHOSDigits->SetAxisRange(0,25.);
- fhPHOSDigits->SetLineColor(2);
- fhPHOSDigits->Draw();
-
- cPHOS->cd(3) ;
- if ( fhPHOSRecParticles->GetMaximum() > 0. )
- gPad->SetLogy();
- fhPHOSRecParticles->SetAxisRange(0, 25.);
- fhPHOSRecParticles->SetLineColor(2);
- fhPHOSRecParticles->Draw();
-
- cPHOS->cd(4) ;
- if ( fhPHOSPhotons->GetMaximum() > 0. )
- gPad->SetLogy();
- fhPHOSPhotons->SetAxisRange(0,25.);
- fhPHOSPhotons->SetLineColor(2);
- fhPHOSPhotons->Draw();
-
- cPHOS->cd(5) ;
- fhPHOSInvariantMass->SetLineColor(2);
- fhPHOSInvariantMass->Draw();
-
- cPHOS->cd(6) ;
- if ( fhPHOSDigitsEvent->GetMaximum() > 0. )
- gPad->SetLogy();
- fhPHOSDigitsEvent->SetAxisRange(0,40.);
- fhPHOSDigitsEvent->SetLineColor(2);
- fhPHOSDigitsEvent->Draw();
-
- cPHOS->Print("PHOS.eps");
-
- char line[1024] ;
- sprintf(line, ".!tar -zcf %s.tar.gz *.eps", GetName()) ;
- gROOT->ProcessLine(line);
- sprintf(line, ".!rm -fR *.eps");
- gROOT->ProcessLine(line);
-
- AliInfo(Form("!!! All the eps files are in %s.tar.gz !!!", GetName())) ;
-
- const char * report ;
- if(problem)
- report="Problems found, please check!!!";
- else
- report="OK";
-
- AliInfo(Form("*** %s Summary Report: %s \n",GetName(), report)) ;
-}
+++ /dev/null
-#ifndef ALIANALYSISTASKPHOSEXAMPLE_H
-#define ALIANALYSISTASKPHOSEXAMPLE_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-//______________________________________________________________________________
-// A basic analysis task to analyse photon detected by PHOS
-// A basic analysis task to analyse photon detected by PHOS
-// Adapted for AliAnalysisTaskSE and AOD production
-// by Gustavo Conesa
-//
-//*-- Yves Schutz
-//////////////////////////////////////////////////////////////////////////////
-
-#include <TTree.h>
-#include "AliAnalysisTaskSE.h"
-
-class AliESDEvent ;
-class AliAODEvent ;
-class TNtuple ;
-class TH1D ;
-class TH1I ;
-
-class AliAnalysisTaskPHOSExample : public AliAnalysisTaskSE {
-
-public:
- AliAnalysisTaskPHOSExample() ;
- AliAnalysisTaskPHOSExample(const char *name) ;
- AliAnalysisTaskPHOSExample(const AliAnalysisTaskPHOSExample& ap) ;
- AliAnalysisTaskPHOSExample& operator = (const AliAnalysisTaskPHOSExample& ap) ;
- virtual ~AliAnalysisTaskPHOSExample() ;
-
- virtual void UserCreateOutputObjects();
- virtual void Init() ;
- virtual void LocalInit() { Init() ; }
- virtual void UserExec(Option_t * opt = "") ;
- Float_t GetPhotonId() const { return fPhotonId ; }
- void SetDebugLevel(Int_t level) { fDebug = level ; }
- void SetPhotonId(Float_t threshold) { fPhotonId = threshold ; }
- virtual void Terminate(Option_t * opt = "") ;
-
-private:
- // input and output
- Int_t fDebug ; // Debug flag
- TClonesArray * fAODPhotons ; //! reconstructed photons
- Int_t fPhotonsInPhos ; //! number of photons found
- // task parameters
- Float_t fPhotonId ; // threshold for photon identification
-
- // Histograms
- TList * fOutputList ; //! output data list
- TNtuple * fhPHOSPos ; //! PHOS (x,y)
- TNtuple * fhPHOS ; //! all PHOS parameters
- TH1D * fhPHOSEnergy ; //! PHOS energy
- TH1I * fhPHOSDigits ; //! PHOS numer of SDigits
- TH1D * fhPHOSRecParticles ;//! PHOS number of RecParticles
- TH1I * fhPHOSPhotons ; //! PHOS number of photons
- TH1D * fhPHOSInvariantMass ; //! PHOS invariant mass
- TH1I * fhPHOSDigitsEvent ; //! PHOS numbet of Sdigits per event
-
- ClassDef(AliAnalysisTaskPHOSExample, 1); // a PHOS photon analysis task
-};
-#endif // ALIANALYSISTASKPHOSEXAMPLE_H
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-// root
-#include <TROOT.h>
-#include <TSystem.h>
-#include <TInterpreter.h>
-#include <TChain.h>
-#include <TFile.h>
-#include <Riostream.h>
-
-// analysis
-#include "AliAnalysisTaskParticleCorrelation.h"
-#include "AliAnalysisManager.h"
-#include "AliESDInputHandler.h"
-#include "AliMCEventHandler.h"
-#include "AliMCEvent.h"
-#include "AliAnaPartCorrMaker.h"
-#include "AliCaloTrackReader.h"
-#include "AliESDEvent.h"
-#include "AliAODEvent.h"
-#include "AliAODHandler.h"
-#include "AliStack.h"
-#include "AliLog.h"
-
-ClassImp(AliAnalysisTaskParticleCorrelation)
-
-////////////////////////////////////////////////////////////////////////
-
- AliAnalysisTaskParticleCorrelation::AliAnalysisTaskParticleCorrelation():
- AliAnalysisTaskSE(),
- fAna(0x0),
- fOutputContainer(0x0),
- fAODBranch(0x0),
- fConfigName(0)
-{
- // Default constructor
-}
-
-//_____________________________________________________
-AliAnalysisTaskParticleCorrelation::AliAnalysisTaskParticleCorrelation(const char* name):
- AliAnalysisTaskSE(name),
- fAna(0x0),
- fOutputContainer(0x0),
- fAODBranch(0x0),
- fConfigName("ConfigAnalysis")
-{
- // Default constructor
-
- DefineOutput(1, TList::Class());
-
-}
-
-//_____________________________________________________
-AliAnalysisTaskParticleCorrelation::~AliAnalysisTaskParticleCorrelation()
-{
- // Remove all pointers
-
- if(fOutputContainer){
- fOutputContainer->Clear() ;
- delete fOutputContainer ;
- }
-
-}
-
-//_____________________________________________________
-void AliAnalysisTaskParticleCorrelation::UserCreateOutputObjects()
-{
- // Create the output container
- if (fDebug > 1) printf("AnalysisTaskParticleCorrelation::CreateOutputData() \n");
-
- //AODs
- fAODBranch = new TClonesArray("AliAODParticleCorrelation", 0);
- fAODBranch->SetName(fAna->GetAODBranchName());
- AddAODBranch("TClonesArray", &fAODBranch);
- fAna->SetAODBranch(fAODBranch);
-
- //Histograms container
- OpenFile(1);
- fOutputContainer = fAna->GetOutputContainer();
-
-}
-
-//_____________________________________________________
-void AliAnalysisTaskParticleCorrelation::Init()
-{
- // Initialization
- if (fDebug > 1) printf("AnalysisTaskParticleCorrelation::Init() \n");
-
- // Call configuration file
-
- if(fConfigName == ""){
- fConfigName="ConfigAnalysis";
- }
-
- AliInfo(Form("### Configuration file is %s.C ###", fConfigName.Data()));
- gROOT->LoadMacro(fConfigName+".C");
- fAna = (AliAnaPartCorrMaker*) gInterpreter->ProcessLine("ConfigAnalysis()");
-
- if(!fAna)
- AliFatal("Analysis pointer not initialized, abort analysis!");
-
- // Initialise analysis
- fAna->Init();
-
- AliDebug(1,"End");
-
-}
-
-
-//_____________________________________________________
-void AliAnalysisTaskParticleCorrelation::UserExec(Option_t */*option*/)
-{
- // Execute analysis for current event
- //
- if (fDebug > 1) printf("AnalysisTaskParticleCorrelation::Exec() \n");
-
- //Get the type of data, check if type is correct
- Int_t datatype = fAna->GetReader()->GetDataType();
- if(datatype != AliCaloTrackReader::kESD && datatype != AliCaloTrackReader::kAOD &&
- datatype != AliCaloTrackReader::kMC){
- AliFatal("Wrong type of data");
- return ;
- }
-
- fAna->GetReader()->SetInputEvent(InputEvent(), AODEvent(), MCEvent());
-
- //Process event
- fAna->ProcessEvent((Int_t) Entry());
-
- PostData(1, fOutputContainer);
-
-}
-
-//_____________________________________________________
-void AliAnalysisTaskParticleCorrelation::Terminate(Option_t */*option*/)
-{
- // Terminate analysis
- //
- AliDebug(1,"Do nothing in Terminate");
- //fAna->Terminate();
-}
-
+++ /dev/null
-#ifndef AliAnalysisTaskParticleCorrelation_H
-#define AliAnalysisTaskParticleCorrelation_H
-
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-#include "AliAnalysisTaskSE.h"
-class AliAnaPartCorrMaker;
-class AliESDEvent;
-class AliAODEvent;
-class TList;
-
-class AliAnalysisTaskParticleCorrelation : public AliAnalysisTaskSE
-{
- public:
- AliAnalysisTaskParticleCorrelation();
- AliAnalysisTaskParticleCorrelation(const char* name);
- virtual ~AliAnalysisTaskParticleCorrelation() ;// virtual dtor
-
- // Implementation of interface methods
- virtual void UserCreateOutputObjects();
- virtual void Init();
- virtual void LocalInit() {Init();}
- virtual void UserExec(Option_t *option);
- virtual void Terminate(Option_t *option);
-
- void SetConfigFileName(TString name ) {fConfigName = name ; }
- TString GetConfigFileName() const {return fConfigName ; }
-
- private:
- AliAnalysisTaskParticleCorrelation(const AliAnalysisTaskParticleCorrelation&); // Not implemented
- AliAnalysisTaskParticleCorrelation& operator=(const AliAnalysisTaskParticleCorrelation&); // Not implemented
-
- AliAnaPartCorrMaker* fAna; // Pointer to the jet finder
- TList * fOutputContainer ; //! Histogram container
- TClonesArray * fAODBranch; //! AOD branch
- TString fConfigName ; //Configuration file name
-
- ClassDef(AliAnalysisTaskParticleCorrelation, 1); // Analysis task for standard gamma correlation analysis
-};
-
-#endif //AliAnalysisTaskParticleCorrelation_H
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-/* $Id: AliCaloPID.cxx 21839 2007-10-29 13:49:42Z gustavo $ */
-
-//_________________________________________________________________________
-// Class for track/cluster acceptance selection
-// Selection in Central barrel, EMCAL and PHOS
-//
-//*-- Author: Gustavo Conesa (LNF-INFN)
-//////////////////////////////////////////////////////////////////////////////
-
-
-// --- ROOT system ---
-#include <TMath.h>
-#include <TLorentzVector.h>
-#include <TString.h>
-#include <TFormula.h>
-
-//---- ANALYSIS system ----
-#include "AliLog.h"
-#include "AliCaloPID.h"
-#include "AliAODCluster.h"
-
-ClassImp(AliCaloPID)
-
-
-//________________________________________________
-AliCaloPID::AliCaloPID() :
- TObject(), fEMCALPhotonWeight(0.), fEMCALPi0Weight(0.),
- fEMCALElectronWeight(0.), fEMCALChargeWeight(0.),
- fEMCALNeutralWeight(0.),
- fPHOSPhotonWeight(0.), fPHOSPi0Weight(0.),
- fPHOSElectronWeight(0.), fPHOSChargeWeight(0.) ,
- fPHOSNeutralWeight(0.), fPHOSWeightFormula(0),
- fPHOSPhotonWeightFormula(0x0), fPHOSPi0WeightFormula(0x0)
-{
- //Ctor
-
- //Initialize parameters
- InitParameters();
-}
-
-//____________________________________________________________________________
-AliCaloPID::AliCaloPID(const AliCaloPID & pid) :
- TObject(pid), fEMCALPhotonWeight(pid.fEMCALPhotonWeight),
- fEMCALPi0Weight(pid.fEMCALPi0Weight),
- fEMCALElectronWeight(pid.fEMCALElectronWeight),
- fEMCALChargeWeight(pid.fEMCALChargeWeight),
- fEMCALNeutralWeight(pid.fEMCALNeutralWeight),
- fPHOSPhotonWeight(pid.fPHOSPhotonWeight),
- fPHOSPi0Weight(pid.fPHOSPi0Weight),
- fPHOSElectronWeight(pid.fPHOSElectronWeight),
- fPHOSChargeWeight(pid.fPHOSChargeWeight),
- fPHOSNeutralWeight(pid.fPHOSNeutralWeight),
- fPHOSWeightFormula(pid.fPHOSWeightFormula),
- fPHOSPhotonWeightFormula(pid.fPHOSPhotonWeightFormula),
- fPHOSPi0WeightFormula(pid.fPHOSPi0WeightFormula)
-
-
-{
- // cpy ctor
-
-}
-
-//_________________________________________________________________________
-AliCaloPID & AliCaloPID::operator = (const AliCaloPID & pid)
-{
- // assignment operator
-
- if(&pid == this) return *this;
-
- fEMCALPhotonWeight = pid. fEMCALPhotonWeight ;
- fEMCALPi0Weight = pid.fEMCALPi0Weight ;
- fEMCALElectronWeight = pid.fEMCALElectronWeight;
- fEMCALChargeWeight = pid.fEMCALChargeWeight;
- fEMCALNeutralWeight = pid.fEMCALNeutralWeight;
-
- fPHOSPhotonWeight = pid.fPHOSPhotonWeight ;
- fPHOSPi0Weight = pid.fPHOSPi0Weight ;
- fPHOSElectronWeight = pid.fPHOSElectronWeight;
- fPHOSChargeWeight = pid.fPHOSChargeWeight;
- fPHOSNeutralWeight = pid.fPHOSNeutralWeight;
-
- fPHOSWeightFormula = pid.fPHOSWeightFormula;
- fPHOSPhotonWeightFormula = pid.fPHOSPhotonWeightFormula;
- fPHOSPi0WeightFormula = pid.fPHOSPi0WeightFormula;
-
- return *this;
-
-}
-
-//_________________________________
-AliCaloPID::~AliCaloPID() {
- //Dtor
-
- if(fPHOSPhotonWeightFormula) delete fPHOSPhotonWeightFormula ;
- if(fPHOSPi0WeightFormula) delete fPHOSPi0WeightFormula ;
-
-}
-
-
-//_______________________________________________________________
-void AliCaloPID::InitParameters()
-{
- //Initialize the parameters of the PID.
-
- fEMCALPhotonWeight = 0.8 ;
- fEMCALPi0Weight = 0.5 ;
- fEMCALElectronWeight = 0.8 ;
- fEMCALChargeWeight = 0.5 ;
- fEMCALNeutralWeight = 0.5 ;
-
- fPHOSPhotonWeight = 0.75 ;
- fPHOSPi0Weight = 0.8 ;
- fPHOSElectronWeight = 0.5 ;
- fPHOSChargeWeight = 0.5 ;
- fPHOSNeutralWeight = 0.5 ;
-
- //Formula to set the PID weight threshold for photon or pi0
- fPHOSWeightFormula = kTRUE;
- fPHOSPhotonWeightFormula =
- new TFormula("photonWeight","0.98*(x<40)+ 0.68*(x>=100)+(x>=40 && x<100)*(0.98+x*(6e-3)-x*x*(2e-04)+x*x*x*(1.1e-06))");
- fPHOSPi0WeightFormula =
- new TFormula("pi0Weight","0.98*(x<65)+ 0.915*(x>=100)+(x>=65 && x-x*(1.95e-3)-x*x*(4.31e-05)+x*x*x*(3.61e-07))");
-}
-
-
-//________________________________________________________________
-void AliCaloPID::Print(const Option_t * opt) const
-{
-
- //Print some relevant parameters set for the analysis
- if(! opt)
- return;
-
- printf("***** Print: %s %s ******\n", GetName(), GetTitle() ) ;
-
- printf("PHOS PID weight , photon %0.2f, pi0 %0.2f, e %0.2f, charge %0.2f, neutral %0.2f \n",
- fPHOSPhotonWeight, fPHOSPi0Weight,
- fPHOSElectronWeight, fPHOSChargeWeight, fPHOSNeutralWeight) ;
- printf("EMCAL PID weight, photon %0.2f, pi0 %0.2f, e %0.2f, charge %0.2f, neutral %0.2f\n",
- fEMCALPhotonWeight, fEMCALPi0Weight,
- fEMCALElectronWeight, fEMCALChargeWeight, fEMCALNeutralWeight) ;
-
- printf("PHOS Parametrized weight on? = %d\n", fPHOSWeightFormula) ;
-// if(fPHOSWeightFormula){
-// printf(">>>>>>>>>>> Photon weight formula<<<<<<<<<<<<\n");
-// fPHOSPhotonWeightFormula->Print();
-// printf(">>>>>>>>>>> Pi0 weight formula<<<<<<<<<<<<\n");
-// fPHOSPhotonWeightFormula->Print();
-// }
- printf(" \n");
-
-}
-
-//_______________________________________________________________
-Int_t AliCaloPID::GetPdg(const TString calo, const Double_t * pid, const Float_t energy) const {
- //Return most probable identity of the particle.
-
- if(!pid) AliFatal("pid pointer not initialized!!!");
-
- Float_t wPh = fPHOSPhotonWeight ;
- Float_t wPi0 = fPHOSPi0Weight ;
- Float_t wE = fPHOSElectronWeight ;
- Float_t wCh = fPHOSChargeWeight ;
- Float_t wNe = fPHOSNeutralWeight ;
-
-
- if(calo == "PHOS" && fPHOSWeightFormula){
- wPh = fPHOSPhotonWeightFormula->Eval(energy) ;
- wPi0 = fPHOSPi0WeightFormula->Eval(energy);
- }
-
- if(calo == "EMCAL"){
-
- wPh = fEMCALPhotonWeight ;
- wPi0 = fEMCALPi0Weight ;
- wE = fEMCALElectronWeight ;
- wCh = fEMCALChargeWeight ;
- wNe = fEMCALNeutralWeight ;
-
- }
-
-// printf("PID: calo %s, ph %0.2f, pi0 %0.2f, el %0.2f, conv el %0.2f, hadrons: pion %0.2f, kaon %0.2f, proton %0.2f , neutron %0.2f, kaon %0.2f \n",
-// calo.Data(),pid[AliAODCluster::kPhoton], pid[AliAODCluster::kPi0],
-// pid[AliAODCluster::kElectron], pid[AliAODCluster::kEleCon],
-// pid[AliAODCluster::kPion], pid[AliAODCluster::kKaon], pid[AliAODCluster::kProton],
-// pid[AliAODCluster::kNeutron], pid[AliAODCluster::kKaon0]);
-
- Int_t pdg = kNeutralUnknown ;
- Float_t chargedHadronWeight = pid[AliAODCluster::kProton]+pid[AliAODCluster::kKaon]+
- pid[AliAODCluster::kPion]+pid[AliAODCluster::kMuon];
- Float_t neutralHadronWeight = pid[AliAODCluster::kNeutron]+pid[AliAODCluster::kKaon0];
- Float_t allChargedWeight = pid[AliAODCluster::kElectron]+pid[AliAODCluster::kEleCon]+ chargedHadronWeight;
- Float_t allNeutralWeight = pid[AliAODCluster::kPhoton]+pid[AliAODCluster::kPi0]+ neutralHadronWeight;
-
- //Select most probable ID
- if(calo=="PHOS"){
- if(pid[AliAODCluster::kPhoton] > wPh) pdg = kPhoton ;
- else if(pid[AliAODCluster::kPi0] > wPi0) pdg = kPi0 ;
- else if(pid[AliAODCluster::kElectron] > wE) pdg = kElectron ;
- else if(pid[AliAODCluster::kEleCon] > wE) pdg = kEleCon ;
- else if(chargedHadronWeight > wCh) pdg = kChargedHadron ;
- else if(neutralHadronWeight > wNe) pdg = kNeutralHadron ;
- else if(allChargedWeight > allNeutralWeight)
- pdg = kChargedUnknown ;
- else
- pdg = kNeutralUnknown ;
- }
- else{//EMCAL
- //Temporal solution, electrons and photons not differenciated
- if(pid[AliAODCluster::kPhoton] + pid[AliAODCluster::kElectron] > wPh) pdg = kPhoton ;
- else if(pid[AliAODCluster::kPi0] > wPi0) pdg = kPi0 ;
- else if(chargedHadronWeight + neutralHadronWeight > wCh) pdg = kChargedHadron ;
- else if(neutralHadronWeight + chargedHadronWeight > wNe) pdg = kNeutralHadron ;
- else pdg = kNeutralUnknown ;
-
- }
-
-
- //printf("Final Pdg: %d \n", pdg);
-
-
-
- return pdg ;
-
-}
-
-//_______________________________________________________________
-Int_t AliCaloPID::GetPdg(const TString calo, const TLorentzVector mom, const Double_t l0,
- const Double_t l1, const Double_t disp, const Double_t tof,
- const Double_t distCPV) const {
- //Recalculated PID with all parameters
- AliDebug(2,Form("Calorimeter %s, E %3.2f, l0 %3.2f, l1 %3.2f, disp %3.2f, tof %3.2f, distCPV %3.2f",
- calo.Data(),mom.E(),l0,l1,disp,tof,distCPV));
-
- if(calo == "EMCAL") {
- if(l0 < 0.25) return kPhoton ;
- else return kNeutralHadron ;
- }
-
- return kNeutralHadron ;
-
-}
-
+++ /dev/null
-#ifndef ALICALOPID_H
-#define ALICALOPID_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-/* $Id: $ */
-
-//_________________________________________________________________________
-// Class for track/cluster acceptance selection
-// Selection in Central barrel, EMCAL and PHOS
-//
-//*-- Author: Gustavo Conesa (INFN-LNF)
-
-// --- ROOT system ---
-#include <TObject.h>
-class TString ;
-class Riostream ;
-class TLorentzVector ;
-class TFormula ;
-
-//--- AliRoot system ---
-class AliLog ;
-
-class AliCaloPID : public TObject {
-
-public:
-
- AliCaloPID() ; // ctor
- AliCaloPID(const AliCaloPID & g) ; // cpy ctor
- AliCaloPID & operator = (const AliCaloPID & g) ;//cpy assignment
- virtual ~AliCaloPID() ;//virtual dtor
-
- enum PidType {
- kPhoton = 22,
- kPi0 = 111,
- kEta = 221,
- kElectron = 11,
- kEleCon = -11,
- kNeutralHadron = 2112,
- kChargedHadron = 211,
- kNeutralUnknown = 130,
- kChargedUnknown=321
- };
-
- enum PhotonStatusType {
- kPromptPhoton=2,
- kFragmentPhoton=3,
- kPi0DecayPhoton=4,
- kEtaDecayPhoton=5,
- kOtherDecayPhoton=6,
- kUnknown=7
- };
-
- void InitParameters();
-
- void Print(const Option_t * opt)const;
-
- Int_t GetPdg(const TString calo, const Double_t * pid, const Float_t energy) const ;
- Int_t GetPdg(const TString calo, const TLorentzVector mom, const Double_t l0, const Double_t l1, const Double_t disp, const Double_t tof, const Double_t distCPV) const ;
-
- //Weight getters
- Float_t GetEMCALPhotonWeight() const { return fEMCALPhotonWeight ; }
- Float_t GetEMCALPi0Weight() const { return fEMCALPi0Weight ; }
- Float_t GetEMCALElectronWeight() const { return fEMCALElectronWeight ; }
- Float_t GetEMCALChargeWeight() const { return fEMCALChargeWeight ; }
- Float_t GetEMCALNeutralWeight() const { return fEMCALNeutralWeight ; }
- Float_t GetPHOSPhotonWeight() const { return fPHOSPhotonWeight ; }
- Float_t GetPHOSPi0Weight() const { return fPHOSPi0Weight ; }
- Float_t GetPHOSElectronWeight() const { return fPHOSElectronWeight ; }
- Float_t GetPHOSChargeWeight() const { return fPHOSChargeWeight ; }
- Float_t GetPHOSNeutralWeight() const { return fPHOSNeutralWeight ; }
-
- Bool_t IsPHOSPIDWeightFormulaOn() const { return fPHOSWeightFormula ; }
- TFormula * GetPHOSPhotonWeightFormula() const { return fPHOSPhotonWeightFormula ; }
- TFormula * GetPHOSPi0WeightFormula() const { return fPHOSPi0WeightFormula ; }
-
- //Weight setters
- void SetEMCALPhotonWeight(Float_t w){ fEMCALPhotonWeight = w ; }
- void SetEMCALPi0Weight(Float_t w){ fEMCALPi0Weight = w ; }
- void SetEMCALElectronWeight(Float_t w){ fEMCALElectronWeight = w ; }
- void SetEMCALChargeWeight(Float_t w){ fEMCALChargeWeight = w ; }
- void SetEMCALNeutralWeight(Float_t w){ fEMCALNeutralWeight = w ; }
- void SetPHOSPhotonWeight(Float_t w){ fPHOSPhotonWeight = w ; }
- void SetPHOSPi0Weight(Float_t w){ fPHOSPi0Weight = w ; }
- void SetPHOSElectronWeight(Float_t w){ fPHOSElectronWeight = w ; }
- void SetPHOSChargeWeight(Float_t w){ fPHOSChargeWeight = w ; }
- void SetPHOSNeutralWeight(Float_t w){ fPHOSNeutralWeight = w ; }
-
- void UsePHOSPIDWeightFormula(Bool_t par) { fPHOSWeightFormula = par; }
- void SetPHOSPhotonWeightFormula(TFormula * photon) { fPHOSPhotonWeightFormula = photon; }
- void SetPHOSPi0WeightFormula(TFormula * pi0) { fPHOSPi0WeightFormula = pi0; }
-
- private:
-
- Float_t fEMCALPhotonWeight; //Bayesian PID weight for photons in EMCAL
- Float_t fEMCALPi0Weight; //Bayesian PID weight for pi0 in EMCAL
- Float_t fEMCALElectronWeight; //Bayesian PID weight for electrons in EMCAL
- Float_t fEMCALChargeWeight; //Bayesian PID weight for charged hadrons in EMCAL
- Float_t fEMCALNeutralWeight; //Bayesian PID weight for neutral hadrons in EMCAL
- Float_t fPHOSPhotonWeight; //Bayesian PID weight for photons in PHOS
- Float_t fPHOSPi0Weight; //Bayesian PID weight for pi0 in PHOS
- Float_t fPHOSElectronWeight; //Bayesian PID weight for electrons in PHOS
- Float_t fPHOSChargeWeight; //Bayesian PID weight for charged hadrons in PHOS
- Float_t fPHOSNeutralWeight; //Bayesian PID weight for neutral hadrons in PHOS
-
- Bool_t fPHOSWeightFormula ; //Use parametrized weight threshold, function of energy
- TFormula * fPHOSPhotonWeightFormula ; //Formula for photon weight
- TFormula * fPHOSPi0WeightFormula ; //Formula for pi0 weight
-
-
- ClassDef(AliCaloPID,1)
-} ;
-
-
-#endif //ALICALOPID_H
-
-
-
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-/* $Id: $ */
-
-//_________________________________________________________________________
-// Minimal class to store photon infomation for pi0, tagged and isolated photon analysis
-//
-//-- Author: Dmitri Peressounko (RRC "KI")
-
-#include "AliCaloPhoton.h"
-ClassImp(AliCaloPhoton)
-//===============================================
-AliCaloPhoton::AliCaloPhoton():TLorentzVector(),fDisp(0),
- fTof(0),fCpv(0),fPCA(0),fTrig(0),
- fIsTagged(0),fIsIsolated(0),
- fX(0.),fY(0.),fZ(0.),
- fModule(0),fBadDist(0)
-{
-
-
-}
-//===============================================
-AliCaloPhoton::AliCaloPhoton(Double_t px,Double_t py,Double_t pz,Double_t energy):
- TLorentzVector(px,py,pz,energy),fDisp(0),
- fTof(0),fCpv(0),fPCA(0),fTrig(0),
- fIsTagged(0),fIsIsolated(0),
- fX(0.),fY(0.),fZ(0.),
- fModule(0),fBadDist(0)
-{
-
-}
-//===============================================
-Bool_t AliCaloPhoton::IsPIDOK(Int_t ipid)const{
- // returns true if photon satisfies given PID criterium
- switch(ipid){
- case 0: return kTRUE ; //No PID at all
- case 1: return fPCA; //Overall PID calculated in AliPHOSPIDv1
- case 2: return fDisp ; //only dispersion cut
- case 3: return fTof ; //Only TOF cut
- case 4: return fCpv ; //Only CPV cut
- case 5: return fDisp&&fTof ; //Dispersion and TOF
- case 6: return fDisp&&fCpv ; //Dispersion and CPV
- case 7: return fTof && fCpv; //TOF and CPV
- case 8: return fDisp&&fTof&&fCpv ; // all 3 cuts
- default: return kFALSE ; //Not known combination
- }
-}
+++ /dev/null
-#ifndef ALICALOPHOTON_H
-#define ALICALOPHOTON_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-/* $Id: $ */
-
-//_________________________________________________________________________
-// Class to fill two-photon invariant mass hisograms
-// to be used to extract pi0 raw yield.
-//
-//-- Author: Dmitri Peressounko (RRC "KI")
-// This class contains all (minimal) necessary information about photon to
-// calculate invarint mass distr for pi0
-// and for tagging and isolation analysis
-
-
-#include "TLorentzVector.h"
-
-class AliCaloPhoton :public TLorentzVector{
-
- public:
-
- AliCaloPhoton() ;
- AliCaloPhoton(Double_t px,Double_t py,Double_t pz,Double_t E) ;
- ~AliCaloPhoton(){}
-
- Bool_t IsDispOK(void)const {return fDisp;}
- Bool_t IsTOFOK(void)const {return fTof;}
- Bool_t IsCPVOK(void)const {return fCpv;}
- Bool_t IsIsolated(void)const{return fIsIsolated ;}
- Bool_t IsTagged(void) const{return fIsTagged ;}
- Double_t EMCx(void)const {return fZ;}
- Double_t EMCy(void)const {return fZ;}
- Double_t EMCz(void)const {return fZ;}
- Int_t Module(void)const{return fModule;}
- Bool_t IsPIDOK(const Int_t ipid) const ;
- Int_t DistToBad()const {return fBadDist ;}
-
-
- void SetDispBit(Bool_t chi2){fDisp = chi2 ;}
- void SetTOFBit(Bool_t tof){fTof = tof ;}
- void SetCPVBit(Bool_t cpv){fCpv = cpv; }
- void SetPCAPID(Bool_t pca){fPCA = pca;}
- void SetTrig(Bool_t trig){fTrig=trig;}
- void SetEMCx(Double_t x){fX = x ;}
- void SetEMCy(Double_t y){fY = y ;}
- void SetEMCz(Double_t z){fZ = z ;}
- void SetModule(Int_t mod){fModule = mod ;}
- void SetDistToBad(Int_t dist){fBadDist=dist;}
- void SetTagged(Bool_t bit){fIsTagged=bit;}
- void SetIsolated(Bool_t bit){fIsIsolated=bit;}
-
-private:
- Bool_t fDisp ; //Dispersion bit
- Bool_t fTof ; //TOF bit
- Bool_t fCpv ; //Charged bit
- Bool_t fPCA ; //Principal Component Analysis bit
- Bool_t fTrig ; //If this photon fired trigger
- Bool_t fIsTagged; //If it is tagged
- Bool_t fIsIsolated ; //it is isolated
- Double_t fX ; //Cluster coordinates in ALICE ref system
- Double_t fY ; //Cluster coordinates in ALICE ref system
- Double_t fZ ; //Cluster coordinates in ALICE ref system
- Int_t fModule ; //Module number
- Int_t fBadDist ; //Distance to bad module in module units
-
- ClassDef(AliCaloPhoton,1)
-
-};
-
-#endif // #ifdef ALICALOPHOTON_H
-
-
+++ /dev/null
-
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-/* $Id: $ */
-
-//_________________________________________________________________________
-// Class for reading data (AODs) in order to do prompt gamma
-// or other particle identification and correlations
-//
-//
-//*-- Author: Gustavo Conesa (LNF-INFN)
-//////////////////////////////////////////////////////////////////////////////
-
-
-// --- ROOT system ---
-
-//---- ANALYSIS system ----
-#include "AliCaloTrackAODReader.h"
-#include "AliAODEvent.h"
-#include "AliAODVertex.h"
-#include "AliAODCaloCluster.h"
-#include "AliAODCaloCluster.h"
-#include "AliAODTrack.h"
-#include "AliMCEvent.h"
-#include "AliLog.h"
-#include "Riostream.h"
-
-ClassImp(AliCaloTrackAODReader)
-
-//____________________________________________________________________________
-AliCaloTrackAODReader::AliCaloTrackAODReader() :
- AliCaloTrackReader()
-{
- //Default Ctor
-
- //Initialize parameters
- fDataType=kAOD;
-
-}
-
-//____________________________________________________________________________
-AliCaloTrackAODReader::AliCaloTrackAODReader(const AliCaloTrackAODReader & g) :
- AliCaloTrackReader(g)
-{
- // cpy ctor
-}
-
-//_________________________________________________________________________
-AliCaloTrackAODReader & AliCaloTrackAODReader::operator = (const AliCaloTrackAODReader & source)
-{
- // assignment operator
-
- if(&source == this) return *this;
-
- return *this;
-
-}
-
-//____________________________________________________________________________
-void AliCaloTrackAODReader::FillInputCTS() {
- //Return array with CTS tracks
- fAODCTS = new TClonesArray("AliAODTrack",0);
-
- Int_t nTracks = fAOD->GetNumberOfTracks() ;
- Int_t naod = 0;
- Double_t p[3];
-
- for (Int_t itrack = 0; itrack < nTracks; itrack++) {////////////// track loop
- AliAODTrack * track = fAOD->GetTrack(itrack) ; // retrieve track from esd
-
- // //We want tracks fitted in the detectors:
- // ULong_t status=AliAODTrack::kTPCrefit;
- // status|=AliAODTrack::kITSrefit;
-
- //We want tracks whose PID bit is set:
- // ULong_t status =AliAODTrack::kITSpid;
- // status|=AliAODTrack::kTPCpid;
-
- // if ( (track->GetStatus() & status) == status) {//Check if the bits we want are set
-
- track->GetPxPyPz(p) ;
- TLorentzVector momentum(p[0],p[1],p[2],0);
-
- if(fCTSPtMin < momentum.Pt() && fFidutialCut->IsInFidutialCut(momentum,"CTS")){
-
- if(fDebug > 2 && momentum.Pt() > 0.1)printf("FillInputCTS():: Selected tracks E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n",
- momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta());
-
- new((*fAODCTS)[naod++]) AliAODTrack(*track);
-
- }//Pt and Fidutial cut passed.
- //}// track status
- }// track loop
- if(fDebug > 1) printf("FillInputCTS():: aod entries %d\n", fAODCTS->GetEntriesFast());
-}
-
-//____________________________________________________________________________
-void AliCaloTrackAODReader::FillInputEMCAL() {
- //Return array with EMCAL clusters in aod format
-
- fAODEMCAL = new TClonesArray("AliAODCaloCluster",0);
- TRefArray * caloClusters = new TRefArray();
- fAOD->GetEMCALClusters(caloClusters);
-
- //Get vertex for momentum calculation
- Double_t v[3] ; //vertex ;
- GetVertex(v);
-
- //Loop to select clusters in fidutial cut and fill container with aodClusters
- Int_t naod = 0;
- for (Int_t iclus = 0; iclus < caloClusters->GetEntriesFast(); iclus++) {
- AliAODCaloCluster * clus = (AliAODCaloCluster *) caloClusters->At(iclus) ;
- TLorentzVector momentum ;
- clus->GetMomentum(momentum, v);
-
- if(fEMCALPtMin < momentum.Pt() && fFidutialCut->IsInFidutialCut(momentum,"EMCAL")){
-
- if(fDebug > 2 && momentum.E() > 0.1)printf("FillInputEMCAL():: Selected clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n",
- momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta());
-
- new((*fAODEMCAL)[naod++]) AliAODCaloCluster(*clus);
-
- }//Pt and Fidutial cut passed.
- }//esd cluster loop
-
- if(fDebug > 1) printf("FillInputEMCAL():: aod entries %d\n", fAODEMCAL->GetEntriesFast());
-
-}
-
-//____________________________________________________________________________
-void AliCaloTrackAODReader::FillInputPHOS() {
- //Return array with PHOS clusters in aod format
-
- fAODPHOS = new TClonesArray("AliAODCaloCluster",0);
- TRefArray * caloClusters = new TRefArray();
- fAOD->GetPHOSClusters(caloClusters);
-
- //Get vertex for momentum calculation
- Double_t v[3] ; //vertex ;
- GetVertex(v);
-
- //Loop to select clusters in fidutial cut and fill container with aodClusters
- Int_t naod = 0;
-
- for (Int_t iclus = 0; iclus < caloClusters->GetEntriesFast(); iclus++) {
- AliAODCaloCluster * clus = (AliAODCaloCluster *) caloClusters->At(iclus) ;
- TLorentzVector momentum ;
- clus->GetMomentum(momentum, v);
-
- if(fPHOSPtMin < momentum.Pt() && fFidutialCut->IsInFidutialCut(momentum,"PHOS")){
-
- if(fDebug > 2 && momentum.E() > 0.1)printf("FillInputPHOS():: Selected clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n",
- momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta());
-
- new((*fAODPHOS)[naod++]) AliAODCaloCluster(*clus);
-
- }//Pt and Fidutial cut passed.
- }//esd cluster loop
-
- if(fDebug > 1) printf("FillInputPHOS():: aod entries %d\n", fAODPHOS->GetEntriesFast());
-
-
-}
-
-//____________________________________________________________________________
-void AliCaloTrackAODReader::FillInputEMCALCells() {
- //Return array with EMCAL cells in aod format
-
- fEMCALCells = (TNamed*) fAOD->GetEMCALCells();
-
-}
-
-//____________________________________________________________________________
-void AliCaloTrackAODReader::FillInputPHOSCells() {
- //Return array with PHOS cells in aod format
-
- fPHOSCells = (TNamed*) fAOD->GetPHOSCells();
-
-}
-
-//____________________________________________________________________________
-void AliCaloTrackAODReader::GetVertex(Double_t v[3]) {
- //Return vertex position
-
- v[0]=fAOD->GetVertex(0)->GetX() ;//CHECK!!!
- v[1]=fAOD->GetVertex(0)->GetY() ;//CHECK!!!
- v[2]=fAOD->GetVertex(0)->GetZ() ;//CHECK!!!
-}
-
-
-//____________________________________________________________________________
-void AliCaloTrackAODReader::SetInputEvent(TObject* input, TObject* aod, TObject* mc) {
- // Connect the data pointers
-
- //If input is AOD, do analysis with input, if not, do analysis with the output aod.
- if(!strcmp(input->GetName(),"AliESDEvent")) SetAOD((AliAODEvent*) aod);
- else if(!strcmp(input->GetName(),"AliAODEvent")) SetAOD((AliAODEvent*) input);
- else AliFatal(Form("Unknown data format: %s",input->GetName()));
-
- SetMC((AliMCEvent*) mc);
-
-}
+++ /dev/null
-#ifndef AliCaloTrackAODReader_H
-#define AliCaloTrackAODReader_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-/* $Id: $ */
-
-//_________________________________________________________________________
-// Class for reading data (AODs) in order to do prompt gamma or other particle
-// identification and correlations
-//
-//
-// -- Author: Gustavo Conesa (INFN-LNF)
-
-// --- ROOT system ---
-
-// --- AliRoot system ---
-#include "AliCaloTrackReader.h"
-
-class AliCaloTrackAODReader : public AliCaloTrackReader {
-
- public:
-
- AliCaloTrackAODReader() ; // ctor
- AliCaloTrackAODReader(const AliCaloTrackAODReader & g) ; // cpy ctor
- AliCaloTrackAODReader & operator = (const AliCaloTrackAODReader & g) ;//cpy assignment
- virtual ~AliCaloTrackAODReader() {;} //virtual dtor
-
- void FillInputCTS();
- void FillInputEMCAL();
- void FillInputPHOS();
-
- void FillInputEMCALCells();
- void FillInputPHOSCells();
-
- void GetVertex(Double_t v[3]) ;
-
- void SetInputEvent(TObject* esd, TObject* aod, TObject* mc) ;
-
-
- ClassDef(AliCaloTrackAODReader,1)
- } ;
-
-
-#endif //AliCaloTrackAODReader_H
-
-
-
+++ /dev/null
-
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-/* $Id: $ */
-
-//_________________________________________________________________________
-// Class for reading data (ESDs) in order to do prompt gamma
-// or other particle identification and correlations
-//
-//
-//*-- Author: Gustavo Conesa (LNF-INFN)
-//////////////////////////////////////////////////////////////////////////////
-
-
-// --- ROOT system ---
-
-//---- ANALYSIS system ----
-#include "AliCaloTrackESDReader.h"
-#include "AliESDEvent.h"
-#include "AliESDVertex.h"
-#include "AliESDCaloCluster.h"
-#include "AliAODCaloCluster.h"
-#include "AliAODTrack.h"
-#include "AliAODEvent.h"
-#include "AliMCEvent.h"
-#include "AliLog.h"
-#include "Riostream.h"
-
-ClassImp(AliCaloTrackESDReader)
-
-//____________________________________________________________________________
-AliCaloTrackESDReader::AliCaloTrackESDReader() :
- AliCaloTrackReader()
-{
- //Default Ctor
-
- //Initialize parameters
- fDataType=kESD;
-
-}
-
-//____________________________________________________________________________
-AliCaloTrackESDReader::AliCaloTrackESDReader(const AliCaloTrackESDReader & g) :
- AliCaloTrackReader(g)
-{
- // cpy ctor
-}
-
-//_________________________________________________________________________
-AliCaloTrackESDReader & AliCaloTrackESDReader::operator = (const AliCaloTrackESDReader & source)
-{
- // assignment operator
-
- if(&source == this) return *this;
-
- return *this;
-
-}
-
-//____________________________________________________________________________
-void AliCaloTrackESDReader::FillInputCTS() {
- //Return array with CTS tracks
-
- fAODCTS = new TClonesArray("AliAODTrack",0);
-
- Int_t nTracks = fESD->GetNumberOfTracks() ;
- Int_t naod = 0;
- Double_t pos[3];
- Double_t p[3];
- Double_t covTr[21];
- Double_t pid[10];
- for (Int_t itrack = 0; itrack < nTracks; itrack++) {////////////// track loop
- AliESDtrack * track = fESD->GetTrack(itrack) ; // retrieve track from esd
-
- //We want tracks fitted in the detectors:
- ULong_t status=AliESDtrack::kTPCrefit;
- status|=AliESDtrack::kITSrefit;
-
- if ( (track->GetStatus() & status) == status) {//Check if the bits we want are set
-
- track->GetPxPyPz(p) ;
- TLorentzVector momentum(p[0],p[1],p[2],0);
-
- if(fCTSPtMin < momentum.Pt() &&fFidutialCut->IsInFidutialCut(momentum,"CTS")){
-
- if(fDebug > 3 && momentum.Pt() > 0.2)printf("FillInputCTS():: Selected tracks E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n",
- momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta());
-
- track->GetXYZ(pos);
- track->GetCovarianceXYZPxPyPz(covTr);
- track->GetESDpid(pid);
-
- Float_t impactXY, impactZ;
-
- track->GetImpactParameters(impactXY,impactZ);
-
- if (impactXY<3) {
- // track inside the beam pipe
-
- AliAODTrack *aodTrack = new((*fAODCTS)[naod++])
- AliAODTrack(track->GetID(), track->GetLabel(), p, kTRUE, pos, kFALSE,covTr, (Short_t)track->GetSign(), track->GetITSClusterMap(),
- pid,
- 0x0,//primary,
- kTRUE, // check if this is right
- kTRUE, // check if this is right
- AliAODTrack::kPrimary,
- 0);
-
- aodTrack->SetFlags(track->GetStatus());
- aodTrack->ConvertAliPIDtoAODPID();
- }
- else continue; // outside the beam pipe: orphan track
- }//Pt and Fidutial cut passed.
- }// track status
- }// track loop
- if(fDebug > 1) printf("FillInputCTS():: aod entries %d\n", fAODCTS->GetEntriesFast());
-}
-
-//____________________________________________________________________________
-void AliCaloTrackESDReader::FillInputEMCAL() {
- //Return array with EMCAL clusters in aod format
-
- fAODEMCAL = new TClonesArray("AliAODCaloCluster",0);
-
- TRefArray * caloClusters = new TRefArray();
- fESD->GetEMCALClusters(caloClusters);
-
- //Get vertex for momentum calculation
- Double_t v[3] ; //vertex ;
- GetVertex(v);
-
- //Loop to select clusters in fidutial cut and fill container with aodClusters
- Int_t naod = 0;
- Float_t pos[3] ;
-// Double_t * pid = new Double_t[AliPID::kSPECIESN];
-
- for (Int_t iclus = 0; iclus < caloClusters->GetEntriesFast(); iclus++) {
- AliESDCaloCluster * clus = (AliESDCaloCluster *) caloClusters->At(iclus) ;
- TLorentzVector momentum ;
- clus->GetMomentum(momentum, v);
- if(fDebug > 3 && momentum.E() > 0.1)printf("FillInputEMCAL():: all clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n",
- momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta());
- if(fEMCALPtMin < momentum.Pt() && fFidutialCut->IsInFidutialCut(momentum,"EMCAL")){
-
- if(fDebug > 2 && momentum.E() > 0.1)printf("FillInputEMCAL():: Selected clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n",
- momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta());
-// pid=clus->GetPid();
- clus->GetPosition(pos) ;
-// printf("Reader PID ESD: ph %0.2f, pi0 %0.2f, el %0.2f, conv el %0.2f,pi %0.2f, k %0.2f, p %0.2f, k0 %0.2f, n %0.2f, mu %0.2f \n",
-// pid[AliPID::kPhoton],pid[AliPID::kPi0],
-// pid[AliPID::kElectron],pid[AliPID::kEleCon],pid[AliPID::kPion],
-// pid[AliPID::kKaon],pid[AliPID::kProton], pid[AliPID::kKaon0],
-// pid[AliPID::kNeutron], pid[AliPID::kMuon]);
- Int_t id = clus->GetID();
- Int_t nLabel = clus->GetNLabels();
- Int_t *labels=0x0;
- if(clus->GetLabels()) labels = (clus->GetLabels())->GetArray();
-
- Float_t energy = clus->E();
- Char_t ttype= AliAODCluster::kEMCALClusterv1;
- AliAODCaloCluster *caloCluster = new((*fAODEMCAL)[naod++])
- AliAODCaloCluster(id,nLabel,labels,energy, pos, NULL,ttype,0);
-
- caloCluster->SetPIDFromESD(clus->GetPid());
- caloCluster->SetCaloCluster(clus->GetDistanceToBadChannel(), clus->GetClusterDisp(),
- clus->GetM20(), clus->GetM02(),
- clus->GetEmcCpvDistance(), clus->GetNExMax(), clus->GetTOF()) ;
- caloCluster->SetNCells(clus->GetNCells());
- caloCluster->SetCellsAbsId(clus->GetCellsAbsId());
- caloCluster->SetCellsAmplitudeFraction(clus->GetCellsAmplitudeFraction());
-
- TArrayI* matchedT = clus->GetTracksMatched();
- if (matchedT && clus->GetTrackMatched() > 0) {
- for (Int_t im = 0; im < matchedT->GetSize(); im++) {
- caloCluster->AddTrackMatched((fESD->GetTrack(im)));
- }
- }
-
- }//Pt and Fidutial cut passed.
- }//esd cluster loop
-
- if(fDebug > 1) printf("FillInputEMCAL():: aod entries %d\n", fAODEMCAL->GetEntriesFast());
-
-}
-
-//____________________________________________________________________________
-void AliCaloTrackESDReader::FillInputPHOS() {
- //Return array with PHOS clusters in aod format
- fAODPHOS = new TClonesArray("AliAODCaloCluster",0);
-
- TRefArray * caloClusters = new TRefArray();
- fESD->GetPHOSClusters(caloClusters);
-
- //Get vertex for momentum calculation
- Double_t v[3] ; //vertex ;
- GetVertex(v);
-
- //Loop to select clusters in fidutial cut and fill container with aodClusters
- Int_t naod = 0;
- Float_t pos[3] ;
- Double_t * pid = new Double_t[AliPID::kSPECIESN];
-
- for (Int_t iclus = 0; iclus < caloClusters->GetEntriesFast(); iclus++) {
- AliESDCaloCluster * clus = (AliESDCaloCluster *) caloClusters->At(iclus) ;
- TLorentzVector momentum ;
- clus->GetMomentum(momentum, v);
- if(fDebug > 3 && momentum.E() > 0.1)printf("FillInputPHOS():: all clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n",
- momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta());
- if(fPHOSPtMin < momentum.Pt() && fFidutialCut->IsInFidutialCut(momentum,"PHOS")){
-
- if(fDebug > 2 && momentum.E() > 0.1)printf("FillInputPHOS():: Selected clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n",
- momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta());
-
- pid=clus->GetPid();
- // printf("Reader PID ESD: ph %0.2f, pi0 %0.2f, el %0.2f, conv el %0.2f,pi %0.2f, k %0.2f, p %0.2f, k0 %0.2f, n %0.2f, mu %0.2f \n",
- // pid[AliPID::kPhoton],pid[AliPID::kPi0],
- // pid[AliPID::kElectron],pid[AliPID::kEleCon],pid[AliPID::kPion],
- // pid[AliPID::kKaon],pid[AliPID::kProton], pid[AliPID::kKaon0],
- // pid[AliPID::kNeutron], pid[AliPID::kMuon]);
-
- clus->GetPosition(pos) ;
- Int_t id = clus->GetID();
- Int_t nLabel = clus->GetNLabels();
- Int_t *labels=0x0;
- if(clus->GetLabels()) labels = (clus->GetLabels())->GetArray();
- Float_t energy = clus->E();
-
- //Phos cluster type
- Char_t ttype= AliAODCluster::kPHOSNeutral;
- Float_t wNeutral = pid[AliPID::kNeutron]+ pid[AliPID::kKaon0]+pid[AliPID::kPhoton]+pid[AliPID::kPi0];
- Float_t wCharged = pid[AliPID::kMuon] + pid[AliPID::kElectron] + pid[AliPID::kEleCon]+
- pid[AliPID::kProton]+pid[AliPID::kKaon]+pid[AliPID::kPion];
- if( wCharged > wNeutral) ttype= AliAODCluster::kPHOSCharged;
-
- AliAODCaloCluster *caloCluster = new((*fAODPHOS)[naod++])
- AliAODCaloCluster(id,nLabel,labels,energy, pos, NULL, ttype, 0);
- caloCluster->SetPIDFromESD(clus->GetPid());
- caloCluster->SetCaloCluster(clus->GetDistanceToBadChannel(), clus->GetClusterDisp(),
- clus->GetM20(), clus->GetM02(),
- clus->GetEmcCpvDistance(), clus->GetNExMax()) ;
- caloCluster->SetNCells(clus->GetNCells());
- caloCluster->SetCellsAbsId(clus->GetCellsAbsId());
- caloCluster->SetCellsAmplitudeFraction(clus->GetCellsAmplitudeFraction());
- TArrayI* matchedT = clus->GetTracksMatched();
- if (matchedT) {
- for (Int_t im = 0; im < matchedT->GetSize(); im++) {