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: $ */

// Objects of this class read txt file with survey data
// and convert the data into AliAlignObjParams of alignable EMCAL volumes.
// AliEMCALSurvey inherits TObject only to use AliLog "functions".
//
// Dummy functions originally written before EMCAL installation and
// survey are kept for backward compatibility, but now they are not
// used.
//
// Surveyed points on the EMCAL support rails were used with the CATIA
// 3D graphics program to determine the positions of the bottom
// corners of the active area for each supermodule.  These numbers are
// read in from file and converted to position of the center and roll, 
// pitch, yaw angles of each installed SM.
//
// J.L. Klay - Cal Poly
// Adapted for DCAL by M.L. Wang CCNU & Subatech Oct-19-2012
// 21-May-2010
//

#include <fstream>

#include <TClonesArray.h>
#include <TGeoManager.h>
#include <TString.h>
#include <TMath.h>

#include "AliSurveyObj.h"
#include "AliSurveyPoint.h"

#include "AliAlignObjParams.h"
#include "AliEMCALGeometry.h"
#include "AliEMCALSurvey.h"
#include "AliLog.h"

ClassImp(AliEMCALSurvey)

//____________________________________________________________________________
AliEMCALSurvey::AliEMCALSurvey()
 : fNSuperModule(0),
   fSuperModuleData(0),
   fDataType(kSurvey)
{
  //Default constructor.
}

namespace {

  //Coordinates for each SM described in survey reports

  struct AliEMCALSuperModuleCoords {
    Double_t fX1; //x coordinate of the center of supermodule
    Double_t fY1; //y coordinate of the center of supermodule
    Double_t fZ1; //z coordinate of the center of supermodule
    Double_t fPsi;   //yaw (psi) of supermodule
    Double_t fTheta; //pitch (theta) of supermodule
    Double_t fPhi;  //roll angle (phi) of supermodule

  };

}

//____________________________________________________________________________
AliEMCALSurvey::AliEMCALSurvey(const TString &txtFileName,const SurveyDataType_t type)
  : fNSuperModule(0),
    fSuperModuleData(0),
    fDataType(type)
{
  //Get the geometry object and then attempt to
  //read survey data from a file, depending on which
  //method (kSurvey or kDummy) is selected.
  
  const AliEMCALGeometry *geom = AliEMCALGeometry::GetInstance();
  if (!geom) {
    AliError("Cannot obtain AliEMCALGeometry instance.");
    return;
  }
  
  fNSuperModule = geom->GetNumberOfSuperModules();
  
  if(fDataType == kSurvey) {
    
    AliSurveyObj *s1 = new AliSurveyObj();
    s1->FillFromLocalFile(txtFileName);
    TObjArray* points = s1->GetData();
    InitSuperModuleData(points);
    
  } else {
    
    //Use a dummy file that stores x,y,z of the center of each SM
    //useful for testing...
    std::ifstream inputFile(txtFileName.Data());
    if (!inputFile) {
      AliError(("Cannot open the survey file " + txtFileName).Data());
      return;
    }
    
    Int_t dummyInt = 0;
    Double_t *xReal     = new Double_t[fNSuperModule];
    Double_t *yReal     = new Double_t[fNSuperModule];
    Double_t *zReal     = new Double_t[fNSuperModule];
    Double_t *psiReal   = new Double_t[fNSuperModule];
    Double_t *thetaReal = new Double_t[fNSuperModule];
    Double_t *phiReal   = new Double_t[fNSuperModule];
    //init the arrays
    memset(xReal,     0,sizeof(Int_t)*fNSuperModule);
    memset(yReal,     0,sizeof(Int_t)*fNSuperModule);
    memset(zReal,     0,sizeof(Int_t)*fNSuperModule);
    memset(psiReal,   0,sizeof(Int_t)*fNSuperModule);
    memset(thetaReal, 0,sizeof(Int_t)*fNSuperModule);
    memset(phiReal,   0,sizeof(Int_t)*fNSuperModule);
    
    
    for (Int_t i = 0; i < fNSuperModule; ++i) {
      if (!inputFile) {
        AliError("Error while reading input file.");
        delete [] xReal;
        delete [] yReal;
        delete [] zReal;
        delete [] psiReal;
        delete [] thetaReal;
        delete [] phiReal;
        return;
      }
      inputFile>>dummyInt>>xReal[i]>>yReal[i]>>zReal[i]>>psiReal[i]>>thetaReal[i]>>phiReal[i];
    }
    
    InitSuperModuleData(xReal, yReal, zReal, psiReal, thetaReal, phiReal);
    
    delete [] xReal;
    delete [] yReal;
    delete [] zReal;
    delete [] psiReal;
    delete [] thetaReal;
    delete [] phiReal;
    
  } //kDummy way of doing it
  
}

