+++ /dev/null
-#include <exception>
-#include "TChain.h"
-#include "TTree.h"
-#include "TVector3.h"
-#include "TCanvas.h"
-#include "TRandom3.h"
-#include "TH2.h"
-#include "TH1.h"
-#include "TH3.h"
-
-#include "AliLog.h"
-#include "AliAnalysisTask.h"
-#include "AliAnalysisManager.h"
-#include "AliAnalysisTaskPi0Reconstruction.h"
-
-#include "AliESDEvent.h"
-#include "AliESDInputHandler.h"
-
-#include "AliAODCentrality.h"
-#include "AliTPCPIDResponse.h"
-#include "AliAODFmdCluster.h"
-#include "AliKFParticle.h"
-#include "AliTracker.h"
-#include "AliV0Reader.h"
-#include "AliAODv0.h"
-#include "AliAODPid.h"
-#include "AliAODEvent.h"
-#include "AliAODTrack.h"
-#include "AliESDtrack.h"
-#include "AliAODHandler.h"
-#include "AliConversionAODBGHandlerRP.h"
-#include "AliV0Reader.h"
-#include "AliV0ReaderV1.h"
-#include "AliCDBEntry.h"
-#include "TObjArray.h"
-#include "AliEventplane.h"
-#include "AliCentrality.h"
-#include "AliVCluster.h"
-#include "AliESDCaloCluster.h"
-#include <iostream>
-
-#include <exception>
-
-// Author Daniel Lohner (Daniel.Lohner@cern.ch)
-
-using namespace std;
-
-ClassImp(AliAnalysisTaskPi0Reconstruction)
-
-
-//________________________________________________________________________
-AliAnalysisTaskPi0Reconstruction::AliAnalysisTaskPi0Reconstruction(const char *name) : AliV0ReaderV1(name),
- fDeltaAODBranchName("GammaConv_gamma"),
- fBGHandler(NULL),
- Pi0MassRange(NULL),
- kEventMixing(kTRUE),
- fIsHeavyIon(kTRUE),
- fRandomizer(NULL),
- kUseSatelliteAODs(kTRUE),
- fPHOSGammas(NULL),
- fEMCALGammas(NULL),
- fPi0Candidates(NULL),
- fBGPi0s(NULL),
- fMCTruePi0s(NULL),
- fRapidityCut(0.9),
- fAlphaCut(1),
- kUseOnlyTaggedPhotons(kFALSE),
- fNRandomEventsForBGRotation(15)
-{
-
- fRandomizer= new TRandom3();
-
- // If V0 Reader is available use it
- SetUseAODConversionPhoton(kTRUE);
-
- // Default Values
- Pi0MassRange=new Double_t[2];
- Pi0MassRange[0]=0.;
- Pi0MassRange[1]=0.3;
-
- DefineInput(0, TChain::Class());
- DefineOutput(1, TList::Class());
-}
-//________________________________________________________________________
-void AliAnalysisTaskPi0Reconstruction::SetBGHandler(AliConversionAODBGHandlerRP *bgHandler)
-{
- fBGHandler=bgHandler;
- fNCentralityBins=fBGHandler->GetNCentralityBins();
-}
-//________________________________________________________________________
-void AliAnalysisTaskPi0Reconstruction::SetDefaultBGHandler()
-{
- AliInfo("Setting up default BGHandler");
- fBGHandler=new AliConversionAODBGHandlerRP();
- fNCentralityBins=fBGHandler->GetNCentralityBins();
-}
-
-//________________________________________________________________________
-AliAnalysisTaskPi0Reconstruction::~AliAnalysisTaskPi0Reconstruction(){
-
- if(fBGHandler){delete fBGHandler;
- fBGHandler=0x0;}
- if(fRandomizer){delete fRandomizer;fRandomizer=0x0;}
-
- if(Pi0MassRange)delete[] Pi0MassRange;
-
-}
-
-//________________________________________________________________________
-void AliAnalysisTaskPi0Reconstruction::UserCreateOutputObjects()
-{
- // Create histograms
- // Called once
- // Create the output container
- /* if(fOutputList != NULL){
- delete fOutputList;
- fOutputList = NULL;
- }
- if(fOutputList == NULL){
- fOutputList = new TList();
- fOutputList->SetOwner(kTRUE);
- }*/
- AliV0ReaderV1::UserCreateOutputObjects();
-
- TList *fPi0List=new TList();
- fPi0List->SetName("Pi0Reconstruction");
- fPi0List->SetOwner(kTRUE);
- fOutputList->Add(fPi0List);
-
-
- hPi0Cuts=new TH1F("Pi0Cand_Cuts","Pi0Cand_Cuts" ,10,-0.5,9.5);
- fPi0List->Add(hPi0Cuts);
- hPi0BGCuts=new TH1F("Pi0Cand_BG_Cuts","Pi0Cand_BG_Cuts" ,10,-0.5,9.5);
- fPi0List->Add(hPi0BGCuts);
- hPi0Alpha=new TH1F("Pi0Cand_Alpha" ,"Pi0Cand Alpha" ,200,0,1);
- fPi0List->Add(hPi0Alpha);
- hPi0OpeningAngle=new TH1F("Pi0Cand_OpeningAngle" ,"Pi0Cand OpeningAngle" ,400,0,TMath::Pi());
- fPi0List->Add(hPi0OpeningAngle);
- hPi0Rapidity=new TH1F("Pi0Cand_Rapidity" ,"Pi0Cand_Rapidity" ,100,-1,1);
- fPi0List->Add(hPi0Rapidity);
- fPi0List->Add(hPi0BGCuts);
- hPi0AlphaRejected=new TH1F("Pi0Cand_Alpha_Rejected" ,"Pi0Cand Alpha Rejected" ,200,0,1);
- fPi0List->Add(hPi0AlphaRejected);
- hPi0OpeningAngleRejected=new TH1F("Pi0Cand_OpeningAngle_Rejected" ,"Pi0Cand OpeningAngle Rejected" ,400,0,TMath::Pi());
- fPi0List->Add(hPi0OpeningAngleRejected);
- hPi0RapidityRejected=new TH1F("Pi0Cand_Rapidity_Rejected" ,"Pi0Cand_Rapidity_Rejected" ,100,-1,1);
- fPi0List->Add(hPi0RapidityRejected);
-
- hPool=new TH3F("BGPool","BGPool",fNCentralityBins,-0.5,fNCentralityBins-0.5,7,-0.5,6.5,fBGHandler->GetNRPBins(),-0.5,fBGHandler->GetNRPBins()-0.5);
- fPi0List->Add(hPool);
-
- // MC
-
- if(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()){
-
- Int_t kGCnXBinsSpectra = Int_t((Pi0MassRange[1]-Pi0MassRange[0])*500); //500 for range 0 - 1
- Double_t kGCfirstXBinSpectra = Pi0MassRange[0];
- Double_t kGClastXBinSpectra = Pi0MassRange[1];
-
- Int_t kGCnYBinsSpectra = 250;
- Double_t kGCfirstYBinSpectra = 0.;
- Double_t kGClastYBinSpectra = 25.;
-
- hPi0TRUE=new TH1F*[fNCentralityBins];
- hPi0RECOTRUE=new TH2F*[fNCentralityBins];
-
- for(Int_t m=0;m<fNCentralityBins;m++){
-
- hPi0TRUE[m]=new TH1F(Form("%d_TRUE_Pi0_Pt",m),Form("%d_TRUE_Pi0_Pt",m),kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra);
- hPi0TRUE[m]->Sumw2();
- fPi0List->Add(hPi0TRUE[m]);
-
- hPi0RECOTRUE[m]=new TH2F(Form("%d_RECOTRUE_Pi0_Pt",m),Form("%d_RECOTRUE_Pi0_Pt",m),kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra);
- hPi0RECOTRUE[m]->Sumw2();
- fPi0List->Add(hPi0RECOTRUE[m]);
-
- }
- }
-
- PostData(1, fOutputList);
-}
-
-//________________________________________________________________________
-void AliAnalysisTaskPi0Reconstruction::UserExec(Option_t *)
-{
-
-
- AliV0ReaderV1::UserExec("");
-
- // Check if BG Handler exists
-
- if(!fBGHandler){SetDefaultBGHandler();}
-
- // Process Event Info
-
- if(fEventIsSelected){
-
- GetConversionGammas();
-
- CalculatePi0Candidates();
-
- CalculateBackground();
-
- ProcessMCMesons();
- }
-
- PostData(1, fOutputList);
-}
-
-//________________________________________________________________________
-
-void AliAnalysisTaskPi0Reconstruction::ProcessMCMesons(){
-
- if(fMCStack){
-
- if(fMCTruePi0s == NULL){
- fMCTruePi0s = new TClonesArray("TParticle",100);
- }
- fMCTruePi0s->Delete();//Reset the TClonesArray
-
- for (Int_t part=0; part<fMCStack->GetNprimary(); part++) {
-
- TParticle *fMCMother = fMCStack->Particle(part);
-
- if(fMCMother){
-
- // Process only Pions
-
- if(fMCMother->GetPdgCode()==111){
-
- // Histogram for pi0->2y efficiency (take acceptance)
- if(IsMCMesonInReconstructionAcceptance(fMCMother)){
- hPi0TRUE[fCentralityBin]->Fill(fMCMother->Pt());
- fMCTruePi0s->AddAt(fMCMother,fMCTruePi0s->GetEntriesFast());
- }
- }
- }
- }
- }
-}
-
-//________________________________________________________________________
-Bool_t AliAnalysisTaskPi0Reconstruction::IsMCMesonInReconstructionAcceptance(TParticle *fMCMother){
-
- // Select only pi0->2y
- if(fMCMother->GetNDaughters()!=2){return kFALSE;}
-
- // PseudoRapidity Cut
- if(TMath::Abs(fMCMother->Eta())>fRapidityCut){return kFALSE;}
-
- Int_t NGammaAcceptance=0;
-
- for(Int_t i=0;i<2;i++){
- TParticle *MDaughter=fMCStack->Particle(fMCMother->GetDaughter(i));
-
- // Is Daughter a Photon?
- if(MDaughter->GetPdgCode()==22){
-
- // Gamma Acceptance Cut
- if(IsMCConversionGammaInAcceptance(MDaughter)){
- NGammaAcceptance++;}
- }
- }
-
- if(NGammaAcceptance!=2){return kFALSE;}
-
- return kTRUE;
-}
-
-//________________________________________________________________________
-
-Bool_t AliAnalysisTaskPi0Reconstruction::IsTruePi0(AliAODConversionMother *pi0){
-
- if(fMCStack){
-
- AliAODConversionPhoton *gamma0=dynamic_cast<AliAODConversionPhoton*>(fConversionGammas->At(pi0->GetLabel(0)));
- AliAODConversionPhoton *gamma1=dynamic_cast<AliAODConversionPhoton*>(fConversionGammas->At(pi0->GetLabel(1)));
-
- TParticle *mcgam0=gamma0->GetMCParticle(fMCStack);
- TParticle *mcgam1=gamma1->GetMCParticle(fMCStack);
- TParticle *mcpi0=NULL;
-
- if(mcgam0&&mcgam1){
- if(mcgam0->GetMother(0)==mcgam1->GetMother(0)){
- mcpi0=fMCStack->Particle(mcgam0->GetMother(0));
-
- if(mcpi0){
- if(mcpi0->GetPdgCode()==111){return kTRUE;}
- }
- }
- }
-
- }
-return kFALSE;
-}
-
-//________________________________________________________________________
-Bool_t AliAnalysisTaskPi0Reconstruction::IsMCPhotonReconstructed(TParticle *MDaughter){
-
- for(Int_t ii=0;ii<fConversionGammas->GetEntriesFast();ii++){
-
- AliAODConversionPhoton *gamma=(AliAODConversionPhoton *)fConversionGammas->At(ii);
-
- TParticle *fMCParticle=gamma->GetMCParticle(fMCStack);
-
- if(fMCParticle){
-
- if(fMCParticle->GetDaughter(0)==MDaughter->GetDaughter(0)&&fMCParticle->GetDaughter(1)==MDaughter->GetDaughter(1)){
- return kTRUE;
- }
- }
- }
- return kFALSE;
-}
-
-//________________________________________________________________________
-void AliAnalysisTaskPi0Reconstruction::CalculatePi0Candidates(){
-
- if(fPi0Candidates == NULL){
- fPi0Candidates = new TClonesArray("AliAODConversionMother",100);
- }
- fPi0Candidates->Delete();//Reset the TClonesArray
-
- if(fConversionGammas->GetEntriesFast()>1){
-
- for(Int_t firstGammaIndex=0;firstGammaIndex<fConversionGammas->GetEntriesFast()-1;firstGammaIndex++){
-
- AliAODConversionPhoton *gamma0=dynamic_cast<AliAODConversionPhoton*>(fConversionGammas->At(firstGammaIndex));
-
- // Combine Photons
-
- for(Int_t secondGammaIndex=firstGammaIndex+1;secondGammaIndex<fConversionGammas->GetEntriesFast();secondGammaIndex++){
-
- AliAODConversionPhoton *gamma1=dynamic_cast<AliAODConversionPhoton*>(fConversionGammas->At(secondGammaIndex));
-
- //Check for same Electron ID
- if(gamma0->GetTrackLabelPositive()==gamma1->GetTrackLabelPositive()||gamma0->GetTrackLabelNegative()==gamma1->GetTrackLabelNegative()
- ||gamma0->GetTrackLabelNegative()==gamma1->GetTrackLabelPositive()||gamma0->GetTrackLabelPositive()==gamma1->GetTrackLabelNegative())continue;
-
- AliAODConversionMother *pi0cand=new AliAODConversionMother(gamma0,gamma1);
- pi0cand->SetLabels(firstGammaIndex,secondGammaIndex);
-
-
- if((CheckPi0(pi0cand))){
- if (pi0cand->M() > Pi0MassRange[0] && pi0cand->M() < Pi0MassRange[1] ){
-
- // Add Pi0 to Stack
- new((*fPi0Candidates)[fPi0Candidates->GetEntriesFast()]) AliAODConversionMother(*pi0cand);
-
- // Test MC truth
- if(IsTruePi0(pi0cand)){
- hPi0RECOTRUE[fCentralityBin]->Fill(pi0cand->M(),pi0cand->Pt());
- }
-
- }
- }
-
- delete pi0cand;
- pi0cand=0x0;
-
- }
-
- }
-
- }
-}
-
-
-//________________________________________________________________________
-void AliAnalysisTaskPi0Reconstruction::Terminate(Option_t *)
-{
-
- // Draw result to the screen
- fOutputList->Print();
- // Called once at the end of the query
-}
-
-
-//________________________________________________________________________
-void AliAnalysisTaskPi0Reconstruction::RotateParticle(AliAODConversionPhoton *gamma,Double_t angle){
- Int_t fNDegreesPMBackground=15;
- Double_t nRadiansPM = fNDegreesPMBackground*TMath::Pi()/180;
- Double_t rotationValue = fRandomizer->Rndm()*2*nRadiansPM + TMath::Pi()-nRadiansPM;
- gamma->RotateZ(rotationValue);
-
-}
-
-//________________________________________________________________________
-
-void AliAnalysisTaskPi0Reconstruction::CalculateBackground(){
-
- if(fBGPi0s == NULL){
- fBGPi0s = new TClonesArray("AliAODConversionMother",100);
- }
- fBGPi0s->Delete();//Reset the TClonesArray
-
- AliAODConversionMother *BGcandidate=NULL;
- TClonesArray *currentEventGammas=fConversionGammas;
-
- //Rotation Method
- if(!kEventMixing){
-
- // Correct for the number of rotations
- // BG is for rotation the same, except for factor NRotations
- Double_t weight=1./Double_t(fNRandomEventsForBGRotation);
-
- for(Int_t firstGammaIndex=0;firstGammaIndex<currentEventGammas->GetEntriesFast();firstGammaIndex++){
-
- AliAODConversionPhoton *gamma1=dynamic_cast<AliAODConversionPhoton*>(currentEventGammas->At(firstGammaIndex));
-
- for(Int_t secondGammaIndex=firstGammaIndex+1;secondGammaIndex<currentEventGammas->GetEntriesFast();secondGammaIndex++){
- for(Int_t nRandom=0;nRandom<fNRandomEventsForBGRotation;nRandom++){
-
- AliAODConversionPhoton *gamma2=dynamic_cast<AliAODConversionPhoton*>(currentEventGammas->At(secondGammaIndex));
-
- RotateParticle(gamma2);
-
- BGcandidate=new AliAODConversionMother(gamma1,gamma2);
-
- if(CheckPi0(BGcandidate,kFALSE)){
-
- if (BGcandidate->M() > Pi0MassRange[0] && BGcandidate->M() < Pi0MassRange[1] ){
-
- new((*fBGPi0s)[fBGPi0s->GetEntriesFast()]) AliAODConversionMother(*BGcandidate);
-
- dynamic_cast<AliAODConversionMother*>(fBGPi0s->At(fBGPi0s->GetEntriesFast()-1))->SetWeight(weight);
- }
- }
- delete BGcandidate;
- BGcandidate=NULL;
-
- }
-
- }
- }
- }
-
- else{
- // Do Event Mixing
-
- Int_t psibin=fBGHandler->GetRPBinIndex(fEPAngle);
-
- for(Int_t nEventsInBG=0;nEventsInBG <fBGHandler->GetNBGEvents(psibin,fBGHandler->GetZBinIndex(fVertexZ),fCentralityBin);nEventsInBG++){
-
- AliGammaConversionPhotonVector *previousEventGammas = fBGHandler->GetBGGoodGammas(psibin,fBGHandler->GetZBinIndex(fVertexZ),fCentralityBin,nEventsInBG);
-
- if(previousEventGammas){
-
- // test weighted background
- Double_t weight=1.0;///Double_t(fBGHandler->GetNBGEvents(psibin,zbin,fCentralityBin));
- // Correct for the number of eventmixing:
- // N gammas -> (N-1) + (N-2) +(N-3) ...+ (N-(N-1)) using sum formula sum(i)=N*(N-1)/2 -> N*(N-1)/2
- // real combinations (since you cannot combine a photon with its own)
- // but BG leads to N_{a}*N_{b} combinations
- weight*=0.5*(Double_t(currentEventGammas->GetEntriesFast()-1))/Double_t(previousEventGammas->size());
-
- for(Int_t iCurrent=0;iCurrent<currentEventGammas->GetEntriesFast();iCurrent++){
- AliAODConversionPhoton *currentEventGamma = (AliAODConversionPhoton*)(currentEventGammas->At(iCurrent));
- for(UInt_t iPrevious=0;iPrevious<previousEventGammas->size();iPrevious++){
-
- AliAODConversionPhoton *previousEventGamma = (AliAODConversionPhoton*)(previousEventGammas->at(iPrevious));
-
- BGcandidate=new AliAODConversionMother(previousEventGamma,currentEventGamma);
-
- if(CheckPi0(BGcandidate,kFALSE)){
-
- if (BGcandidate->M() > Pi0MassRange[0] && BGcandidate->M() < Pi0MassRange[1] ){
-
- new((*fBGPi0s)[fBGPi0s->GetEntriesFast()]) AliAODConversionMother(*BGcandidate);
- dynamic_cast<AliAODConversionMother*>(fBGPi0s->At(fBGPi0s->GetEntriesFast()-1))->SetWeight(weight);
- }
- }
- delete BGcandidate;
- BGcandidate=NULL;
- }
- }
- }
- }
-
- // Add Current Event to BG POOL
- fBGHandler->AddEvent(fConversionGammas,fEPAngle,fVertexZ,Int_t(fCentrality));
- hPool->Fill(fCentralityBin,fBGHandler->GetZBinIndex(fVertexZ),fBGHandler->GetRPBinIndex(fEPAngle));
-
- }
-}
-
-//________________________________________________________________________
-Bool_t AliAnalysisTaskPi0Reconstruction::GetPHOSGammas(){
-
- // TClones Array for local working copy
-
- /*
- if(fPHOSGammas == NULL){
- fPHOSGammas = new TClonesArray("AliAODConversionPhoton",100);
- }
- fPHOSGammas->Delete();//Reset the TClonesArray
-
- //AliESDCaloCluster *clu=NULL;
- AliVCluster *clu=NULL;
- TLorentzVector pPHOS;
- AliAODConversionPhoton *gammaPHOS=NULL;
-
- Double_t vtx[3];
- vtx[0] = fESDEvent->GetPrimaryVertex()->GetX();
- vtx[1] = fESDEvent->GetPrimaryVertex()->GetY();
- vtx[2] = fESDEvent->GetPrimaryVertex()->GetZ();
-
-
- for (Int_t i=0; i<fESDEvent->GetNumberOfCaloClusters(); i++){
- clu = fESDEvent->GetCaloCluster(i);
-
- // Cuts from AliAnalysisTaskCaloConv
- if ( !clu->IsPHOS() || clu->E()<0.1 ) continue;
- clu ->GetMomentum(pPHOS ,vtx);
- if(pPHOS.Energy()<0.25){
- continue ;
- }
- if(clu->GetNCells()<=2){
- continue ;
- }
-
- Bool_t isNeutral = kTRUE ;
- Bool_t isDispOK = kTRUE ;
- Bool_t isTOFOK = kTRUE ;
- Int_t iMod,iX,iZ ;
-
- isNeutral = clu->GetEmcCpvDistance()>5. ; //To be improved
- isDispOK = kFALSE ;
- Double_t l0=clu->GetM02(),l1=clu->GetM20() ;
- if(l1>= 0 && l0>= 0 && l1 < 0.1 && l0 < 0.1) isDispOK=kFALSE ;
- if(l1>= 0 && l0 > 0.5 && l1 < 0.1 && l0 < 1.5) isDispOK=kTRUE ;
- if(l1>= 0 && l0 > 2.0 && l1 < 0.1 && l0 < 2.7) isDispOK=kFALSE ;
- if(l1>= 0 && l0 > 2.7 && l1 < 0.1 && l0 < 4.0) isDispOK=kFALSE ;
- if(l1 > 0.1 && l1 < 0.7 && l0 > 0.7 && l0 < 2.1) isDispOK=kTRUE ;
- if(l1 > 0.1 && l1 < 0.3 && l0 > 3.0 && l0 < 5.0) isDispOK=kFALSE ;
- if(l1 > 0.3 && l1 < 0.7 && l0 > 2.5 && l0 < 4.0) isDispOK=kFALSE ;
- if(l1 > 0.7 && l1 < 1.3 && l0 > 1.0 && l0 < 1.6) isDispOK=kTRUE ;
- if(l1 > 0.7 && l1 < 1.3 && l0 > 1.6 && l0 < 3.5) isDispOK=kTRUE ;
- if(l1 > 1.3 && l1 < 3.5 && l0 > 1.3 && l0 < 3.5) isDispOK=kTRUE ;
-
- Float_t xyz[3] = {0,0,0};
- clu->GetPosition(xyz); //Global position in ALICE system
- TVector3 global(xyz) ;
- Int_t relid[4] ;
- if(!fPHOSgeom->GlobalPos2RelId(global,relid)){
- printf("PHOS_beyond: x=%f, y=%f, z=%f \n",xyz[0],xyz[1],xyz[2]) ;
- continue ;
- }
- iMod=relid[0] ;
- iX=relid[2];
- iZ=relid[3] ;
- if(!IsGoodChannel("PHOS",iMod,iX,iZ))
- continue ;
-
- // Add selected cluster to Photonqueue
- gammaPHOS=new AliAODConversionPhoton();
- gammaPHOS->SetXYZM(pPHOS.Px(),pPHOS.Py(),pPHOS.Pz(),0.);
- new((*fPHOSGammas)[fPHOSGammas->GetEntriesFast()]) AliAODConversionPhoton(*gammaPHOS);
- }
-
- if(fPHOSGammas->GetEntries()){return kTRUE;}
-*/
- return kFALSE;
-
-
-}
-
-//________________________________________________________________________
-Bool_t AliAnalysisTaskPi0Reconstruction::GetConversionGammas(){
-
- // ESD mode
-
- if(fESDEvent){
-
- fConversionGammas=GetReconstructedGammas();
-
- if(!fConversionGammas)AliError("No Gammas from V0 Reader");
- }
-
-
- // AOD mode
-
- if(fAODEvent&&kUseSatelliteAODs){
-
- if(fConversionGammas == NULL){
- fConversionGammas = new TClonesArray("AliAODConversionPhoton",100);
- }
- fConversionGammas->Delete();//Reset the TClonesArray
-
- //Get Gammas from satellite AOD gamma branch
-
- AliAODConversionPhoton *gamma=0x0;
-
- TClonesArray *fInputGammas=dynamic_cast<TClonesArray*>(fAODEvent->FindListObject(fDeltaAODBranchName.Data()));
- if(!fInputGammas){FindDeltaAODBranchName();
- fInputGammas=dynamic_cast<TClonesArray*>(fAODEvent->FindListObject(fDeltaAODBranchName.Data()));}
- if(!fInputGammas){AliError("No Gamma Satellites found");return kFALSE;}
-
- // Apply Selection Cuts to Gammas and create local working copy
- if(fInputGammas){
- for(Int_t i=0;i<fInputGammas->GetEntriesFast();i++){
- gamma=dynamic_cast<AliAODConversionPhoton*>(fInputGammas->At(i));
- if(gamma){
- if(IsGammaCandidate(gamma)){
- new((*fConversionGammas)[fConversionGammas->GetEntriesFast()]) AliAODConversionPhoton(*gamma);}
- }
- }
- }
-
- }
-
- if(fConversionGammas->GetEntries()){return kTRUE;}
-
- return kFALSE;
-}
-
-//________________________________________________________________________
-void AliAnalysisTaskPi0Reconstruction::FindDeltaAODBranchName(){
- TList *list=fAODEvent->GetList();
- for(Int_t ii=0;ii<list->GetEntries();ii++){
- TString name((list->At(ii))->GetName());
- if(name.BeginsWith("GammaConv")&&name.EndsWith("gamma")){
- fDeltaAODBranchName=name;
- AliInfo(Form("Set DeltaAOD BranchName to: %s",fDeltaAODBranchName.Data()));
- return;
- }
- }
-}
-
-
-///________________________________________________________________________
-Bool_t AliAnalysisTaskPi0Reconstruction::CheckPi0(AliAODConversionMother *pi0,Bool_t IsSignal)
-{
-
- Bool_t passcuts=kTRUE;
-
- TH1 *hist=0x0;
-
- if(IsSignal){hist=hPi0Cuts;
- }
- else{hist=hPi0BGCuts;}
-
- // Undefined Rapidity -> Floating Point exception
- if((pi0->E()+pi0->Pz())/(pi0->E()-pi0->Pz())<=0){
- hist->Fill(0);
- passcuts=kFALSE;
- }
- else{
- // PseudoRapidity Cut
- if(TMath::Abs(pi0->PseudoRapidity())>fRapidityCut){
- hist->Fill(1);
- passcuts=kFALSE;
- }
- }
-
- // Opening Angle Cut
- if(pi0->GetOpeningAngle()<0.005){
- hist->Fill(2);
- passcuts=kFALSE;
- }
-
- // Alpha (Energy Asymmetry) Cut
- if(pi0->GetAlpha()>fAlphaCut){
- hist->Fill(3);
- passcuts=kFALSE;
- }
-
- // Fill Histograms
-
- if(passcuts){
- hist->Fill(9);
- if(IsSignal){
- hPi0Rapidity->Fill(pi0->PseudoRapidity());
- hPi0Alpha->Fill(pi0->GetAlpha());
- hPi0OpeningAngle->Fill(pi0->GetOpeningAngle());
-
- }
- }
- else{
- hist->Fill(8);
- if(IsSignal){
- hPi0RapidityRejected->Fill(pi0->PseudoRapidity());
- hPi0AlphaRejected->Fill(pi0->GetAlpha());
- hPi0OpeningAngleRejected->Fill(pi0->GetOpeningAngle());
- }
- }
-
- return passcuts;
-}
+++ /dev/null
-#ifndef AliAnalysisTaskPi0Reconstruction_cxx
-#define AliAnalysisTaskPi0Reconstruction_cxx
-
-#include "TH1.h"
-#include "AliESDEvent.h"
-
-#include "AliAODConversionMother.h"
-#include "AliConversionPhotonBase.h"
-#include "AliAODConversionPhoton.h"
-#include "AliConversionAODBGHandlerRP.h"
-
-#include "AliAODTrack.h"
-#include "AliESDtrack.h"
-#include "AliVTrack.h"
-#include "AliKFParticle.h"
-#include "AliAnalysisTaskSE.h"
-#include "TRandom3.h"
-#include "TH1.h"
-#include "AliLog.h"
-#include "AliV0ReaderV1.h"
-
-class AliAnalysisTaskPi0Reconstruction : public AliV0ReaderV1{
-public:
- AliAnalysisTaskPi0Reconstruction(const char *name);
- virtual ~AliAnalysisTaskPi0Reconstruction();
-
- virtual void UserCreateOutputObjects();
- virtual void UserExec(Option_t *option);
- virtual void Terminate(Option_t *);
-
- // public getter functions
-
- TClonesArray *GetPi0Candidates(){return fPi0Candidates;}
- TClonesArray *GetBGPi0s(){return fBGPi0s;}
- TClonesArray *GetTrueMCPi0s(){return fMCTruePi0s;}
-
-
- // public Set Functions
- void SetBGHandler(AliConversionAODBGHandlerRP *bgHandler);
- void SetDefaultBGHandler();
- void SetDeltaAODBranchName(TString string) { fDeltaAODBranchName = string;AliInfo(Form("Set DeltaAOD BranchName to: %s",fDeltaAODBranchName.Data()));}
- void SetPi0MassRange(Double_t low,Double_t up){Pi0MassRange[0]=low;Pi0MassRange[1]=up;};
- void SetEventMixing(Bool_t k){kEventMixing=k;};
- void SetIsHeavyIon(Bool_t k){fIsHeavyIon=k;};
- void SetUseSatelliteAODs(Bool_t k){kUseSatelliteAODs=k;};
- void SetInvMassRange(Double_t range[2]){Pi0MassRange[0]=range[0];Pi0MassRange[1]=range[1];AliInfo(Form("Set Invariant Mass Range: %f - %f",Pi0MassRange[0],Pi0MassRange[1]));};
- void SetRapidityCut(Double_t maxrapidity){fRapidityCut=maxrapidity;AliInfo(Form(" Rapidity Range for Pi0: %f - %f",-fRapidityCut,fRapidityCut));};
- void SetAlphaCut(Double_t maxalpha){fAlphaCut=maxalpha;AliInfo(Form("Alpha Cut: %f",fAlphaCut));};
- void SetUseOnlyTaggedPhotons(Bool_t ktag){kUseOnlyTaggedPhotons=ktag;}
- void SetNRotations(Int_t nrot){fNRandomEventsForBGRotation=nrot;}
-
-protected:
-
- Bool_t IsMCMesonInReconstructionAcceptance(TParticle *fMCMother);
-
- void FindDeltaAODBranchName();
- void InitializeBGHandler();
-
- void CalculatePi0Candidates();
- void CalculateBackground();
-
- void RotateParticle(AliAODConversionPhoton *gamma=0x0,Double_t angle=0);
-
- Bool_t GetConversionGammas();
- Bool_t GetPHOSGammas();
- Bool_t GetEMCALGammas();
-
- AliVTrack *GetTrack(Int_t label=-1);
- Bool_t IsTruePi0(AliAODConversionMother *);
- Bool_t CheckGamma(AliAODConversionPhoton *gamma=0x0);
- Bool_t CheckPi0(AliAODConversionMother *pi0=0x0,Bool_t IsSignal=kTRUE);
-
- void ProcessMCMesons();
-
- Bool_t IsMCPhotonReconstructed(TParticle *MDaughter);
-
- TString fDeltaAODBranchName;//! File where Gamma Conv AOD is located, if not in default AOD
- AliConversionAODBGHandlerRP *fBGHandler;
-
- Double_t *Pi0MassRange;
- Bool_t kEventMixing;
- Bool_t fIsHeavyIon;
- TRandom3 *fRandomizer;
- Bool_t kUseSatelliteAODs;
- TClonesArray *fPHOSGammas;
- TClonesArray *fEMCALGammas;
- TClonesArray *fPi0Candidates;
- TClonesArray *fBGPi0s;
- TClonesArray *fMCTruePi0s;
- Double_t fRapidityCut;
- Double_t fAlphaCut;
- Bool_t kUseOnlyTaggedPhotons;
- Int_t fNRandomEventsForBGRotation;
-
- // Histograms
-
- TH1F *hPi0Cuts;
- TH1F *hPi0BGCuts;
- TH1F *hPi0Alpha;
- TH1F *hPi0AlphaRejected;
- TH1F *hPi0OpeningAngle;
- TH1F *hPi0OpeningAngleRejected;
- TH1F *hPi0Rapidity;
- TH1F *hPi0RapidityRejected;
- TH1F **hPi0TRUE;
- TH2F **hPi0RECOTRUE;
-
- TH3F *hPool;
-
- AliAnalysisTaskPi0Reconstruction(const AliAnalysisTaskPi0Reconstruction&); // not implemented
- AliAnalysisTaskPi0Reconstruction& operator=(const AliAnalysisTaskPi0Reconstruction&); // not implemented
-
- ClassDef(AliAnalysisTaskPi0Reconstruction, 1); // example of analysis
-};
-
-#endif
-
+++ /dev/null
-#include <exception>
-#include "TChain.h"
-#include "TTree.h"
-#include "TVector3.h"
-#include "TCanvas.h"
-#include "TRandom3.h"
-#include "TH2.h"
-#include "TH1.h"
-#include "TH3.h"
-
-#include "AliLog.h"
-#include "AliAnalysisTask.h"
-#include "AliAnalysisManager.h"
-#include "AliAnalysisTaskPi0v2.h"
-
-#include "AliESDEvent.h"
-#include "AliAODEvent.h"
-#include "AliEventplane.h"
-#include "AliCentrality.h"
-#include <iostream>
-
-
-// Author Daniel Lohner (Daniel.Lohner@cern.ch)
-
-using namespace std;
-
-ClassImp(AliAnalysisTaskPi0v2)
-
-
-//________________________________________________________________________
- AliAnalysisTaskPi0v2::AliAnalysisTaskPi0v2(const char *name) : AliAnalysisTaskPi0Reconstruction(name),
- fNBinsPhi(1)
-{
-
- // Define input and output slots here
- DefineInput(0, TChain::Class());
- DefineOutput(1, TList::Class());
-}
-
-//________________________________________________________________________
-AliAnalysisTaskPi0v2::~AliAnalysisTaskPi0v2(){
-
-}
-
-//________________________________________________________________________
-void AliAnalysisTaskPi0v2::UserCreateOutputObjects()
-{
- // Create histograms
-
- AliAnalysisTaskPi0Reconstruction::UserCreateOutputObjects();
-
- TList *fESDList=new TList();
- fESDList->SetName("ESD histograms");
- fESDList->SetOwner(kTRUE);
- fOutputList->Add(fESDList);
- TList *fBGList=new TList();
- fBGList->SetName("Background histograms");
- fBGList->SetOwner(kTRUE);
- fOutputList->Add(fBGList);
-
- //Adding the histograms to the output container
- Int_t kGCnXBinsSpectra = Int_t((Pi0MassRange[1]-Pi0MassRange[0])*500); //500 for range 0 - 1
- Double_t kGCfirstXBinSpectra = Pi0MassRange[0];
- Double_t kGClastXBinSpectra = Pi0MassRange[1];
-
- Int_t kGCnYBinsSpectra = 250;
- Double_t kGCfirstYBinSpectra = 0.;
- Double_t kGClastYBinSpectra = 25.;
-
- hInvMassPt=new TH2F("ESD_Mother_InvMass_vs_Pt","ESD Invariant Mass vs Pt",kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra);
- hInvMassPt->Sumw2();
- fESDList->Add(hInvMassPt);
- hInvMass=new TH1F("ESD_Mother_InvMass","ESD Invariant Mass",kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra);
- hInvMass->Sumw2();
- fESDList->Add(hInvMass);
- hBGPt=new TH2F("ESD_Background_InvMass_vs_Pt","ESD Invariant Mass vs Pt",kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra);
- hBGPt->Sumw2();
- fBGList->Add(hBGPt);
- hBG=new TH1F("ESD_Background_InvMass","ESD Invariant Mass",kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra);
- hBG->Sumw2();
- fBGList->Add(hBG);
-
- hInvMassmphi=new TH2F**[fNBinsPhi];
- hBGmphi=new TH2F**[fNBinsPhi];
- for(Int_t phi=0;phi<fNBinsPhi;phi++){
- hInvMassmphi[phi]=new TH2F*[fNCentralityBins];
- hBGmphi[phi]=new TH2F*[fNCentralityBins];
- for(Int_t m=0;m<fNCentralityBins;m++){
- hInvMassmphi[phi][m]=new TH2F(Form("%d%dESD_Mother_InvMass_vs_Pt",phi,m),"ESD Invariant Mass vs Pt",kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra);
- hInvMassmphi[phi][m]->Sumw2();
- fESDList->Add(hInvMassmphi[phi][m]);
- hBGmphi[phi][m]=new TH2F(Form("%d%dESD_Background_InvMass_vs_Pt",phi,m),"ESD Invariant Mass vs Pt",kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra);
- hBGmphi[phi][m]->Sumw2();
- fBGList->Add(hBGmphi[phi][m]);
- }
- }
-
- hInclv2PtInvMassCentrality=new TH2F*[fNCentralityBins];
-
- for(Int_t m=0;m<fNCentralityBins;m++){
- hInclv2PtInvMassCentrality[m]=new TH2F(Form("%dInclv2_vs_MInv_vs_Pt",m),"" , kGCnXBinsSpectra, kGCfirstXBinSpectra, kGClastXBinSpectra,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra);
- hInclv2PtInvMassCentrality[m]->Sumw2();
- fESDList->Add(hInclv2PtInvMassCentrality[m]);
- }
-
- // RP Calculation
- TList *fRPList=new TList();
- fRPList->SetName("Reaction Plane");
- fRPList->SetOwner(kTRUE);
- fOutputList->Add(fRPList);
-
- hRP=new TH1F("RP" ,"Reaction Plane Angle" , 360, 0, TMath::Pi());
- fRPList->Add(hRP);
- hRPCentrality=new TH2F("RP_Centrality" ,"Reaction Plane Angle" , 20, 0.001,100.001, 180, 0, TMath::Pi());
- fRPList->Add(hRPCentrality);
- hRPSubevents=new TH2F("RP_Subevents" ,"Reaction Plane Angle" , 180, 0, TMath::Pi(), 180, 0, TMath::Pi());
- fRPList->Add(hRPSubevents);
- hRPDeltaRP=new TH2F("DeltaRP_Centrality" ,"Delta Reaction Plane Angle" , 100, -TMath::Pi()/2, TMath::Pi()/2,20,0.001,100.001);
- fRPList->Add(hRPDeltaRP);
- hRPCosDeltaRP=new TH2F("Cos(DeltaRP)" ,"" , 20, 0.001,100.001,110,-1.1,1.1); // range -1.1 - 1.1 else cos(0) will go to the overflow bin!!!!!
- fRPList->Add(hRPCosDeltaRP);
-
- // Other
- TList *fOtherList=new TList();
- fOtherList->SetName("Charged");
- fOtherList->SetOwner(kTRUE);
- fOutputList->Add(fOtherList);
-
- hChargedPt=new TH1F*[fNCentralityBins];
-
- for(Int_t m=0;m<fNCentralityBins;m++){
- hChargedPt[m]=new TH1F(Form("ChargedSpectrum_Pt_%d",m),"Charged Pt",kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra);
- hChargedPt[m]->Sumw2();
- fOtherList->Add(hChargedPt[m]);
-
- }
-
- // Gamma
-
- TList *fGammaList=new TList();
- fGammaList->SetName("Gammav2");
- fGammaList->SetOwner(kTRUE);
- fOutputList->Add(fGammaList);
-
- hGammav2=new TH2F*[fNCentralityBins];
-
- for(int i=0;i<fNCentralityBins;i++){
- hGammav2[i]=new TH2F(Form("%d_Gamma_v2_vs_Pt",i) ,Form("%d_Gamma_v2_vs_Pt",i),kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,6,0,TMath::Pi()/2);
- hGammav2[i]->Sumw2();
- fGammaList->Add(hGammav2[i]);
- }
-
- PostData(1, fOutputList);
-}
-
-//________________________________________________________________________
-void AliAnalysisTaskPi0v2::UserExec(Option_t *)
-{
-
- AliAnalysisTaskPi0Reconstruction::UserExec("");
-
-
- // Event Selection
- if(fEventIsSelected){
-
- ProcessChargedParticles();
-
- ProcessGammas();
-
- ProcessPi0s();
-
- ProcessEventPlaneResolution();
-
- }
-
-
- PostData(1, fOutputList);
-}
-
-//________________________________________________________________________
-void AliAnalysisTaskPi0v2::ProcessChargedParticles()
-{
- AliVParticle *track=0x0;
-
- for(Int_t ii=0;ii<fInputEvent->GetNumberOfTracks();ii++){
- track=fInputEvent->GetTrack(ii);
- hChargedPt[fCentralityBin]->Fill(track->Pt());
- }
-}
-
-//________________________________________________________________________
-void AliAnalysisTaskPi0v2::ProcessGammas(){
-
- // Process Reconstructed Gammas
-
- for(Int_t firstGammaIndex=0;firstGammaIndex<fConversionGammas->GetEntriesFast();firstGammaIndex++){
-
- AliAODConversionPhoton *gamma=dynamic_cast<AliAODConversionPhoton*>(fConversionGammas->At(firstGammaIndex));
-
- // Gamma Phi wrt EP
-
- Double_t phiwrt=TMath::ACos(TMath::Abs(TMath::Cos(gamma->Phi()-fEPAngle)));
- hGammav2[fCentralityBin]->Fill(gamma->Pt(),phiwrt);
- }
-
-}
-
-
-//________________________________________________________________________
-void AliAnalysisTaskPi0v2::ProcessPi0s(){
-
-
- for(Int_t ii=0;ii<fPi0Candidates->GetEntriesFast();ii++){
-
- AliAODConversionMother *pi0cand=dynamic_cast<AliAODConversionMother*>(fPi0Candidates->At(ii));
-
- hInvMassPt->Fill(pi0cand->M() ,pi0cand->Pt());
- hInvMass->Fill(pi0cand->M());
-
- hInclv2PtInvMassCentrality[fCentralityBin]->Fill(pi0cand->M(),pi0cand->Pt(),TMath::Cos(2*(pi0cand->Phi()-fEPAngle)));
-
- Int_t phibin=GetPhiBin(pi0cand->Phi()-fEPAngle);
- if(!(phibin<0||phibin>=fNBinsPhi)){
- hInvMassmphi[phibin][fCentralityBin]->Fill(pi0cand->M(),pi0cand->Pt());}
-
-
- }
-
- ProcessBGPi0s();
-}
-
-//________________________________________________________________________
-void AliAnalysisTaskPi0v2::Terminate(Option_t *)
-{
-
- // Draw result to the screen
- fOutputList->Print();
- // Called once at the end of the query
-}
-
-
-//________________________________________________________________________
-void AliAnalysisTaskPi0v2::ProcessBGPi0s(){
-
- for(Int_t ii=0;ii<fBGPi0s->GetEntriesFast();ii++){
-
- AliAODConversionMother *pi0candidate=dynamic_cast<AliAODConversionMother*>(fBGPi0s->At(ii));
-
- hBGPt->Fill(pi0candidate->M(),pi0candidate->Pt(),pi0candidate->GetWeight());
- hBG->Fill(pi0candidate->M(),pi0candidate->GetWeight());
-
- Int_t phibin=GetPhiBin(pi0candidate->Phi()-fEPAngle);
- if(!(phibin<0||phibin>=fNBinsPhi)){
- hBGmphi[phibin][fCentralityBin]->Fill(pi0candidate->M(),pi0candidate->Pt(),pi0candidate->GetWeight()); }
- }
-}
-
-
-//________________________________________________________________________
-void AliAnalysisTaskPi0v2::ProcessEventPlaneResolution()
-{
- AliEventplane *fEP=GetEventPlane();
-
- if(!fEP||!fEP->GetQsub1()||!fEP->GetQsub2()) return;
-
- // Subevents for Resolution
-
- Double_t fPsiRP1=fEP->GetQsub1()->Phi()/2;
- Double_t fPsiRP2=fEP->GetQsub2()->Phi()/2;
-
- // Calculations for Resolution
- Double_t fDeltaPsiRP=fPsiRP1-fPsiRP2;
-
- // reactionplaneangle + Pi() is the same angle
- if(TMath::Abs(fDeltaPsiRP)>TMath::Pi()/2){
- if(fDeltaPsiRP>0)fDeltaPsiRP-=TMath::Pi();
- else fDeltaPsiRP+=TMath::Pi();
- }
-
- Double_t cos2deltaRP=TMath::Cos(2*fDeltaPsiRP);
-
- // FillHistograms
- hRPSubevents->Fill(fPsiRP1,fPsiRP2);
- hRP->Fill(fEPAngle);
- hRPCentrality->Fill(fCentrality,fEPAngle);
- hRPDeltaRP->Fill(fDeltaPsiRP,fCentrality);
- //hRPQxQy->Fill(mQx,mQy);
- hRPCosDeltaRP->Fill(fCentrality,cos2deltaRP);
-
-}
-
-
- //________________________________________________________________________
-Int_t AliAnalysisTaskPi0v2::GetPhiBin(Double_t phi)
-{
- Int_t phibin=-1;
-
-
- if(!(TMath::Abs(phi)>=0&&TMath::Abs(phi)<=2*TMath::Pi())){AliError("phi w.r.t. RP out of defined range");return -1;}
-
- Double_t phiwrtrp=TMath::ACos(TMath::Abs(TMath::Cos(phi)));
-
- phibin=Int_t(fNBinsPhi*phiwrtrp/(0.5*TMath::Pi()));
-
- if(phibin==-1){AliError("Phi Bin not defined");}
- return phibin;
-}
+++ /dev/null
-#ifndef AliAnalysisTaskPi0v2_cxx
-#define AliAnalysisTaskPi0v2_cxx
-
-#include "AliAODConversionPhoton.h"
-#include "AliAODConversionMother.h"
-#include "AliESDtrack.h"
-
-#include "AliAnalysisTaskSE.h"
-#include "TRandom3.h"
-#include "TH1.h"
-#include "AliLog.h"
-#include "AliV0ReaderV1.h"
-#include "AliAnalysisTaskPi0Reconstruction.h"
-using namespace std;
-
-class AliAnalysisTaskPi0v2 : public AliAnalysisTaskPi0Reconstruction {
-
-public:
- AliAnalysisTaskPi0v2(const char *name);
- virtual ~AliAnalysisTaskPi0v2();
-
- virtual void UserCreateOutputObjects();
- virtual void UserExec(Option_t *option);
- virtual void Terminate(Option_t *);
-
- void SetNBinsPhi(Int_t nphibins){fNBinsPhi=nphibins;}
-
-private:
-
- void ProcessGammas();
- void ProcessPi0s();
- void ProcessBGPi0s();
-
- void ProcessChargedParticles();
- void ProcessEventPlaneResolution();
-
- Int_t GetPhiBin(Double_t phi);
-
- Int_t fNBinsPhi;
-
- // Histograms
-
- TH2F ***hInvMassmphi;
- TH2F ***hBGmphi;
- TH2F *hInvMassPt;
- TH1F *hInvMass;
- TH2F *hBGPt;
- TH1F *hBG;
-
- TH1F **hPi0TRUE;
- TH2F **hPi0RECOTRUE;
-
- // RP
- TH1F *hRP;
- TH2F *hRPCentrality;
- TH2F *hRPSubevents;
- TH1F *hRPTrackCuts;
- TH3F *hRPPhiTracks;
- TH2F *hRPDeltaRP;
- TH2F *hRPQxQy;
- TH2F *hRPCosDeltaRP;
-
- // Others
- TH2F **hInclv2PtInvMassCentrality;
-
- TH1F **hChargedPt;
-
- // Gamma
- TH2F **hGammav2;
-
-
-
- AliAnalysisTaskPi0v2(const AliAnalysisTaskPi0v2&); // not implemented
- AliAnalysisTaskPi0v2& operator=(const AliAnalysisTaskPi0v2&); // not implemented
-
- ClassDef(AliAnalysisTaskPi0v2, 2); // example of analysis
-};
-
-#endif
-
+++ /dev/null
-#if !defined( __CINT__) || defined(__MAKECINT__)
-
-#include <exception>
-#include <iostream>
-#include "AliLog.h"
-#include "AliConversionAODBGHandlerRP.h"
-using namespace std;
-#endif
-
-
-// Author Daniel Lohner (Daniel.Lohner@cern.ch)
-
-
-ClassImp(AliConversionAODBGHandlerRP)
-
-AliConversionAODBGHandlerRP::AliConversionAODBGHandlerRP() :
- fNEvents(20),
- fBGEventCounter(NULL),
- fNBGEvents(NULL),
- fNBinsZ(7),
- fNBinsCentrality(6),
- fNBinsRP(6),
- fBinLimitsArrayZ(NULL),
- fBinLimitsArrayCentrality(NULL),
- fBinLimitsArrayRP(NULL),
- fBGEvents(fNBinsRP,AliGammaConversionVertexPositionVector(fNBinsZ,AliGammaConversionCentralityVector(fNBinsCentrality,AliGammaConversionBGEventVector(fNEvents))))
-{
- // Default Constructor
-
- // CentralityBins
- fBinLimitsArrayCentrality= new Double_t[fNBinsCentrality+1];
-
- fBinLimitsArrayCentrality[0] = 0;
- fBinLimitsArrayCentrality[1] = 5;
- fBinLimitsArrayCentrality[2] = 10;
- fBinLimitsArrayCentrality[3] = 20;
- fBinLimitsArrayCentrality[4] = 40;
- fBinLimitsArrayCentrality[5] = 60;
- fBinLimitsArrayCentrality[6] = 90;
-
- // Vertex Z Binning
-
- fBinLimitsArrayZ = new Double_t[fNBinsZ+1];
-
- fBinLimitsArrayZ[0] = -10;
- fBinLimitsArrayZ[1] = -5.4;
- fBinLimitsArrayZ[2] = -2.8;
- fBinLimitsArrayZ[3] = -0.6;
- fBinLimitsArrayZ[4] = 1.4;
- fBinLimitsArrayZ[5] = 3.5;
- fBinLimitsArrayZ[6] = 6.1;
- fBinLimitsArrayZ[7] = 10;
-
- // Initialize
-
- Initialize();
-
-}
-
-AliConversionAODBGHandlerRP::AliConversionAODBGHandlerRP(Int_t NEvents,Int_t NBinsZ,Double_t *BinLimitsZ,Int_t NBinsCentrality,Double_t *BinLimitsCentrality,Int_t NBinsRP) :
-fNEvents(NEvents),
-fBGEventCounter(NULL),
-fNBGEvents(NULL),
-fNBinsZ(NBinsZ),
-fNBinsCentrality(NBinsCentrality),
-fNBinsRP(NBinsRP),
-fBinLimitsArrayZ(BinLimitsZ),
-fBinLimitsArrayCentrality(BinLimitsCentrality),
-fBinLimitsArrayRP(NULL),
-fBGEvents(fNBinsRP,AliGammaConversionVertexPositionVector(fNBinsZ,AliGammaConversionCentralityVector(fNBinsCentrality,AliGammaConversionBGEventVector(fNEvents))))
-{
- Initialize();
-}
-
-
-AliConversionAODBGHandlerRP::~AliConversionAODBGHandlerRP()
-{
- if(fBinLimitsArrayZ){
- delete[] fBinLimitsArrayZ;
- fBinLimitsArrayZ=0x0;}
- if(fBinLimitsArrayCentrality){
- delete[] fBinLimitsArrayCentrality;
- fBinLimitsArrayCentrality=0x0;}
- if(fBinLimitsArrayRP){
- delete[] fBinLimitsArrayRP;
- fBinLimitsArrayRP=0x0;}
-
- if(fBGEventCounter){
-
- for(Int_t psi=0;psi<fNBinsRP;psi++){
- for(Int_t z=0;z<fNBinsZ;z++){
- delete[] fBGEventCounter[psi][z];
- }
- delete[] fBGEventCounter[psi];
- }
- delete[] fBGEventCounter;
- fBGEventCounter = NULL;
- }
-
- // Delete pool
-
- for(Int_t psi=0;psi<fNBinsRP;psi++){
- for(Int_t z=0;z<fNBinsZ;z++){
- for(Int_t m=0;m<fNBinsCentrality;m++){
- for(Int_t eventCounter=0;eventCounter<fNBGEvents[psi][z][m]&&eventCounter<fNEvents;eventCounter++){
-
- for(UInt_t d=0;d<fBGEvents[psi][z][m][eventCounter].size();d++){
- delete (AliAODConversionPhoton*)(fBGEvents[psi][z][m][eventCounter][d]);
- }
- }
- }
- }
- }
-
- if(fNBGEvents){
- for(Int_t psi=0;psi<fNBinsRP;psi++){
- for(Int_t z=0;z<fNBinsZ;z++){
- delete[] fNBGEvents[psi][z];
- }
- delete[] fNBGEvents[psi];
- }
- delete[] fNBGEvents;
- fNBGEvents = NULL;
- }
-
-
-}
-
-
-void AliConversionAODBGHandlerRP::Initialize(){
-
- // RP Binning
-
- fBinLimitsArrayRP=new Double_t[fNBinsRP+1];
-
- for(Int_t i=0;i<fNBinsRP+1;i++){
- fBinLimitsArrayRP[i] = i*TMath::Pi()/fNBinsRP;
- }
-
- // Counter
-
- if(fBGEventCounter == NULL){
- fBGEventCounter= new Int_t**[fNBinsRP];
- }
- for(Int_t psi=0;psi<fNBinsRP;psi++){
- fBGEventCounter[psi]= new Int_t*[fNBinsZ];
-
- for(Int_t z=0;z<fNBinsZ;z++){
- fBGEventCounter[psi][z]=new Int_t[fNBinsCentrality];
- }
- }
- for(Int_t psi=0;psi<fNBinsRP;psi++){
- for(Int_t z=0;z<fNBinsZ;z++){
- for(Int_t m=0;m<fNBinsCentrality;m++){
- fBGEventCounter[psi][z][m]=0;
- }
- }
- }
-
-
- if(fNBGEvents == NULL){
- fNBGEvents= new Int_t**[fNBinsRP];
- }
- for(Int_t psi=0;psi<fNBinsRP;psi++){
- fNBGEvents[psi]= new Int_t*[fNBinsZ];
-
- for(Int_t z=0;z<fNBinsZ;z++){
- fNBGEvents[psi][z]=new Int_t[fNBinsCentrality];
- }
- }
- for(Int_t psi=0;psi<fNBinsRP;psi++){
- for(Int_t z=0;z<fNBinsZ;z++){
- for(Int_t m=0;m<fNBinsCentrality;m++){
- fNBGEvents[psi][z][m]=0;
- }
- }
- }
-
-}
-
-//-------------------------------------------------------------
-
-Int_t AliConversionAODBGHandlerRP::GetZBinIndex(Double_t zvalue) const{
- // see header file for documantation
- if(fNBinsZ<2 || zvalue<=fBinLimitsArrayZ[0]){
- return 0;
- }
-
- for(Int_t i=0; i<fNBinsZ ;i++){
- if(zvalue >= fBinLimitsArrayZ[i] && zvalue <= fBinLimitsArrayZ[i+1]){
- return i;
- }
- }
- return -1;
-}
-//-------------------------------------------------------------
-Int_t AliConversionAODBGHandlerRP::GetCentralityBinIndex(Int_t multiplicity) const{
- if(fNBinsCentrality<2){
- return 0;
- }
-
- for(Int_t i=0; i<fNBinsCentrality ;i++){
- if(multiplicity >= fBinLimitsArrayCentrality[i] && multiplicity < fBinLimitsArrayCentrality[i+1]){
- return i;
- }
- }
- return -1;
-}
-
-//-------------------------------------------------------------
-
-Int_t AliConversionAODBGHandlerRP::GetRPBinIndex(Double_t psivalue) const{
-
- if(fNBinsRP<2 || psivalue<=fBinLimitsArrayRP[0]){
- return 0;
- }
-
- for(Int_t i=0; i<fNBinsRP ;i++){
- if(psivalue >= fBinLimitsArrayRP[i] && psivalue <= fBinLimitsArrayRP[i+1]){
- return i;
- }
- }
- return -1;
-}
-
-
-//-------------------------------------------------------------
-void AliConversionAODBGHandlerRP::AddEvent(TClonesArray * const eventGammas,Double_t psivalue,Double_t zvalue, Int_t multiplicity){
-
-
- Int_t z = GetZBinIndex(zvalue);
- Int_t m = GetCentralityBinIndex(multiplicity);
- Int_t psi=GetRPBinIndex(psivalue);
-
- // If Event Stack is full, replace the first entry (First in first out)
- if(fBGEventCounter[psi][z][m] >= fNEvents){
- fBGEventCounter[psi][z][m]=0;
- }
-
- // Update number of Events stored
- if(fNBGEvents[psi][z][m] < fNEvents){
- fNBGEvents[psi][z][m]++;
- }
-
-
- Int_t eventCounter=fBGEventCounter[psi][z][m];
-
- //clear the vector for old gammas
- for(UInt_t d=0;d<fBGEvents[psi][z][m][eventCounter].size();d++){
- delete (AliAODConversionPhoton*)(fBGEvents[psi][z][m][eventCounter][d]);
- }
-
- fBGEvents[psi][z][m][eventCounter].clear();
-
-
- // add the gammas to the vector
-
- for(Int_t i=0; i< eventGammas->GetEntriesFast();i++){
- fBGEvents[psi][z][m][eventCounter].push_back(new AliAODConversionPhoton(*(AliAODConversionPhoton*)(eventGammas->At(i))));
- }
-
- fBGEventCounter[psi][z][m]++;
-
-
-}
-
-//-------------------------------------------------------------
-AliGammaConversionPhotonVector* AliConversionAODBGHandlerRP::GetBGGoodGammas(Int_t psi,Int_t zbin, Int_t mbin, Int_t event){
- //see headerfile for documentation
- return &(fBGEvents[psi][zbin][mbin][event]);
-}
-
+++ /dev/null
-#ifndef __ALICONVERSIONAODBGHANDLERRP_H__
-#define __ALICONVERSIONAODBGHANDLERRP_H__
-
-#include "AliLog.h"
-#include "TObject.h"
-#include "AliAODConversionPhoton.h"
-#include "TClonesArray.h"
-using namespace std;
-
-typedef vector<AliAODConversionPhoton*> AliGammaConversionPhotonVector;
-
-class AliConversionAODBGHandlerRP: public TObject{
-
-public:
-
- AliConversionAODBGHandlerRP();
- AliConversionAODBGHandlerRP(Int_t NEvents,Int_t NBinsZ,Double_t *BinLimitsZ,Int_t NBinsCentrality,Double_t *BinLimitsCentrality,Int_t NBinsRP);
-
-
-virtual ~AliConversionAODBGHandlerRP();
-
-
-Int_t GetZBinIndex(Double_t z) const;
-Int_t GetCentralityBinIndex(Int_t mult) const;
-Int_t GetRPBinIndex(Double_t psi) const;
-void Initialize();
-
-typedef vector<AliGammaConversionPhotonVector> AliGammaConversionBGEventVector; // Event contains vector of gammas (AliConversionPhotons)
-typedef vector<AliGammaConversionBGEventVector> AliGammaConversionCentralityVector; // Centrality classes containing event vectors
-typedef vector<AliGammaConversionCentralityVector> AliGammaConversionVertexPositionVector; // z vertex position ...
-typedef vector<AliGammaConversionVertexPositionVector> AliGammaConversionBGVector; // RP angle
-
-
-AliGammaConversionPhotonVector* GetBGGoodGammas(Int_t psi,Int_t zbin, Int_t mbin, Int_t event);
-void AddEvent(TClonesArray * const eventGammas, Double_t psi,Double_t zvalue, Int_t multiplicity);
-Int_t GetNBGEvents()const {return fNEvents;} // Size of the Pool (20)
-Int_t GetNBGEvents(Int_t psi,Int_t z,Int_t m)const{if(z<fNBinsZ&&m<fNBinsCentrality){return fNBGEvents[psi][z][m];}else{AliError(Form("Requested BG pool does not exist: z %i m %i psi %i",z,m,psi));return 0;}};
-Int_t GetNZBins()const{return fNBinsZ;};
-Int_t GetNRPBins()const{return fNBinsRP;};
-Int_t GetNCentralityBins()const{return fNBinsCentrality;};
-
-private:
-
- Int_t fNEvents;
- Int_t *** fBGEventCounter; //! bg counter
- Int_t *** fNBGEvents;
- Int_t fNBinsZ; //n z bins
- Int_t fNBinsCentrality; //n bins multiplicity
- Int_t fNBinsRP;
- Double_t *fBinLimitsArrayZ;//! bin limits z array
- Double_t *fBinLimitsArrayCentrality;//! bin limit multiplicity array
- Double_t *fBinLimitsArrayRP;
- AliGammaConversionBGVector fBGEvents; //background events
-
-
- ClassDef(AliConversionAODBGHandlerRP,0);
-
-};
-#endif
+++ /dev/null
-#include "AliV0ReaderV1.h"
-#include "AliKFParticle.h"
-#include "AliAODv0.h"
-#include "AliESDv0.h"
-#include "AliAODEvent.h"
-#include "AliESDEvent.h"
-#include "AliKFParticle.h"
-#include "AliKFConversionPhoton.h"
-#include "AliAODConversionPhoton.h"
-#include "AliConversionPhotonBase.h"
-#include "TVector.h"
-#include "AliKFVertex.h"
-#include "AliAODTrack.h"
-#include "AliESDtrack.h"
-#include "AliAnalysisManager.h"
-#include "AliInputEventHandler.h"
-#include "AliAODHandler.h"
-#include "AliPIDResponse.h"
-#include "TH1.h"
-#include "TH2.h"
-#include "TChain.h"
-#include "AliStack.h"
-
-class iostream;
-
-
-using namespace std;
-
-ClassImp(AliV0ReaderV1)
-
-//________________________________________________________________________
-AliV0ReaderV1::AliV0ReaderV1(const char *name) : AliAnalysisTaskSE(name),
-fConversionGammas(NULL),
-fESDEvent(NULL),
-fAODEvent(NULL),
-fMCStack(NULL),
-fOutputList(NULL),
-fCurrentMotherKFCandidate(NULL),
-fCurrentPositiveKFParticle(NULL),
-fCurrentNegativeKFParticle(NULL),
-fCurrentTrackLabels(NULL),
-fCurrentV0Index(-1),
-fNCentralityBins(5),
- fCentralityBin(0),
- fBGHandler(NULL),
- fVertexZ(-999),
- fCentrality(-1),
- fEPAngle(-1),
-fMaxVertexZ(10),
-fMaxR(180),// 100 meter(outside of ALICE)
-fMinR(5),// 100 meter(outside of ALICE)
-fEtaCut(0.9),
-fEtaCutMin(-0.1),
-fPtCut(0.),
-fSinglePtCut(0.),
-fMaxZ(240),
-fMinClsTPC(0.),
-fMinClsTPCToF(0.),
-fLineCutZRSlope(0.),
-fLineCutZValue(7),
-fLineCutZRSlopeMin(0.),
-fLineCutZValueMin(-2),
-fChi2CutConversion(30),
-fPIDProbabilityCutNegativeParticle(0),
-fPIDProbabilityCutPositiveParticle(0),
-fDodEdxSigmaCut(kTRUE),
-fDoTOFsigmaCut(kFALSE), // RRnewTOF
-fPIDTRDEfficiency(0.95),
-fDoTRDPID(kFALSE),
-fPIDnSigmaAboveElectronLine(5),
-fPIDnSigmaBelowElectronLine(-3),
-fTofPIDnSigmaAboveElectronLine(100), // RRnewTOF
-fTofPIDnSigmaBelowElectronLine(-100), // RRnewTOF
-fPIDnSigmaAbovePionLine(0),
-fPIDnSigmaAbovePionLineHighPt(-100),
-fPIDMinPnSigmaAbovePionLine(1),
-fPIDMaxPnSigmaAbovePionLine(3),
-fDoKaonRejectionLowP(kTRUE),
- fDoProtonRejectionLowP(kTRUE),
- fDoPionRejectionLowP(kTRUE),
- fPIDnSigmaAtLowPAroundKaonLine(0),
- fPIDnSigmaAtLowPAroundProtonLine(0),
- fPIDnSigmaAtLowPAroundPionLine(0),
- fPIDMinPKaonRejectionLowP(1.5),
- fPIDMinPProtonRejectionLowP(2),
- fPIDMinPPionRejectionLowP(0.5),
- fDoQtGammaSelection(kTRUE),
- fDoHighPtQtGammaSelection(kTRUE), // RRnew
- fQtMax(0.05),
- fHighPtQtMax(0.06), // RRnew
- fPtBorderForQt(2.5), // RRnew
- fNSigmaMass(0.),
- fUseImprovedVertex(kTRUE),
- fUseOwnXYZCalculation(kTRUE),
- fUseConstructGamma(kFALSE),
- fUseEtaMinCut(kFALSE),
- fUseOnFlyV0Finder(kTRUE),
- fDoPhotonAsymmetryCut(kTRUE),
- fMinPPhotonAsymmetryCut(100.),
-fMinPhotonAsymmetry(0.),
- kUseAODConversionPhoton(kFALSE),
- fIsHeavyIon(kTRUE),
- fCreateAOD(kFALSE),
- fDeltaAODFilename("AliAODGammaConversion.root")
-{
-
- fLineCutZRSlope=tan(2*atan(exp(-fEtaCut)));
- // Input slot #0 works with a TChain
- DefineInput(0, TChain::Class());
- // Output slot #0 id reserved by the base class for AOD
- // Output slot #1 writes into a TH1 container
- DefineOutput(1, TList::Class());
-
- fCurrentTrackLabels=new Int_t[2];
-}
-
-
-//________________________________________________________________________
-AliV0ReaderV1::~AliV0ReaderV1()
-{
- if(fConversionGammas){
- fConversionGammas->Delete();// Clear Objects
- delete fConversionGammas;
- fConversionGammas=0x0;
- }
-
- if(fCurrentTrackLabels){
- delete[] fCurrentTrackLabels;
- fCurrentTrackLabels=NULL;}
-
-}
-
-//________________________________________________________________________
-void AliV0ReaderV1::UserCreateOutputObjects()
-{
-
-if(fOutputList != NULL){
- delete fOutputList;
- fOutputList = NULL;
- }
- if(fOutputList == NULL){
- fOutputList = new TList();
- fOutputList->SetOwner(kTRUE);
- }
-
- TList *fCutList=new TList();
- fCutList->SetName("GammaReconstruction");
- fCutList->SetOwner(kTRUE);
- fOutputList->Add(fCutList);
-
-//GammaMass-plots
-Int_t kGCnXBinsGammaMass = 4000;
-Double_t kGCfirstXBinGammaMass= 0.;
-Double_t kGClastXBinGammaMass = 1.;
-
- Int_t kGCnYBinsSpectra = 250;
- Double_t kGCfirstYBinSpectra = 0.;
- Double_t kGClastYBinSpectra = 25.;
-
-// Process Gammas Histograms
-
-hV0CurrentFinder=new TH1F("ESD_V0sCurrentFinder_InvMass","V0sCurrentFinder",kGCnXBinsGammaMass,kGCfirstXBinGammaMass,kGClastXBinGammaMass);
-fCutList->Add(hV0CurrentFinder);
-hV0AllArmenteros=new TH2F("ESD_V0sCurrentFinder_Armenteros","Armenteros Alpha Qt",200,-1,1,250,0,0.25);
-fCutList->Add(hV0AllArmenteros);
-hV0Good=new TH1F("ESD_GoodV0s_InvMass","GoodV0s",kGCnXBinsGammaMass,kGCfirstXBinGammaMass,kGClastXBinGammaMass);
-fCutList->Add(hV0Good);
-hV0GoodArmenteros=new TH2F("ESD_GoodV0s_Armenteros","Armenteros Alpha Qt",200,-1,1,250,0,0.25);
-fCutList->Add(hV0GoodArmenteros);
-
-
-// Track Cuts
-hV0CutLikeSign=new TH1F("ESD_CutLikeSign_InvMass","LikeSign",kGCnXBinsGammaMass,kGCfirstXBinGammaMass,kGClastXBinGammaMass);
-fCutList->Add(hV0CutLikeSign);
-hV0CutRefit=new TH1F("ESD_CutRefit_InvMass","No TPC refit",kGCnXBinsGammaMass,kGCfirstXBinGammaMass,kGClastXBinGammaMass);
-fCutList->Add(hV0CutRefit);
-hV0CutKinks=new TH1F("ESD_CutKink_InvMass","Kinks",kGCnXBinsGammaMass,kGCfirstXBinGammaMass,kGClastXBinGammaMass);
-fCutList->Add(hV0CutKinks);
-hV0CutMinNclsTPCToF=new TH1F("ESD_CutMinNClsTPCToF_InvMass","Min Ncls TPC ToF",kGCnXBinsGammaMass,kGCfirstXBinGammaMass,kGClastXBinGammaMass);
-fCutList->Add(hV0CutMinNclsTPCToF);
-
-// Event Cuts
-/*hV0CutNContributors=new TH1F("ESD_CutNContributors_InvMass","NContributors<=0",kGCnXBinsGammaMass,kGCfirstXBinGammaMass,kGClastXBinGammaMass);
-fCutList->Add(hV0CutNContributors);
-hV0CutVertexZ=new TH1F("ESD_CutVertexZ_InvMass","VertexZ",kGCnXBinsGammaMass,kGCfirstXBinGammaMass,kGClastXBinGammaMass);
-fCutList->Add(hV0CutVertexZ);
-*/
-
-
-// dEdx Cuts
-
-hV0CutdEdxElectron=new TH1F("ESD_CutdEdxSigmaElectronLine_InvMass" ,"dedx ElectronLine" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass);
-fCutList->Add(hV0CutdEdxElectron);
-hV0CutdEdxPion=new TH1F("ESD_CutdEdxSigmaPionLine_InvMass" ,"dedx PionLine" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass);
-fCutList->Add(hV0CutdEdxPion);
-hV0CutdEdxKaonLowP=new TH1F("ESD_CutKaonRejectionLowP_InvMass" ,"dedx KaonRejection LowP" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass);
-fCutList->Add(hV0CutdEdxKaonLowP);
-hV0CutdEdxProtonLowP=new TH1F("ESD_CutProtonRejectionLowP_InvMass" ,"dedx ProtonRejection LowP" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass);
-fCutList->Add(hV0CutdEdxProtonLowP);
-hV0CutdEdxPionLowP=new TH1F("ESD_CutPionRejectionLowP_InvMass" ,"dedx PionRejection LowP" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass);
-fCutList->Add(hV0CutdEdxPionLowP);
-hV0CutdEdxTOFElectron=new TH1F("ESD_CutTOFsigmaElec_InvMass", "ESD_CutTOFsigmaElec_InvMass",kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass);
-fCutList->Add(hV0CutdEdxTOFElectron);
-hV0CutdEdxTRD=new TH1F("ESD_CutTRD_InvMass", "ESD_CutTRD_InvMass",kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass);
-fCutList->Add(hV0CutdEdxTRD);
-hGammadEdxbefore=new TH2F("Gamma_dEdx_before","dEdx Gamma before" ,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,400, 0,200);
-fCutList->Add(hGammadEdxbefore);
-hGammadEdxafter=new TH2F("Gamma_dEdx_after","dEdx Gamma after" ,kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,400, 0,200);
-fCutList->Add(hGammadEdxafter);
-
-
-// Armenteros
-
-hV0CutQt=new TH1F("ESD_CutQt_InvMass","ESD_CutQt_InvMass",kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass);
-fCutList->Add(hV0CutQt);
-
-// Kinematic Cuts
-
-hV0CutR=new TH1F("ESD_CutR_InvMass" ,"Above RMax" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass);
-fCutList->Add(hV0CutR);
-hV0CutMinR=new TH1F("ESD_CutMinR_InvMass" ,"Above RMax" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass);
-fCutList->Add(hV0CutMinR);
-hV0CutLine=new TH1F("ESD_CutLine_InvMass" ,"Out of reconstruction area" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass);
-fCutList->Add(hV0CutLine);
-hV0CutZ=new TH1F("ESD_CutZ_InvMass" ,"Out of reconstruction area" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass);
-fCutList->Add(hV0CutZ);
-hV0CutEta=new TH1F("ESD_CutEta_InvMass" ,"Above #eta max" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass);
-fCutList->Add(hV0CutEta);
-
-
-hV0CutSinglePt=new TH1F("ESD_CutSinglePt_InvMass" ,"Below p_{t} min" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass);
-fCutList->Add(hV0CutSinglePt);
-hV0CutNDF=new TH1F("ESD_CutNDF_InvMass" ,"#chi^{2} > Max" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass);
-fCutList->Add(hV0CutNDF);
-hV0CutChi2=new TH1F("ESD_CutChi2_InvMass" ,"#chi^{2} > Max" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass);
-fCutList->Add(hV0CutChi2);
-hV0CutPt= new TH1F("ESD_CutPt_InvMass" ,"Below p_{t} min" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass);
-fCutList->Add(hV0CutPt);
-
-// Asymmetry Cut
-
-hV0CutAsymmetry=new TH1F("ESD_CutPhotonAsymmetry_InvMass" ,"Out of reconstruction area" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass);
-fCutList->Add(hV0CutAsymmetry);
-
-// PID Prob
-
-hV0CutPIDProb=new TH1F("ESD_CutPIDProb_InvMass" ,"wrong TPC PID" , kGCnXBinsGammaMass, kGCfirstXBinGammaMass, kGClastXBinGammaMass);
-fCutList->Add(hV0CutPIDProb);
-
-// Event Info
-
- // Other
- TList *fOtherList=new TList();
- fOtherList->SetName("EventInfo");
- fOtherList->SetOwner(kTRUE);
- fOutputList->Add(fOtherList);
-
-
- hV0EventCuts=new TH1F("ESD_EventCuts","Event Cuts",10,-0.5,9.5);
- fOtherList->Add(hV0EventCuts);
- hNEvents=new TH1F("NEvents_vs_Centrality","NEvents vs Centrality",fNCentralityBins,-0.5,fNCentralityBins-0.5);
- fOtherList->Add(hNEvents);
- hCentrality=new TH1F("Centrality","Centrality",100,0,100);
- fOtherList->Add(hCentrality);
- hVertexZ=new TH1F("VertexZ","VertexZ",1000,-50,50);
- fOtherList->Add(hVertexZ);
-
-// QA
-
- TList *fGammaList=new TList();
- fGammaList->SetName("GammaInfo");
- fGammaList->SetOwner(kTRUE);
- fOutputList->Add(fGammaList);
-
- hGammaPt=new TH1F*[fNCentralityBins];
-
- for(int i=0;i<fNCentralityBins;i++){
- hGammaPt[i]=new TH1F(Form("GammaSpectrum_RECO_Pt_%d",i),"Reco Gamma Pt",kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra);
- fGammaList->Add(hGammaPt[i]);
- }
-
- hGammaPhi=new TH1F("Phi_Gamma","Phi Gamma" ,36, 0, 2*TMath::Pi());
- fGammaList->Add(hGammaPhi);
- hGammaConversionMapXY=new TH2F("Gamma_ConversionMap_XY","Conversion Point xy",400,-200,200,400,-200,200);
- fGammaList->Add(hGammaConversionMapXY);
- hGammaConversionMapZR=new TH2F("Gamma_ConversionMap_ZR","Conversion Point zr",500,-250,250,180,0,180);
- fGammaList->Add(hGammaConversionMapZR);
-
-
- // FILL MC PART only if MC is available
- if(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()){
-
- hMCPtTRUE=new TH1F*[fNCentralityBins];
- hMCPtRECOTRUE=new TH1F*[fNCentralityBins];
-
- for(int i=0;i<fNCentralityBins;i++){
- hMCPtTRUE[i]=new TH1F(Form("GammaSpectrum_MC_Pt_%d",i),"TRUE Gamma Pt",kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra);
- fGammaList->Add(hMCPtTRUE[i]);
- hMCPtRECOTRUE[i]=new TH1F(Form("GammaSpectrum_RECOTRUE_Pt_%d",i),"True Reco Gamma Pt",kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra);
- fGammaList->Add(hMCPtRECOTRUE[i]);
- }
-
- // Call Sumw2 Option
- for (Int_t i=0; i<fGammaList->GetEntries(); i++) {
- TH1 *h1 = dynamic_cast<TH1*>(fGammaList->At(i));
- if (h1){h1->Sumw2();}
- }
-
- hMCPtResolution=new TH2F("Resolution_Gamma_dPt_Pt","dPt vs Pt", kGCnYBinsSpectra, kGCfirstYBinSpectra, kGClastYBinSpectra,200,-10,10);
- fGammaList->Add(hMCPtResolution);
- hMCPtResolutionPhi=new TH2F("Resolution_Gamma_dPt_Phi","dPt vs Phi",180,0,2*TMath::Pi(),200,-10,10);
- fGammaList->Add(hMCPtResolutionPhi);
- hMCRResolutionvsR=new TH2F("Resolution_dRAbs_VS_R","dR vs R", 720,0,360,100,-5,5);
- fGammaList->Add(hMCRResolutionvsR);
- hMCZResolutionvsZ=new TH2F("Resolution_dZAbs_VS_Z","dZ vs Z", 200,-50,50,100,-5,5);
- fGammaList->Add(hMCZResolutionvsZ);
-
-}
-// Gamma Output
-
-if(fCreateAOD){kUseAODConversionPhoton=kTRUE;}
-
-if(fConversionGammas == NULL){
- if(kUseAODConversionPhoton){
- fConversionGammas = new TClonesArray("AliAODConversionPhoton",100);}
- else{
- fConversionGammas = new TClonesArray("AliKFConversionPhoton",100);}
-}
-fConversionGammas->Delete();//Reset the TClonesArray
-
-// Create AODs
-
-if(fCreateAOD){
- fConversionGammas->SetName(Form("GammaConv_gamma"));
-
- AddAODBranch("TClonesArray", &fConversionGammas, fDeltaAODFilename.Data());
- AliAnalysisManager::GetAnalysisManager()->RegisterExtraFile(fDeltaAODFilename.Data());
-}
-
- PostData(1, fOutputList);
-
-}
-//________________________________________________________________________
-void AliV0ReaderV1::UserExec(Option_t *){
-
- fAODEvent = dynamic_cast<AliAODEvent*>(fInputEvent);
- fESDEvent = dynamic_cast<AliESDEvent*>(fInputEvent);
- if(!fAODEvent&&!fESDEvent) {
- AliError("No Input event");
- return;
- }
-
- fMCStack=NULL;
- if(fMCEvent){
- fMCStack = fMCEvent->Stack();}
-
-
- if(fESDEvent)AliKFParticle::SetField(fESDEvent->GetMagneticField());
- if(fAODEvent)AliKFParticle::SetField(fAODEvent->GetMagneticField());
-
- fConversionGammas->Delete();//Reset the TClonesArray
-
- // Event Cuts
-
- EventCuts();
-
- if(EventIsSelected()){
-
- // Process V0s
- for(fCurrentV0Index=0;fCurrentV0Index<fInputEvent->GetNumberOfV0s();fCurrentV0Index++){
- if(CheckV0Status()){
-
- ProcessV0();
- }
- }
- ProcessMCGammasForEfficiency();
-
- // Set AOD Output
-
- ///Make sure delta aod is filled if standard aod is filled (for synchronization when reading aod with standard aod)
- if(fCreateAOD) {
- AliAODHandler * aodhandler = dynamic_cast<AliAODHandler*>(AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler());
- if (aodhandler && aodhandler->GetFillAOD()) {
- AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillExtension(kTRUE);
- }}
- }
-
- PostData(1, fOutputList);
-}
- ///________________________________________________________________________
-Bool_t AliV0ReaderV1::IsGammaCandidate(AliConversionPhotonBase *fPhotonCandidate)
-{
-
- // Fill Histos before Cuts
- hV0CurrentFinder->Fill(fPhotonCandidate->GetPhotonMass());
- hV0AllArmenteros->Fill(fPhotonCandidate->GetArmenterosAlpha(),fPhotonCandidate->GetArmenterosQt());
-
- Bool_t passcuts=kTRUE;
-
- // Gamma selection based on QT from Armenteros
- if(fDoQtGammaSelection == kTRUE){
- if(!ArmenterosQtCut(fPhotonCandidate))return kFALSE;//passcuts=kFALSE;
- }
-
- // Chi Cut
-
- if(fPhotonCandidate->GetChi2perNDF() > fChi2CutConversion || fPhotonCandidate->GetChi2perNDF() <=0){
- hV0CutChi2->Fill(fPhotonCandidate->GetPhotonMass());
- return kFALSE;
- }
-
- // Reconstruction Acceptance Cuts
- if(!AcceptanceCuts(fPhotonCandidate))return kFALSE;//passcuts=kFALSE;
-
-
- // Track Cuts
- if(!TrackCuts(fPhotonCandidate))return kFALSE;//passcuts=kFALSE;
-
-
- // PID Cuts
- if(!dEdxCuts(fPhotonCandidate))return kFALSE;//passcuts=kFALSE;
-
- // Asymmetry Cut
- if(fDoPhotonAsymmetryCut == kTRUE){
- if(!AsymmetryCut(fPhotonCandidate))return kFALSE;//passcuts=kFALSE;
- }
-
- //Check the pid probability
-
- if(!PIDProbabilityCut(fPhotonCandidate))return kFALSE;//passcuts=kFALSE;
-
-return passcuts;
-
-}
-
-///________________________________________________________________________
-const AliExternalTrackParam *AliV0ReaderV1::GetExternalTrackParam(Int_t charge){
-
-
- if(!(charge==1||charge==-1)){AliError("Charge not defined");return 0x0;}
-
- Int_t label;
- if(charge>0)label=0;
- else label=1;
- // Check for sign flip
-
- if(fESDEvent){
- AliESDv0 *fCurrentV0=dynamic_cast<AliESDv0*>(fESDEvent->GetV0(fCurrentV0Index));
- if(fCurrentV0){
- if(!fCurrentV0->GetParamN()||!fCurrentV0->GetParamP())return 0x0;
- if(!fESDEvent->GetTrack(fCurrentV0->GetNindex())||!fESDEvent->GetTrack(fCurrentV0->GetPindex()))return 0x0;
- if((fESDEvent->GetTrack(fCurrentV0->GetPindex()))->Charge()==charge){
- fCurrentTrackLabels[label]=fCurrentV0->GetPindex();
- return fCurrentV0->GetParamP();}
- if((fESDEvent->GetTrack(fCurrentV0->GetNindex()))->Charge()==charge){
- fCurrentTrackLabels[label]=fCurrentV0->GetNindex();
- return fCurrentV0->GetParamN();}
- }
-
- }
-
- if(fAODEvent){
-/* AliAODv0 *fCurrentV0=dynamic_cast<AliAODv0*>(fAODEvent->GetV0(fCurrentV0Index));
- if(fCurrentV0){
- if(!fCurrentV0->GetParamN()||!fCurrentV0->GetParamP())return 0x0;
- if(!fAODEvent->GetTrack(fCurrentV0->GetNegID())||!fAODEvent->GetTrack(fCurrentV0->GetPosID()))return 0x0;
- if((fAODEvent->GetTrack(fCurrentV0->GetPosID()))->Charge()==1){
- fCurrentTrackLabels[label]=fCurrentV0->GetPosID();
- return fCurrentV0->GetParamP();}
- if((fAODEvent->GetTrack(fCurrentV0->GetNegID()))->Charge()==1){
- fCurrentTrackLabels[label]=fCurrentV0->GetNegID();
- return fCurrentV0->GetParamN();}
- }
- */ }
- return 0x0;
-}
-
-///________________________________________________________________________
-Bool_t AliV0ReaderV1::CheckV0Status()
-{
- if(fESDEvent){
- AliESDv0 *fCurrentV0=(AliESDv0*)(fESDEvent->GetV0(fCurrentV0Index));
- if(!fCurrentV0){
- printf("Requested V0 does not exist");
- return kFALSE;}
- //checks if on the fly mode is set
- if(fCurrentV0->GetOnFlyStatus()==fUseOnFlyV0Finder)return kTRUE;
- }
-
- if(fAODEvent){
- AliAODv0 *fCurrentV0=dynamic_cast<AliAODv0*>(fAODEvent->GetV0(fCurrentV0Index));
- if(!fCurrentV0){
- AliWarning("Requested V0 does not exist");
- return kFALSE;}
-
- //checks if on the fly mode is set
- if(fCurrentV0->GetOnFlyStatus()==fUseOnFlyV0Finder)return kTRUE;
- }
- return kFALSE;
-}
-
-
-
-
-///________________________________________________________________________
-void AliV0ReaderV1::ProcessV0(){
-
- // Reset TrackLabels
- fCurrentTrackLabels[0]=-1;
- fCurrentTrackLabels[1]=-1;
-
-
- // cout<<"V0ReaderV1 ProcessV0 "<<fCurrentV0Index<<endl;
-
- // Get Daughter KF Particles
-
- const AliExternalTrackParam *fCurrentExternalTrackParamPositive=GetExternalTrackParamP();
- const AliExternalTrackParam *fCurrentExternalTrackParamNegative=GetExternalTrackParamN();
-
- if(fCurrentExternalTrackParamPositive&&fCurrentExternalTrackParamNegative){
-
- fCurrentNegativeKFParticle=new AliKFParticle(*(fCurrentExternalTrackParamNegative),11);
- fCurrentPositiveKFParticle=new AliKFParticle(*(fCurrentExternalTrackParamPositive),-11);
-
- }
- //else{hV0CutLikeSign->Fill(fCurrentMotherKFCandidate->M());}// Like Sign error is already catched here
-
-
- // Reconstruct Gamma
-
- if(fCurrentNegativeKFParticle&&fCurrentPositiveKFParticle){
-
- if(fUseConstructGamma==kTRUE){
-
- fCurrentMotherKFCandidate = new AliKFConversionPhoton();
- fCurrentMotherKFCandidate->ConstructGamma(*fCurrentNegativeKFParticle,*fCurrentPositiveKFParticle);
- }else{
- fCurrentMotherKFCandidate = new AliKFConversionPhoton(*fCurrentNegativeKFParticle,*fCurrentPositiveKFParticle);
- fCurrentMotherKFCandidate->SetMassConstraint(0,fNSigmaMass);
- }
-
- if(fCurrentNegativeKFParticle){delete fCurrentNegativeKFParticle;
- fCurrentNegativeKFParticle=0x0;}
- if(fCurrentPositiveKFParticle){ delete fCurrentPositiveKFParticle;
- fCurrentPositiveKFParticle=0x0;}
-
-
- // Update Vertex
- if(fUseImprovedVertex == kTRUE){
- AliKFVertex primaryVertexImproved(*GetPrimaryVertex());
- primaryVertexImproved+=*fCurrentMotherKFCandidate;
- fCurrentMotherKFCandidate->SetProductionVertex(primaryVertexImproved);
- }
-
- // Set Track Labels
-
- fCurrentMotherKFCandidate->SetV0Index(fCurrentV0Index);
- fCurrentMotherKFCandidate->SetTrackLabels(fCurrentTrackLabels[0],fCurrentTrackLabels[1]);
-
- //Set MC Label
-
- if(fMCStack){
- Int_t labeln=TMath::Abs(GetTrack(fCurrentMotherKFCandidate->GetTrackLabelPositive())->GetLabel());
- Int_t labelp=TMath::Abs(GetTrack(fCurrentMotherKFCandidate->GetTrackLabelNegative())->GetLabel());
-
- TParticle *fNegativeMCParticle = fMCStack->Particle(labeln);
- TParticle *fPositiveMCParticle = fMCStack->Particle(labelp);
-
- if(fPositiveMCParticle&&fNegativeMCParticle){
- fCurrentMotherKFCandidate->SetMCLabelPositive(labelp);
- fCurrentMotherKFCandidate->SetMCLabelNegative(labeln);
- }
- }
-
-
-
- //Add PID information with ESD tender (AOD implementation is not complete)
-
-
- AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
- AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
- AliPIDResponse *fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
-
- if(fESDEvent){
- Int_t labelp=((AliESDv0*)fESDEvent->GetV0(fCurrentMotherKFCandidate->GetV0Index()))->GetNindex();
- Int_t labeln=((AliESDv0*)fESDEvent->GetV0(fCurrentMotherKFCandidate->GetV0Index()))->GetNindex();
-
- AliESDtrack *trackpos=fESDEvent->GetTrack(labelp);
- AliESDtrack *trackneg=fESDEvent->GetTrack(labeln);
-
- if(trackpos&&trackneg){
-
- Float_t fNSigmadEdxPositive[5];
- Float_t fNSigmadEdxNegative[5];
-
- fNSigmadEdxPositive[0]=fPIDResponse->NumberOfSigmasTPC(trackpos,AliPID::kElectron);
- fNSigmadEdxPositive[1]=fPIDResponse->NumberOfSigmasTPC(trackpos,AliPID::kMuon);
- fNSigmadEdxPositive[2]=fPIDResponse->NumberOfSigmasTPC(trackpos,AliPID::kPion);
- fNSigmadEdxPositive[3]=fPIDResponse->NumberOfSigmasTPC(trackpos,AliPID::kKaon);
- fNSigmadEdxPositive[4]=fPIDResponse->NumberOfSigmasTPC(trackpos,AliPID::kProton);
-
- fNSigmadEdxNegative[0]=fPIDResponse->NumberOfSigmasTPC(trackneg,AliPID::kElectron);
- fNSigmadEdxNegative[1]=fPIDResponse->NumberOfSigmasTPC(trackneg,AliPID::kMuon);
- fNSigmadEdxNegative[2]=fPIDResponse->NumberOfSigmasTPC(trackneg,AliPID::kPion);
- fNSigmadEdxNegative[3]=fPIDResponse->NumberOfSigmasTPC(trackneg,AliPID::kKaon);
- fNSigmadEdxNegative[4]=fPIDResponse->NumberOfSigmasTPC(trackneg,AliPID::kProton);
-
- fCurrentMotherKFCandidate->SetNSigmadEdx(fNSigmadEdxPositive,fNSigmadEdxNegative);
- }
- }
-
- // Calculate ConversionPoint
-
- if(fUseOwnXYZCalculation){
-
- Double_t convpos[3]={0,0,0};
- GetConversionPoint(fCurrentExternalTrackParamPositive,fCurrentExternalTrackParamNegative,convpos);
- fCurrentMotherKFCandidate->SetConversionPoint(convpos);
-
- }
-
- // if(kTRUE){
- if(IsGammaCandidate(fCurrentMotherKFCandidate)){
- // Fill Histos after Cuts
-
- // Process MC
-
- ProcessMC(fCurrentMotherKFCandidate);
-
-
- hV0Good->Fill(fCurrentMotherKFCandidate->M());
- hV0GoodArmenteros->Fill(fCurrentMotherKFCandidate->GetArmenterosAlpha(),fCurrentMotherKFCandidate->GetArmenterosQt());
-
-
- // Set Mass Zero for Gammas
- SetGammaMassZero();
-
- // Add Gamma to the TClonesArray
-
- if(kUseAODConversionPhoton){
- new((*fConversionGammas)[fConversionGammas->GetEntriesFast()]) AliAODConversionPhoton(fCurrentMotherKFCandidate);
- }
- else{
- new((*fConversionGammas)[fConversionGammas->GetEntriesFast()]) AliKFConversionPhoton(*fCurrentMotherKFCandidate);
- }
- // Fill QA Histos
-
- hGammaPhi->Fill(fCurrentMotherKFCandidate->Phi());
- hGammaPt[fCentralityBin]->Fill(fCurrentMotherKFCandidate->Pt());
- hGammaConversionMapXY->Fill(fCurrentMotherKFCandidate->GetConversionX(),fCurrentMotherKFCandidate->GetConversionY());
- hGammaConversionMapZR->Fill(fCurrentMotherKFCandidate->GetConversionZ(),fCurrentMotherKFCandidate->GetConversionRadius());
-
- }
- delete fCurrentMotherKFCandidate;
- fCurrentMotherKFCandidate=NULL;
- }
-
-}
-
-///________________________________________________________________________
-Bool_t AliV0ReaderV1::ArmenterosQtCut(AliConversionPhotonBase *fPhotonCandidate)
-{
- if(fDoHighPtQtGammaSelection){
- if(fPhotonCandidate->GetPhotonPt() < fPtBorderForQt){
- if(fPhotonCandidate->GetArmenterosQt()>fQtMax){
- hV0CutQt->Fill(fPhotonCandidate->GetPhotonMass());
- return kFALSE;
- }
- } else {
- if(fPhotonCandidate->GetArmenterosQt()>fHighPtQtMax){
- hV0CutQt->Fill(fPhotonCandidate->GetPhotonMass());
- return kFALSE;
- }
- }
- } else {
-
- if(fPhotonCandidate->GetArmenterosQt()>fQtMax){
- hV0CutQt->Fill(fPhotonCandidate->GetPhotonMass());
- return kFALSE;
- }
- }
- return kTRUE;
-}
-
-///________________________________________________________________________
-Bool_t AliV0ReaderV1::AcceptanceCuts(AliConversionPhotonBase *fPhotonCandidate)
-{
- AliVTrack *fCurrentNegativeTrack=GetTrack(fPhotonCandidate->GetTrackLabelNegative());
- AliVTrack *fCurrentPositiveTrack=GetTrack(fPhotonCandidate->GetTrackLabelPositive());
-
- if(fPhotonCandidate->GetConversionRadius()>fMaxR){ // cuts on distance from collision point
- hV0CutR->Fill(fPhotonCandidate->GetPhotonMass());
- return kFALSE;
- }
-
- if(fPhotonCandidate->GetConversionRadius()<fMinR){ // cuts on distance from collision point
- hV0CutMinR->Fill(fPhotonCandidate->GetPhotonMass());
- return kFALSE;
- }
-
- if(fPhotonCandidate->GetConversionRadius() <= ((TMath::Abs(fPhotonCandidate->GetConversionZ())*fLineCutZRSlope)-fLineCutZValue)){
- hV0CutLine->Fill(fPhotonCandidate->GetPhotonMass());
- return kFALSE;
- }
- /*else if (fUseEtaMinCut && fPhotonCandidate->GetConversionRadius() >= ((TMath::Abs(fPhotonCandidate->GetConversionZ())*fLineCutZRSlopeMin)-fLineCutZValueMin )){
- hV0CutLine->Fill(fPhotonCandidate->GetPhotonMass());
- return kFALSE;
- }*/
-
-
- if(TMath::Abs(fPhotonCandidate->GetConversionZ()) > fMaxZ ){ // cuts out regions where we do not reconstruct
- hV0CutZ->Fill(fPhotonCandidate->GetPhotonMass());
- return kFALSE;
- }
-
- if(TMath::Abs(fPhotonCandidate->GetPhotonEta())> fEtaCut || TMath::Abs(fPhotonCandidate->GetPhotonEta())< fEtaCutMin){
- hV0CutEta->Fill(fPhotonCandidate->GetPhotonMass());
- return kFALSE;
- }
-
- if(TMath::Abs(fCurrentNegativeTrack->Eta())> fEtaCut || TMath::Abs(fCurrentNegativeTrack->Eta())< fEtaCutMin){
- hV0CutEta->Fill(fPhotonCandidate->GetPhotonMass());
- return kFALSE;
- }
-
- if(TMath::Abs(fCurrentPositiveTrack->Eta())> fEtaCut || TMath::Abs(fCurrentPositiveTrack->Eta())< fEtaCutMin){
- hV0CutEta->Fill(fPhotonCandidate->GetPhotonMass());
- return kFALSE;
- }
-
- if( fCurrentNegativeTrack->Pt()< fSinglePtCut || fCurrentNegativeTrack->Pt()< fSinglePtCut){
- hV0CutSinglePt->Fill(fPhotonCandidate->GetPhotonMass());
- return kFALSE;
- }
-
-
- if(fPhotonCandidate->GetPhotonPt()<fPtCut){
- hV0CutPt->Fill(fPhotonCandidate->GetPhotonMass());
- return kFALSE;
- }
-return kTRUE;
-}
-
-
-
-///________________________________________________________________________
-Bool_t AliV0ReaderV1::TrackCuts(AliConversionPhotonBase *fPhotonCandidate){
-
- Bool_t passtrackcuts=kTRUE;
-
-
-
- if(fESDEvent){
-
- AliESDtrack *fCurrentNegativeESDTrack=(AliESDtrack*)fESDEvent->GetTrack(fPhotonCandidate->GetTrackLabelNegative());
- AliESDtrack *fCurrentPositiveESDTrack=(AliESDtrack*)fESDEvent->GetTrack(fPhotonCandidate->GetTrackLabelPositive());
-
- if(!fCurrentNegativeESDTrack||!fCurrentPositiveESDTrack)return kFALSE;
-
- // avoid like sign
- if(fCurrentNegativeESDTrack->Charge() == fCurrentPositiveESDTrack->Charge()){
-
- hV0CutLikeSign->Fill(fPhotonCandidate->GetPhotonMass());
- passtrackcuts=kFALSE;
- }
-
- if( (!(fCurrentNegativeESDTrack->IsOn(AliESDtrack::kTPCrefit))||(!(fCurrentPositiveESDTrack->IsOn(AliESDtrack::kTPCrefit))))){
- hV0CutRefit->Fill(fPhotonCandidate->GetPhotonMass());
- passtrackcuts=kFALSE;
-
- }
-
- if( fCurrentNegativeESDTrack->GetKinkIndex(0) > 0 ||
- fCurrentPositiveESDTrack->GetKinkIndex(0) > 0) {
- passtrackcuts=kFALSE;
- }
-
- if(fCurrentNegativeESDTrack->GetNcls(1) < fMinClsTPC || fCurrentPositiveESDTrack->GetNcls(1) < fMinClsTPC ){
- passtrackcuts=kFALSE;
- hV0CutKinks->Fill(fPhotonCandidate->GetPhotonMass());
- }
-
- /* Double_t negclsToF = 0.;
- if (!fUseCorrectedTPCClsInfo ){
- if(fCurrentNegativeESDTrack->GetTPCNclsF()!=0 ){
- negclsToF = (Double_t)fCurrentNegativeESDTrack->GetNcls(1)/(Double_t)fCurrentNegativeESDTrack->GetTPCNclsF();
- }
- } else {
- negclsToF = fCurrentNegativeESDTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(GetXYRadius()));
- }
-
- Double_t posclsToF = 0.;
- if (!fUseCorrectedTPCClsInfo ){
- if(fCurrentTrack->GetTPCNclsF()!=0 ){
- posclsToF = (Double_t)fCurrentTrack->GetNcls(1)/(Double_t)fCurrentTrack->GetTPCNclsF();
- }
- }else{
- posclsToF = fCurrentTrack->GetTPCClusterInfo(2,0,GetFirstTPCRow(GetXYRadius()));
- }
-
- if( negclsToF < fMinClsTPCToF || posclsToF < fMinClsTPCToF ){
- hV0CutMinNclsTPCToF->Fill(fPhotonCandidate->GetPhotonMass());
- passtrackcuts=kFALSE; }
- */
-
-
-
-
- }
-
- if(fAODEvent){
-
- AliAODTrack *fCurrentNegativeESDTrack=(AliAODTrack*)fAODEvent->GetTrack(fPhotonCandidate->GetTrackLabelNegative());
- AliAODTrack *fCurrentPositiveESDTrack=(AliAODTrack*)fAODEvent->GetTrack(fPhotonCandidate->GetTrackLabelPositive());
-
- if(!fCurrentNegativeESDTrack||!fCurrentPositiveESDTrack)return kFALSE;
-
- // avoid like sign
- if(fCurrentNegativeESDTrack->Charge() == fCurrentPositiveESDTrack->Charge()){
-
- hV0CutLikeSign->Fill(fPhotonCandidate->GetPhotonMass());
- passtrackcuts=kFALSE;
- }
-
- if( !(fCurrentNegativeESDTrack->IsOn(AliESDtrack::kTPCrefit))){
- hV0CutRefit->Fill(fPhotonCandidate->GetPhotonMass());
- passtrackcuts=kFALSE;
- }
-
- if( !(fCurrentPositiveESDTrack->IsOn(AliESDtrack::kTPCrefit))){
- hV0CutRefit->Fill(fPhotonCandidate->GetPhotonMass());
- passtrackcuts=kFALSE;
- }
-
- // to be implemented
- /*
- if( fCurrentNegativeESDTrack->GetKinkIndex(0) > 0 ||
- fCurrentPositiveESDTrack->GetKinkIndex(0) > 0) {
- }*/
-
- if(fCurrentNegativeESDTrack->GetNcls(1) < fMinClsTPC || fCurrentPositiveESDTrack->GetNcls(1) < fMinClsTPC ){
- passtrackcuts=kFALSE;}
-
-
- }
-
- return passtrackcuts;
-}
-
-///________________________________________________________________________
-Bool_t AliV0ReaderV1::dEdxCuts(AliConversionPhotonBase *fPhotonCandidate){
-
- AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
- AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
- AliPIDResponse *fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
-
- AliVTrack *fCurrentTrack=0x0;
-
- for(Int_t ilabel=0;ilabel<2;ilabel++){
-
- fCurrentTrack=GetTrack(fPhotonCandidate->GetTrackLabel(ilabel));
-
- if(!fCurrentTrack)return kFALSE;
-
- // Fill dEdx before cuts
-
- hGammadEdxbefore->Fill(fCurrentTrack->P(),fCurrentTrack->GetTPCsignal());
-
- if(fDodEdxSigmaCut == kTRUE){
- if( fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaBelowElectronLine ||
- fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaAboveElectronLine){
-
- hV0CutdEdxElectron->Fill(fPhotonCandidate->GetPhotonMass());
- return kFALSE;
- }
-
- if( fCurrentTrack->P()>fPIDMinPnSigmaAbovePionLine && fCurrentTrack->P()<fPIDMaxPnSigmaAbovePionLine ){
- if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
- fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&&
- fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLine){
-
- hV0CutdEdxPion->Fill(fPhotonCandidate->GetPhotonMass());
- return kFALSE;
- }
- }
-
- // High Pt
- if( fCurrentTrack->P()>fPIDMaxPnSigmaAbovePionLine ){
- if(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)>fPIDnSigmaBelowElectronLine &&
- fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kElectron)<fPIDnSigmaAboveElectronLine&&
- fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion)<fPIDnSigmaAbovePionLineHighPt){
-
- hV0CutdEdxPion->Fill(fPhotonCandidate->GetPhotonMass());
- return kFALSE;
- }
- }
- }
-
- if(fDoKaonRejectionLowP == kTRUE){
- if(fCurrentTrack->P()<fPIDMinPKaonRejectionLowP ){
- if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kKaon))<fPIDnSigmaAtLowPAroundKaonLine){
- hV0CutdEdxKaonLowP->Fill(fPhotonCandidate->GetPhotonMass());
- return kFALSE;
- }
- }
- }
-
- if(fDoProtonRejectionLowP == kTRUE){
- if( fCurrentTrack->P()<fPIDMinPProtonRejectionLowP ){
- if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kProton))<fPIDnSigmaAtLowPAroundProtonLine){
- hV0CutdEdxProtonLowP->Fill(fPhotonCandidate->GetPhotonMass());
- return kFALSE;
- }
- }
- }
-
- if(fDoPionRejectionLowP == kTRUE){
- if( fCurrentTrack->P()<fPIDMinPPionRejectionLowP ){
- if( TMath::Abs(fPIDResponse->NumberOfSigmasTPC(fCurrentTrack,AliPID::kPion))<fPIDnSigmaAtLowPAroundPionLine){
- hV0CutdEdxPionLowP->Fill(fPhotonCandidate->GetPhotonMass());
- return kFALSE;
- }
- }
- }
-
-
- if( fDoTOFsigmaCut == kTRUE ){ // RRnewTOF start /////////////////////////////////////////////////////////////////////////////
-
- if((fPIDResponse->NumberOfSigmasTOF(fCurrentTrack,AliPID::kElectron)>fTofPIDnSigmaAboveElectronLine) || (fPIDResponse->NumberOfSigmasTOF(fCurrentTrack,AliPID::kElectron)<fTofPIDnSigmaBelowElectronLine)){
- hV0CutdEdxTOFElectron->Fill(fPhotonCandidate->GetPhotonMass());
- return kFALSE;
- }
- } /////////////////////////////// RRnewTOF end ///////////////////////////////////////////////////////////////////////////////
-
- // Apply TRD PID
- if(fDoTRDPID){
- if(!fPIDResponse->IdentifiedAsElectronTRD(fCurrentTrack,fPIDTRDEfficiency)){
- hV0CutdEdxTRD->Fill(fPhotonCandidate->GetPhotonMass());
- return kFALSE;
- }
- }
-
- // Fill dEdx Histogram after Cuts
-
- hGammadEdxafter->Fill(fCurrentTrack->P(),fCurrentTrack->GetTPCsignal());
-
- }
-
- return kTRUE;
-}
-
-///________________________________________________________________________
-Bool_t AliV0ReaderV1::AsymmetryCut(AliConversionPhotonBase *fPhotonCandidate)
-{
-
- for(Int_t ii=0;ii<2;ii++){
- AliVTrack *fCurrentTrack=GetTrack(fPhotonCandidate->GetTrackLabel(ii));
-
- if( fCurrentTrack->P()>fMinPPhotonAsymmetryCut ){
- Double_t trackNegAsy=0;
- if (fPhotonCandidate->GetPhotonP()!=0.){
- trackNegAsy= fCurrentTrack->P()/fPhotonCandidate->GetPhotonP();
- }
- if( trackNegAsy<fMinPhotonAsymmetry ||trackNegAsy>(1.- fMinPhotonAsymmetry)){
- hV0CutAsymmetry->Fill(fPhotonCandidate->GetPhotonMass());
- return kFALSE;
- }
- }
- }
-
- return kTRUE;
-}
-
-
-///________________________________________________________________________
-
-Int_t AliV0ReaderV1::GetNumberOfContributorsVtx(){
- // returns number of contributors to the vertex
- if(fESDEvent){
- if(fESDEvent->GetPrimaryVertexTracks()->GetNContributors()>0) {
- return fESDEvent->GetPrimaryVertexTracks()->GetNContributors();
- }
-
- if(fESDEvent->GetPrimaryVertexTracks()->GetNContributors()<1) {
- // return 0;
- //-AM test pi0s without SPD only vertex
- if(fESDEvent->GetPrimaryVertexSPD()->GetNContributors()>0) {
- return fESDEvent->GetPrimaryVertexSPD()->GetNContributors();
-
- }
- if(fESDEvent->GetPrimaryVertexSPD()->GetNContributors()<1) {
- // cout<<"number of contributors from bad vertex type::"<< fESDEvent->GetPrimaryVertex()->GetName() << endl;
- return 0;
- }
- }
- }
- if(fAODEvent){
- if(fAODEvent->GetPrimaryVertex()->GetNContributors()>0) {
- return fESDEvent->GetPrimaryVertex()->GetNContributors();
- }
- if(fAODEvent->GetPrimaryVertex()->GetNContributors()<1) {
- if(fAODEvent->GetPrimaryVertexSPD()->GetNContributors()>0) {
- return fAODEvent->GetPrimaryVertexSPD()->GetNContributors();
-
- }
- if(fAODEvent->GetPrimaryVertexSPD()->GetNContributors()<1) {
- AliWarning(Form("Number of contributors from bad vertex type:: %s",fAODEvent->GetPrimaryVertex()->GetName()));
- return 0;
- }
- }
- }
-
- return 0;
-
-}
-
-///________________________________________________________________________
-Double_t AliV0ReaderV1::GetCentrality(){
- if(fAODEvent){
- if(fAODEvent->GetHeader()){return fAODEvent->GetHeader()->GetCentrality();}
- }
-
- if(fESDEvent){
- return ((AliCentrality *)fESDEvent->GetCentrality())->GetCentralityPercentile("V0M");
- }
-
- return -1;
-}
-
-///________________________________________________________________________
-
-AliEventplane *AliV0ReaderV1::GetEventPlane(){
- if(fESDEvent){
- return fESDEvent->GetEventplane();
- }
- if(fAODEvent){
- return fAODEvent->GetEventplane();
- }
-return 0x0;
-}
-
-//________________________________________________________________________
-Bool_t AliV0ReaderV1::SetEventPlane()
-{
- if(fMCStack||!fIsHeavyIon){
- // NO EP in MC mode and pp mode
- fEPAngle=0;
- return kTRUE;
- }
-
- if(fIsHeavyIon){
- AliEventplane *fEP=GetEventPlane();
-
- if(!fEP)return kFALSE;
-
- fEPAngle=fEP->GetEventplane("Q");
-
- return kTRUE;
- }
- return kFALSE;
-}
-
-///________________________________________________________________________
-Bool_t AliV0ReaderV1::EventCuts(){
-
- fEventIsSelected=kTRUE;
-
- // Z Vertex Position Cut
-
- if(!VertexZCut()){
- hV0EventCuts->Fill(0);
- fEventIsSelected=kFALSE;;
- }
- // Number of Contributors Cut
-
- if(GetNumberOfContributorsVtx()<=0) {
- hV0EventCuts->Fill(1);
- fEventIsSelected=kFALSE;;
- }
- // Centrality Selection
-
- if(!CentralitySelection()){
- hV0EventCuts->Fill(2);
- fEventIsSelected=kFALSE;;
- }
-
- // Event Plane
- if(!SetEventPlane()){hV0EventCuts->Fill(4);}
-
- // Fill Event Histograms
-
- if(fEventIsSelected){
- // Fill Event Histograms
- hV0EventCuts->Fill(9);
- hVertexZ->Fill(fVertexZ);
- hCentrality->Fill(fCentrality);
- hNEvents->Fill(fCentralityBin);
- }
- else{hV0EventCuts->Fill(8);}
-
- return fEventIsSelected;
-}
-
-///________________________________________________________________________
-Bool_t AliV0ReaderV1::VertexZCut(){
-
- fVertexZ=GetPrimaryVertex()->GetZ();
-
- if(fBGHandler){
- if(fBGHandler->GetZBinIndex(fVertexZ)<0)return kFALSE;
- }
- else{
- if(fVertexZ>fMaxVertexZ)return kFALSE;
- }
- return kTRUE;
-}
-
-///________________________________________________________________________
-AliVTrack *AliV0ReaderV1::GetTrack(Int_t label){
- if(fESDEvent){
- return (AliESDtrack*)fESDEvent->GetTrack(label);
- }
- if(fAODEvent)return (AliAODTrack*)fAODEvent->GetTrack(label);
- return 0x0;
-}
-
-///________________________________________________________________________
-Bool_t AliV0ReaderV1::PIDProbabilityCut(AliConversionPhotonBase *fPhotonCandidate){
-
- if(fESDEvent){
-
- Bool_t iResult=kFALSE;
-
- Double_t *posProbArray = new Double_t[AliPID::kSPECIES];
- Double_t *negProbArray = new Double_t[AliPID::kSPECIES];
-
- AliESDtrack* negTrack = (AliESDtrack*)fESDEvent->GetTrack(fPhotonCandidate->GetTrackLabelNegative());
- AliESDtrack* posTrack = (AliESDtrack*)fESDEvent->GetTrack(fPhotonCandidate->GetTrackLabelPositive());
-
- if(negProbArray && posProbArray){
-
- negTrack->GetTPCpid(negProbArray);
- posTrack->GetTPCpid(posProbArray);
-
- if(negProbArray[AliPID::kElectron]>=fPIDProbabilityCutNegativeParticle && posProbArray[AliPID::kElectron]>=fPIDProbabilityCutPositiveParticle){
- iResult=kTRUE;
- }
- else{hV0CutPIDProb->Fill(fPhotonCandidate->GetPhotonMass());}
- }
-
- delete [] posProbArray;
- delete [] negProbArray;
- return iResult;
-
- }
- if(fAODEvent){
- // not possible to implement
- return kTRUE;}
- return kFALSE;
-}
-
-///________________________________________________________________________
-const AliVertex *AliV0ReaderV1::GetPrimaryVertex() {
- if(fESDEvent)return fESDEvent->GetPrimaryVertex();
- if(fAODEvent)return const_cast<const AliVertex*>(dynamic_cast<AliVertex*>(fAODEvent->GetPrimaryVertex()));
-return 0x0;
-}
-
-///________________________________________________________________________
-Bool_t AliV0ReaderV1::GetHelixCenter(const AliExternalTrackParam *track, Double_t b,Int_t charge, Double_t center[2]){
- // see header file for documentation
-
- Double_t helix[6];
- track->GetHelixParameters(helix,b);
-
- Double_t xpos = helix[5];
- Double_t ypos = helix[0];
- Double_t radius = TMath::Abs(1./helix[4]);
- Double_t phi = helix[2];
-
- if(phi < 0){
- phi = phi + 2*TMath::Pi();
- }
-
- phi -= TMath::Pi()/2.;
- Double_t xpoint = radius * TMath::Cos(phi);
- Double_t ypoint = radius * TMath::Sin(phi);
-
- if(b<0){
- if(charge > 0){
- xpoint = - xpoint;
- ypoint = - ypoint;
- }
-
- if(charge < 0){
- xpoint = xpoint;
- ypoint = ypoint;
- }
- }
- if(b>0){
- if(charge > 0){
- xpoint = xpoint;
- ypoint = ypoint;
- }
-
- if(charge < 0){
- xpoint = - xpoint;
- ypoint = - ypoint;
- }
- }
- center[0] = xpos + xpoint;
- center[1] = ypos + ypoint;
-
- return 1;
-}
-///________________________________________________________________________
-Bool_t AliV0ReaderV1::GetConversionPoint(const AliExternalTrackParam *pparam,const AliExternalTrackParam *nparam,Double_t convpos[3]){
-
- if(!pparam||!nparam)return kFALSE;
-
- Double_t helixcenterpos[2];
- GetHelixCenter(pparam,GetMagneticField(),pparam->Charge(),helixcenterpos);
-
- Double_t helixcenterneg[2];
- GetHelixCenter(nparam,GetMagneticField(),nparam->Charge(),helixcenterneg);
-
- Double_t helixpos[6];
- pparam->GetHelixParameters(helixpos,GetMagneticField());
- Double_t posradius = TMath::Abs(1./helixpos[4]);
-
- Double_t helixneg[6];
- nparam->GetHelixParameters(helixneg,GetMagneticField());
- Double_t negradius = TMath::Abs(1./helixneg[4]);
-
- // Calculate xy-position
-
- Double_t xpos = helixcenterpos[0];
- Double_t ypos = helixcenterpos[1];
- Double_t xneg = helixcenterneg[0];
- Double_t yneg = helixcenterneg[1];
-
- convpos[0] = (xpos*negradius + xneg*posradius)/(negradius+posradius);
- convpos[1] = (ypos*negradius+ yneg*posradius)/(negradius+posradius);
-
-
- // Calculate z-position
-
- Double_t deltaXPos = convpos[0] - xpos;
- Double_t deltaYPos = convpos[1] - ypos;
-
- Double_t deltaXNeg = convpos[0] - xneg;
- Double_t deltaYNeg = convpos[1] - yneg;
-
- Double_t alphaPos = TMath::Pi() + TMath::ATan2(-deltaYPos,-deltaXPos);
- Double_t alphaNeg = TMath::Pi() + TMath::ATan2(-deltaYNeg,-deltaXNeg);
-
- Double_t vertexXNeg = xneg + TMath::Abs(negradius)*
- TMath::Cos(alphaNeg);
- Double_t vertexYNeg = yneg + TMath::Abs(negradius)*
- TMath::Sin(alphaNeg);
-
- Double_t vertexXPos = xpos + TMath::Abs(posradius)*
- TMath::Cos(alphaPos);
- Double_t vertexYPos = ypos + TMath::Abs(posradius)*
- TMath::Sin(alphaPos);
-
- Double_t x0neg = helixneg[5];
- Double_t y0neg = helixneg[0];
-
- Double_t x0pos = helixpos[5];
- Double_t y0pos = helixpos[0];
-
- Double_t dNeg = TMath::Sqrt((vertexXNeg - x0neg)*(vertexXNeg - x0neg)
- +(vertexYNeg - y0neg)*(vertexYNeg - y0neg));
-
- Double_t dPos = TMath::Sqrt((vertexXPos - x0pos)*(vertexXPos - x0pos)
- +(vertexYPos - y0pos)*(vertexYPos - y0pos));
-
- Double_t rNeg = TMath::Sqrt(negradius*negradius -
- dNeg*dNeg/4.);
-
- Double_t rPos = TMath::Sqrt(posradius*posradius -
- dPos*dPos/4.);
-
- Double_t deltabetaNeg = 2*(TMath::Pi() + TMath::ATan2(-dNeg/2.,-rNeg));
- Double_t deltabetaPos = 2*(TMath::Pi() + TMath::ATan2(-dPos/2.,-rPos));
-
- Double_t deltaUNeg = negradius*deltabetaNeg;
- Double_t deltaUPos = posradius*deltabetaPos;
-
- Double_t zphaseNeg = nparam->GetZ() + deltaUNeg * nparam->GetTgl();
- Double_t zphasePos = pparam->GetZ() + deltaUPos * pparam->GetTgl();
-
- convpos[2] = (zphasePos*negradius+zphaseNeg*posradius)/(negradius+posradius);
-
-return kTRUE;
-}
-///________________________________________________________________________
-void AliV0ReaderV1::ProcessMC(AliKFConversionPhoton *fCurrentReconstructedGamma){
-
- if(!fMCStack)return;
-
- TParticle *fMotherMCParticle=NULL;
- TParticle *fNegativeMCParticle=NULL;
- TParticle *fPositiveMCParticle=NULL;
-
- // Get MC Particles
- fMotherMCParticle = fCurrentReconstructedGamma->GetMCParticle(fMCStack);
- fNegativeMCParticle = fCurrentReconstructedGamma->GetNegativeMCDaughter(fMCStack);
- fPositiveMCParticle = fCurrentReconstructedGamma->GetPositiveMCDaughter(fMCStack);
-
- if(fPositiveMCParticle&&fNegativeMCParticle&&fMotherMCParticle){
-
- // Check if it is a true photon
-
- if(fMotherMCParticle->GetPdgCode()==22){
-
- hMCPtRECOTRUE[fCentralityBin]->Fill(fCurrentReconstructedGamma->GetPt());
-
- // Pt Resolution
-
- Double_t mcpt = fMotherMCParticle->Pt();
- Double_t esdpt = fCurrentReconstructedGamma->GetPt();
- Double_t resdPt = 0.;
- if(mcpt > 0){
- resdPt = ((esdpt - mcpt)/mcpt)*100.;
- } else if(mcpt < 0){
- AliWarning("Pt of MC particle is negative, this will cause wrong calculation of resPt");
- }
-
-
- hMCPtResolution->Fill(mcpt,resdPt);
- hMCPtResolutionPhi->Fill(fMotherMCParticle->Phi(),resdPt);
-
- // Conversion Point Resolution
-
- Double_t resdR = 0.;
- if(fNegativeMCParticle->R() != 0){
- resdR = ((fCurrentReconstructedGamma->GetConversionRadius() - fNegativeMCParticle->R())/fNegativeMCParticle->R())*100.;
- }
- Double_t resdRAbs = 0.;
- resdRAbs = (fCurrentReconstructedGamma->GetConversionRadius() - fNegativeMCParticle->R());
-
- hMCRResolutionvsR->Fill(fNegativeMCParticle->R(),resdRAbs);
-
- // 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_R_dPt", fV0Reader->GetNegativeMCParticle()->R(), resdPt);
-
- Double_t resdZ = 0.;
- if(fNegativeMCParticle->Vz() != 0){
- resdZ = ((fCurrentReconstructedGamma->GetZ() -fNegativeMCParticle->Vz())/fNegativeMCParticle->Vz())*100.;
- }
- Double_t resdZAbs = 0.;
- resdZAbs = fCurrentReconstructedGamma->GetZ() -fNegativeMCParticle->Vz();
-
- hMCZResolutionvsZ->Fill( fNegativeMCParticle->Vz(), resdZAbs);
- }
- }
-
-}
-
-///________________________________________________________________________
-void AliV0ReaderV1::ProcessMCGammasForEfficiency(){
-
- if(!fMCStack)return;
-
- for (Int_t iTracks = 0; iTracks < fMCStack->GetNprimary(); iTracks++) {
- TParticle* particle = (TParticle *)fMCStack->Particle(iTracks);
-
- //process the gammas
-
- if(IsMCConversionGammaInAcceptance(particle)){
-
- hMCPtTRUE[fCentralityBin]->Fill(particle->Pt());
-
- }
- }
-}
-
-
-///________________________________________________________________________
-Bool_t AliV0ReaderV1::IsMCConversionGammaInAcceptance(TParticle *particle){
- if(!fMCStack)return kFALSE;
-
- if (particle->GetPdgCode() == 22){
- if(TMath::Abs(particle->Eta())> fEtaCut || TMath::Abs(particle->Eta())< fEtaCutMin) return kFALSE;
-
- if(particle->GetMother(0) >-1 && fMCStack->Particle(particle->GetMother(0))->GetPdgCode() == 22){
- return kFALSE; // no photon as mothers!
- }
-
- if(particle->GetMother(0) >= fMCStack->GetNprimary()){
- return kFALSE; // the gamma has a mother, and it is not a primary particle
- }
-
- // looking for conversion (electron + positron from pairbuilding (= 5) )
- TParticle* ePos = NULL;
- TParticle* eNeg = NULL;
-
- if(particle->GetNDaughters() >= 2){
- for(Int_t daughterIndex=particle->GetFirstDaughter();daughterIndex<=particle->GetLastDaughter();daughterIndex++){
- TParticle *tmpDaughter = fMCStack->Particle(daughterIndex);
- if(tmpDaughter->GetUniqueID() == 5){
- if(tmpDaughter->GetPdgCode() == 11){
- eNeg = tmpDaughter;
- } else if(tmpDaughter->GetPdgCode() == -11){
- ePos = tmpDaughter;
- }
- }
- }
- }
-
- if(ePos == NULL || eNeg == NULL){ // means we do not have two daughters from pair production
- return kFALSE;
- }
-
- if(AcceptanceCut(particle,ePos,eNeg))return kTRUE;
- }
- return kFALSE;
-}
-
-///________________________________________________________________________
-Bool_t AliV0ReaderV1::AcceptanceCut(TParticle *particle, TParticle * ePos,TParticle* eNeg){
-
- // cuts on distance from collision point
-
- if(particle->R()>fMaxR){
- return kFALSE;}
-
- if(ePos->R()>fMaxR){
- return kFALSE;
- }
-
- if(ePos->R()<fMinR){
- return kFALSE;
- }
-
- if( ePos->R() <= ((TMath::Abs(ePos->Vz())*fLineCutZRSlope)-fLineCutZValue)){
- return kFALSE;
- }
- /*else if (fUseEtaMinCut && ePos->R() >= ((TMath::Abs(ePos->Vz())*fLineCutZRSlopeMin)-fLineCutZValueMin )){
- return kFALSE;
- } */
-
- if(TMath::Abs(eNeg->Vz()) > fMaxZ ){ // cuts out regions where we do not reconstruct
- return kFALSE;
- }
-
- if(eNeg->Vz()!=ePos->Vz()||eNeg->R()!=ePos->R()){
- return kFALSE;
- }
-
- if(TMath::Abs(ePos->Vz()) > fMaxZ ){ // cuts out regions where we do not reconstruct
- return kFALSE;
- }
-
- if(TMath::Abs(particle->Eta())> fEtaCut || TMath::Abs(particle->Eta())< fEtaCutMin){
- return kFALSE;
- }
-
- if(TMath::Abs(ePos->Eta())> fEtaCut || TMath::Abs(ePos->Eta())< fEtaCutMin){
- return kFALSE;
- }
-
- if(TMath::Abs(eNeg->Eta())> fEtaCut || TMath::Abs(eNeg->Eta())< fEtaCutMin){
- return kFALSE;
- }
-
- if( ePos->Pt()< fSinglePtCut || eNeg->Pt()< fSinglePtCut){
- return kFALSE;
- }
-
- if(particle->Pt()<fPtCut){
- return kFALSE;
- }
-
- return kTRUE;
-}
-///________________________________________________________________________
-void AliV0ReaderV1::PrintCuts(){
-
- cout<<"V0 Reader initialized with following settings"<<endl;
-
-
- cout<<"Acceptance Eta:"<<endl;
- cout<<fEtaCutMin<<" < eta < "<<fEtaCut<<endl;
- cout<<"Conversion Point"<<endl;
- cout<<"Z <"<<fMaxZ<<endl;
- cout<<fMinR<<" < R < "<<fMaxR<<endl;
- cout<<"Line Cut Slope"<<fLineCutZRSlope<<" ZValue "<<fLineCutZValue<<endl;
-
- cout<<"Pt Gamma > "<<fPtCut<<endl;
- cout<<"Pt Daughters > "<<fSinglePtCut<<endl;
-
- cout<<"Armenteros Qt Cut"<<endl;
-
- if(fDoHighPtQtGammaSelection){
- cout<<" qt < "<<fQtMax<<" for pt < "<<fPtBorderForQt<<endl;
- cout<<" qt < "<<fHighPtQtMax<<" for pt > "<<fPtBorderForQt<<endl;
- }
- else{
- cout<<" qt < "<<fQtMax<<endl;
- }
- cout<<"Chi2perNDF > "<<fChi2CutConversion<<endl;
-
-
-
-}
-
-//_______________________________________________________________________
-
-Bool_t AliV0ReaderV1::CentralitySelection(){
-
- fCentralityBin=-1;
-
- if(!fIsHeavyIon){fCentralityBin=0;fCentrality=0;return kTRUE;}
-
- fCentrality=GetCentrality();
-
- if(fIsHeavyIon){
-
- if(fBGHandler){
- fCentralityBin=fBGHandler->GetCentralityBinIndex(Int_t(fCentrality));
- }
- else{
- Double_t fCentralityBins[fNCentralityBins+1];
- for(int i=0;i<fNCentralityBins;i++){
- fCentralityBins[i]=i*100/Double_t(fNCentralityBins);
- }
-
- for(int i=0;i<fNCentralityBins;i++){
- if(fCentrality>fCentralityBins[i]&&fCentrality<fCentralityBins[i+1]){
- fCentralityBin=i;
- return kTRUE;}
- }
- }
-
- }
- if(fCentralityBin>=0&&fCentrality>=0){
-
- return kTRUE;
- }
-
- AliWarning("Centrality not defined");
- return kFALSE;
-
-}
-
-//________________________________________________________________________
-void AliV0ReaderV1::Terminate(Option_t *)
-{
-
- printf(Form("V0ReaderV1: V0s processed: %4.0f reconstructed photons: %4.0f \n",hV0CurrentFinder->GetEntries(),hV0Good->GetEntries()));
-
-}
+++ /dev/null
-#ifndef ALIV0READERV1_H
-#define ALIV0READERV1_H
-
-#include "AliAnalysisTaskSE.h"
-#include "TClonesArray.h"
-#include "AliKFParticle.h"
-#include "AliAODv0.h"
-#include "AliESDv0.h"
-#include "AliAODEvent.h"
-#include "AliESDEvent.h"
-#include "AliKFConversionPhoton.h"
-#include "AliConversionPhotonBase.h"
-#include "AliConversionAODBGHandlerRP.h"
-#include "TVector.h"
-#include "AliKFVertex.h"
-#include "AliAODTrack.h"
-#include "AliESDtrack.h"
-#include "AliVTrack.h"
-#include "AliStack.h"
-#include "AliEventplane.h"
-
-#include "TH1.h"
-#include "TH2.h"
-
-class AliAODConversionPhoton;
-
-using namespace std;
-
-class AliV0ReaderV1 : public AliAnalysisTaskSE {
-
- public:
-
- AliV0ReaderV1(const char *name="V0ReaderV1");
- virtual ~AliV0ReaderV1(); //virtual destructor
- void UserCreateOutputObjects();
-
- virtual void UserExec(Option_t *option);
- virtual void Terminate(Option_t *);
-
- // Reconstruct Gammas
- void ProcessV0();
-
- Bool_t CheckV0Status();
-
- void ProcessMC(AliKFConversionPhoton*);
- void ProcessMCGammasForEfficiency();
-
- void SetIsHeavyIon(Bool_t heavyion){fIsHeavyIon=heavyion;if(!fIsHeavyIon){fNCentralityBins=1;}}
-
- // Return Reconstructed Gammas
- TClonesArray *GetReconstructedGammas(){return fConversionGammas;}
- Int_t GetNReconstructedGammas(){if(fConversionGammas){return fConversionGammas->GetEntriesFast();}else{return 0;}}
-
- // Process Gamma Candidates
-
- Bool_t IsGammaCandidate(AliConversionPhotonBase *fPhotonCandidate);
- Bool_t IsMCConversionGammaInAcceptance(TParticle *particle);
-
- void PrintCuts();
-
- Bool_t CentralitySelection();
- Bool_t VertexZCut();
- Double_t GetCentrality();
- Bool_t SetEventPlane();
- AliEventplane *GetEventPlane();
- AliVTrack *GetTrack(Int_t label);
-
- // Getter Functions
-
- const AliExternalTrackParam *GetExternalTrackParam(Int_t charge);
- const AliExternalTrackParam *GetExternalTrackParamP(){return GetExternalTrackParam(1);};
- const AliExternalTrackParam *GetExternalTrackParamN(){return GetExternalTrackParam(-1);};
-
-
- Bool_t GetConversionPoint(const AliExternalTrackParam *pparam,const AliExternalTrackParam *nparam,Double_t convpos[3]);
- Bool_t GetHelixCenter(const AliExternalTrackParam *track, Double_t b,Int_t charge, Double_t center[2]);
-
- Double_t GetMagneticField() const{if(fESDEvent){return fESDEvent->GetMagneticField();}if(fAODEvent){return fAODEvent->GetMagneticField();}return 0;}
-
-
- const AliVertex *GetPrimaryVertex();
-
- AliKFParticle *GetPositiveKFParticle(AliAODv0 *fCurrentV0,Int_t fTrackLabel[2]);
- AliKFParticle *GetNegativeKFParticle(AliAODv0 *fCurrentV0,Int_t fTrackLabel[2]);
- AliKFParticle *GetPositiveKFParticle(AliESDv0 *fCurrentV0,Int_t fTrackLabel[2]);
- AliKFParticle *GetNegativeKFParticle(AliESDv0 *fCurrentV0,Int_t fTrackLabel[2]);
-
- Int_t GetNumberOfContributorsVtx();
-
- // Cut Functions
-
- Bool_t EventIsSelected(){return fEventIsSelected;}
- Bool_t TrackCuts(AliConversionPhotonBase *fPhotonCandidate);
- Bool_t AcceptanceCuts(AliConversionPhotonBase *fPhotonCandidate);
- Bool_t AcceptanceCut(TParticle *particle, TParticle * ePos,TParticle* eNeg);
- Bool_t dEdxCuts(AliConversionPhotonBase *fPhotonCandidate);
- Bool_t ArmenterosQtCut(AliConversionPhotonBase *fPhotonCandidate);
- Bool_t AsymmetryCut(AliConversionPhotonBase *fPhotonCandidate);
- Bool_t PIDProbabilityCut(AliConversionPhotonBase *fPhotonCandidate);
- Bool_t EventCuts();
-
- // Set Mass Zero for Gammas
- void SetGammaMassZero(){fCurrentMotherKFCandidate->E()=fCurrentMotherKFCandidate->GetP();}
-
-
- // Set Output
-
- void SetUseAODConversionPhoton(Bool_t b){if(b){cout<<"Setting Outputformat to AliAODConversionPhoton "<<endl;}else{cout<<"Setting Outputformat to AliKFConversionPhoton "<<endl;};kUseAODConversionPhoton=b;}
-
- void SetCreateAODs(Bool_t k){fCreateAOD=k;}
- void SetDeltaAODFilename(TString s){fDeltaAODFilename=s;}
-
-
-
-
- // Set Cuts
-
- void SetMaxVertexZ(Double_t maxVertexZ){fMaxVertexZ=maxVertexZ;}
-
- void SetUseImprovedVertex(Bool_t useImprovedVertex){fUseImprovedVertex=useImprovedVertex;}
-
- void SetOnFlyFlag(Bool_t flag){fUseOnFlyV0Finder = flag;}
-
- void SetMaxRCut(Double_t maxR){fMaxR=maxR;}
- void SetMinRCut(Double_t minR){fMinR=minR;}
-
- void SetEtaCut(Double_t etaCut){fEtaCut=etaCut;}
-
- void SetEtaCutMin(Double_t etaCutMin){fEtaCutMin=etaCutMin;}
-
- void SetPtCut(Double_t ptCut){fPtCut=ptCut;}
-
- void SetSinglePtCut(Double_t singleptCut){fSinglePtCut=singleptCut;}
-
- void SetMaxZCut(Double_t maxZ){fMaxZ=maxZ;}
-
- void SetMinClsTPCCut(Double_t minClsTPC){fMinClsTPC=minClsTPC;}
-
- void SetMinClsTPCCutToF(Double_t minClsTPCToF){fMinClsTPCToF=minClsTPCToF;}
-
- void SetLineCutZRSlope(Double_t LineCutZRSlope){fLineCutZRSlope=LineCutZRSlope;}
- void SetLineCutZValue(Double_t LineCutZValue){fLineCutZValue=LineCutZValue;}
-
- void SetLineCutZRSlopeMin(Double_t LineCutZRSlopeMin){fLineCutZRSlopeMin=LineCutZRSlopeMin;}
- void SetLineCutZValueMin(Double_t LineCutZValueMin){fLineCutZValueMin=LineCutZValueMin;}
-
- void SetChi2CutConversion(Double_t chi2){fChi2CutConversion=chi2;}
-
- void SetPIDProbability(Double_t pidProb){fPIDProbabilityCutPositiveParticle=pidProb; fPIDProbabilityCutNegativeParticle=pidProb;}
-
- void SetPIDProbabilityNegativeParticle(Double_t pidProb){fPIDProbabilityCutNegativeParticle=pidProb;}
-
- void SetPIDProbabilityPositiveParticle(Double_t pidProb){fPIDProbabilityCutPositiveParticle=pidProb;}
-
- void SetPIDnSigmaAboveElectronLine(Double_t nSigmaAbove){fPIDnSigmaAboveElectronLine=nSigmaAbove;}
- void SetTofPIDnSigmaAboveElectronLine(Double_t nTofSigmaAbove){fTofPIDnSigmaAboveElectronLine=nTofSigmaAbove;} // RRnewTOF
-
- void SetPIDnSigmaBelowElectronLine(Double_t nSigmaBelow){fPIDnSigmaBelowElectronLine=nSigmaBelow;}
- void SetTofPIDnSigmaBelowElectronLine(Double_t nTofSigmaBelow){fTofPIDnSigmaBelowElectronLine=nTofSigmaBelow;} // RRnewTOF
-
- /*
- * Sets the PIDnSigmaAbovePion cut value for the tracks.
- */
- void SetPIDnSigmaAbovePionLine(Double_t nSigmaAbovePion){fPIDnSigmaAbovePionLine=nSigmaAbovePion;}
-
- /*
- * Sets the PIDnSigmaAbovePion cut value for the tracks.
- */
- void SetPIDnSigmaAbovePionLineHighPt(Double_t nSigmaAbovePionHighPt){fPIDnSigmaAbovePionLineHighPt=nSigmaAbovePionHighPt;}
-
- /*
- * Sets the PIDMinPnSigmaAbovePion cut value for the tracks.
- */
- void SetPIDMinPnSigmaAbovePionLine(Double_t MinPnSigmaAbovePion){fPIDMinPnSigmaAbovePionLine=MinPnSigmaAbovePion;}
-
- /*
- * Sets the PIDMinPnSigmaAbovePion cut value for the tracks.
- */
- void SetPIDMaxPnSigmaAbovePionLine(Double_t MaxPnSigmaAbovePion){fPIDMaxPnSigmaAbovePionLine=MaxPnSigmaAbovePion;}
-
- /*
- * Sets the SigmaMassCut value.
- */
- void SetSigmaMass(Double_t sigmaMass){fNSigmaMass=sigmaMass;}
-
- void SetTRDEfficiency(Double_t eff){if(eff<=1&&eff>=0){fPIDTRDEfficiency=eff;}}
- void SetDoTRDPID(Bool_t doTRD){fDoTRDPID=doTRD;}
-
- void SetDodEdxSigmaCut( Bool_t dodEdxSigmaCut){fDodEdxSigmaCut=dodEdxSigmaCut;}
- void SetDoTOFsigmaCut( Bool_t doTOFsigmaCut){fDoTOFsigmaCut=doTOFsigmaCut;} //RRnewTOF
- void SetDoPhotonAsymmetryCut( Bool_t doPhotonAsymmetryCut){fDoPhotonAsymmetryCut=doPhotonAsymmetryCut;}
-
- void SetMinPPhotonAsymmetryCut(Double_t minPPhotonAsymmetryCut){fMinPPhotonAsymmetryCut=minPPhotonAsymmetryCut;}
- void SetMinPhotonAsymmetry(Double_t minPhotonAsymmetry){fMinPhotonAsymmetry=minPhotonAsymmetry;}
- /*
- * Sets the flag to enable/disable the cut dedx N sigma for Kaon Rejection at low p
- */
- void SetDoKaonRejectionLowP( Bool_t doKaonRejectionLowP){fDoKaonRejectionLowP=doKaonRejectionLowP;}
- /*
- * Sets the flag to enable/disable the cut dedx N sigma for Proton Rejection at low p
- */
- void SetDoProtonRejectionLowP( Bool_t doProtonRejectionLowP){fDoProtonRejectionLowP=doProtonRejectionLowP;}
-
- /*
- * Sets the flag to enable/disable the cut dedx N sigma for Pion Rejection at low p
- */
- void SetDoPionRejectionLowP( Bool_t doPionRejectionLowP){fDoPionRejectionLowP=doPionRejectionLowP;}
-
- /*
- * Sets the PIDMinPnSigmaAroundKaon cut value for the tracks.
- */
- void SetPIDnSigmaAtLowPAroundKaonLine(Double_t nSigmaAtLowPAroundKaon){fPIDnSigmaAtLowPAroundKaonLine =nSigmaAtLowPAroundKaon;}
-
- /*
- * Sets the PIDMinPnSigmaAroundProton cut value for the tracks.
- */
- void SetPIDnSigmaAtLowPAroundProtonLine(Double_t nSigmaAtLowPAroundProton){fPIDnSigmaAtLowPAroundProtonLine =nSigmaAtLowPAroundProton;}
-
- /*
- * Sets the PIDMinPnSigmaAroundPion cut value for the tracks.
- */
- void SetPIDnSigmaAtLowPAroundPionLine(Double_t nSigmaAtLowPAroundPion){fPIDnSigmaAtLowPAroundPionLine =nSigmaAtLowPAroundPion;}
-
- /*
- * Sets the PIDMinPnSigmaAbovePion cut value for the tracks.
- */
- void SetPIDMinPKaonRejectionLowP(Double_t PIDMinPKaonRejectionLowP ){fPIDMinPKaonRejectionLowP=PIDMinPKaonRejectionLowP;}
-
- /*
- * Sets the PIDMinPnSigmaAbovePion cut value for the tracks.
- */
- void SetPIDMinPProtonRejectionLowP(Double_t PIDMinPProtonRejectionLowP ){fPIDMinPProtonRejectionLowP=PIDMinPProtonRejectionLowP;}
- /*
- * Sets the PIDMinPnSigmaAbovePion cut value for the tracks.
- */
- void SetPIDMinPPionRejectionLowP(Double_t PIDMinPPionRejectionLowP ){fPIDMinPPionRejectionLowP=PIDMinPPionRejectionLowP;}
-
- /*
- *Set if we want to use Gamma Selection based on Qt from Armenteros
- */
- void SetDoQtGammaSelection(Bool_t doQtGammaSelection){fDoQtGammaSelection=doQtGammaSelection;}
- void SetDoHighPtQtGammaSelection(Bool_t doHighPtQtGammaSelection){fDoHighPtQtGammaSelection=doHighPtQtGammaSelection;} // RRnew
-
- void SetQtMax(Double_t qtMax){fQtMax=qtMax;}
- void SetHighPtQtMax(Double_t qtMaxHighPt){fHighPtQtMax=qtMaxHighPt;} // RRnew
- void SetPtBorderForQt(Double_t ptBorderForQt){fPtBorderForQt=ptBorderForQt;} // RRnew
-
- void SetUseOwnXYZCalculation(Bool_t flag){fUseOwnXYZCalculation=flag;}
-
- void SetUseConstructGamma(Bool_t flag){fUseConstructGamma=flag;}
-
-protected:
- TClonesArray *fConversionGammas;
- AliESDEvent *fESDEvent;
- AliAODEvent *fAODEvent;
- AliStack *fMCStack;
- TList *fOutputList;
- AliKFConversionPhoton *fCurrentMotherKFCandidate;
- AliKFParticle *fCurrentPositiveKFParticle;
- AliKFParticle *fCurrentNegativeKFParticle;
- Int_t *fCurrentTrackLabels;
- Int_t fCurrentV0Index;
- Int_t fNCentralityBins;
- Int_t fCentralityBin;
- Bool_t fEventIsSelected;
- AliConversionAODBGHandlerRP *fBGHandler;
- Double_t fVertexZ;
- Double_t fCentrality;
- Double_t fEPAngle;
-
-private:
- //Event Cuts
- Double_t fMaxVertexZ; // max z vertex cut
- //cuts
- Double_t fMaxR; //r cut
- Double_t fMinR; //r cut
- Double_t fEtaCut; //eta cut
- Double_t fEtaCutMin; //eta cut
- Double_t fPtCut; // pt cut
- Double_t fSinglePtCut; // pt cut for electron/positron
- Double_t fMaxZ; //z cut
- Double_t fMinClsTPC; // minimum clusters in the TPC
- Double_t fMinClsTPCToF; // minimum clusters to findable clusters
- Double_t fLineCutZRSlope; //linecut
- Double_t fLineCutZValue; //linecut
- Double_t fLineCutZRSlopeMin; //linecut
- Double_t fLineCutZValueMin; //linecut
- Double_t fChi2CutConversion; //chi2cut
- Double_t fPIDProbabilityCutNegativeParticle;
- Double_t fPIDProbabilityCutPositiveParticle;
- Bool_t fDodEdxSigmaCut; // flag to use the dEdxCut based on sigmas
- Bool_t fDoTOFsigmaCut; // flag to use TOF pid cut RRnewTOF
- Double_t fPIDTRDEfficiency;
- Bool_t fDoTRDPID;
- Double_t fPIDnSigmaAboveElectronLine; // sigma cut
- Double_t fPIDnSigmaBelowElectronLine; // sigma cut
- Double_t fTofPIDnSigmaAboveElectronLine; // sigma cut RRnewTOF
- Double_t fTofPIDnSigmaBelowElectronLine; // sigma cut RRnewTOF
- Double_t fPIDnSigmaAbovePionLine; // sigma cut
- Double_t fPIDnSigmaAbovePionLineHighPt; // sigma cut
- Double_t fPIDMinPnSigmaAbovePionLine; // sigma cut
- Double_t fPIDMaxPnSigmaAbovePionLine; // sigma cut
- Double_t fDoKaonRejectionLowP; // Kaon rejection at low p
- Double_t fDoProtonRejectionLowP; // Proton rejection at low p
- Double_t fDoPionRejectionLowP; // Pion rejection at low p
- Double_t fPIDnSigmaAtLowPAroundKaonLine; // sigma cut
- Double_t fPIDnSigmaAtLowPAroundProtonLine; // sigma cut
- Double_t fPIDnSigmaAtLowPAroundPionLine; // sigma cut
- Double_t fPIDMinPKaonRejectionLowP; // Momentum limit to apply kaon rejection
- Double_t fPIDMinPProtonRejectionLowP; // Momentum limit to apply proton rejection
- Double_t fPIDMinPPionRejectionLowP; // Momentum limit to apply proton rejection
- Bool_t fDoQtGammaSelection; // Select gammas using qtMax
- Bool_t fDoHighPtQtGammaSelection; // RRnew Select gammas using qtMax for high pT
- Double_t fQtMax; // Maximum Qt from Armenteros to select Gammas
- Double_t fHighPtQtMax; // RRnew Maximum Qt for High pT from Armenteros to select Gammas
- Double_t fPtBorderForQt; // RRnew
- Double_t fXVertexCut; //vertex cut
- Double_t fYVertexCut; //vertex cut
- Double_t fZVertexCut; // vertexcut
-
- Double_t fNSigmaMass; //nsigma cut
-
- Bool_t fUseImprovedVertex; //flag
-
- Bool_t fUseOwnXYZCalculation; //flag that determines if we use our own calculation of xyz (markus)
-
- Bool_t fUseConstructGamma; //flag that determines if we use ConstructGamma method from AliKF
-
- Bool_t fUseEtaMinCut; //flag
-
- Bool_t fUseOnFlyV0Finder; //flag
-
- Bool_t fDoPhotonAsymmetryCut; // flag to use the PhotonAsymetryCut
- Double_t fMinPPhotonAsymmetryCut;
- Double_t fMinPhotonAsymmetry;
-
- Bool_t kUseAODConversionPhoton;
-
- Bool_t fIsHeavyIon;
- Bool_t fCreateAOD;
- TString fDeltaAODFilename;
-
-
-
- // Histograms
-
- TH1F *hV0CurrentFinder;
- TH2F *hV0AllArmenteros;
- TH1F *hV0Good;
- TH2F *hV0GoodArmenteros;
-
- TH1F *hV0CutLikeSign;
- TH1F *hV0CutRefit;
- TH1F *hV0CutKinks;
- TH1F *hV0CutMinNclsTPCToF;
-
- TH1F *hV0CutNContributors;
- TH1F *hV0CutVertexZ;
-
- TH1F *hV0CutdEdxElectron;
- TH1F *hV0CutdEdxPion;
- TH1F *hV0CutdEdxKaonLowP;
- TH1F *hV0CutdEdxProtonLowP;
- TH1F *hV0CutdEdxPionLowP;
- TH1F *hV0CutdEdxTOFElectron;
- TH1F * hV0CutdEdxTRD;
-
- TH1F *hV0CutQt;
-
- TH1F *hV0CutR;
- TH1F *hV0CutMinR;
- TH1F *hV0CutLine;
- TH1F *hV0CutZ;
- TH1F *hV0CutEta;
- TH1F *hV0CutSinglePt;
- TH1F *hV0CutPt;
- TH1F *hV0CutNDF;
- TH1F *hV0CutChi2;
-
- TH1F *hV0CutPIDProb;
- TH1F* hV0CutAsymmetry;
-
- TH2F *hMCPtResolution;
- TH1F **hGammaPt;
- TH1F **hMCPtRECOTRUE;
- TH1F **hMCPtTRUE;
- TH2F *hMCPtResolutionPhi;
- TH2F *hMCRResolutionvsR;
- TH2F *hMCZResolutionvsZ;
- TH1F *hGammaPhi;
- TH2F *hGammadEdxbefore;
- TH2F *hGammadEdxafter;
- TH2F *hGammaConversionMapXY;
- TH2F *hGammaConversionMapZR;
-
- // Event
-
- TH1F *hV0EventCuts;
- TH1F *hNEvents;
- TH1F *hCentrality;
- TH1F *hVertexZ;
-
-
- ClassDef(AliV0ReaderV1,1)
-};
-
-
-#endif
-
-
-
-
-