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

/* $Id$ */

//_________________________________________________________________________
//--
//-- Yves Schutz (SUBATECH) 
// Reconstruction class. Redesigned from the old AliReconstructionner class and 
// derived from STEER/AliReconstructor. 
// 
// --- ROOT system ---
#include "TGeoManager.h"
#include "TGeoMatrix.h"

// --- Standard library ---

// --- AliRoot header files ---
#include "AliLog.h"
#include "AliAltroMapping.h"
#include "AliESDEvent.h"
#include "AliESDCaloCluster.h"
#include "AliESDCaloCells.h"
#include "AliPHOSReconstructor.h"
#include "AliPHOSClusterizerv1.h"
#include "AliPHOSTrackSegmentMakerv1.h"
#include "AliPHOSPIDv1.h"
#include "AliPHOSTracker.h"
#include "AliRawReader.h"
#include "AliPHOSCalibData.h"
#include "AliCDBEntry.h"
#include "AliCDBManager.h"
#include "AliPHOSTrigger.h"
#include "AliPHOSGeometry.h"
#include "AliPHOSDigit.h"
#include "AliPHOSTrackSegment.h"
#include "AliPHOSEmcRecPoint.h"
#include "AliPHOSRecParticle.h"
#include "AliPHOSRawFitterv0.h"
#include "AliPHOSRawFitterv1.h"
#include "AliPHOSRawFitterv2.h"
#include "AliPHOSRawFitterv3.h"
#include "AliPHOSRawFitterv4.h"
#include "AliPHOSRawDigiProducer.h"
#include "AliPHOSPulseGenerator.h"
#include "AliPHOSTriggerRawDigit.h"
#include "AliPHOSTriggerRawDigiProducer.h"
#include "AliPHOSTriggerParameters.h"

ClassImp(AliPHOSReconstructor)

Bool_t AliPHOSReconstructor::fgDebug = kFALSE ; 
TClonesArray*     AliPHOSReconstructor::fgDigitsArray = 0;   // Array of PHOS digits
TObjArray*        AliPHOSReconstructor::fgEMCRecPoints = 0;   // Array of EMC rec.points
AliPHOSCalibData * AliPHOSReconstructor::fgCalibData  = 0 ;
TClonesArray*     AliPHOSReconstructor::fgTriggerDigits = 0;   // Array of PHOS trigger digits

//____________________________________________________________________________
AliPHOSReconstructor::AliPHOSReconstructor() :
  fGeom(NULL),fClusterizer(NULL),fTSM(NULL),fPID(NULL),fTmpDigLG(NULL)
{
  // ctor
  fGeom          = AliPHOSGeometry::GetInstance("IHEP","");
  fClusterizer   = new AliPHOSClusterizerv1      (fGeom);
  fTSM           = new AliPHOSTrackSegmentMakerv1(fGeom);
  fPID           = new AliPHOSPIDv1              (fGeom);
  fTmpDigLG      = new TClonesArray("AliPHOSDigit",100);
  fgDigitsArray  = new TClonesArray("AliPHOSDigit",100);
  fgEMCRecPoints = new TObjArray(100) ;
  if (!fgCalibData)
    fgCalibData = new AliPHOSCalibData(-1); //use AliCDBManager's run number
  
  fgTriggerDigits  = new TClonesArray("AliPHOSTriggerRawDigit",100);
  
  AliInfo(Form("PHOS bad channel map contains %d bad channel(s).\n",
               fgCalibData->GetNumOfEmcBadChannels()));
 
}

//____________________________________________________________________________
AliPHOSReconstructor::~AliPHOSReconstructor()
{
  // dtor
  //  delete fGeom; // RS: fGeom is a static object owned by AliPHOSGeometry::fGeom, don't delete
  delete fClusterizer;
  delete fTSM;
  delete fPID;
  delete fTmpDigLG;
  delete fgDigitsArray;
  delete fgEMCRecPoints;
  delete fgTriggerDigits;
} 