//____________________________________________________________________________
AliEMCALSurvey::~AliEMCALSurvey()
{
  //destructor
  delete [] fSuperModuleData;
}

//____________________________________________________________________________
void AliEMCALSurvey::CreateAliAlignObjParams(TClonesArray &array)
{
  //Create AliAlignObjParams.
  const AliEMCALGeometry * geom = AliEMCALGeometry::GetInstance();
  if (!geom) {
    AliError("Cannot obtain AliEMCALGeometry instance.");
    return;
  }

  if (!gGeoManager) {
    AliWarning("Cannot create local transformations for supermodules - gGeoManager does not exist.");
    AliInfo("Null shifts and rotations will be created instead.");
    return CreateNullObjects(array, geom);
  }

  Int_t arrayInd = array.GetEntries(), iIndex = 0;
  AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
  UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
  AliAlignObjParams* myobj = 0x0;

  TString SMName;
  Int_t tmpType = -1;
  Int_t SMOrder = 0;

  for (Int_t smodnum = 0; smodnum < geom->GetNumberOfSuperModules(); ++smodnum) {
    if(geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_Standard )      SMName = "FullSupermodule";
    else if(geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_Half )     SMName = "HalfSupermodule";
    else if(geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_3rd )      SMName = "OneThrdSupermodule";
    else if( geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Standard ) SMName = "DCALSupermodule";
    else if( geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Ext )      SMName = "DCALExtensionSM";
    else AliError("Unkown SM Type!!");

    if(geom->GetSMType(smodnum) == tmpType) {
      SMOrder++;
    } else {
      tmpType = geom->GetSMType(smodnum);
      SMOrder = 1;
    }

    TString smodName(TString::Format("EMCAL/%s%d", SMName.Data(), SMOrder));
    AliEMCALSuperModuleDelta t(GetSuperModuleTransformation(smodnum));

    ///////////////////////////////
    // JLK 13-July-2010
    //
    // VERY IMPORTANT!!!!
    //
    // All numbers were calculated in ALICE global c.s., which means
    // that the last argument in the creation of AliAlignObjParams
    // MUST BE set to true
    //////////////////////////////
    new(array[arrayInd])
      AliAlignObjParams(
			smodName.Data(), volid, 
			t.fXShift, t.fYShift, t.fZShift, 
			-t.fPsi, -t.fTheta, -t.fPhi, 
			true
			);
    ++arrayInd;
    myobj = (AliAlignObjParams*)array.UncheckedAt(smodnum);
    printf("==== AliAlignObjParams for SM %d ====\n",smodnum);
    myobj->Print("");

  }

}

