ROOT logo
/**************************************************************************
 * 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!

// jcorran main class
// used in local and grid execution
// blah
// blah
// blah

#include <TH1D.h>
#include "AliJCORRAN.h"

#include "AliJTrackCounter.h"
#include <TClonesArray.h>

#include "AliJCard.h"
#include "AliJHistos.h"
#include "AliJCorrelations.h"
#include "AliJEventPool.h"
#include "AliJDataManager.h"

#include  "AliJEventHeader.h"
#include  "AliJRunHeader.h"
#include  "AliJTrack.h"
#include  "AliJPhoton.h"
#include  "AliJMCTrack.h"
#include  "AliJConst.h"




#include "AliJEfficiency.h"
#include <iostream>

ClassImp(AliJCORRAN)

    AliJCORRAN::AliJCORRAN() :
        TObject(),
        fExecLocal(kTRUE),
        fFirstEvent(kTRUE),
        fjtrigg((particleType)-100),
        fjassoc((particleType)-100),
        fcard(0),
        finputFile(0), 
        fInclusiveFile(""),
        fevt(0),
        fhistos(0), 
        fcorrelations(0), 
        fphotonPool(0), 
        fassocPool(0),  
        fphotonList(0),  
        fchargedHadronList(0), 
        fpizeroList(0), 
        ftriggList(0),  
        fassocList(0), 
        fpairList(0), 
        fpairCounterList(0), 
        finputList(0), 
        fdmg(0), 
        feventHeader(0), 
        frunHeader(0), 
        fnumberEvents(0), 
        fieout(0), 
        fEventCounter(0), 
        fcent(0), 
        fncBin(0), 
        fnPttBin(0), 
        fbTriggCorrel(0), 
        fbLPCorrel(0), 
        fbLPpairCorrel(0), 
        fTrackEtaRange(0), 
        flowerPtAssocBoarder(0), 
        fCentMultLow(0),  
        fCentMultHigh(0),
        fEventBC(0),
        fSQRTS(0),
        fEfficiency(0),
        fRunTable(0),
        fIsolationR(0),
        fHadronSelectionCut(0)
{
    // constructor
}

AliJCORRAN::AliJCORRAN(Bool_t execLocal) :
    TObject(),
    fExecLocal(execLocal),
    fFirstEvent(kTRUE),
    fjtrigg((particleType)-100),
    fjassoc((particleType)-100),
    fcard(0),
    finputFile(0), 
    fInclusiveFile(""),
    fevt(0),
    fhistos(0), 
    fcorrelations(0), 
    fphotonPool(0), 
    fassocPool(0),  
    fphotonList(0),  
    fchargedHadronList(0), 
    fpizeroList(0), 
    ftriggList(0),  
    fassocList(0), 
    fpairList(0), 
    fpairCounterList(0), 
    finputList(0), 
    fdmg(0), 
    feventHeader(0), 
    frunHeader(0), 
    fnumberEvents(0), 
    fieout(0), 
    fEventCounter(0), 
    fcent(0), 
    fncBin(0), 
    fnPttBin(0), 
    fbTriggCorrel(0), 
    fbLPCorrel(0), 
    fbLPpairCorrel(0), 
    fTrackEtaRange(0), 
    flowerPtAssocBoarder(0), 
    fCentMultLow(0),  
    fCentMultHigh(0),
    fEventBC(0),
    fSQRTS(0),
    fEfficiency(0),
    fRunTable(0),
    fIsolationR(0),
    fHadronSelectionCut(0)
{
    // constructor
}

AliJCORRAN::~AliJCORRAN(){
    // destructor
}

AliJCORRAN::AliJCORRAN(const AliJCORRAN& obj) : 
    TObject(),
    fExecLocal(obj.fExecLocal),
    fFirstEvent(obj.fFirstEvent),
    fjtrigg(obj.fjtrigg),
    fjassoc(obj.fjassoc),
    fcard(obj.fcard),
    finputFile(obj.finputFile), 
    fInclusiveFile(obj.fInclusiveFile),
    fevt(obj.fevt),
    fhistos(obj.fhistos), 
    fcorrelations(obj.fcorrelations), 
    fphotonPool(obj.fphotonPool), 
    fassocPool(obj.fassocPool),  
    fphotonList(obj.fphotonList),  
    fchargedHadronList(obj.fchargedHadronList), 
    fpizeroList(obj.fpizeroList), 
    ftriggList(obj.ftriggList),  
    fassocList(obj.fassocList), 
    fpairList(obj.fpairList), 
    fpairCounterList(obj.fpairCounterList), 
    finputList(obj.finputList), 
    fdmg(obj.fdmg), 
    feventHeader(obj.feventHeader), 
    frunHeader(obj.frunHeader), 
    fnumberEvents(obj.fnumberEvents), 
    fieout(obj.fieout), 
    fEventCounter(obj.fEventCounter), 
    fcent(obj.fcent), 
    fncBin(obj.fncBin), 
    fnPttBin(obj.fnPttBin), 
    fbTriggCorrel(obj.fbTriggCorrel), 
    fbLPCorrel(obj.fbLPCorrel), 
    fbLPpairCorrel(obj.fbLPpairCorrel), 
    fTrackEtaRange(obj.fTrackEtaRange), 
    flowerPtAssocBoarder(obj.flowerPtAssocBoarder), 
    fCentMultLow(obj.fCentMultLow),  
    fCentMultHigh(obj.fCentMultHigh),
    fEventBC(obj.fEventBC),
    fSQRTS(obj.fSQRTS),
    fEfficiency(obj.fEfficiency),
    fRunTable(obj.fRunTable),
    fIsolationR(obj.fIsolationR),
    fHadronSelectionCut(obj.fHadronSelectionCut)
{
    // copy constructor
    JUNUSED(obj);
}

AliJCORRAN& AliJCORRAN::operator=(const AliJCORRAN& obj){
    // copy constructor
    JUNUSED(obj);
    return *this;
}


void AliJCORRAN::Initialize() const{
    // init

}

void AliJCORRAN::UserCreateOutputObjects(){
    // local init


    cout << "jcorran user create output objects ----------------" << endl;

    fHadronSelectionCut =int ( fcard->Get("HadronSelectionCut"));
    fIsolationR = fcard->Get("IsolationR");

    fhistos = new AliJHistos( fcard );          
    fhistos->CreateEventTrackHistos();
    fhistos->CreateAzimuthCorrHistos();
    fhistos->CreateIAAMoons();
    fhistos->CreateXEHistos();
    fhistos->CreateXtHistos();
    fhistos->CreatePairPtCosThetaStar();

    fhistos->fHMG->Print();

    fEventBC = (Int_t)(fcard->Get( "eventBC" ));
    fSQRTS = 0.;


    //TODO: inclusive fhistos shipping along

    fcorrelations = new AliJCorrelations( fcard, fhistos);
    cout<<endl<< " -----" <<endl; 
    if( fInclusiveFile.Length() ) {
        fhistos->ReadInclusiveHistos(fInclusiveFile);
        fcorrelations->SetSampligInclusive(); //kperp background and triangle. Default is flat
        cout<<"Sampling kperp and triangle from " << fInclusiveFile <<endl; 
    } else cout << "Sampling kperp and triangle from flat" <<endl; 
    cout<< " -----" <<endl <<endl;  

    //==================================

    //cout<<kParticleTypeStrName[kPhoton]<<" "<<kParticleTypeStrName[fjtrigg]<<endl;
    // EventPool for Mixing
    fphotonPool  = new AliJEventPool( fcard, fhistos, fcorrelations, kJPhoton);  // for pi0 mass
    fassocPool   = new AliJEventPool( fcard, fhistos, fcorrelations, fjassoc);

    fphotonList = new TClonesArray(kParticleProtoType[kJPhoton],1500);      
    //     TClonesArray *cellList = new TClonesArray("AliJCaloCell",1500);      
    fchargedHadronList  = new TClonesArray(kParticleProtoType[kJHadron],1500);      
    fpizeroList = new TClonesArray(kParticleProtoType[kJPizero],1500);      
    ftriggList  = new TClonesArray(kParticleProtoType[fjtrigg],1500);      
    fassocList  = new TClonesArray(kParticleProtoType[fjassoc],1500);      
    fpairList     = new TClonesArray(kParticleProtoType[fjtrigg],1500);      
    fpairCounterList  = new TClonesArray("AliJTrackCounter",1500);      
    finputList = NULL;
    //TClonesArray *isolPizeroList  = new TClonesArray("AliPhJPiZero",1500);

    fdmg = new AliJDataManager(fcard, fhistos, fcorrelations, fExecLocal);
    fdmg->SetExecLocal( fExecLocal );

    //==== Read the Data files =====
    if( fExecLocal ){
        fdmg->ChainInputStream(finputFile);
        // TODO: run header is not supposed to be here
        // doesn't work fSQRTS = 2.*frunHeader->GetBeamEnergy();

        // for grid running, numberEvents is filled by the encapsulating
		// grid task, which has access to the input handlers and can
		// extract event numbers out of it
		fnumberEvents = fdmg->GetNEvents();
		fieout = fnumberEvents/20;
		frunHeader = fdmg->GetRunHeader();
		cout<<"RunID = "<<frunHeader->GetRunNumber()<< " Looping over "<<fnumberEvents<<" events"<<endl;

	} else {
		fdmg->SetRunHeader( frunHeader );
		frunHeader = fdmg->GetRunHeader();
	}

	//==== Efficiency ====
	fEfficiency = new AliJEfficiency;
	fEfficiency->SetMode( fcard->Get("EfficiencyMode") ); // 0:NoEff, 1:Period 2:RunNum 3:Auto
	if(fExecLocal) { 
		fEfficiency->SetDataPath("/mnt/flustre/alice/taxi_jcorran/2013/EFF/data"); // Efficiency root file location local or alien
	} else {
		fEfficiency->SetDataPath("alien:///alice/cern.ch/user/d/djkim/legotrain/efficieny/data"); // Efficiency root file location local or alien
	}

	//-------------------------------------------------------------------
	fEventCounter=0;

	fcent = -1;
	fncBin = fcard->GetNoOfBins( kCentrType );
	fnPttBin = fcard->GetNoOfBins( kTriggType );

	fbTriggCorrel  = fcard->Get("CorrelationType")==0;
	fbLPCorrel     = fcard->Get("CorrelationType")==1;
	fbLPpairCorrel = fcard->Get("CorrelationType")==2;
	fTrackEtaRange = fcard->Get("EtaRange");
	flowerPtAssocBoarder = fcard->GetBinBorder(kAssocType, 0);

	//==== Limit the no of track for each fcentrality ======
	fCentMultLow = new TF1("fCentMultLow","[0]*sqrt([1]-x)+[2]", 0, 75);
	fCentMultHigh = new TF1("fCentMultHigh","[0]*sqrt([1]-x)+[2]", 0, 90);

	// fast parameter load


	fhistos->fHMG->WriteConfig();
	fFirstEvent = kTRUE;
	fevt = -1;

	cout << "end of jcorran user create output objects ----------------" << endl;

}

void AliJCORRAN::UserExec(){
	// event loop
	fevt++;

	// TODO Add train mode if( !fExecLocal && fFirstEvent ){
	if( 0 && !fExecLocal && fFirstEvent ){
		fdmg->ChainInputStream("");
		fieout = fnumberEvents/20;
		if (fieout<1) fieout=1;
		cout<<"RunID = "<<frunHeader->GetRunNumber()<< " Looping over "<<fnumberEvents<<" events"<<endl;

		//==== Efficiency ====
		// TODO run can be different in a job?
		fhistos->fhEventPerRun->Fill(fnumberEvents>0?log(fnumberEvents):1);
		fFirstEvent = kFALSE;
	}

	// TODO 
	if( fExecLocal ) {
		if(fevt % fieout == 0) cout << fevt << "\t" << int(float(fevt)/fnumberEvents*100) << "%" << endl ;
	}

	if( fFirstEvent ) {
		//==== RunTable
		fRunTable = & AliJRunTable::GetSpecialInstance();
		fRunTable->SetRunNumber( frunHeader->GetRunNumber() );
		fSQRTS = fRunTable->GetBeamEnergy(fRunTable->GetPeriod());
		cout << "sqrts = "<< fSQRTS << ",runnumber = "<< frunHeader->GetRunNumber() << endl;
		fEfficiency->SetRunNumber( frunHeader->GetRunNumber() );
		fEfficiency->Load();
		fFirstEvent = kFALSE;
	}

	if(fRunTable->IsHeavyIon()){
		fCentMultLow->SetParameters( fcard->Get("CentMultCutLow",0),  fcard->Get("CentMultCutLow",1),  fcard->Get("CentMultCutLow",2) );
		fCentMultHigh->SetParameters(fcard->Get("CentMultCutHigh",0), fcard->Get("CentMultCutHigh",1), fcard->Get("CentMultCutHigh",2) );
		//fCentMultLow->Print();
		//fCentMultHigh->Print();
	}

	fdmg->LoadEvent(fevt); // to be here to load EventHeader
	fhistos->fhEvents->Fill( 0 );

	if(!fdmg->IsGoodEvent()) return;  // Vertex cut applied in IsGoodEvent and histo saved there too

	feventHeader  = fdmg->GetEventHeader();
	double zVert    = feventHeader->GetZVertex();
	//----------------------------------------------------------

	UInt_t triggermaskJCorran = feventHeader->GetTriggerMaskJCorran();
	//cout << fevt <<"\t"<< zVert << "\t"<< triggermaskJCorran <<  endl;

	if( fdmg->IsSelectedTrigger((int) triggermaskJCorran))
		fhistos->fhEvents->Fill( 5 );

	// select only some BC%4
	if( feventHeader->GetBunchCrossNumber() % 4 != fEventBC &&
			fEventBC > -1 )
		return;

	if( fdmg->IsSelectedTrigger((int) triggermaskJCorran))
		fhistos->fhEvents->Fill( 6 );

	if(fRunTable->IsHeavyIon() || fRunTable->IsPA()){
		fcent = feventHeader->GetCentrality();
	}else  {
		fcent = 1; //ntracks;
	}

	//cout<<"evt="<<fevt <<" c="<<  fcent <<endl;
	int cBin        = fcard->GetBin(kCentrType, fcent);
	if(cBin<0) return;

	if( fdmg->IsSelectedTrigger((int) triggermaskJCorran))
		fhistos->fhEvents->Fill( 7 );

	int zBin        = fcard->GetBin(kZVertType, zVert); //should be alway >0; checked in fdmg->IsGoodEvent()

	// do not fill MB in case of MB mixing
	if( fdmg->IsSelectedTrigger((int) triggermaskJCorran))
		fhistos->fhZVert[cBin]->Fill(zVert);

	//temporary fevent skip
	//Trigger to be selected from the JCorran trigger mask is specified in the fCard
	//         if(! fdmg->IsSelectedTrigger((int) triggermaskJCorran))
	//           continue;

	fEventCounter++;

	//==== QA Event
	fhistos->fhV0AMult[cBin]->Fill( feventHeader->GetV0AMult() );

	//------------------------------------------------------------------
	// Triggers and associated
	//----------------------ooooo---------------------------------------

	if(fjtrigg==kJPizero || fjassoc==kJPizero || fjtrigg==kJPhoton || fjassoc==kJPhoton){
	} // pizero || photon
	if(fjtrigg==kJHadron || fjassoc==kJHadron){
		fchargedHadronList->Clear();
		fdmg->RegisterList(fchargedHadronList, NULL, cBin, zBin, kJHadron);
		// apply efficiencies

		for( int i = 0; i < fchargedHadronList->GetEntries(); i++ ){

			AliJBaseTrack *triggTr = (AliJBaseTrack*)fchargedHadronList->At(i);
			double ptt = triggTr->Pt();

			double effCorr = 1./fEfficiency->GetCorrection(ptt, fHadronSelectionCut, fcent);  // here you generate warning if ptt>30
			fhistos->fhTrackingEfficiency[cBin]->Fill( ptt, 1./effCorr );
			triggTr->SetTrackEff( 1./effCorr );
		}
	}

	//---- assign input list ---- 
	if(fjtrigg==kJPizero)      finputList = fpizeroList;  
	else if(fjtrigg==kJHadron) finputList = fchargedHadronList;
	else if(fjtrigg==kJPhoton) finputList = fphotonList;
	int noAllTriggTracks = finputList->GetEntries();
	int noAllChargedTracks = fchargedHadronList->GetEntries();
	fhistos->fhChargedMult[cBin]->Fill(noAllChargedTracks);
	fhistos->fhChargedMultCent->Fill(fcent, noAllChargedTracks>0 ? log(noAllChargedTracks) : 0);

	//---------------------------------------------
	//--    Check fcentrality outliers           ---
	//--    and count enevents only here        ---
	//---------------------------------------------
	if(fRunTable->IsHeavyIon() && fCentMultLow->GetParameter(0) >0 ){
		double logMult = noAllChargedTracks>0 ? log(noAllChargedTracks) : 0 ;
		if( fcent<fCentMultLow->GetParameter(1) && logMult <fCentMultLow->Eval(fcent) ) return;
		if( fCentMultHigh->Eval(fcent) < logMult) return;
	}
	fhistos->fhChargedMultCut[cBin]->Fill(noAllChargedTracks);
	fhistos->fhCentr->Fill(fcent);
	fhistos->fhiCentr->Fill(cBin);

	// ------------------------------
	// --- calculate e-b-e vn
	// ------------------------------
	if(fRunTable->IsHeavyIon()){
		double vdelta[2] = {0};
		int    vdeltaNorm = 0;
		for(int it1=0; it1<noAllTriggTracks-1; it1++){
			AliJBaseTrack *ftk1 = (AliJBaseTrack*)finputList->At(it1);
			if(ftk1->Pt()<flowerPtAssocBoarder) continue;
			for(int it2=it1+1; it2<noAllTriggTracks; it2++){
				AliJBaseTrack *ftk2 = (AliJBaseTrack*)finputList->At(it2);
				if(ftk2->Pt()<flowerPtAssocBoarder) continue;
				if(fabs(ftk1->Eta() - ftk2->Eta())<1.0) continue;
				double fdphi = ftk1->DeltaPhi(*ftk2);
				fhistos->fhVN[cBin]->Fill(fdphi);
				vdelta[0] += cos(2*fdphi); 
				vdelta[1] += cos(3*fdphi); 
				//cout<< ftk1->Pt() <<" "<< ftk2->Pt() <<" "<< fabs(ftk1->Eta() - ftk2->Eta()) <<" "<< 2*fdphi <<" "<< 3*fdphi <<endl; 
				vdeltaNorm++;
			}
		}
		vdelta[0] = vdeltaNorm>0 ? vdelta[0]/vdeltaNorm : 0;
		vdelta[1] = vdeltaNorm>0 ? vdelta[1]/vdeltaNorm : 0;
		fhistos->fhVdelta2[cBin]->Fill(vdelta[0]*100);
		fhistos->fhVdelta3[cBin]->Fill(vdelta[1]*100);
		if(vdelta[0]>0) fhistos->fpV2->Fill( fcent, sqrt(vdelta[0])*100 );
		if(vdelta[1]>0) {
			fhistos->fpV3->Fill( fcent, sqrt(vdelta[1])*100 );
			fcard->SetEventV3kv(vdelta[1]);
		}
		fhistos->fpVdeltaNorm->Fill( fcent, vdeltaNorm );
	}

	//----------------------------------------------------
	//----- Generate trigg list and find LP             --
	//----- Fiducial cut should be used in AliJCorrelations--
	//----------------------------------------------------
	AliJTrackCounter *lpTrackCounter = new AliJTrackCounter(), *lpPairCounter = new AliJTrackCounter();
	AliJBaseTrack *lPTr = NULL;
	int noTriggs=0;
	ftriggList->Clear();
	for(int itrack=0; itrack<noAllTriggTracks; itrack++){
		AliJBaseTrack *triggTr = (AliJBaseTrack*)finputList->At(itrack);
		triggTr->SetTriggBin( fcard->GetBin(kTriggType, triggTr->Pt()) );

		double ptt = triggTr->Pt();
		double etat = triggTr->Eta();
		//TODO iCut == 0;

		double effCorr = 1.0/triggTr->GetTrackEff();

		if( ptt>flowerPtAssocBoarder ){
			//FK//double effCorr = 1./fcard->TrackEfficiency(ptt, fcent);  // here you generate warning if ptt>30
			//double effCorr = 1./fcard->TrackEfficiency(ptt, etat, cBin);  // here you generate warning if ptt>30
			fhistos->fhChargedPt[cBin]->Fill(ptt, effCorr );
			fhistos->fhChargedPtNoCorr[cBin]->Fill( ptt );
			fhistos->fhChargedEta->Fill(triggTr->Eta(), 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( !triggTr->IsInTriggerBin() ) continue;
		//FK//triggTr->SetTrackEff( fcard->TrackEfficiency(triggTr->Pt(), fcent) );
		int iptt = triggTr->GetTriggBin();
		fhistos->fhIphiTrigg[cBin][iptt]->Fill( triggTr->Phi(), effCorr);
		fhistos->fhIetaTrigg[cBin][iptt]->Fill( triggTr->Eta(), effCorr);

		if( ptt > lpTrackCounter->Pt() ) {
			lpTrackCounter->Store(noTriggs, ptt, iptt);
			lPTr = triggTr;
		}
		//cout <<"1 ptt="<< triggTr->Pt() <<" bin="<< triggTr->GetTriggBin() << " st=" << triggTr->GetStatus() << " trigg eff=" << triggTr->GetTrackEff() << endl; 
		new ((*ftriggList)[noTriggs++]) AliJBaseTrack(*triggTr);
		fhistos->fhTriggMult[cBin][iptt]->Fill(noAllTriggTracks);
	}

	//----------------------------------------------------
	//----- Find sum of two leading particles ------------
	//----------------------------------------------------
	if(fbLPpairCorrel){
		int noPairs=0;
		fpairList->Clear();
		fpairCounterList->Clear();
		for(int ii=0;ii<noTriggs-1;ii++){
			AliJBaseTrack *triggTr1 = (AliJBaseTrack*)ftriggList->At(ii);
			for(int jj=ii+1;jj<noTriggs;jj++){
				AliJBaseTrack *triggTr2 = (AliJBaseTrack*)ftriggList->At(jj);
				TLorentzVector lVPair = triggTr1->GetLorentzVector()+triggTr2->GetLorentzVector();
				double fdphi = DeltaPhi(triggTr1->Phi(), triggTr2->Phi());
				new ((*fpairList)[noPairs]) AliJBaseTrack(lVPair);
				new ((*fpairCounterList)[noPairs++]) 
					AliJTrackCounter( triggTr1->GetID(), triggTr2->GetID(), ii, jj,  fdphi );
			}
		}

		// ----- Find the Leading Pair --------------------------
		AliJBaseTrack *pairTr = NULL;
		for(int ii=0;ii<noPairs;ii++){
			pairTr = (AliJBaseTrack*)fpairList->At(ii);
			AliJTrackCounter   *pairCounter = (AliJTrackCounter*)fpairCounterList->At(ii);
			//cout<<pairTr->Pt()<<endl;    pairCounter->Print();
			if(pairTr->Pt() > lpPairCounter->Pt() && fabs(pairCounter->GetPairDPhi())<1.0) {
				int iptt  = fcard->GetBin(kTriggType, pairTr->Pt());
				lpPairCounter = pairCounter;
				lpPairCounter->Store(ii, pairTr->Pt(), iptt); 
			}
		}
		if(lpPairCounter->Exists()){
			pairTr->SetParticleType(kJHadron);
			//double effCorr = 1./fcard->TrackEfficiency(lpTrackCounter->GetLPpt());
			fhistos->fhLPpairPt->Fill(pairTr->Pt());
		}
	}

	//--------------------------------------------------
	//---   Generate assoc list and pool             ---
	//--------------------------------------------------
	fassocList->Clear();
	int noAssocs=0;
	double  sumPtAroundLP = 0;
	if(fjassoc==kJPizero) finputList = fpizeroList;  
	else if(fjassoc==kJHadron) finputList = fchargedHadronList;
	else if(fjassoc==kJPhoton) finputList = fphotonList;

	int noAllAssocTracks = finputList->GetEntries();


	for(int itrack=0;itrack<noAllAssocTracks; itrack++){

		AliJBaseTrack *assocTr = (AliJBaseTrack*)finputList->At(itrack);
		assocTr->SetAssocBin( fcard->GetBin(kAssocType, assocTr->Pt()) );

		if(assocTr->IsInAssocBin()){ 

			int ipta  = assocTr->GetAssocBin();
			double effCorr = 1.0/assocTr->GetTrackEff();
			fhistos->fhIphiAssoc[cBin][ipta]->Fill( assocTr->Phi(), effCorr);
			fhistos->fhIetaAssoc[cBin][ipta]->Fill( assocTr->Eta(), effCorr);
			new ((*fassocList)[noAssocs++]) AliJBaseTrack(*assocTr);
		}
		// determine an activity in the cone around trigger 
		if(lpTrackCounter->Exists() && (lPTr->GetID()!=assocTr->GetID()) && (0.5 < assocTr->Pt())){
			double dPhi = DeltaPhi( assocTr->Phi(), lPTr->Phi() );
			double dEta = assocTr->Eta() - lPTr->Eta();
			if(fIsolationR > sqrt(dPhi*dPhi+dEta*dEta))  sumPtAroundLP += assocTr->Pt();//FK//
		}
	}

	FillXtHistos(finputList, lpTrackCounter);

	//-----------------------------------------------
	// Set the isolation flag
	//-----------------------------------------------
	if( lpTrackCounter->Exists() ){
		//double effCorr = 1./fcard->TrackEfficiency(lpTrackCounter->Pt(), fcent);
		//TODO ??? AGAIN AGAIN???
		double effCorr = 1./fEfficiency->GetCorrection(lpTrackCounter->Pt(), fHadronSelectionCut, fcent );
		fhistos->fhLPpt->Fill(lpTrackCounter->Pt(), effCorr);
		fhistos->fhLPeta->Fill(lPTr->Eta(), effCorr);
		fhistos->fhBkgActivity[lpTrackCounter->GetPtBin()]->Fill(sumPtAroundLP/lpTrackCounter->Pt());

		if( sumPtAroundLP/lpTrackCounter->Pt()< fcard->GetCutOnBkgActivity() &&     ///relative activity
				( fabs(lPTr->Eta()) < (fTrackEtaRange - fIsolationR) )   ){ //fiducial cut

			fhistos->fhIsolatedLPpt->Fill(lpTrackCounter->Pt(), effCorr );

			AliJBaseTrack* lpTrigger = (AliJBaseTrack*) ftriggList->At(lpTrackCounter->GetIndex());
			lpTrigger->SetIsIsolated(1);
		}
	}

	fhistos->fhAssocMult->Fill(noAssocs);
	//cout<"Triggs = "<<<noTriggs<<" Assoc = "<<noAssocs<<" all = "<<noAllTracks<<endl;

	//============================================================
	//there is obviously a problem when you do "fixed" correlation.
	//In this case the noTriggs==0 condition is never fullfilled
	//============================================================
	//if(noTriggs==0 || ((fjtrigg==kPizero) && (fjassoc==kPizero)) )
	//if(leadingPt<1.5) //should be fixed
	//if(noTriggs==0 && noAssocs>0 ){}
	if(noAssocs>0 ) fassocPool->AcceptList(fassocList, fcent, zVert, noAllChargedTracks, fevt);

	//------------------------------------------------------------------
	// Do the Correlation 
	//----------------------ooooo---------------------------------------
	int noTriggTracs=-1;
	noTriggTracs = fbTriggCorrel ? noTriggs : 1;
	if(fbLPCorrel && !lpTrackCounter->Exists()) return;
	if(fbLPpairCorrel && !lpPairCounter->Exists()) return;
	AliJBaseTrack *triggTr = NULL;

	for(int ii=0;ii<noTriggTracs;ii++){ // trigger loop 
		if (fbTriggCorrel)  triggTr = (AliJBaseTrack*)ftriggList->At(ii);
		if (fbLPCorrel)     triggTr = (AliJBaseTrack*)ftriggList->At(lpTrackCounter->GetIndex());
		if (fbLPpairCorrel) triggTr = (AliJBaseTrack*)fpairList->At(lpPairCounter->GetIndex());
		//for(int ii=0;ii<noIsolPizero;ii++){ // trigger loop }
		//AliJBaseTrack *triggTr = (AliJBaseTrack*)isolPizeroList->At(ii);
		double ptt = triggTr->Pt();
		int iptt   = triggTr->GetTriggBin(); 
		if(iptt<0) {
			cout<<"Not registered trigger ! I better stop here." <<endl; 
			exit(-1);
		}
		double effCorr = 1.0/triggTr->GetTrackEff();
		fhistos->fhTriggPtBin[cBin][zBin][iptt]->Fill(ptt, effCorr);//inclusive

		if(triggTr->GetIsIsolated()>0) fhistos->fhTriggPtBinIsolTrigg[kReal][cBin][iptt]->Fill(ptt, effCorr);

		for(int jj=0;jj<noAssocs;jj++){ // assoc loop
			AliJBaseTrack  *assocTr = (AliJBaseTrack*)fassocList->At(jj);
			//assocTr->PrintOut("assoc track");
			if(fbLPpairCorrel && 
					(assocTr->GetID()==lpPairCounter->GetPairTrackID(0) || 
					 assocTr->GetID()==lpPairCounter->GetPairTrackID(1)) ) continue;
			//-------------------------------------------------------------
			fcorrelations->FillAzimuthHistos(kReal, cBin, zBin, triggTr, assocTr);
			//-------------------------------------------------------------
		} // end assoc loop
	} // end trigg loop
	// == mix trigg with assoc
	if (fbLPpairCorrel) 
		fassocPool->Mix(fpairList,  kAzimuthFill, fcent, zVert, noAllChargedTracks, fevt);
	else
		fassocPool->Mix(ftriggList, kAzimuthFill, fcent, zVert, noAllChargedTracks, fevt);

	//--------------------------------------------------------------
	// End of the Correlation
	//--------------------------------------------------------------



}

void AliJCORRAN::Terminate() {
	// termination

	/*  TODO
		for (int hic = 0;hic < fcard->GetNoOfBins(kCentrType);hic++){
		ScaleNotEquidistantHisto( fhistos->fhChargedPt[hic], 1);
		ScaleNotEquidistantHisto( fhistos->fhChargedPtNoCorr[hic], 1);
		ScaleNotEquidistantHisto( fhistos->fhChargedPtJacek[hic], 1);
		}
		ScaleNotEquidistantHisto( fhistos->fhLPpt, 1);
		ScaleNotEquidistantHisto( fhistos->fhLPpairPt, 1);
		ScaleNotEquidistantHisto( fhistos->fhIsolatedLPpt, 1);
		ScaleNotEquidistantHisto( fhistos->fhChargedPtFiete, 1);
		*/

	//    cout<<"MB's="<<noMB<<" "<<" ERT's="<<noERT<<endl;
	fcorrelations->PrintOut();
	fassocPool->PrintOut();
	fEfficiency->Write();
	fhistos->fHMG->Print();
	//fhistos->fHMG->Write();
}

