From 61ada9676338cdd4164f4657b0ece8128cadd282 Mon Sep 17 00:00:00 2001 From: gconesab Date: Wed, 12 Nov 2008 18:06:51 +0000 Subject: [PATCH] Files moved to GammaConv directory --- .../AliAnalysisTaskGammaConversion.cxx | 618 ------------------ .../PartCorr/AliAnalysisTaskGammaConversion.h | 95 --- .../PartCorr/AliGammaConversionHistograms.cxx | 304 --------- PWG4/PartCorr/AliGammaConversionHistograms.h | 83 --- PWG4/PartCorr/AliV0Reader.cxx | 498 -------------- PWG4/PartCorr/AliV0Reader.h | 308 --------- 6 files changed, 1906 deletions(-) delete mode 100644 PWG4/PartCorr/AliAnalysisTaskGammaConversion.cxx delete mode 100644 PWG4/PartCorr/AliAnalysisTaskGammaConversion.h delete mode 100644 PWG4/PartCorr/AliGammaConversionHistograms.cxx delete mode 100644 PWG4/PartCorr/AliGammaConversionHistograms.h delete mode 100644 PWG4/PartCorr/AliV0Reader.cxx delete mode 100644 PWG4/PartCorr/AliV0Reader.h diff --git a/PWG4/PartCorr/AliAnalysisTaskGammaConversion.cxx b/PWG4/PartCorr/AliAnalysisTaskGammaConversion.cxx deleted file mode 100644 index f6edf1f412e..00000000000 --- a/PWG4/PartCorr/AliAnalysisTaskGammaConversion.cxx +++ /dev/null @@ -1,618 +0,0 @@ -/************************************************************************** - * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Author: Ana Marin, Kathrin Koch, Kenneth Aamodt * - * Version 1.0 * - * * - * 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. * - **************************************************************************/ - -//////////////////////////////////////////////// -//--------------------------------------------- -// Class used to do analysis on conversion pairs -//--------------------------------------------- -//////////////////////////////////////////////// - -// root -#include - -// analysis -#include "AliAnalysisTaskGammaConversion.h" -#include "AliStack.h" -#include "AliLog.h" -#include - -class AliKFVertex; -class AliAODHandler; -class AliAODEvent; -class ALiESDEvent; -class AliMCEvent; -class AliMCEventHandler; -class AliESDInputHandler; -class AliAnalysisManager; -class Riostream; -class TFile; -class TInterpreter; -class TSystem; -class TROOT; - -ClassImp(AliAnalysisTaskGammaConversion) - - -AliAnalysisTaskGammaConversion::AliAnalysisTaskGammaConversion(): - AliAnalysisTaskSE(), - fV0Reader(NULL), - fStack(NULL), - fOutputContainer(NULL), - fHistograms(NULL), - fDoMCTruth(kFALSE), - fMCAllGammas(), - fMCPi0s(), - fMCEtas(), - fMCGammaChic(), - fKFReconstructedGammas(), - fElectronMass(-1), - fGammaMass(-1), - fPi0Mass(-1), - fEtaMass(-1), - fGammaWidth(-1), - fPi0Width(-1), - fEtaWidth(-1), - fCalculateBackground(kFALSE) -{ - // Default constructor - // Common I/O in slot 0 - DefineInput (0, TChain::Class()); - DefineOutput(0, TTree::Class()); - - // Your private output - DefineOutput(1, TList::Class()); -} - -AliAnalysisTaskGammaConversion::AliAnalysisTaskGammaConversion(const char* name): - AliAnalysisTaskSE(name), - fV0Reader(NULL), - fStack(NULL), - fOutputContainer(0x0), - fHistograms(NULL), - fDoMCTruth(kFALSE), - fMCAllGammas(), - fMCPi0s(), - fMCEtas(), - fMCGammaChic(), - fKFReconstructedGammas(), - fElectronMass(-1), - fGammaMass(-1), - fPi0Mass(-1), - fEtaMass(-1), - fGammaWidth(-1), - fPi0Width(-1), - fEtaWidth(-1), - fCalculateBackground(kFALSE) -{ - // Common I/O in slot 0 - DefineInput (0, TChain::Class()); - DefineOutput(0, TTree::Class()); - - // Your private output - DefineOutput(1, TList::Class()); -} - -AliAnalysisTaskGammaConversion::~AliAnalysisTaskGammaConversion() -{ - // Remove all pointers - - if(fOutputContainer){ - fOutputContainer->Clear() ; - delete fOutputContainer ; - } - if(fHistograms){ - delete fHistograms; - } - if(fV0Reader){ - delete fV0Reader; - } -} - - -void AliAnalysisTaskGammaConversion::Init() -{ - // Initialization - AliLog::SetGlobalLogLevel(AliLog::kError); -} - - -void AliAnalysisTaskGammaConversion::Exec(Option_t */*option*/) -{ - // Execute analysis for current event - - ConnectInputData(""); - - //clear vectors - fMCAllGammas.clear(); - fMCPi0s.clear(); - fMCEtas.clear(); - fMCGammaChic.clear(); - - fKFReconstructedGammas.clear(); - - //Clear the data in the v0Reader - fV0Reader->UpdateEventByEventData(); - - // Process the MC information - if(fDoMCTruth){ - ProcessMCData(); - } - - // Process the v0 information - ProcessV0s(); - - //calculate background if flag is set - if(fCalculateBackground){ - CalculateBackground(); - } - - // Process reconstructed gammas - ProcessGammasForNeutralMesonAnalysis(); - - PostData(1, fOutputContainer); - -} - -void AliAnalysisTaskGammaConversion::ConnectInputData(Option_t */*option*/){ - // see header file for documentation - - if(fV0Reader == NULL){ - // Write warning here cuts and so on are default if this ever happens - } - fV0Reader->Initialize(); -} - -void AliAnalysisTaskGammaConversion::ProcessMCData(){ - // see header file for documentation - - fStack = fV0Reader->GetMCStack(); - - for (Int_t iTracks = 0; iTracks < fStack->GetNtrack(); iTracks++) { - TParticle* particle = (TParticle *)fStack->Particle(iTracks); - - if (!particle) { - //print warning here - continue; - } - - if(particle->Pt()GetPtCut()){ - continue; - } - - if(TMath::Abs(particle->Eta())> fV0Reader->GetEtaCut()){ - continue; - } - - if(particle->R()>fV0Reader->GetMaxRCut()){ // cuts on distance from collision point - continue; - } - - Double_t tmpPhi=particle->Phi(); - if(particle->Phi()> TMath::Pi()){ - tmpPhi = particle->Phi()-(2*TMath::Pi()); - } - - - //process the gammas - if (particle->GetPdgCode()== 22){ - fMCAllGammas.push_back(particle); - if(particle->GetMother(0)>-1){ //Means we have a mother - if( fStack->Particle(particle->GetMother(0))->GetPdgCode() != 22 ){//Checks for a non gamma mother. - fHistograms->FillHistogram("MC_Gamma_Energy", particle->Energy()); - fHistograms->FillHistogram("MC_Gamma_Pt", particle->Pt()); - fHistograms->FillHistogram("MC_Gamma_Eta", particle->Eta()); - - fHistograms->FillHistogram("MC_Gamma_Phi", tmpPhi); - - //adding the conversion points from all gammas with e+e- daughters - if(particle->GetNDaughters() >= 2){ - TParticle* daughter0 = NULL; - TParticle* daughter1 = NULL; - - for(Int_t daughterIndex=particle->GetFirstDaughter();daughterIndex<=particle->GetLastDaughter();daughterIndex++){ - TParticle *tmpDaughter = fStack->Particle(daughterIndex); - if(tmpDaughter->GetUniqueID() == 5){ - if(tmpDaughter->GetPdgCode() == 11){ - daughter0 = tmpDaughter; - } - else if(tmpDaughter->GetPdgCode() == -11){ - daughter1 = tmpDaughter; - } - } - } - - if(daughter0 == NULL || daughter1 == NULL){ // means we do not have two daughters from pair production - continue; - } - - if(daughter0->R()>fV0Reader->GetMaxRCut() || daughter1->R()>fV0Reader->GetMaxRCut()){ - continue; - } - - if((daughter0->GetPdgCode() == -11 && daughter1->GetPdgCode()) == 11 || - (daughter0->GetPdgCode() == 11 && daughter1->GetPdgCode() == -11)){ - - // begin Mapping - Int_t rBin = fHistograms->GetRBin(daughter0->R()); - Int_t phiBin = fHistograms->GetPhiBin(daughter0->Phi()); - - TString nameMCMappingPhiR=""; - nameMCMappingPhiR.Form("MC_EP_Mapping-Phi%02d-R%02d",phiBin,rBin); - fHistograms->FillHistogram(nameMCMappingPhiR, daughter0->Vz(), particle->Eta()); - - TString nameMCMappingPhi=""; - nameMCMappingPhi.Form("MC_EP_Mapping-Phi%02d",phiBin); - fHistograms->FillHistogram(nameMCMappingPhi, particle->Eta()); - - TString nameMCMappingR=""; - nameMCMappingR.Form("MC_EP_Mapping-R%02d",rBin); - fHistograms->FillHistogram(nameMCMappingR, particle->Eta()); - - TString nameMCMappingPhiInR=""; - nameMCMappingPhiInR.Form("MC_EP_Mapping_Phi_R-%02d",rBin); - fHistograms->FillHistogram(nameMCMappingPhiInR, tmpPhi); - //end mapping - - fHistograms->FillHistogram("MC_EP_R",daughter0->R()); - fHistograms->FillHistogram("MC_EP_ZR",daughter0->Vz(),daughter0->R()); - fHistograms->FillHistogram("MC_EP_XY",daughter0->Vx(),daughter0->Vy()); - fHistograms->FillHistogram("MC_EP_OpeningAngle",GetMCOpeningAngle(daughter0, daughter1)); - }// end if((daughter0->GetPdgCode() == -11 && daughter1->GetPdgCode()) == 11 ||....... approx 20 lines above - }// end if(particle->GetNDaughters() >= 2){ - } // end if( fStack->Particle(particle->GetMother(0))->GetPdgCode() != 22 ) - if( fStack->Particle(particle->GetMother(0))->GetPdgCode()==10441 ||//chic0 - fStack->Particle(particle->GetMother(0))->GetPdgCode()==20443 ||//psi2S - fStack->Particle(particle->GetMother(0))->GetPdgCode()==445 //chic2 - ){ - fMCGammaChic.push_back(particle); - } - }// end if(particle->GetMother(0)>-1) - else{//means we have a primary particle - fHistograms->FillHistogram("MC_DirectGamma_Energy",particle->Energy()); - fHistograms->FillHistogram("MC_DirectGamma_Pt", particle->Pt()); - fHistograms->FillHistogram("MC_DirectGamma_Eta", particle->Eta()); - fHistograms->FillHistogram("MCDirectGammaPhi", tmpPhi); - - //adding the conversion points from all gammas with e+e- daughters - if(particle->GetNDaughters() == 2){ - TParticle* daughter0 = (TParticle*)fStack->Particle(particle->GetFirstDaughter()); - TParticle* daughter1 = (TParticle*)fStack->Particle(particle->GetLastDaughter()); - if((daughter0->GetPdgCode() == -11 && daughter1->GetPdgCode() == 11) || - (daughter0->GetPdgCode() == 11 && daughter1->GetPdgCode() == -11)){ - - fHistograms->FillHistogram("MC_EP_R",daughter0->R()); - fHistograms->FillHistogram("MC_EP_ZR",daughter0->Vz(),daughter0->R()); - fHistograms->FillHistogram("MC_EP_XY",daughter0->Vx(),daughter0->Vy()); - fHistograms->FillHistogram("MC_EP_OpeningAngle",GetMCOpeningAngle(daughter0, daughter1)); - - } - } - }// end else - }// end if (particle->GetPdgCode()== 22){ - else if (TMath::Abs(particle->GetPdgCode())== 11){ // Means we have an electron or a positron - if(particle->GetMother(0)>-1){ // means we have a mother - if( fStack->Particle(particle->GetMother(0))->GetPdgCode()==22 ){ // Means we have a gamma mother - if(particle->GetPdgCode() == 11){//electron - fHistograms->FillHistogram("MC_E_Energy", particle->Energy()); - fHistograms->FillHistogram("MC_E_Pt", particle->Pt()); - fHistograms->FillHistogram("MC_E_Eta", particle->Eta()); - fHistograms->FillHistogram("MC_E_Phi", tmpPhi); - } - if(particle->GetPdgCode() == -11){//positron - fHistograms->FillHistogram("MC_P_Energy", particle->Energy()); - fHistograms->FillHistogram("MC_P_Pt", particle->Pt()); - fHistograms->FillHistogram("MC_P_Eta", particle->Eta()); - fHistograms->FillHistogram("MC_P_Phi", tmpPhi); - } - } - } - } // end else if (TMath::Abs(particle->GetPdgCode())== 11) - else if(particle->GetNDaughters() == 2){ - - TParticle* daughter0 = (TParticle*)fStack->Particle(particle->GetFirstDaughter()); - TParticle* daughter1 = (TParticle*)fStack->Particle(particle->GetLastDaughter()); - if(daughter0->GetPdgCode() == 22 && daughter1->GetPdgCode() == 22){//check for gamma gamma daughters - - if(particle->GetPdgCode()==111){//Pi0 - - fHistograms->FillHistogram("MC_Pi0_Secondaries_Phi", tmpPhi); - - if( iTracks >= fStack->GetNprimary()){ - - fHistograms->FillHistogram("MC_Pi0_Secondaries_Eta", particle->Eta()); - - fHistograms->FillHistogram("MC_Pi0_Secondaries_Phi", tmpPhi); - fHistograms->FillHistogram("MC_Pi0_Secondaries_Pt", particle->Pt()); - fHistograms->FillHistogram("MC_Pi0_Secondaries_Energy", particle->Energy()); - fHistograms->FillHistogram("MC_Pi0_Secondaries_R", particle->R()); - fHistograms->FillHistogram("MC_Pi0_Secondaries_ZR", particle->Vz(),particle->R()); - fHistograms->FillHistogram("MC_Pi0_Secondaries_GammaDaughter_OpeningAngle", GetMCOpeningAngle(daughter0,daughter1)); - fHistograms->FillHistogram("MC_Pi0_Secondaries_XY", particle->Vx(),particle->Vy());//only fill from one daughter to avoid multiple filling - } - else{ - fHistograms->FillHistogram("MC_Pi0_Eta", particle->Eta()); - - fHistograms->FillHistogram("MC_Pi0_Phi", tmpPhi); - fHistograms->FillHistogram("MC_Pi0_Pt", particle->Pt()); - fHistograms->FillHistogram("MC_Pi0_Energy", particle->Energy()); - fHistograms->FillHistogram("MC_Pi0_R", particle->R()); - fHistograms->FillHistogram("MC_Pi0_ZR", particle->Vz(),particle->R()); - fHistograms->FillHistogram("MC_Pi0_GammaDaughter_OpeningAngle", GetMCOpeningAngle(daughter0,daughter1)); - fHistograms->FillHistogram("MC_Pi0_XY", particle->Vx(), particle->Vy());//only fill from one daughter to avoid multiple filling - } - } - else if(particle->GetPdgCode()==221){//Eta - fHistograms->FillHistogram("MC_Eta_Eta", particle->Eta()); - - fHistograms->FillHistogram("MC_Eta_Phi",tmpPhi); - fHistograms->FillHistogram("MC_Eta_Pt", particle->Pt()); - fHistograms->FillHistogram("MC_Eta_Energy", particle->Energy()); - fHistograms->FillHistogram("MC_Eta_R", particle->R()); - fHistograms->FillHistogram("MC_Eta_ZR", particle->Vz(),particle->R()); - fHistograms->FillHistogram("MC_Eta_GammaDaughter_OpeningAngle", GetMCOpeningAngle(daughter0,daughter1)); - fHistograms->FillHistogram("MC_Eta_XY", particle->Vx(), particle->Vy());//only fill from one daughter to avoid multiple filling - } - - //the match data should be filled no matter which mother the gamma-gamma comes from - fHistograms->FillHistogram("MC_Match_Gamma_R", particle->R()); - fHistograms->FillHistogram("MC_Match_Gamma_ZR", particle->Vz(),particle->R()); - fHistograms->FillHistogram("MC_Match_Gamma_XY", particle->Vx(),particle->Vy()); - fHistograms->FillHistogram("MC_Match_Gamma_Mass", particle->GetCalcMass()); - fHistograms->FillHistogram("MC_Match_Gamma_OpeningAngle", GetMCOpeningAngle(daughter0,daughter1)); - fHistograms->FillHistogram("MC_Match_Gamma_Energy", particle->Energy()); - fHistograms->FillHistogram("MC_Match_Gamma_Pt", particle->Pt()); - fHistograms->FillHistogram("MC_Match_Gamma_Eta", particle->Eta()); - fHistograms->FillHistogram("MC_Match_Gamma_Phi",tmpPhi); - } - }// end else if(particle->GetNDaughters() == 2) - }// end for (Int_t iTracks = 0; iTracks < fStack->GetNtrack(); iTracks++) -} // end ProcessMCData - -void AliAnalysisTaskGammaConversion::ProcessV0s(){ - // see header file for documentation - - Int_t nSurvivingV0s=0; - while(fV0Reader->NextV0()){ - nSurvivingV0s++; - //-------------------------- filling v0 information ------------------------------------- - fHistograms->FillHistogram("ESD_EP_OpeningAngle", fV0Reader->GetOpeningAngle()); - fHistograms->FillHistogram("ESD_EP_R", fV0Reader->GetXYRadius()); - fHistograms->FillHistogram("ESD_EP_ZR", fV0Reader->GetZ(),fV0Reader->GetXYRadius()); - fHistograms->FillHistogram("ESD_EP_XY", fV0Reader->GetX(),fV0Reader->GetY()); - - - fHistograms->FillHistogram("ESD_E_Energy", fV0Reader->GetNegativeTrackEnergy()); - fHistograms->FillHistogram("ESD_E_Pt", fV0Reader->GetNegativeTrackPt()); - fHistograms->FillHistogram("ESD_E_Eta", fV0Reader->GetNegativeTrackEta()); - fHistograms->FillHistogram("ESD_E_Phi", fV0Reader->GetNegativeTrackPhi()); - - fHistograms->FillHistogram("ESD_P_Energy", fV0Reader->GetPositiveTrackEnergy()); - fHistograms->FillHistogram("ESD_P_Pt", fV0Reader->GetPositiveTrackPt()); - fHistograms->FillHistogram("ESD_P_Eta", fV0Reader->GetPositiveTrackEta()); - fHistograms->FillHistogram("ESD_P_Phi", fV0Reader->GetPositiveTrackPhi()); - - fHistograms->FillHistogram("ESD_Gamma_Energy", fV0Reader->GetMotherCandidateEnergy()); - fHistograms->FillHistogram("ESD_Gamma_Pt", fV0Reader->GetMotherCandidatePt()); - fHistograms->FillHistogram("ESD_Gamma_Eta", fV0Reader->GetMotherCandidateEta()); - fHistograms->FillHistogram("ESD_Gamma_Phi", fV0Reader->GetMotherCandidatePhi()); - - - // begin mapping - Int_t rBin = fHistograms->GetRBin(fV0Reader->GetXYRadius()); - Int_t phiBin = fHistograms->GetPhiBin(fV0Reader->GetNegativeTrackPhi()); - Double_t motherCandidateEta= fV0Reader->GetMotherCandidateEta(); - - TString nameESDMappingPhiR=""; - nameESDMappingPhiR.Form("ESD_EP_Mapping-Phi%02d-R%02d",phiBin,rBin); - fHistograms->FillHistogram(nameESDMappingPhiR, fV0Reader->GetZ(), motherCandidateEta); - - TString nameESDMappingPhi=""; - nameESDMappingPhi.Form("ESD_EP_Mapping-Phi%02d",phiBin); - fHistograms->FillHistogram(nameESDMappingPhi, fV0Reader->GetZ(), motherCandidateEta); - - TString nameESDMappingR=""; - nameESDMappingR.Form("ESD_EP_Mapping-R%02d",rBin); - fHistograms->FillHistogram(nameESDMappingR, fV0Reader->GetZ(), motherCandidateEta); - - TString nameESDMappingPhiInR=""; - nameESDMappingPhiInR.Form("ESD_EP_Mapping_Phi_R-%02d",rBin); - fHistograms->FillHistogram(nameESDMappingPhiInR, fV0Reader->GetMotherCandidatePhi()); - // end mapping - - fKFReconstructedGammas.push_back(*fV0Reader->GetMotherCandidateKFCombination()); - - //----------------------------------- checking for "real" conversions (MC match) -------------------------------------- - if(fDoMCTruth){ - if(fV0Reader->HasSameMCMother() == kFALSE){ - continue; - } - - TParticle * negativeMC = (TParticle*)fV0Reader->GetNegativeMCParticle(); - TParticle * positiveMC = (TParticle*)fV0Reader->GetPositiveMCParticle(); - - if(negativeMC->GetPdgCode()!=11 || positiveMC->GetPdgCode()!=-11){ - continue; - } - if(fV0Reader->GetMotherMCParticle()->GetPdgCode() == 22){ - fHistograms->FillHistogram("ESD_Match_Gamma_XY", fV0Reader->GetX(),fV0Reader->GetY()); - fHistograms->FillHistogram("ESD_Match_Gamma_OpeningAngle", fV0Reader->GetOpeningAngle()); - fHistograms->FillHistogram("ESD_Match_Gamma_Pt", fV0Reader->GetMotherCandidatePt()); - fHistograms->FillHistogram("ESD_Match_Gamma_Energy", fV0Reader->GetMotherCandidateEnergy()); - fHistograms->FillHistogram("ESD_Match_Gamma_Eta", fV0Reader->GetMotherCandidateEta()); - - fHistograms->FillHistogram("ESD_Match_Gamma_Phi", fV0Reader->GetMotherCandidatePhi()); - fHistograms->FillHistogram("ESD_Match_Gamma_Mass", fV0Reader->GetMotherCandidateMass()); - fHistograms->FillHistogram("ESD_Match_Gamma_Width", fV0Reader->GetMotherCandidateWidth()); - fHistograms->FillHistogram("ESD_Match_Gamma_Chi2", fV0Reader->GetMotherCandidateChi2()); - fHistograms->FillHistogram("ESD_Match_Gamma_NDF", fV0Reader->GetMotherCandidateNDF()); - fHistograms->FillHistogram("ESD_Match_Gamma_R", fV0Reader->GetXYRadius()); - fHistograms->FillHistogram("ESD_Match_Gamma_ZR", fV0Reader->GetZ(),fV0Reader->GetXYRadius()); - - //resolution - Double_t mcpt = fV0Reader->GetMotherMCParticle()->Pt(); - Double_t esdpt = fV0Reader->GetMotherCandidatePt(); - Double_t resdPt = 0; - if(mcpt != 0){ - resdPt = ((esdpt - mcpt)/mcpt)*100; - } - - fHistograms->FillHistogram("Resolution_dPt", mcpt, resdPt); - fHistograms->FillHistogram("Resolution_MC_Pt", mcpt); - fHistograms->FillHistogram("Resolution_ESD_Pt", esdpt); - - Double_t resdZ = 0; - if(fV0Reader->GetNegativeMCParticle()->Vz() != 0){ - resdZ = ((fV0Reader->GetZ() -fV0Reader->GetNegativeMCParticle()->Vz())/fV0Reader->GetNegativeMCParticle()->Vz())*100; - } - - fHistograms->FillHistogram("Resolution_dZ", fV0Reader->GetNegativeMCParticle()->Vz(), resdZ); - fHistograms->FillHistogram("Resolution_MC_Z", fV0Reader->GetNegativeMCParticle()->Vz()); - fHistograms->FillHistogram("Resolution_ESD_Z", fV0Reader->GetZ()); - - Double_t resdR = 0; - if(fV0Reader->GetNegativeMCParticle()->R() != 0){ - resdR = ((fV0Reader->GetXYRadius() - fV0Reader->GetNegativeMCParticle()->R())/fV0Reader->GetNegativeMCParticle()->R())*100; - } - fHistograms->FillHistogram("Resolution_dR", fV0Reader->GetNegativeMCParticle()->R(), resdR); - fHistograms->FillHistogram("Resolution_MC_R", fV0Reader->GetNegativeMCParticle()->R()); - fHistograms->FillHistogram("Resolution_ESD_R", fV0Reader->GetXYRadius()); - fHistograms->FillHistogram("Resolution_dR_dPt", resdR, resdPt); - } - } - } - fHistograms->FillHistogram("NumberOfSurvivingV0s", nSurvivingV0s); - fHistograms->FillHistogram("NumberOfV0s", fV0Reader->GetNumberOfV0s()); -} - -void AliAnalysisTaskGammaConversion::ProcessGammasForNeutralMesonAnalysis(){ - // see header file for documentation - - for(UInt_t firstGammaIndex=0;firstGammaIndexGetMass(massTwoGammaCandidate,widthTwoGammaCandidate); - if(twoGammaCandidate->GetNDF()>0){ - chi2TwoGammaCandidate = twoGammaCandidate->GetChi2()/twoGammaCandidate->GetNDF(); - if(chi2TwoGammaCandidate>0 && chi2TwoGammaCandidateGetChi2CutMeson()){ - - TVector3 vectorTwoGammaCandidate(twoGammaCandidate->Px(),twoGammaCandidate->Py(),twoGammaCandidate->Pz()); - - Double_t openingAngleTwoGammaCandidate = twoGammaDecayCandidateDaughter0->GetAngle(*twoGammaDecayCandidateDaughter1); - - //Calculating by hand the radius - Double_t tmpX= twoGammaCandidate->GetX(); - Double_t tmpY= twoGammaCandidate->GetY(); - - Double_t radiusTwoGammaCandidate = TMath::Sqrt(tmpX*tmpX + tmpY*tmpY); - - fHistograms->FillHistogram("ESD_TwoGammaCombination_GammaDaughter_OpeningAngle", openingAngleTwoGammaCandidate); - fHistograms->FillHistogram("ESD_TwoGammaCombination_Energy", twoGammaCandidate->GetE()); - fHistograms->FillHistogram("ESD_TwoGammaCombination_Pt", sqrt(twoGammaCandidate->GetPx()*twoGammaCandidate->GetPx()+twoGammaCandidate->GetPy()*twoGammaCandidate->GetPy())); - fHistograms->FillHistogram("ESD_TwoGammaCombination_Eta", vectorTwoGammaCandidate.Eta()); - fHistograms->FillHistogram("ESD_TwoGammaCombination_Phi", vectorTwoGammaCandidate.Phi()); - fHistograms->FillHistogram("ESD_TwoGammaCombination_Mass", massTwoGammaCandidate); - fHistograms->FillHistogram("ESD_TwoGammaCombination_R", radiusTwoGammaCandidate); - fHistograms->FillHistogram("ESD_TwoGammaCombination_ZR", tmpY, radiusTwoGammaCandidate); - fHistograms->FillHistogram("ESD_TwoGammaCombination_XY", tmpX, tmpY); - fHistograms->FillHistogram("InvMass_vs_Pt_Spectra",massTwoGammaCandidate ,sqrt(twoGammaCandidate->GetPx()*twoGammaCandidate->GetPx()+twoGammaCandidate->GetPy()*twoGammaCandidate->GetPy())); - } - } - delete twoGammaCandidate; - } - } -} - -void AliAnalysisTaskGammaConversion::CalculateBackground(){ - // see header file for documentation - - vector vectorCurrentEventGoodV0s = fV0Reader->GetCurrentEventGoodV0s(); - vector vectorPreviousEventGoodV0s = fV0Reader->GetPreviousEventGoodV0s(); - for(UInt_t iCurrent=0;iCurrentGetMass(massBG,widthBG); - if(backgroundCandidate->GetNDF()>0){ - chi2BG = backgroundCandidate->GetChi2()/backgroundCandidate->GetNDF(); - if(chi2BG>0 && chi2BGGetChi2CutMeson()){ - - TVector3 vectorBGCandidate(backgroundCandidate->Px(),backgroundCandidate->Py(),backgroundCandidate->Pz()); - - Double_t openingAngleBG = currentEventGoodV0->GetAngle(*previousGoodV0); - - //Calculating by hand the radius (find a better way) - Double_t tmpX= backgroundCandidate->GetX(); - Double_t tmpY= backgroundCandidate->GetY(); - - Double_t radiusBG = TMath::Sqrt(tmpX*tmpX + tmpY*tmpY); - - fHistograms->FillHistogram("ESD_Background_GammaDaughter_OpeningAngle", openingAngleBG); - fHistograms->FillHistogram("ESD_Background_Energy", backgroundCandidate->GetE()); - fHistograms->FillHistogram("ESD_Background_Pt", sqrt(backgroundCandidate->GetPx()*backgroundCandidate->GetPx()+backgroundCandidate->GetPy()*backgroundCandidate->GetPy())); - fHistograms->FillHistogram("ESD_Background_Eta", vectorBGCandidate.Eta()); - fHistograms->FillHistogram("ESD_Background_Phi", vectorBGCandidate.Phi()); - fHistograms->FillHistogram("ESD_Background_Mass", massBG); - fHistograms->FillHistogram("ESD_Background_R", radiusBG); - fHistograms->FillHistogram("ESD_Background_ZR", tmpY, radiusBG); - fHistograms->FillHistogram("ESD_Background_XY", tmpX, tmpY); - fHistograms->FillHistogram("Background_InvMass_vs_Pt_Spectra",massBG,sqrt(backgroundCandidate->GetPx()*backgroundCandidate->GetPx()+backgroundCandidate->GetPy()*backgroundCandidate->GetPy())); - } - } - delete backgroundCandidate; - } - } -} - -void AliAnalysisTaskGammaConversion::Terminate(Option_t */*option*/) -{ - // Terminate analysis - // - AliDebug(1,"Do nothing in Terminate"); -} - -void AliAnalysisTaskGammaConversion::UserCreateOutputObjects() -{ - // Create the output container - if(fOutputContainer != NULL){ - delete fOutputContainer; - fOutputContainer = NULL; - } - if(fOutputContainer == NULL){ - fOutputContainer = new TList(); - } - fHistograms->GetOutputContainer(fOutputContainer); - fOutputContainer->SetName(GetName()); -} - -Double_t AliAnalysisTaskGammaConversion::GetMCOpeningAngle(TParticle* daughter0, TParticle* daughter1) const{ - //helper function - TVector3 v3D0(daughter0->Px(),daughter0->Py(),daughter0->Pz()); - TVector3 v3D1(daughter1->Px(),daughter1->Py(),daughter1->Pz()); - return v3D0.Angle(v3D1); -} diff --git a/PWG4/PartCorr/AliAnalysisTaskGammaConversion.h b/PWG4/PartCorr/AliAnalysisTaskGammaConversion.h deleted file mode 100644 index 9e48cdf8deb..00000000000 --- a/PWG4/PartCorr/AliAnalysisTaskGammaConversion.h +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef ALIANALYSISTASKGAMMACONVERSION_H -#define ALIANALYSISTASKGAMMACONVERSION_H - -/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full Copyright notice */ - -//////////////////////////////////////////////// -//--------------------------------------------- -// Class used to do analysis on conversion pairs -//--------------------------------------------- -//////////////////////////////////////////////// - -#include "AliAnalysisTaskSE.h" -#include -#include "AliV0Reader.h" - -class AliGammaConversionHistograms; -class AliESDv0; -class AliKFParticle; -class AliESDInputHandler; -class AliESDEvent; -class AliAODEvent; -class TList; -class AliStack; - -class AliAnalysisTaskGammaConversion : public AliAnalysisTaskSE -{ - public: - AliAnalysisTaskGammaConversion(); - AliAnalysisTaskGammaConversion(const char* name); - virtual ~AliAnalysisTaskGammaConversion() ;// virtual destructor - - // Implementation of interface methods - virtual void UserCreateOutputObjects(); - virtual void Init(); - virtual void LocalInit() {Init();} - virtual void Exec(Option_t *option); - virtual void Terminate(Option_t *option); - virtual void ConnectInputData(Option_t *); - - void ProcessMCData(); - void ProcessV0s(); - void ProcessGammasForNeutralMesonAnalysis(); - void SetHistograms(AliGammaConversionHistograms *histograms){fHistograms=histograms;} - void SetDoMCTruth(Bool_t flag){fDoMCTruth=flag;} - void SetElectronMass(Double_t electronMass){fElectronMass = electronMass;} - void SetGammaMass(Double_t gammaMass){fGammaMass = gammaMass;} - void SetGammaWidth(Double_t gammaWidth){fGammaWidth = gammaWidth;} - void SetPi0Mass(Double_t pi0Mass){fPi0Mass = pi0Mass;} - void SetPi0Width(Double_t pi0Width){fPi0Width = pi0Width;} - void SetEtaMass(Double_t etaMass){fEtaMass = etaMass;} - void SetEtaWidth(Double_t etaWidth){fEtaWidth = etaWidth;} - void SetV0Reader(AliV0Reader* reader){fV0Reader=reader;} - void SetCalculateBackground(Bool_t bg){fCalculateBackground=bg;} - void CalculateBackground(); - Double_t GetMCOpeningAngle(TParticle* daughter0, TParticle* daughter1) const; - - private: - AliAnalysisTaskGammaConversion(const AliAnalysisTaskGammaConversion&); // Not implemented - AliAnalysisTaskGammaConversion& operator=(const AliAnalysisTaskGammaConversion&); // Not implemented - - AliV0Reader* fV0Reader; - - AliStack * fStack; - - TList * fOutputContainer ; // Histogram container - - AliGammaConversionHistograms *fHistograms; - - Bool_t fDoMCTruth; - - vector fMCAllGammas; - vector fMCPi0s; - vector fMCEtas; - vector fMCGammaChic; - - vector fKFReconstructedGammas; - - //mass defines - Double_t fElectronMass; - Double_t fGammaMass; - Double_t fPi0Mass; - Double_t fEtaMass; - - // width defines - Double_t fGammaWidth; - Double_t fPi0Width; - Double_t fEtaWidth; - Bool_t fCalculateBackground; - - - ClassDef(AliAnalysisTaskGammaConversion, 0); // Analysis task for gamma conversions -}; - -#endif //ALIANALYSISTASKGAMMA_H diff --git a/PWG4/PartCorr/AliGammaConversionHistograms.cxx b/PWG4/PartCorr/AliGammaConversionHistograms.cxx deleted file mode 100644 index 08ada546385..00000000000 --- a/PWG4/PartCorr/AliGammaConversionHistograms.cxx +++ /dev/null @@ -1,304 +0,0 @@ -/************************************************************************** - * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Author: Ana Marin, Kathrin Koch, Kenneth Aamodt * - * Version 1.0 * - * * - * 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. * - **************************************************************************/ - -//////////////////////////////////////////////// -//--------------------------------------------- -// Class used to do analysis on conversion pairs -//--------------------------------------------- -//////////////////////////////////////////////// - -#include "AliGammaConversionHistograms.h" -#include "TMath.h" -#include "TObjString.h" -#include "TMap.h" -#include "TList.h" -#include "TH1F.h" -#include "TH2F.h" - - -using namespace std; - -ClassImp(AliGammaConversionHistograms) - - -AliGammaConversionHistograms::AliGammaConversionHistograms() : - fHistogramMap(new TMap()), - fNPhiIndex(0), - fNRIndex(0), - fMinRadius(0.), - fMaxRadius(0.), - fDeltaR(0.), - fMinPhi(0.), - fMaxPhi(0.), - fDeltaPhi(0.), - fMappingContainer(NULL) -{ - // see header file for documenation -} - - -AliGammaConversionHistograms::AliGammaConversionHistograms(const AliGammaConversionHistograms & original) : - fHistogramMap(original.fHistogramMap), - fNPhiIndex(original.fNPhiIndex), - fNRIndex(original.fNRIndex), - fMinRadius(original.fMinRadius), - fMaxRadius(original.fMaxRadius), - fDeltaR(original.fDeltaR), - fMinPhi(original.fMinPhi), - fMaxPhi(original.fMaxPhi), - fDeltaPhi(original.fDeltaPhi), - fMappingContainer(original.fMappingContainer) -{ - //see header file for documentation -} - - -AliGammaConversionHistograms & AliGammaConversionHistograms::operator = (const AliGammaConversionHistograms & /*original*/) -{ - // assignment operator - return *this; -} - - -AliGammaConversionHistograms::~AliGammaConversionHistograms() { - //destructor - - -} - -void AliGammaConversionHistograms::AddHistogram(TString histogramName, TString histogramTitle, Int_t nXBins, Double_t firstX,Double_t lastX,TString xAxisTitle, TString yAxisTitle){ - // see header file for documentation - TH1F *tmp = new TH1F(histogramName, histogramTitle,nXBins,firstX,lastX); - tmp->GetXaxis()->SetTitle(xAxisTitle); - tmp->GetYaxis()->SetTitle(yAxisTitle); - TObjString* tobjstring = new TObjString(histogramName.Data()); - fHistogramMap->Add((TObject*)tobjstring,(TObject*)tmp); -} - -void AliGammaConversionHistograms::AddHistogram(TString histogramName, TString histogramTitle, Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){ - // see header file for documentation - TH2F *tmp = new TH2F(histogramName, histogramTitle,nXBins,firstX,lastX,nYBins,firstY,lastY); - tmp->GetXaxis()->SetTitle(xAxisTitle); - tmp->GetYaxis()->SetTitle(yAxisTitle); - TObjString *tobjstring = new TObjString(histogramName.Data()); - fHistogramMap->Add((TObject*)tobjstring,(TObject*)tmp); -} - -void AliGammaConversionHistograms::FillHistogram(TString histogramName, Double_t xValue) const{ - //see header file for documentation - TH1 *tmp = (TH1*)fHistogramMap->GetValue(histogramName.Data()); - if(tmp){ - tmp->Fill(xValue); - } - else{ - cout<<"Histogram does not exist: "<GetValue(histogramName.Data()); - if(tmp){ - tmp->Fill(xValue, yValue); - } - else{ - cout<<"Histogram does not exist: "<GetString(); - if(histogramString.Contains("Mapping")){// means it should be put in the mapping folder - if(fMappingContainer == NULL){ - fMappingContainer = new TList(); - fMappingContainer->SetName("Mapping histograms"); - } - if(fMappingContainer != NULL){ - fMappingContainer->Add((TH1*)fHistogramMap->GetValue(histogramString.Data())); - } - } - fOutputContainer->Add((TH1*)fHistogramMap->GetValue(histogramString.Data())); - histogramName = NULL; - } // end while - // fOutputContainer->Add(fMappingContainer); - } -} - -Int_t AliGammaConversionHistograms::GetRBin(Double_t radius) const{ - // see header file for documentation - Int_t iResult=0; - if(fDeltaR>0){ - iResult = (Int_t)((radius - fMinRadius)/fDeltaR); - } - return iResult; -} - -Int_t AliGammaConversionHistograms::GetPhiBin(Double_t phi) const{ - // see header file for documentation - Int_t iResult=0; - if(fDeltaPhi>0){ - if(phi>TMath::Pi()){ - phi-=2*TMath::Pi(); - } - iResult = (Int_t)((phi - fMinPhi)/fDeltaPhi); - } - return iResult; -} - - - -void AliGammaConversionHistograms::InitializeMappingValues(Int_t nPhiIndex, Int_t nRIndex, Int_t nBinsR, Double_t minRadius, Double_t maxRadius,Int_t nBinsPhi, Double_t minPhi, Double_t maxPhi){ - // Initializing the valuse for the mapping - - fNPhiIndex = nPhiIndex; - fNRIndex = nRIndex; - fMinRadius = minRadius; - fMaxRadius = maxRadius; - if(nBinsR>0 && nRIndex!=0){ - fDeltaR = (fMaxRadius - fMinRadius)/nRIndex; - } - fMinPhi = minPhi; - fMaxPhi = maxPhi; - if(nBinsPhi>0 && nPhiIndex!=0){ - fDeltaPhi = (fMaxPhi-fMinPhi)/nPhiIndex; - } -} - - -//mapping -void AliGammaConversionHistograms::AddMappingHistograms(Int_t nPhiIndex, Int_t nRIndex,Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle, TString yAxisTitle){ - // see header file for documentation - - for(Int_t phi =0; phi<=fNPhiIndex;phi++){ - - for(Int_t r =0; r - -class TMap; -class TList; -class TH1F; -class TH2F; - -class AliGammaConversionHistograms{ - - public: - - AliGammaConversionHistograms(); //constructor - AliGammaConversionHistograms(const AliGammaConversionHistograms & original); //copy constructor - AliGammaConversionHistograms & operator = (const AliGammaConversionHistograms & original); //assignment operator - virtual ~AliGammaConversionHistograms(); //virtual destructor - - - // TList * GetOutputContainer(); - void GetOutputContainer(TList *fOutputContainer); - - Int_t GetRBin(Double_t radius) const; - Int_t GetPhiBin(Double_t phi) const; - - void InitializeMappingValues(Int_t nPhiHistograms, Int_t nRHistograms, Int_t nBinsR, Double_t minRadius, Double_t maxRadius,Int_t nBinsPhi, Double_t minPhi, Double_t maxPhi); - - void AddMappingHistograms(Int_t nPhiHistograms, Int_t nRHistograms,Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle="", TString yAxisTitle=""); - - /* - * Adds a TH1F histogram to the histogram map and create a key for it - */ - void AddHistogram(TString histogramName, TString histogramTitle, Int_t nXBins, Double_t firstX,Double_t lastX,TString xAxisTitle="", TString yAxisTitle=""); - - /* - * Adds a TH2F histogram to the histogram map and create a key for it - */ - void AddHistogram(TString histogramName, TString histogramTitle, Int_t nXBins, Double_t firstX, Double_t lastX, Int_t nYBins, Double_t firstY, Double_t lastY, TString xAxisTitle="", TString yAxisTitle=""); - - /* - * Fills a TH1F histogram with the given name with the given value - */ - void FillHistogram(TString histogramName, Double_t xValue) const; - - /* - * Fills a TH2F histogram with the given name with the given value - */ - void FillHistogram(TString histogramName, Double_t xValue, Double_t yValue) const; - - private: - TMap* fHistogramMap; - - Int_t fNPhiIndex; - Int_t fNRIndex; - Double_t fMinRadius; - Double_t fMaxRadius; - Double_t fDeltaR; - Double_t fMinPhi; - Double_t fMaxPhi; - Double_t fDeltaPhi; - - TList * fMappingContainer; - - - ClassDef(AliGammaConversionHistograms,1) -} ; - - -#endif - - - diff --git a/PWG4/PartCorr/AliV0Reader.cxx b/PWG4/PartCorr/AliV0Reader.cxx deleted file mode 100644 index 7e39f1f54e6..00000000000 --- a/PWG4/PartCorr/AliV0Reader.cxx +++ /dev/null @@ -1,498 +0,0 @@ -/************************************************************************** - * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Author: Ana Marin, Kathrin Koch, Kenneth Aamodt * - * Version 1.0 * - * * - * 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. * - **************************************************************************/ - -//////////////////////////////////////////////// -//--------------------------------------------- -// Class used to do analysis on conversion pairs -//--------------------------------------------- -//////////////////////////////////////////////// - -// --- ROOT system --- -#include - -//---- ANALYSIS system ---- -#include "AliV0Reader.h" -#include "AliAnalysisManager.h" -#include "AliESDInputHandler.h" -#include "AliMCEvent.h" -#include "AliKFVertex.h" - -#include "AliStack.h" -#include "AliMCEventHandler.h" - - -class iostream; -class AliESDv0; -class TFormula; - -using namespace std; - -ClassImp(AliV0Reader) - - - - AliV0Reader::AliV0Reader() : - TObject(), - fMCStack(NULL), - fMCTruth(NULL), - fChain(NULL), - fESDHandler(NULL), - fESDEvent(NULL), - fHistograms(NULL), - fCurrentV0IndexNumber(0), - fCurrentV0(NULL), - fCurrentNegativeKFParticle(NULL), - fCurrentPositiveKFParticle(NULL), - fCurrentMotherKFCandidate(NULL), - fCurrentNegativeESDTrack(NULL), - fCurrentPositiveESDTrack(NULL), - fNegativeTrackLorentzVector(NULL), - fPositiveTrackLorentzVector(NULL), - fMotherCandidateLorentzVector(NULL), - fCurrentXValue(0), - fCurrentYValue(0), - fCurrentZValue(0), - fPositiveTrackPID(0), - fNegativeTrackPID(0), - fNegativeMCParticle(NULL), - fPositiveMCParticle(NULL), - fMotherMCParticle(NULL), - fMotherCandidateKFMass(0), - fMotherCandidateKFWidth(0), - fUseKFParticle(kTRUE), - fUseESDTrack(kFALSE), - fDoMC(kFALSE), - fMaxR(10000),// 100 meter(outside of ALICE) - fEtaCut(0.), - fPtCut(0.), - fChi2CutConversion(0.), - fChi2CutMeson(0.), - fPIDProbabilityCutNegativeParticle(0), - fPIDProbabilityCutPositiveParticle(0), - fXVertexCut(0.), - fYVertexCut(0.), - fZVertexCut(0.), - fNSigmaMass(0.), - fUseImprovedVertex(kFALSE), - fCurrentEventGoodV0s(), - fPreviousEventGoodV0s() -{ - -} - - -AliV0Reader::AliV0Reader(const AliV0Reader & original) : - TObject(original), - fMCStack(original.fMCStack), - fMCTruth(original.fMCTruth), - fChain(original.fChain), - fESDHandler(original.fESDHandler), - fESDEvent(original.fESDEvent), - fHistograms(original.fHistograms), - fCurrentV0IndexNumber(original.fCurrentV0IndexNumber), - fCurrentV0(original.fCurrentV0), - fCurrentNegativeKFParticle(original.fCurrentNegativeKFParticle), - fCurrentPositiveKFParticle(original.fCurrentPositiveKFParticle), - fCurrentMotherKFCandidate(original.fCurrentMotherKFCandidate), - fCurrentNegativeESDTrack(original.fCurrentNegativeESDTrack), - fCurrentPositiveESDTrack(original.fCurrentPositiveESDTrack), - fNegativeTrackLorentzVector(original.fNegativeTrackLorentzVector), - fPositiveTrackLorentzVector(original.fPositiveTrackLorentzVector), - fMotherCandidateLorentzVector(original.fMotherCandidateLorentzVector), - fCurrentXValue(original.fCurrentXValue), - fCurrentYValue(original.fCurrentYValue), - fCurrentZValue(original.fCurrentZValue), - fPositiveTrackPID(original.fPositiveTrackPID), - fNegativeTrackPID(original.fNegativeTrackPID), - fNegativeMCParticle(original.fNegativeMCParticle), - fPositiveMCParticle(original.fPositiveMCParticle), - fMotherMCParticle(original.fMotherMCParticle), - fMotherCandidateKFMass(original.fMotherCandidateKFMass), - fMotherCandidateKFWidth(original.fMotherCandidateKFWidth), - fUseKFParticle(kTRUE), - fUseESDTrack(kFALSE), - fDoMC(kFALSE), - fMaxR(original.fMaxR), - fEtaCut(original.fEtaCut), - fPtCut(original.fPtCut), - fChi2CutConversion(original.fChi2CutConversion), - fChi2CutMeson(original.fChi2CutMeson), - fPIDProbabilityCutNegativeParticle(original.fPIDProbabilityCutNegativeParticle), - fPIDProbabilityCutPositiveParticle(original.fPIDProbabilityCutPositiveParticle), - fXVertexCut(original.fXVertexCut), - fYVertexCut(original.fYVertexCut), - fZVertexCut(original.fZVertexCut), - fNSigmaMass(original.fNSigmaMass), - fUseImprovedVertex(original.fUseImprovedVertex), - fCurrentEventGoodV0s(original.fCurrentEventGoodV0s), - fPreviousEventGoodV0s(original.fPreviousEventGoodV0s) -{ - -} - - -AliV0Reader & AliV0Reader::operator = (const AliV0Reader & /*source*/) -{ - // assignment operator - return *this; -} - -void AliV0Reader::Initialize(){ - //see header file for documentation - - // Get the input handler from the manager - fESDHandler = (AliESDInputHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()); - if(fESDHandler == NULL){ - //print warning here - } - - // Get pointer to esd event from input handler - fESDEvent = fESDHandler->GetEvent(); - if(fESDEvent == NULL){ - //print warning here - } - - //Get pointer to MCTruth - fMCTruth = (AliMCEventHandler*)((AliAnalysisManager::GetAnalysisManager())->GetMCtruthEventHandler()); - if(fMCTruth == NULL){ - //print warning here - } - - //Get pointer to the mc stack - fMCStack = fMCTruth->MCEvent()->Stack(); - if(fMCStack == NULL){ - //print warning here - } - - AliKFParticle::SetField(fESDEvent->GetMagneticField()); - -} - -AliESDv0* AliV0Reader::GetV0(Int_t index){ - //see header file for documentation - - fCurrentV0 = fESDEvent->GetV0(index); - UpdateV0Information(); - return fCurrentV0; -} - - -Bool_t AliV0Reader::NextV0(){ - //see header file for documentation - - Bool_t iResult=kFALSE; - while(fCurrentV0IndexNumberGetNumberOfV0s()){ - fCurrentV0 = fESDEvent->GetV0(fCurrentV0IndexNumber); - - //checks if on the fly mode is set - if ( !fCurrentV0->GetOnFlyStatus() ){ - fCurrentV0IndexNumber++; - fHistograms->FillHistogram("V0MassDebugCut1",GetMotherCandidateMass()); - continue; - } - - if(fESDEvent->GetPrimaryVertex()->GetNContributors()<=0) {//checks if we have a vertex - fCurrentV0IndexNumber++; - fHistograms->FillHistogram("V0MassDebugCut2",GetMotherCandidateMass()); - continue; - } - - if(CheckPIDProbability(fPIDProbabilityCutNegativeParticle,fPIDProbabilityCutPositiveParticle)==kFALSE){ - fCurrentV0IndexNumber++; - fHistograms->FillHistogram("V0MassDebugCut3",GetMotherCandidateMass()); - continue; - } - - - fCurrentV0->GetXYZ(fCurrentXValue,fCurrentYValue,fCurrentZValue); - - if(GetXYRadius()>fMaxR){ // cuts on distance from collision point - fCurrentV0IndexNumber++; - fHistograms->FillHistogram("V0MassDebugCut4",GetMotherCandidateMass()); - continue; - } - - UpdateV0Information(); - - if(fUseKFParticle){ - if(fCurrentMotherKFCandidate->GetNDF()<=0){ - fCurrentV0IndexNumber++; - fHistograms->FillHistogram("V0MassDebugCut5",GetMotherCandidateMass()); - continue; - } - Double_t chi2V0 = fCurrentMotherKFCandidate->GetChi2()/fCurrentMotherKFCandidate->GetNDF(); - if(chi2V0 > fChi2CutConversion || chi2V0 <=0){ - fCurrentV0IndexNumber++; - fHistograms->FillHistogram("V0MassDebugCut6",GetMotherCandidateMass()); - continue; - } - - if(TMath::Abs(fMotherCandidateLorentzVector->Eta())> fEtaCut){ - fCurrentV0IndexNumber++; - fHistograms->FillHistogram("V0MassDebugCut7",GetMotherCandidateMass()); - continue; - } - - if(fMotherCandidateLorentzVector->Pt()FillHistogram("V0MassDebugCut8",GetMotherCandidateMass()); - continue; - } - - } - else if(fUseESDTrack){ - //TODO - } - - iResult=kTRUE;//means we have a v0 who survived all the cuts applied - - fCurrentV0IndexNumber++; - - break; - } - return iResult; -} - -void AliV0Reader::UpdateV0Information(){ - //see header file for documentation - - if(fCurrentNegativeKFParticle != NULL){ - delete fCurrentNegativeKFParticle; - } - fCurrentNegativeKFParticle = new AliKFParticle(*(fCurrentV0->GetParamN()),fNegativeTrackPID); - - if(fCurrentPositiveKFParticle != NULL){ - delete fCurrentPositiveKFParticle; - } - fCurrentPositiveKFParticle = new AliKFParticle(*(fCurrentV0->GetParamP()),fPositiveTrackPID); - - if(fCurrentMotherKFCandidate != NULL){ - delete fCurrentMotherKFCandidate; - } - fCurrentMotherKFCandidate = new AliKFParticle(*fCurrentNegativeKFParticle,*fCurrentPositiveKFParticle); - - fCurrentNegativeESDTrack = fESDEvent->GetTrack(fCurrentV0->GetNindex()); - - fCurrentPositiveESDTrack = fESDEvent->GetTrack(fCurrentV0->GetPindex()); - - if(fPositiveTrackPID==-11 && fNegativeTrackPID==11){ - fCurrentMotherKFCandidate->SetMassConstraint(0,fNSigmaMass); - } - - if(fUseImprovedVertex == kTRUE){ - AliKFVertex primaryVertexImproved(*GetPrimaryVertex()); - primaryVertexImproved+=*fCurrentMotherKFCandidate; - fCurrentMotherKFCandidate->SetProductionVertex(primaryVertexImproved); - } - - fCurrentMotherKFCandidate->GetMass(fMotherCandidateKFMass,fMotherCandidateKFWidth); - - - if(fNegativeTrackLorentzVector != NULL){ - delete fNegativeTrackLorentzVector; - } - if(fUseKFParticle){ - fNegativeTrackLorentzVector = new TLorentzVector(fCurrentNegativeKFParticle->Px(),fCurrentNegativeKFParticle->Py(),fCurrentNegativeKFParticle->Pz()); - } - else if(fUseESDTrack){ - fNegativeTrackLorentzVector = new TLorentzVector(fCurrentNegativeESDTrack->Px(),fCurrentNegativeESDTrack->Py(),fCurrentNegativeESDTrack->Pz()); - } - - if(fPositiveTrackLorentzVector != NULL){ - delete fPositiveTrackLorentzVector; - } - if(fUseKFParticle){ - fPositiveTrackLorentzVector = new TLorentzVector(fCurrentPositiveKFParticle->Px(),fCurrentPositiveKFParticle->Py(),fCurrentPositiveKFParticle->Pz()); - } - else if(fUseESDTrack){ - fPositiveTrackLorentzVector = new TLorentzVector(fCurrentPositiveESDTrack->Px(),fCurrentPositiveESDTrack->Py(),fCurrentPositiveESDTrack->Pz()); - } - - if(fMotherCandidateLorentzVector != NULL){ - delete fMotherCandidateLorentzVector; - } - if(fUseKFParticle){ - fMotherCandidateLorentzVector = new TLorentzVector(*fNegativeTrackLorentzVector + *fPositiveTrackLorentzVector); - } - else if(fUseESDTrack){ - fMotherCandidateLorentzVector = new TLorentzVector(*fNegativeTrackLorentzVector + *fPositiveTrackLorentzVector); - } - - if(fPositiveTrackPID==-11 && fNegativeTrackPID==11){ - fMotherCandidateLorentzVector->SetXYZM(fMotherCandidateLorentzVector->Px() ,fMotherCandidateLorentzVector->Py(),fMotherCandidateLorentzVector->Pz(),0.); - } - - if(fDoMC == kTRUE){ - fNegativeMCParticle = fMCStack->Particle(TMath::Abs(fESDEvent->GetTrack(fCurrentV0->GetNindex())->GetLabel())); - fPositiveMCParticle = fMCStack->Particle(TMath::Abs(fESDEvent->GetTrack(fCurrentV0->GetPindex())->GetLabel())); - } - fCurrentEventGoodV0s.push_back(*fCurrentMotherKFCandidate); -} - -Bool_t AliV0Reader::HasSameMCMother(){ - //see header file for documentation - - Bool_t iResult = kFALSE; - if(fDoMC == kTRUE){ - if(fNegativeMCParticle != NULL && fPositiveMCParticle != NULL){ - if(fNegativeMCParticle->GetMother(0) == fPositiveMCParticle->GetMother(0)) - fMotherMCParticle = fMCStack->Particle(fPositiveMCParticle->GetMother(0)); - iResult = kTRUE; - } - } - return iResult; -} - -Bool_t AliV0Reader::CheckPIDProbability(Double_t negProbCut, Double_t posProbCut){ - //see header file for documentation - - Bool_t iResult=kFALSE; - - Double_t *posProbArray = new Double_t[10]; - Double_t *negProbArray = new Double_t[10]; - AliESDtrack* negTrack = fESDEvent->GetTrack(fCurrentV0->GetNindex()); - AliESDtrack* posTrack = fESDEvent->GetTrack(fCurrentV0->GetPindex()); - - negTrack->GetTPCpid(negProbArray); - posTrack->GetTPCpid(posProbArray); - - if(negProbArray!=NULL && posProbArray!=NULL){ - if(negProbArray[GetSpeciesIndex(-1)]>=negProbCut && posProbArray[GetSpeciesIndex(1)]>=posProbCut){ - iResult=kTRUE; - } - } - delete [] posProbArray; - delete [] negProbArray; - return iResult; -} - -void AliV0Reader::UpdateEventByEventData(){ - //see header file for documentation - - if(fCurrentEventGoodV0s.size() >0 ){ - fPreviousEventGoodV0s.clear(); - fPreviousEventGoodV0s = fCurrentEventGoodV0s; - } - fCurrentEventGoodV0s.clear(); - - fCurrentV0IndexNumber=0; -} - -Double_t AliV0Reader::GetNegativeTrackPhi() const{ - //see header file for documentation - - Double_t offset=0; - if(fNegativeTrackLorentzVector->Phi()> TMath::Pi()){ - offset = -2*TMath::Pi(); - } - return fNegativeTrackLorentzVector->Phi()+offset; -} - -Double_t AliV0Reader::GetPositiveTrackPhi() const{ - //see header file for documentation - - Double_t offset=0; - if(fPositiveTrackLorentzVector->Phi()> TMath::Pi()){ - offset = -2*TMath::Pi(); - } - return fPositiveTrackLorentzVector->Phi()+offset; -} - -Double_t AliV0Reader::GetMotherCandidatePhi() const{ - //see header file for documentation - - Double_t offset=0; - if(fMotherCandidateLorentzVector->Phi()> TMath::Pi()){ - offset = -2*TMath::Pi(); - } - return fMotherCandidateLorentzVector->Phi()+offset; -} - -Int_t AliV0Reader::GetSpeciesIndex(Int_t chargeOfTrack){ - //see header file for documentation - - Int_t iResult = 10; // Unknown particle - - if(chargeOfTrack==-1){ //negative track - switch(abs(fNegativeTrackPID)){ - case 11: //electron - iResult = 0; - break; - case 13: //muon - iResult = 1; - break; - case 211: //pion - iResult = 2; - break; - case 321: //kaon - iResult = 3; - break; - case 2212: //proton - iResult = 4; - break; - case 22: //photon - iResult = 5; - break; - case 111: //pi0 - iResult = 6; - break; - case 2112: //neutron - iResult = 7; - break; - case 311: //K0 - iResult = 8; - break; - - //Put in here for kSPECIES::kEleCon ???? - } - } - else if(chargeOfTrack==1){ //positive track - switch(abs(fPositiveTrackPID)){ - case 11: //electron - iResult = 0; - break; - case 13: //muon - iResult = 1; - break; - case 211: //pion - iResult = 2; - break; - case 321: //kaon - iResult = 3; - break; - case 2212: //proton - iResult = 4; - break; - case 22: //photon - iResult = 5; - break; - case 111: //pi0 - iResult = 6; - break; - case 2112: //neutron - iResult = 7; - break; - case 311: //K0 - iResult = 8; - break; - - //Put in here for kSPECIES::kEleCon ???? - } - } - else{ - //Wrong parameter.. Print warning - } - return iResult; -} diff --git a/PWG4/PartCorr/AliV0Reader.h b/PWG4/PartCorr/AliV0Reader.h deleted file mode 100644 index 41a3ab9bd2e..00000000000 --- a/PWG4/PartCorr/AliV0Reader.h +++ /dev/null @@ -1,308 +0,0 @@ -#ifndef ALIV0READER_H -#define ALIV0READER_H -/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full Copyright notice */ - -//////////////////////////////////////////////// -//--------------------------------------------- -// Class used to do analysis on conversion pairs -//--------------------------------------------- -//////////////////////////////////////////////// - -// --- ROOT system --- -#include "TObject.h" -#include "AliESDv0.h" -#include "AliESDEvent.h" -#include "AliKFParticle.h" -#include "TParticle.h" -#include "AliGammaConversionHistograms.h" -#include - -class TClonesArray; -class TFormula; -class Riostream; -class TChain; -//--- AliRoot system --- - -class AliStack; -class AliESDEvent; -class AliMCEventHandler; -class AliESDInputHandler; -class AliESDVertex; -class AliLog; -class TChain; -class TChain; - - - -class AliV0Reader : public TObject { - - public: - - AliV0Reader(); //constructor - AliV0Reader(const AliV0Reader & g); //copy constructor - AliV0Reader & operator = (const AliV0Reader & g); //assignment operator - virtual ~AliV0Reader() {;} //virtual destructor - /* - *Initialize the reader - */ - void Initialize(); - - /* - *Returns the number of v0s in the event, no cuts applied. - */ - Int_t GetNumberOfV0s() const{return fESDEvent->GetNumberOfV0s();} - - /* - * Check if there are any more good v0s left in the v0 stack - * if so, fCurrent v0 is set to this v0 and can be retrieved - * by GetCurrentV0 function. - * returns kFALSE if there is no more good v0s in the v0 stack - */ - Bool_t NextV0(); - - /* - * Returns the v0 at the given index, no checks are done on the v0. - */ - AliESDv0* GetV0(Int_t index); - - /* - * Returns the current v0 - */ - AliESDv0* GetCurrentV0() const{return fCurrentV0;} - - /* - * Returns the negative ESD track which belongs to fCurrentV0 - */ - AliESDtrack* GetNegativeESDTrack(){return fESDEvent->GetTrack(fCurrentV0->GetNindex());} - - /* - * Returns the positive ESD track which belongs to fCurrentV0 - */ - AliESDtrack* GetPositiveESDTrack(){return fESDEvent->GetTrack(fCurrentV0->GetPindex());} - - /* - * Returns the negative KF particle which belongs to fCurrentV0 - */ - AliKFParticle* GetNegativeKFParticle() const{return fCurrentNegativeKFParticle;} - - /* - * Returns the positive KF particle which belongs to fCurrentV0 - */ - AliKFParticle* GetPositiveKFParticle() const{return fCurrentPositiveKFParticle;} - /* - * Returns the KFParticle object of the 2 tracks. - */ - AliKFParticle* GetMotherCandidateKFCombination() const{return fCurrentMotherKFCandidate;} - /* - * Checks the probablity that the PID of the particle is what we want it to be. - */ - Bool_t CheckPIDProbability(Double_t negProbCut, Double_t posProbCut); - - /* - *Get the negative MC TParticle from the stack - */ - TParticle * GetNegativeMCParticle() const{return fNegativeMCParticle;} - - /* - *Get the positive MC TParticle from the stack - */ - TParticle * GetPositiveMCParticle() const{return fPositiveMCParticle;} - - /* - *Get the mother MC TParticle from the stack - */ - TParticle * GetMotherMCParticle() const{return fMotherMCParticle;} - - Bool_t HasSameMCMother(); - - /* - *Get the MC stack - */ - AliStack* GetMCStack() const{return fMCStack;} - - /* - *Get the magnetic field from the ESD event - */ - Double_t GetMagneticField() const{return fESDEvent->GetMagneticField();} - - /* - *Get the primary vertex from the esd event - */ - const AliESDVertex *GetPrimaryVertex() const {return fESDEvent->GetPrimaryVertex();} - - /* - * Set the PID of the negative track - */ - void SetNegativeTrackPID(Int_t negTrackPID){fNegativeTrackPID=negTrackPID;} - - /* - * Set the PID of the positive track - */ - void SetPositiveTrackPID(Int_t posTrackPID){fPositiveTrackPID=posTrackPID;} - - /* - * Set the flag to use the kfparticle class. Will also disable the use of esd tracks - */ - void UseKFParticle(){fUseKFParticle = kTRUE; fUseESDTrack = kFALSE;} - - /* - * Set the flag to use the esd track class. Will also disable the use of kf particles - */ - void UseESDTrack(){fUseESDTrack = kTRUE; fUseKFParticle = kFALSE;} - - /* - * Set the flag to use improved vertex or not - */ - void SetUseImprovedVertex(Bool_t useImprovedVertex){fUseImprovedVertex=useImprovedVertex;} - - /* - * Return the number in the species array belonging to the negative or positive track pid. - */ - Int_t GetSpeciesIndex(Int_t chargeOfTrack); - - /* - * Return the x coordinate of the v0 - */ - Double_t GetX() const{return fCurrentXValue;} - - /* - * Return the y coordinate of the v0 - */ - Double_t GetY() const{return fCurrentYValue;} - - /* - * Return the Z coordinate of the v0 - */ - Double_t GetZ() const{return fCurrentZValue;} - - /* - * Return the radius of the v0 - */ - Double_t GetXYRadius() const{return sqrt((Double_t)(fCurrentXValue*fCurrentXValue + fCurrentYValue*fCurrentYValue));} - - /* - * Get the opening angle between the two tracks - */ - Double_t GetOpeningAngle(){return fNegativeTrackLorentzVector->Angle(fPositiveTrackLorentzVector->Vect());} - - Double_t GetNegativeTrackEnergy() const{return fCurrentNegativeKFParticle->E();} - Double_t GetPositiveTrackEnergy() const{return fCurrentPositiveKFParticle->E();} - Double_t GetMotherCandidateEnergy() const{return fCurrentMotherKFCandidate->E();} - - Double_t GetNegativeTrackPt() const{return fNegativeTrackLorentzVector->Pt();} - Double_t GetPositiveTrackPt() const{return fPositiveTrackLorentzVector->Pt();} - Double_t GetMotherCandidatePt() const{return fMotherCandidateLorentzVector->Pt();} - - Double_t GetNegativeTrackEta() const{return fNegativeTrackLorentzVector->Eta();} - Double_t GetPositiveTrackEta() const{return fPositiveTrackLorentzVector->Eta();} - Double_t GetMotherCandidateEta() const{return fMotherCandidateLorentzVector->Eta();} - - Double_t GetMotherCandidateNDF() const{return fCurrentMotherKFCandidate->GetNDF();} - Double_t GetMotherCandidateChi2() const{return fCurrentMotherKFCandidate->GetChi2();} - Double_t GetMotherCandidateMass() const{return fMotherCandidateKFMass;} - Double_t GetMotherCandidateWidth() const{return fMotherCandidateKFWidth;} - - Double_t GetNegativeTrackPhi() const; - Double_t GetPositiveTrackPhi() const; - Double_t GetMotherCandidatePhi() const; - - void UpdateEventByEventData(); - - Double_t GetMaxRCut() const{return fMaxR;} - Double_t GetEtaCut() const{return fEtaCut;} - Double_t GetPtCut() const{return fPtCut;} - Double_t GetChi2CutConversion() const{return fChi2CutConversion;} - Double_t GetChi2CutMeson() const{return fChi2CutMeson;} - - void SetMaxRCut(Double_t maxR){fMaxR=maxR;} - void SetEtaCut(Double_t etaCut){fEtaCut=etaCut;} - void SetPtCut(Double_t ptCut){fPtCut=ptCut;} - void SetChi2CutConversion(Double_t chi2){fChi2CutConversion=chi2;} - void SetChi2CutMeson(Double_t chi2){fChi2CutMeson=chi2;} - - void SetXVertexCut(Double_t xVtx){fCurrentXValue=xVtx;} - void SetYVertexCut(Double_t yVtx){fCurrentYValue=yVtx;} - void SetZVertexCut(Double_t zVtx){fCurrentZValue=zVtx;} - void SetPIDProbability(Double_t pidProb){fPIDProbabilityCutPositiveParticle=pidProb; fPIDProbabilityCutNegativeParticle=pidProb;} - void SetPIDProbabilityNegativeParticle(Double_t pidProb){fPIDProbabilityCutNegativeParticle=pidProb;} - void SetPIDProbabilityPositiveParticle(Double_t pidProb){fPIDProbabilityCutPositiveParticle=pidProb;} - void SetSigmaMass(Double_t sigmaMass){fNSigmaMass=sigmaMass;} - - void SetDoMCTruth(Bool_t doMC){fDoMC = doMC;} - - void UpdateV0Information(); - - void SetHistograms(AliGammaConversionHistograms *histograms){fHistograms=histograms;} - - vector GetCurrentEventGoodV0s() const{return fCurrentEventGoodV0s;} - vector GetPreviousEventGoodV0s() const{return fPreviousEventGoodV0s;} - - private: - AliStack * fMCStack; // pointer to MonteCarlo particle stack - AliMCEventHandler* fMCTruth; // pointer to the MC event handler - TChain * fChain; // pointer to the TChain - - AliESDInputHandler* fESDHandler; //! pointer to esd object - AliESDEvent *fESDEvent; //! pointer to esd object - - AliGammaConversionHistograms *fHistograms; - - Int_t fCurrentV0IndexNumber; - AliESDv0 * fCurrentV0; //! pointer to the current v0 - AliKFParticle * fCurrentNegativeKFParticle; //! pointer to the negative KF particle - AliKFParticle * fCurrentPositiveKFParticle; //! pointer to the positive KF particle - AliKFParticle * fCurrentMotherKFCandidate; //! pointer to the positive KF particle - - AliESDtrack * fCurrentNegativeESDTrack; //! pointer to the negative ESD track - AliESDtrack * fCurrentPositiveESDTrack; //! pointer to the positive ESD track - - TLorentzVector * fNegativeTrackLorentzVector; //! pointer to the negative Track Lorentz Vector - TLorentzVector * fPositiveTrackLorentzVector; //! pointer to the positive Track Lorentz Vector - TLorentzVector * fMotherCandidateLorentzVector; //! pointer to the mother candidate Track Lorentz Vector - - Double_t fCurrentXValue; - Double_t fCurrentYValue; - Double_t fCurrentZValue; - - Int_t fPositiveTrackPID; - Int_t fNegativeTrackPID; - - TParticle *fNegativeMCParticle; //! - TParticle *fPositiveMCParticle; //! - TParticle *fMotherMCParticle; //! - - Double_t fMotherCandidateKFMass; - Double_t fMotherCandidateKFWidth; - - Bool_t fUseKFParticle; - Bool_t fUseESDTrack; - Bool_t fDoMC; - - //cuts - Double_t fMaxR; - Double_t fEtaCut; - Double_t fPtCut; - Double_t fChi2CutConversion; - Double_t fChi2CutMeson; - Double_t fPIDProbabilityCutNegativeParticle; - Double_t fPIDProbabilityCutPositiveParticle; - Double_t fXVertexCut; - Double_t fYVertexCut; - Double_t fZVertexCut; - - Double_t fNSigmaMass; - - Bool_t fUseImprovedVertex; - - vector fCurrentEventGoodV0s; - vector fPreviousEventGoodV0s; - - ClassDef(AliV0Reader,0) -}; - - -#endif - - - -- 2.39.3