//____________________________________________________________________________
void AliEMCALSurvey::CreateNullObjects(TClonesArray &array, const AliEMCALGeometry *geom)const
{
  //Create null shifts and rotations.
  Int_t arrayInd = array.GetEntries(), iIndex = 0;
  AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
  UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);

  TString SMName;
  Int_t tmpType = -1;
  Int_t SMOrder = 0;

  for (Int_t smodnum = 0; smodnum < geom->GetNumberOfSuperModules(); ++smodnum) {
    if(geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_Standard )      SMName = "FullSupermodule";
    else if(geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_Half )     SMName = "HalfSupermodule";
    else if(geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_3rd )      SMName = "OneThrdSupermodule";
    else if( geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Standard ) SMName = "DCALSupermodule";
    else if( geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Ext )      SMName = "DCALExtensionSM";
    else AliError("Unkown SM Type!!");

    if(geom->GetSMType(smodnum) == tmpType) {
      SMOrder++;
    } else {
      tmpType = geom->GetSMType(smodnum);
      SMOrder = 1;
    }
    TString smodName(TString::Format("EMCAL/%s%d", SMName.Data(), SMOrder));

    new(array[arrayInd]) AliAlignObjParams(smodName.Data(), volid, 0., 0., 0., 0., 0., 0., true);
    ++arrayInd;
  }
}

//____________________________________________________________________________
AliEMCALSurvey::AliEMCALSuperModuleDelta AliEMCALSurvey::GetSuperModuleTransformation(Int_t supModIndex)const
{
  //Supermodule transformation.
  AliEMCALSuperModuleDelta t = {0., 0., 0., 0., 0., 0.};
  if (!fSuperModuleData)
    return t;

  return fSuperModuleData[supModIndex];
}

