--- /dev/null
+
+# -*- mode: CMake -*-
+#--------------------------------------------------------------------------------#
+# Package File for PWGCF/Correlations/JCORRAN #
+# Author : D.J Kim (Dong.Jo.Kim@cern.ch) #
+# Variables Defined : #
+# #
+# SRCS - C++ source files #
+# HDRS - C++ header files #
+# DHDR - ROOT Dictionary Linkdef header file #
+# CSRCS - C source files #
+# CHDRS - C header files #
+# EINCLUDE - Include directories #
+# EDEFINE - Compiler definitions #
+# ELIBS - Extra libraries to link #
+# ELIBSDIR - Extra library directories #
+# PACKFFLAGS - Fortran compiler flags for package #
+# PACKCXXFLAGS - C++ compiler flags for package #
+# PACKCFLAGS - C compiler flags for package #
+# PACKSOFLAGS - Shared library linking flags #
+# PACKLDFLAGS - Module linker flags #
+# PACKBLIBS - Libraries to link (Executables only) #
+# EXPORT - Header files to be exported #
+# CINTHDRS - Dictionary header files #
+# CINTAUTOLINK - Set automatic dictionary generation #
+# ARLIBS - Archive Libraries and objects for linking (Executables only) #
+# SHLIBS - Shared Libraries and objects for linking (Executables only) #
+#--------------------------------------------------------------------------------#
+
+set ( SRCS
+ Correlations/JCORRAN/AliJEbeHistos.cxx
+ Correlations/JCORRAN/AliJEbePercentile.cxx
+ Correlations/JCORRAN/AliJEbECORRTask.cxx
+ Correlations/JCORRAN/AliJJetTask.cxx
+ Correlations/JCORRAN/AliJDiJetAnalysis.cxx
+ Correlations/JCORRAN/AliJDiJetTask.cxx
+ Correlations/JCORRAN/AliJJetCORRAnalysis.cxx
+ Correlations/JCORRAN/AliJJetCORRTask.cxx
+)
+
+string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
+
+set ( DHDR PWGCFCorrelationsJCORRANProLinkDef.h )
+
+string ( REPLACE ".cxx" ".h" EXPORT "${SRCS}" )
+
+set ( EINCLUDE ANALYSIS CORRFW PWGCF/Correlations/JCORRAN PWG/Tools PWG/EMCAL PWGJE/EMCALJetTasks PWGJE/EMCALJetTasks/UserTasks OADB STEER/AOD STEER/ESD STEER/STEERBase EMCAL PHOS )
+
+
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+// Comment describing what this class does needed!
+
+//===========================================================
+// Dummy comment, should be replaced by a real one
+// comment
+// comment
+//===========================================================
+
+#include <TRandom.h>
+#include <TMath.h>
+#include "AliJJet.h"
+#include "AliJDiJetAnalysis.h"
+#include "AliJHistManager.h"
+
+AliJDiJetAnalysis::AliJDiJetAnalysis():
+ fInputList(NULL),
+ fJetList(NULL),
+ fJetListOfList(),
+ fIsFullAcceptance(0),
+ fJetEtaRange(0),
+ fIsMartasDiJet(0),
+ fTrackJetMap(NULL),
+ fJetPtBins(NULL),
+ fJetPtPairBins(NULL),
+ fJetPtMinCut(0),
+ fMeanDiJetPt(0),
+ fParton23Pt(0),
+ fCard(NULL),
+ fHMG(NULL),
+ fJetPtBin(),
+ fJetPtPairBin(),
+ fInvMBin(),
+ fJetTypeBin(),
+ fJetSelectionBin(),
+ fDiJetSelectionBin(),
+ fJetRBin(),
+ fJetDRBin(),
+ fDiJetBinTypeBin(),
+ fPYJetTypeBin(),
+ fBin2(),
+ fhJetPt (),
+ fhJetPhi(),
+ fhJetEta(),
+ fhJetNConst(),
+ fhJetEnergy(),
+ fhJetEnergyComp(),
+ fhJetPtComp(),
+ fhJetDRToRef(),
+ fhJetDPhiToRef(),
+ fhDiJetPtPair(),
+ fhDiJetInvM(),
+ fhDiJetKtA(),
+ fhDiJetDeltaR(),
+ fhDiJetDeltaPhi(),
+ fhDiJetDeltaEta(),
+ fhDiJetPtAsymm(),
+ fhDiJetEAsymm(),
+ fhDiJetMultiplicity(),
+ fhPythiaJetPtPair(),
+ fhPythiaJetSum()
+{
+ // Constaractor
+}
+
+AliJDiJetAnalysis::AliJDiJetAnalysis( AliJBaseCard * card ):
+ fInputList(NULL),
+ fJetList(NULL),
+ fJetListOfList(),
+ fIsFullAcceptance(0),
+ fJetEtaRange(0),
+ fIsMartasDiJet(0),
+ fTrackJetMap(NULL),
+ fJetPtBins(NULL),
+ fJetPtPairBins(NULL),
+ fJetPtMinCut(0),
+ fMeanDiJetPt(0),
+ fParton23Pt(0),
+ fCard(card),
+ fHMG(NULL),
+ fJetPtBin(),
+ fJetPtPairBin(),
+ fInvMBin(),
+ fJetTypeBin(),
+ fJetSelectionBin(),
+ fDiJetSelectionBin(),
+ fJetRBin(),
+ fJetDRBin(),
+ fDiJetBinTypeBin(),
+ fPYJetTypeBin(),
+ fBin2(),
+ fhJetPt (),
+ fhJetPhi(),
+ fhJetEta(),
+ fhJetNConst(),
+ fhJetEnergy(),
+ fhJetEnergyComp(),
+ fhJetPtComp(),
+ fhJetDRToRef(),
+ fhJetDPhiToRef(),
+ fhDiJetPtPair(),
+ fhDiJetInvM(),
+ fhDiJetKtA(),
+ fhDiJetDeltaR(),
+ fhDiJetDeltaPhi(),
+ fhDiJetDeltaEta(),
+ fhDiJetPtAsymm(),
+ fhDiJetEAsymm(),
+ fhDiJetMultiplicity(),
+ fhPythiaJetPtPair(),
+ fhPythiaJetSum()
+{
+ // Constaractor
+}
+
+AliJDiJetAnalysis::AliJDiJetAnalysis( const AliJDiJetAnalysis & obj ):
+ fInputList(obj.fInputList),
+ fJetList(obj.fJetList),
+ fJetListOfList(obj.fJetListOfList),
+ fIsFullAcceptance(obj.fIsFullAcceptance),
+ fJetEtaRange(obj.fJetEtaRange),
+ fIsMartasDiJet(obj.fIsMartasDiJet),
+ fTrackJetMap(obj.fTrackJetMap),
+ fJetPtBins(obj.fJetPtBins),
+ fJetPtPairBins(obj.fJetPtPairBins),
+ fJetPtMinCut(obj.fJetPtMinCut),
+ fMeanDiJetPt(obj.fMeanDiJetPt),
+ fParton23Pt(obj.fParton23Pt),
+ fCard(obj.fCard),
+ fHMG(obj.fHMG),
+ fJetPtBin(obj.fJetPtBin),
+ fJetPtPairBin(obj.fJetPtPairBin),
+ fInvMBin(obj.fInvMBin),
+ fJetTypeBin(obj.fJetTypeBin),
+ fJetSelectionBin(obj.fJetSelectionBin),
+ fDiJetSelectionBin(obj.fDiJetSelectionBin),
+ fJetRBin(obj.fJetRBin),
+ fJetDRBin(obj.fJetDRBin),
+ fDiJetBinTypeBin(obj.fDiJetBinTypeBin),
+ fPYJetTypeBin(obj.fPYJetTypeBin),
+ fBin2(obj.fBin2),
+ fhJetPt(obj.fhJetPt),
+ fhJetPhi(obj.fhJetPhi),
+ fhJetEta(obj.fhJetEta),
+ fhJetNConst(obj.fhJetNConst),
+ fhJetEnergy(obj.fhJetEnergy),
+ fhJetEnergyComp(obj.fhJetEnergyComp),
+ fhJetPtComp(obj.fhJetPtComp),
+ fhJetDRToRef(obj.fhJetDRToRef),
+ fhJetDPhiToRef(obj.fhJetDPhiToRef),
+ fhDiJetPtPair(obj.fhDiJetPtPair),
+ fhDiJetInvM(obj.fhDiJetInvM),
+ fhDiJetKtA(obj.fhDiJetKtA),
+ fhDiJetDeltaR(obj.fhDiJetDeltaR),
+ fhDiJetDeltaPhi(obj.fhDiJetDeltaPhi),
+ fhDiJetDeltaEta(obj.fhDiJetDeltaEta),
+ fhDiJetPtAsymm(obj.fhDiJetPtAsymm),
+ fhDiJetEAsymm(obj.fhDiJetEAsymm),
+ fhDiJetMultiplicity(obj.fhDiJetMultiplicity),
+ fhPythiaJetPtPair(obj.fhPythiaJetPtPair),
+ fhPythiaJetSum(obj.fhPythiaJetSum)
+{
+ // Constaractor
+}
+
+AliJDiJetAnalysis& AliJDiJetAnalysis::operator=(const AliJDiJetAnalysis & obj){
+ if( this != &obj ){
+ this->~AliJDiJetAnalysis();
+ new(this) AliJDiJetAnalysis(obj);
+ }
+ return *this;
+}
+
+void AliJDiJetAnalysis::UserCreateOutputObjects(){
+ fJetListOfList.Clear();
+ // comment needed
+ fJetPtBins = fCard->GetVector("Jet:PtBins");
+ fJetPtPairBins = fCard->GetVector("Jet:PtPairBins");
+ fJetPtMinCut = fCard->Get("Jet:PtMinCut");
+ CreateHistos();
+
+ for( int i=0;i<kJNJetType;i++ ){
+ for( int j=0;j<kJNJetSelection;j++ ){
+ fJets[i][j] = NULL;
+ for( int k=0;k<kJNDiJetSelection;k++ ){
+ fDiJets[i][j][k]=NULL;
+ fDiJetBin[i][j][k][0] = -1;
+ fDiJetBin[i][j][k][1] = -1;
+ }
+ }
+ }
+}
+
+void AliJDiJetAnalysis::ClearBeforeEvent(){
+ //fJetListOfList.Clear();
+ for( int i=0;i<kJNJetType;i++ ){
+ for( int j=0;j<kJNJetSelection;j++ ){
+ if( fJets[i][j] ){
+ delete fJets[i][j];
+ fJets[i][j] = NULL;
+ }
+ for( int k=0;k<kJNDiJetSelection;k++ ){
+ if( fDiJets[i][j][k] ){
+ delete fDiJets[i][j][k];
+ fDiJets[i][j][k] = NULL;
+ }
+ }
+ }
+ }
+}
+
+void AliJDiJetAnalysis::UserExec(){
+ //cout<<"DEBUG_B1 "<<fJetListOfList.GetEntries()<<endl;
+ for( int i=0;i<fJetListOfList.GetEntries();i++ ){
+ TObjArray * ar = (TObjArray*) fJetListOfList[i];
+ if(!ar) {
+ //cout<<"DEBUG_B2 no array at "<<i<<endl;
+ continue;
+ }
+ }
+ FillHistosJets();
+ FillHistosDiJet();
+ FillPythiaDiJet(0);
+
+}
+void AliJDiJetAnalysis::Terminate() const{
+ // comment needed
+ fHMG->Write();
+ fHMG->WriteConfig();
+}
+
+
+AliJDiJet * AliJDiJetAnalysis::GetDiJets(int type, int js, int djs){
+ if( fDiJets[type][js][djs] ) return fDiJets[type][js][djs];
+ TObjArray * jets = GetJets( type, js );
+ AliJDiJet * dijet = fDiJets[type][js][djs] = new AliJDiJet();
+ if( !jets ) return dijet;
+
+ fDiJets[type][js][djs] = dijet;
+ if( type==kJIncomingJet && js!=0 && djs!=0 ){
+ return dijet;
+ }
+ //==== DIJET DiJet In Full Acceptance
+ if( djs == kJDiJetLeadingSubLeading ){
+ for( int ij=0;ij<jets->GetEntriesFast();ij++ ){
+ AliJJet * jet = (AliJJet*) jets->At(ij);
+ dijet->Add( jet );
+ if( dijet->GetEntries() >= 2 ) break;
+ }
+ }
+ //==== DIJET DiJet In Alice Acceptance
+ if( djs == kLeadingSubLeadingOpposite ){
+ for( int ij=0;ij<jets->GetEntriesFast();ij++ ){
+ AliJJet * jet = (AliJJet*) jets->At(ij);
+ dijet->Add(jet);
+ if( dijet->GetEntries() >= 2 ) break;
+ }
+ if( dijet->GetEntries() > 1){
+ double dphi = dijet->DPhi();
+ if( fabs(dphi) < TMath::Pi()/2 ) dijet->Clear();
+ }
+
+ }
+ //==== DIJET 2 : Marta - Find DiJet in Eta
+ if( djs == kJDiJetMarta ){
+ if( type == kJIncomingJet ) return dijet;
+ TObjArray *jetsFull = NULL;
+ switch ( type ){
+ case kJChargedJet: jetsFull = GetJets( kJFullJet, js );break;
+ case kJChargedJet08: jetsFull = GetJets( kJFullJet08, js );break;
+ default: jetsFull = jets;
+ }
+
+ if( !jetsFull || !jets ) return dijet;
+ AliJJet * trigJet = NULL;
+ for( int ij=0;ij<jetsFull->GetEntriesFast();ij++ ){
+ AliJJet * jet = (AliJJet*) jetsFull->At(ij);
+ if( jet->Area() < 0.3 ) continue;
+ if( jet->Pt() < 20 ) break;
+ if( jet->LeadingParticlePt() < 5 || jet->LeadingParticlePt() > 100 ) continue;
+ trigJet = jet;break;
+ }
+ if( trigJet == NULL ) return dijet;
+ double ptt = trigJet->Pt();
+ AliJJet * asocJet = NULL;
+ for( int ij=0;ij<jets->GetEntriesFast();ij++ ){
+ AliJJet * jet = (AliJJet*) jets->At(ij);
+ if( !jet ){
+ cout<<"JWARN_GETDIJET13: "<<dijet->GetEntries()<<endl;
+ continue;
+ }
+ if( jet->Area() < 0.3 ) continue;
+ double pta = jet->Pt();
+ if( pta < 20 ) break;
+ if( pta > ptt ) break;
+ if( jet->LeadingParticlePt() < 5 || jet->LeadingParticlePt() > 100 ) continue;
+ if( fabs(jet->DeltaPhi( *trigJet ))<TMath::Pi()/2 ) continue;
+ asocJet = jet;break;
+ }
+ if( asocJet ){
+ dijet->SetJets( trigJet,asocJet );
+ }
+ }
+ return fDiJets[type][js][djs];
+}
+
+TObjArray * AliJDiJetAnalysis::GetJets(int type, int js){
+ if( fJets[type][js] ) return fJets[type][js];
+ TObjArray * na = new TObjArray;
+ //=========================================
+ //== Jet Selection
+ //=========================================
+ TObjArray * jets = (TObjArray*)fJetListOfList[type];
+ if( !jets ) return na;
+ for( int i=0;i<jets->GetEntriesFast();i++ ){
+ AliJJet * jet = (AliJJet*) jets->At(i);
+ if( jet->LeadingParticleId() < 0 ) jet->ReSum();
+ if( type == kJIncomingJet ){
+ //=========================================
+ //== Incoming jets
+ //=========================================
+ if( js != kJEtaAll ) continue;
+ na->Add(jet);
+ }else if( js == kJEtaAll ){
+ //=========================================
+ //== kJEtaAll
+ //=========================================
+ if( type == kJOutgoingJet ){
+ //cout<<"DEBUG_G1 "<<jet->Eta()<<endl;
+ }
+ if( fabs(jet->Eta()) < 5 ){
+ na->Add(jet);
+ }
+ }else if( js == kJEtaAlice ){
+ //=========================================
+ //== kJEtaAlice
+ //=========================================
+ if( fabs(jet->Eta()) < 0.4 ){
+ na->Add(jet);
+ }
+ }
+ }// jets
+ //=========================================
+ //== NOJET
+ //=========================================
+ if( na->GetEntries() < 1 ){
+ delete na;
+ na=NULL;
+ }
+ return fJets[type][js]=na;
+}
+
+void AliJDiJetAnalysis::FillHistosJets(){
+ //==== TYPE
+ //for( int type=0;type<kJNJetType;type++:set ){
+ for( int type=0;type<fJetListOfList.GetEntriesFast();type++ ){
+ //==== Jet Selection
+ for( int js=0;js<kJNJetSelection;js++ ){
+ //cout<<"DEBUG_F0: type="<< type <<"\tjs="<<js<<endl;
+ TObjArray *jets = GetJets( type, js );
+ if( !jets ) {
+ //cout<<"DEBUG_F1: type="<< type <<"\tjs="<<js<<"\t"<<jets<<endl;
+ continue;
+ }else{
+ //cout<<"DEBUG_F2: type="<< type <<"\tjs="<<js<<"\t"<<jets<<endl;
+ }
+ //==== jets
+ for( int i=0;i<jets->GetEntriesFast();i++ ){
+ AliJJet * jet = dynamic_cast<AliJJet*>( jets->At(i) );
+ if( !jet ) {
+ //cout<<"DEBUG_F15 type="<<type<<"\tjs="<<js<<"\ti="<<i<<endl;
+ continue;
+ }else{
+ //cout<<"DEBUG_F16 type="<<type<<"\tjs="<<js<<"\ti="<<i<<endl;
+
+ }
+ fhJetPt[type][js]->Fill( jet->Pt() );
+ fhJetPhi[type][js]->Fill( jet->Phi() );
+ fhJetEta[type][js]->Fill( jet->Eta() );
+ fhJetNConst[type][js]->Fill( jet->GetNConstituents() );
+ fhJetEnergy[type][js]->Fill( jet->E() );
+ //== DiJet Multiplicity
+ for( int j=i+1;j<jets->GetEntriesFast();j++ ){
+ AliJJet * jet1 = dynamic_cast<AliJJet*>( jets->At(j) );
+ AliJDiJet dijet(jet,jet1);
+ fhDiJetMultiplicity[type][js]->Fill( dijet.InvM() );
+ }
+ }
+ }
+ }
+}
+
+void AliJDiJetAnalysis::FillHistosDiJet(){
+ //==== TYPE
+ //for( int type=0;type<kJNJetType;type++ ){
+ for( int type=0;type<fJetListOfList.GetEntriesFast();type++ ){
+ //==== Jet Selection
+ for( int js=0;js<kJNJetSelection;js++ ){
+ //==== DiJet Selection
+ for( int djs=0;djs<kJNDiJetSelection;djs++ ){
+ AliJDiJet & dijet = *GetDiJets( type, js, djs );
+ if( dijet.GetEntries() < 2 ) continue;
+ //TODO error check
+ //double pt0 = dijet(0).Pt();
+ //double pt1 = dijet(1).Pt();
+ double invm = dijet.InvM();
+ double lpt = dijet.LeadingPt();
+ int iInvM = fInvMBin.GetBin( invm );
+ int iLPt = fJetPtBin.GetBin( lpt );
+ fDiJetBin[type][js][djs][0] = iInvM;
+ fDiJetBin[type][js][djs][1] = iLPt;
+ }
+ }
+ }
+ //==== TYPE
+ for( int type=0;type<fJetListOfList.GetEntriesFast();type++ ){
+ //==== Jet Selection
+ for( int js=0;js<kJNJetSelection;js++ ){
+ //==== DiJet Selection
+ for( int djs=0;djs<kJNDiJetSelection;djs++ ){
+ AliJDiJet & dijet = *GetDiJets( type, js, djs );
+ if( dijet.GetEntries() < 2 ) continue;
+ double ptpair = dijet.PtPair();
+ double invm = dijet.InvM();
+ double dR = dijet.DR();
+ double dPhi = dijet.DPhi();
+ double dEta = dijet.DEta();
+ double eAsymm = dijet.EAsymm();
+ double ptAsymm= dijet.PtAsymm();
+ //double kTA = dijet.kTA();
+
+ for( int i=0; i<6 ; i++ ){
+ int bin = 0;
+ if( i==0 ) bin = fDiJetBin[kJChargedJet][js][djs][0];
+ if( i==1 ) bin = fDiJetBin[kJOutgoingJet][js][0][0];
+ if( i==2 ) bin = fDiJetBin[kJChargedJet][js][djs][1];
+ if( i==3 ) bin = fDiJetBin[kJOutgoingJet][js][0][1];
+ if( i==4 ) bin = fDiJetBin[type][js][djs][0];
+ if( i==5 ) bin = fDiJetBin[type][js][djs][1];
+
+ if( bin < 0 ) continue;
+
+ fhDiJetPtPair[type][js][djs][i][bin]->Fill( ptpair );
+ fhDiJetInvM[type][js][djs][i][bin]->Fill( invm );
+ fhDiJetDeltaR[type][js][djs][i][bin]->Fill( dR );
+ fhDiJetDeltaPhi[type][js][djs][i][bin]->Fill( dPhi );
+ fhDiJetDeltaEta[type][js][djs][i][bin]->Fill( dEta );
+ fhDiJetPtAsymm[type][js][djs][i][bin]->Fill( ptAsymm );
+ fhDiJetEAsymm[type][js][djs][i][bin]->Fill( eAsymm );
+
+ }
+ if( type==kJChargedJet ){
+ AliJDiJet & dijet0 = * GetDiJets(1, js, 0);
+ AliJDiJet & dijet1 = * GetDiJets(2, js, djs);
+ for( int j0=0;j0<2;j0++){
+ //int bin=-1;
+ for( int j1=0;j1<dijet0.GetEntries();j1++ ){
+ int rbin = fJetDRBin.GetBin( dijet(j0).DeltaR(dijet0(j1) ));
+ if( rbin < 0 ) continue;
+ fhJetEnergyComp[1][js][djs][rbin]->Fill( dijet(j0).E(), dijet0(j1).E() );
+ fhJetPtComp[1][js][djs][rbin]->Fill( dijet(j0).Pt(), dijet0(j1).Pt() );
+ }
+ for( int j1=0;j1<dijet1.GetEntries();j1++ ){
+ int rbin = fJetDRBin.GetBin( dijet(j0).DeltaR(dijet1(j1) ));
+ if( rbin < 0 ) continue;
+ fhJetEnergyComp[2][js][djs][rbin]->Fill( dijet(j0).E(), dijet1(j1).E() );
+ fhJetPtComp[2][js][djs][rbin]->Fill( dijet(j0).Pt(), dijet1(j1).Pt() );
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+/*
+ void AliJDiJetAnalysis::FillFullChargedComparision( int js, int djs ){
+ AliJDiJet & cjets = *GetDiJets( 4, js, djs );
+ AliJDiJet & fjets = *GetDiJets( 3, js, djs );
+
+ if( cjets.GetEntries() <1 && fjets.GetEntries() < 1 ) return;
+
+ }
+ */
+
+void AliJDiJetAnalysis::FillPythiaDiJet(int js ){
+
+ AliJDiJet & jetsIn = *GetDiJets( 0, 0, 0 );
+ AliJDiJet & jetsOut = *GetDiJets( 1, js, 0 );
+
+
+ if( jetsIn.GetEntries() < 2 || jetsOut.GetEntries() < 2 ) return;
+
+ AliJJet& jet00 = jetsIn(0);
+ AliJJet& jet01 = jetsIn(1);
+ AliJJet& jet10 = jetsOut(0);
+ AliJJet& jet11 = jetsOut(1);
+
+ AliJJet jet0 = jet00+jet01;
+ AliJJet jet1 = jet10+jet11;
+
+ AliJJet jetsum = jet0+jet1;
+ int iM0 = fInvMBin.GetBin( jetsIn.InvM() );
+ int iM1 = fInvMBin.GetBin( jetsOut.InvM() );
+
+ if( iM0 > -1 && iM1 > -1 ){
+ fhPythiaJetPtPair[0][iM0]->Fill( jetsIn.PtPair() );
+ fhPythiaJetPtPair[1][iM1]->Fill( jetsOut.PtPair() );
+ fhPythiaJetSum[0]->Fill( jetsum.P() );
+ fhPythiaJetSum[1]->Fill( jetsum.E() );
+ }
+}
+
+void AliJDiJetAnalysis::CreateHistos(){
+ // Create Histograms
+
+ //==== Hist Manager
+ fHMG = new AliJHistManager( "AliJDiJetAnalysisHistManager");
+
+ //==== BIN
+ fJetPtPairBin .Set("JetPtPair", "P", "p_{Tpair}:%2.0f-%2.0f").SetBin( fCard->GetVector("Jet:PtPairBins") );
+ fJetPtBin .Set("JetPt", "P", "p_{T}:%2.0f-%2.0f").SetBin( fCard->GetVector("Jet:PtBins") );
+ fInvMBin .Set("InvMB", "M", "M:%2.0f-%2.0f").SetBin( fCard->GetVector("InvMBin"));
+ fJetTypeBin .Set("JetType", "T", "T%1.0f", AliJBin::kSingle).SetBin( kJNJetType );
+ fJetSelectionBin.Set("JetSelection","J", "J%1.0f", AliJBin::kSingle).SetBin( kJNJetSelection );
+ fDiJetSelectionBin.Set("DiJetSelection","J", "J%1.0f",AliJBin::kSingle).SetBin( kJNDiJetSelection);
+
+ fJetRBin .Set("JetR", "R", "R:%2.1f",AliJBin::kSingle ).SetBin( "0.4, 0.5");
+ fDiJetBinTypeBin.Set("BinType", "B", "B:%1.f", AliJBin::kSingle ).SetBin( 6 );
+ fJetDRBin .Set("JetDR", "R", "R:%1.f" ).SetBin( "0.5, 1, 2, 4");
+ fPYJetTypeBin.Set("PYJetType", "T", "T%1.0f", AliJBin::kSingle).SetBin( 2 );
+ fBin2 .Set("Bin2", "B", "B%1.0f", AliJBin::kSingle).SetBin( 2 );
+
+ //==== Log Bins
+ int nBINS2=300;
+ double logBinsX2[nBINS2+2], limL2=0.1, LimH2=2000;
+ double logBW2 = (log(LimH2)-log(limL2))/nBINS2;
+ for(int ij=0;ij<=nBINS2;ij++) logBinsX2[ij+1]=limL2*exp(ij*logBW2);
+ logBinsX2[0]=0;
+
+ //==== Histogram
+ int nDR = 1000;double xDR0= -10; double xDR1 = 10;
+ int nDPhi=1000;double xDPhi0=-TMath::Pi(); double xDPhi1=-xDPhi0;
+ //== Jets QA
+ fhJetPt
+ << TH1D("hJetPt","",nBINS2, logBinsX2 )
+ << fJetTypeBin << fJetSelectionBin <<"END";
+ fhJetPhi
+ << TH1D("hJetPhi","",nDPhi, xDPhi0, xDPhi1 )
+ << fJetTypeBin << fJetSelectionBin <<"END";
+ fJetTypeBin.Print();
+ fJetSelectionBin.Print();
+ fhJetEta
+ << TH1D("hJetEta","",nDR, xDR0, xDR1 )
+ << fJetTypeBin << fJetSelectionBin <<"END";
+ fhJetNConst
+ << TH1D("hJetNConst","",100, 0-.5, 100-.5 )
+ << fJetTypeBin << fJetSelectionBin <<"END";
+ fhJetNConst
+ << TH1D("hJetNConst","",nBINS2, logBinsX2 )
+ << fJetTypeBin << fJetSelectionBin <<"END";
+ fhJetEnergy
+ << TH1D("hJetEnergy","",nBINS2, logBinsX2 )
+ << fJetTypeBin << fJetSelectionBin <<"END";
+
+ //== Jet Comparision
+ fhJetEnergyComp
+ << TProfile("hJetEnergyComp","",nBINS2, logBinsX2 )
+ << fJetTypeBin << fJetSelectionBin << fDiJetSelectionBin << fJetDRBin <<"END";
+ fhJetPtComp
+ << TProfile("hJetPtComp","",nBINS2, logBinsX2 )
+ << fJetTypeBin << fJetSelectionBin << fDiJetSelectionBin << fJetDRBin <<"END";
+ fhJetDRToRef
+ << TH1D("hJetDRToRef","", nDR, xDR0, xDR1 )
+ << fJetTypeBin << fJetSelectionBin << fJetPtBin <<"END";
+ fhJetDPhiToRef
+ << TH1D("hJetDPhiToRef","", nDPhi, xDPhi0, xDPhi1 )
+ << fJetTypeBin << fJetSelectionBin << fJetPtBin <<"END";
+
+
+
+ //== DiJets
+ fhDiJetPtPair // Inclusive PtPair
+ << TH1D("hDiJetPtPair","",nBINS2, logBinsX2 )
+ << fJetTypeBin << fJetSelectionBin << fDiJetSelectionBin << fDiJetBinTypeBin << fInvMBin<<"END";
+ fhDiJetInvM
+ << TH1D("hDiJetInvM","",nBINS2, logBinsX2 )
+ << fJetTypeBin << fJetSelectionBin << fDiJetSelectionBin << fDiJetBinTypeBin << fInvMBin<<"END";
+ fhDiJetKtA
+ << TH1D("hDiJetKtA","",nBINS2, logBinsX2 ) // TODO change bins
+ << fJetTypeBin << fJetSelectionBin << fDiJetSelectionBin << fDiJetBinTypeBin << fInvMBin<<"END";
+ fhDiJetDeltaR
+ << TH1D("hDiJetDeltaR","",nDR, xDR0, xDR1 ) // TODO change bins
+ << fJetTypeBin << fJetSelectionBin << fDiJetSelectionBin << fDiJetBinTypeBin << fInvMBin<<"END";
+ fhDiJetDeltaPhi
+ << TH1D("hDiJetDeltaPhi","",nDPhi, xDPhi0, xDPhi1) // TODO change bins
+ << fJetTypeBin << fJetSelectionBin << fDiJetSelectionBin << fDiJetBinTypeBin << fInvMBin<<"END";
+ fhDiJetDeltaEta
+ << TH1D("hDiJetDeltaEta","",nDR, xDR0, xDR1 ) // TODO change bins
+ << fJetTypeBin << fJetSelectionBin << fDiJetSelectionBin << fDiJetBinTypeBin << fInvMBin<<"END";
+ fhDiJetPtAsymm
+ << TH1D("hDiJetPtAsymm","",100,0,1 ) // TODO change bins
+ << fJetTypeBin << fJetSelectionBin << fDiJetSelectionBin << fDiJetBinTypeBin << fInvMBin<<"END";
+ fhDiJetEAsymm
+ << TH1D("hDiJetEAsymm","",100,0,1 ) // TODO change bins
+ << fJetTypeBin << fJetSelectionBin << fDiJetSelectionBin << fDiJetBinTypeBin << fInvMBin<<"END";
+ fhDiJetMultiplicity
+ << TH1D("hDiJetMultiplicity","",nBINS2, logBinsX2)// TODO change bins
+ << fJetTypeBin << fJetSelectionBin << "END";
+
+
+ //== PYTHIA
+ fhPythiaJetPtPair
+ << TH1D("hPythiaJetPtPair", "", 1000,-10,10 )
+ << fPYJetTypeBin << fInvMBin << "END";
+ fhPythiaJetSum
+ << TH1D("hPythiaJetSum", "", 1000,-10,10 )
+ << fBin2 << fInvMBin << "END";
+
+ fHMG->Print();
+ fHMG->WriteConfig();
+}
+
+
+
--- /dev/null
+/* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+// Short comment describing what this class does needed!
+
+//===========================================================
+// Dummy comment, should be replaced by a real one
+//===========================================================
+
+#ifndef ALIJDIJETANALYSIS_H
+#define ALIJDIJETANALYSIS_H
+
+#include <vector>
+#include <TObjArray.h>
+#include "AliJBaseCard.h"
+#include "AliJConst.h"
+#include "AliJJet.h"
+//#include "AliJHistosDiJetAnalysis.h"
+#include "AliJHistManager.h"
+
+class AliJDiJet {
+ public:
+ AliJDiJet():fJet(){ ; }
+ AliJDiJet(AliJJet*i,AliJJet*j):fJet(){SetJets(i,j);}
+ void SetJet( int i, AliJJet* j ){ Safe(i);fJet[i]=j; }
+ void SetJets( AliJJet* i, AliJJet*j){ Safe(2);fJet[0]=i;fJet[1]=j; }
+ double DPt( AliJDiJet & dijet, int i, int j );
+ double PtPair(){ return (jet(0)+jet(1)).Pt(); }
+ double kTA(){ return LeadingPt()*TMath::Sin( DPhi() ); }
+ double DPhi(){ return jet(0).DeltaPhi(jet(1)); }
+ double DR(){ return jet(0).DeltaR(jet(1)); }
+ double DEta(){ return jet(0).Eta() - jet(1).Eta(); }
+ double DPt(){ return jet(0).Pt() - jet(1).Pt();}
+ double PtAsymm(){ return (jet(0).Pt() -jet(1).Pt())/(jet(0).Pt()+jet(1).Pt()); }
+ double EAsymm(){ return (jet(0).E() -jet(1).E())/(jet(0).E()+jet(1).E()); }
+ double InvM(){ return (jet(0)+jet(1)).M(); }
+ void Clear(){ fJet.clear(); }
+ void Add(AliJJet*j){ fJet.push_back(j); }
+ int GetEntries(){ return fJet.size(); }
+ void Safe( UInt_t x ){ if( fJet.size()<x) fJet.resize(x); }
+ double LeadingPt(){ double pt0=jet(0).Pt();double pt1=jet(1).Pt();return pt0>pt1?pt0:pt1;}
+
+ AliJJet& jet(int i){ Safe(i);return (*this)(i); }
+ AliJJet& operator()(int i ){
+ if( i > 1 || i< 0) { cout<<"wrong index"<<endl;exit(2); }
+ if( !fJet[i] ){ cout<<"Empty jet"<<endl;exit(3); }
+ return* fJet[i];
+ }
+
+ vector<AliJJet*> fJet;
+};
+
+
+class AliJDiJetAnalysis{
+ public:
+ enum {
+ kJDiJetLeadingSubLeading,
+ kLeadingSubLeadingOpposite,
+ kJDiJetMarta,
+ //kJDiJetAtlas,
+ kJNDiJetSelection
+ };
+ enum {
+ kJIncomingJet, kJOutgoingJet,
+ kJFullJet, kJFullJet08,
+ kJChargedJet, kJChargedJet08,
+ //kJIdealJet,
+ kJMultiPartonAll,
+ kJNJetType
+ };
+ enum{ kJEtaAll, kJEtaAlice, kJNJetSelection};
+
+ AliJDiJetAnalysis();
+ AliJDiJetAnalysis( AliJBaseCard * card );
+ AliJDiJetAnalysis( const AliJDiJetAnalysis & obj );
+ AliJDiJetAnalysis& operator=(const AliJDiJetAnalysis & obj);
+
+ AliJDiJet * GetDiJets(int type, int js, int djs);
+ TObjArray * GetJets(int type, int js);
+
+ void FillHistosJets();
+ void FillHistosDiJet();
+ void CreateHistos();
+
+
+ void AddJets(TObjArray * jets ){
+ if( !jets ) {
+ cout<<"JWARN_C1 in AddJets jets="<<jets<<endl;
+ //return;
+ }
+ fJetListOfList.Add( (TObject*)jets );
+ if( !jets ) return;
+ for( int i=0;i<jets->GetEntriesFast();i++ ){
+ //((AliJJet*)jets->At(i))->ReSum();
+ }
+ } // TODO clean before event
+
+
+ int GetNJets(){ return GetJetList()->GetEntriesFast(); }
+ TObjArray* GetJetList(){ return fJetList; }
+ Double_t GetJetEtaRange(){ return fJetEtaRange; }
+ void SetJetEtaRange(double eta){ fJetEtaRange=eta; }
+ void SetJetList(TObjArray* jetlist){ fJetList=jetlist; }
+ void SetInputList(TObjArray * ilist){ fInputList = ilist;}
+ void SetTrackJetMap(std::vector<int> * v){ fTrackJetMap=v;}
+ void SetJetPtBin( TVector * b){ fJetPtBins=b; }
+
+ AliJJet & Jet( int i ){ return *(AliJJet*) fJetList->At(i); }
+ TObjArray * GetDiJetList( int i ){ return (TObjArray*)fJetListOfList[i]; }
+ void FillJetPythiaComperisonHistos(int ref, int typ, int js);
+
+ void UserCreateOutputObjects();
+ void UserExec();
+ void Terminate() const;
+
+ void ClearBeforeEvent();
+
+ void FillPythiaDiJet(int js );
+
+ private:
+ TObjArray * fInputList; // comment needed
+ TObjArray * fJetList; // comment needed
+ TObjArray fJetListOfList; // !comment needed
+ AliJDiJet *fDiJets[kJNJetType][kJNJetSelection][kJNDiJetSelection]; // comment needed
+ TObjArray *fJets[kJNJetType][kJNJetSelection]; // comment needed
+ bool fIsFullAcceptance; // comment needed
+ double fJetEtaRange; // comment needed
+ int fIsMartasDiJet; // comment needed
+ std::vector<int> *fTrackJetMap; // comment needed
+
+ TVector *fJetPtBins;
+ TVector *fJetPtPairBins;
+ double fJetPtMinCut;
+
+
+
+ double fMeanDiJetPt;
+
+ // PYTHIA8
+ double fParton23Pt;
+
+ AliJBaseCard * fCard; // comment needed
+
+
+ //== Histogram
+ AliJHistManager * fHMG;
+ AliJBin fJetPtBin;
+ AliJBin fJetPtPairBin;
+ AliJBin fInvMBin;
+ AliJBin fJetTypeBin;
+ AliJBin fJetSelectionBin;
+ AliJBin fDiJetSelectionBin;
+ AliJBin fJetRBin;
+ AliJBin fJetDRBin;
+ AliJBin fDiJetBinTypeBin;
+ AliJBin fPYJetTypeBin;
+ AliJBin fBin2;
+
+ //== Jets
+ AliJTH1D fhJetPt ;
+ AliJTH1D fhJetPhi;
+ AliJTH1D fhJetEta;
+ AliJTH1D fhJetNConst;
+ AliJTH1D fhJetEnergy;
+
+ AliJTProfile fhJetEnergyComp;
+ AliJTProfile fhJetPtComp;
+ AliJTH1D fhJetDRToRef;
+ AliJTH1D fhJetDPhiToRef;
+ //== DiJets;
+ AliJTH1D fhDiJetPtPair;
+ AliJTH1D fhDiJetInvM;
+ AliJTH1D fhDiJetKtA;
+ AliJTH1D fhDiJetDeltaR; //!
+ AliJTH1D fhDiJetDeltaPhi;
+ AliJTH1D fhDiJetDeltaEta;
+ AliJTH1D fhDiJetPtAsymm;
+ AliJTH1D fhDiJetEAsymm;
+ AliJTH1D fhDiJetMultiplicity;
+
+ //== PYTHIA
+ AliJTH1D fhPythiaJetPtPair;
+ AliJTH1D fhPythiaJetSum;
+
+ int fDiJetBin[kJNJetType][kJNJetSelection][kJNDiJetSelection][10];
+};
+
+#endif
+
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+//______________________________________________________________________________
+// Analysis task for di-jet Analysis
+// author: R.Diaz, J. Rak, D.J. Kim
+// ALICE Group University of Jyvaskyla
+// Finland
+// Fill the analysis containers for ESD or AOD
+// Adapted for AliAnalysisTaskSE and AOD objects
+//////////////////////////////////////////////////////////////////////////////
+
+#include "AliAnalysisTaskSE.h"
+#include "AliAODHandler.h"
+#include "AliAnalysisManager.h"
+#include "AliLog.h"
+#include "AliJDiJetTask.h"
+#include "AliJEventHeader.h"
+#include "AliJRunHeader.h"
+#include "AliJCORRANTask.h"
+#include "AliJCard.h"
+#include "AliJRunTable.h"
+#include "AliAnalysisUtils.h"
+
+//______________________________________________________________________________
+AliJDiJetTask::AliJDiJetTask() :
+ AliAnalysisTaskSE("AliJDiJetTaskTask"),
+ fJetTask(NULL),
+ fJetTaskName(""),
+ fJDiJetAnalysis(0x0),
+ fOutput(NULL),
+ fFirstEvent(kTRUE),
+ fAnaUtils(NULL),
+ fRunTable(NULL),
+ fCard(NULL)
+{
+ DefineOutput (1, TDirectory::Class());
+}
+
+//______________________________________________________________________________
+AliJDiJetTask::AliJDiJetTask(const char *name, TString inputformat):
+ AliAnalysisTaskSE(name),
+ fJetTask(NULL),
+ fJetTaskName(""),
+ fJDiJetAnalysis(0x0),
+ fOutput(NULL),
+ fFirstEvent(kTRUE),
+ fAnaUtils(NULL),
+ fRunTable(NULL),
+ fCard(NULL)
+{
+ // Constructor
+ AliInfo("---- AliJDiJetTask Constructor ----");
+
+ JUNUSED(inputformat);
+ DefineOutput (1, TDirectory::Class());
+}
+
+//____________________________________________________________________________
+AliJDiJetTask::AliJDiJetTask(const AliJDiJetTask& ap) :
+ AliAnalysisTaskSE(ap.GetName()),
+ fJetTask(ap.fJetTask),
+ fJetTaskName(ap.fJetTaskName),
+ fJDiJetAnalysis( ap.fJDiJetAnalysis ),
+ fOutput( ap.fOutput ),
+ fFirstEvent( ap.fFirstEvent),
+ fAnaUtils(ap.fAnaUtils),
+ fRunTable(ap.fRunTable),
+ fCard( ap.fCard )
+{
+
+ AliInfo("----DEBUG AliJDiJetTask COPY ----");
+
+}
+
+//_____________________________________________________________________________
+AliJDiJetTask& AliJDiJetTask::operator = (const AliJDiJetTask& ap)
+{
+ // assignment operator
+
+ AliInfo("----DEBUG AliJDiJetTask operator= ----");
+ this->~AliJDiJetTask();
+ new(this) AliJDiJetTask(ap);
+ return *this;
+}
+
+//______________________________________________________________________________
+AliJDiJetTask::~AliJDiJetTask()
+{
+ // destructor
+
+ delete fJDiJetAnalysis;
+ delete fAnaUtils;
+
+}
+
+//________________________________________________________________________
+
+void AliJDiJetTask::UserCreateOutputObjects()
+{
+ //=== create the jcorran outputs objects
+ if(fDebug > 1) printf("AliJDiJetTask::UserCreateOutPutData() \n");
+
+ fAnaUtils = new AliAnalysisUtils();
+ fAnaUtils->SetUseOutOfBunchPileUp( kTRUE );
+
+ //=== Get AnalysisManager
+ AliAnalysisManager *man = AliAnalysisManager::GetAnalysisManager();
+
+ OpenFile(1);
+ fOutput = gDirectory;//->mkdir("JDiHadronCorr");
+ fOutput->cd();
+
+ fJDiJetAnalysis = new AliJDiJetAnalysis(fCard);
+ fJDiJetAnalysis->UserCreateOutputObjects();
+ fCard->WriteCard( gDirectory );
+
+ PostData( 1, fOutput );
+
+ fJetTask = (AliJJetTask*)(man->GetTask( fJetTaskName));
+
+ fJDiJetAnalysis->AddJets( NULL );
+ fJDiJetAnalysis->AddJets( NULL );
+ //for( int ij=0;ij< fJetTask->GetNumberOfJetCollections();ij++ ){
+ // fJDiJetAnalysis->AddJets( fJetTask->GetAliJJetList( ij ) );
+ //}
+ fJDiJetAnalysis->AddJets( fJetTask->GetAliJJetList( 0 ) );
+ fJDiJetAnalysis->AddJets( fJetTask->GetAliJJetList( 1 ) );
+ fJDiJetAnalysis->AddJets( fJetTask->GetAliJJetList( 3 ) );
+ fJDiJetAnalysis->AddJets( fJetTask->GetAliJJetList( 4 ) );
+
+ // TODO
+
+
+
+ cout << "Add(fAliRunHeader) in UserCreateObject() ======= " << endl;
+}
+
+//______________________________________________________________________________
+void AliJDiJetTask::UserExec(Option_t* /*option*/)
+{
+
+ // Processing of one event
+ if(fDebug > 5) cout << "------- AliJDiJetTask Exec-------"<<endl;
+
+ // Check Event
+ if( fJetTask->GetTaskEntry() != fEntry ) return;
+ AliVEvent *event = InputEvent();
+ if(!event) return;
+ AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(event);
+ if(!aodEvent) return;
+ if( fFirstEvent ) {
+ fRunTable = & AliJRunTable::GetSpecialInstance();
+ fRunTable->SetRunNumber( aodEvent->GetRunNumber() );
+ fFirstEvent = kFALSE;
+ }
+ if(!IsGoodEvent( event )) return; // zBin is set there
+
+ // Call DiJetAnalysis
+ fJDiJetAnalysis->ClearBeforeEvent();
+ fJDiJetAnalysis->UserExec();
+ PostData(1, fOutput );
+
+ if(fDebug > 5) cout << "\t------- End UserExec "<<endl;
+}
+
+//______________________________________________________________________________
+void AliJDiJetTask::Init()
+{
+ // Intialisation of parameters
+ AliInfo("Doing initialization") ;
+ //fJDiJetAnalysis->Init();
+}
+
+//______________________________________________________________________________
+void AliJDiJetTask::Terminate(Option_t *)
+{
+ cout<<"AliJDiJetTask Analysis DONE !!"<<endl;
+
+}
+
+//________________________________________________________________________
+bool AliJDiJetTask::IsGoodEvent(AliVEvent *event) {
+
+ // TODO pile up test for PP
+ if(fRunTable->IsPP() && fAnaUtils->IsPileUpEvent(event)) {
+ return kFALSE;
+ } else {
+ Bool_t triggeredEventMB = kFALSE; //init
+
+ Bool_t triggerkMB = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & ( AliVEvent::kMB );
+
+ if( triggerkMB ){
+ triggeredEventMB = kTRUE; //event triggered as minimum bias
+ }
+ //--------------------------------------------------------------
+ // check reconstructed vertex
+ int ncontributors = 0;
+ Bool_t goodRecVertex = kFALSE;
+ const AliVVertex *vtx = event->GetPrimaryVertex();
+ if(vtx){
+ ncontributors = vtx->GetNContributors();
+ if(ncontributors > 0){
+ double zVert = vtx->GetZ();
+ if(fCard->VertInZRange(zVert)) {
+ goodRecVertex = kTRUE;
+ }
+ }
+ }
+ return goodRecVertex;
+ }
+ //---------------------------------
+}
--- /dev/null
+#ifndef ALIJDIJETTASK_H
+#define ALIJDIJETTASK_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+//______________________________________________________________________________
+// Analysis task for high pt particle correlations
+// author: R.Diaz, J. Rak, D.J. Kim
+// ALICE Group University of Jyvaskyla
+// Finland
+//
+// Fill the analysis containers for ESD or AOD
+// Note: Adapted for AliAnalysisTaskSE
+//////////////////////////////////////////////////////////////////////////////
+
+
+#include "AliAnalysisTaskSE.h"
+#include "AliJDiJetAnalysis.h"
+#include "AliJJetTask.h"
+#include "AliJCard.h"
+
+class AliJRunTable;
+class AliJDiJetAnalysisTask;
+//==============================================================
+
+using namespace std;
+
+class AliJDiJetTask : public AliAnalysisTaskSE {
+
+ public:
+ AliJDiJetTask();
+ AliJDiJetTask(const char *name, TString inputformat);
+ AliJDiJetTask(const AliJDiJetTask& ap);
+ AliJDiJetTask& operator = (const AliJDiJetTask& ap);
+ virtual ~AliJDiJetTask();
+
+ // methods to fill from AliAnalysisTaskSE
+ virtual void UserCreateOutputObjects();
+ virtual void Init();
+ virtual void LocalInit() { Init(); }
+ virtual void UserExec(Option_t *option);
+ virtual void Terminate(Option_t *);
+ virtual Bool_t UserNotify() { std::cout<<"DEBUG UserNotify"<<std::endl; return kTRUE;}
+
+ bool IsGoodEvent( AliVEvent * event );
+
+ void SetJetTaskName(TString name){ fJetTaskName=name; }
+ void SetDiJetAnalysis(AliJDiJetAnalysis * jco){ fJDiJetAnalysis=jco; }
+ void SetCard( AliJCard * card ){ fCard=card; }
+
+ private:
+
+ // TODO new Task - AliJJetTask?
+ AliJJetTask * fJetTask;
+ TString fJetTaskName;
+ AliJDiJetAnalysis * fJDiJetAnalysis; //!
+ TDirectory * fOutput;
+ Bool_t fFirstEvent; //
+ AliAnalysisUtils *fAnaUtils;
+ AliJRunTable *fRunTable; //
+ AliJCard * fCard;
+
+ ClassDef(AliJDiJetTask, 1);
+};
+#endif // AliJDiJetTask_H
--- /dev/null
+#include <TChain.h>
+#include <TTree.h>
+#include <TH1D.h>
+#include <TH2D.h>
+#include <TGraphErrors.h>
+#include <TMath.h>
+#include <TCanvas.h>
+#include <TVector3.h>
+#include <TVectorT.h>
+
+
+#include "AliJBaseTrack.h"
+#include "AliJEbECORRTask.h"
+#include "AliJCorrelations.h"
+#include "AliJEventPool.h"
+#include "AliJEbePercentile.h"
+#include "AliAnalysisManager.h"
+
+#include "AliESDEvent.h"
+#include "AliAODEvent.h"
+#include "AliESDInputHandler.h"
+#include "AliESDtrack.h"
+#include "AliAODTrack.h"
+#include "AliESDtrackCuts.h"
+#include "AliVVertex.h"
+#include "AliAODMCParticle.h"
+#include "AliAODMCHeader.h"
+
+#include "AliMCEventHandler.h"
+#include "AliMCEvent.h"
+#include "AliStack.h"
+#include "AliHeader.h"
+#include "AliGenEventHeader.h"
+#include "AliGenCocktailEventHeader.h"
+#include "AliGenPythiaEventHeader.h"
+#include "AliInputEventHandler.h"
+#include "AliESDVertex.h"
+#include "AliVParticle.h"
+#include "AliCentrality.h"
+#include "AliEventplane.h"
+
+#include "AliJHistos.h"
+#include "AliJEbeHistos.h"
+
+
+ClassImp(AliJEbECORRTask)
+
+ AliJEbECORRTask::AliJEbECORRTask()
+: AliAnalysisTaskSE(), fOutput(0x0),
+ fAnaUtils(NULL),
+ fCard(NULL),
+ fHistos(NULL),
+ fEbeHistos(NULL),
+ fEfficiency(NULL),
+ fHadronSelectionCut(0),
+ fInputList(NULL),
+ ftriggList(NULL),
+ fassocList(NULL),
+ fcorrelations(NULL),
+ fassocPool(NULL),
+ fEbePercentile(NULL),
+ fFirstEvent(kTRUE),
+ cBin(-1),
+ ebeBin(-1),
+ zBin(-1),
+ zVert(-999),
+ fevt(0),
+ fDebugMode(0),
+ trkfilterBit(0),
+ fEbECentBinBorders(NULL),
+ ebePercentileInputFileName(""),
+ fRunTable(0),
+ fRandom(NULL)
+{
+ // Constructor
+}
+//________________________________________________________________________
+AliJEbECORRTask::AliJEbECORRTask(const char *name)
+ : AliAnalysisTaskSE(name),
+ fOutput(0x0),
+ fAnaUtils(0x0),
+ fCard(0x0),
+ fHistos(0x0),
+ fEbeHistos(0x0),
+ fEfficiency(0x0),
+ fHadronSelectionCut(0),
+ fInputList(0x0),
+ ftriggList(0x0),
+ fassocList(0x0),
+ fcorrelations(0x0),
+ fassocPool(0x0),
+ fEbePercentile(0x0),
+ fFirstEvent(kTRUE),
+ cBin(-1),
+ ebeBin(-1),
+ zBin(-1),
+ zVert(-999),
+ fevt(0),
+ fDebugMode(0),
+ trkfilterBit(0),
+ fEbECentBinBorders(0x0),
+ ebePercentileInputFileName(""),
+ fRunTable(0),
+ fRandom(0x0)
+{
+
+ // Constructor
+
+
+ // Define input and output slots here
+ // Input slot #0 works with a TChain
+ DefineInput(0, TChain::Class());
+ // Output slot #0 writes into a TH1 container
+ DefineOutput(1, TDirectory::Class());
+}
+
+//________________________________________________________________________
+AliJEbECORRTask::AliJEbECORRTask(const AliJEbECORRTask& a):
+ AliAnalysisTaskSE(a.GetName()),
+ fOutput(a.fOutput),
+ fAnaUtils(a.fAnaUtils),
+ fCard(a.fCard),
+ fHistos(a.fHistos),
+ fEbeHistos(a.fEbeHistos),
+ fEfficiency(a.fEfficiency),
+ fHadronSelectionCut(a.fHadronSelectionCut),
+ fInputList(a.fInputList),
+ ftriggList(a.ftriggList),
+ fassocList(a.fassocList),
+ fcorrelations(a.fcorrelations),
+ fassocPool(a.fassocPool),
+ fEbePercentile(a.fEbePercentile),
+ fFirstEvent(kTRUE),
+ cBin(-1),
+ ebeBin(-1),
+ zBin(-1),
+ zVert(-999),
+ fevt(-1),
+ fDebugMode(0),
+ trkfilterBit(a.trkfilterBit),
+ fEbECentBinBorders(a.fEbECentBinBorders),
+ ebePercentileInputFileName(""),
+ fRunTable(a.fRunTable),
+ fRandom(a.fRandom)
+{
+ //copy constructor
+}
+//________________________________________________________________________
+AliJEbECORRTask& AliJEbECORRTask::operator = (const AliJEbECORRTask& ap){
+ // assignment operator
+
+ JUNUSED(ap);
+ this->~AliJEbECORRTask();
+ new(this) AliJEbECORRTask(ap);
+ return *this;
+}
+
+Bool_t AliJEbECORRTask::UserNotify() {
+
+ cout <<"UserNotify ievt =" << fevt << endl;
+ cout << MemoryStatus() << endl;
+ return kTRUE;
+}
+
+
+//________________________________________________________________________
+void AliJEbECORRTask::UserCreateOutputObjects(){
+ // Create histograms
+ // Called once
+ if(fDebugMode) cout <<"UserCreateOutputObjects:0 "<< MemoryStatus() << endl;
+
+ fRandom = new TRandom(0);
+
+ fAnaUtils = new AliAnalysisUtils();
+ fAnaUtils->SetUseOutOfBunchPileUp( kTRUE );
+ fAnaUtils->SetUseSPDCutInMultBins( kTRUE);
+
+ cout<<"\n=============== CARD =============="<<endl;
+ fCard->PrintOut();
+ cout<<"===================================\n"<<endl;
+
+ fInputList = new TClonesArray("AliJBaseTrack",1500);
+ fInputList->SetOwner(kTRUE);
+ ftriggList = new TClonesArray("AliJBaseTrack",1500);
+ fassocList = new TClonesArray("AliJBaseTrack",1500);
+
+ OpenFile(1);
+ fOutput = gDirectory;
+ fOutput->cd();
+
+ if(fDebugMode) cout <<"UserCreateOutputObjects: fHistos 0 "<< MemoryStatus() << endl;
+ fHistos = new AliJHistos(fCard);
+ if(fDebugMode) cout <<"UserCreateOutputObjects: fHistos x1 "<< MemoryStatus() << endl;
+ fHistos->CreateEventTrackHistos();
+ if(fDebugMode) cout <<"UserCreateOutputObjects: fHistos x2 "<< MemoryStatus() << endl;
+ fHistos->CreateAzimuthCorrHistos();
+ if(fDebugMode) cout <<"UserCreateOutputObjects: fHistos x3 "<< MemoryStatus() << endl;
+ fHistos->CreateIAAMoons();
+ if(fDebugMode) cout <<"UserCreateOutputObjects: fHistos x4 "<< MemoryStatus() << endl;
+ fHistos->CreateXEHistos();
+ if(fDebugMode) cout <<"UserCreateOutputObjects: fHistos x5 "<< MemoryStatus() << endl;
+ fHistos->CreateXtHistos();
+ if(fDebugMode) cout <<"UserCreateOutputObjects: fHistos x6 "<< MemoryStatus() << endl;
+ fHistos->CreatePairPtCosThetaStar();
+ if(fDebugMode) cout <<"UserCreateOutputObjects: fHistos x7 "<< MemoryStatus() << endl;
+
+ fHistos->fHMG->Print();
+ if(fDebugMode) cout <<"UserCreateOutputObjects: fHistos 1 "<< MemoryStatus() << endl;
+ // E-b-E
+ fEbeHistos = new AliJEbeHistos(fCard);
+ fEbeHistos->CreateUnfoldingHistos();
+ if(fDebugMode) cout <<"UserCreateOutputObjects: fEbeHistos 1 "<< MemoryStatus() << endl;
+
+ fcorrelations = new AliJCorrelations(fCard, fHistos);
+ fassocPool = new AliJEventPool( fCard, fHistos, fcorrelations, kJHadron);
+ fEbePercentile = new AliJEbePercentile(fCard, ebePercentileInputFileName);
+ fEbECentBinBorders = fCard->GetVector("EbECentBinBorders");
+ if(fDebugMode) cout <<"UserCreateOutputObjects: fEbePercentile 1 "<< MemoryStatus() << endl;
+
+ fEfficiency = new AliJEfficiency();
+ fEfficiency->SetMode( fCard->Get("EfficiencyMode") ); // 0:NoEff, 1:Period 2:RunNum 3:Auto
+ fEfficiency->SetDataPath("alien:///alice/cern.ch/user/d/djkim/legotrain/efficieny/data"); // Efficiency root file location local or alien
+
+ fHadronSelectionCut = int ( fCard->Get("HadronSelectionCut"));
+ trkfilterBit = Int_t ( fCard->Get("AODTrackFilterBit"));
+
+ fCard->WriteCard(fOutput);
+ fHistos->fHMG->WriteConfig();
+ fFirstEvent = kTRUE;
+ fevt = -1;
+ PostData(1, fOutput);
+}
+//________________________________________________________________________
+AliJEbECORRTask::~AliJEbECORRTask() {
+ delete fOutput;
+ delete [] fAnaUtils;
+ delete fHistos;
+ delete fEbeHistos;
+ delete fEfficiency;
+ delete fInputList;
+ delete ftriggList;
+ delete fassocList;
+ delete fCard;
+ delete fRandom;
+ delete fcorrelations;
+ if( fassocPool ) delete fassocPool;
+ delete fEbePercentile;
+}
+
+//________________________________________________________________________
+void AliJEbECORRTask::UserExec(Option_t *) {
+ // Main loop
+ // Called for each event
+ fevt++;
+ if(fevt % 1000 == 0) cout << "Numer of event scanned = "<< fevt << endl;
+
+ AliVEvent *event = InputEvent();
+ if(!event) return;
+
+ //---------------------------------------------------------------
+ // check if the event was triggered or not and vertex
+
+ AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(event);
+ if(!aodEvent) return;
+
+ if( fFirstEvent ) {
+ fRunTable = & AliJRunTable::GetSpecialInstance();
+ fRunTable->SetRunNumber( aodEvent->GetRunNumber() );
+ fEfficiency->SetRunNumber( aodEvent->GetRunNumber() );
+ fEfficiency->Load();
+ fFirstEvent = kFALSE;
+ }
+
+ if(!IsGoodEvent( event )) return; // zBin is set there
+ if(fDebug) cout << "zvtx = " << zVert << endl;
+
+ // centrality
+ float fcent = -999;
+ if(fRunTable->IsHeavyIon() || fRunTable->IsPA()){
+ AliCentrality *cent = event->GetCentrality();
+ if( ! cent ) return;
+ fcent = cent->GetCentralityPercentile("V0M");
+ } else {
+ fcent = -1;
+ }
+ cBin = fCard->GetBin(kCentrType, fcent);;
+
+ if(cBin<0) return;
+
+ fHistos->fhZVert[cBin]->Fill(zVert);
+ if(fDebug ) cout <<"Centrality = "<< fcent <<"\t"<< cBin << endl;
+
+ fHistos->fhEvents->Fill( 4 );
+ Int_t nt = aodEvent->GetNumberOfTracks();
+
+ fHistos->fhCentr->Fill(fcent);
+ fHistos->fhiCentr->Fill(cBin);
+
+ // clear them up for every event
+ fInputList->Clear();
+ ftriggList->Clear();
+ fassocList->Clear();
+
+ int counter = 0;
+
+ // Making the inputlist from AOD
+ for(Int_t it = 0; it < nt; it++) {
+ AliAODTrack *aodtrack = dynamic_cast<AliAODTrack*>(aodEvent->GetTrack(it));
+ if( !aodtrack ) continue;
+ if(aodtrack->TestFilterBit(trkfilterBit)) {
+ if(!fCard->IsInEtaRange(aodtrack->Eta())) continue;
+ TLorentzVector l = TLorentzVector( aodtrack->Px(), aodtrack->Py(), aodtrack->Pz(), aodtrack->E() );
+ AliJBaseTrack *track = new AliJBaseTrack( l );
+ track->SetID(fInputList->GetEntriesFast());
+ track->SetParticleType(kJHadron);
+ track->SetCharge(aodtrack->Charge());
+ double ptt = track->Pt();
+ double effCorr = 1./fEfficiency->GetCorrection(ptt, fHadronSelectionCut, fcent); // here you generate warning if ptt>30
+ fHistos->fhTrackingEfficiency[cBin]->Fill( ptt, 1./effCorr );
+ track->SetTrackEff( 1./effCorr );
+ //fInputList->Add( track );
+ new ((*fInputList)[counter++]) AliJBaseTrack(*track);
+ }
+ } // end of aodtrack
+
+ // Run the flow analysis here
+ if(fDebugMode) cout << "Start of RunEbEFlowAnalysis.. FilterBit (AOD,Ntrack)="<< trkfilterBit << ","<< nt <<","<< fInputList->GetEntries() <<endl;
+
+ double ebeCent = RunEbEFlowAnalysis(event, fInputList);
+
+ if(fDebugMode) fEbECentBinBorders->Print();
+ if(fDebugMode) cout << "EbECentBinBorders="<< (*fEbECentBinBorders)[1]<<","<< (*fEbECentBinBorders)[2]<<endl;
+
+ if( (*fEbECentBinBorders)[1] > ebeCent || ebeCent > (*fEbECentBinBorders)[2] ) return;
+
+ if(fDebugMode) cout << "End of RunEbEFlowAnalysis.."<<endl;
+
+ // Trigger and Assoc List
+ int noTrigg=0,noAssoc=0;
+ for(int i=0;i<fInputList->GetEntriesFast();i++) {
+ AliJBaseTrack *track = (AliJBaseTrack*)fInputList->At(i);
+ track->SetTriggBin( fCard->GetBin(kTriggType, track->Pt()) );
+ track->SetAssocBin( fCard->GetBin(kAssocType, track->Pt()) );
+
+ double ptt = track->Pt();
+ double etat = track->Eta();
+ double effCorr = 1.0/track->GetTrackEff();
+
+ fHistos->fhChargedPtNoCorr[cBin]->Fill(ptt);
+ fHistos->fhChargedEta->Fill(etat);
+ fHistos->fhChargedPt[cBin]->Fill(ptt, effCorr );
+ fHistos->fhChargedPtNoCorr[cBin]->Fill( ptt );
+ fHistos->fhChargedEta->Fill(etat, effCorr);
+ //fHistos->fhChargedPtJacek[cBin]->Fill(ptt, effCorr );
+ fHistos->fhChargedPtJacek[cBin]->Fill(ptt, ptt>0 ? 1./ptt*effCorr : 0); //One CANNOT do 1/ptt here!! First unfold.
+ if( -0.8<etat && etat<-0.2) fHistos->fhChargedPtJacekEta[cBin][0]->Fill(ptt, ptt>0 ? 1./ptt*effCorr : 0);
+ if( -0.2<etat && etat< 0.3) fHistos->fhChargedPtJacekEta[cBin][1]->Fill(ptt, ptt>0 ? 1./ptt*effCorr : 0);
+ if( 0.3<etat && etat< 0.8) fHistos->fhChargedPtJacekEta[cBin][2]->Fill(ptt, ptt>0 ? 1./ptt*effCorr : 0);
+ fHistos->fhChargedPtFiete->Fill(ptt, effCorr );
+ if( track->GetTriggBin() > -1 ) { new ((*ftriggList)[noTrigg++]) AliJBaseTrack(*track); }//ftriggList->Add( track );
+ if( track->GetAssocBin() > -1 ) { new ((*fassocList)[noAssoc++]) AliJBaseTrack(*track); }//
+ if(track->GetAssocBin() > -1){
+ int ipta = track->GetAssocBin();
+ double effCorrection = 1.0/track->GetTrackEff();
+ fHistos->fhIphiAssoc[cBin][ipta]->Fill( track->Phi(), effCorrection);
+ fHistos->fhIetaAssoc[cBin][ipta]->Fill( track->Eta(), effCorrection);
+ }
+ }
+
+ // correlation loop
+ if(fDebugMode) cout << "Start of Correlation Loop noTrigg = "<< ftriggList->GetEntriesFast()<<"\t noAssoc="<<fassocList->GetEntriesFast()<<endl;
+ if(fassocList->GetEntriesFast()>0 ) fassocPool->AcceptList(fassocList, fcent, zVert, fInputList->GetEntriesFast(), fevt);
+ PlayCorrelation(ftriggList, fassocList);
+ fassocPool->Mix(ftriggList, kAzimuthFill, fcent, zVert, fInputList->GetEntriesFast(), fevt);
+
+ PostData(1, fOutput);
+}
+
+//________________________________________________________________________
+void AliJEbECORRTask::Terminate(Option_t *)
+{
+
+ /*
+ for (int hic = 0;hic < fCard->GetNoOfBins(kCentrType);hic++){
+ ScaleNotEquidistantHisto( fHistos->fhChargedPt[hic], 1);
+ ScaleNotEquidistantHisto( fHistos->fhChargedPtNoCorr[hic], 1);
+ ScaleNotEquidistantHisto( fHistos->fhChargedPtJacek[hic], 1);
+ }
+ OpenFile(2);
+
+ fcorrelations->PrintOut();
+ //fassocPool->PrintOut();
+ */
+ cout<<"Sucessfully Finished"<<endl;
+
+}
+
+
+//________________________________________________________________________
+bool AliJEbECORRTask::IsGoodEvent(AliVEvent *event) {
+
+ if(fRunTable->IsPP() && fAnaUtils->IsPileUpEvent(event)) {
+ return kFALSE;
+ } else {
+ Bool_t triggeredEventMB = kFALSE; //init
+
+ fHistos->fhEvents->Fill( 0 );
+
+ Bool_t triggerkMB = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & ( AliVEvent::kMB );
+
+ if( triggerkMB ){
+ triggeredEventMB = kTRUE; //event triggered as minimum bias
+ fHistos->fhEvents->Fill( 1 );
+ }
+ //--------------------------------------------------------------
+ // check reconstructed vertex
+ int ncontributors = 0;
+ Bool_t goodRecVertex = kFALSE;
+ const AliVVertex *vtx = event->GetPrimaryVertex();
+ if(vtx){
+ ncontributors = vtx->GetNContributors();
+ if(ncontributors > 0){
+ zVert = vtx->GetZ();
+ fHistos->fhEvents->Fill( 2 );
+ if(fCard->VertInZRange(zVert)) {
+ goodRecVertex = kTRUE;
+ fHistos->fhEvents->Fill( 3 );
+ zBin = fCard->GetBin(kZVertType, zVert);
+ }
+ }
+ }
+ return goodRecVertex;
+ }
+ //---------------------------------
+}
+
+//________________________________________________________________________
+double AliJEbECORRTask::RunEbEFlowAnalysis(AliVEvent *event, TClonesArray* inputlist){
+
+ Double_t qxTot = 0.0, qyTot = 0.0;
+ Double_t qxTotA = 0.0, qyTotA = 0.0;
+ Double_t qxTotC[kNHarmonics] = {0.0}, qyTotC[kNHarmonics] = {0.0};
+ double Qxa[kNHarmonics];
+ double Qxb[kNHarmonics];
+ double Qya[kNHarmonics];
+ double Qyb[kNHarmonics];
+ double Qxalt[kNHarmonics];
+ double Qyalt[kNHarmonics];
+ double Psi[kNHarmonics];
+ double PsiA[kNHarmonics];
+ double PsiC[kNHarmonics];
+ double vnxa[kNHarmonics];
+ double vnya[kNHarmonics];
+ double vnxb[kNHarmonics];
+ double vnyb[kNHarmonics];
+ double vnx[kNHarmonics];
+ double vny[kNHarmonics];
+ double vobsalt[kNHarmonics];
+
+ int firstH = 1;
+
+ for( int ih=1;ih<kNHarmonics;ih++ ){
+ fEbeHistos->fhEPCosndPhi[ih]->Reset();
+ fEbeHistos->fhEPCosndPhi2[ih]->Reset();
+ }
+ AliEventplane *ep = event->GetEventplane();
+ if(ep){
+ for( int ih=firstH;ih<kNHarmonics;ih++ ){
+ Psi[ih] = ep->CalculateVZEROEventPlane(event,10,ih,qxTot,qyTot);
+ PsiA[ih] = ep->CalculateVZEROEventPlane(event,8,ih,qxTotA,qyTotA);
+ PsiC[ih] = ep->CalculateVZEROEventPlane(event,9,ih,qxTotC[ih],qyTotC[ih]);
+ fEbeHistos->fhQvectorV0[cBin][ih]->Fill(TMath::Sqrt(qxTot*qxTot+qyTot*qyTot));
+ fEbeHistos->fhQvectorV0A[cBin][ih]->Fill(TMath::Sqrt(qxTotA*qxTotA+qyTotA*qyTotA));
+ fEbeHistos->fhQvectorV0C[cBin][ih]->Fill(TMath::Sqrt(qxTotC[ih]*qxTotC[ih]+qyTotC[ih]*qyTotC[ih]));
+ fEbeHistos->fhEventPlane[cBin][ih]->Fill(Psi[ih]);
+ fEbeHistos->fhQvectorCorrelation[cBin][ih]->Fill(TMath::Sqrt(qxTotA*qxTotA+qyTotA*qyTotA),TMath::Sqrt(qxTotC[ih]*qxTotC[ih]+qyTotC[ih]*qyTotC[ih]));
+ }
+ }
+ for(int ih = 0 ; ih < kNHarmonics; ih++){
+ Qxa[ih] = 0;
+ Qxb[ih] = 0;
+ Qya[ih] = 0;
+ Qyb[ih] = 0;
+ Qxalt[ih] = 0;
+ Qyalt[ih] = 0;
+ }
+
+ int counterA = 0;
+ int counterB = 0;
+ int counterAB = 0;
+ int counterMulti = 0;
+ double lowpTcut = 0.5;// ATLAS paper > 0.5
+
+ for(int i=0;i<inputlist->GetEntriesFast();i++) {
+ AliJBaseTrack *track = (AliJBaseTrack*)inputlist->At(i);
+ //double w = tk->Pt();
+ double w = 1;
+ if(track->Pt()>lowpTcut){
+ counterMulti++;
+ if(fRandom->Uniform(1.0)<0.5){
+ for(int ih = firstH ; ih < kNHarmonics ; ih++){
+ Qxa[ih] = Qxa[ih] + w*TMath::Cos(ih*track->Phi());
+ Qya[ih] = Qya[ih] + w*TMath::Sin(ih*track->Phi());
+ }
+ //counterA+=w;
+ counterA++;
+ }
+ else{
+ for(int ih = firstH ; ih < kNHarmonics ; ih++){
+ Qxb[ih] = Qxb[ih] + w*TMath::Cos(ih*track->Phi());
+ Qyb[ih] = Qyb[ih] + w*TMath::Sin(ih*track->Phi());
+ }
+ // counterB+=w;
+ counterB++;
+ }
+ for(int ih = firstH; ih < kNHarmonics; ih++){
+ Qxalt[ih] = Qxalt[ih] + w*TMath::Cos(ih*track->Phi());
+ Qyalt[ih] = Qyalt[ih] + w*TMath::Sin(ih*track->Phi());
+ }
+ //counterAB+=w;
+ counterAB++;
+ }
+ for(int ih = firstH; ih < kNHarmonics ; ih++){
+ fEbeHistos->fhEPCosndPhi[ih]->Fill( cos(ih*(track->Phi()-Psi[ih])) );
+ if(track->Pt()>lowpTcut){
+ fEbeHistos->fhEPCosndPhi2[ih]->Fill( cos(ih*(track->Phi()-Psi[ih])) );
+ }
+ //fEbeHistos->hEPdNdPhi[id][ih]->Fill( track->Phi()-Psi[ih] );
+ fEbeHistos->fhCosndPhiPt[cBin][ih]->Fill(track->Pt(), cos(ih*(track->Phi()-Psi[ih])));
+ fEbeHistos->fhCounter[cBin][ih]->Fill(track->Pt(),1);
+ }
+ } // track loop
+
+ // calculating Vn obs
+ if(counterA > 1 && counterB > 1){
+
+ for(int ih = firstH ; ih < kNHarmonics ; ih++){
+ vnxa[ih] = Qxa[ih]/counterA;
+ vnya[ih] = Qya[ih]/counterA;
+ vnxb[ih] = Qxb[ih]/counterB;
+ vnyb[ih] = Qyb[ih]/counterB;
+ vnx[ih] = Qxalt[ih]/counterAB;
+ vny[ih] = Qyalt[ih]/counterAB;
+ vobsalt[ih] = TMath::Sqrt(vnx[ih]*vnx[ih]+vny[ih]*vny[ih]);
+ fEbeHistos->fhVnObsVector[cBin][ih]->Fill(vobsalt[ih]);
+ //cout << "ih: " << ih << " vnalt Average : " << vnalt[ih]->GetMean() << " Current vobs: " << vobsalt[ih] << " Counter: " << counterAB << endl;
+ fEbeHistos->fhResponseDist[cBin][ih]->Fill(vnxa[ih]-vnxb[ih],vnya[ih]-vnyb[ih]);
+ }
+ //multiCount->Fill(counterMulti);
+ fEbeHistos->fhMultiCount[cBin]->Fill(counterAB);
+ }
+
+ // Vn from EP
+ for(int ih = firstH; ih < kNHarmonics; ih++){
+ fEbeHistos->fhVnObsEP[cBin][ih]->Fill(fEbeHistos->fhEPCosndPhi2[ih]->GetMean());
+ //VnMulti[ih]->Fill(hEPCosndPhi2[ih]->GetEntries(),hEPCosndPhi2[ih]->GetMean());
+ }
+ for(int i=0;i<inputlist->GetEntriesFast();i++) {
+ AliJBaseTrack *track = (AliJBaseTrack*)inputlist->At(i);
+ for(int ih = firstH; ih < kNHarmonics; ih++)
+ fEbeHistos->fheCosndPhiPt[cBin][ih]->Fill(track->Pt(), pow( (cos (ih* (track->Phi()-Psi[ih]) - fEbeHistos->fhCosndPhiPt[cBin][ih]->GetBinContent( ( fEbeHistos->fhCosndPhiPt[cBin][ih]->FindBin(track->Pt()))))),2));
+ }
+
+ // correlation VnObs vs Qvector from V0C
+ for(int ih = firstH; ih < kNHarmonics; ih++){
+ fEbeHistos->fhVnObsVsQvectorCorrelation[cBin][ih]->Fill(vobsalt[ih],TMath::Sqrt(qxTotC[ih]*qxTotC[ih]+qyTotC[ih]*qyTotC[ih]));
+ }
+ // E-b-E vn selection here
+ int ih = 3;// for 3 rd harmonics
+ double ebeCent = fEbePercentile->GetEbeFlowPercentile( cBin, ih, vobsalt[ih] );//From the data scan observed distribution at this moment, we need matrix to unfloded vn
+
+ return ebeCent;
+}
+
+//________________________________________________________________________
+void AliJEbECORRTask::PlayCorrelation(TClonesArray *triggList, TClonesArray *assocList){
+ int noTrigg = triggList->GetEntries();
+ int noAssoc = assocList->GetEntries();
+
+ fHistos->fhAssocMult->Fill(noAssoc);
+ //------------------------------------------------------------------
+ //==== Correlation Loop
+ //------------------------------------------------------------------
+ for(int ii=0;ii<noTrigg;ii++){ // trigger loop
+ AliJBaseTrack * triggTr = (AliJBaseTrack*)triggList->At(ii);
+ int iptt = triggTr->GetTriggBin();
+ if( iptt < 0 ) continue;
+ double effCorr = 1.0/triggTr->GetTrackEff();
+ fHistos->fhTriggPtBin[cBin][zBin][iptt]->Fill(triggTr->Pt(), effCorr);//inclusive
+ for(int jj=0;jj<noAssoc;jj++){ // assoc loop
+ AliJBaseTrack *assocTr = (AliJBaseTrack*)assocList->At(jj);
+ fcorrelations->FillAzimuthHistos(kReal, cBin, zBin, triggTr, assocTr);
+ }
+ } // end of trigg
+}
+
+void AliJEbECORRTask::ScaleNotEquidistantHisto(TH1D *hid, const double sc=1){
+ // histo scaler
+ for(int i=1;i<= hid->GetNbinsX();i++){
+ hid->SetBinContent(i,hid->GetBinContent(i)*sc/hid->GetBinWidth(i));
+ hid->SetBinError(i,hid->GetBinError(i)*sc/hid->GetBinWidth(i));
+ }
+}
--- /dev/null
+#ifndef AliJEBECORR_cxx
+#define AliJEBECORR_cxx
+
+#include <TVector.h>
+#include <TRandom.h>
+#include <TString.h>
+#include <TPRegexp.h>
+#include "AliAnalysisTaskSE.h"
+#include "AliGenEventHeader.h"
+#include "AliAnalysisUtils.h"
+#include "AliJEfficiency.h"
+
+#include <sys/types.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <time.h>
+#include <math.h>
+#include <fstream>
+
+class AliESDEvent;
+class AliESDtrackCuts;
+class AliESDVertex;
+class TClonesArray;
+class AliJCard;
+class AliJBaseTrack;
+class AliJHistos;
+class AliJEbeHistos;
+class AliJCorrelations;
+class AliJEbePercentile;
+class AliJEfficiency;
+class AliJEventPool;
+class AliJRunTable;
+
+class AliJEbECORRTask : public AliAnalysisTaskSE {
+
+ public:
+ AliJEbECORRTask();
+ AliJEbECORRTask(const char *name);
+ AliJEbECORRTask(const AliJEbECORRTask& a); // not implemented
+ AliJEbECORRTask& operator=(const AliJEbECORRTask& ap); // not implemented
+
+ virtual ~AliJEbECORRTask();
+
+ virtual void UserCreateOutputObjects();
+ virtual void UserExec(Option_t *option);
+ virtual void Terminate(Option_t *);
+ virtual Bool_t UserNotify();
+
+ bool IsGoodEvent(AliVEvent *event);
+ double RunEbEFlowAnalysis(AliVEvent *event, TClonesArray* inputlist);
+ void PlayCorrelation(TClonesArray *triggList, TClonesArray *assocList);
+ void SetDebugMode( int debug) { fDebugMode = debug; };
+ void ScaleNotEquidistantHisto(TH1D *hid, const double sc);
+ AliJCard *GetCard() { return fCard; }
+ void SetCard( AliJCard *c ) { fCard = c; }
+ void SetEbePercentileInputFileName(TString name) { ebePercentileInputFileName = name; };
+ TString MemoryStatus(){
+ int pid = getpid();
+ TString key;
+ TString v1;
+ ifstream ins(Form("/proc/%d/status",pid ));
+ double VmSwap= 0.;
+ double VmSize= 0.;
+ double VmPeak= 0.;
+ double nom = TMath::Power( 2, 20 );
+ TPMERegexp split("\\s+");
+ TString line;
+ while( ins.good() ){
+ line.ReadLine(ins);
+ split.Split(line);
+ if( split.NMatches() < 2 ) continue;
+ key = split[0];
+ v1 = split[1];
+ if( key == "VmSwap:" ) VmSwap = v1.Atof()/nom;
+ if( key == "VmSize:" ) VmSize = v1.Atof()/nom;
+ if( key.BeginsWith("VmPeak") ) VmPeak = v1.Atof()/nom;
+ }
+ TString res = Form("VmPeak:%10.2f VmSize:%10.2f VmSwap:%10.2f", VmPeak, VmSize, VmSwap);
+ ins.close();
+ return res;
+ };
+
+ private:
+ TDirectory *fOutput; // Output
+
+ AliAnalysisUtils *fAnaUtils;
+
+ AliJCard * fCard;
+
+ AliJHistos * fHistos; //!
+ AliJEbeHistos * fEbeHistos; //!
+ AliJEfficiency *fEfficiency;
+ int fHadronSelectionCut;
+
+ TClonesArray * fInputList;
+ TClonesArray * ftriggList;
+ TClonesArray * fassocList;
+
+ AliJCorrelations *fcorrelations; //!
+ AliJEventPool *fassocPool; //!
+ AliJEbePercentile *fEbePercentile; //!
+
+ Bool_t fFirstEvent; //
+ int cBin;
+ int ebeBin;
+ int zBin;
+ double zVert;
+ Int_t fevt; // event number
+ int fDebugMode;
+ Int_t trkfilterBit;
+ TVector *fEbECentBinBorders;
+ TString ebePercentileInputFileName;
+ AliJRunTable *fRunTable; //
+
+ TRandom *fRandom;
+
+ ClassDef(AliJEbECORRTask, 1); // example of analysis
+};
+
+#endif
--- /dev/null
+#include "AliJEbeHistos.h"
+#include "AliJCard.h"
+
+//______________________________________________________________________________
+AliJEbeHistos::AliJEbeHistos(AliJCard* cardP):
+ fcard(cardP),
+ fmaxEtaRange(0),
+ fmaxTriggEtaRange(0),
+ ftriggFiducCut(0),
+ fhistoList(NULL),
+ fUseDirectory(true),
+ fTopDirectory(false)
+{ // constructor
+
+ fcard=cardP;
+ fmaxEtaRange = fcard->Get("EtaRange");
+ ftriggFiducCut = fcard->Get("TriggerFiducialEtaCut"); //FK// Fiduc cut
+ fmaxTriggEtaRange = fmaxEtaRange - ftriggFiducCut; //FK// Trigger range
+
+ fhistoList = new TList();
+ fTopDirectory = gDirectory;
+
+ //fhtyp[1] = "Real";
+ //fhtyp[2] = "Mixed";
+ //fhtyp[3] = "Rap. Gap";
+}
+
+//______________________________________________________________________________
+AliJEbeHistos::AliJEbeHistos(const AliJEbeHistos& obj):
+ fcard(obj.fcard),
+ fmaxEtaRange(obj.fmaxEtaRange),
+ fmaxTriggEtaRange(obj.fmaxTriggEtaRange),
+ ftriggFiducCut(obj.ftriggFiducCut),
+ fhistoList(obj.fhistoList),
+ fUseDirectory(obj.fUseDirectory),
+ fTopDirectory(obj.fTopDirectory)
+{
+ // copy constructor
+}
+
+//______________________________________________________________________________
+AliJEbeHistos& AliJEbeHistos::operator=(const AliJEbeHistos& obj)
+{
+
+ JUNUSED(obj);
+ // copy constructor
+ return *this;
+}
+
+
+void AliJEbeHistos::CreateUnfoldingHistos(){
+ // pi0mass histos
+
+ int hic;
+ float b1 = 0, b2 = 0.50;
+ int bins=300;
+ double lbin = 0.0;
+ double hbin = 0.5;
+ const int NPTBins = 51;
+
+ Double_t PTBINS[NPTBins+1] = {
+ 0.0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45,
+ 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95,
+ 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9,
+ 2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.2, 3.4, 3.6, 3.8,
+ 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 8.0, 10.5, 14.0,
+ 21.0, 32.0};
+
+ if(fcard->GetNoOfBins(kCentrType) > kMaxNoCentrBin ){
+ cout<<"ERROR: No of Centrality bins exceed max dim in AliJEbeHistos.cxx "<<endl;
+ exit(0);
+ }
+
+ TDirectory * cwd = gDirectory;
+ TDirectory * nwd = gDirectory->mkdir("UnfoldingHistos");
+ if( nwd ) nwd->cd();
+
+ for( hic=0;hic<fcard->GetNoOfBins(kCentrType);hic++){
+ for(int ih = 1; ih < kNHarmonics; ih++){
+ b1 = fcard->GetBinBorder(kCentrType, hic);
+ b2 = fcard->GetBinBorder(kCentrType, hic+1);
+ //inclusive fpt spectra================================================
+ sprintf(fhname,"hVnObsVector%02d%02d", hic, ih);
+ sprintf(fhtit, "Observed v_{%d}: %3.0f -%3.0f ", ih, b1, b2);
+ fhVnObsVector[hic][ih] = new TH1D(fhname, fhtit, bins, lbin,hbin); fhVnObsVector[hic][ih]->Sumw2();
+ fhistoList->Add(fhVnObsVector[hic][ih]);
+ sprintf(fhname,"hResponseDist%02d%02d", hic,ih);
+ sprintf(fhtit, "Response Distribution v_{%d}: %3.0f -%3.0f ", ih, b1, b2);
+ fhResponseDist[hic][ih] = new TH2D(fhname, fhtit, bins, -0.5, 0.5, bins, -0.5,0.5); fhResponseDist[hic][ih]->Sumw2();
+ fhistoList->Add(fhResponseDist[hic][ih]);
+ sprintf(fhname,"hVnObsEP%02d%02d", hic,ih);
+ sprintf(fhtit, "Observed EP v_{%d}: %3.0f -%3.0f ", ih, b1, b2);
+ fhVnObsEP[hic][ih] = new TH1D(fhname, fhtit, bins, -0.2,0.5); fhVnObsEP[hic][ih]->Sumw2();
+ fhistoList->Add(fhVnObsEP[hic][ih]);
+ sprintf(fhname,"hCosndPhiPt%02d%02d", hic,ih);
+ sprintf(fhtit, "Cos%d#Delta#phi Pt: %3.0f -%3.0f ", ih, b1, b2);
+ fhCosndPhiPt[hic][ih] = new TH1D(fhname, fhtit, NPTBins, PTBINS); fhCosndPhiPt[hic][ih]->Sumw2();
+ fhistoList->Add(fhCosndPhiPt[hic][ih]);
+ sprintf(fhname,"heCosndPhiPt%02d%02d", hic,ih);
+ sprintf(fhtit, "eCos%d#Delta#phi Pt: %3.0f -%3.0f ", ih, b1, b2);
+ fheCosndPhiPt[hic][ih] = new TH1D(fhname, fhtit, NPTBins, PTBINS); fheCosndPhiPt[hic][ih]->Sumw2();
+ fhistoList->Add(fheCosndPhiPt[hic][ih]);
+ sprintf(fhname,"hCounter%02d%02d", hic,ih);
+ sprintf(fhtit, "Counter Pt %02d: %3.0f -%3.0f ", ih, b1, b2);
+ fhCounter[hic][ih] = new TH1D(fhname, fhtit, NPTBins, PTBINS); fhCounter[hic][ih]->Sumw2();
+ fhistoList->Add(fhCounter[hic][ih]);
+
+ sprintf(fhname,"hEventPlane%02d%02d", hic,ih);
+ sprintf(fhtit, "Event Planes %02d: %3.0f -%3.0f ", ih, b1, b2);
+ fhEventPlane[hic][ih] = new TH1D(fhname, fhtit, 100, -6.5,6.5); fhEventPlane[hic][ih]->Sumw2();
+ fhistoList->Add(fhEventPlane[hic][ih]);
+
+ sprintf(fhtit, "Q vector from V0 %02d: %3.0f -%3.0f ", ih, b1, b2);
+ fhQvectorV0[hic][ih] = new TH1D(Form("hQvectorV0_%02d%02d",hic,ih),fhtit ,400, 0, 100); fhQvectorV0[hic][ih]->Sumw2();
+ sprintf(fhtit, "Q vector from V0A %02d: %3.0f -%3.0f ", ih, b1, b2);
+ fhQvectorV0A[hic][ih] = new TH1D(Form("hQvectorV0A_%02d%02d",hic,ih),fhtit ,400, 0, 100); fhQvectorV0A[hic][ih]->Sumw2();
+ sprintf(fhtit, "Q vector from V0C %02d: %3.0f -%3.0f ", ih, b1, b2);
+ fhQvectorV0C[hic][ih] = new TH1D(Form("hQvectorV0C_%02d%02d",hic,ih), fhtit ,400, 0, 100); fhQvectorV0C[hic][ih]->Sumw2();
+ fhistoList->Add(fhQvectorV0[hic][ih]);
+ fhistoList->Add(fhQvectorV0A[hic][ih]);
+ fhistoList->Add(fhQvectorV0C[hic][ih]);
+
+ sprintf(fhtit, "Q vector correlation V0A and V0C %02d: %3.0f -%3.0f ", ih, b1, b2);
+ fhQvectorCorrelation[hic][ih] = new TH2D(Form("hQvectorCorrelation_%02d%02d",hic,ih),fhtit , 400, 0, 100, 400, 0 ,100); fhQvectorCorrelation[hic][ih]->Sumw2();
+ fhistoList->Add(fhQvectorCorrelation[hic][ih]);
+
+ sprintf(fhtit, "VnObs vs V0C Qvector correlation %02d: %3.0f -%3.0f ", ih, b1, b2);
+ fhVnObsVsQvectorCorrelation[hic][ih] = new TH2D(Form("hVnObsVsQvectorCorrelation_%02d%02d",hic,ih),fhtit , 400, 0, 0.5, 400, 0 ,100); fhVnObsVsQvectorCorrelation[hic][ih]->Sumw2();
+ fhistoList->Add(fhVnObsVsQvectorCorrelation[hic][ih]);
+ }
+ sprintf(fhname,"hMultiCount%02d", hic);
+ sprintf(fhtit, "Multiplicity count: %3.0f -%3.0f ", b1, b2);
+ fhMultiCount[hic] = new TH1D( fhname, fhtit, 1000, 0, 10000 );
+ fhistoList->Add(fhMultiCount[hic]);
+ }
+ // tmp histogram for e-b-e
+ for(int ih = 1; ih < kNHarmonics; ih++){
+ fhEPCosndPhi[ih] = new TH1D(Form("hEPCosndPhi_%02d",ih), Form("cos%d#Delta#phi",ih), 400, -1.1, 1.1); fhEPCosndPhi[ih]->Sumw2();
+ fhEPCosndPhi2[ih] = new TH1D(Form("hEPCosndPhi2_%02d",ih), Form("cos%d#Delta#phi",ih), 400, -1.1, 1.1); fhEPCosndPhi2[ih]->Sumw2();
+ fhistoList->Add(fhEPCosndPhi[ih]);
+ fhistoList->Add(fhEPCosndPhi2[ih]);
+
+
+ }
+ cwd->cd();
+}
+
--- /dev/null
+//===========================================================
+// AliJEbeHistos.h
+//
+// J
+//===========================================================
+
+#ifndef ALIJEBEHISTOS_H
+#define ALIJEBEHISTOS_H
+
+#include <iostream>
+#include <fstream>
+#include <stdlib.h>
+#include <stdio.h>
+
+#include <TH1.h>
+#include <TH2.h>
+#include <TProfile.h>
+#include <TFile.h>
+#include <TList.h>
+#include <TLorentzVector.h>
+
+#include "AliJConst.h"
+
+
+class AliJCard;
+
+using namespace std;
+
+class AliJEbeHistos {
+
+ public:
+ AliJEbeHistos(AliJCard* cardP); //constructor
+ virtual ~AliJEbeHistos(){delete fhistoList;} //destructor
+ AliJEbeHistos(const AliJEbeHistos& obj);
+ AliJEbeHistos& operator=(const AliJEbeHistos& obj);
+
+ // create histograms
+ void CreateUnfoldingHistos();
+ TList *GetHistoList() { return fhistoList; }
+
+ void UseDirectory(bool b) { fUseDirectory=b; }
+ bool UseDrectory(){ return fUseDirectory; }
+
+ TDirectory * MakeDirectory(TString name){
+ JumpToDefalutDirectory();
+ TDirectory * dir = gDirectory->GetDirectory(name);
+ if( !dir ) dir = gDirectory->mkdir(name);
+ dir->cd();
+ return dir;
+ }
+ TDirectory * JumpToDefalutDirectory(){
+ fTopDirectory->cd();
+ return gDirectory;
+ }
+
+ public:
+ AliJCard *fcard; // comment me
+ char fhname[40], fhtit[40]; // comment me
+ TString fhtyp[3]; // comment me
+
+
+ //Unfolding
+ TH1D* fhVnObsVector[kMaxNoCentrBin][kNHarmonics];
+ TH2D* fhResponseDist[kMaxNoCentrBin][kNHarmonics];
+ TH1D* fhMultiCount[kMaxNoCentrBin];
+ TH1D* fhVnObsEP[kMaxNoCentrBin][kNHarmonics];
+ TH1D* fhCosndPhiPt[kMaxNoCentrBin][kNHarmonics];
+ TH1D* fheCosndPhiPt[kMaxNoCentrBin][kNHarmonics];
+ TH1D* fhCounter[kMaxNoCentrBin][kNHarmonics];
+ TH1D* fhEventPlane[kMaxNoCentrBin][kNHarmonics];
+ TH1D *fhEPCosndPhi[kNHarmonics];
+ TH1D *fhEPCosndPhi2[kNHarmonics];
+
+ TH1D *fhQvectorV0[kMaxNoCentrBin][kNHarmonics];
+ TH1D *fhQvectorV0A[kMaxNoCentrBin][kNHarmonics];
+ TH1D *fhQvectorV0C[kMaxNoCentrBin][kNHarmonics];
+ TH2D *fhQvectorCorrelation[kMaxNoCentrBin][kNHarmonics];
+ TH2D *fhVnObsVsQvectorCorrelation[kMaxNoCentrBin][kNHarmonics];
+
+ TH1D *fhResolution[kMaxNoCentrBin][kNHarmonics];
+
+
+
+ protected:
+ double fmaxEtaRange; // evident
+ double fmaxTriggEtaRange; // should be the same as above. Use for GeoAccCorr
+ double ftriggFiducCut; // fiducial cut for the trigger part in eta. Not in use I think (Jan)
+
+ TList *fhistoList; // comment me
+ bool fUseDirectory;
+ TDirectory * fTopDirectory;
+
+};
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--- /dev/null
+#include <TGrid.h>
+#include "AliJEbePercentile.h"
+
+//______________________________________________________________________________
+AliJEbePercentile::AliJEbePercentile():
+ fFile(NULL),
+ fCard(NULL)
+{
+}
+//______________________________________________________________________________
+AliJEbePercentile::AliJEbePercentile(const AliJEbePercentile& obj):
+ fFile(obj.fFile),
+ fCard(obj.fCard)
+{
+ // copy constructor
+}
+
+AliJEbePercentile::AliJEbePercentile(AliJCard *fcard, TString input):
+ fFile(NULL),
+ fCard(NULL)
+{
+
+ fCard = fcard;
+ cout << input << endl;
+
+ if (TString(input).BeginsWith("alien:")) TGrid::Connect("alien:");
+ fFile = TFile::Open(input);
+
+ fFile->Print();
+
+ for(int ibv = 0; ibv < NBVn ; ibv++){
+ vnPercentile[ibv] = ibv*1.0/NBVn;
+ }
+
+ TString name;
+ int NH = 4;
+ for(int ic = 0; ic<fCard->GetNoOfBins(kCentrType);ic++){
+ for(int ih=2;ih<NH;ih++) {
+ name = "hVnObsVector";
+ vnobs[ih][ic] = (TH1D*)fFile->Get(name.Append(Form("%02d%02d",ic,ih)));
+ }
+ }
+
+ double entr;
+ double sum;
+ int found[NBVn];
+
+ for(int ic = 0 ; ic < fCard->GetNoOfBins(kCentrType); ic++){
+ for(int ih = 2; ih < NH ; ih++){
+ vnLimit[ih][ic][0]=1;
+ vnLimit[ih][ic][NBVn-1]=0;
+ for(int ibv = 1 ; ibv < NBVn ; ibv++){
+ found[ibv] = 0;
+ }
+ sum = 0;
+ entr = vnobs[ih][ic]->GetEntries();
+ //cout << "Centrality " << ic << " of " << NC ;
+ //cout << " Harmonic " << ih << " of " << NH << endl;
+ for(int ib = 1; ib < vnobs[ih][ic]->GetNbinsX() +1 ; ib++){
+ sum = sum + vnobs[ih][ic]->GetBinContent(ib);
+ for(int ibv = 1; ibv < NBVn ; ibv++){
+ if( sum/entr > 1- vnPercentile[ibv] && found[ibv] == 0){
+ //cout << "top " << vnpercentile[ibv]*100 << "% limit: " << vnobs[ih][ic]->GetBinCenter(ib) << endl;
+ found[ibv] = 1;
+ vnLimit[ih][ic][ibv] = vnobs[ih][ic]->GetBinCenter(ib);
+ }
+ }
+
+ }
+ }
+ }
+}
+
+
+
+
+//______________________________________________________________________________
+AliJEbePercentile& AliJEbePercentile::operator=(const AliJEbePercentile& obj){
+ // copy constructor
+ JUNUSED(obj);
+ return *this;
+}
+
+
+double AliJEbePercentile::GetEbeFlowPercentile(int cBin, int ih, double vn){
+ double pecentile = -1;
+ for(int ibv = 0 ; ibv < NBVn ; ibv++){
+ if(vn > vnLimit[cBin][ih][ibv]){
+ pecentile = vnPercentile[ibv];
+ }
+ }
+ return pecentile;
+}
+
--- /dev/null
+//===========================================================
+// AliJEbePercentile.h
+//
+// J
+//===========================================================
+
+#ifndef ALIJEBEPERCENTILE_H
+#define ALIJEBEPERCENTILE_H
+
+#include <iostream>
+#include <fstream>
+#include <stdlib.h>
+#include <stdio.h>
+
+#include <TH1.h>
+#include <TH2.h>
+#include <TProfile.h>
+#include <TFile.h>
+#include <TList.h>
+#include <TLorentzVector.h>
+#include "AliJConst.h"
+#include "AliJCard.h"
+
+class AliJCard;
+
+const int NBVn = 100;
+
+using namespace std;
+
+class AliJEbePercentile {
+
+ public:
+ AliJEbePercentile();
+ virtual ~AliJEbePercentile(){delete fFile;} //destructor
+ AliJEbePercentile(const AliJEbePercentile& obj);
+ AliJEbePercentile(AliJCard *fCard, TString file);
+ AliJEbePercentile& operator=(const AliJEbePercentile& obj);
+
+ double GetEbeFlowPercentile(int cBin, int ih, double vn);
+
+
+ protected:
+ TFile *fFile;
+ AliJCard *fCard;
+ double vnLimit[kMaxNoCentrBin][kNHarmonics][NBVn];
+ double vnPercentile[NBVn+1];
+ TH1D *vnobs[kMaxNoCentrBin][kNHarmonics];
+};
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+// Comment describing what this class does needed!
+
+//===========================================================
+// Dummy comment, should be replaced by a real one
+// comment
+// comment
+//===========================================================
+
+#include <TRandom.h>
+#include <TMath.h>
+
+#include "AliJBaseTrack.h"
+#include "AliJCorrelations.h"
+#include "AliJEventPool.h"
+#include "AliJHistos.h"
+#include "AliJEfficiency.h"
+
+#include "AliJJet.h"
+#include "AliJJetCORRAnalysis.h"
+#include "AliJHistManager.h"
+
+AliJJetCORRAnalysis::AliJJetCORRAnalysis():
+ fInputList(NULL),
+ fJetList(NULL),
+ fJetListOfList(),
+ fIsFullAcceptance(0),
+ fJetEtaRange(0),
+ fTrackJetMap(NULL),
+ fJetPtBins(NULL),
+ fJetPtMinCut(0),
+ fCard(0x0),
+ fHistos(0x0),
+ fEfficiency(0x0),
+ ftriggList(0x0),
+ fassocList(0x0),
+ fcorrelations(0x0),
+ fassocPool(0x0),
+ cBin(-1),
+ fcent(-999),
+ zBin(-1),
+ fevt(0),
+ fTargetJetIndex(0),
+ fDebugMode(0)
+{
+ // Constaractor
+}
+
+AliJJetCORRAnalysis::AliJJetCORRAnalysis( AliJCard * card ):
+ fInputList(NULL),
+ fJetList(NULL),
+ fJetListOfList(),
+ fIsFullAcceptance(0),
+ fJetEtaRange(0),
+ fTrackJetMap(NULL),
+ fJetPtBins(NULL),
+ fJetPtMinCut(0),
+ fCard(card),
+ fHistos(0x0),
+ fEfficiency(0x0),
+ ftriggList(0x0),
+ fassocList(0x0),
+ fcorrelations(0x0),
+ fassocPool(0x0),
+ cBin(-1),
+ fcent(-999),
+ zBin(-1),
+ fevt(0),
+ fTargetJetIndex(0),
+ fDebugMode(0)
+{
+ // Constaractor
+}
+
+AliJJetCORRAnalysis::AliJJetCORRAnalysis( const AliJJetCORRAnalysis & obj ):
+ fInputList(obj.fInputList),
+ fJetList(obj.fJetList),
+ fJetListOfList(obj.fJetListOfList),
+ fIsFullAcceptance(obj.fIsFullAcceptance),
+ fJetEtaRange(obj.fJetEtaRange),
+ fTrackJetMap(obj.fTrackJetMap),
+ fJetPtBins(obj.fJetPtBins),
+ fJetPtMinCut(obj.fJetPtMinCut),
+ fCard(obj.fCard),
+ fHistos(obj.fHistos),
+ fEfficiency(obj.fEfficiency),
+ ftriggList(obj.ftriggList),
+ fassocList(obj.fassocList),
+ fcorrelations(obj.fcorrelations),
+ fassocPool(obj.fassocPool),
+ cBin(-1),
+ fcent(-999),
+ zBin(-1),
+ fevt(0),
+ fTargetJetIndex(0),
+ fDebugMode(0)
+{
+ // Constaractor
+}
+
+AliJJetCORRAnalysis& AliJJetCORRAnalysis::operator=(const AliJJetCORRAnalysis & obj){
+ if( this != &obj ){
+ this->~AliJJetCORRAnalysis();
+ new(this) AliJJetCORRAnalysis(obj);
+ }
+ return *this;
+}
+
+void AliJJetCORRAnalysis::UserCreateOutputObjects(){
+ // comment needed
+ fJetPtBins = fCard->GetVector("Jet:PtBins");
+ fJetPtMinCut = fCard->Get("Jet:PtMinCut");
+
+ fInputList = new TClonesArray("AliJBaseTrack",1500);
+ fInputList->SetOwner(kTRUE);
+ ftriggList = new TClonesArray("AliJBaseTrack",1500);
+ fassocList = new TClonesArray("AliJBaseTrack",1500);
+
+ fHistos = new AliJHistos(fCard);
+ fHistos->CreateEventTrackHistos();
+ fHistos->CreateAzimuthCorrHistos();
+ fHistos->CreateIAAMoons();
+ fHistos->CreateXEHistos();
+ fHistos->CreateXtHistos();
+ fHistos->CreatePairPtCosThetaStar();
+
+ fHistos->fHMG->Print();
+
+ fcorrelations = new AliJCorrelations(fCard, fHistos);
+ fassocPool = new AliJEventPool( fCard, fHistos, fcorrelations, kJHadron);
+
+ fEfficiency = new AliJEfficiency();
+ fEfficiency->SetMode( fCard->Get("EfficiencyMode") ); // 0:NoEff, 1:Period 2:RunNum 3:Auto
+ fEfficiency->SetDataPath("alien:///alice/cern.ch/user/d/djkim/legotrain/efficieny/data"); // Efficiency root file location local or alien
+
+ fHistos->fHMG->WriteConfig();
+
+}
+
+void AliJJetCORRAnalysis::ClearBeforeEvent(){
+
+}
+
+void AliJJetCORRAnalysis::UserExec(){
+
+ TObjArray *jets = (TObjArray*) fJetListOfList[fTargetJetIndex]; // only for one jet finder
+ if(!jets) return;
+ ftriggList->Clear();
+ fassocList->Clear();
+ //Make Trigger list and assocList
+ int noTrigg=0,noAssoc=0;
+ for(int ii=0;ii<jets->GetEntriesFast();ii++) {
+ AliJJet *jet = (AliJJet*)jets->At(ii);
+ jet->SetTriggBin( fCard->GetBin(kTriggType, jet->Pt()) );
+ jet->SetTrackEff( 1.0 );
+ if( jet->GetTriggBin() > -1 ) { new ((*ftriggList)[noTrigg++]) AliJBaseTrack(*jet); }
+
+ TObjArray *constituents = (TObjArray*)jet->GetConstituents();
+ for(int jj=0;jj<constituents->GetEntriesFast();jj++) {
+ AliJBaseTrack *con = (AliJBaseTrack*)constituents->At(jj);
+ con->SetAssocBin( fCard->GetBin(kAssocType, con->Pt()) );
+ con->SetParticleType(kJHadron);
+ double pt = con->Pt();
+ con->SetTrackEff( fEfficiency->GetCorrection(pt, 5, fcent) ); // only here for hybrid cut = 5
+ if( con->GetAssocBin() > -1 ) { new ((*fassocList)[noAssoc++]) AliJBaseTrack(*con); }
+ if(con->GetAssocBin() > -1){
+ int ipta = con->GetAssocBin();
+ double effCorrection = 1.0/con->GetTrackEff();
+ fHistos->fhIphiAssoc[cBin][ipta]->Fill( con->Phi(), effCorrection);
+ fHistos->fhIetaAssoc[cBin][ipta]->Fill( con->Eta(), effCorrection);
+ }
+ }
+ }
+ if(fDebugMode>0) cout << "jetfinder " << ", noTrigg ="<< noTrigg <<", noAssoc = "<< noAssoc << endl;
+ PlayCorrelation(ftriggList, fassocList);
+}
+void AliJJetCORRAnalysis::Terminate() const{
+ // comment needed
+}
+
+
+void AliJJetCORRAnalysis::FillHistosJets(TObjArray *Jets){
+ for(int i=0; i<Jets->GetEntries();i++) {
+ AliJJet *jet = (AliJJet*)Jets->At(i);
+ jet->Print();
+ }
+}
+
+void AliJJetCORRAnalysis::CreateHistos(){
+ // Create Histograms
+}
+
+
+//________________________________________________________________________
+void AliJJetCORRAnalysis::PlayCorrelation(TClonesArray *triggList, TClonesArray *assocList){
+ int noTrigg = triggList->GetEntries();
+ int noAssoc = assocList->GetEntries();
+
+ fHistos->fhAssocMult->Fill(noAssoc);
+ //------------------------------------------------------------------
+ //==== Correlation Loop
+ //------------------------------------------------------------------
+ for(int ii=0;ii<noTrigg;ii++){ // trigger loop
+ AliJBaseTrack * triggTr = (AliJBaseTrack*)triggList->At(ii);
+ int iptt = triggTr->GetTriggBin();
+ if( iptt < 0 ) continue;
+ double effCorr = 1.0/triggTr->GetTrackEff();
+ fHistos->fhTriggPtBin[cBin][zBin][iptt]->Fill(triggTr->Pt(), effCorr);//inclusive
+ for(int jj=0;jj<noAssoc;jj++){ // assoc loop
+ AliJBaseTrack *assocTr = (AliJBaseTrack*)assocList->At(jj);
+ fcorrelations->FillAzimuthHistos(kReal, cBin, zBin, triggTr, assocTr); // cBin and zBin from the members in header vis setter from TaskCode.
+ }
+ } // end of trigg
+}
--- /dev/null
+/* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+// Short comment describing what this class does needed!
+
+//===========================================================
+// Dummy comment, should be replaced by a real one
+//===========================================================
+
+#ifndef ALIJJETCORRANALYSIS_H
+#define ALIJJETCORRANALYSIS_H
+
+#include <vector>
+#include <TObjArray.h>
+#include <TClonesArray.h>
+#include "AliJConst.h"
+#include "AliJCard.h"
+#include "AliJJet.h"
+#include "AliJHistManager.h"
+
+class AliJCard;
+class AliJHistos;
+class AliJCorrelations;
+class AliJEfficiency;
+class AliJEventPool;
+
+class AliJJetCORRAnalysis{
+ public:
+ AliJJetCORRAnalysis();
+ AliJJetCORRAnalysis( AliJCard * card );
+ AliJJetCORRAnalysis( const AliJJetCORRAnalysis & obj );
+ AliJJetCORRAnalysis& operator=(const AliJJetCORRAnalysis & obj);
+ void SetDebugMode( int debug) { fDebugMode = debug; };
+
+ void CreateHistos();
+ void FillHistosJets(TObjArray *Jets);
+
+ void AddJets(TObjArray * jets ){
+ if( !jets ) {
+ cout<<"JWARN_C1 in AddJets jets="<<jets<<endl;
+ //return;
+ }
+ fJetListOfList.Add( (TObject*)jets );
+ if( !jets ) return;
+ for( int i=0;i<jets->GetEntriesFast();i++ ){
+ //((AliJJet*)jets->At(i))->ReSum();
+ }
+ } // TODO clean before event
+
+ int GetNJets(){ return GetJetList()->GetEntriesFast(); }
+ TObjArray* GetJetList(){ return fJetList; }
+ Double_t GetJetEtaRange(){ return fJetEtaRange; }
+ void SetJetEtaRange(double eta){ fJetEtaRange=eta; }
+ void SetJetList(TObjArray* jetlist){ fJetList=jetlist; }
+ void SetInputList(TObjArray * ilist){ fInputList = ilist;}
+ void SetTrackJetMap(std::vector<int> * v){ fTrackJetMap=v;}
+ void SetJetPtBin( TVector * b){ fJetPtBins=b; }
+ void SetTargetJetIndex( int jfindex ) { fTargetJetIndex = jfindex; } // PlayCorrelation only for selected jetfinder
+
+ AliJJet & Jet( int i ){ return *(AliJJet*) fJetList->At(i); }
+ void UserCreateOutputObjects();
+ void UserExec();
+ void Terminate() const;
+
+ void ClearBeforeEvent();
+
+ // Related JCORRAN classes
+ void PlayCorrelation(TClonesArray *triggList, TClonesArray *assocList);
+ void SetCentralityBin( int cbin) { cBin = cbin;}
+ void SetCentrality( float cent) { fcent = cent;}
+ void SetZVertexBin( int zbin) { zBin = zbin;}
+ AliJEfficiency* GetAliJEfficiency() { return fEfficiency;}
+ AliJHistos *GetAliJHistos() { return fHistos;}
+
+ private:
+ TObjArray * fInputList; // comment needed
+ TObjArray * fJetList; // comment needed
+ TObjArray fJetListOfList; // !comment needed
+ bool fIsFullAcceptance; // comment needed
+ double fJetEtaRange; // comment needed
+ std::vector<int> *fTrackJetMap; // comment needed
+
+ TVector *fJetPtBins;
+ double fJetPtMinCut;
+
+ AliJCard * fCard; // comment needed
+ AliJHistos * fHistos; //!
+ AliJEfficiency *fEfficiency;
+ TClonesArray * ftriggList;
+ TClonesArray * fassocList;
+ AliJCorrelations *fcorrelations; //!
+ AliJEventPool *fassocPool; //!
+ int cBin;
+ float fcent;
+ int zBin;
+ Int_t fevt; // event number
+ int fTargetJetIndex;
+ int fDebugMode;
+};
+
+#endif
+
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+//______________________________________________________________________________
+// Analysis task for jet correlation Analysis
+// author: B.S Chang D.J. Kim
+// ALICE Group University of Jyvaskyla
+// Finland
+// Fill the analysis containers for ESD or AOD
+// Adapted for AliAnalysisTaskSE and AOD objects
+//////////////////////////////////////////////////////////////////////////////
+
+#include "AliAODEvent.h"
+#include "AliInputEventHandler.h"
+#include "AliAnalysisUtils.h"
+#include "AliAnalysisTaskSE.h"
+#include "AliAODHandler.h"
+#include "AliAnalysisManager.h"
+#include "AliLog.h"
+#include "AliJJetCORRTask.h"
+#include "AliJEventHeader.h"
+#include "AliJCard.h"
+#include "AliJRunTable.h"
+#include "AliJEfficiency.h"
+#include "AliJHistos.h"
+
+//______________________________________________________________________________
+AliJJetCORRTask::AliJJetCORRTask() :
+ AliAnalysisTaskSE("AliJJetCORRTaskTask"),
+ fJetTask(NULL),
+ fJetTaskName(""),
+ fJJetCORRAnalysis(0x0),
+ fOutput(NULL),
+ fCard(NULL),
+ fAnaUtils(NULL),
+ fRunTable(NULL),
+ fFirstEvent(kTRUE),
+ cBin(-1),
+ zBin(-1),
+ zVert(-999),
+ fDebugMode(0),
+ fTargetJetIndex(0),
+ fevt(-1)
+{
+ DefineOutput (1, TDirectory::Class());
+}
+
+//______________________________________________________________________________
+AliJJetCORRTask::AliJJetCORRTask(const char *name, TString inputformat):
+ AliAnalysisTaskSE(name),
+ fJetTask(NULL),
+ fJetTaskName(""),
+ fJJetCORRAnalysis(0x0),
+ fOutput(NULL),
+ fCard(NULL),
+ fAnaUtils(NULL),
+ fRunTable(NULL),
+ fFirstEvent(kTRUE),
+ cBin(-1),
+ zBin(-1),
+ zVert(-999),
+ fDebugMode(0),
+ fTargetJetIndex(0),
+ fevt(-1)
+{
+ // Constructor
+ AliInfo("---- AliJJetCORRTask Constructor ----");
+
+ JUNUSED(inputformat);
+ DefineOutput (1, TDirectory::Class());
+}
+
+//____________________________________________________________________________
+AliJJetCORRTask::AliJJetCORRTask(const AliJJetCORRTask& ap) :
+ AliAnalysisTaskSE(ap.GetName()),
+ fJetTask(ap.fJetTask),
+ fJetTaskName(ap.fJetTaskName),
+ fJJetCORRAnalysis( ap.fJJetCORRAnalysis ),
+ fOutput( ap.fOutput ),
+ fCard( ap.fCard ),
+ fAnaUtils(ap.fAnaUtils),
+ fRunTable(ap.fRunTable),
+ fFirstEvent(kTRUE),
+ cBin(-1),
+ zBin(-1),
+ zVert(-999),
+ fDebugMode(0),
+ fTargetJetIndex(0),
+ fevt(-1)
+{
+
+ AliInfo("----DEBUG AliJJetCORRTask COPY ----");
+
+}
+
+//_____________________________________________________________________________
+AliJJetCORRTask& AliJJetCORRTask::operator = (const AliJJetCORRTask& ap)
+{
+ // assignment operator
+
+ AliInfo("----DEBUG AliJJetCORRTask operator= ----");
+ this->~AliJJetCORRTask();
+ new(this) AliJJetCORRTask(ap);
+ return *this;
+}
+
+//______________________________________________________________________________
+AliJJetCORRTask::~AliJJetCORRTask()
+{
+ // destructor
+
+ delete fJJetCORRAnalysis;
+
+}
+
+//________________________________________________________________________
+
+void AliJJetCORRTask::UserCreateOutputObjects()
+{
+ //=== create the jcorran outputs objects
+ if(fDebugMode > 1) printf("AliJJetCORRTask::UserCreateOutPutData() \n");
+
+ fAnaUtils = new AliAnalysisUtils();
+ fAnaUtils->SetUseOutOfBunchPileUp( kTRUE );
+
+ //=== Get AnalysisManager
+ AliAnalysisManager *man = AliAnalysisManager::GetAnalysisManager();
+ fJetTask = (AliJJetTask*)(man->GetTask( fJetTaskName));
+
+ OpenFile(1);
+ fOutput = gDirectory;//->mkdir("JDiHadronCorr");
+ fOutput->cd();
+
+ fJJetCORRAnalysis = new AliJJetCORRAnalysis(fCard);
+ fJJetCORRAnalysis->UserCreateOutputObjects();
+ TNamed jetFinderName("JetFinder", fJetTask->GetJetFinderString()[fTargetJetIndex].Data() );
+ jetFinderName.Write();
+ fCard->WriteCard( gDirectory );
+
+
+ PostData( 1, fOutput );
+
+
+ cout << fJetTaskName <<"\t NumberOfJetCollections = "<< fJetTask->GetNumberOfJetCollections() << endl;
+
+ // Add jets into the fJJetCORRAnalysis-
+ for( int ij=0;ij< fJetTask->GetNumberOfJetCollections();ij++ ){
+ fJJetCORRAnalysis->AddJets( fJetTask->GetAliJJetList( ij ) );
+ }
+
+ fFirstEvent = kTRUE;
+
+ cout << "Add(fAliRunHeader) in UserCreateObject() ======= " << endl;
+}
+
+//______________________________________________________________________________
+void AliJJetCORRTask::UserExec(Option_t* /*option*/)
+{
+
+ // Processing of one event
+ if(fDebugMode > 5) cout << "------- AliJJetCORRTask Exec-------"<<endl;
+ if( fJetTask->GetTaskEntry() != fEntry ) return; // Make sure if we loop over the same event
+ fJJetCORRAnalysis->ClearBeforeEvent();
+
+ // Main loop
+ // Called for each event
+ AliVEvent *event = InputEvent();
+ if(!event) return;
+
+ //---------------------------------------------------------------
+ // check if the event was triggered or not and vertex
+
+ AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(event);
+ if(!aodEvent) return;
+
+ if( fFirstEvent ) {
+ fRunTable = & AliJRunTable::GetSpecialInstance();
+ fRunTable->SetRunNumber( aodEvent->GetRunNumber() );
+ fJJetCORRAnalysis->GetAliJEfficiency()->SetRunNumber( aodEvent->GetRunNumber() );
+ fJJetCORRAnalysis->GetAliJEfficiency()->Load();
+ fFirstEvent = kFALSE;
+ }
+
+ if(!IsGoodEvent( event )) return; // zBin is set there
+ if(fDebugMode) cout << "zvtx = " << zVert << endl;
+
+ // centrality
+ float fcent = -999;
+ if(fRunTable->IsHeavyIon() || fRunTable->IsPA()){
+ AliCentrality *cent = event->GetCentrality();
+ if( ! cent ) return;
+ fcent = cent->GetCentralityPercentile("V0M");
+ } else {
+ fcent = -1;
+ }
+ cBin = fCard->GetBin(kCentrType, fcent);;
+
+ if(cBin<0) return;
+
+ fJJetCORRAnalysis->SetCentralityBin( cBin );
+ fJJetCORRAnalysis->SetCentrality( fcent );
+ fJJetCORRAnalysis->SetZVertexBin( cBin );
+ fJJetCORRAnalysis->SetTargetJetIndex( fTargetJetIndex );
+
+ fJJetCORRAnalysis->UserExec();
+
+ PostData(1, fOutput );
+
+ if(fDebugMode > 5) cout << "\t------- End UserExec "<<endl;
+}
+
+//______________________________________________________________________________
+void AliJJetCORRTask::Init()
+{
+ // Intialisation of parameters
+ AliInfo("Doing initialization") ;
+ //fJJetCORRAnalysis->Init();
+}
+
+//______________________________________________________________________________
+void AliJJetCORRTask::Terminate(Option_t *)
+{
+ cout<<"AliJJetCORRTask Analysis DONE !!"<<endl;
+
+}
+
+//________________________________________________________________________
+bool AliJJetCORRTask::IsGoodEvent(AliVEvent *event) {
+
+ if(fRunTable->IsPP() && fAnaUtils->IsPileUpEvent(event)) {
+ return kFALSE;
+ } else {
+ Bool_t triggeredEventMB = kFALSE; //init
+
+ fJJetCORRAnalysis->GetAliJHistos()->fhEvents->Fill( 0 );
+
+ Bool_t triggerkMB = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & ( AliVEvent::kMB );
+
+ if( triggerkMB ){
+ triggeredEventMB = kTRUE; //event triggered as minimum bias
+ fJJetCORRAnalysis->GetAliJHistos()->fhEvents->Fill( 1 );
+ }
+ //--------------------------------------------------------------
+ // check reconstructed vertex
+ int ncontributors = 0;
+ Bool_t goodRecVertex = kFALSE;
+ const AliVVertex *vtx = event->GetPrimaryVertex();
+ if(vtx){
+ ncontributors = vtx->GetNContributors();
+ if(ncontributors > 0){
+ zVert = vtx->GetZ();
+ fJJetCORRAnalysis->GetAliJHistos()->fhEvents->Fill( 2 );
+ if(fCard->VertInZRange(zVert)) {
+ goodRecVertex = kTRUE;
+ fJJetCORRAnalysis->GetAliJHistos()->fhEvents->Fill( 3 );
+ zBin = fCard->GetBin(kZVertType, zVert);
+ }
+ }
+ }
+ return goodRecVertex;
+ }
+ //---------------------------------
+}
--- /dev/null
+#ifndef ALIJJETCORRTASK_H
+#define ALIJJETCORRTASK_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+//______________________________________________________________________________
+// Analysis task for high pt particle correlations
+// author: R.Diaz, J. Rak, D.J. Kim
+// ALICE Group University of Jyvaskyla
+// Finland
+//
+// Fill the analysis containers for ESD or AOD
+// Note: Adapted for AliAnalysisTaskSE
+//////////////////////////////////////////////////////////////////////////////
+
+
+#include "AliAnalysisTaskSE.h"
+#include "AliJJetCORRAnalysis.h"
+#include "AliJJetTask.h"
+#include "AliJCard.h"
+
+class AliJJetCORRAnalysis;
+class AliJRunTable;
+//==============================================================
+
+using namespace std;
+
+class AliJJetCORRTask : public AliAnalysisTaskSE {
+
+ public:
+ AliJJetCORRTask();
+ AliJJetCORRTask(const char *name, TString inputformat);
+ AliJJetCORRTask(const AliJJetCORRTask& ap);
+ AliJJetCORRTask& operator = (const AliJJetCORRTask& ap);
+ virtual ~AliJJetCORRTask();
+
+ // methods to fill from AliAnalysisTaskSE
+ virtual void UserCreateOutputObjects();
+ virtual void Init();
+ virtual void LocalInit() { Init(); }
+ virtual void UserExec(Option_t *option);
+ virtual void Terminate(Option_t *);
+ virtual Bool_t UserNotify() { std::cout<<"DEBUG UserNotify"<<std::endl; return kTRUE;}
+
+ void SetJetTaskName(TString name){ fJetTaskName=name; }
+ void SetJJetCORRAnalysis(AliJJetCORRAnalysis * jco){ fJJetCORRAnalysis=jco; }
+ void SetCard( AliJCard * card ){ fCard=card; }
+ void SetTargetJetIndex( int jfindex ) { fTargetJetIndex = jfindex; } // PlayCorrelation only for selected jetfinder
+
+ bool IsGoodEvent(AliVEvent *event);
+ void SetDebugMode( int debug) { fDebugMode = debug; };
+
+ private:
+ AliJJetTask * fJetTask;
+ TString fJetTaskName;
+ AliJJetCORRAnalysis * fJJetCORRAnalysis; //!
+ TDirectory * fOutput;
+ AliJCard * fCard;
+ AliAnalysisUtils *fAnaUtils;
+ AliJRunTable *fRunTable; //
+ Bool_t fFirstEvent; //
+ int cBin;
+ int zBin;
+ double zVert;
+ int fDebugMode;
+ int fTargetJetIndex;
+ int fevt;
+
+ ClassDef(AliJJetCORRTask, 1);
+};
+#endif // AliJJetCORRTask_H
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+//
+//
+// Jet fragmentation transverse momentum (j_T) analysis task
+//
+// Author: T.Snellman
+
+#include <TClonesArray.h>
+#include <TH1F.h>
+#include <TH2F.h>
+#include <TH3F.h>
+#include <TList.h>
+#include <TProfile.h>
+#include <TLorentzVector.h>
+#include <TVector.h>
+#include <TGraphErrors.h>
+#include <TGrid.h>
+#include <TSystem.h>
+#include <TFile.h>
+
+#include "AliCentrality.h"
+
+
+
+#include "AliVCluster.h"
+#include "AliAODCaloCluster.h"
+#include "AliESDCaloCluster.h"
+#include "AliVTrack.h"
+#include "AliEmcalJet.h"
+#include "AliRhoParameter.h"
+#include "AliLog.h"
+#include "AliJetContainer.h"
+#include "AliParticleContainer.h"
+#include "AliClusterContainer.h"
+#include "AliPicoTrack.h"
+#include "AliJBaseTrack.h"
+#include "AliJJet.h"
+#include "AliJJetTask.h"
+
+
+ClassImp(AliJJetTask);
+
+//________________________________________________________________________
+AliJJetTask::AliJJetTask() :
+ AliAnalysisTaskEmcalJet("AliJJetTask", kTRUE),
+ fJetsCont(),
+ fTracksCont(),
+ fCaloClustersCont(),
+ fJTracks("AliJBaseTrack",1000),
+ fJJets(),
+ fTaskEntry(-1),
+ fJetFinderString(),
+ fTrackArrayName("nonejk"),
+ fNJetFinder(0),
+ debug(0)
+
+{
+ // Default constructor.
+
+
+ SetMakeGeneralHistograms(kTRUE);
+}
+
+//________________________________________________________________________
+AliJJetTask::AliJJetTask(const char *name, const int nJetFinder) :
+ AliAnalysisTaskEmcalJet(name, kTRUE),
+ fJetsCont(nJetFinder),
+ fTracksCont(nJetFinder),
+ fCaloClustersCont(nJetFinder),
+ fJTracks("AliJBaseTrack",1000),
+ fJJets(),
+ fTaskEntry(-1),
+ fJetFinderString(nJetFinder),
+ fTrackArrayName("nonejk"),
+ fNJetFinder(nJetFinder),
+ debug(0)
+{
+ SetMakeGeneralHistograms(kTRUE);
+}
+
+AliJJetTask::AliJJetTask(const AliJJetTask& ap) :
+ AliAnalysisTaskEmcalJet(ap.fName, kTRUE),
+ fJetsCont(ap.fJetsCont),
+ fTracksCont(ap.fTracksCont),
+ fCaloClustersCont(ap.fCaloClustersCont),
+ fJTracks(ap.fJTracks),
+ fJJets(ap.fJJets),
+ fTaskEntry(ap.fTaskEntry),
+ fJetFinderString(ap.fJetFinderString),
+ fTrackArrayName(ap.fTrackArrayName),
+ fNJetFinder(ap.fNJetFinder),
+ debug(ap.debug)
+{
+
+}
+
+
+AliJJetTask& AliJJetTask::operator = (const AliJJetTask& ap)
+{
+
+ this->~AliJJetTask();
+ new(this) AliJJetTask(ap);
+ return *this;
+}
+
+//________________________________________________________________________
+AliJJetTask::~AliJJetTask()
+{
+ // Destructor.
+
+ //delete[] fJJets;
+}
+
+
+
+
+//________________________________________________________________________
+void AliJJetTask::UserCreateOutputObjects()
+{
+ // Create user output.
+
+ fJetsCont.resize(fNJetFinder);
+ fJJets.clear();
+ fJJets.resize(fNJetFinder, TClonesArray("AliJJet",1000));
+ fTracksCont.resize(fNJetFinder);
+ fCaloClustersCont.resize(fNJetFinder);
+
+
+
+ AliAnalysisTaskEmcalJet::UserCreateOutputObjects();
+
+
+ //fJJets = new TClonesArray[fNJetFinder];
+
+
+ fJetFinderString.clear();
+ for (int i=0; i<fNJetFinder; i++){
+ fJetsCont[i] = GetJetContainer(i);
+ fJetFinderString.push_back(fJetsCont[i]->GetArrayName());
+ cout << i <<"\t" << fJetFinderString[i] << endl;
+ fTracksCont[i] = GetParticleContainer(0);
+ fCaloClustersCont[i] = GetClusterContainer(0);
+ fTracksCont[i]->SetClassName("AliVTrack");
+ fCaloClustersCont[i]->SetClassName("AliAODCaloCluster");
+ //fJJets.push_back(TClonesArray("AliJJet",1000));
+ }
+
+}
+
+//________________________________________________________________________
+Bool_t AliJJetTask::FillHistograms()
+{
+
+ {
+ int iTrack =0;
+ AliVTrack *track = static_cast<AliVTrack*>(fTracksCont[0]->GetNextAcceptParticle(0));
+ while(track){
+ new (fJTracks[iTrack]) AliJBaseTrack(track->Px(),track->Py(), track->Pz(), track->E(), iTrack,0,0);
+ track = static_cast<AliVTrack*>(fTracksCont[0]->GetNextAcceptParticle());
+
+ iTrack++;
+ }
+ }
+ for (int i=0; i<fNJetFinder; i++){
+ AliEmcalJet *jet = fJetsCont[i]->GetNextAcceptJet(0);
+ int iJet =0;
+
+ //fills fJJets[icontainer][ijet] and histograms
+ while(jet){
+ TClonesArray & jets = fJJets[i];
+ new (jets[iJet]) AliJJet(jet->Px(),jet->Py(), jet->Pz(), jet->E(), jet->GetLabel(),0,0);
+ AliJJet * j = (AliJJet*) fJJets[i][iJet];
+ j->SetArea(jet->Area() );
+
+
+ Int_t nConstituents = jet->GetNumberOfTracks();
+
+ for (int it=0; it<nConstituents; it++){
+ int iTrack = jet->TrackAt(it);
+ j->AddConstituent(fJTracks[iTrack]);
+
+ }
+
+ if (debug>0) { cout<<" iContainer : "<<i<<
+ " iJet : "<<iJet<<
+ " nConstituents : "<<nConstituents<<endl;
+ }
+
+ //Goes to the next jet
+ jet = fJetsCont[i]->GetNextAcceptJet();
+ if (debug>0) {
+ cout<<" fJJets N lists : "<<fJJets[i].GetEntries()<<
+ " fJJets constituents : "<<((AliJJet*)fJJets[i][iJet])->GetConstituents()->GetEntries()<<endl;
+ }
+
+ iJet++;
+ }
+
+
+ }
+
+
+ return kTRUE;
+
+}
+
+
+
+
+//________________________________________________________________________
+void AliJJetTask::ExecOnce() {
+
+ if(debug > 0){
+ cout << "AliJJetTask::ExecOnce(): " << endl;
+ }
+ AliAnalysisTaskEmcalJet::ExecOnce();
+
+ for (int i=0; i<fNJetFinder; i++){
+ if (fJetsCont[i] && fJetsCont[i]->GetArray() == 0) fJetsCont[i] = 0;
+ if (fTracksCont[i] && fTracksCont[i]->GetArray() == 0) fTracksCont[i] = 0;
+ if (fCaloClustersCont[i] && fCaloClustersCont[i]->GetArray() == 0) fCaloClustersCont[i] = 0;
+ }
+}
+
+//________________________________________________________________________
+Bool_t AliJJetTask::Run()
+{
+ // Run analysis code here, if needed. It will be executed before FillHistograms().
+ fTaskEntry = fEntry;
+ for (int i=0; i<fNJetFinder; i++){
+ fJJets[i]. Clear();
+ }
+ fJTracks.Clear();
+
+ if (debug >0 && Entry()%1000 ==0 ) cout<<Entry()<<endl;
+ return kTRUE; // If return kFALSE FillHistogram() will NOT be executed.
+}
+
+//________________________________________________________________________
+void AliJJetTask::Terminate(Option_t *)
+{
+ // Called once at the end of the analysis.
+}
+
--- /dev/null
+#ifndef ALIJJETTASK_H
+#define ALIJJETTASK_H
+class TH1;
+class TH1D;
+class TH2;
+class TH3;
+class TGraphErrors;
+class TProfile;
+class AliJetContainer;
+class AliParticleContainer;
+class AliClusterContainer;
+
+
+#include "AliAnalysisTaskEmcalJet.h"
+#include <TClonesArray.h>
+#include <TString.h>
+
+
+class AliJJetTask : public AliAnalysisTaskEmcalJet {
+ public:
+
+ AliJJetTask();
+ AliJJetTask(const char *name, const int NJetFinder);
+ //AliJJetTask(const char * name, int njetfinder );
+ virtual ~AliJJetTask();
+
+
+ void UserCreateOutputObjects();
+ void SetTrackArrayName( char *c ) { fTrackArrayName = c; }
+ vector<TClonesArray>* GetAliJJetCollection() {return &fJJets;}
+ TObjArray* GetAliJJetList(int i) {return &fJJets[i]; }
+ int GetNumberOfJetCollections() {return fNJetFinder;}
+ //void SetNumberOfJetCollections(const int n) {
+ // fJetsCont.resize(n);
+ // fJJets.resize(n);
+ // fTracksCont.resize(n);
+ // fCaloClustersCont.resize(n);
+ // fNJetFinder=n;
+ //}
+
+ int GetTaskEntry() {return fTaskEntry;}
+ void Terminate(Option_t *option);
+
+ void SetDebug(int n) {debug = n; }
+ int GetDebug(){ return debug; }
+ vector<TString> &GetJetFinderString() { return fJetFinderString;}
+
+
+ protected:
+ void ExecOnce();
+ Bool_t FillHistograms() ;
+ Bool_t Run() ;
+ void CheckClusTrackMatching();
+
+
+
+
+
+
+ vector<AliJetContainer*> fJetsCont; //!Jets
+ //AliJetContainer **fJetsConts; //!Jets
+ //Int_t nJetsConts;
+ vector<AliParticleContainer*> fTracksCont; //!Tracks
+ vector<AliClusterContainer*> fCaloClustersCont; //!Clusters
+
+ private:
+ AliJJetTask(const AliJJetTask& ap); // not implemented
+ AliJJetTask &operator=(const AliJJetTask&); // not implemented
+
+ //TVector *EtaGapThresholds;
+ //TVector *RGapThresholds;
+ //TVector *KlongBorders;
+ //TVector *XeBorders;
+
+ TClonesArray fJTracks; //! tracks array
+ vector<TClonesArray> fJJets; //! tracks array
+ UInt_t fTaskEntry;
+
+ vector<TString> fJetFinderString;
+
+
+
+ TString fTrackArrayName; // track constituents array name
+
+
+ Int_t fNJetFinder;
+ Int_t debug;
+
+ ClassDef(AliJJetTask, 4) // jet sample analysis task
+
+
+
+};
+
+
+#endif
--- /dev/null
+AliJDiJetTask * AddTaskJDiJet (
+ TString taskName = "DiJetTask" ,
+ TString jetTaskName = "AliJJetTask" ,
+ TString cardName = "cardAlice_pp.input",
+ TString cardSetting = "",
+ Int_t debug = 1
+ ){
+ // Get the pointer to the existing analysis manager via the static access method.
+ //==============================================================================
+ AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+ if (!mgr)
+ {
+ ::Error("AddTaskJJet", "No analysis manager to connect to.");
+ return NULL;
+ }
+
+ // Check the analysis type using the event handlers connected to the analysis manager.
+ //==============================================================================
+ if (!mgr->GetInputEventHandler())
+ {
+ ::Error("AddTaskJJet", "This task requires an input event handler");
+ return NULL;
+ }
+
+
+ AliJCard *card = new AliJCard(cardName.Data());
+ card->PrintOut();
+ card->ReadLine( cardSetting.Data() );
+ card->ReCompile();
+ card->PrintOut();
+
+ //-------------------------------------------------------
+ // Init the task and do settings
+ //-------------------------------------------------------
+ AliJDiJetTask * dijetTask = new AliJDiJetTask(taskName,"AOD");
+ dijetTask->SetJetTaskName( jetTaskName );
+ dijetTask->SetCard( card );
+ mgr->AddTask(dijetTask);
+
+ // Create containers for input/output
+ AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
+
+ // Connect input/output
+ mgr->ConnectInput(dijetTask, 0, cinput);
+ AliAnalysisDataContainer *jHist = mgr->CreateContainer(Form("%scontainer",dijetTask->GetName()), TDirectory::Class(), AliAnalysisManager::kOutputContainer, Form("%s:%s",AliAnalysisManager::GetCommonFileName(), dijetTask->GetName()));
+ mgr->ConnectOutput(dijetTask, 1, jHist );
+
+ return dijetTask;
+
+
+}
--- /dev/null
+//_____________________________________________________________________
+AliAnalysisTask *AddTaskJEbECORR(TString taskName, UInt_t triggSel, TString cardName, TString cardSetting, TString ebeCentFile){
+ // Load Custom Configuration and parameters
+ // override values with parameters
+
+ cout<<"### DEGUG Input is "<< taskName << "\t"<< cardName <<"\t"<< cardSetting <<"\t"<<"#########"<<endl;
+ AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+
+ //==== JCORRAN Efficiency TASK
+ AliJEbECORRTask *jebetask = new AliJEbECORRTask(taskName.Data());
+ jebetask->SetDebugLevel(0);
+ jebetask->SetDebugMode(0);
+ jebetask->SetEbePercentileInputFileName(ebeCentFile);
+ cout << jebetask->GetName() << endl;
+
+
+ // === Create AliJCORRAN ====
+ AliJCard *card = new AliJCard(cardName.Data());
+ card->PrintOut();
+ card->ReadLine( cardSetting.Data() );
+ card->ReCompile();
+ card->PrintOut();
+ jebetask->SetCard( card );
+ jebetask->SelectCollisionCandidates( triggSel ); //Apply offline trigger selection by AliPhysicsSelectionTask
+
+ mgr->AddTask((AliAnalysisTask*) jebetask);
+
+ // Create containers for input/output
+ AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
+
+ // Connect input/output
+ mgr->ConnectInput(jebetask, 0, cinput);
+ AliAnalysisDataContainer *jHist = mgr->CreateContainer(Form("%scontainer",jebetask->GetName()), TDirectory::Class(), AliAnalysisManager::kOutputContainer, Form("%s:%s",AliAnalysisManager::GetCommonFileName(), jebetask->GetName()));
+ mgr->ConnectOutput(jebetask, 1, jHist );
+
+ return jebetask;
+}
+
--- /dev/null
+// $Id$
+
+AliJJetTask* AddTaskJJet(
+ Int_t trigger = AliVEvent::kEMCEJE,
+ const char *taskname = "AliJJetTask",
+ int debug = 1
+)
+{
+
+ // Get the pointer to the existing analysis manager via the static access method.
+ //==============================================================================
+ AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+ if (!mgr)
+ {
+ ::Error("AddTaskJJet", "No analysis manager to connect to.");
+ return NULL;
+ }
+
+ // Check the analysis type using the event handlers connected to the analysis manager.
+ //==============================================================================
+ if (!mgr->GetInputEventHandler())
+ {
+ ::Error("AddTaskJJet", "This task requires an input event handler");
+ return NULL;
+ }
+
+ //-------------------------------------------------------
+ // Init the task and do settings
+ //-------------------------------------------------------
+
+ TString name(taskname);
+ //name += trigger;
+
+ //TString tracksName = "PicoTracks";
+ TString tracksName = "PicoTracks";
+ TString clustersName = "EmcCaloClusters";
+ TString clustersCorrName = "CaloClustersCorr";
+ TString rhoName = "";
+
+
+ gROOT->LoadMacro("$ALICE_ROOT/PWGJE/EMCALJetTasks/macros/AddTaskEmcalJet.C");
+
+ const int nJetFinder=6;
+ AliEmcalJetTask* jetFinderTask[nJetFinder];
+ double aConeSizes[nJetFinder]={0.4,0.5,0.6,0.4,0.5,0.6};
+ int aJetType[nJetFinder]={0,0,0,1,1,1}; // 0 :FullJet 1:Charged
+ for (int i=0; i<nJetFinder; i++){
+ jetFinderTask[i] = AddTaskEmcalJet(tracksName,clustersCorrName,1,aConeSizes[i],aJetType[i],0.15,0.300,0.005,1,"Jet",5.); // anti-kt
+ }
+
+ char *ntracks = tracksName;
+ char *nclusters = clustersCorrName;
+ char *nrho = rhoName;
+ Printf("name: %s",name.Data());
+
+ AliJJetTask* jtTask = new AliJJetTask(name, nJetFinder);
+ jtTask->SetDebug(debug);
+ jtTask->SelectCollisionCandidates(trigger);
+
+
+ AliParticleContainer *trackCont = jtTask->AddParticleContainer(ntracks);
+ trackCont->SetClassName("AliVTrack");
+ AliClusterContainer *clusterCont = jtTask->AddClusterContainer(nclusters);
+
+ char *type="EMCAL";
+ TString strType(type);
+ AliJetContainer *jetCont[nJetFinder];
+
+ for(int i=0; i<nJetFinder; i++){
+ jetCont[i] = jtTask->AddJetContainer(jetFinderTask[i]->GetName(),strType,aConeSizes[i]);
+ if(jetCont[i]) {
+ jetCont[i]->SetRhoName(nrho);
+ jetCont[i]->ConnectParticleContainer(trackCont);
+ jetCont[i]->ConnectClusterContainer(clusterCont);
+ jetCont[i]->SetZLeadingCut(0.98,0.98);
+ jetCont[i]->SetPercAreaCut(0.6);
+ jetCont[i]->SetJetPtCut(5);
+ jetCont[i]->SetLeadingHadronType(0);
+ }
+ }
+
+ //-------------------------------------------------------
+ // Final settings, pass to manager and set the containers
+ //-------------------------------------------------------
+
+ mgr->AddTask(jtTask);
+
+
+
+ // Create containers for input/output
+ AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer() ;
+ TString contname(name);
+ contname += "_histos";
+ cout << "Create container " << contname << endl;
+ AliAnalysisDataContainer *coutput = mgr->CreateContainer(contname.Data(),
+ TList::Class(),AliAnalysisManager::kOutputContainer,
+ Form("%s", AliAnalysisManager::GetCommonFileName()));
+
+ mgr->ConnectInput (jtTask, 0, cinput );
+ mgr->ConnectOutput (jtTask, 1, coutput ); // MUST HAVE IT, DON"T KNOW WHY ??? maybe from EMCALJET code
+
+ return jtTask;
+}
--- /dev/null
+AliJJetCORRTask * AddTaskJJetCORR (
+ Int_t trigger = AliVEvent::kEMCEJE,
+ TString taskName = "JJetCORRTask" ,
+ TString jetTaskName = "AliJJetTask" ,
+ TString cardName = "cardAlice_pp.input",
+ TString cardSetting = "",
+ int TargetJetIndex = 1,
+ Int_t debug = 1
+ ){
+ // Get the pointer to the existing analysis manager via the static access method.
+ //==============================================================================
+ AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+ if (!mgr)
+ {
+ ::Error("AddTaskJJet", "No analysis manager to connect to.");
+ return NULL;
+ }
+
+ // Check the analysis type using the event handlers connected to the analysis manager.
+ //==============================================================================
+ if (!mgr->GetInputEventHandler())
+ {
+ ::Error("AddTaskJJet", "This task requires an input event handler");
+ return NULL;
+ }
+
+
+ AliJCard *card = new AliJCard(cardName.Data());
+ card->PrintOut();
+ card->ReadLine( cardSetting.Data() );
+ card->ReCompile();
+ card->PrintOut();
+
+ //-------------------------------------------------------
+ // Init the task and do settings
+ //-------------------------------------------------------
+ AliJJetCORRTask * jjetcorrTask = new AliJJetCORRTask(taskName,"AOD");
+ jjetcorrTask->SetJetTaskName( jetTaskName );
+ jjetcorrTask->SetCard( card );
+ jjetcorrTask->SetTargetJetIndex( TargetJetIndex );
+ jjetcorrTask->SelectCollisionCandidates(trigger);
+ jjetcorrTask->SetDebugMode( debug );
+ mgr->AddTask(jjetcorrTask);
+
+ // Create containers for input/output
+ AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
+
+ // Connect input/output
+ mgr->ConnectInput(jjetcorrTask, 0, cinput);
+ AliAnalysisDataContainer *jHist = mgr->CreateContainer(Form("%scontainer",jjetcorrTask->GetName()), TDirectory::Class(), AliAnalysisManager::kOutputContainer, Form("%s:%s",AliAnalysisManager::GetCommonFileName(), jjetcorrTask->GetName()));
+ mgr->ConnectOutput(jjetcorrTask, 1, jHist );
+
+ return jjetcorrTask;
+
+
+}
--- /dev/null
+#ifdef __CINT__
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+
+#pragma link C++ class AliJEbECORRTask+;
+#pragma link C++ class AliJJetTask+;
+#pragma link C++ class AliJDiJetTask+;
+#pragma link C++ class AliJDiJetAnalysis+;
+#pragma link C++ class AliJJetCORRTask+;
+#pragma link C++ class AliJJetCORRAnalysis+;
+#endif /* __CINT__ */