//____________________________________________________________________________
void AliPHOSReconstructor::Reconstruct(TTree* digitsTree, TTree* clustersTree) const
{
  // 'single-event' local reco method called by AliReconstruction; 
  // Only the clusterization is performed,; the rest of the reconstruction is done in FillESD because the track
  // segment maker needs access to the AliESDEvent object to retrieve the tracks reconstructed by 
  // the global tracking.

  fClusterizer->InitParameters();
  fClusterizer->SetInput(digitsTree);
  fClusterizer->SetOutput(clustersTree);
  if ( Debug() ) 
    fClusterizer->Digits2Clusters("deb all") ; 
  else 
    fClusterizer->Digits2Clusters("") ;
}

//____________________________________________________________________________
void AliPHOSReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree, 
				   AliESDEvent* esd) const
{
  // This method produces PHOS rec-particles,
  // then it creates AliESDtracks out of them and
  // write tracks to the ESD


  // do current event; the loop over events is done by AliReconstruction::Run()
  fTSM->SetESD(esd) ; 
  fTSM->SetInput(clustersTree);
  if ( Debug() ) 
    fTSM->Clusters2TrackSegments("deb all") ;
  else 
    fTSM->Clusters2TrackSegments("") ;
  
  fPID->SetInput(clustersTree, fTSM->GetTrackSegments()) ; 
  fPID->SetESD(esd) ; 
  if ( Debug() ) 
    fPID->TrackSegments2RecParticles("deb all") ;
  else 
    fPID->TrackSegments2RecParticles("") ;

  TClonesArray *recParticles  = fPID->GetRecParticles();
  Int_t nOfRecParticles = recParticles->GetEntriesFast();
  
  AliDebug(2,Form("%d rec. particles, option %s",nOfRecParticles,GetOption()));
  
  // Read digits array

  TBranch *branch = digitsTree->GetBranch("PHOS");
  if (!branch) { 
    AliError("can't get the branch with the PHOS digits !");
    return;
  }
  branch->SetAddress(&fgDigitsArray);
  branch->GetEntry(0);

  // Get the clusters array

  TBranch *emcbranch = clustersTree->GetBranch("PHOSEmcRP");
  if (!emcbranch) { 
    AliError("can't get the branch with the PHOS EMC clusters !");
    return;
  }

  emcbranch->SetAddress(&fgEMCRecPoints);
  emcbranch->GetEntry(0);
  
  
  // Trigger
  
  TBranch *tbranch = digitsTree->GetBranch("TPHOS");
  if (tbranch) { 
    
    tbranch->SetAddress(&fgTriggerDigits);
    tbranch->GetEntry(0);
    
    AliESDCaloTrigger* trgESD = esd->GetCaloTrigger("PHOS");
    
    if (trgESD) {
      trgESD->Allocate(fgTriggerDigits->GetEntriesFast());
      
      for (Int_t i = 0; i < fgTriggerDigits->GetEntriesFast(); i++) {
	AliPHOSTriggerRawDigit* tdig = (AliPHOSTriggerRawDigit*)fgTriggerDigits->At(i);
	
	Int_t mod,modX,modZ;
	tdig->GetModXZ(mod,modX,modZ);
	
	const Int_t relId[4] = {5-mod,0,modX+1,modZ+1};
	Int_t absId;
	
	fGeom->RelToAbsNumbering(relId,absId);
	trgESD->Add(mod,absId,tdig->GetAmp(),0.,(Int_t*)NULL,0,0,0);
      }
    }  
  }
  
//   //#########Calculate trigger and set trigger info###########

//   AliPHOSTrigger tr ;
//   //   tr.SetPatchSize(1);//create 4x4 patches
//   tr.SetSimulation(kFALSE);
//   tr.Trigger(fgDigitsArray);
  
//   Float_t maxAmp2x2  = tr.Get2x2MaxAmplitude();
//   Float_t maxAmpnxn  = tr.GetnxnMaxAmplitude();
//   Float_t ampOutOfPatch2x2  = tr.Get2x2AmpOutOfPatch() ;
//   Float_t ampOutOfPatchnxn  = tr.GetnxnAmpOutOfPatch() ;

//   Int_t iSM2x2      = tr.Get2x2SuperModule();
//   Int_t iSMnxn      = tr.GetnxnSuperModule();
//   Int_t iCrystalPhi2x2 = tr.Get2x2CrystalPhi();
//   Int_t iCrystalPhinxn = tr.GetnxnCrystalPhi();
//   Int_t iCrystalEta2x2 = tr.Get2x2CrystalEta();
//   Int_t iCrystalEtanxn = tr.GetnxnCrystalEta();

//   AliDebug(2, Form("Trigger 2x2 max amp %f, out amp %f, SM %d, iphi %d ieta %d",  
// 		   maxAmp2x2, ampOutOfPatch2x2, iSM2x2,iCrystalPhi2x2, iCrystalEta2x2));
//   AliDebug(2, Form("Trigger 4x4 max amp %f , out amp %f, SM %d, iphi %d, ieta %d",
// 		   maxAmpnxn, ampOutOfPatchnxn, iSMnxn,iCrystalPhinxn, iCrystalEtanxn));

//   // Attention! PHOS modules in order to calculate AbsId need to be 1-5 not 0-4 as returns trigger.
//   Int_t iRelId2x2 []= {iSM2x2+1,0,iCrystalPhi2x2,iCrystalEta2x2};
//   Int_t iAbsId2x2 =-1;
//   Int_t iRelIdnxn []= {iSMnxn+1,0,iCrystalPhinxn,iCrystalEtanxn};
//   Int_t iAbsIdnxn =-1;
//   TVector3    pos2x2(-1,-1,-1);
//   TVector3    posnxn(-1,-1,-1);
//   fGeom->RelToAbsNumbering(iRelId2x2, iAbsId2x2);
//   fGeom->RelToAbsNumbering(iRelIdnxn, iAbsIdnxn);
//   fGeom->RelPosInAlice(iAbsId2x2, pos2x2);
//   fGeom->RelPosInAlice(iAbsIdnxn, posnxn);

//   TArrayF triggerPosition(6);
//   triggerPosition[0] = pos2x2(0) ;   
//   triggerPosition[1] = pos2x2(1) ;   
//   triggerPosition[2] = pos2x2(2) ;  
//   triggerPosition[3] = posnxn(0) ;   
//   triggerPosition[4] = posnxn(1) ;   
//   triggerPosition[5] = posnxn(2) ;  

//   TArrayF triggerAmplitudes(4);
//   triggerAmplitudes[0] = maxAmp2x2 ;   
//   triggerAmplitudes[1] = ampOutOfPatch2x2 ;    
//   triggerAmplitudes[2] = maxAmpnxn ;   
//   triggerAmplitudes[3] = ampOutOfPatchnxn ;   

//   //esd->SetPHOSTriggerCells(triggerPosition);
//   esd->AddPHOSTriggerPosition(triggerPosition);
//   esd->AddPHOSTriggerAmplitudes(triggerAmplitudes);
  

  //########################################
  //############# Fill CaloCells ###########
  //########################################

  Int_t nDigits = fgDigitsArray->GetEntries();
  Int_t idignew = 0 ;
  AliDebug(1,Form("%d digits",nDigits));

  const Int_t knEMC = fGeom->GetNModules()*fGeom->GetNPhi()*fGeom->GetNZ();
  AliESDCaloCells &phsCells = *(esd->GetPHOSCells());
  phsCells.CreateContainer(nDigits);
  phsCells.SetType(AliESDCaloCells::kPHOSCell);

  // Add to CaloCells only EMC digits with non-zero energy 
  for (Int_t idig = 0 ; idig < nDigits ; idig++) {
    const AliPHOSDigit * dig = (const AliPHOSDigit*)fgDigitsArray->At(idig);
    if(dig->GetId() <= knEMC && 
       Calibrate(dig->GetEnergy(),dig->GetId()) > GetRecoParam()->GetEMCMinE() ){
      Int_t primary = dig->GetPrimary(1) ;
      phsCells.SetCell(idignew,dig->GetId(), Calibrate(dig->GetEnergy(),dig->GetId()),
                                             CalibrateT(dig->GetTime(),dig->GetId(),dig->IsLG()),
                                             primary,0.,!dig->IsLG()) ;
					     
      idignew++;
    }
  }
  phsCells.SetNumberOfCells(idignew);
  phsCells.Sort();

  //########################################
  //############## Fill CaloClusters #######
  //########################################

  for (Int_t recpart = 0 ; recpart < nOfRecParticles ; recpart++) {
    AliPHOSRecParticle  *rp    = static_cast<AliPHOSRecParticle*>(recParticles->At(recpart));
    if (Debug()) 
      rp->Print();
    // Get track segment and EMC rec.point associated with this rec.particle
    AliPHOSTrackSegment *ts    = static_cast<AliPHOSTrackSegment *>(fTSM->GetTrackSegments()
								    ->At(rp->GetPHOSTSIndex()));

    AliPHOSEmcRecPoint  *emcRP = static_cast<AliPHOSEmcRecPoint *>(fgEMCRecPoints->At(ts->GetEmcIndex()));
    AliESDCaloCluster   *ec    = new AliESDCaloCluster() ; 
    
    Float_t xyz[3];
    for (Int_t ixyz=0; ixyz<3; ixyz++) 
      xyz[ixyz] = rp->GetPos()[ixyz];
    
    AliDebug(2,Form("Global position xyz=(%f,%f,%f)",xyz[0],xyz[1],xyz[2]));
   
    // Create cell lists

    Int_t     cellMult   = emcRP->GetDigitsMultiplicity();
    Int_t    *digitsList = emcRP->GetDigitsList();
    Float_t  *rpElist    = emcRP->GetEnergiesList() ;
    UShort_t *absIdList  = new UShort_t[cellMult];
    Double_t *fracList   = new Double_t[cellMult];

    for (Int_t iCell=0; iCell<cellMult; iCell++) {
      AliPHOSDigit *digit = static_cast<AliPHOSDigit *>(fgDigitsArray->At(digitsList[iCell]));
      absIdList[iCell] = (UShort_t)(digit->GetId());
      if (digit->GetEnergy() > 0)
 	fracList[iCell] = rpElist[iCell]/(Calibrate(digit->GetEnergy(),digit->GetId()));
      else
 	fracList[iCell] = 0;
    }

    //Primaries
    Int_t  primMult  = 0;
    Int_t *primList =  emcRP->GetPrimaries(primMult);

    Float_t energy=0.;
    if (GetRecoParam()->EMCEcore2ESD())
      energy = emcRP->GetCoreEnergy();
    else
      energy = rp->Energy();
    //Apply nonlinearity correction
    if(GetRecoParam()->GetEMCEnergyCorrectionOn())
      energy=CorrectNonlinearity(energy) ;

    // fills the ESDCaloCluster
    ec->SetType(AliVCluster::kPHOSNeutral);
    ec->SetPosition(xyz);                       //rec.point position in MARS
    ec->SetE(energy);                           //total or core particle energy
    ec->SetDispersion(emcRP->GetDispersion());  //cluster dispersion
    ec->SetPID(rp->GetPID()) ;            //array of particle identification
    ec->SetM02(emcRP->GetM2x()) ;               //second moment M2x
    ec->SetM20(emcRP->GetM2z()) ;               //second moment M2z
    ec->SetNExMax(emcRP->GetNExMax());          //number of local maxima
    ec->SetEmcCpvDistance(ts->GetCpvDistance("r")); //Only radius, what about separate x,z????
    ec->SetTrackDistance(ts->GetCpvDistance("x"),ts->GetCpvDistance("z")); 
    ec->SetChi2(-1);                     //not yet implemented
    ec->SetTOF(emcRP->GetTime());               //Time of flight - already calibrated in EMCRecPoint

    //Cells contributing to clusters
    ec->SetNCells(cellMult);
    ec->SetCellsAbsId(absIdList);
    ec->SetCellsAmplitudeFraction(fracList);

    //Distance to the nearest bad crystal
    ec->SetDistanceToBadChannel(emcRP->GetDistanceToBadCrystal()); 
  
    //Array of MC indeces
    TArrayI arrayPrim(primMult,primList);
    ec->AddLabels(arrayPrim);
    
    //Matched ESD track
    TArrayI arrayTrackMatched(1);
    arrayTrackMatched[0]= ts->GetTrackIndex();
    ec->AddTracksMatched(arrayTrackMatched);
    
    Int_t index = esd->AddCaloCluster(ec);

    //Set pointer to this cluster in ESD track
    Int_t nt=esd->GetNumberOfTracks();
    for (Int_t itr=0; itr<nt; itr++) {
      AliESDtrack *esdTrack=esd->GetTrack(itr);
      if(!esdTrack->IsPHOS())
        continue ;
      if(esdTrack->GetPHOScluster()==-recpart){ //we store negative cluster number
        esdTrack->SetPHOScluster(index) ;
//no garatie that only one track matched this cluster
//      break ;
      }
    }
 
    delete ec;   
    delete [] fracList;
    delete [] absIdList;
  }
  fgDigitsArray ->Clear("C");
  fgEMCRecPoints->Clear("C");
  recParticles  ->Clear();

  //Store PHOS misalignment matrixes
  FillMisalMatrixes(esd) ;

}