//____________________________________________________________________________
void AliEMCALSurvey::InitSuperModuleData(const TObjArray *svypts)
{
  //This method uses the data points from the EMCAL survey and CATIA program to
  //create the alignment matrices.  Only valid for (installed)
  //SM, others will have null objects
  
  /*--------------------------------------
   The bottom edges of the strip modules
   define the active area of the EMCAL, but
   in software we have a box to hold them which
   is longer than that.  We need to convert
   info about the position of the corners of the
   bottom of the active area to the center of
   the software box that contains the strip
   modules.
   
   View from beam axis up to EMCAL
   Ai                Ci
   
   0,1         0,0 1,0          1,1
   xxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx
   x   x             x x              x   x
   x   x    % *      x x      * %     x   x
   x   x             x x              x   x
   xxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx
   1,1         1,0 0,0          0,1
   <--> = added length                 <--> = added length
   
   * represents the center of the active area
   % represents the center of the full box (with added length)
   
   View from side of topmost SM
   
   Ai                Ci
   
   0,1         0,0 1,0          1,1
   xxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx
   x   x    % *      x x      % *     x   x
   xxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx
   1,1         1,0 0,0          0,1
   <--> = added length                 <--> = added length
   
   * represents the center of the active area
   % represents the center of the full box (with added length)
   
   -------------------------------------*/
  
  AliEMCALGeometry *geom = AliEMCALGeometry::GetInstance();
  //Center of supermodules
  Float_t pars[] = {geom->GetSuperModulesPar(0),geom->GetSuperModulesPar(1),geom->GetSuperModulesPar(2)};
  Double_t rpos = (geom->GetEnvelop(0) + geom->GetEnvelop(1))/2.;
  Float_t fInnerEdge = geom->GetDCALInnerEdge();
  Double_t phi=0, phiRad=0, xpos=0, ypos=0, zpos=0;
  
  AliEMCALSuperModuleCoords *idealSM = new AliEMCALSuperModuleCoords[fNSuperModule];
  for (Int_t smodnum = 0; smodnum < geom->GetNumberOfSuperModules(); ++smodnum) {
    AliEMCALSuperModuleCoords &smc = idealSM[smodnum];
    phiRad = geom->GetPhiCenterOfSMSec(smodnum); //comes in radians
    phi = phiRad*180./TMath::Pi(); //need degrees for AliAlignObjParams
    xpos = rpos * TMath::Cos(phiRad);
    ypos = rpos * TMath::Sin(phiRad);
    zpos = pars[2];
    if(  geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_Half 
      || geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_3rd 
      || geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Ext ) {
      xpos += (pars[1]/2. * TMath::Sin(phiRad));
      ypos -= (pars[1]/2. * TMath::Cos(phiRad));
    } else if( geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Standard) {
        zpos = pars[2] + fInnerEdge/2.;
    }

    smc.fX1 = xpos;
    smc.fY1 = ypos;
    smc.fPhi = phi; //degrees
    smc.fTheta = 0.; //degrees
    smc.fPsi = 0.; //degrees
    if(smodnum%2==0) {
      smc.fZ1 = zpos;
    } else {
      smc.fZ1 = -zpos;
    }
    printf("<SM %d> IDEAL x,y,z positions: %.2f,%.2f,%.2f, IDEAL phi,theta,psi angles: %.2f,%.2f,%.2f\n",smodnum,smc.fX1,smc.fY1,smc.fZ1,smc.fPhi,smc.fTheta,smc.fPsi);
    
  }
  
  //Real coordinates of center and rotation angles need to be computed
  //from the survey/CATIA points
  const Int_t buffersize = 255;
  char substr[buffersize];
  AliEMCALSuperModuleCoords *realSM = new AliEMCALSuperModuleCoords[fNSuperModule];
  for (Int_t smodnum = 0; smodnum < geom->GetNumberOfSuperModules(); ++smodnum) {
    AliEMCALSuperModuleCoords &smc = realSM[smodnum];
    Double_t zLength = pars[2]*2.; //length of SM in z from software
    Double_t halfHeight = pars[0]; //half the height of the SM in y direction
    Double_t halfWidth = pars[1];

    printf("AliEMCALGeometry says zlength = %.2f, halfheight = %.2f, halfwidth = %.2f\n",zLength,halfHeight,halfWidth);
    
    snprintf(substr,buffersize,"4096%d",smodnum);
    //retrieve components of four face points and determine average position of center
    //in x,y,z
    
    std::vector<Double_t> xval;
    std::vector<Double_t> yval;
    std::vector<Double_t> zval;
    
    for(Int_t i = 0; i < svypts->GetEntries(); i++) {
      AliSurveyPoint* pt = (AliSurveyPoint*)svypts->At(i);
      TString ptname = pt->GetPointName();
      if(ptname.Contains(substr)) {
        //Note: order of values is 00, 01, 10, 11
        xval.push_back(pt->GetX()*100.); //convert m to cm
        yval.push_back(pt->GetY()*100.); 
        zval.push_back(pt->GetZ()*100.); 
      }
    }
    
    //compute center of active area of each SM on bottome face from survey points
    Double_t activeX = ((xval[0] + (xval[2] - xval[0])/2.)        //x00 and x10
                        +(xval[1] + (xval[3] - xval[1])/2.) ) /2.; //x01 and x11
    
        Double_t activeY = ((yval[0] + (yval[2] - yval[0])/2.)
    			+(yval[1] + (yval[3] - yval[1])/2.) ) /2.;
        
        Double_t activeZ = ((zval[0] + (zval[2] - zval[0])/2.)
    			+(zval[1] + (zval[3] - zval[1])/2.) ) /2.;
    
    printf("Bottom Center of active area of SM %s: %.2f, %.2f, %.2f\n",substr,activeX,activeY,activeZ);
    
    //compute angles for each SM
    //rotation about each axis
    //phi = angle in x-y plane
    
    Double_t realphi = 0.;
    //Note: this is phi wrt y axis.  To get phi wrt to x, add pi/2
    if(smodnum%2 == 0) {
      realphi = (TMath::ATan((yval[2] - yval[0])/(xval[2] - xval[0])) 
                 +TMath::ATan((yval[3] - yval[1])/(xval[3] - xval[1])) )/2.;
    } else {
      realphi = (TMath::ATan((yval[0] - yval[2])/(xval[0] - xval[2]))
                 +TMath::ATan((yval[1] - yval[3])/(xval[1] - xval[3])) )/2.;
    }
    
    //NOTE: Psi angle is always zero because the two z values being
    //subtracted are exactly the same, but just in case that could change...
    //psi = angle in x-z plane
    Double_t realpsi = (TMath::ATan((zval[0] - zval[2])/(xval[2] - xval[0]))
                        +TMath::ATan((zval[1] - zval[3])/(xval[3] - xval[1])) )/2.;
    
    //theta = angle in y-z plane
    Double_t realtheta = TMath::Pi()/2. 
    + (TMath::ATan((zval[2] - zval[3])/(yval[3] - yval[2]))
       +TMath::ATan((zval[0] - zval[1])/(yval[1] - yval[0])) )/2.;
        
    printf("Old edge of %s 01: %.2f, %.2f, %.2f\n",substr,xval[1],yval[1],zval[1]);
    printf("Old edge of %s 11: %.2f, %.2f, %.2f\n",substr,xval[3],yval[3],zval[3]);
    printf("Real theta angle (degrees) = %.2f\n",realtheta*TMath::RadToDeg());

    //Now calculate the center of the box in z with length added to the 01
    //and 11 corners, corrected by the theta angle
    Double_t activeLength = TMath::Abs(((zval[1] - zval[0]) + (zval[3] - zval[2]))/2.);
    printf("ACTIVE LENGTH = %.2f\n",activeLength);
    if(smodnum%2 == 0) {
      yval[1] += (zLength - activeLength)*sin(realtheta);
      yval[3] += (zLength - activeLength)*sin(realtheta);
      zval[1] += (zLength - activeLength)*cos(realtheta);
      zval[3] += (zLength - activeLength)*cos(realtheta);
    } else {
      yval[1] -= (zLength - activeLength)*sin(realtheta);
      yval[3] -= (zLength - activeLength)*sin(realtheta);
      zval[1] -= (zLength - activeLength)*cos(realtheta);
      zval[3] -= (zLength - activeLength)*cos(realtheta);
    }
    
    printf("New extended edge of %s 01: %.2f, %.2f, %.2f\n",substr,xval[1],yval[1],zval[1]);            
    printf("New extended edge of %s 11: %.2f, %.2f, %.2f\n",substr,xval[3],yval[3],zval[3]);
    
    //Compute the center of the bottom of the box in x,y,z
    Double_t realX = activeX;    
    Double_t realY = ((yval[0] + (yval[2] - yval[0])/2.)
                      +(yval[1] + (yval[3] - yval[1])/2.) ) /2.;    
    Double_t realZ = ((zval[0] + (zval[2] - zval[0])/2.)
                      +(zval[1] + (zval[3] - zval[1])/2.) ) /2.;
    
    
    printf("Bottom Center of SM %s Box: %.2f, %.2f, %.2f\n",substr,realX,realY,realZ);
    
    //correct the SM centers so that we have the center of the box in
    //x,y using the phi,theta angles                   
    realX += halfHeight*TMath::Cos(TMath::Pi()/2+realphi);
    realY += halfHeight*(TMath::Sin(TMath::Pi()/2+realphi) + TMath::Sin(realtheta));
    realZ += halfHeight*TMath::Cos(TMath::Pi()/2-realtheta);
    
    printf("Rotation angles of SM %s (phi,psi,theta) in degrees: %.4f, %.4f, %.4f\n",substr,realphi*TMath::RadToDeg(),realpsi*TMath::RadToDeg(),realtheta*TMath::RadToDeg());
    printf("Middle of SM %s: %.2f, %.2f, %.2f\n\n",substr,realX,realY,realZ);
    
    smc.fX1 = realX;
    smc.fY1 = realY;
    smc.fZ1 = realZ;
    
    smc.fPhi = 90. + realphi*TMath::RadToDeg();
    smc.fTheta = 0. + realtheta*TMath::RadToDeg();
    smc.fPsi = 0. + realpsi*TMath::RadToDeg();
    
  }//loop over supermodules

  //Now take average values for A and C side SMs (0&1,2&3) and set
  //their values to be equal to that average
  for (Int_t i = 0; i < fNSuperModule; i++) {
    if(i%2==0) {
      AliEMCALSuperModuleCoords &realA = realSM[i];
      AliEMCALSuperModuleCoords &realC = realSM[i+1];
      Double_t avgx = (realA.fX1 + realC.fX1)/2.;
      Double_t avgy = (realA.fY1 + realC.fY1)/2.;
      Double_t avgphi = (realA.fPhi + realC.fPhi)/2.;
      Double_t avgtheta = (realA.fTheta + realC.fTheta)/2.;
      Double_t avgpsi = (realA.fPsi + realC.fPsi)/2.;
      printf("AVERAGE VALUES: %.2f,%.2f,%.2f,%.2f,%.2f\n",avgx,avgy,avgphi,avgtheta,avgpsi);
      
      realA.fX1 = avgx;         realC.fX1 = avgx;
      realA.fY1 = avgy;         realC.fY1 = avgy;
      realA.fPhi = avgphi;      realC.fPhi = avgphi;
      realA.fTheta = avgtheta;  realC.fTheta = avgtheta;
      realA.fPsi = avgpsi;      realC.fPhi = avgphi;
    }
  }

  fSuperModuleData = new AliEMCALSuperModuleDelta[fNSuperModule];
  
  for (Int_t i = 0; i < fNSuperModule; ++i) {
    const AliEMCALSuperModuleCoords &real = realSM[i];
    const AliEMCALSuperModuleCoords &ideal = idealSM[i];
    AliEMCALSuperModuleDelta &t = fSuperModuleData[i];
    t.fXShift = real.fX1 - ideal.fX1;
    t.fYShift = real.fY1 - ideal.fY1;
    t.fZShift = real.fZ1 - ideal.fZ1;
    t.fPhi = real.fPhi - ideal.fPhi;
    t.fTheta = real.fTheta - ideal.fTheta;
    t.fPsi = real.fPsi - ideal.fPsi;

    printf("===================== SM %d =======================\n",i);
    printf("real x (%.2f) - ideal x (%.2f) = shift in x (%.2f)\n",real.fX1,ideal.fX1,t.fXShift);
    printf("real y (%.2f) - ideal y (%.2f) = shift in y (%.2f)\n",real.fY1,ideal.fY1,t.fYShift);
    printf("real z (%.2f) - ideal z (%.2f) = shift in z (%.2f)\n",real.fZ1,ideal.fZ1,t.fZShift);
    printf("real theta (%.2f) - ideal theta (%.2f) = shift in theta %.2f\n",real.fTheta,ideal.fTheta,t.fTheta);
    printf("real psi (%.2f) - ideal psi (%.2f) = shift in psi %.2f\n",real.fPsi,ideal.fPsi,t.fPsi);
    printf("real phi (%.2f) - ideal phi (%.2f) = shift in phi %.2f\n",real.fPhi,ideal.fPhi,t.fPhi);
    printf("===================================================\n");    
  }
  
  delete [] realSM;
  delete [] idealSM;
}


