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

//_________________________________________________________________________
//  Base class for the cluster unfolding algorithm 
//*-- Author: Adam Matyja (SUBATECH)
//  Based on unfolding in clusterizerv1 done by Cynthia Hadjidakis
//-- Unfolding for eta~0: Cynthia Hadjidakis - still in AliEMCALCLusterizerv1
//-- Unfolding extension for whole EMCAL: Adam Matyja (SUBATECH & INP PAN)
//
//  unfolds the clusters having several local maxima. 
//////////////////////////////////////////////////////////////////////////////

// --- ROOT system ---
#include "TClonesArray.h"
#include <TMath.h> 
#include <TMinuit.h>

// --- Standard library ---
#include <cassert>

// --- AliRoot header files ---
#include "AliEMCALUnfolding.h"
#include "AliEMCALGeometry.h"
#include "AliRunLoader.h"
#include "AliRun.h"
#include "AliEMCAL.h"
#include "AliEMCALRecParam.h"
#include "AliEMCALRecPoint.h"
#include "AliEMCALDigit.h"
#include "AliEMCALReconstructor.h"

#include "AliLog.h"
#include "AliCDBManager.h"
class AliCDBStorage;
#include "AliCDBEntry.h"

Double_t AliEMCALUnfolding::fgSSPars[8]={0.9262,3.365,1.548,0.1625,-0.4195,0.,0.,2.332};
Double_t AliEMCALUnfolding::fgPar5[3]={12.31,-0.007381,-0.06936};
Double_t AliEMCALUnfolding::fgPar6[3]={0.05452,0.0001228,0.001361};

ClassImp(AliEMCALUnfolding)
  
//____________________________________________________________________________
AliEMCALUnfolding::AliEMCALUnfolding():
  fNumberOfECAClusters(0),
  fECALocMaxCut(0),
  fThreshold(0.01),//10 MeV
  fRejectBelowThreshold(0),//split
  fGeom(NULL),
  fRecPoints(NULL),
  fDigitsArr(NULL)
{
  // ctor with the indication of the file where header Tree and digits Tree are stored
  Init() ;
}

//____________________________________________________________________________
AliEMCALUnfolding::AliEMCALUnfolding(AliEMCALGeometry* geometry):
  fNumberOfECAClusters(0),
  fECALocMaxCut(0),
  fThreshold(0.01),//10 MeV
  fRejectBelowThreshold(0),//split
  fGeom(geometry),
  fRecPoints(NULL),
  fDigitsArr(NULL)
{
  // ctor with the indication of the file where header Tree and digits Tree are stored
  // use this contructor to avoid usage of Init() which uses runloader
  // change needed by HLT - MP
  if (!fGeom)
  {
    AliFatal("AliEMCALUnfolding: Geometry not initialized.");
  }

}

//____________________________________________________________________________
AliEMCALUnfolding::AliEMCALUnfolding(AliEMCALGeometry* geometry,Float_t ECALocMaxCut,Double_t *SSPars,Double_t *Par5,Double_t *Par6):
  fNumberOfECAClusters(0),
  fECALocMaxCut(ECALocMaxCut),
  fThreshold(0.01),//10 MeV
  fRejectBelowThreshold(0),//split
  fGeom(geometry),
  fRecPoints(NULL),
  fDigitsArr(NULL)
{
  // ctor with the indication of the file where header Tree and digits Tree are stored
  // use this contructor to avoid usage of Init() which uses runloader
  // change needed by HLT - MP
  if (!fGeom)
  {
    AliFatal("AliEMCALUnfolding: Geometry not initialized.");
  }
  Int_t i=0;
  for (i = 0; i < 8; i++) fgSSPars[i] = SSPars[i];
  for (i = 0; i < 3; i++) {
    fgPar5[i] = Par5[i];
    fgPar6[i] = Par6[i];
  }

}

//____________________________________________________________________________
void AliEMCALUnfolding::Init()
{
  // Make all memory allocations which can not be done in default constructor.
  // Attach the Clusterizer task to the list of EMCAL tasks

  AliRunLoader *rl = AliRunLoader::Instance();
  if (rl && rl->GetAliRun()){
    AliEMCAL* emcal = dynamic_cast<AliEMCAL*>(rl->GetAliRun()->GetDetector("EMCAL"));
    if(emcal)fGeom = emcal->GetGeometry();
  }
  
  if(!fGeom)
    fGeom =  AliEMCALGeometry::GetInstance(AliEMCALGeometry::GetDefaultGeometryName());
  
  AliDebug(1,Form("geom %p",fGeom));
  
  if(!gMinuit) 
    //    gMinuit = new TMinuit(100) ;//the same is in FindFitV2
    gMinuit = new TMinuit(30) ;//the same is in FindFitV2
  
}

//____________________________________________________________________________
  AliEMCALUnfolding::~AliEMCALUnfolding()
{
  // dtor
}

//____________________________________________________________________________
void AliEMCALUnfolding::SetInput(Int_t numberOfECAClusters,TObjArray *recPoints,TClonesArray *digitsArr)
{
  //
  //Set input for unfolding purposes
  //
  SetNumberOfECAClusters(numberOfECAClusters);
  SetRecPoints(recPoints);
  SetDigitsArr(digitsArr);
}

//____________________________________________________________________________
void AliEMCALUnfolding::MakeUnfolding()
{
  // Unfolds clusters using the shape of an ElectroMagnetic shower
  // Performs unfolding of all clusters
  
  AliDebug(4,Form(" V1: total no of clusters %d from %d digits",fNumberOfECAClusters,fDigitsArr->GetEntriesFast()));
  if(fNumberOfECAClusters > 0){
    if (fGeom==0)
      AliFatal("Did not get geometry from EMCALLoader") ;
    //Int_t nModulesToUnfold = fGeom->GetNCells();
    
    Int_t numberOfClustersToUnfold=fNumberOfECAClusters;
    //we unfold only clusters present in the array untill now
    //fNumberOfECAClusters may change due to unfilded clusters
    //so 0 to numberOfClustersToUnfold-1: clusters before unfolding
    //numberOfClustersToUnfold to the end: new clusters from unfolding
    //of course numberOfClustersToUnfold also is decreased but we don't loop over clusters added in UF 
    Int_t index ;
    for(index = 0 ; index < numberOfClustersToUnfold ; index++){
      AliEMCALRecPoint * recPoint = dynamic_cast<AliEMCALRecPoint *>( fRecPoints->At(index) ) ;
      if(recPoint){
        Int_t nMultipl = recPoint->GetMultiplicity() ;
        AliEMCALDigit ** maxAt = new AliEMCALDigit*[nMultipl] ;
        Float_t * maxAtEnergy = new Float_t[nMultipl] ;
        Int_t nMax = recPoint->GetNumberOfLocalMax(maxAt, maxAtEnergy,fECALocMaxCut,fDigitsArr) ;
        if( nMax > 1 ) {     // if cluster is very flat (no pronounced maximum) then nMax = 0
	  AliDebug(4,Form("  *** V1+UNFOLD *** Cluster index before UF %d",fNumberOfECAClusters));
          if(UnfoldClusterV2(recPoint, nMax, maxAt, maxAtEnergy) ){
	    //if unfolding correct remove old recPoint
            fRecPoints->Remove(recPoint);
            fRecPoints->Compress() ;//is it really needed
            index-- ;
            fNumberOfECAClusters-- ;
	    numberOfClustersToUnfold--;
          }
	  AliDebug(4,Form("  Cluster index after UF %d",fNumberOfECAClusters));
	} else{
          recPoint->SetNExMax(1) ; //Only one local maximum
        }
        
        delete[] maxAt ;
        delete[] maxAtEnergy ;
      } else {
	//AliError("RecPoint NULL"); //end of check if recPoint exist
	Error("MakeUnfolding", "RecPoint NULL, index = %d, fNumberOfECAClusters = %d, numberOfClustersToUnfold = %d",index,fNumberOfECAClusters,numberOfClustersToUnfold) ;
      }
    } // rec point loop
  }//end of check fNumberOfECAClusters
  // End of Unfolding of clusters

  AliDebug(4,Form(" V1+UNFOLD: total no of clusters %d from %d digits",fNumberOfECAClusters,fDigitsArr->GetEntriesFast()));
//  for(Int_t i=0;i<fNumberOfECAClusters;i++){
//    AliEMCALRecPoint * recPoint = dynamic_cast<AliEMCALRecPoint *>(fRecPoints->At(i));
//    Int_t nMultipl = recPoint->GetMultiplicity() ;
//    Double_t energy=recPoint->GetEnergy();
//    Int_t absIdMaxDigit=recPoint->GetAbsIdMaxDigit();
//    Int_t sm=recPoint->GetSuperModuleNumber();
//    Double_t pointEne=recPoint->GetPointEnergy();
//    Float_t maxEne=recPoint->GetMaximalEnergy();
//    Int_t maxEneInd=recPoint->GetMaximalEnergyIndex();
//    printf("  cluster %d,ncells %d,ene %f,absIdMaxCell %d,sm %d,pointEne %f,maxEne %f,maxEneInd %d\n",i,nMultipl,energy,absIdMaxDigit,sm,pointEne,maxEne,maxEneInd);
//  }

}