//____________________________________________________________________________
AliTracker* AliPHOSReconstructor::CreateTracker() const
{
  // creates the PHOS tracker
  return new AliPHOSTracker();
}

//____________________________________________________________________________
void  AliPHOSReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digitsTree) const
{
  // Converts raw data to
  // PHOS digits
  // Works on a single-event basis
  rawReader->Reset() ; 

  AliPHOSRawFitterv0 * fitter ;

  const TObjArray* maps = AliPHOSRecoParam::GetMappings();
  if(!maps) AliFatal("Cannot retrieve ALTRO mappings!!");

  AliAltroMapping *mapping[20];
  for(Int_t i = 0; i < 20; i++) {
    mapping[i] = (AliAltroMapping*)maps->At(i);
  }

  if      (strcmp(GetRecoParam()->EMCFitterVersion(),"v0")==0) 
    fitter=new AliPHOSRawFitterv0();
  else if (strcmp(GetRecoParam()->EMCFitterVersion(),"v1")==0) 
    fitter=new AliPHOSRawFitterv1();
  else if (strcmp(GetRecoParam()->EMCFitterVersion(),"v2")==0) 
    fitter=new AliPHOSRawFitterv2();
  else if (strcmp(GetRecoParam()->EMCFitterVersion(),"v3")==0) 
    fitter=new AliPHOSRawFitterv3();
  else
    fitter=new AliPHOSRawFitterv4();

  fitter->SubtractPedestals(GetRecoParam()->EMCSubtractPedestals());
  fitter->SetAmpOffset     (GetRecoParam()->GetGlobalAltroOffset());
  fitter->SetAmpThreshold  (GetRecoParam()->GetGlobalAltroThreshold());

  TClonesArray *digits = new TClonesArray("AliPHOSDigit",1);
  digits->SetName("DIGITS");
  Int_t bufsize = 32000;
  digitsTree->Branch("PHOS", &digits, bufsize);

  AliPHOSRawDigiProducer rdp(rawReader,mapping);

  rdp.SetEmcMinAmp(GetRecoParam()->GetEMCRawDigitThreshold()); // in ADC
  rdp.SetCpvMinAmp(GetRecoParam()->GetCPVMinE());
  rdp.SetSampleQualityCut(GetRecoParam()->GetEMCSampleQualityCut());
  rdp.MakeDigits(digits,fTmpDigLG,fitter);

  delete fitter ;

  TClonesArray *tdigits = new TClonesArray("AliPHOSTriggerRawDigit",1);
  tdigits->SetName("TDIGITS");
  digitsTree->Branch("TPHOS", &tdigits, bufsize);  

  rawReader->Reset();
  AliPHOSTriggerRawDigiProducer tdp(rawReader);
  
  AliPHOSTriggerParameters* parameters = (AliPHOSTriggerParameters*)AliPHOSRecoParam::GetTriggerParameters();
  
  tdp.SetTriggerParameters(parameters);
  tdp.ProcessEvent(tdigits);
  
  if (AliLog::GetGlobalDebugLevel() == 1) {
    Int_t modMax=-111;
    Int_t colMax=-111;
    Int_t rowMax=-111;
    Float_t eMax=-333;
    //!!!for debug!!!
    
    Int_t relId[4];
    for(Int_t iDigit=0; iDigit<digits->GetEntries(); iDigit++) {
      AliPHOSDigit* digit = (AliPHOSDigit*)digits->At(iDigit);
      if(digit->GetEnergy()>eMax) {
	fGeom->AbsToRelNumbering(digit->GetId(),relId);
	eMax=digit->GetEnergy();
	modMax=relId[0];
	rowMax=relId[2];
	colMax=relId[3];
      }
    }
    
    AliDebug(1,Form("Digit with max. energy:  modMax %d colMax %d rowMax %d  eMax %f\n\n",
		    modMax,colMax,rowMax,eMax));
  }
  
  digitsTree->Fill();
  
  digits->Delete();
  delete digits;
  
  tdigits->Delete();
  delete tdigits;
}
//==================================================================================
Float_t AliPHOSReconstructor::Calibrate(Float_t amp, Int_t absId)const{
  // Calibrate EMC digit, i.e. multiply its Amp by a factor read from CDB

  const AliPHOSGeometry *geom = AliPHOSGeometry::GetInstance() ;

  //Determine rel.position of the cell absolute ID
  Int_t relId[4];
  geom->AbsToRelNumbering(absId,relId);
  Int_t module=relId[0];
  Int_t row   =relId[2];
  Int_t column=relId[3];
  if(relId[1]){ //CPV
    Float_t calibration = fgCalibData->GetADCchannelCpv(module,column,row);
    return amp*calibration ;
  }
  else{ //EMC
    Float_t calibration = fgCalibData->GetADCchannelEmc(module,column,row);
    return amp*calibration ;
  }
}
//==================================================================================
Float_t AliPHOSReconstructor::CalibrateT(Float_t time, Int_t absId,Bool_t isLG)const{
  // Calibrate EMC digit, i.e. multiply its Amp by a factor read from CDB

  const AliPHOSGeometry *geom = AliPHOSGeometry::GetInstance() ;

  //Determine rel.position of the cell absolute ID
  Int_t relId[4];
  geom->AbsToRelNumbering(absId,relId);
  Int_t module=relId[0];
  Int_t row   =relId[2];
  Int_t column=relId[3];
  if(relId[1]){ //CPV
    return 0. ;
  }
  else{ //EMC
    if(isLG)
      time += fgCalibData->GetLGTimeShiftEmc(module,column,row);
    else
      time += fgCalibData->GetTimeShiftEmc(module,column,row);
    return time ;
  }
}
//==================================================================================
void AliPHOSReconstructor::FillMisalMatrixes(AliESDEvent* esd)const{
  //Store PHOS matrixes in ESD Header

  //Check, if matrixes was already stored
  for(Int_t mod=0 ;mod<5; mod++){
    if(esd->GetPHOSMatrix(mod)!=0)
      return ;
  }

  //Create and store matrixes
  if(!gGeoManager){
    AliError("Can not store misal. matrixes: no gGeoManager! \n") ;
    return ;
  }
  //Note, that owner of copied marixes will be header
  char path[255] ;
  TGeoHMatrix * m ;
  for(Int_t mod=0; mod<5; mod++){
    snprintf(path,255,"/ALIC_1/PHOS_%d",mod+1) ; //In Geometry modules numbered 1,2,.,5
    if (gGeoManager->cd(path)){
      m = gGeoManager->GetCurrentMatrix() ;
      esd->SetPHOSMatrix(new TGeoHMatrix(*m),mod) ;
    }
    else{
      esd->SetPHOSMatrix(NULL,mod) ;
    }
  }

}
//==================================================================================
Float_t AliPHOSReconstructor::CorrectNonlinearity(Float_t en){

  //For backward compatibility, if no RecoParameters found
  if(!GetRecoParam()){
    return 0.0241+1.0504*en+0.000249*en*en ;
  }

  if(strcmp(GetRecoParam()->GetNonlinearityCorrectionVersion(),"NoCorrection")==0){
    return en ;
  }
  if(strcmp(GetRecoParam()->GetNonlinearityCorrectionVersion(),"Gustavo2005")==0){
    const Float_t *par=GetRecoParam()->GetNonlinearityParams() ;
    return par[0]+par[1]*en + par[2]*en*en ;
  }
  if(strcmp(GetRecoParam()->GetNonlinearityCorrectionVersion(),"Henrik2010")==0){
     const Float_t *par=GetRecoParam()->GetNonlinearityParams() ;
     return en*(par[0]+par[1]*TMath::Exp(-en*par[2]))*(1.+par[3]*TMath::Exp(-en*par[4]))*(1.+par[6]/(en*en+par[5])) ;
  }
  //For backward compatibility
  if(strcmp(GetRecoParam()->GetNonlinearityCorrectionVersion(),"")==0){
    return 0.0241+1.0504*en+0.000249*en*en ;
  }
  return en ;
}