particleType  AliJCORRAN::GetParticleType(char *inchar){
	// part type
	for(int i=0;i<kNumberOfParticleTypes;i++) {
		//cout<<"<"<<inchar<<"> <"<<particleTypeStr[i]<<"> "<<strcmp(inchar,particleTypeStr[i])<<" "<<(particleType)i<<endl;
		if(strcmp(inchar,kParticleTypeStrName[i])==0) return (particleType)i;
	}
	std::cout<<"Particle type <"<<inchar<<"> not recognized"<<std::endl;
	exit(1);
}

double AliJCORRAN::DeltaPhi(double phi1, double phi2) {
	// dphi
	double res =  atan2(sin(phi1-phi2), cos(phi1-phi2));
	//return res>-kJPi/3.0 ? res : kJTwoPi+res ; 
	return res>-kJPi*9./20. ? res : kJTwoPi+res ; 
}

void AliJCORRAN::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));
	}   
}

// Fill xT histograms (Esko)
void AliJCORRAN::FillXtHistos(TClonesArray *inputList, AliJTrackCounter *lpTrackCounter){
	// Here should be a comment describing this method 
	JUNUSED(lpTrackCounter);

	enum xTtype { kInclusive=0, kIsolated=1, kIsolatedLP=2} ;
	double lowerPtCut = 0.2;
	double isolationR = 0.4;
	double fCutOnBkgActivity = 0.10;
	int cBin  = fcard->GetBin(kCentrType, fcent);
	double sqrts = fSQRTS;
	int noAllTriggTracks = inputList->GetEntries();
	//cout << "Entering Esko's analysis loop" << endl;
	//cout << "Sqrts = " << sqrts << " pT = " << ptt << " xT = " << xtt << endl;
	for(int itrack=0; itrack<noAllTriggTracks; itrack++){
		AliJBaseTrack *triggTr = (AliJBaseTrack*)inputList->At(itrack);
		double  sumPtAroundTrigger = 0;
		double ptt = triggTr->Pt();
		double xtt = 2.0 * ptt / (1.0 * sqrts);
		double effCorr = 1.0/triggTr->GetTrackEff();
		fhistos->fhPtForXt[kInclusive][cBin]->Fill(ptt, ptt>0 ? 1./ptt*effCorr : 0);
		fhistos->fhXt[kInclusive][cBin]->Fill(xtt, effCorr );
		fhistos->fhXtWeighted[kInclusive][cBin]->Fill(xtt, effCorr*1.0/xtt );

		for(int jj=0;jj<inputList->GetEntriesFast();jj++){ // assoc loop
			AliJBaseTrack *assocTr = (AliJBaseTrack*)inputList->At(jj);
			if(triggTr->GetID()==assocTr->GetID()) continue;
			double pta = assocTr->Pt();
			// determine the activity in the cone around trigger (Esko)
			if( lowerPtCut < pta ){
				double dPhi = DeltaPhi( assocTr->Phi(), triggTr->Phi() );
				double dEta = assocTr->Eta() - triggTr->Eta();
				if(isolationR > sqrt(dPhi*dPhi+dEta*dEta))  sumPtAroundTrigger += assocTr->Pt();//FK//
			}
			//cout << "  Assoc number " << assocCounter++ << endl;
		}
		// If pT sum is below the limit, fill to the isolated histos
		if( sumPtAroundTrigger/ptt < fCutOnBkgActivity &&     ///relative activity
				( fabs(triggTr->Eta()) < (fTrackEtaRange - isolationR) )   ){ //fiducial cut
			// pT and xT
			// kInclusive kIsolated, kLPIsolated
			fhistos->fhPtForXt[kIsolated][cBin]->Fill(ptt,effCorr*1.0/ptt);
			fhistos->fhXt[kIsolated][cBin]->Fill(xtt, effCorr );
			fhistos->fhXtWeighted[kIsolated][cBin]->Fill(xtt,effCorr*1.0/xtt);
		}
		//cout<<"pT sum around trigger = " << sumPtAroundTrigger << endl;
	}

} // end FillXtHistos
 AliJCORRAN.cxx:1
 AliJCORRAN.cxx:2
 AliJCORRAN.cxx:3
 AliJCORRAN.cxx:4
 AliJCORRAN.cxx:5
 AliJCORRAN.cxx:6
 AliJCORRAN.cxx:7
 AliJCORRAN.cxx:8
 AliJCORRAN.cxx:9
 AliJCORRAN.cxx:10
 AliJCORRAN.cxx:11
 AliJCORRAN.cxx:12
 AliJCORRAN.cxx:13
 AliJCORRAN.cxx:14
 AliJCORRAN.cxx:15
 AliJCORRAN.cxx:16
 AliJCORRAN.cxx:17
 AliJCORRAN.cxx:18
 AliJCORRAN.cxx:19
 AliJCORRAN.cxx:20
 AliJCORRAN.cxx:21
 AliJCORRAN.cxx:22
 AliJCORRAN.cxx:23
 AliJCORRAN.cxx:24
 AliJCORRAN.cxx:25
 AliJCORRAN.cxx:26
 AliJCORRAN.cxx:27
 AliJCORRAN.cxx:28
 AliJCORRAN.cxx:29
 AliJCORRAN.cxx:30
 AliJCORRAN.cxx:31
 AliJCORRAN.cxx:32
 AliJCORRAN.cxx:33
 AliJCORRAN.cxx:34
 AliJCORRAN.cxx:35
 AliJCORRAN.cxx:36
 AliJCORRAN.cxx:37
 AliJCORRAN.cxx:38
 AliJCORRAN.cxx:39
 AliJCORRAN.cxx:40
 AliJCORRAN.cxx:41
 AliJCORRAN.cxx:42
 AliJCORRAN.cxx:43
 AliJCORRAN.cxx:44
 AliJCORRAN.cxx:45
 AliJCORRAN.cxx:46
 AliJCORRAN.cxx:47
 AliJCORRAN.cxx:48
 AliJCORRAN.cxx:49
 AliJCORRAN.cxx:50
 AliJCORRAN.cxx:51
 AliJCORRAN.cxx:52
 AliJCORRAN.cxx:53
 AliJCORRAN.cxx:54
 AliJCORRAN.cxx:55
 AliJCORRAN.cxx:56
 AliJCORRAN.cxx:57
 AliJCORRAN.cxx:58
 AliJCORRAN.cxx:59
 AliJCORRAN.cxx:60
 AliJCORRAN.cxx:61
 AliJCORRAN.cxx:62
 AliJCORRAN.cxx:63
 AliJCORRAN.cxx:64
 AliJCORRAN.cxx:65
 AliJCORRAN.cxx:66
 AliJCORRAN.cxx:67
 AliJCORRAN.cxx:68
 AliJCORRAN.cxx:69
 AliJCORRAN.cxx:70
 AliJCORRAN.cxx:71
 AliJCORRAN.cxx:72
 AliJCORRAN.cxx:73
 AliJCORRAN.cxx:74
 AliJCORRAN.cxx:75
 AliJCORRAN.cxx:76
 AliJCORRAN.cxx:77
 AliJCORRAN.cxx:78
 AliJCORRAN.cxx:79
 AliJCORRAN.cxx:80
 AliJCORRAN.cxx:81
 AliJCORRAN.cxx:82
 AliJCORRAN.cxx:83
 AliJCORRAN.cxx:84
 AliJCORRAN.cxx:85
 AliJCORRAN.cxx:86
 AliJCORRAN.cxx:87
 AliJCORRAN.cxx:88
 AliJCORRAN.cxx:89
 AliJCORRAN.cxx:90
 AliJCORRAN.cxx:91
 AliJCORRAN.cxx:92
 AliJCORRAN.cxx:93
 AliJCORRAN.cxx:94
 AliJCORRAN.cxx:95
 AliJCORRAN.cxx:96
 AliJCORRAN.cxx:97
 AliJCORRAN.cxx:98
 AliJCORRAN.cxx:99
 AliJCORRAN.cxx:100
 AliJCORRAN.cxx:101
 AliJCORRAN.cxx:102
 AliJCORRAN.cxx:103
 AliJCORRAN.cxx:104
 AliJCORRAN.cxx:105
 AliJCORRAN.cxx:106
 AliJCORRAN.cxx:107
 AliJCORRAN.cxx:108
 AliJCORRAN.cxx:109
 AliJCORRAN.cxx:110
 AliJCORRAN.cxx:111
 AliJCORRAN.cxx:112
 AliJCORRAN.cxx:113
 AliJCORRAN.cxx:114
 AliJCORRAN.cxx:115
 AliJCORRAN.cxx:116
 AliJCORRAN.cxx:117
 AliJCORRAN.cxx:118
 AliJCORRAN.cxx:119
 AliJCORRAN.cxx:120
 AliJCORRAN.cxx:121
 AliJCORRAN.cxx:122
 AliJCORRAN.cxx:123
 AliJCORRAN.cxx:124
 AliJCORRAN.cxx:125
 AliJCORRAN.cxx:126
 AliJCORRAN.cxx:127
 AliJCORRAN.cxx:128
 AliJCORRAN.cxx:129
 AliJCORRAN.cxx:130
 AliJCORRAN.cxx:131
 AliJCORRAN.cxx:132
 AliJCORRAN.cxx:133
 AliJCORRAN.cxx:134
 AliJCORRAN.cxx:135
 AliJCORRAN.cxx:136
 AliJCORRAN.cxx:137
 AliJCORRAN.cxx:138
 AliJCORRAN.cxx:139
 AliJCORRAN.cxx:140
 AliJCORRAN.cxx:141
 AliJCORRAN.cxx:142
 AliJCORRAN.cxx:143
 AliJCORRAN.cxx:144
 AliJCORRAN.cxx:145
 AliJCORRAN.cxx:146
 AliJCORRAN.cxx:147
 AliJCORRAN.cxx:148
 AliJCORRAN.cxx:149
 AliJCORRAN.cxx:150
 AliJCORRAN.cxx:151
 AliJCORRAN.cxx:152
 AliJCORRAN.cxx:153
 AliJCORRAN.cxx:154
 AliJCORRAN.cxx:155
 AliJCORRAN.cxx:156
 AliJCORRAN.cxx:157
 AliJCORRAN.cxx:158
 AliJCORRAN.cxx:159
 AliJCORRAN.cxx:160
 AliJCORRAN.cxx:161
 AliJCORRAN.cxx:162
 AliJCORRAN.cxx:163
 AliJCORRAN.cxx:164
 AliJCORRAN.cxx:165
 AliJCORRAN.cxx:166
 AliJCORRAN.cxx:167
 AliJCORRAN.cxx:168
 AliJCORRAN.cxx:169
 AliJCORRAN.cxx:170
 AliJCORRAN.cxx:171
 AliJCORRAN.cxx:172
 AliJCORRAN.cxx:173
 AliJCORRAN.cxx:174
 AliJCORRAN.cxx:175
 AliJCORRAN.cxx:176
 AliJCORRAN.cxx:177
 AliJCORRAN.cxx:178
 AliJCORRAN.cxx:179
 AliJCORRAN.cxx:180
 AliJCORRAN.cxx:181
 AliJCORRAN.cxx:182
 AliJCORRAN.cxx:183
 AliJCORRAN.cxx:184
 AliJCORRAN.cxx:185
 AliJCORRAN.cxx:186
 AliJCORRAN.cxx:187
 AliJCORRAN.cxx:188
 AliJCORRAN.cxx:189
 AliJCORRAN.cxx:190
 AliJCORRAN.cxx:191
 AliJCORRAN.cxx:192
 AliJCORRAN.cxx:193
 AliJCORRAN.cxx:194
 AliJCORRAN.cxx:195
 AliJCORRAN.cxx:196
 AliJCORRAN.cxx:197
 AliJCORRAN.cxx:198
 AliJCORRAN.cxx:199
 AliJCORRAN.cxx:200
 AliJCORRAN.cxx:201
 AliJCORRAN.cxx:202
 AliJCORRAN.cxx:203
 AliJCORRAN.cxx:204
 AliJCORRAN.cxx:205
 AliJCORRAN.cxx:206
 AliJCORRAN.cxx:207
 AliJCORRAN.cxx:208
 AliJCORRAN.cxx:209
 AliJCORRAN.cxx:210
 AliJCORRAN.cxx:211
 AliJCORRAN.cxx:212
 AliJCORRAN.cxx:213
 AliJCORRAN.cxx:214
 AliJCORRAN.cxx:215
 AliJCORRAN.cxx:216
 AliJCORRAN.cxx:217
 AliJCORRAN.cxx:218
 AliJCORRAN.cxx:219
 AliJCORRAN.cxx:220
 AliJCORRAN.cxx:221
 AliJCORRAN.cxx:222
 AliJCORRAN.cxx:223
 AliJCORRAN.cxx:224
 AliJCORRAN.cxx:225
 AliJCORRAN.cxx:226
 AliJCORRAN.cxx:227
 AliJCORRAN.cxx:228
 AliJCORRAN.cxx:229
 AliJCORRAN.cxx:230
 AliJCORRAN.cxx:231
 AliJCORRAN.cxx:232
 AliJCORRAN.cxx:233
 AliJCORRAN.cxx:234
 AliJCORRAN.cxx:235
 AliJCORRAN.cxx:236
 AliJCORRAN.cxx:237
 AliJCORRAN.cxx:238
 AliJCORRAN.cxx:239
 AliJCORRAN.cxx:240
 AliJCORRAN.cxx:241
 AliJCORRAN.cxx:242
 AliJCORRAN.cxx:243
 AliJCORRAN.cxx:244
 AliJCORRAN.cxx:245
 AliJCORRAN.cxx:246
 AliJCORRAN.cxx:247
 AliJCORRAN.cxx:248
 AliJCORRAN.cxx:249
 AliJCORRAN.cxx:250
 AliJCORRAN.cxx:251
 AliJCORRAN.cxx:252
 AliJCORRAN.cxx:253
 AliJCORRAN.cxx:254
 AliJCORRAN.cxx:255
 AliJCORRAN.cxx:256
 AliJCORRAN.cxx:257
 AliJCORRAN.cxx:258
 AliJCORRAN.cxx:259
 AliJCORRAN.cxx:260
 AliJCORRAN.cxx:261
 AliJCORRAN.cxx:262
 AliJCORRAN.cxx:263
 AliJCORRAN.cxx:264
 AliJCORRAN.cxx:265
 AliJCORRAN.cxx:266
 AliJCORRAN.cxx:267
 AliJCORRAN.cxx:268
 AliJCORRAN.cxx:269
 AliJCORRAN.cxx:270
 AliJCORRAN.cxx:271
 AliJCORRAN.cxx:272
 AliJCORRAN.cxx:273
 AliJCORRAN.cxx:274
 AliJCORRAN.cxx:275
 AliJCORRAN.cxx:276
 AliJCORRAN.cxx:277
 AliJCORRAN.cxx:278
 AliJCORRAN.cxx:279
 AliJCORRAN.cxx:280
 AliJCORRAN.cxx:281
 AliJCORRAN.cxx:282
 AliJCORRAN.cxx:283
 AliJCORRAN.cxx:284
 AliJCORRAN.cxx:285
 AliJCORRAN.cxx:286
 AliJCORRAN.cxx:287
 AliJCORRAN.cxx:288
 AliJCORRAN.cxx:289
 AliJCORRAN.cxx:290
 AliJCORRAN.cxx:291
 AliJCORRAN.cxx:292
 AliJCORRAN.cxx:293
 AliJCORRAN.cxx:294
 AliJCORRAN.cxx:295
 AliJCORRAN.cxx:296
 AliJCORRAN.cxx:297
 AliJCORRAN.cxx:298
 AliJCORRAN.cxx:299
 AliJCORRAN.cxx:300
 AliJCORRAN.cxx:301
 AliJCORRAN.cxx:302
 AliJCORRAN.cxx:303
 AliJCORRAN.cxx:304
 AliJCORRAN.cxx:305
 AliJCORRAN.cxx:306
 AliJCORRAN.cxx:307
 AliJCORRAN.cxx:308
 AliJCORRAN.cxx:309
 AliJCORRAN.cxx:310
 AliJCORRAN.cxx:311
 AliJCORRAN.cxx:312
 AliJCORRAN.cxx:313
 AliJCORRAN.cxx:314
 AliJCORRAN.cxx:315
 AliJCORRAN.cxx:316
 AliJCORRAN.cxx:317
 AliJCORRAN.cxx:318
 AliJCORRAN.cxx:319
 AliJCORRAN.cxx:320
 AliJCORRAN.cxx:321
 AliJCORRAN.cxx:322
 AliJCORRAN.cxx:323
 AliJCORRAN.cxx:324
 AliJCORRAN.cxx:325
 AliJCORRAN.cxx:326
 AliJCORRAN.cxx:327
 AliJCORRAN.cxx:328
 AliJCORRAN.cxx:329
 AliJCORRAN.cxx:330
 AliJCORRAN.cxx:331
 AliJCORRAN.cxx:332
 AliJCORRAN.cxx:333
 AliJCORRAN.cxx:334
 AliJCORRAN.cxx:335
 AliJCORRAN.cxx:336
 AliJCORRAN.cxx:337
 AliJCORRAN.cxx:338
 AliJCORRAN.cxx:339
 AliJCORRAN.cxx:340
 AliJCORRAN.cxx:341
 AliJCORRAN.cxx:342
 AliJCORRAN.cxx:343
 AliJCORRAN.cxx:344
 AliJCORRAN.cxx:345
 AliJCORRAN.cxx:346
 AliJCORRAN.cxx:347
 AliJCORRAN.cxx:348
 AliJCORRAN.cxx:349
 AliJCORRAN.cxx:350
 AliJCORRAN.cxx:351
 AliJCORRAN.cxx:352
 AliJCORRAN.cxx:353
 AliJCORRAN.cxx:354
 AliJCORRAN.cxx:355
 AliJCORRAN.cxx:356
 AliJCORRAN.cxx:357
 AliJCORRAN.cxx:358
 AliJCORRAN.cxx:359
 AliJCORRAN.cxx:360
 AliJCORRAN.cxx:361
 AliJCORRAN.cxx:362
 AliJCORRAN.cxx:363
 AliJCORRAN.cxx:364
 AliJCORRAN.cxx:365
 AliJCORRAN.cxx:366
 AliJCORRAN.cxx:367
 AliJCORRAN.cxx:368
 AliJCORRAN.cxx:369
 AliJCORRAN.cxx:370
 AliJCORRAN.cxx:371
 AliJCORRAN.cxx:372
 AliJCORRAN.cxx:373
 AliJCORRAN.cxx:374
 AliJCORRAN.cxx:375
 AliJCORRAN.cxx:376
 AliJCORRAN.cxx:377
 AliJCORRAN.cxx:378
 AliJCORRAN.cxx:379
 AliJCORRAN.cxx:380
 AliJCORRAN.cxx:381
 AliJCORRAN.cxx:382
 AliJCORRAN.cxx:383
 AliJCORRAN.cxx:384
 AliJCORRAN.cxx:385
 AliJCORRAN.cxx:386
 AliJCORRAN.cxx:387
 AliJCORRAN.cxx:388
 AliJCORRAN.cxx:389
 AliJCORRAN.cxx:390
 AliJCORRAN.cxx:391
 AliJCORRAN.cxx:392
 AliJCORRAN.cxx:393
 AliJCORRAN.cxx:394
 AliJCORRAN.cxx:395
 AliJCORRAN.cxx:396
 AliJCORRAN.cxx:397
 AliJCORRAN.cxx:398
 AliJCORRAN.cxx:399
 AliJCORRAN.cxx:400
 AliJCORRAN.cxx:401
 AliJCORRAN.cxx:402
 AliJCORRAN.cxx:403
 AliJCORRAN.cxx:404
 AliJCORRAN.cxx:405
 AliJCORRAN.cxx:406
 AliJCORRAN.cxx:407
 AliJCORRAN.cxx:408
 AliJCORRAN.cxx:409
 AliJCORRAN.cxx:410
 AliJCORRAN.cxx:411
 AliJCORRAN.cxx:412
 AliJCORRAN.cxx:413
 AliJCORRAN.cxx:414
 AliJCORRAN.cxx:415
 AliJCORRAN.cxx:416
 AliJCORRAN.cxx:417
 AliJCORRAN.cxx:418
 AliJCORRAN.cxx:419
 AliJCORRAN.cxx:420
 AliJCORRAN.cxx:421
 AliJCORRAN.cxx:422
 AliJCORRAN.cxx:423
 AliJCORRAN.cxx:424
 AliJCORRAN.cxx:425
 AliJCORRAN.cxx:426
 AliJCORRAN.cxx:427
 AliJCORRAN.cxx:428
 AliJCORRAN.cxx:429
 AliJCORRAN.cxx:430
 AliJCORRAN.cxx:431
 AliJCORRAN.cxx:432
 AliJCORRAN.cxx:433
 AliJCORRAN.cxx:434
 AliJCORRAN.cxx:435
 AliJCORRAN.cxx:436
 AliJCORRAN.cxx:437
 AliJCORRAN.cxx:438
 AliJCORRAN.cxx:439
 AliJCORRAN.cxx:440
 AliJCORRAN.cxx:441
 AliJCORRAN.cxx:442
 AliJCORRAN.cxx:443
 AliJCORRAN.cxx:444
 AliJCORRAN.cxx:445
 AliJCORRAN.cxx:446
 AliJCORRAN.cxx:447
 AliJCORRAN.cxx:448
 AliJCORRAN.cxx:449
 AliJCORRAN.cxx:450
 AliJCORRAN.cxx:451
 AliJCORRAN.cxx:452
 AliJCORRAN.cxx:453
 AliJCORRAN.cxx:454
 AliJCORRAN.cxx:455
 AliJCORRAN.cxx:456
 AliJCORRAN.cxx:457
 AliJCORRAN.cxx:458
 AliJCORRAN.cxx:459
 AliJCORRAN.cxx:460
 AliJCORRAN.cxx:461
 AliJCORRAN.cxx:462
 AliJCORRAN.cxx:463
 AliJCORRAN.cxx:464
 AliJCORRAN.cxx:465
 AliJCORRAN.cxx:466
 AliJCORRAN.cxx:467
 AliJCORRAN.cxx:468
 AliJCORRAN.cxx:469
 AliJCORRAN.cxx:470
 AliJCORRAN.cxx:471
 AliJCORRAN.cxx:472
 AliJCORRAN.cxx:473
 AliJCORRAN.cxx:474
 AliJCORRAN.cxx:475
 AliJCORRAN.cxx:476
 AliJCORRAN.cxx:477
 AliJCORRAN.cxx:478
 AliJCORRAN.cxx:479
 AliJCORRAN.cxx:480
 AliJCORRAN.cxx:481
 AliJCORRAN.cxx:482
 AliJCORRAN.cxx:483
 AliJCORRAN.cxx:484
 AliJCORRAN.cxx:485
 AliJCORRAN.cxx:486
 AliJCORRAN.cxx:487
 AliJCORRAN.cxx:488
 AliJCORRAN.cxx:489
 AliJCORRAN.cxx:490
 AliJCORRAN.cxx:491
 AliJCORRAN.cxx:492
 AliJCORRAN.cxx:493
 AliJCORRAN.cxx:494
 AliJCORRAN.cxx:495
 AliJCORRAN.cxx:496
 AliJCORRAN.cxx:497
 AliJCORRAN.cxx:498
 AliJCORRAN.cxx:499
 AliJCORRAN.cxx:500
 AliJCORRAN.cxx:501
 AliJCORRAN.cxx:502
 AliJCORRAN.cxx:503
 AliJCORRAN.cxx:504
 AliJCORRAN.cxx:505
 AliJCORRAN.cxx:506
 AliJCORRAN.cxx:507
 AliJCORRAN.cxx:508
 AliJCORRAN.cxx:509
 AliJCORRAN.cxx:510
 AliJCORRAN.cxx:511
 AliJCORRAN.cxx:512
 AliJCORRAN.cxx:513
 AliJCORRAN.cxx:514
 AliJCORRAN.cxx:515
 AliJCORRAN.cxx:516
 AliJCORRAN.cxx:517
 AliJCORRAN.cxx:518
 AliJCORRAN.cxx:519
 AliJCORRAN.cxx:520
 AliJCORRAN.cxx:521
 AliJCORRAN.cxx:522
 AliJCORRAN.cxx:523
 AliJCORRAN.cxx:524
 AliJCORRAN.cxx:525
 AliJCORRAN.cxx:526
 AliJCORRAN.cxx:527
 AliJCORRAN.cxx:528
 AliJCORRAN.cxx:529
 AliJCORRAN.cxx:530
 AliJCORRAN.cxx:531
 AliJCORRAN.cxx:532
 AliJCORRAN.cxx:533
 AliJCORRAN.cxx:534
 AliJCORRAN.cxx:535
 AliJCORRAN.cxx:536
 AliJCORRAN.cxx:537
 AliJCORRAN.cxx:538
 AliJCORRAN.cxx:539
 AliJCORRAN.cxx:540
 AliJCORRAN.cxx:541
 AliJCORRAN.cxx:542
 AliJCORRAN.cxx:543
 AliJCORRAN.cxx:544
 AliJCORRAN.cxx:545
 AliJCORRAN.cxx:546
 AliJCORRAN.cxx:547
 AliJCORRAN.cxx:548
 AliJCORRAN.cxx:549
 AliJCORRAN.cxx:550
 AliJCORRAN.cxx:551
 AliJCORRAN.cxx:552
 AliJCORRAN.cxx:553
 AliJCORRAN.cxx:554
 AliJCORRAN.cxx:555
 AliJCORRAN.cxx:556
 AliJCORRAN.cxx:557
 AliJCORRAN.cxx:558
 AliJCORRAN.cxx:559
 AliJCORRAN.cxx:560
 AliJCORRAN.cxx:561
 AliJCORRAN.cxx:562
 AliJCORRAN.cxx:563
 AliJCORRAN.cxx:564
 AliJCORRAN.cxx:565
 AliJCORRAN.cxx:566
 AliJCORRAN.cxx:567
 AliJCORRAN.cxx:568
 AliJCORRAN.cxx:569
 AliJCORRAN.cxx:570
 AliJCORRAN.cxx:571
 AliJCORRAN.cxx:572
 AliJCORRAN.cxx:573
 AliJCORRAN.cxx:574
 AliJCORRAN.cxx:575
 AliJCORRAN.cxx:576
 AliJCORRAN.cxx:577
 AliJCORRAN.cxx:578
 AliJCORRAN.cxx:579
 AliJCORRAN.cxx:580
 AliJCORRAN.cxx:581
 AliJCORRAN.cxx:582
 AliJCORRAN.cxx:583
 AliJCORRAN.cxx:584
 AliJCORRAN.cxx:585
 AliJCORRAN.cxx:586
 AliJCORRAN.cxx:587
 AliJCORRAN.cxx:588
 AliJCORRAN.cxx:589
 AliJCORRAN.cxx:590
 AliJCORRAN.cxx:591
 AliJCORRAN.cxx:592
 AliJCORRAN.cxx:593
 AliJCORRAN.cxx:594
 AliJCORRAN.cxx:595
 AliJCORRAN.cxx:596
 AliJCORRAN.cxx:597
 AliJCORRAN.cxx:598
 AliJCORRAN.cxx:599
 AliJCORRAN.cxx:600
 AliJCORRAN.cxx:601
 AliJCORRAN.cxx:602
 AliJCORRAN.cxx:603
 AliJCORRAN.cxx:604
 AliJCORRAN.cxx:605
 AliJCORRAN.cxx:606
 AliJCORRAN.cxx:607
 AliJCORRAN.cxx:608
 AliJCORRAN.cxx:609
 AliJCORRAN.cxx:610
 AliJCORRAN.cxx:611
 AliJCORRAN.cxx:612
 AliJCORRAN.cxx:613
 AliJCORRAN.cxx:614
 AliJCORRAN.cxx:615
 AliJCORRAN.cxx:616
 AliJCORRAN.cxx:617
 AliJCORRAN.cxx:618
 AliJCORRAN.cxx:619
 AliJCORRAN.cxx:620
 AliJCORRAN.cxx:621
 AliJCORRAN.cxx:622
 AliJCORRAN.cxx:623
 AliJCORRAN.cxx:624
 AliJCORRAN.cxx:625
 AliJCORRAN.cxx:626
 AliJCORRAN.cxx:627
 AliJCORRAN.cxx:628
 AliJCORRAN.cxx:629
 AliJCORRAN.cxx:630
 AliJCORRAN.cxx:631
 AliJCORRAN.cxx:632
 AliJCORRAN.cxx:633
 AliJCORRAN.cxx:634
 AliJCORRAN.cxx:635
 AliJCORRAN.cxx:636
 AliJCORRAN.cxx:637
 AliJCORRAN.cxx:638
 AliJCORRAN.cxx:639
 AliJCORRAN.cxx:640
 AliJCORRAN.cxx:641
 AliJCORRAN.cxx:642
 AliJCORRAN.cxx:643
 AliJCORRAN.cxx:644
 AliJCORRAN.cxx:645
 AliJCORRAN.cxx:646
 AliJCORRAN.cxx:647
 AliJCORRAN.cxx:648
 AliJCORRAN.cxx:649
 AliJCORRAN.cxx:650
 AliJCORRAN.cxx:651
 AliJCORRAN.cxx:652
 AliJCORRAN.cxx:653
 AliJCORRAN.cxx:654
 AliJCORRAN.cxx:655
 AliJCORRAN.cxx:656
 AliJCORRAN.cxx:657
 AliJCORRAN.cxx:658
 AliJCORRAN.cxx:659
 AliJCORRAN.cxx:660
 AliJCORRAN.cxx:661
 AliJCORRAN.cxx:662
 AliJCORRAN.cxx:663
 AliJCORRAN.cxx:664
 AliJCORRAN.cxx:665
 AliJCORRAN.cxx:666
 AliJCORRAN.cxx:667
 AliJCORRAN.cxx:668
 AliJCORRAN.cxx:669
 AliJCORRAN.cxx:670
 AliJCORRAN.cxx:671
 AliJCORRAN.cxx:672
 AliJCORRAN.cxx:673
 AliJCORRAN.cxx:674
 AliJCORRAN.cxx:675
 AliJCORRAN.cxx:676
 AliJCORRAN.cxx:677
 AliJCORRAN.cxx:678
 AliJCORRAN.cxx:679
 AliJCORRAN.cxx:680
 AliJCORRAN.cxx:681
 AliJCORRAN.cxx:682
 AliJCORRAN.cxx:683
 AliJCORRAN.cxx:684
 AliJCORRAN.cxx:685
 AliJCORRAN.cxx:686
 AliJCORRAN.cxx:687
 AliJCORRAN.cxx:688
 AliJCORRAN.cxx:689
 AliJCORRAN.cxx:690
 AliJCORRAN.cxx:691
 AliJCORRAN.cxx:692
 AliJCORRAN.cxx:693
 AliJCORRAN.cxx:694
 AliJCORRAN.cxx:695
 AliJCORRAN.cxx:696
 AliJCORRAN.cxx:697
 AliJCORRAN.cxx:698
 AliJCORRAN.cxx:699
 AliJCORRAN.cxx:700
 AliJCORRAN.cxx:701
 AliJCORRAN.cxx:702
 AliJCORRAN.cxx:703
 AliJCORRAN.cxx:704
 AliJCORRAN.cxx:705
 AliJCORRAN.cxx:706
 AliJCORRAN.cxx:707
 AliJCORRAN.cxx:708
 AliJCORRAN.cxx:709
 AliJCORRAN.cxx:710
 AliJCORRAN.cxx:711
 AliJCORRAN.cxx:712
 AliJCORRAN.cxx:713
 AliJCORRAN.cxx:714
 AliJCORRAN.cxx:715
 AliJCORRAN.cxx:716
 AliJCORRAN.cxx:717
 AliJCORRAN.cxx:718
 AliJCORRAN.cxx:719
 AliJCORRAN.cxx:720
 AliJCORRAN.cxx:721
 AliJCORRAN.cxx:722
 AliJCORRAN.cxx:723
 AliJCORRAN.cxx:724
 AliJCORRAN.cxx:725
 AliJCORRAN.cxx:726
 AliJCORRAN.cxx:727
 AliJCORRAN.cxx:728
 AliJCORRAN.cxx:729
 AliJCORRAN.cxx:730
 AliJCORRAN.cxx:731
 AliJCORRAN.cxx:732
 AliJCORRAN.cxx:733
 AliJCORRAN.cxx:734
 AliJCORRAN.cxx:735
 AliJCORRAN.cxx:736
 AliJCORRAN.cxx:737
 AliJCORRAN.cxx:738
 AliJCORRAN.cxx:739
 AliJCORRAN.cxx:740
 AliJCORRAN.cxx:741
 AliJCORRAN.cxx:742
 AliJCORRAN.cxx:743
 AliJCORRAN.cxx:744
 AliJCORRAN.cxx:745
 AliJCORRAN.cxx:746
 AliJCORRAN.cxx:747
 AliJCORRAN.cxx:748
 AliJCORRAN.cxx:749
 AliJCORRAN.cxx:750
 AliJCORRAN.cxx:751
 AliJCORRAN.cxx:752
 AliJCORRAN.cxx:753
 AliJCORRAN.cxx:754
 AliJCORRAN.cxx:755
 AliJCORRAN.cxx:756
 AliJCORRAN.cxx:757
 AliJCORRAN.cxx:758
 AliJCORRAN.cxx:759
 AliJCORRAN.cxx:760
 AliJCORRAN.cxx:761
 AliJCORRAN.cxx:762
 AliJCORRAN.cxx:763
 AliJCORRAN.cxx:764
 AliJCORRAN.cxx:765
 AliJCORRAN.cxx:766
 AliJCORRAN.cxx:767
 AliJCORRAN.cxx:768
 AliJCORRAN.cxx:769
 AliJCORRAN.cxx:770
 AliJCORRAN.cxx:771
 AliJCORRAN.cxx:772
 AliJCORRAN.cxx:773
 AliJCORRAN.cxx:774
 AliJCORRAN.cxx:775
 AliJCORRAN.cxx:776
 AliJCORRAN.cxx:777
 AliJCORRAN.cxx:778
 AliJCORRAN.cxx:779
 AliJCORRAN.cxx:780
 AliJCORRAN.cxx:781
 AliJCORRAN.cxx:782
 AliJCORRAN.cxx:783
 AliJCORRAN.cxx:784
 AliJCORRAN.cxx:785
 AliJCORRAN.cxx:786
 AliJCORRAN.cxx:787
 AliJCORRAN.cxx:788
 AliJCORRAN.cxx:789
 AliJCORRAN.cxx:790
 AliJCORRAN.cxx:791
 AliJCORRAN.cxx:792
 AliJCORRAN.cxx:793