//____________________________________________________________________________
Int_t AliEMCALUnfolding::UnfoldOneCluster(AliEMCALRecPoint * iniTower, 
					  Int_t nMax, 
					  AliEMCALDigit ** maxAt, 
					  Float_t * maxAtEnergy,
					  TObjArray *list)
{
  // Input one cluster
  // Output list of clusters
  // returns number of clusters
  // if fit failed or unfolding is not applicable returns 0 and empty list
  
  //**************************** part 1 *******************************************
  // Performs the unfolding of a cluster with nMax overlapping showers 
  
  //cout<<"unfolding check here part 1"<<endl;
  AliDebug(5,Form("  Original cluster E %f, nMax = %d",iniTower->GetEnergy(),nMax ));

  Int_t nPar = 3 * nMax ;
  Float_t * fitparameters = new Float_t[nPar] ;
  
  if (fGeom==0)
    AliFatal("Did not get geometry from EMCALLoader") ;
  
  Bool_t rv = FindFitV2(iniTower, maxAt, maxAtEnergy, nPar, fitparameters) ;
  if( !rv ) 
  {
    // Fit failed, return (and remove cluster? - why? I leave the cluster)
    iniTower->SetNExMax(-1) ;
    delete[] fitparameters ;
    return 0;//changed here
  }
  
  //speed up solution for clusters with 2 maxima where one maximum is below threshold fThreshold
  if(nMax==2){
    if(fitparameters[2]<fThreshold || fitparameters[5]<fThreshold){
      AliDebug(1,"One of fitted energy below threshold");
      iniTower->SetNExMax(1) ;
      delete[] fitparameters ;
      return 0;//changed here
    }
  }

  //**************************** part 2 *******************************************
  // create unfolded rec points and fill them with new energy lists
  // First calculate energy deposited in each sell in accordance with
  // fit (without fluctuations): efit[]
  // and later correct this number in acordance with actual energy
  // deposition
  
  //  cout<<"unfolding check here part 2"<<endl;
  Int_t nDigits = iniTower->GetMultiplicity() ;
  Float_t * efit = new Float_t[nDigits] ;//new fitted energy in cells
  Float_t xpar=0.,zpar=0.,epar=0.  ;//center of gravity in cell units
  
  AliEMCALDigit * digit = 0 ;
  Int_t * digitsList = iniTower->GetDigitsList() ;
  
  Int_t iSupMod =  0 ;
  Int_t iTower  =  0 ;
  Int_t iIphi   =  0 ;
  Int_t iIeta   =  0 ;
  Int_t iphi    =  0 ;//x direction
  Int_t ieta    =  0 ;//z direstion
  
  Int_t iparam = 0 ;
  Int_t iDigit = 0 ;
  
  for(iDigit = 0 ; iDigit < nDigits ; iDigit ++)
  {
    digit = dynamic_cast<AliEMCALDigit*>( fDigitsArr->At(digitsList[iDigit] ) ) ;
    if(digit)
    {
      fGeom->GetCellIndex(digit->GetId(),iSupMod,iTower,iIphi,iIeta); 
      fGeom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,
                                         iIphi, iIeta,iphi,ieta);
      EvalParsPhiDependence(digit->GetId(),fGeom);
      
      efit[iDigit] = 0.;
      iparam = 0;
      while(iparam < nPar )
      {
        xpar = fitparameters[iparam] ;
        zpar = fitparameters[iparam+1] ;
        epar = fitparameters[iparam+2] ;

        efit[iDigit] += epar * ShowerShapeV2((Float_t)iphi - xpar,(Float_t)ieta - zpar) ;
        iparam += 3 ;
      }

    } else AliDebug(1,"Digit NULL part 2!");
    
  }//digit loop
  
  //**************************** part 3 *******************************************
  // Now create new RecPoints and fill energy lists with efit corrected to fluctuations
  // so that energy deposited in each cell is distributed between new clusters proportionally
  // to its contribution to efit
  
  Float_t * energiesList = iniTower->GetEnergiesList() ;
  Float_t ratio = 0. ;
  Float_t eDigit = 0. ;
  Int_t nSplittedClusters=(Int_t)nPar/3;
  
  Float_t * correctedEnergyList = new Float_t[nDigits*nSplittedClusters];
  //above - temporary table with energies after unfolding.
  //the order is following: 
  //first cluster <first cell - last cell>, 
  //second cluster <first cell - last cell>, etc.
  
  //**************************** sub-part 3.1 *************************************
  //If not the energy from a given cell in the cluster is divided in correct proportions 
  //in accordance to the other clusters and added to them and set to 0.
  
  //  cout<<"unfolding check here part 3.1"<<endl;

  iparam = 0 ;
  while(iparam < nPar )
  {
    xpar = fitparameters[iparam] ;
    zpar = fitparameters[iparam+1] ;
    epar = fitparameters[iparam+2] ;
    
    for(iDigit = 0 ; iDigit < nDigits ; iDigit ++)
    {
      digit = dynamic_cast<AliEMCALDigit*>( fDigitsArr->At( digitsList[iDigit] ) ) ;
      if(digit)
      {
        fGeom->GetCellIndex(digit->GetId(),iSupMod,iTower,iIphi,iIeta); 
        fGeom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,
                                           iIphi, iIeta,iphi,ieta);
        
        EvalParsPhiDependence(digit->GetId(),fGeom);
       
        if(efit[iDigit]==0) 
        {//just for sure
          correctedEnergyList[iparam/3*nDigits+iDigit] = 0.;//correction here
          continue;
        }
        
        ratio = epar * ShowerShapeV2((Float_t)iphi - xpar,(Float_t)ieta - zpar) / efit[iDigit] ;
        eDigit = energiesList[iDigit] * ratio ;
        
        //add energy to temporary matrix
        correctedEnergyList[iparam/3*nDigits+iDigit] = eDigit;
        
      } else AliDebug(1,"NULL digit part 3");
    }//digit loop 
    iparam += 3 ;
  }//while
  
  //**************************** sub-part 3.2 *************************************
  //here we check if energy of the cell in the cluster after unfolding is above threshold. 
  //here we correct energy for each cell and cluster
  //  cout<<"unfolding check here part 3.2"<<endl;


  //here we have 3 possibilities
  //when after UF cell energy in cluster is below threshold:
  //1 - keep it associated to cluster - equivalent of threshold=0
  //2 - default - split (or add) energy of that cell into that cell in the other cluster(s)
  //3 - reject that cell from cluster - fraction energy in cell=0 - breaks energy conservation
  //Bool_t rejectBelowThreshold=kTRUE;//default option = 2 - split = kFALSE

  if(fThreshold > 0){//option 2 or 3
    if(fRejectBelowThreshold){//option 3
      for(iDigit = 0 ; iDigit < nDigits ; iDigit++){//digit loop
	for(iparam = 0 ; iparam < nPar ; iparam+=3){//param0 loop = energy loop
	  if(correctedEnergyList[iparam/3*nDigits+iDigit] < fThreshold ) correctedEnergyList[iparam/3*nDigits+iDigit]=0.;
	}
      }
    }else{//option 2
      Float_t maximumEne=0.;
      Int_t maximumIndex=0;
      Bool_t isAnyBelowThreshold=kFALSE;
      //  Float_t Threshold=0.01;
      Float_t * energyFraction = new Float_t[nSplittedClusters];
      Int_t iparam2 = 0 ;
      for(iDigit = 0 ; iDigit < nDigits ; iDigit++){
	isAnyBelowThreshold=kFALSE;
	maximumEne=0.;
	for(iparam = 0 ; iparam < nPar ; iparam+=3){
	  if(correctedEnergyList[iparam/3*nDigits+iDigit] < fThreshold ) isAnyBelowThreshold = kTRUE;
	  if(correctedEnergyList[iparam/3*nDigits+iDigit] > maximumEne) 
	    {
	      maximumEne = correctedEnergyList[iparam/3*nDigits+iDigit];
	      maximumIndex = iparam;
	    }
	}//end of loop over clusters after unfolding
	
	if(!isAnyBelowThreshold) continue; //no cluster-cell below threshold 
	
	if(maximumEne < fThreshold) 
	  {//add all cluster cells and put energy into max index, other set to 0
	    maximumEne=0.;
	    for(iparam = 0 ; iparam < nPar ; iparam+=3)
	      {
		maximumEne+=correctedEnergyList[iparam/3*nDigits+iDigit];
		correctedEnergyList[iparam/3*nDigits+iDigit]=0;
	      }
	    correctedEnergyList[maximumIndex/3*nDigits+iDigit]=maximumEne;
	    continue;
	  }//end if
	
	//divide energy of cell below threshold in the correct proportion and add to other cells
	maximumEne=0.;//not used any more so use it for the energy sum 
	for(iparam = 0 ; iparam < nPar ; iparam+=3)
	  {//calculate energy sum
	    if(correctedEnergyList[iparam/3*nDigits+iDigit] < fThreshold) energyFraction[iparam/3]=0;
	    else 
	      {
		energyFraction[iparam/3]=1.;
		maximumEne+=correctedEnergyList[iparam/3*nDigits+iDigit];
	      }
	  }//end of loop over clusters after unfolding
	if(maximumEne>0.) {
	  for(iparam = 0 ; iparam < nPar ; iparam+=3){//calculate fraction
	    energyFraction[iparam/3] = energyFraction[iparam/3] * correctedEnergyList[iparam/3*nDigits+iDigit] / maximumEne;
	  }
	  
	  for(iparam = 0 ; iparam < nPar ; iparam+=3)
	    {//add energy from cells below threshold to others
	      if(energyFraction[iparam/3]>0.) continue;
	      else
		{
		  for(iparam2 = 0 ; iparam2 < nPar ; iparam2+=3)
		    {
		      correctedEnergyList[iparam2/3*nDigits+iDigit] += (energyFraction[iparam2/3] * 
									correctedEnergyList[iparam/3*nDigits+iDigit]) ;
		    }//inner loop
		  correctedEnergyList[iparam/3*nDigits+iDigit] = 0.;
		}
	    }
	} else {
	  //digit energy to be set to 0
	  for(iparam = 0 ; iparam < nPar ; iparam+=3)
	    {
	      correctedEnergyList[iparam/3*nDigits+iDigit] = 0.;
	    }
	}//correction for: is energy>0
	
      }//end of loop over digits
      delete[] energyFraction;
      
    }//end of option 2 or 3 
  } else {//option 1
    //do nothing
  }

  
  //**************************** sub-part 3.3 *************************************
  //here we add digits to recpoints with corrected energy
  //  cout<<"unfolding check here part 3.3"<<endl;

  Int_t newClusterIndex=0;
  iparam = 0 ;
  while(iparam < nPar )
  {
    AliEMCALRecPoint * recPoint = 0 ;
    
    if(nSplittedClusters >= list->GetSize())
      list->Expand(nSplittedClusters);
    
    //add recpoint
    (*list)[newClusterIndex] = new AliEMCALRecPoint("") ;
    recPoint = dynamic_cast<AliEMCALRecPoint *>( list->At(newClusterIndex) ) ;
    
    if(recPoint){//recPoint present -> good
      recPoint->SetNExMax(nSplittedClusters) ;//can be wrong number, to be corrected in outer method
      
      for(iDigit = 0 ; iDigit < nDigits ; iDigit ++) {
        digit = dynamic_cast<AliEMCALDigit*>( fDigitsArr->At( digitsList[iDigit] ) ) ;
        if(digit && correctedEnergyList[iparam/3*nDigits+iDigit]>0. ){
          //if(correctedEnergyList[iparam/3*nDigits+iDigit]<fThreshold) printf("Final E cell %f < %f\n",correctedEnergyList[iparam/3*nDigits+iDigit],fThreshold);
          recPoint->AddDigit( *digit, correctedEnergyList[iparam/3*nDigits+iDigit], kFALSE ) ; //FIXME, need to study the shared case
        } else {
          AliDebug(1,Form("NULL digit part3.3 or NULL energy=%f",correctedEnergyList[iparam/3*nDigits+iDigit]));
        }
      }//digit loop

      if(recPoint->GetMultiplicity()==0){//recpoint exists but no digits associated -> remove from list
	delete (*list)[newClusterIndex];
	list->RemoveAt(newClusterIndex);
	nSplittedClusters--;
	newClusterIndex--;//decrease cluster number
      }else {//recPoint exists and has digits associated -> very good increase number of clusters 
	AliDebug(5,Form("cluster %d, digit no %d, energy %f",iparam/3,(recPoint->GetDigitsList())[0],(recPoint->GetEnergiesList())[0]));
      }
      
    } else {//recPoint empty -> remove from list
      AliError("NULL RecPoint");
      //protection from recpoint with no digits
      delete (*list)[newClusterIndex];
      list->RemoveAt(newClusterIndex);
      nSplittedClusters--;
      newClusterIndex--;//decrease cluster number
    }

    iparam += 3 ;
    newClusterIndex++;
  }//while
  
  delete[] fitparameters ;
  delete[] efit ;
  delete[] correctedEnergyList ;

//  print 
  AliDebug(5,Form("  nSplittedClusters %d, fNumberOfECAClusters %d, newClusterIndex %d,list->Entries() %d\n",nSplittedClusters,fNumberOfECAClusters,newClusterIndex,list->GetEntriesFast() ));
  
  //  cout<<"end of unfolding check part 3.3"<<endl;
  return nSplittedClusters;
}