void AliPHOSReconstructor::readTRUParameters(AliPHOSTriggerParameters* parameters) const
{
  //Read trigger parameters.

  TString path(gSystem->Getenv("ALICE_ROOT"));
  path += "/PHOS/macros/Trigger/OCDB/";
  
  for (Int_t mod = 2; mod < 5; ++mod) { // module
    for (Int_t tru = 0; tru < 4; tru++) { // tru row
      for (Int_t branch = 0; branch < 2; branch++) { // branch
	
	// Open the Appropriate pedestal file
	TString fileName = path;
	fileName += "pedestal_m";
	fileName = fileName += mod;
	fileName+="_r";
	fileName+=tru;
	fileName+="_b";
	fileName+=branch;
	fileName+=".dat";
	std::ifstream instream;
	instream.open(fileName.Data());
	
	// Read pedestals from file
	if( ! instream.is_open() )
	  Printf("E-TRUPedestals: could not open %s", fileName.Data());
	else
	  {
	    Int_t ped[112];
	    
	    char ch_s[36];
	    char *ch_s_p = ch_s;
	    //Int_t nlines = 0;
	    
	    Int_t t_ped_0 =0;
	    Int_t t_ped_1 =0;
	    Int_t t_ped_2 =0;
	    
	    for(Int_t n=0; n<112; n++)
	      {
		instream.getline(ch_s_p,36);
		if (ch_s_p[23]<='9' && ch_s_p[23]>='0')
		  {
		    t_ped_0 = ch_s_p[23]-'0';
		  }
		else if (ch_s_p[23]>='A' && ch_s_p[23]<='Z')
		  {
		    t_ped_0 = ch_s_p[23]-'A'+10;
		    
		  }
		  
		if (ch_s_p[22]<='9' && ch_s_p[22]>='0')
		  {
		    t_ped_1 = ch_s_p[22]-'0';
		  }
		else if (ch_s_p[22]<='Z' && ch_s_p[22]>='A')
		  {
		    t_ped_1 = ch_s_p[22]-'A'+10;
		  }
		
		if (ch_s_p[21]<='9' && ch_s_p[21]>='0')
		  {
		    t_ped_2 = ch_s_p[21]-'0';
		  }
		else if (ch_s_p[21]<='Z' && ch_s_p[21]>='A')
		  {
		    t_ped_2 = ch_s_p[21]-'A'+10;
		  }
		
		ped[n]=t_ped_2*256+t_ped_1*16+t_ped_0;
		
		
	      }
	    for (Int_t xrow = 0; xrow < 8; xrow++){
	      for (Int_t zcol = 0; zcol < 14; zcol++){
		Int_t pedestal = ped[zcol*8+xrow];
		
		if( pedestal < 612 && pedestal > 412 ) // resonable
		  parameters->SetTRUPedestal(pedestal, mod, tru, branch, xrow, zcol);
		else // unresonable
		  continue;
	      }
	    }
	  } // Ends read of pedestals from branch from file.
	instream.close();
      }// end branch
    }// end tru
    
  }// end for mod
}




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