#include "AliAnalysisTaskAj.h"
+using std::cout;
+using std::endl;
+
ClassImp(AliAnalysisTaskAj)
AliAnalysisTaskAj::AliAnalysisTaskAj() :
AliAnalysisTaskSE(),
fESD(0x0),
-fAOD(0x0),
+fAODIn(0x0),
+fAODOut(0x0),
fAODExtension(0x0),
fBackgroundBranch(""),
fNonStdFile(""),
AliAnalysisTaskAj::AliAnalysisTaskAj(const char *name) :
AliAnalysisTaskSE(name),
fESD(0x0),
-fAOD(0x0),
+fAODIn(0x0),
+fAODOut(0x0),
fAODExtension(0x0),
fBackgroundBranch(""),
fNonStdFile(""),
fESD=dynamic_cast<AliESDEvent*>(InputEvent());
if (!fESD) {
AliError("ESD not available");
- fAOD = dynamic_cast<AliAODEvent*>(InputEvent());
- } else {
- fAOD = dynamic_cast<AliAODEvent*>(AODEvent());
- }
+ fAODIn = dynamic_cast<AliAODEvent*>(InputEvent());}
+ fAODOut = dynamic_cast<AliAODEvent*>(AODEvent());
+
+ static AliAODEvent* aod = 0;
+ // take all other information from the aod we take the tracks from
+ if(!aod){
+ if(!fESD)aod = fAODIn;
+ else aod = fAODOut;}
+
+
if(fNonStdFile.Length()!=0){
// case that we have an AOD extension we need can fetch the jets from the extended output
}
// vertex selection
- if(!fAOD){
+ if(!aod){
if(fDebug) Printf("%s:%d No AOD",(char*)__FILE__,__LINE__);
fHistEvtSelection->Fill(3);
PostData(1, fOutputList);
}
- AliAODVertex* primVtx = fAOD->GetPrimaryVertex();
+ AliAODVertex* primVtx = aod->GetPrimaryVertex();
if(!primVtx){
if(fDebug) Printf("%s:%d No primVtx",(char*)__FILE__,__LINE__);
Double_t centValue = 0.;
if(fESD) {cent = fESD->GetCentrality();
if(cent) centValue = cent->GetCentralityPercentile("V0M");}
- else centValue=fAOD->GetHeader()->GetCentrality();
+ else centValue=aod->GetHeader()->GetCentrality();
if(fDebug) printf("centrality: %f\n", centValue);
- if (centValue < fCentMin || centValue > fCentMax){
- fHistEvtSelection->Fill(4);
- PostData(1, fOutputList);
- return;
- }
+ // if (centValue < fCentMin || centValue > fCentMax){
+ // fHistEvtSelection->Fill(4);
+ // PostData(1, fOutputList);
+ // return;
+ // }
fHistEvtSelection->Fill(0);
// get background
AliAODJetEventBackground* externalBackground = 0;
- if(fAOD&&!externalBackground&&fBackgroundBranch.Length()){
- externalBackground = (AliAODJetEventBackground*)(fAOD->FindListObject(fBackgroundBranch.Data()));
+ if(fAODOut&&!externalBackground&&fBackgroundBranch.Length()){
+ externalBackground = (AliAODJetEventBackground*)(fAODOut->FindListObject(fBackgroundBranch.Data()));
if(!externalBackground)Printf("%s:%d Background branch not found %s",(char*)__FILE__,__LINE__,fBackgroundBranch.Data());;
}
if(fAODExtension&&!externalBackground&&fBackgroundBranch.Length()){
if(!externalBackground)Printf("%s:%d Background branch not found %s",(char*)__FILE__,__LINE__,fBackgroundBranch.Data());;
}
- Float_t rho = 0;
+ if(fAODIn&&!externalBackground&&fBackgroundBranch.Length()){
+ externalBackground = (AliAODJetEventBackground*)(fAODIn->FindListObject(fBackgroundBranch.Data()));
+ if(!externalBackground)Printf("%s:%d Background branch not found %s",(char*)__FILE__,__LINE__,fBackgroundBranch.Data());;
+ }
+ Float_t rho = 0;
if(externalBackground)rho = externalBackground->GetBackground(0);
// fetch jets
TClonesArray *aodJets[2];
aodJets[0]=0;
- if(fAOD&&!aodJets[0]){
- aodJets[0] = dynamic_cast<TClonesArray*>(fAOD->FindListObject(fJetBranchName[0].Data()));
- aodJets[1] = dynamic_cast<TClonesArray*>(fAOD->FindListObject(fJetBranchName[1].Data())); }
+ if(fAODOut&&!aodJets[0]){
+ aodJets[0] = dynamic_cast<TClonesArray*>(fAODOut->FindListObject(fJetBranchName[0].Data()));
+ aodJets[1] = dynamic_cast<TClonesArray*>(fAODOut->FindListObject(fJetBranchName[1].Data())); }
if(fAODExtension && !aodJets[0]){
aodJets[0] = dynamic_cast<TClonesArray*>(fAODExtension->GetAOD()->FindListObject(fJetBranchName[0].Data()));
aodJets[1] = dynamic_cast<TClonesArray*>(fAODExtension->GetAOD()->FindListObject(fJetBranchName[1].Data())); }
+ if(fAODIn&&!aodJets[0]){
+ aodJets[0] = dynamic_cast<TClonesArray*>(fAODIn->FindListObject(fJetBranchName[0].Data()));
+ aodJets[1] = dynamic_cast<TClonesArray*>(fAODIn->FindListObject(fJetBranchName[1].Data())); }
//Double_t ptsub[aodJets[0]->GetEntriesFast()];
//Int_t inord[aodJets[0]->GetEntriesFast()];
if(ptcorrj>ptmax){ptmax=ptcorrj;
selec=i;}}
///hardest jet selected
- if(selec<0){PostData(1, fOutputList);
- return;}
+ if(selec<0){PostData(1, fOutputList);
+ return;}
AliAODJet* jet1 = (AliAODJet*)(fListJets[0]->At(selec));
//What is the hardest constituent track?
AliAODTrack* leadtrack1;
Float_t ppjY = pPerp.Dot(ppJ3);
TVector2 vr(ppjX, ppjY) ;
//and this is the angle between the particle and the TM axis.
- // Float_t phistr = evec.DeltaPhi(vr);
+ Float_t phistr = evec.DeltaPhi(vr);
- Double_t phistr=vr.Phi()-evec.Phi();
+ //Double_t phistr=vr.Phi()-evec.Phi();
if(centValue<10.) fh3LocalCoordinates->Fill(ppjX,ppjY,ptcorr2);
Double_t deltaEta = eta2-track->Eta();
- if(phistr<-0.5*TMath::Pi()) phistr+=2.*TMath::Pi();
- if(phistr>3./2.*TMath::Pi()) phistr-=2.*TMath::Pi();
+
if(deltaPhi<-0.5*TMath::Pi()) deltaPhi+=2.*TMath::Pi();
if(deltaPhi>3./2.*TMath::Pi()) deltaPhi-=2.*TMath::Pi();
Int_t AliAnalysisTaskAj::GetListOfTracks(TList *list){
Int_t iCount = 0;
- if(!fAOD)return iCount;
+
+ AliAODEvent *aod = 0;
+ if(!fESD)aod = fAODIn;
+ else aod = fAODOut;
+ if(!aod) return iCount;
- for(int it = 0;it < fAOD->GetNumberOfTracks();++it){
- AliAODTrack *tr = fAOD->GetTrack(it);
+ for(int it = 0;it < aod->GetNumberOfTracks();++it){
+ AliAODTrack *tr = aod->GetTrack(it);
if((fFilterMask>0)&&!(tr->TestFilterBit(fFilterMask)))continue;
if(TMath::Abs(tr->Eta())>0.9)continue;
if(tr->Pt()<0.15)continue;
}
Int_t AliAnalysisTaskAj::GetHardestTrackBackToJet(AliAODJet *jetbig){
-
+
+ Int_t index=-1;
+ AliAODEvent *aod = 0;
+ if(!fESD)aod = fAODIn;
+ else aod = fAODOut;
+ if(!aod) return index;
+
- Int_t index=-1;
Double_t ptmax=-10;
Double_t dphi=0;
Double_t dif=0;
Int_t iCount=0;
- for(int it = 0;it < fAOD->GetNumberOfTracks();++it){
- AliAODTrack *tr = fAOD->GetTrack(it);
+ for(int it = 0;it < aod->GetNumberOfTracks();++it){
+ AliAODTrack *tr = aod->GetTrack(it);
if((fFilterMask>0)&&!(tr->TestFilterBit(fFilterMask)))continue;
if(TMath::Abs(tr->Eta())>0.9)continue;
if(tr->Pt()<0.15)continue;
Int_t AliAnalysisTaskAj::GetListOfTracksCloseToJet(TList *list,AliAODJet *jetbig){
Int_t iCount = 0;
+ AliAODEvent *aod = 0;
+ if(!fESD)aod = fAODIn;
+ else aod = fAODOut;
+ if(!aod) return iCount;
+
- for(int it = 0;it < fAOD->GetNumberOfTracks();++it){
- AliAODTrack *tr = fAOD->GetTrack(it);
+ for(int it = 0;it < aod->GetNumberOfTracks();++it){
+ AliAODTrack *tr = aod->GetTrack(it);
if((fFilterMask>0)&&!(tr->TestFilterBit(fFilterMask)))continue;
if(TMath::Abs(tr->Eta())>0.9)continue;
if(tr->Pt()<0.15)continue;
{
Int_t nInputTracks = 0;
+ AliAODEvent *aod = 0;
+ if(!fESD)aod = fAODIn;
+ else aod = fAODOut;
+ if(!aod) return nInputTracks;
+
TString jbname(fJetBranchName[1]);
//needs complete event, use jets without background subtraction
if(jbname.Contains("AODextra")) jbname.ReplaceAll("AODextra","AOD");
if(fDebug) Printf("Multiplicity from jet branch %s", jbname.Data());
- TClonesArray *tmpAODjets = dynamic_cast<TClonesArray*>(fAOD->FindListObject(jbname.Data()));
+ TClonesArray *tmpAODjets = dynamic_cast<TClonesArray*>(aod->FindListObject(jbname.Data()));
if(!tmpAODjets){
Printf("Jet branch %s not found", jbname.Data());
Printf("AliAnalysisTaskAj::GetNInputTracks FAILED");
case 7:
label = "deltaPhiTM";
nbins = 60;
- xmin = -0.5*pi;
- xmax = 1.5*pi;
+ xmin = 0.;
+ xmax = 1.3*pi;
break;