//____________________________________________________________________________
Bool_t AliEMCALUnfolding::UnfoldClusterV2(AliEMCALRecPoint * iniTower, 
					  Int_t nMax, 
					  AliEMCALDigit ** maxAt, 
					  Float_t * maxAtEnergy)
{
  // Extended to whole EMCAL 
  // Performs the unfolding of a cluster with nMax overlapping showers 
  // Returns true if success (1->several clusters), otherwise false (fit failed)

  TObjArray *list =new TObjArray(2);//temporary object
  Int_t nUnfoldedClusters=UnfoldOneCluster(iniTower,nMax,maxAt,maxAtEnergy,list);

  // here we write new clusters from list to fRecPoints 
  AliDebug(5,Form("Number of clusters after unfolding %d",list->GetEntriesFast()));
  Int_t iDigit=0;
  AliEMCALDigit * digit = 0 ;
  for(Int_t i=0;i<list->GetEntriesFast();i++) {
    AliEMCALRecPoint * recPoint = 0 ;
    
    if(fNumberOfECAClusters >= fRecPoints->GetSize())
      fRecPoints->Expand(2*fNumberOfECAClusters) ;
    
    //add recpoint
    (*fRecPoints)[fNumberOfECAClusters] = new AliEMCALRecPoint("") ;//fNumberOfECAClusters-1 is old cluster before unfolding
    recPoint = dynamic_cast<AliEMCALRecPoint *>( fRecPoints->At(fNumberOfECAClusters) ) ;
		AliEMCALRecPoint * rpUFOne = dynamic_cast<AliEMCALRecPoint *>(list->At(i)) ;
		
    if( recPoint && rpUFOne ){//recPoint present -> good
      
			recPoint->SetNExMax(list->GetEntriesFast()) ;
			
      Int_t   *digitsList = rpUFOne->GetDigitsList();
      Float_t *energyList = rpUFOne->GetEnergiesList();

      if(!digitsList || ! energyList)
      {
        AliDebug(-1,"No digits index or energy available");
				delete (*fRecPoints)[fNumberOfECAClusters];
				fRecPoints->RemoveAt(fNumberOfECAClusters);
        continue;
      }
      
      AliDebug(5,Form("cluster %d, digit no %d, energy %f\n",i,digitsList[0],energyList[0]));

      for(iDigit = 0 ; iDigit < rpUFOne->GetMultiplicity(); iDigit ++) {
        digit = dynamic_cast<AliEMCALDigit*>( fDigitsArr->At( digitsList[iDigit] ) ) ;
        if(digit) recPoint->AddDigit( *digit, energyList[iDigit], kFALSE ) ; //FIXME, need to study the shared case
      }//digit loop
      fNumberOfECAClusters++ ; 
    } else {//recPoint empty -> remove from list
      AliError("NULL RecPoint");
      delete (*fRecPoints)[fNumberOfECAClusters];
      fRecPoints->RemoveAt(fNumberOfECAClusters);
    }

  }//loop over unfolded clusters
  
  //print energy of new unfolded clusters
  AliDebug(5,Form("  nUnfoldedClusters %d, fNumberOfECAClusters %d",nUnfoldedClusters,fNumberOfECAClusters ));
  for(Int_t inewclus=0; inewclus<nUnfoldedClusters;inewclus++){
		AliEMCALRecPoint * rp = dynamic_cast<AliEMCALRecPoint *>(fRecPoints->At(fNumberOfECAClusters-1-inewclus));
    if(rp) AliDebug(5,Form("  Unfolded cluster %d E %f",inewclus, rp->GetEnergy() ));
  }

  //clear tables  
  list->SetOwner(kTRUE);
  list->Delete();
  delete list;
  if(nUnfoldedClusters>1) return kTRUE;
  return kFALSE;
}



//____________________________________________________________________________
Bool_t AliEMCALUnfolding::UnfoldClusterV2old(AliEMCALRecPoint * iniTower, 
					  Int_t nMax, 
					  AliEMCALDigit ** maxAt, 
					  Float_t * maxAtEnergy)
{
  // Extended to whole EMCAL 
  // Performs the unfolding of a cluster with nMax overlapping showers 
  
  Int_t nPar = 3 * nMax ;
  Float_t * fitparameters = new Float_t[nPar] ;
  
  if (fGeom==0)
    AliFatal("Did not get geometry from EMCALLoader") ;
  
  Bool_t rv = FindFitV2(iniTower, maxAt, maxAtEnergy, nPar, fitparameters) ;
  if( !rv ) {
    // Fit failed, return (and remove cluster? - why? I leave the cluster)
    iniTower->SetNExMax(-1) ;
    delete[] fitparameters ;
    return kFALSE;
  }
  
  // create unfolded rec points and fill them with new energy lists
  // First calculate energy deposited in each sell in accordance with
  // fit (without fluctuations): efit[]
  // and later correct this number in acordance with actual energy
  // deposition
  
  Int_t nDigits = iniTower->GetMultiplicity() ;
  Float_t * efit = new Float_t[nDigits] ;//new fitted energy in cells
  Float_t xpar=0.,zpar=0.,epar=0.  ;//center of gravity in cell units
  
  AliEMCALDigit * digit = 0 ;
  Int_t * digitsList = iniTower->GetDigitsList() ;
  
  Int_t iSupMod =  0 ;
  Int_t iTower  =  0 ;
  Int_t iIphi   =  0 ;
  Int_t iIeta   =  0 ;
  Int_t iphi    =  0 ;//x direction
  Int_t ieta    =  0 ;//z direstion
  
  Int_t iparam = 0 ;
  Int_t iDigit = 0 ;
  
  for(iDigit = 0 ; iDigit < nDigits ; iDigit ++){
    digit = dynamic_cast<AliEMCALDigit*>( fDigitsArr->At(digitsList[iDigit] ) ) ;
    if(digit){
      fGeom->GetCellIndex(digit->GetId(),iSupMod,iTower,iIphi,iIeta); 
      fGeom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,
                                         iIphi, iIeta,iphi,ieta);
      EvalParsPhiDependence(digit->GetId(),fGeom);
      
      efit[iDigit] = 0.;
      iparam = 0;
      while(iparam < nPar ){
        xpar = fitparameters[iparam] ;
        zpar = fitparameters[iparam+1] ;
        epar = fitparameters[iparam+2] ;
        iparam += 3 ;
        
        efit[iDigit] += epar * ShowerShapeV2((Float_t)iphi - xpar,(Float_t)ieta - zpar) ;
      }
    } else AliError("Digit NULL!");
    
  }//digit loop
  
  // Now create new RecPoints and fill energy lists with efit corrected to fluctuations
  // so that energy deposited in each cell is distributed between new clusters proportionally
  // to its contribution to efit
  
  Float_t * energiesList = iniTower->GetEnergiesList() ;
  Float_t ratio = 0 ;
  
  iparam = 0 ;
  while(iparam < nPar ){
    xpar = fitparameters[iparam] ;
    zpar = fitparameters[iparam+1] ;
    epar = fitparameters[iparam+2] ;
    iparam += 3 ;
    
    AliEMCALRecPoint * recPoint = 0 ;
    
    if(fNumberOfECAClusters >= fRecPoints->GetSize())
      fRecPoints->Expand(2*fNumberOfECAClusters) ;
    
    //add recpoint
    (*fRecPoints)[fNumberOfECAClusters] = new AliEMCALRecPoint("") ;
    recPoint = dynamic_cast<AliEMCALRecPoint *>( fRecPoints->At(fNumberOfECAClusters) ) ;
    
    if(recPoint){
      
      fNumberOfECAClusters++ ;
      recPoint->SetNExMax((Int_t)nPar/3) ;
      
      Float_t eDigit = 0. ;
      for(iDigit = 0 ; iDigit < nDigits ; iDigit ++){
        digit = dynamic_cast<AliEMCALDigit*>( fDigitsArr->At( digitsList[iDigit] ) ) ;
        if(digit){
          fGeom->GetCellIndex(digit->GetId(),iSupMod,iTower,iIphi,iIeta); 
          fGeom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,
                                             iIphi, iIeta,iphi,ieta);
          EvalParsPhiDependence(digit->GetId(),fGeom);
          if(efit[iDigit]==0) continue;//just for sure
          ratio = epar * ShowerShapeV2((Float_t)iphi - xpar,(Float_t)ieta - zpar) / efit[iDigit] ;
          eDigit = energiesList[iDigit] * ratio ;
          recPoint->AddDigit( *digit, eDigit, kFALSE ) ; //FIXME, need to study the shared case
        } else AliError("NULL digit");
      }//digit loop 
    } else AliError("NULL RecPoint");
  }//while
  
  delete[] fitparameters ;
  delete[] efit ;
  
  return kTRUE;
}


//____________________________________________________________________________
Bool_t AliEMCALUnfolding::FindFitV2(AliEMCALRecPoint * recPoint, AliEMCALDigit ** maxAt, 
					const Float_t* maxAtEnergy,
					Int_t nPar, Float_t * fitparameters) const
{
  // Calls TMinuit to fit the energy distribution of a cluster with several maxima
  // The initial values for fitting procedure are set equal to the
  // positions of local maxima.       
  // Cluster will be fitted as a superposition of nPar/3
  // electromagnetic showers

  if (fGeom==0) AliFatal("Did not get geometry from EMCALLoader");
	
  if(!gMinuit){
    //    gMinuit = new TMinuit(100) ;//max 100 parameters
    if(nPar<30) gMinuit = new TMinuit(30);
    else gMinuit = new TMinuit(nPar) ;//max nPar parameters
    //
  } else {
    if(gMinuit->fMaxpar < nPar) {
      delete gMinuit;
      gMinuit = new TMinuit(nPar);
    }
  }

  gMinuit->mncler();                     // Reset Minuit's list of paramters
  gMinuit->SetPrintLevel(-1) ;           // No Printout
  gMinuit->SetFCN(AliEMCALUnfolding::UnfoldingChiSquareV2) ;
  // To set the address of the minimization function
  TList * toMinuit = new TList();
  toMinuit->AddAt(recPoint,0) ;
  toMinuit->AddAt(fDigitsArr,1) ;
  toMinuit->AddAt(fGeom,2) ;

  gMinuit->SetObjectFit(toMinuit) ;         // To tranfer pointer to UnfoldingChiSquare

  // filling initial values for fit parameters
  AliEMCALDigit * digit ;

  Int_t ierflg  = 0;
  Int_t index   = 0 ;
  Int_t nDigits = (Int_t) nPar / 3 ;

  Int_t iDigit ;

  Int_t iSupMod =  0 ;
  Int_t iTower  =  0 ;
  Int_t iIphi   =  0 ;
  Int_t iIeta   =  0 ;
  Int_t iphi    =  0 ;//x direction
  Int_t ieta    =  0 ;//z direstion

  for(iDigit = 0; iDigit < nDigits; iDigit++)
  {
    digit = maxAt[iDigit];
    if(!digit)
    {
      AliError("Null digit pointer");
      continue;
    }
    
    fGeom->GetCellIndex(digit->GetId(),iSupMod,iTower,iIphi,iIeta);
    fGeom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,
				       iIphi, iIeta,iphi,ieta);

    Float_t energy = maxAtEnergy[iDigit] ;

    //gMinuit->mnparm(index, "x",  iphi, 0.1, 0, 0, ierflg) ;//original
    gMinuit->mnparm(index, "x",  iphi, 0.05, 0, 0, ierflg) ;
    index++ ;
    if(ierflg != 0){
      Error("FindFit", "EMCAL Unfolding unable to set initial value for fit procedure: x=%d, param.id=%d, nMaxima=%d",iphi,index-1,nPar/3 ) ;
      toMinuit->Clear();
      delete toMinuit ;
      return kFALSE;
    }
    //gMinuit->mnparm(index, "z",  ieta, 0.1, 0, 0, ierflg) ;//original
    gMinuit->mnparm(index, "z",  ieta, 0.05, 0, 0, ierflg) ;
    index++ ;
    if(ierflg != 0){
      Error("FindFit", "EMCAL Unfolding unable to set initial value for fit procedure: z=%d, param.id=%d, nMaxima=%d", ieta, index-1,nPar/3) ;
      toMinuit->Clear();
      delete toMinuit ;
      return kFALSE;
    }
    //gMinuit->mnparm(index, "Energy",  energy , 0.05*energy, 0., 4.*energy, ierflg) ;//original
    gMinuit->mnparm(index, "Energy",  energy , 0.001*energy, 0., 5.*energy, ierflg) ;//was 0.05
    index++ ;
    if(ierflg != 0){
      Error("FindFit", "EMCAL Unfolding unable to set initial value for fit procedure: energy = %f, param.id=%d, nMaxima=%d", energy, index-1, nPar/3) ;
      toMinuit->Clear();
      delete toMinuit ;
      return kFALSE;
    }
  }

  Double_t p0 = 0.1 ; // "Tolerance" Evaluation stops when EDM = 0.0001*p0 ; 
                      // The number of function call slightly depends on it.
  //  Double_t p1 = 1.0 ;// par to gradient 
  Double_t p2 = 0.0 ;
  //  Double_t p3 = 3.0 ;
  gMinuit->mnexcm("SET STR", &p2, 0, ierflg) ;   // force TMinuit to reduce function calls
  //  gMinuit->mnexcm("SET GRA", &p1, 1, ierflg) ;   // force TMinuit to use my gradient
  gMinuit->SetMaxIterations(5);//was 5
  gMinuit->mnexcm("SET NOW", &p2 , 0, ierflg) ;  // No Warnings
  //gMinuit->mnexcm("SET PRI", &p3 , 3, ierflg) ;  // printouts

  gMinuit->mnexcm("MIGRAD", &p0, 0, ierflg) ;    // minimize
  //gMinuit->mnexcm("MINI", &p0, 0, ierflg) ;    // minimize
  if(ierflg == 4){  // Minimum not found
    AliDebug(1,"EMCAL Unfolding  Fit not converged, cluster abandoned " ) ;
    toMinuit->Clear();
    delete toMinuit ;
    return kFALSE ;
  }
  for(index = 0; index < nPar; index++){
    Double_t err = 0. ;
    Double_t val = 0. ;
    gMinuit->GetParameter(index, val, err) ;    // Returns value and error ofOA parameter index
    fitparameters[index] = val ;
  }

  toMinuit->Clear();
  delete toMinuit ;

  if(gMinuit->fMaxpar>30) delete gMinuit;

  return kTRUE;

}