//____________________________________________________________________________
void AliEMCALSurvey::InitSuperModuleData(const Double_t *xReal, const Double_t *yReal, 
					 const Double_t *zReal, const Double_t *psiReal,
					 const Double_t *thetaReal, const Double_t *phiReal)
{
  ///////////////////////////////////////
  //Dummy method just takes the inputted values and applies them
  //
  //Useful for testing small changes
  //////////////////////////////////////
  AliEMCALGeometry *geom = AliEMCALGeometry::GetInstance();
  //Center of supermodules
  Float_t pars[] = {geom->GetSuperModulesPar(0),geom->GetSuperModulesPar(1),geom->GetSuperModulesPar(2)};
  Double_t rpos = (geom->GetEnvelop(0) + geom->GetEnvelop(1))/2.;
  Float_t fInnerEdge = geom->GetDCALInnerEdge();
  Double_t phi=0, phiRad=0, xpos=0, ypos=0, zpos=0;

  zpos = pars[2];

  AliEMCALSuperModuleCoords *idealSM = new AliEMCALSuperModuleCoords[fNSuperModule];
  for (Int_t smodnum = 0; smodnum < geom->GetNumberOfSuperModules(); ++smodnum) {
    AliEMCALSuperModuleCoords &smc = idealSM[smodnum];
    phiRad = geom->GetPhiCenterOfSMSec(smodnum); //comes in radians
    phi = phiRad*180./TMath::Pi(); //need degrees for AliAlignObjParams
    xpos = rpos * TMath::Cos(phiRad);
    ypos = rpos * TMath::Sin(phiRad);

    if(  geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_Half
      || geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_3rd
      || geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Ext ) {
      xpos += (pars[1]/2. * TMath::Sin(phiRad));
      ypos -= (pars[1]/2. * TMath::Cos(phiRad));
    } else if( geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Standard) {
        zpos = pars[2] + fInnerEdge/2.;
    }

    smc.fX1 = xpos;
    smc.fY1 = ypos;

    smc.fPhi = phi; //degrees
    smc.fTheta = 0.; //degrees
    smc.fPsi = 0.; //degrees

    if(smodnum%2==0) {
      smc.fZ1 = zpos;
    } else {
      smc.fZ1 = -zpos;
    }

  }

  AliEMCALSuperModuleCoords *realSM = new AliEMCALSuperModuleCoords[fNSuperModule];
  for (Int_t smodnum = 0; smodnum < geom->GetNumberOfSuperModules(); ++smodnum) {
    AliEMCALSuperModuleCoords &smc = realSM[smodnum];
    smc.fX1    = xReal[smodnum];  
    smc.fY1    = yReal[smodnum];  
    smc.fZ1    = zReal[smodnum];  
    smc.fTheta = thetaReal[smodnum];
    smc.fPsi   = psiReal[smodnum];
    smc.fPhi   = phiReal[smodnum];
  }
  
  fSuperModuleData = new AliEMCALSuperModuleDelta[fNSuperModule];
  
  for (Int_t i = 0; i < fNSuperModule; ++i) {
    const AliEMCALSuperModuleCoords &real = realSM[i];
    const AliEMCALSuperModuleCoords &ideal = idealSM[i];
    AliEMCALSuperModuleDelta &t = fSuperModuleData[i];
    t.fTheta = real.fTheta - ideal.fTheta;
    t.fPsi = 0.;
    t.fPhi = real.fPhi - ideal.fPhi;
    t.fXShift = real.fX1 - ideal.fX1;
    t.fYShift = real.fY1 - ideal.fY1;
    t.fZShift = real.fZ1 - ideal.fZ1;

    printf("===================== SM %d =======================\n",i);
    printf("real x (%.2f) - ideal x (%.2f) = shift in x (%.2f)\n",real.fX1,ideal.fX1,t.fXShift);
    printf("real y (%.2f) - ideal y (%.2f) = shift in y (%.2f)\n",real.fY1,ideal.fY1,t.fYShift);
    printf("real z (%.2f) - ideal z (%.2f) = shift in z (%.2f)\n",real.fZ1,ideal.fZ1,t.fZShift);
    printf("real theta (%.2f) - ideal theta (%.2f) = shift in theta %.2f\n",real.fTheta,ideal.fTheta,t.fTheta);
    printf("real psi (%.2f) - ideal psi (%.2f) = shift in psi %.2f\n",real.fPsi,ideal.fPsi,t.fPsi);
    printf("real phi (%.2f) - ideal phi (%.2f) = shift in phi %.2f\n",real.fPhi,ideal.fPhi,t.fPhi);
    printf("===================================================\n");    
  }

  delete [] realSM;
  delete [] idealSM;
}

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