//____________________________________________________________________________
Double_t  AliEMCALUnfolding::ShowerShapeV2(Double_t x, Double_t y)
{ 
  // extended to whole EMCAL 
  // Shape of the shower
  // If you change this function, change also the gradient evaluation in ChiSquare()

  Double_t r = fgSSPars[7]*TMath::Sqrt(x*x+y*y);
  Double_t rp1  = TMath::Power(r, fgSSPars[1]) ;
  Double_t rp5  = TMath::Power(r, fgSSPars[5]) ;
  Double_t shape = fgSSPars[0]*TMath::Exp( -rp1 * (1. / (fgSSPars[2] + fgSSPars[3] * rp1) + fgSSPars[4] / (1 + fgSSPars[6] * rp5) ) ) ;
  return shape ;
}

//____________________________________________________________________________
void AliEMCALUnfolding::UnfoldingChiSquareV2(Int_t & nPar, Double_t * Grad,
					     Double_t & fret,
					     Double_t * x, Int_t iflag)
{
  // Calculates the Chi square for the cluster unfolding minimization
  // Number of parameters, Gradient, Chi squared, parameters, what to do
  
  TList * toMinuit = dynamic_cast<TList*>( gMinuit->GetObjectFit() ) ;
  if(toMinuit){
    AliEMCALRecPoint * recPoint = dynamic_cast<AliEMCALRecPoint*>( toMinuit->At(0) )  ;
    TClonesArray * digits = dynamic_cast<TClonesArray*>( toMinuit->At(1) )  ;
    // A bit buggy way to get an access to the geometry
    // To be revised!
    AliEMCALGeometry *geom = dynamic_cast<AliEMCALGeometry *>(toMinuit->At(2));
    
    if(recPoint && digits && geom){
      
      Int_t * digitsList     = recPoint->GetDigitsList() ;
      
      Int_t nOdigits = recPoint->GetDigitsMultiplicity() ;
      
      Float_t * energiesList = recPoint->GetEnergiesList() ;
      
      fret = 0. ;
      Int_t iparam = 0 ;
      
      if(iflag == 2)
        for(iparam = 0 ; iparam < nPar ; iparam++)
          Grad[iparam] = 0 ; // Will evaluate gradient
      
      Double_t efit = 0. ;
      
      AliEMCALDigit * digit ;
      Int_t iDigit ;
      
      Int_t iSupMod =  0 ;
      Int_t iTower  =  0 ;
      Int_t iIphi   =  0 ;
      Int_t iIeta   =  0 ;
      Int_t iphi    =  0 ;//x direction
      Int_t ieta    =  0 ;//z direstion
      
      
      for( iDigit = 0 ; iDigit < nOdigits ; iDigit++) {
        if(energiesList[iDigit]==0) continue;
        
        digit = dynamic_cast<AliEMCALDigit*>( digits->At( digitsList[iDigit] ) );
        
        if(digit){
	  geom->GetCellIndex(digit->GetId(),iSupMod,iTower,iIphi,iIeta); 
	  geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,
					    iIphi, iIeta,iphi,ieta);
	  EvalParsPhiDependence(digit->GetId(),geom);
	  
	  if(iflag == 2){  // calculate gradient
	    Int_t iParam = 0 ;
	    efit = 0. ;
	    while(iParam < nPar ){
	      Double_t dx = ((Float_t)iphi - x[iParam]) ;
	      iParam++ ;
	      Double_t dz = ((Float_t)ieta - x[iParam]) ;
	      iParam++ ;
	      efit += x[iParam] * ShowerShapeV2(dx,dz) ;
	      iParam++ ;
	    }
	    
	    Double_t sum = 2. * (efit - energiesList[iDigit]) / energiesList[iDigit] ; // Here we assume, that sigma = sqrt(E)
	    iParam = 0 ;
	    while(iParam < nPar ){
	      Double_t xpar = x[iParam] ;
	      Double_t zpar = x[iParam+1] ;
	      Double_t epar = x[iParam+2] ;
	      
	      Double_t dr = fgSSPars[7]*TMath::Sqrt( ((Float_t)iphi - xpar) * ((Float_t)iphi - xpar) + ((Float_t)ieta - zpar) * ((Float_t)ieta - zpar) );
	      Double_t shape = sum * ShowerShapeV2((Float_t)iphi - xpar,(Float_t)ieta - zpar) ;
	      Double_t rp1  = TMath::Power(dr, fgSSPars[1]) ;
	      Double_t rp5  = TMath::Power(dr, fgSSPars[5]) ;
	      
	      Double_t deriv = -2 * TMath::Power(dr,fgSSPars[1]-2.) * fgSSPars[7] * fgSSPars[7] * 
		(fgSSPars[1] * ( 1/(fgSSPars[2]+fgSSPars[3]*rp1) + fgSSPars[4]/(1+fgSSPars[6]*rp5) ) - 
		 (fgSSPars[1]*fgSSPars[3]*rp1/( (fgSSPars[2]+fgSSPars[3]*rp1)*(fgSSPars[2]+fgSSPars[3]*rp1) ) + 
		  fgSSPars[4]*fgSSPars[5]*fgSSPars[6]*rp5/( (1+fgSSPars[6]*rp5)*(1+fgSSPars[6]*rp5) ) ) );
	      
	      //Double_t deriv =-1.33 * TMath::Power(dr,0.33)*dr * ( 1.57 / ( (1.57 + 0.0860 * r133) * (1.57 + 0.0860 * r133) )
	      //                                                   - 0.55 / (1 + 0.000563 * r669) / ( (1 + 0.000563 * r669) * (1 + 0.000563 * r669) ) ) ;
	      
	      Grad[iParam] += epar * shape * deriv * ((Float_t)iphi - xpar) ;  // Derivative over x
	      iParam++ ;
	      Grad[iParam] += epar * shape * deriv * ((Float_t)ieta - zpar) ;  // Derivative over z
	      iParam++ ;
	      Grad[iParam] += shape ;                                  // Derivative over energy
	      iParam++ ;
	    }
	  }
	  efit = 0;
	  iparam = 0 ;
	  
	  while(iparam < nPar ){
	    Double_t xpar = x[iparam] ;
	    Double_t zpar = x[iparam+1] ;
	    Double_t epar = x[iparam+2] ;
	    iparam += 3 ;
	    efit += epar * ShowerShapeV2((Float_t)iphi - xpar,(Float_t)ieta - zpar) ;
	  }
	  
	  fret += (efit-energiesList[iDigit])*(efit-energiesList[iDigit])/energiesList[iDigit] ;
	  // Here we assume, that sigma = sqrt(E) 
        } else printf("AliEMCALUnfoding::UnfoldingChiSquareV2 - NULL digit!, nPar %d \n", nPar); // put nPar here to cheat coverity and rule checker
      } // digit loop
    } // recpoint, digits and geom not NULL
  }// List is not NULL
  
}


//____________________________________________________________________________
void AliEMCALUnfolding::SetShowerShapeParams(Double_t *pars){
  for(UInt_t i=0;i<7;++i)
    fgSSPars[i]=pars[i];
  if(pars[2]==0. && pars[3]==0.) fgSSPars[2]=1.;//to avoid dividing by 0
}

//____________________________________________________________________________
void AliEMCALUnfolding::SetPar5(Double_t *pars){
  for(UInt_t i=0;i<3;++i)
    fgPar5[i]=pars[i];
}

//____________________________________________________________________________
void AliEMCALUnfolding::SetPar6(Double_t *pars){
  for(UInt_t i=0;i<3;++i)
    fgPar6[i]=pars[i];
}

//____________________________________________________________________________
void AliEMCALUnfolding::EvalPar5(Double_t phi){
  //
  //Evaluate the 5th parameter of the shower shape function
  //phi in degrees range (-10,10)
  //
  //fSSPars[5] = 12.31 - phi*0.007381 - phi*phi*0.06936;
  fgSSPars[5] = fgPar5[0] + phi * fgPar5[1] + phi*phi * fgPar5[2];
}

//____________________________________________________________________________
void AliEMCALUnfolding::EvalPar6(Double_t phi){
  //
  //Evaluate the 6th parameter of the shower shape function
  //phi in degrees range (-10,10)
  //
  //fSSPars[6] = 0.05452 + phi*0.0001228 + phi*phi*0.001361;
  fgSSPars[6] = fgPar6[0] + phi * fgPar6[1] + phi*phi * fgPar6[2];
}

//____________________________________________________________________________
void AliEMCALUnfolding::EvalParsPhiDependence(Int_t absId, const AliEMCALGeometry *geom){
  //
  // calculate params p5 and p6 depending on the phi angle in global coordinate
  // for the cell with given absId index
  //
  Double_t etaGlob = 0.;//eta in global c.s. - unused
  Double_t phiGlob = 0.;//phi in global c.s. in radians
  geom->EtaPhiFromIndex(absId, etaGlob, phiGlob);
  phiGlob*=180./TMath::Pi();
  phiGlob-=90.;
  phiGlob-= (Double_t)((Int_t)geom->GetSuperModuleNumber(absId)/2 * 20);

  EvalPar5(phiGlob);
  EvalPar6(phiGlob);
}

 AliEMCALUnfolding.cxx:1
 AliEMCALUnfolding.cxx:2
 AliEMCALUnfolding.cxx:3
 AliEMCALUnfolding.cxx:4
 AliEMCALUnfolding.cxx:5
 AliEMCALUnfolding.cxx:6
 AliEMCALUnfolding.cxx:7
 AliEMCALUnfolding.cxx:8
 AliEMCALUnfolding.cxx:9
 AliEMCALUnfolding.cxx:10
 AliEMCALUnfolding.cxx:11
 AliEMCALUnfolding.cxx:12
 AliEMCALUnfolding.cxx:13
 AliEMCALUnfolding.cxx:14
 AliEMCALUnfolding.cxx:15
 AliEMCALUnfolding.cxx:16
 AliEMCALUnfolding.cxx:17
 AliEMCALUnfolding.cxx:18
 AliEMCALUnfolding.cxx:19
 AliEMCALUnfolding.cxx:20
 AliEMCALUnfolding.cxx:21
 AliEMCALUnfolding.cxx:22
 AliEMCALUnfolding.cxx:23
 AliEMCALUnfolding.cxx:24
 AliEMCALUnfolding.cxx:25
 AliEMCALUnfolding.cxx:26
 AliEMCALUnfolding.cxx:27
 AliEMCALUnfolding.cxx:28
 AliEMCALUnfolding.cxx:29
 AliEMCALUnfolding.cxx:30
 AliEMCALUnfolding.cxx:31
 AliEMCALUnfolding.cxx:32
 AliEMCALUnfolding.cxx:33
 AliEMCALUnfolding.cxx:34
 AliEMCALUnfolding.cxx:35
 AliEMCALUnfolding.cxx:36
 AliEMCALUnfolding.cxx:37
 AliEMCALUnfolding.cxx:38
 AliEMCALUnfolding.cxx:39
 AliEMCALUnfolding.cxx:40
 AliEMCALUnfolding.cxx:41
 AliEMCALUnfolding.cxx:42
 AliEMCALUnfolding.cxx:43
 AliEMCALUnfolding.cxx:44
 AliEMCALUnfolding.cxx:45
 AliEMCALUnfolding.cxx:46
 AliEMCALUnfolding.cxx:47
 AliEMCALUnfolding.cxx:48
 AliEMCALUnfolding.cxx:49
 AliEMCALUnfolding.cxx:50
 AliEMCALUnfolding.cxx:51
 AliEMCALUnfolding.cxx:52
 AliEMCALUnfolding.cxx:53
 AliEMCALUnfolding.cxx:54
 AliEMCALUnfolding.cxx:55
 AliEMCALUnfolding.cxx:56
 AliEMCALUnfolding.cxx:57
 AliEMCALUnfolding.cxx:58
 AliEMCALUnfolding.cxx:59
 AliEMCALUnfolding.cxx:60
 AliEMCALUnfolding.cxx:61
 AliEMCALUnfolding.cxx:62
 AliEMCALUnfolding.cxx:63
 AliEMCALUnfolding.cxx:64
 AliEMCALUnfolding.cxx:65
 AliEMCALUnfolding.cxx:66
 AliEMCALUnfolding.cxx:67
 AliEMCALUnfolding.cxx:68
 AliEMCALUnfolding.cxx:69
 AliEMCALUnfolding.cxx:70
 AliEMCALUnfolding.cxx:71
 AliEMCALUnfolding.cxx:72
 AliEMCALUnfolding.cxx:73
 AliEMCALUnfolding.cxx:74
 AliEMCALUnfolding.cxx:75
 AliEMCALUnfolding.cxx:76
 AliEMCALUnfolding.cxx:77
 AliEMCALUnfolding.cxx:78
 AliEMCALUnfolding.cxx:79
 AliEMCALUnfolding.cxx:80
 AliEMCALUnfolding.cxx:81
 AliEMCALUnfolding.cxx:82
 AliEMCALUnfolding.cxx:83
 AliEMCALUnfolding.cxx:84
 AliEMCALUnfolding.cxx:85
 AliEMCALUnfolding.cxx:86
 AliEMCALUnfolding.cxx:87
 AliEMCALUnfolding.cxx:88
 AliEMCALUnfolding.cxx:89
 AliEMCALUnfolding.cxx:90
 AliEMCALUnfolding.cxx:91
 AliEMCALUnfolding.cxx:92
 AliEMCALUnfolding.cxx:93
 AliEMCALUnfolding.cxx:94
 AliEMCALUnfolding.cxx:95
 AliEMCALUnfolding.cxx:96
 AliEMCALUnfolding.cxx:97
 AliEMCALUnfolding.cxx:98
 AliEMCALUnfolding.cxx:99
 AliEMCALUnfolding.cxx:100
 AliEMCALUnfolding.cxx:101
 AliEMCALUnfolding.cxx:102
 AliEMCALUnfolding.cxx:103
 AliEMCALUnfolding.cxx:104
 AliEMCALUnfolding.cxx:105
 AliEMCALUnfolding.cxx:106
 AliEMCALUnfolding.cxx:107
 AliEMCALUnfolding.cxx:108
 AliEMCALUnfolding.cxx:109
 AliEMCALUnfolding.cxx:110
 AliEMCALUnfolding.cxx:111
 AliEMCALUnfolding.cxx:112
 AliEMCALUnfolding.cxx:113
 AliEMCALUnfolding.cxx:114
 AliEMCALUnfolding.cxx:115
 AliEMCALUnfolding.cxx:116
 AliEMCALUnfolding.cxx:117
 AliEMCALUnfolding.cxx:118
 AliEMCALUnfolding.cxx:119
 AliEMCALUnfolding.cxx:120
 AliEMCALUnfolding.cxx:121
 AliEMCALUnfolding.cxx:122
 AliEMCALUnfolding.cxx:123
 AliEMCALUnfolding.cxx:124
 AliEMCALUnfolding.cxx:125
 AliEMCALUnfolding.cxx:126
 AliEMCALUnfolding.cxx:127
 AliEMCALUnfolding.cxx:128
 AliEMCALUnfolding.cxx:129
 AliEMCALUnfolding.cxx:130
 AliEMCALUnfolding.cxx:131
 AliEMCALUnfolding.cxx:132
 AliEMCALUnfolding.cxx:133
 AliEMCALUnfolding.cxx:134
 AliEMCALUnfolding.cxx:135
 AliEMCALUnfolding.cxx:136
 AliEMCALUnfolding.cxx:137
 AliEMCALUnfolding.cxx:138
 AliEMCALUnfolding.cxx:139
 AliEMCALUnfolding.cxx:140
 AliEMCALUnfolding.cxx:141
 AliEMCALUnfolding.cxx:142
 AliEMCALUnfolding.cxx:143
 AliEMCALUnfolding.cxx:144
 AliEMCALUnfolding.cxx:145
 AliEMCALUnfolding.cxx:146
 AliEMCALUnfolding.cxx:147
 AliEMCALUnfolding.cxx:148
 AliEMCALUnfolding.cxx:149
 AliEMCALUnfolding.cxx:150
 AliEMCALUnfolding.cxx:151
 AliEMCALUnfolding.cxx:152
 AliEMCALUnfolding.cxx:153
 AliEMCALUnfolding.cxx:154
 AliEMCALUnfolding.cxx:155
 AliEMCALUnfolding.cxx:156
 AliEMCALUnfolding.cxx:157
 AliEMCALUnfolding.cxx:158
 AliEMCALUnfolding.cxx:159
 AliEMCALUnfolding.cxx:160
 AliEMCALUnfolding.cxx:161
 AliEMCALUnfolding.cxx:162
 AliEMCALUnfolding.cxx:163
 AliEMCALUnfolding.cxx:164
 AliEMCALUnfolding.cxx:165
 AliEMCALUnfolding.cxx:166
 AliEMCALUnfolding.cxx:167
 AliEMCALUnfolding.cxx:168
 AliEMCALUnfolding.cxx:169
 AliEMCALUnfolding.cxx:170
 AliEMCALUnfolding.cxx:171
 AliEMCALUnfolding.cxx:172
 AliEMCALUnfolding.cxx:173
 AliEMCALUnfolding.cxx:174
 AliEMCALUnfolding.cxx:175
 AliEMCALUnfolding.cxx:176
 AliEMCALUnfolding.cxx:177
 AliEMCALUnfolding.cxx:178
 AliEMCALUnfolding.cxx:179
 AliEMCALUnfolding.cxx:180
 AliEMCALUnfolding.cxx:181
 AliEMCALUnfolding.cxx:182
 AliEMCALUnfolding.cxx:183
 AliEMCALUnfolding.cxx:184
 AliEMCALUnfolding.cxx:185
 AliEMCALUnfolding.cxx:186
 AliEMCALUnfolding.cxx:187
 AliEMCALUnfolding.cxx:188
 AliEMCALUnfolding.cxx:189
 AliEMCALUnfolding.cxx:190
 AliEMCALUnfolding.cxx:191
 AliEMCALUnfolding.cxx:192
 AliEMCALUnfolding.cxx:193
 AliEMCALUnfolding.cxx:194
 AliEMCALUnfolding.cxx:195
 AliEMCALUnfolding.cxx:196
 AliEMCALUnfolding.cxx:197
 AliEMCALUnfolding.cxx:198
 AliEMCALUnfolding.cxx:199
 AliEMCALUnfolding.cxx:200
 AliEMCALUnfolding.cxx:201
 AliEMCALUnfolding.cxx:202
 AliEMCALUnfolding.cxx:203
 AliEMCALUnfolding.cxx:204
 AliEMCALUnfolding.cxx:205
 AliEMCALUnfolding.cxx:206
 AliEMCALUnfolding.cxx:207
 AliEMCALUnfolding.cxx:208
 AliEMCALUnfolding.cxx:209
 AliEMCALUnfolding.cxx:210
 AliEMCALUnfolding.cxx:211
 AliEMCALUnfolding.cxx:212
 AliEMCALUnfolding.cxx:213
 AliEMCALUnfolding.cxx:214
 AliEMCALUnfolding.cxx:215
 AliEMCALUnfolding.cxx:216
 AliEMCALUnfolding.cxx:217
 AliEMCALUnfolding.cxx:218
 AliEMCALUnfolding.cxx:219
 AliEMCALUnfolding.cxx:220
 AliEMCALUnfolding.cxx:221
 AliEMCALUnfolding.cxx:222
 AliEMCALUnfolding.cxx:223
 AliEMCALUnfolding.cxx:224
 AliEMCALUnfolding.cxx:225
 AliEMCALUnfolding.cxx:226
 AliEMCALUnfolding.cxx:227
 AliEMCALUnfolding.cxx:228
 AliEMCALUnfolding.cxx:229
 AliEMCALUnfolding.cxx:230
 AliEMCALUnfolding.cxx:231
 AliEMCALUnfolding.cxx:232
 AliEMCALUnfolding.cxx:233
 AliEMCALUnfolding.cxx:234
 AliEMCALUnfolding.cxx:235
 AliEMCALUnfolding.cxx:236
 AliEMCALUnfolding.cxx:237
 AliEMCALUnfolding.cxx:238
 AliEMCALUnfolding.cxx:239
 AliEMCALUnfolding.cxx:240
 AliEMCALUnfolding.cxx:241
 AliEMCALUnfolding.cxx:242
 AliEMCALUnfolding.cxx:243
 AliEMCALUnfolding.cxx:244
 AliEMCALUnfolding.cxx:245
 AliEMCALUnfolding.cxx:246
 AliEMCALUnfolding.cxx:247
 AliEMCALUnfolding.cxx:248
 AliEMCALUnfolding.cxx:249
 AliEMCALUnfolding.cxx:250
 AliEMCALUnfolding.cxx:251
 AliEMCALUnfolding.cxx:252
 AliEMCALUnfolding.cxx:253
 AliEMCALUnfolding.cxx:254
 AliEMCALUnfolding.cxx:255
 AliEMCALUnfolding.cxx:256
 AliEMCALUnfolding.cxx:257
 AliEMCALUnfolding.cxx:258
 AliEMCALUnfolding.cxx:259
 AliEMCALUnfolding.cxx:260
 AliEMCALUnfolding.cxx:261
 AliEMCALUnfolding.cxx:262
 AliEMCALUnfolding.cxx:263
 AliEMCALUnfolding.cxx:264
 AliEMCALUnfolding.cxx:265
 AliEMCALUnfolding.cxx:266
 AliEMCALUnfolding.cxx:267
 AliEMCALUnfolding.cxx:268
 AliEMCALUnfolding.cxx:269
 AliEMCALUnfolding.cxx:270
 AliEMCALUnfolding.cxx:271
 AliEMCALUnfolding.cxx:272
 AliEMCALUnfolding.cxx:273
 AliEMCALUnfolding.cxx:274
 AliEMCALUnfolding.cxx:275
 AliEMCALUnfolding.cxx:276
 AliEMCALUnfolding.cxx:277
 AliEMCALUnfolding.cxx:278
 AliEMCALUnfolding.cxx:279
 AliEMCALUnfolding.cxx:280
 AliEMCALUnfolding.cxx:281
 AliEMCALUnfolding.cxx:282
 AliEMCALUnfolding.cxx:283
 AliEMCALUnfolding.cxx:284
 AliEMCALUnfolding.cxx:285
 AliEMCALUnfolding.cxx:286
 AliEMCALUnfolding.cxx:287
 AliEMCALUnfolding.cxx:288
 AliEMCALUnfolding.cxx:289
 AliEMCALUnfolding.cxx:290
 AliEMCALUnfolding.cxx:291
 AliEMCALUnfolding.cxx:292
 AliEMCALUnfolding.cxx:293
 AliEMCALUnfolding.cxx:294
 AliEMCALUnfolding.cxx:295
 AliEMCALUnfolding.cxx:296
 AliEMCALUnfolding.cxx:297
 AliEMCALUnfolding.cxx:298
 AliEMCALUnfolding.cxx:299
 AliEMCALUnfolding.cxx:300
 AliEMCALUnfolding.cxx:301
 AliEMCALUnfolding.cxx:302
 AliEMCALUnfolding.cxx:303
 AliEMCALUnfolding.cxx:304
 AliEMCALUnfolding.cxx:305
 AliEMCALUnfolding.cxx:306
 AliEMCALUnfolding.cxx:307
 AliEMCALUnfolding.cxx:308
 AliEMCALUnfolding.cxx:309
 AliEMCALUnfolding.cxx:310
 AliEMCALUnfolding.cxx:311
 AliEMCALUnfolding.cxx:312
 AliEMCALUnfolding.cxx:313
 AliEMCALUnfolding.cxx:314
 AliEMCALUnfolding.cxx:315
 AliEMCALUnfolding.cxx:316
 AliEMCALUnfolding.cxx:317
 AliEMCALUnfolding.cxx:318
 AliEMCALUnfolding.cxx:319
 AliEMCALUnfolding.cxx:320
 AliEMCALUnfolding.cxx:321
 AliEMCALUnfolding.cxx:322
 AliEMCALUnfolding.cxx:323
 AliEMCALUnfolding.cxx:324
 AliEMCALUnfolding.cxx:325
 AliEMCALUnfolding.cxx:326
 AliEMCALUnfolding.cxx:327
 AliEMCALUnfolding.cxx:328
 AliEMCALUnfolding.cxx:329
 AliEMCALUnfolding.cxx:330
 AliEMCALUnfolding.cxx:331
 AliEMCALUnfolding.cxx:332
 AliEMCALUnfolding.cxx:333
 AliEMCALUnfolding.cxx:334
 AliEMCALUnfolding.cxx:335
 AliEMCALUnfolding.cxx:336
 AliEMCALUnfolding.cxx:337
 AliEMCALUnfolding.cxx:338
 AliEMCALUnfolding.cxx:339
 AliEMCALUnfolding.cxx:340
 AliEMCALUnfolding.cxx:341
 AliEMCALUnfolding.cxx:342
 AliEMCALUnfolding.cxx:343
 AliEMCALUnfolding.cxx:344
 AliEMCALUnfolding.cxx:345
 AliEMCALUnfolding.cxx:346
 AliEMCALUnfolding.cxx:347
 AliEMCALUnfolding.cxx:348
 AliEMCALUnfolding.cxx:349
 AliEMCALUnfolding.cxx:350
 AliEMCALUnfolding.cxx:351
 AliEMCALUnfolding.cxx:352
 AliEMCALUnfolding.cxx:353
 AliEMCALUnfolding.cxx:354
 AliEMCALUnfolding.cxx:355
 AliEMCALUnfolding.cxx:356
 AliEMCALUnfolding.cxx:357
 AliEMCALUnfolding.cxx:358
 AliEMCALUnfolding.cxx:359
 AliEMCALUnfolding.cxx:360
 AliEMCALUnfolding.cxx:361
 AliEMCALUnfolding.cxx:362
 AliEMCALUnfolding.cxx:363
 AliEMCALUnfolding.cxx:364
 AliEMCALUnfolding.cxx:365
 AliEMCALUnfolding.cxx:366
 AliEMCALUnfolding.cxx:367
 AliEMCALUnfolding.cxx:368
 AliEMCALUnfolding.cxx:369
 AliEMCALUnfolding.cxx:370
 AliEMCALUnfolding.cxx:371
 AliEMCALUnfolding.cxx:372
 AliEMCALUnfolding.cxx:373
 AliEMCALUnfolding.cxx:374
 AliEMCALUnfolding.cxx:375
 AliEMCALUnfolding.cxx:376
 AliEMCALUnfolding.cxx:377
 AliEMCALUnfolding.cxx:378
 AliEMCALUnfolding.cxx:379
 AliEMCALUnfolding.cxx:380
 AliEMCALUnfolding.cxx:381
 AliEMCALUnfolding.cxx:382
 AliEMCALUnfolding.cxx:383
 AliEMCALUnfolding.cxx:384
 AliEMCALUnfolding.cxx:385
 AliEMCALUnfolding.cxx:386
 AliEMCALUnfolding.cxx:387
 AliEMCALUnfolding.cxx:388
 AliEMCALUnfolding.cxx:389
 AliEMCALUnfolding.cxx:390
 AliEMCALUnfolding.cxx:391
 AliEMCALUnfolding.cxx:392
 AliEMCALUnfolding.cxx:393
 AliEMCALUnfolding.cxx:394
 AliEMCALUnfolding.cxx:395
 AliEMCALUnfolding.cxx:396
 AliEMCALUnfolding.cxx:397
 AliEMCALUnfolding.cxx:398
 AliEMCALUnfolding.cxx:399
 AliEMCALUnfolding.cxx:400
 AliEMCALUnfolding.cxx:401
 AliEMCALUnfolding.cxx:402
 AliEMCALUnfolding.cxx:403
 AliEMCALUnfolding.cxx:404
 AliEMCALUnfolding.cxx:405
 AliEMCALUnfolding.cxx:406
 AliEMCALUnfolding.cxx:407
 AliEMCALUnfolding.cxx:408
 AliEMCALUnfolding.cxx:409
 AliEMCALUnfolding.cxx:410
 AliEMCALUnfolding.cxx:411
 AliEMCALUnfolding.cxx:412
 AliEMCALUnfolding.cxx:413
 AliEMCALUnfolding.cxx:414
 AliEMCALUnfolding.cxx:415
 AliEMCALUnfolding.cxx:416
 AliEMCALUnfolding.cxx:417
 AliEMCALUnfolding.cxx:418
 AliEMCALUnfolding.cxx:419
 AliEMCALUnfolding.cxx:420
 AliEMCALUnfolding.cxx:421
 AliEMCALUnfolding.cxx:422
 AliEMCALUnfolding.cxx:423
 AliEMCALUnfolding.cxx:424
 AliEMCALUnfolding.cxx:425
 AliEMCALUnfolding.cxx:426
 AliEMCALUnfolding.cxx:427
 AliEMCALUnfolding.cxx:428
 AliEMCALUnfolding.cxx:429
 AliEMCALUnfolding.cxx:430
 AliEMCALUnfolding.cxx:431
 AliEMCALUnfolding.cxx:432
 AliEMCALUnfolding.cxx:433
 AliEMCALUnfolding.cxx:434
 AliEMCALUnfolding.cxx:435
 AliEMCALUnfolding.cxx:436
 AliEMCALUnfolding.cxx:437
 AliEMCALUnfolding.cxx:438
 AliEMCALUnfolding.cxx:439
 AliEMCALUnfolding.cxx:440
 AliEMCALUnfolding.cxx:441
 AliEMCALUnfolding.cxx:442
 AliEMCALUnfolding.cxx:443
 AliEMCALUnfolding.cxx:444
 AliEMCALUnfolding.cxx:445
 AliEMCALUnfolding.cxx:446
 AliEMCALUnfolding.cxx:447
 AliEMCALUnfolding.cxx:448
 AliEMCALUnfolding.cxx:449
 AliEMCALUnfolding.cxx:450
 AliEMCALUnfolding.cxx:451
 AliEMCALUnfolding.cxx:452
 AliEMCALUnfolding.cxx:453
 AliEMCALUnfolding.cxx:454
 AliEMCALUnfolding.cxx:455
 AliEMCALUnfolding.cxx:456
 AliEMCALUnfolding.cxx:457
 AliEMCALUnfolding.cxx:458
 AliEMCALUnfolding.cxx:459
 AliEMCALUnfolding.cxx:460
 AliEMCALUnfolding.cxx:461
 AliEMCALUnfolding.cxx:462
 AliEMCALUnfolding.cxx:463
 AliEMCALUnfolding.cxx:464
 AliEMCALUnfolding.cxx:465
 AliEMCALUnfolding.cxx:466
 AliEMCALUnfolding.cxx:467
 AliEMCALUnfolding.cxx:468
 AliEMCALUnfolding.cxx:469
 AliEMCALUnfolding.cxx:470
 AliEMCALUnfolding.cxx:471
 AliEMCALUnfolding.cxx:472
 AliEMCALUnfolding.cxx:473
 AliEMCALUnfolding.cxx:474
 AliEMCALUnfolding.cxx:475
 AliEMCALUnfolding.cxx:476
 AliEMCALUnfolding.cxx:477
 AliEMCALUnfolding.cxx:478
 AliEMCALUnfolding.cxx:479
 AliEMCALUnfolding.cxx:480
 AliEMCALUnfolding.cxx:481
 AliEMCALUnfolding.cxx:482
 AliEMCALUnfolding.cxx:483
 AliEMCALUnfolding.cxx:484
 AliEMCALUnfolding.cxx:485
 AliEMCALUnfolding.cxx:486
 AliEMCALUnfolding.cxx:487
 AliEMCALUnfolding.cxx:488
 AliEMCALUnfolding.cxx:489
 AliEMCALUnfolding.cxx:490
 AliEMCALUnfolding.cxx:491
 AliEMCALUnfolding.cxx:492
 AliEMCALUnfolding.cxx:493
 AliEMCALUnfolding.cxx:494
 AliEMCALUnfolding.cxx:495
 AliEMCALUnfolding.cxx:496
 AliEMCALUnfolding.cxx:497
 AliEMCALUnfolding.cxx:498
 AliEMCALUnfolding.cxx:499
 AliEMCALUnfolding.cxx:500
 AliEMCALUnfolding.cxx:501
 AliEMCALUnfolding.cxx:502
 AliEMCALUnfolding.cxx:503
 AliEMCALUnfolding.cxx:504
 AliEMCALUnfolding.cxx:505
 AliEMCALUnfolding.cxx:506
 AliEMCALUnfolding.cxx:507
 AliEMCALUnfolding.cxx:508
 AliEMCALUnfolding.cxx:509
 AliEMCALUnfolding.cxx:510
 AliEMCALUnfolding.cxx:511
 AliEMCALUnfolding.cxx:512
 AliEMCALUnfolding.cxx:513
 AliEMCALUnfolding.cxx:514
 AliEMCALUnfolding.cxx:515
 AliEMCALUnfolding.cxx:516
 AliEMCALUnfolding.cxx:517
 AliEMCALUnfolding.cxx:518
 AliEMCALUnfolding.cxx:519
 AliEMCALUnfolding.cxx:520
 AliEMCALUnfolding.cxx:521
 AliEMCALUnfolding.cxx:522
 AliEMCALUnfolding.cxx:523
 AliEMCALUnfolding.cxx:524
 AliEMCALUnfolding.cxx:525
 AliEMCALUnfolding.cxx:526
 AliEMCALUnfolding.cxx:527
 AliEMCALUnfolding.cxx:528
 AliEMCALUnfolding.cxx:529
 AliEMCALUnfolding.cxx:530
 AliEMCALUnfolding.cxx:531
 AliEMCALUnfolding.cxx:532
 AliEMCALUnfolding.cxx:533
 AliEMCALUnfolding.cxx:534
 AliEMCALUnfolding.cxx:535
 AliEMCALUnfolding.cxx:536
 AliEMCALUnfolding.cxx:537
 AliEMCALUnfolding.cxx:538
 AliEMCALUnfolding.cxx:539
 AliEMCALUnfolding.cxx:540
 AliEMCALUnfolding.cxx:541
 AliEMCALUnfolding.cxx:542
 AliEMCALUnfolding.cxx:543
 AliEMCALUnfolding.cxx:544
 AliEMCALUnfolding.cxx:545
 AliEMCALUnfolding.cxx:546
 AliEMCALUnfolding.cxx:547
 AliEMCALUnfolding.cxx:548
 AliEMCALUnfolding.cxx:549
 AliEMCALUnfolding.cxx:550
 AliEMCALUnfolding.cxx:551
 AliEMCALUnfolding.cxx:552
 AliEMCALUnfolding.cxx:553
 AliEMCALUnfolding.cxx:554
 AliEMCALUnfolding.cxx:555
 AliEMCALUnfolding.cxx:556
 AliEMCALUnfolding.cxx:557
 AliEMCALUnfolding.cxx:558
 AliEMCALUnfolding.cxx:559
 AliEMCALUnfolding.cxx:560
 AliEMCALUnfolding.cxx:561
 AliEMCALUnfolding.cxx:562
 AliEMCALUnfolding.cxx:563
 AliEMCALUnfolding.cxx:564
 AliEMCALUnfolding.cxx:565
 AliEMCALUnfolding.cxx:566
 AliEMCALUnfolding.cxx:567
 AliEMCALUnfolding.cxx:568
 AliEMCALUnfolding.cxx:569
 AliEMCALUnfolding.cxx:570
 AliEMCALUnfolding.cxx:571
 AliEMCALUnfolding.cxx:572
 AliEMCALUnfolding.cxx:573
 AliEMCALUnfolding.cxx:574
 AliEMCALUnfolding.cxx:575
 AliEMCALUnfolding.cxx:576
 AliEMCALUnfolding.cxx:577
 AliEMCALUnfolding.cxx:578
 AliEMCALUnfolding.cxx:579
 AliEMCALUnfolding.cxx:580
 AliEMCALUnfolding.cxx:581
 AliEMCALUnfolding.cxx:582
 AliEMCALUnfolding.cxx:583
 AliEMCALUnfolding.cxx:584
 AliEMCALUnfolding.cxx:585
 AliEMCALUnfolding.cxx:586
 AliEMCALUnfolding.cxx:587
 AliEMCALUnfolding.cxx:588
 AliEMCALUnfolding.cxx:589
 AliEMCALUnfolding.cxx:590
 AliEMCALUnfolding.cxx:591
 AliEMCALUnfolding.cxx:592
 AliEMCALUnfolding.cxx:593
 AliEMCALUnfolding.cxx:594
 AliEMCALUnfolding.cxx:595
 AliEMCALUnfolding.cxx:596
 AliEMCALUnfolding.cxx:597
 AliEMCALUnfolding.cxx:598
 AliEMCALUnfolding.cxx:599
 AliEMCALUnfolding.cxx:600
 AliEMCALUnfolding.cxx:601
 AliEMCALUnfolding.cxx:602
 AliEMCALUnfolding.cxx:603
 AliEMCALUnfolding.cxx:604
 AliEMCALUnfolding.cxx:605
 AliEMCALUnfolding.cxx:606
 AliEMCALUnfolding.cxx:607
 AliEMCALUnfolding.cxx:608
 AliEMCALUnfolding.cxx:609
 AliEMCALUnfolding.cxx:610
 AliEMCALUnfolding.cxx:611
 AliEMCALUnfolding.cxx:612
 AliEMCALUnfolding.cxx:613
 AliEMCALUnfolding.cxx:614
 AliEMCALUnfolding.cxx:615
 AliEMCALUnfolding.cxx:616
 AliEMCALUnfolding.cxx:617
 AliEMCALUnfolding.cxx:618
 AliEMCALUnfolding.cxx:619
 AliEMCALUnfolding.cxx:620
 AliEMCALUnfolding.cxx:621
 AliEMCALUnfolding.cxx:622
 AliEMCALUnfolding.cxx:623
 AliEMCALUnfolding.cxx:624
 AliEMCALUnfolding.cxx:625
 AliEMCALUnfolding.cxx:626
 AliEMCALUnfolding.cxx:627
 AliEMCALUnfolding.cxx:628
 AliEMCALUnfolding.cxx:629
 AliEMCALUnfolding.cxx:630
 AliEMCALUnfolding.cxx:631
 AliEMCALUnfolding.cxx:632
 AliEMCALUnfolding.cxx:633
 AliEMCALUnfolding.cxx:634
 AliEMCALUnfolding.cxx:635
 AliEMCALUnfolding.cxx:636
 AliEMCALUnfolding.cxx:637
 AliEMCALUnfolding.cxx:638
 AliEMCALUnfolding.cxx:639
 AliEMCALUnfolding.cxx:640
 AliEMCALUnfolding.cxx:641
 AliEMCALUnfolding.cxx:642
 AliEMCALUnfolding.cxx:643
 AliEMCALUnfolding.cxx:644
 AliEMCALUnfolding.cxx:645
 AliEMCALUnfolding.cxx:646
 AliEMCALUnfolding.cxx:647
 AliEMCALUnfolding.cxx:648
 AliEMCALUnfolding.cxx:649
 AliEMCALUnfolding.cxx:650
 AliEMCALUnfolding.cxx:651
 AliEMCALUnfolding.cxx:652
 AliEMCALUnfolding.cxx:653
 AliEMCALUnfolding.cxx:654
 AliEMCALUnfolding.cxx:655
 AliEMCALUnfolding.cxx:656
 AliEMCALUnfolding.cxx:657
 AliEMCALUnfolding.cxx:658
 AliEMCALUnfolding.cxx:659
 AliEMCALUnfolding.cxx:660
 AliEMCALUnfolding.cxx:661
 AliEMCALUnfolding.cxx:662
 AliEMCALUnfolding.cxx:663
 AliEMCALUnfolding.cxx:664
 AliEMCALUnfolding.cxx:665
 AliEMCALUnfolding.cxx:666
 AliEMCALUnfolding.cxx:667
 AliEMCALUnfolding.cxx:668
 AliEMCALUnfolding.cxx:669
 AliEMCALUnfolding.cxx:670
 AliEMCALUnfolding.cxx:671
 AliEMCALUnfolding.cxx:672
 AliEMCALUnfolding.cxx:673
 AliEMCALUnfolding.cxx:674
 AliEMCALUnfolding.cxx:675
 AliEMCALUnfolding.cxx:676
 AliEMCALUnfolding.cxx:677
 AliEMCALUnfolding.cxx:678
 AliEMCALUnfolding.cxx:679
 AliEMCALUnfolding.cxx:680
 AliEMCALUnfolding.cxx:681
 AliEMCALUnfolding.cxx:682
 AliEMCALUnfolding.cxx:683
 AliEMCALUnfolding.cxx:684
 AliEMCALUnfolding.cxx:685
 AliEMCALUnfolding.cxx:686
 AliEMCALUnfolding.cxx:687
 AliEMCALUnfolding.cxx:688
 AliEMCALUnfolding.cxx:689
 AliEMCALUnfolding.cxx:690
 AliEMCALUnfolding.cxx:691
 AliEMCALUnfolding.cxx:692
 AliEMCALUnfolding.cxx:693
 AliEMCALUnfolding.cxx:694
 AliEMCALUnfolding.cxx:695
 AliEMCALUnfolding.cxx:696
 AliEMCALUnfolding.cxx:697
 AliEMCALUnfolding.cxx:698
 AliEMCALUnfolding.cxx:699
 AliEMCALUnfolding.cxx:700
 AliEMCALUnfolding.cxx:701
 AliEMCALUnfolding.cxx:702
 AliEMCALUnfolding.cxx:703
 AliEMCALUnfolding.cxx:704
 AliEMCALUnfolding.cxx:705
 AliEMCALUnfolding.cxx:706
 AliEMCALUnfolding.cxx:707
 AliEMCALUnfolding.cxx:708
 AliEMCALUnfolding.cxx:709
 AliEMCALUnfolding.cxx:710
 AliEMCALUnfolding.cxx:711
 AliEMCALUnfolding.cxx:712
 AliEMCALUnfolding.cxx:713
 AliEMCALUnfolding.cxx:714
 AliEMCALUnfolding.cxx:715
 AliEMCALUnfolding.cxx:716
 AliEMCALUnfolding.cxx:717
 AliEMCALUnfolding.cxx:718
 AliEMCALUnfolding.cxx:719
 AliEMCALUnfolding.cxx:720
 AliEMCALUnfolding.cxx:721
 AliEMCALUnfolding.cxx:722
 AliEMCALUnfolding.cxx:723
 AliEMCALUnfolding.cxx:724
 AliEMCALUnfolding.cxx:725
 AliEMCALUnfolding.cxx:726
 AliEMCALUnfolding.cxx:727
 AliEMCALUnfolding.cxx:728
 AliEMCALUnfolding.cxx:729
 AliEMCALUnfolding.cxx:730
 AliEMCALUnfolding.cxx:731
 AliEMCALUnfolding.cxx:732
 AliEMCALUnfolding.cxx:733
 AliEMCALUnfolding.cxx:734
 AliEMCALUnfolding.cxx:735
 AliEMCALUnfolding.cxx:736
 AliEMCALUnfolding.cxx:737
 AliEMCALUnfolding.cxx:738
 AliEMCALUnfolding.cxx:739
 AliEMCALUnfolding.cxx:740
 AliEMCALUnfolding.cxx:741
 AliEMCALUnfolding.cxx:742
 AliEMCALUnfolding.cxx:743
 AliEMCALUnfolding.cxx:744
 AliEMCALUnfolding.cxx:745
 AliEMCALUnfolding.cxx:746
 AliEMCALUnfolding.cxx:747
 AliEMCALUnfolding.cxx:748
 AliEMCALUnfolding.cxx:749
 AliEMCALUnfolding.cxx:750
 AliEMCALUnfolding.cxx:751
 AliEMCALUnfolding.cxx:752
 AliEMCALUnfolding.cxx:753
 AliEMCALUnfolding.cxx:754
 AliEMCALUnfolding.cxx:755
 AliEMCALUnfolding.cxx:756
 AliEMCALUnfolding.cxx:757
 AliEMCALUnfolding.cxx:758
 AliEMCALUnfolding.cxx:759
 AliEMCALUnfolding.cxx:760
 AliEMCALUnfolding.cxx:761
 AliEMCALUnfolding.cxx:762
 AliEMCALUnfolding.cxx:763
 AliEMCALUnfolding.cxx:764
 AliEMCALUnfolding.cxx:765
 AliEMCALUnfolding.cxx:766
 AliEMCALUnfolding.cxx:767
 AliEMCALUnfolding.cxx:768
 AliEMCALUnfolding.cxx:769
 AliEMCALUnfolding.cxx:770
 AliEMCALUnfolding.cxx:771
 AliEMCALUnfolding.cxx:772
 AliEMCALUnfolding.cxx:773
 AliEMCALUnfolding.cxx:774
 AliEMCALUnfolding.cxx:775
 AliEMCALUnfolding.cxx:776
 AliEMCALUnfolding.cxx:777
 AliEMCALUnfolding.cxx:778
 AliEMCALUnfolding.cxx:779
 AliEMCALUnfolding.cxx:780
 AliEMCALUnfolding.cxx:781
 AliEMCALUnfolding.cxx:782
 AliEMCALUnfolding.cxx:783
 AliEMCALUnfolding.cxx:784
 AliEMCALUnfolding.cxx:785
 AliEMCALUnfolding.cxx:786
 AliEMCALUnfolding.cxx:787
 AliEMCALUnfolding.cxx:788
 AliEMCALUnfolding.cxx:789
 AliEMCALUnfolding.cxx:790
 AliEMCALUnfolding.cxx:791
 AliEMCALUnfolding.cxx:792
 AliEMCALUnfolding.cxx:793
 AliEMCALUnfolding.cxx:794
 AliEMCALUnfolding.cxx:795
 AliEMCALUnfolding.cxx:796
 AliEMCALUnfolding.cxx:797
 AliEMCALUnfolding.cxx:798
 AliEMCALUnfolding.cxx:799
 AliEMCALUnfolding.cxx:800
 AliEMCALUnfolding.cxx:801
 AliEMCALUnfolding.cxx:802
 AliEMCALUnfolding.cxx:803
 AliEMCALUnfolding.cxx:804
 AliEMCALUnfolding.cxx:805
 AliEMCALUnfolding.cxx:806
 AliEMCALUnfolding.cxx:807
 AliEMCALUnfolding.cxx:808
 AliEMCALUnfolding.cxx:809
 AliEMCALUnfolding.cxx:810
 AliEMCALUnfolding.cxx:811
 AliEMCALUnfolding.cxx:812
 AliEMCALUnfolding.cxx:813
 AliEMCALUnfolding.cxx:814
 AliEMCALUnfolding.cxx:815
 AliEMCALUnfolding.cxx:816
 AliEMCALUnfolding.cxx:817
 AliEMCALUnfolding.cxx:818
 AliEMCALUnfolding.cxx:819
 AliEMCALUnfolding.cxx:820
 AliEMCALUnfolding.cxx:821
 AliEMCALUnfolding.cxx:822
 AliEMCALUnfolding.cxx:823
 AliEMCALUnfolding.cxx:824
 AliEMCALUnfolding.cxx:825
 AliEMCALUnfolding.cxx:826
 AliEMCALUnfolding.cxx:827
 AliEMCALUnfolding.cxx:828
 AliEMCALUnfolding.cxx:829
 AliEMCALUnfolding.cxx:830
 AliEMCALUnfolding.cxx:831
 AliEMCALUnfolding.cxx:832
 AliEMCALUnfolding.cxx:833
 AliEMCALUnfolding.cxx:834
 AliEMCALUnfolding.cxx:835
 AliEMCALUnfolding.cxx:836
 AliEMCALUnfolding.cxx:837
 AliEMCALUnfolding.cxx:838
 AliEMCALUnfolding.cxx:839
 AliEMCALUnfolding.cxx:840
 AliEMCALUnfolding.cxx:841
 AliEMCALUnfolding.cxx:842
 AliEMCALUnfolding.cxx:843
 AliEMCALUnfolding.cxx:844
 AliEMCALUnfolding.cxx:845
 AliEMCALUnfolding.cxx:846
 AliEMCALUnfolding.cxx:847
 AliEMCALUnfolding.cxx:848
 AliEMCALUnfolding.cxx:849
 AliEMCALUnfolding.cxx:850
 AliEMCALUnfolding.cxx:851
 AliEMCALUnfolding.cxx:852
 AliEMCALUnfolding.cxx:853
 AliEMCALUnfolding.cxx:854
 AliEMCALUnfolding.cxx:855
 AliEMCALUnfolding.cxx:856
 AliEMCALUnfolding.cxx:857
 AliEMCALUnfolding.cxx:858
 AliEMCALUnfolding.cxx:859
 AliEMCALUnfolding.cxx:860
 AliEMCALUnfolding.cxx:861
 AliEMCALUnfolding.cxx:862
 AliEMCALUnfolding.cxx:863
 AliEMCALUnfolding.cxx:864
 AliEMCALUnfolding.cxx:865
 AliEMCALUnfolding.cxx:866
 AliEMCALUnfolding.cxx:867
 AliEMCALUnfolding.cxx:868
 AliEMCALUnfolding.cxx:869
 AliEMCALUnfolding.cxx:870
 AliEMCALUnfolding.cxx:871
 AliEMCALUnfolding.cxx:872
 AliEMCALUnfolding.cxx:873
 AliEMCALUnfolding.cxx:874
 AliEMCALUnfolding.cxx:875
 AliEMCALUnfolding.cxx:876
 AliEMCALUnfolding.cxx:877
 AliEMCALUnfolding.cxx:878
 AliEMCALUnfolding.cxx:879
 AliEMCALUnfolding.cxx:880
 AliEMCALUnfolding.cxx:881
 AliEMCALUnfolding.cxx:882
 AliEMCALUnfolding.cxx:883
 AliEMCALUnfolding.cxx:884
 AliEMCALUnfolding.cxx:885
 AliEMCALUnfolding.cxx:886
 AliEMCALUnfolding.cxx:887
 AliEMCALUnfolding.cxx:888
 AliEMCALUnfolding.cxx:889
 AliEMCALUnfolding.cxx:890
 AliEMCALUnfolding.cxx:891
 AliEMCALUnfolding.cxx:892
 AliEMCALUnfolding.cxx:893
 AliEMCALUnfolding.cxx:894
 AliEMCALUnfolding.cxx:895
 AliEMCALUnfolding.cxx:896
 AliEMCALUnfolding.cxx:897
 AliEMCALUnfolding.cxx:898
 AliEMCALUnfolding.cxx:899
 AliEMCALUnfolding.cxx:900
 AliEMCALUnfolding.cxx:901
 AliEMCALUnfolding.cxx:902
 AliEMCALUnfolding.cxx:903
 AliEMCALUnfolding.cxx:904
 AliEMCALUnfolding.cxx:905
 AliEMCALUnfolding.cxx:906
 AliEMCALUnfolding.cxx:907
 AliEMCALUnfolding.cxx:908
 AliEMCALUnfolding.cxx:909
 AliEMCALUnfolding.cxx:910
 AliEMCALUnfolding.cxx:911
 AliEMCALUnfolding.cxx:912
 AliEMCALUnfolding.cxx:913
 AliEMCALUnfolding.cxx:914
 AliEMCALUnfolding.cxx:915
 AliEMCALUnfolding.cxx:916
 AliEMCALUnfolding.cxx:917
 AliEMCALUnfolding.cxx:918
 AliEMCALUnfolding.cxx:919
 AliEMCALUnfolding.cxx:920
 AliEMCALUnfolding.cxx:921
 AliEMCALUnfolding.cxx:922
 AliEMCALUnfolding.cxx:923
 AliEMCALUnfolding.cxx:924
 AliEMCALUnfolding.cxx:925
 AliEMCALUnfolding.cxx:926
 AliEMCALUnfolding.cxx:927
 AliEMCALUnfolding.cxx:928
 AliEMCALUnfolding.cxx:929
 AliEMCALUnfolding.cxx:930
 AliEMCALUnfolding.cxx:931
 AliEMCALUnfolding.cxx:932
 AliEMCALUnfolding.cxx:933
 AliEMCALUnfolding.cxx:934
 AliEMCALUnfolding.cxx:935
 AliEMCALUnfolding.cxx:936
 AliEMCALUnfolding.cxx:937
 AliEMCALUnfolding.cxx:938
 AliEMCALUnfolding.cxx:939
 AliEMCALUnfolding.cxx:940
 AliEMCALUnfolding.cxx:941
 AliEMCALUnfolding.cxx:942
 AliEMCALUnfolding.cxx:943
 AliEMCALUnfolding.cxx:944
 AliEMCALUnfolding.cxx:945
 AliEMCALUnfolding.cxx:946
 AliEMCALUnfolding.cxx:947
 AliEMCALUnfolding.cxx:948
 AliEMCALUnfolding.cxx:949
 AliEMCALUnfolding.cxx:950
 AliEMCALUnfolding.cxx:951
 AliEMCALUnfolding.cxx:952
 AliEMCALUnfolding.cxx:953
 AliEMCALUnfolding.cxx:954
 AliEMCALUnfolding.cxx:955
 AliEMCALUnfolding.cxx:956
 AliEMCALUnfolding.cxx:957
 AliEMCALUnfolding.cxx:958
 AliEMCALUnfolding.cxx:959
 AliEMCALUnfolding.cxx:960
 AliEMCALUnfolding.cxx:961
 AliEMCALUnfolding.cxx:962
 AliEMCALUnfolding.cxx:963
 AliEMCALUnfolding.cxx:964
 AliEMCALUnfolding.cxx:965
 AliEMCALUnfolding.cxx:966
 AliEMCALUnfolding.cxx:967
 AliEMCALUnfolding.cxx:968
 AliEMCALUnfolding.cxx:969
 AliEMCALUnfolding.cxx:970
 AliEMCALUnfolding.cxx:971
 AliEMCALUnfolding.cxx:972
 AliEMCALUnfolding.cxx:973
 AliEMCALUnfolding.cxx:974
 AliEMCALUnfolding.cxx:975
 AliEMCALUnfolding.cxx:976
 AliEMCALUnfolding.cxx:977
 AliEMCALUnfolding.cxx:978
 AliEMCALUnfolding.cxx:979
 AliEMCALUnfolding.cxx:980
 AliEMCALUnfolding.cxx:981
 AliEMCALUnfolding.cxx:982
 AliEMCALUnfolding.cxx:983
 AliEMCALUnfolding.cxx:984
 AliEMCALUnfolding.cxx:985
 AliEMCALUnfolding.cxx:986
 AliEMCALUnfolding.cxx:987
 AliEMCALUnfolding.cxx:988
 AliEMCALUnfolding.cxx:989
 AliEMCALUnfolding.cxx:990
 AliEMCALUnfolding.cxx:991
 AliEMCALUnfolding.cxx:992
 AliEMCALUnfolding.cxx:993
 AliEMCALUnfolding.cxx:994
 AliEMCALUnfolding.cxx:995
 AliEMCALUnfolding.cxx:996
 AliEMCALUnfolding.cxx:997
 AliEMCALUnfolding.cxx:998
 AliEMCALUnfolding.cxx:999
 AliEMCALUnfolding.cxx:1000
 AliEMCALUnfolding.cxx:1001
 AliEMCALUnfolding.cxx:1002
 AliEMCALUnfolding.cxx:1003
 AliEMCALUnfolding.cxx:1004
 AliEMCALUnfolding.cxx:1005
 AliEMCALUnfolding.cxx:1006
 AliEMCALUnfolding.cxx:1007
 AliEMCALUnfolding.cxx:1008
 AliEMCALUnfolding.cxx:1009
 AliEMCALUnfolding.cxx:1010
 AliEMCALUnfolding.cxx:1011
 AliEMCALUnfolding.cxx:1012
 AliEMCALUnfolding.cxx:1013
 AliEMCALUnfolding.cxx:1014
 AliEMCALUnfolding.cxx:1015
 AliEMCALUnfolding.cxx:1016
 AliEMCALUnfolding.cxx:1017
 AliEMCALUnfolding.cxx:1018
 AliEMCALUnfolding.cxx:1019
 AliEMCALUnfolding.cxx:1020
 AliEMCALUnfolding.cxx:1021
 AliEMCALUnfolding.cxx:1022
 AliEMCALUnfolding.cxx:1023
 AliEMCALUnfolding.cxx:1024
 AliEMCALUnfolding.cxx:1025
 AliEMCALUnfolding.cxx:1026
 AliEMCALUnfolding.cxx:1027
 AliEMCALUnfolding.cxx:1028
 AliEMCALUnfolding.cxx:1029
 AliEMCALUnfolding.cxx:1030
 AliEMCALUnfolding.cxx:1031
 AliEMCALUnfolding.cxx:1032
 AliEMCALUnfolding.cxx:1033
 AliEMCALUnfolding.cxx:1034
 AliEMCALUnfolding.cxx:1035
 AliEMCALUnfolding.cxx:1036
 AliEMCALUnfolding.cxx:1037
 AliEMCALUnfolding.cxx:1038
 AliEMCALUnfolding.cxx:1039
 AliEMCALUnfolding.cxx:1040
 AliEMCALUnfolding.cxx:1041
 AliEMCALUnfolding.cxx:1042
 AliEMCALUnfolding.cxx:1043
 AliEMCALUnfolding.cxx:1044
 AliEMCALUnfolding.cxx:1045
 AliEMCALUnfolding.cxx:1046