LCOV - code coverage report
Current view: top level - EMCAL/EMCALUtils - AliEMCALEMCGeometry.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 272 468 58.1 %
Date: 2016-06-14 17:26:59 Functions: 11 19 57.9 %

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
       3             :  *                                                                        *
       4             :  * Author: The ALICE Off-line Project.                                    *
       5             :  * Contributors are mentioned in the code where appropriate.              *
       6             :  *                                                                        *
       7             :  * Permission to use, copy, modify and distribute this software and its   *
       8             :  * documentation strictly for non-commercial purposes is hereby granted   *
       9             :  * without fee, provided that the above copyright notice appears in all   *
      10             :  * copies and that both the copyright notice and this permission notice   *
      11             :  * appear in the supporting documentation. The authors make no claims     *
      12             :  * about the suitability of this software for any purpose. It is          *
      13             :  * provided "as is" without express or implied warranty.                  *
      14             :  **************************************************************************/
      15             : 
      16             : // --- Root header files ---
      17             : #include <TObjArray.h>
      18             : #include <TObjString.h>
      19             : #include <TRegexp.h>
      20             : 
      21             : // -- ALICE Headers.
      22             : #include "AliLog.h"
      23             : 
      24             : // --- EMCAL headers
      25             : #include "AliEMCALEMCGeometry.h"
      26             : #include <cassert>
      27             : 
      28          72 : ClassImp(AliEMCALEMCGeometry)
      29             : 
      30             : // these initialisations are needed for a singleton
      31             : Bool_t    AliEMCALEMCGeometry::fgInit      = kFALSE;
      32             : const Char_t*   AliEMCALEMCGeometry::fgkDefaultGeometryName = "EMCAL_COMPLETE12SMV1_DCAL_8SM";
      33             : 
      34             : 
      35             : AliEMCALEMCGeometry::AliEMCALEMCGeometry() 
      36           0 :   : TNamed(),
      37           0 :     fGeoName(0),fArrayOpts(0),fNAdditionalOpts(0),fECPbRadThickness(0.),fECScintThick(0.),
      38           0 :     fNECLayers(0),fArm1PhiMin(0.),fArm1PhiMax(0.),fArm1EtaMin(0.),fArm1EtaMax(0.),fIPDistance(0.),
      39           0 :     fShellThickness(0.),fZLength(0.),fDCALInnerEdge(0.),fDCALPhiMin(0),fDCALPhiMax(0),fEMCALPhiMax(0),
      40           0 :     fDCALStandardPhiMax(0),fDCALInnerExtandedEta(0),fNZ(0),fNPhi(0),fSampling(0.),fNumberOfSuperModules(0),
      41           0 :     fEMCSMSystem(0x0),fFrontSteelStrip(0.),fLateralSteelStrip(0.),fPassiveScintThick(0.),fPhiModuleSize(0.),
      42           0 :     fEtaModuleSize(0.),fPhiTileSize(0.),fEtaTileSize(0.),fLongModuleSize(0.),fPhiSuperModule(0),fNPhiSuperModule(0),
      43           0 :     fNPHIdiv(0),fNETAdiv(0), fNCells(0),fNCellsInSupMod(0),fNCellsInModule(0),
      44           0 :     fTrd1Angle(0.),f2Trd1Dx2(0.),fPhiGapForSM(0.),fKey110DEG(0),fnSupModInDCAL(0),fPhiBoundariesOfSM(0),
      45           0 :     fPhiCentersOfSM(0),fPhiCentersOfSMSec(0),fEtaMaxOfTRD1(0),fTrd1AlFrontThick(0.0), fTrd1BondPaperThick(0.),
      46           0 :     fCentersOfCellsEtaDir(0), fCentersOfCellsXDir(0),fCentersOfCellsPhiDir(0),
      47           0 :     fEtaCentersOfCells(0),fPhiCentersOfCells(0),fShishKebabTrd1Modules(0),
      48           0 :     fParSM(), fILOSS(-1), fIHADR(-1),
      49             :     //obsolete member data
      50           0 :      fGap2Active(0.), fSteelFrontThick(0.), fTrd2AngleY(0.),
      51           0 :     f2Trd2Dy2(0.), fEmptySpace(0.), fTubsR(0.), fTubsTurnAngle(0.)
      52           0 : { 
      53             :   // default ctor only for internal usage (singleton)
      54             :   // must be kept public for root persistency purposes, 
      55             :   // but should never be called by the outside world    
      56           0 :   fParSM[0]=0; fParSM[1]=0; fParSM[2]=0;
      57           0 :   fEnvelop[0] = 0; fEnvelop[1] = 0; fEnvelop[2] = 0;
      58           0 :   for(Int_t i = 0; i < 6; i++) fkAdditionalOpts[i] = "";
      59             :   
      60           0 :   AliDebug(2, "AliEMCALEMCGeometry : default ctor ");
      61           0 : }
      62             : //______________________________________________________________________
      63             : AliEMCALEMCGeometry::AliEMCALEMCGeometry(const Text_t* name, const Text_t* title,
      64             :                                          const Text_t* mcname, const Text_t* mctitle ) :
      65           5 :   TNamed(name,title),
      66          10 :     fGeoName(0),fArrayOpts(0),fNAdditionalOpts(0),fECPbRadThickness(0.),fECScintThick(0.),
      67           5 :     fNECLayers(0),fArm1PhiMin(0.),fArm1PhiMax(0.),fArm1EtaMin(0.),fArm1EtaMax(0.),fIPDistance(0.),
      68           5 :     fShellThickness(0.),fZLength(0.),fDCALInnerEdge(0.),fDCALPhiMin(0),fDCALPhiMax(0),fEMCALPhiMax(0),
      69           5 :     fDCALStandardPhiMax(0),fDCALInnerExtandedEta(0),fNZ(0),fNPhi(0),fSampling(0.),fNumberOfSuperModules(0),
      70           5 :     fEMCSMSystem(0x0),fFrontSteelStrip(0.),fLateralSteelStrip(0.),fPassiveScintThick(0.),fPhiModuleSize(0.),
      71           5 :     fEtaModuleSize(0.),fPhiTileSize(0.),fEtaTileSize(0.),fLongModuleSize(0.),fPhiSuperModule(0),fNPhiSuperModule(0),
      72           5 :     fNPHIdiv(0),fNETAdiv(0), fNCells(0),fNCellsInSupMod(0),fNCellsInModule(0),
      73           5 :     fTrd1Angle(0.),f2Trd1Dx2(0.),fPhiGapForSM(0.),fKey110DEG(0),fnSupModInDCAL(0),fPhiBoundariesOfSM(0),
      74          15 :     fPhiCentersOfSM(0),fPhiCentersOfSMSec(0),fEtaMaxOfTRD1(0),fTrd1AlFrontThick(0.0), fTrd1BondPaperThick(0.),
      75          15 :     fCentersOfCellsEtaDir(0),fCentersOfCellsXDir(0),fCentersOfCellsPhiDir(0),
      76          15 :     fEtaCentersOfCells(0),fPhiCentersOfCells(0),fShishKebabTrd1Modules(0),
      77           5 :     fParSM(),fILOSS(-1), fIHADR(-1), 
      78             :     //obsolete member data
      79           5 :     fGap2Active(0.), fSteelFrontThick(0.), fTrd2AngleY(0.),
      80           5 :     f2Trd2Dy2(0.), fEmptySpace(0.), fTubsR(0.), fTubsTurnAngle(0.)
      81          25 : {
      82             :   // ctor only for internal usage (singleton)
      83          25 :   AliDebug(2, Form("AliEMCALEMCGeometry(%s,%s,%s,%s) ", name,title,mcname,mctitle));
      84             : 
      85           5 :   Init(mcname,mctitle);
      86             : 
      87             :   //  CreateListOfTrd1Modules();
      88             : 
      89          20 :   if (AliDebugLevel()>=2) {
      90           0 :     PrintGeometry();
      91             :   }
      92             : 
      93          10 : }
      94             : //______________________________________________________________________
      95             : AliEMCALEMCGeometry::AliEMCALEMCGeometry(const AliEMCALEMCGeometry& geom)
      96           0 :   : TNamed(geom),
      97           0 :     fGeoName(geom.fGeoName),
      98           0 :     fArrayOpts(geom.fArrayOpts),
      99           0 :     fNAdditionalOpts(geom.fNAdditionalOpts),
     100           0 :     fECPbRadThickness(geom.fECPbRadThickness),
     101           0 :     fECScintThick(geom.fECScintThick),
     102           0 :     fNECLayers(geom.fNECLayers),
     103           0 :     fArm1PhiMin(geom.fArm1PhiMin),
     104           0 :     fArm1PhiMax(geom.fArm1PhiMax),
     105           0 :     fArm1EtaMin(geom.fArm1EtaMin),
     106           0 :     fArm1EtaMax(geom.fArm1EtaMax),
     107           0 :     fIPDistance(geom.fIPDistance),
     108           0 :     fShellThickness(geom.fShellThickness),
     109           0 :     fZLength(geom.fZLength),
     110           0 :     fDCALInnerEdge(geom.fDCALInnerEdge),
     111           0 :     fDCALPhiMin(geom.fDCALPhiMin),
     112           0 :     fDCALPhiMax(geom.fDCALPhiMax),
     113           0 :     fEMCALPhiMax(geom.fEMCALPhiMax),
     114           0 :     fDCALStandardPhiMax(geom.fDCALStandardPhiMax),
     115           0 :     fDCALInnerExtandedEta(geom.fDCALInnerExtandedEta),
     116           0 :     fNZ(geom.fNZ),
     117           0 :     fNPhi(geom.fNPhi),
     118           0 :     fSampling(geom.fSampling),
     119           0 :     fNumberOfSuperModules(geom.fNumberOfSuperModules),
     120           0 :     fEMCSMSystem(new Int_t[fNumberOfSuperModules]),
     121           0 :     fFrontSteelStrip(geom.fFrontSteelStrip),
     122           0 :     fLateralSteelStrip(geom.fLateralSteelStrip),
     123           0 :     fPassiveScintThick(geom.fPassiveScintThick),
     124           0 :     fPhiModuleSize(geom.fPhiModuleSize),
     125           0 :     fEtaModuleSize(geom.fEtaModuleSize),
     126           0 :     fPhiTileSize(geom.fPhiTileSize),
     127           0 :     fEtaTileSize(geom.fEtaTileSize),
     128           0 :     fLongModuleSize(geom.fLongModuleSize),
     129           0 :     fPhiSuperModule(geom.fPhiSuperModule),
     130           0 :     fNPhiSuperModule(geom.fNPhiSuperModule),
     131           0 :     fNPHIdiv(geom.fNPHIdiv),
     132           0 :     fNETAdiv(geom.fNETAdiv),
     133           0 :     fNCells(geom.fNCells),
     134           0 :     fNCellsInSupMod(geom.fNCellsInSupMod),
     135           0 :     fNCellsInModule(geom.fNCellsInModule),
     136           0 :     fTrd1Angle(geom.fTrd1Angle),
     137           0 :     f2Trd1Dx2(geom.f2Trd1Dx2),
     138           0 :     fPhiGapForSM(geom.fPhiGapForSM),
     139           0 :     fKey110DEG(geom.fKey110DEG),
     140           0 :     fnSupModInDCAL(geom.fnSupModInDCAL),
     141           0 :     fPhiBoundariesOfSM(geom.fPhiBoundariesOfSM),
     142           0 :     fPhiCentersOfSM(geom.fPhiCentersOfSM),
     143           0 :     fPhiCentersOfSMSec(geom.fPhiCentersOfSMSec),
     144           0 :     fEtaMaxOfTRD1(geom.fEtaMaxOfTRD1),
     145           0 :     fTrd1AlFrontThick(geom.fTrd1AlFrontThick),
     146           0 :     fTrd1BondPaperThick(geom.fTrd1BondPaperThick),
     147           0 :     fCentersOfCellsEtaDir(geom.fCentersOfCellsEtaDir),
     148           0 :     fCentersOfCellsXDir(geom.fCentersOfCellsXDir),
     149           0 :     fCentersOfCellsPhiDir(geom.fCentersOfCellsPhiDir),
     150           0 :     fEtaCentersOfCells(geom.fEtaCentersOfCells),
     151           0 :     fPhiCentersOfCells(geom.fPhiCentersOfCells),
     152           0 :     fShishKebabTrd1Modules(geom.fShishKebabTrd1Modules),
     153           0 :     fILOSS(geom.fILOSS), fIHADR(geom.fIHADR),
     154             :     //obsolete member data
     155           0 :     fGap2Active(geom.fGap2Active),
     156           0 :     fSteelFrontThick(geom.fSteelFrontThick),
     157           0 :     fTrd2AngleY(geom.fTrd2AngleY),
     158           0 :     f2Trd2Dy2(geom.f2Trd2Dy2),
     159           0 :     fEmptySpace(geom.fEmptySpace),
     160           0 :     fTubsR(geom.fTubsR),
     161           0 :     fTubsTurnAngle(geom.fTubsTurnAngle)
     162           0 : {
     163             :   //copy ctor
     164           0 :   for(Int_t i=0;i<fNumberOfSuperModules;i++)
     165           0 :     fEMCSMSystem[i] = geom.fEMCSMSystem[i];
     166           0 :   fParSM[0]=geom.fParSM[0]; 
     167           0 :   fParSM[1]=geom.fParSM[1]; 
     168           0 :   fParSM[2]=geom.fParSM[2];
     169           0 :   fEnvelop[0] = geom.fEnvelop[0]; 
     170           0 :   fEnvelop[1] = geom.fEnvelop[1]; 
     171           0 :   fEnvelop[2] = geom.fEnvelop[2];
     172           0 :   for(Int_t i = 0; i < 6; i++) fkAdditionalOpts[i] = geom.fkAdditionalOpts[i];
     173             : 
     174           0 : }
     175             : 
     176             : //______________________________________________________________________
     177           0 : AliEMCALEMCGeometry::~AliEMCALEMCGeometry(void){
     178             :     // dtor
     179           0 :   delete[] fEMCSMSystem; // was created with new[], note the brackets
     180             :   // TODO, FIXME Hans, Aug 2015: Shouldn't one add
     181             :   // if(fArrayOpts){fArrayOpts->Delete();delete fArrayOpts;}
     182             :   // End Hans, Aug 2015
     183             : 
     184           0 : }
     185             : 
     186             : //______________________________________________________________________
     187             : void AliEMCALEMCGeometry::Init(const Text_t* mcname, const Text_t* mctitle){
     188             :   //
     189             :   // Initializes the EMCAL parameters based on the name
     190             :   // Only Shashlyk geometry is available, but various combinations of
     191             :   // layers and number of supermodules can be selected with additional
     192             :   // options or geometry name
     193             :   //
     194             : 
     195          10 :   fkAdditionalOpts[0] = "nl=";       // number of sampling layers (fNECLayers)
     196           5 :   fkAdditionalOpts[1] = "pbTh=";     // cm, Thickness of the Pb   (fECPbRadThick)
     197           5 :   fkAdditionalOpts[2] = "scTh=";     // cm, Thickness of the Sc    (fECScintThick)
     198           5 :   fkAdditionalOpts[3] = "latSS=";    // cm, Thickness of lateral steel strip (fLateralSteelStrip)
     199           5 :   fkAdditionalOpts[4] = "allILOSS="; // = 0,1,2,3,4 (4 - energy loss without fluctuation)
     200           5 :   fkAdditionalOpts[5] = "allIHADR="; // = 0,1,2 (0 - no hadronic interaction)
     201             : 
     202           5 :   fNAdditionalOpts = sizeof(fkAdditionalOpts) / sizeof(char*);
     203             : 
     204             :   // geometry
     205           5 :   fgInit = kFALSE; // Assume failed until proven otherwise.
     206           5 :   fGeoName   = GetName();
     207           5 :   fGeoName.ToUpper();
     208             : 
     209             :   //Convert old geometry names to new ones
     210           5 :   if(fGeoName.Contains("SHISH_77_TRD1_2X2_FINAL_110DEG")) {
     211           0 :     if(fGeoName.Contains("PBTH=0.144") && fGeoName.Contains("SCTH=0.176")) {
     212           0 :       fGeoName = "EMCAL_COMPLETE";
     213           0 :     } else {
     214           0 :       fGeoName = "EMCAL_PDC06";
     215             :     }
     216             :   }
     217             :   
     218           5 :   if(fGeoName.Contains("WSUC")) fGeoName = "EMCAL_WSUC";
     219             : 
     220             :   //check that we have a valid geometry name
     221           5 :   if(!( fGeoName.Contains("EMCAL_PDC06")
     222          10 :      || fGeoName.Contains("EMCAL_WSUC")  
     223          10 :      || fGeoName.Contains("EMCAL_COMPLETE")
     224           5 :      || fGeoName.Contains("EMCAL_COMPLETEV1")
     225           0 :      || fGeoName.Contains("EMCAL_COMPLETE12SMV1") 
     226           0 :      || fGeoName.Contains("EMCAL_FIRSTYEAR")
     227           0 :      || fGeoName.Contains("EMCAL_FIRSTYEARV1") )) {
     228           0 :     Fatal("Init", "%s is an undefined geometry!", fGeoName.Data()) ; 
     229           0 :   }
     230             : 
     231             :   // Option to know whether we have the "half" supermodule(s) or not
     232           5 :   fKey110DEG = 0;
     233           5 :   if(  fGeoName.Contains("COMPLETE")
     234           5 :     || fGeoName.Contains("PDC06") 
     235           5 :     || fGeoName.Contains("12SM")) fKey110DEG = 1; // for GetAbsCellId
     236           8 :   if(fGeoName.Contains("COMPLETEV1"))  fKey110DEG = 0; 
     237           5 :   fShishKebabTrd1Modules = 0;
     238             : 
     239           5 :   fnSupModInDCAL = 0;
     240           5 :   if(fGeoName.Contains("DCAL_DEV")){
     241           0 :     fnSupModInDCAL = 10;  
     242           5 :   } else if(fGeoName.Contains("DCAL_8SM")){
     243           2 :     fnSupModInDCAL = 8;
     244           5 :   } else if(fGeoName.Contains("DCAL")){
     245           0 :     fnSupModInDCAL = 6;
     246           0 :   }
     247             : 
     248             :   // JLK 13-Apr-2008
     249             :   //default parameters are those of EMCAL_COMPLETE geometry
     250             :   //all others render variations from these at the end of
     251             :   //geometry-name specific options
     252             : 
     253           5 :   fNumberOfSuperModules = 12;       // 12 = 6 * 2 (6 in phi, 2 in Z)
     254           5 :   fNPhi                 = 12;       // module granularity in phi within smod (azimuth)
     255           5 :   fNZ                   = 24;       // module granularity along Z within smod (eta)
     256           5 :   fNPHIdiv = fNETAdiv   = 2;        // tower granularity within module
     257           5 :   fArm1PhiMin           = 80.0;     // degrees, Starting EMCAL Phi position
     258           5 :   fArm1PhiMax           = 200.0;    // degrees, Ending EMCAL Phi position
     259           5 :   fArm1EtaMin           = -0.7;     // pseudorapidity, Starting EMCAL Eta position
     260           5 :   fArm1EtaMax           = +0.7;     // pseudorapidity, Ending EMCAL Eta position
     261           5 :   fIPDistance           = 428.0;    // cm, radial distance to front face from nominal vertex point
     262           5 :   fPhiGapForSM          = 2.;       // cm, only for final TRD1 geometry
     263           5 :   fFrontSteelStrip      = 0.025;    // 0.025cm = 0.25mm  (13-may-05 from V.Petrov)
     264           5 :   fPassiveScintThick    = 0.8;      // 0.8cm   = 8mm     (13-may-05 from V.Petrov)
     265           5 :   fLateralSteelStrip    = 0.01;     // 0.01cm  = 0.1mm   (13-may-05 from V.Petrov) - was 0.025
     266           5 :   fTrd1Angle            = 1.5;      // in degrees       
     267             : 
     268           5 :   fSampling             = 1.;       // should be calculated with call to DefineSamplingFraction()
     269           5 :   fNECLayers            = 77;       // (13-may-05 from V.Petrov) - can be changed with additional options
     270           5 :   fECScintThick         = 0.176;    // scintillator layer thickness
     271           5 :   fECPbRadThickness     = 0.144;    // lead layer thickness
     272             : 
     273           5 :   fPhiModuleSize = 12.26 - fPhiGapForSM / Float_t(fNPhi); // first assumption
     274           5 :   fEtaModuleSize = fPhiModuleSize;
     275             : 
     276           5 :   fZLength              = 700.;     // Z coverage (cm)
     277           5 :   fPhiSuperModule       = 20. ;     // phi in degree
     278           5 :   fDCALInnerEdge        = fIPDistance * TMath::Tan( fTrd1Angle * 8.* TMath::DegToRad());
     279             : 
     280             :   //needs to be called for each geometry and before setting geometry
     281             :   //parameters which can depend on the outcome
     282           5 :   CheckAdditionalOptions();
     283             : 
     284             :   //modifications to the above for PDC06 geometry
     285           5 :   if(fGeoName.Contains("PDC06")){ // 18-may-05 - about common structure
     286           0 :     fECScintThick  = fECPbRadThickness = 0.16;// (13-may-05 from V.Petrov)    
     287           0 :     CheckAdditionalOptions();
     288           0 :   }
     289             : 
     290             :   //modifications to the above for WSUC geometry
     291           5 :   if(fGeoName.Contains("WSUC")){ // 18-may-05 - about common structure
     292           0 :     fNumberOfSuperModules = 2;  // 27-may-05; Nov 24,2010 for TB
     293           0 :     fNPhi = fNZ = 4; 
     294           0 :     fTrd1AlFrontThick   = 1.0;  // one cm
     295             :     // Bond paper - two sheets around Sc tile
     296           0 :     fTrd1BondPaperThick = 0.01; // 0.01cm = 0.1 mm
     297             :     
     298           0 :     fPhiModuleSize = 12.0;
     299           0 :     fEtaModuleSize = fPhiModuleSize;
     300           0 :     fLateralSteelStrip = 0.015; // 0.015cm  = 0.15mm
     301             : 
     302           0 :     CheckAdditionalOptions();
     303           0 :   }
     304             : 
     305             :   //In 2009-2010 data taking runs only 4 SM, in the upper position.
     306           5 :   if(fGeoName.Contains("FIRSTYEAR")){ 
     307           0 :     fNumberOfSuperModules = 4;  
     308           0 :     fArm1PhiMax           = 120.0;
     309           0 :     CheckAdditionalOptions();   
     310           0 :   }
     311             :   
     312          12 :   if(fGeoName.Contains("FIRSTYEARV1") || fGeoName.Contains("COMPLETEV1") || fGeoName.Contains("COMPLETE12SMV1") ){
     313             :     // Oct 26,2010 : First module has tilt = 0.75 degree : 
     314             :     // look to AliEMCALShishKebabTrd1Module::DefineFirstModule(key)
     315             :     // New sizes from production drawing, added Al front plate.
     316             :     // The thickness of sampling is change due to existing two sheets of paper.
     317             :     
     318             :     // Will replace fFrontSteelStrip
     319           5 :     fTrd1AlFrontThick   = 1.0;  // one cm
     320             :     // Bond paper - two sheets around Sc tile
     321           5 :     fTrd1BondPaperThick = 0.01; // 0.01cm = 0.1 mm
     322             :     
     323           5 :     fPhiModuleSize = 12.0;
     324           5 :     fEtaModuleSize = fPhiModuleSize;
     325           5 :     fLateralSteelStrip = 0.015; // 0.015cm  = 0.15mm
     326             :     
     327           5 :     if(fGeoName.Contains("COMPLETEV1"))
     328             :     {
     329           3 :       fNumberOfSuperModules = 10;       
     330           3 :       fArm1PhiMax           = 180.0;
     331           3 :     }
     332           2 :     else if (fGeoName.Contains("COMPLETE12SMV1"))
     333             :     {
     334           2 :       fNumberOfSuperModules = 12;       
     335           2 :       fArm1PhiMax           = 200.0; 
     336           2 :     }
     337           5 :     if (fGeoName.Contains("DCAL"))
     338             :     {
     339           2 :       fNumberOfSuperModules = 12 + fnSupModInDCAL;
     340           2 :       fArm1PhiMax           = 320.0; 
     341           4 :       if(fGeoName.Contains("DCAL_8SM"))      fArm1PhiMax      = 340.0;            // degrees, End of DCAL Phi position
     342           0 :       else if(fGeoName.Contains("DCAL_DEV")) fArm1PhiMin      = 40.0;     // degrees, Starting EMCAL(shifted) Phi position
     343           2 :       fDCALPhiMin           = fArm1PhiMax - 10.*fnSupModInDCAL; 
     344           2 :     }
     345           5 :     CheckAdditionalOptions();   
     346           5 :   }
     347             :   
     348             :   //
     349             :   // Init EMCal/DCal SMs type array
     350           5 :   if(fEMCSMSystem) delete[] fEMCSMSystem;
     351             :   
     352           5 :   fEMCSMSystem = new Int_t[fNumberOfSuperModules];
     353             :   
     354         150 :   for(Int_t i=0;i<fNumberOfSuperModules;i++)
     355          70 :     fEMCSMSystem[i]=kNotExistent;
     356             :   
     357             :   Int_t iSM = 0;
     358             :   
     359             :   //
     360             :   // BASIC EMCAL SM
     361           5 :   if(fGeoName.Contains("WSUC") ){
     362           0 :     for(int i = 0; i<2; i++){
     363           0 :       fEMCSMSystem[iSM] = kEMCAL_Standard;
     364           0 :       iSM++;
     365             :     }
     366           5 :   } else if(fGeoName.Contains("FIRSTYEAR") ){
     367           0 :     for(int i = 0; i<4; i++){
     368           0 :       fEMCSMSystem[iSM] = kEMCAL_Standard;
     369           0 :       iSM++;
     370             :     }
     371          10 :   } else if( fGeoName.Contains("PDC06")
     372          10 :             || fGeoName.Contains("COMPLETE") ){
     373         110 :     for(int i = 0; i<10; i++){
     374          50 :       fEMCSMSystem[iSM] = kEMCAL_Standard;
     375          50 :       iSM++;
     376             :     }
     377           5 :   }
     378             :   
     379             :   //
     380             :   // EMCAL 110SM
     381           7 :   if(fKey110DEG && fGeoName.Contains("12SM") ){
     382          12 :     for(int i = 0; i<2; i++){
     383           4 :       fEMCSMSystem[iSM] = kEMCAL_Half;
     384           4 :       if(fGeoName.Contains("12SMV1") ){
     385           4 :         fEMCSMSystem[iSM] = kEMCAL_3rd;
     386           4 :       }
     387           4 :       iSM++;
     388             :     }
     389           2 :   }
     390             :   
     391             :   //
     392             :   // DCAL SM
     393           7 :   if(fnSupModInDCAL && fGeoName.Contains("DCAL")){
     394           2 :     if(fGeoName.Contains("8SM")) {
     395          28 :       for(int i = 0; i<fnSupModInDCAL-2; i++){
     396          12 :         fEMCSMSystem[iSM] = kDCAL_Standard;
     397          12 :         iSM++;
     398             :       }
     399          12 :       for(int i = 0; i<2; i++){
     400           4 :         fEMCSMSystem[iSM] = kDCAL_Ext;
     401           4 :         iSM++;
     402             :       }
     403           2 :     } else {
     404           0 :       for(int i = 0; i<fnSupModInDCAL; i++){
     405           0 :         fEMCSMSystem[iSM] = kDCAL_Standard;
     406           0 :         iSM++;
     407             :       }
     408             :     }
     409             :   }
     410             : 
     411             :   // constant for transition absid <--> indexes
     412           5 :   fNCellsInModule = fNPHIdiv*fNETAdiv;
     413           5 :   fNCellsInSupMod = fNCellsInModule*fNPhi*fNZ;
     414           5 :   fNCells = 0;
     415         150 :    for( int i=0; i<fNumberOfSuperModules; i++) {
     416         120 :      if(      GetSMType(i) == kEMCAL_Standard) fNCells +=   fNCellsInSupMod   ;
     417          20 :      else if( GetSMType(i) == kEMCAL_Half)     fNCells +=   fNCellsInSupMod/2 ;
     418          24 :      else if( GetSMType(i) == kEMCAL_3rd)      fNCells +=   fNCellsInSupMod/3 ;
     419          28 :      else if( GetSMType(i) == kDCAL_Standard)  fNCells += 2*fNCellsInSupMod/3 ;
     420           8 :      else if( GetSMType(i) == kDCAL_Ext)       fNCells +=   fNCellsInSupMod/3 ;
     421           0 :      else AliError(Form("Uknown SuperModule Type !!"));
     422             :    }
     423             : 
     424           5 :   fNPhiSuperModule = fNumberOfSuperModules/2;
     425           5 :   if(fNPhiSuperModule < 1) fNPhiSuperModule = 1;
     426             :     
     427           5 :   fPhiTileSize = fPhiModuleSize/double(fNPHIdiv) - fLateralSteelStrip; // 13-may-05 
     428           5 :   fEtaTileSize = fEtaModuleSize/double(fNETAdiv) - fLateralSteelStrip; // 13-may-05 
     429             : 
     430           5 :   fLongModuleSize = fNECLayers*(fECScintThick + fECPbRadThickness);  
     431           5 :   if(fGeoName.Contains("V1")){
     432           5 :     Double_t ws = fECScintThick + fECPbRadThickness + 2.*fTrd1BondPaperThick; // sampling width
     433             :     // Number of Pb tiles = Number of Sc tiles - 1
     434           5 :     fLongModuleSize = fTrd1AlFrontThick + (ws*fNECLayers - fECPbRadThickness);
     435           5 :   }
     436           5 :   f2Trd1Dx2 = fEtaModuleSize + 2.*fLongModuleSize*TMath::Tan(fTrd1Angle*TMath::DegToRad()/2.);
     437             : 
     438          10 :   if(!fGeoName.Contains("WSUC")) fShellThickness  = TMath::Sqrt(fLongModuleSize*fLongModuleSize + f2Trd1Dx2*f2Trd1Dx2);
     439             : 
     440             :   //These parameters are used to create the mother volume to hold the supermodules
     441             :   //2cm padding added to allow for misalignments - JLK 30-May-2008
     442           5 :   fEnvelop[0]     = fIPDistance - 1.; // mother volume inner radius
     443           5 :   fEnvelop[1]     = fIPDistance + fShellThickness + 1.; // mother volume outer r.
     444           5 :   fEnvelop[2]     = fZLength + 2.; //mother volume length 
     445             : 
     446             :   // Local coordinates
     447           5 :   fParSM[0] = GetShellThickness()/2.;        
     448           5 :   fParSM[1] = GetPhiModuleSize() * GetNPhi()/2.;
     449           5 :   fParSM[2] = fZLength/4.;  //divide by 4 to get half-length of SM
     450             : 
     451             :   // SM phi boundaries - (0,1),(2,3) ... - has the same boundaries;
     452           5 :   fPhiBoundariesOfSM.Set(fNumberOfSuperModules);
     453           5 :   fPhiCentersOfSM.Set(fNumberOfSuperModules/2);
     454           5 :   fPhiCentersOfSMSec.Set(fNumberOfSuperModules/2);
     455           5 :   Double_t kfSupermodulePhiWidth = fPhiSuperModule*TMath::DegToRad();
     456           5 :   fPhiCentersOfSM[0]    = (fArm1PhiMin + fPhiSuperModule/2.) * TMath::DegToRad(); // Define from First SM
     457           5 :   fPhiCentersOfSMSec[0] = fPhiCentersOfSM[0];  // the same in the First SM
     458           5 :   fPhiBoundariesOfSM[0] = fPhiCentersOfSM[0] - TMath::ATan2(fParSM[1] , fIPDistance); // 1th and 2th modules)
     459           5 :   fPhiBoundariesOfSM[1] = fPhiCentersOfSM[0] + TMath::ATan2(fParSM[1] , fIPDistance);
     460           5 :   if(fNumberOfSuperModules > 2) { // 2 to Max
     461           5 :     Int_t tmpSMType = GetSMType(2);
     462          70 :      for(int i = 1; i<fNPhiSuperModule; i++) {
     463          30 :        fPhiBoundariesOfSM[2*i]   += fPhiBoundariesOfSM[2*i-2] + kfSupermodulePhiWidth;
     464          30 :        if(tmpSMType == GetSMType(2*i)) {
     465          24 :          fPhiBoundariesOfSM[2*i+1]  += fPhiBoundariesOfSM[2*i-1] + kfSupermodulePhiWidth;
     466          24 :        } else { 
     467             :          //changed SM Type, redefine the [2*i+1] Boundaries
     468           6 :          tmpSMType = GetSMType(2*i);
     469           6 :          if(        GetSMType(2*i)  == kEMCAL_Standard) {
     470           0 :            fPhiBoundariesOfSM[2*i+1] = fPhiBoundariesOfSM[2*i] + kfSupermodulePhiWidth;
     471           6 :          } else if( GetSMType(2*i)  == kEMCAL_Half)     {
     472           0 :            fPhiBoundariesOfSM[2*i+1] = fPhiBoundariesOfSM[2*i] + 2.*TMath::ATan2((fParSM[1])/2, fIPDistance);
     473           6 :          } else if( GetSMType(2*i)  == kEMCAL_3rd )     {
     474           2 :            fPhiBoundariesOfSM[2*i+1] = fPhiBoundariesOfSM[2*i] + 2.*TMath::ATan2((fParSM[1])/3, fIPDistance);
     475           6 :          } else if( GetSMType(2*i)  == kDCAL_Standard ) {      // jump the gap
     476           2 :            fPhiBoundariesOfSM[2*i]   = (fDCALPhiMin - fArm1PhiMin)*TMath::DegToRad() + fPhiBoundariesOfSM[0];
     477           2 :            fPhiBoundariesOfSM[2*i+1] = (fDCALPhiMin - fArm1PhiMin)*TMath::DegToRad() + fPhiBoundariesOfSM[1];
     478           4 :          } else if( GetSMType(2*i)  == kDCAL_Ext)       {
     479           2 :            fPhiBoundariesOfSM[2*i+1] = fPhiBoundariesOfSM[2*i] + 2.*TMath::ATan2((fParSM[1])/3, fIPDistance); 
     480           2 :          }
     481             :       }
     482          30 :       fPhiCentersOfSM[i]    = (fPhiBoundariesOfSM[2*i]+fPhiBoundariesOfSM[2*i+1])/2.;
     483          30 :       fPhiCentersOfSMSec[i] = fPhiBoundariesOfSM[2*i] + TMath::ATan2(fParSM[1] , fIPDistance);
     484             :     }
     485           5 :   }
     486             : 
     487             :   //inner extend in eta (same as outer part) for DCal (0.189917), //calculated from the smallest gap (1# cell to the 80-degree-edge),
     488             :   Double_t fInnerExtandedPhi = 1.102840997; //calculated from the smallest gap (1# cell to the 80-degree-edge), too complicatd to explain...
     489           5 :   fDCALInnerExtandedEta = -TMath::Log(TMath::Tan( (TMath::Pi()/2. - 8*fTrd1Angle*TMath::DegToRad() + (TMath::Pi()/2 - fNZ*fTrd1Angle*TMath::DegToRad() - TMath::ATan(TMath::Exp(fArm1EtaMin))*2))/2.));
     490             : 
     491           5 :   fEMCALPhiMax  = fArm1PhiMin;    
     492           5 :   fDCALPhiMax   = fDCALPhiMin;// DCAl extention will not be included
     493          80 :   for( Int_t i = 0; i < fNumberOfSuperModules; i+=2) {
     494          60 :     if(      GetSMType(i) == kEMCAL_Standard ) fEMCALPhiMax += 20.;
     495          10 :     else if( GetSMType(i) == kEMCAL_Half     ) fEMCALPhiMax += fPhiSuperModule/2. + fInnerExtandedPhi;
     496          12 :     else if( GetSMType(i) == kEMCAL_3rd      ) fEMCALPhiMax += fPhiSuperModule/3. + 4.0*fInnerExtandedPhi/3.0;
     497          14 :     else if( GetSMType(i) == kDCAL_Standard  ) {fDCALPhiMax  += 20.; fDCALStandardPhiMax = fDCALPhiMax;}
     498           4 :     else if( GetSMType(i) == kDCAL_Ext       ) fDCALPhiMax  += fPhiSuperModule/3. + 4.0*fInnerExtandedPhi/3.0;
     499           0 :     else AliError("Unkown SM Type!!");
     500             :   }
     501             : // for compatible reason
     502             : // if(fNumberOfSuperModules == 4) {fEMCALPhiMax = fArm1PhiMax ;}
     503           5 :  if(fNumberOfSuperModules == 12) {fEMCALPhiMax = fArm1PhiMax ;}  
     504             :   
     505             :   // called after setting of scintillator and lead layer parameters
     506             :   // called now in AliEMCALv0::CreateGeometry() - 15/03/16
     507             :   //DefineSamplingFraction(mcname,mctitle);
     508             : 
     509           5 :   fgInit = kTRUE; 
     510           5 : }
     511             : 
     512             : //___________________________________________________________________
     513             : void AliEMCALEMCGeometry::PrintGeometry()
     514             : {
     515             :   // Separate routine is callable from broswer; Nov 7,2006
     516           8 :   printf("\nInit: geometry of EMCAL named %s :\n", fGeoName.Data());
     517           4 :   if(fArrayOpts) {
     518           0 :     for(Int_t i=0; i<fArrayOpts->GetEntries(); i++){
     519           0 :       TObjString *o = (TObjString*)fArrayOpts->At(i);
     520           0 :       printf(" %i : %s \n", i, o->String().Data());
     521             :     }
     522           0 :   }
     523           4 :   if(fGeoName.Contains("DCAL")) {
     524           0 :    printf("Phi min of DCAL SuperModule: %7.1f, DCAL has %d SuperModule\n", fDCALPhiMin, fnSupModInDCAL);
     525           0 :    printf("The DCAL inner edge is +- %7.1f\n", fDCALInnerEdge);
     526           0 :     if(fGeoName.Contains("DCAL_8SM")) printf("DCAL has its 2 EXTENTION SM\n");
     527             :   }
     528           4 :   printf("Granularity: %d in eta and %d in phi\n", GetNZ(), GetNPhi()) ;
     529           4 :   printf("Layout: phi = (%7.1f, %7.1f), eta = (%5.2f, %5.2f), IP = %7.2f -> for EMCAL envelope only\n",  
     530           4 :            GetArm1PhiMin(), GetArm1PhiMax(),GetArm1EtaMin(), GetArm1EtaMax(), GetIPDistance() );
     531             : 
     532           4 :   printf( "               ECAL      : %d x (%f cm Pb, %f cm Sc) \n", 
     533           4 :   GetNECLayers(), GetECPbRadThick(), GetECScintThick() ) ; 
     534           4 :   printf("                fSampling %5.2f \n",  fSampling );
     535           4 :   printf(" fIPDistance       %6.3f cm \n", fIPDistance);
     536           4 :   printf(" fNPhi %i   |  fNZ %i \n", fNPhi, fNZ);
     537           4 :   printf(" fNCellsInModule %i : fNCellsInSupMod %i : fNCells %i\n",fNCellsInModule, fNCellsInSupMod, fNCells);
     538           4 :   printf(" X:Y module size     %6.3f , %6.3f cm \n", fPhiModuleSize, fEtaModuleSize);
     539           4 :   printf(" X:Y   tile size     %6.3f , %6.3f cm \n", fPhiTileSize, fEtaTileSize);
     540           4 :   printf(" #of sampling layers %i(fNECLayers) \n", fNECLayers);
     541           4 :   printf(" fLongModuleSize     %6.3f cm \n", fLongModuleSize);
     542           4 :   printf(" #supermodule in phi direction %i \n", fNPhiSuperModule );
     543           4 :   printf(" supermodule width in phi direction %f \n", fPhiSuperModule );
     544           4 :   printf(" fILOSS %i : fIHADR %i \n", fILOSS, fIHADR);
     545           4 :   printf(" fTrd1Angle %7.4f\n", fTrd1Angle);
     546           4 :   printf(" f2Trd1Dx2  %7.4f\n",  f2Trd1Dx2);
     547           4 :   printf(" fTrd1AlFrontThick   %7.4f \n", fTrd1AlFrontThick);
     548           4 :   printf(" fTrd1BondPaperThick %5.4f \n", fTrd1BondPaperThick);
     549           4 :   printf("SM dimensions(TRD1) : dx %7.2f dy %7.2f dz %7.2f (SMOD, BOX)\n", 
     550           4 :          fParSM[0],fParSM[1],fParSM[2]);
     551           4 :   printf(" fPhiGapForSM  %7.4f cm (%7.4f <- phi size in degree)\n",  
     552           4 :          fPhiGapForSM, TMath::ATan2(fPhiGapForSM,fIPDistance)*TMath::RadToDeg());
     553           4 :   if( fKey110DEG && !fGeoName.Contains("12SMV1") ) printf(" Last two modules have size 10 degree in  phi (180<phi<190)\n");
     554           4 :   if( fKey110DEG && fGeoName.Contains("12SMV1")) printf(" Last two modules have size 6.6 degree in  phi (180<phi<186.6)\n");
     555           4 :   printf(" phi SM boundaries \n"); 
     556          48 :   for(int i=0; i<fPhiBoundariesOfSM.GetSize()/2.; i++) {
     557          20 :     printf(" %i : %7.15f(%7.12f) -> %7.15f(%7.12f) : center %7.15f(%7.12f) \n", i, 
     558          20 :            fPhiBoundariesOfSM[2*i], fPhiBoundariesOfSM[2*i]*TMath::RadToDeg(),
     559          20 :            fPhiBoundariesOfSM[2*i+1], fPhiBoundariesOfSM[2*i+1]*TMath::RadToDeg(),
     560          20 :            fPhiCentersOfSM[i], fPhiCentersOfSM[i]*TMath::RadToDeg());
     561             :   }
     562             : 
     563           4 : }
     564             : 
     565             : //______________________________________________________________________
     566             : void AliEMCALEMCGeometry::CheckAdditionalOptions()
     567             : {
     568             :   // Feb 06,2006
     569             :   // Additional options that
     570             :   // can be used to select
     571             :   // the specific geometry of 
     572             :   // EMCAL to run
     573             :   // Dec 27,2006
     574             :   // adeed allILOSS= and allIHADR= for MIP investigation
     575             :   // TODO, FIXME Hans, Aug 2015: Shouldn't one add
     576             :   // if(fArrayOpts){fArrayOpts->Delete();delete fArrayOpts;}
     577             :   // This function is called twice in the Init()
     578             :   // End Hans, Aug 2015
     579          30 :   fArrayOpts = new TObjArray;
     580          10 :   Int_t nopt = ParseString(fGeoName, *fArrayOpts);
     581          10 :   if(nopt==1) { // no aditional option(s)
     582          10 :     fArrayOpts->Delete();
     583          20 :     delete fArrayOpts;
     584          10 :     fArrayOpts = 0; 
     585          10 :     return;
     586             :   }              
     587           0 :   for(Int_t i=1; i<nopt; i++){
     588           0 :     TObjString *o = (TObjString*)fArrayOpts->At(i); 
     589             : 
     590           0 :     TString addOpt = o->String();
     591             :     Int_t indj=-1;
     592           0 :     for(Int_t j=0; j<fNAdditionalOpts; j++) {
     593           0 :       TString opt = fkAdditionalOpts[j];
     594           0 :       if(addOpt.Contains(opt,TString::kIgnoreCase)) {
     595             :           indj = j;
     596           0 :         break;
     597             :       }
     598           0 :     }
     599           0 :     if(indj<0) {
     600           0 :       AliDebug(2,Form("<E> option |%s| unavailable : ** look to the file AliEMCALGeometry.h **\n", 
     601             :                       addOpt.Data()));
     602           0 :       assert(0);
     603             :     } else {
     604           0 :       AliDebug(2,Form("<I> option |%s| is valid : number %i : |%s|\n", 
     605             :                       addOpt.Data(), indj, fkAdditionalOpts[indj]));
     606           0 :       if       (addOpt.Contains("NL=",TString::kIgnoreCase))   {// number of sampling layers
     607           0 :         sscanf(addOpt.Data(),"NL=%i", &fNECLayers);
     608           0 :         AliDebug(2,Form(" fNECLayers %i (new) \n", fNECLayers));
     609           0 :       } else if(addOpt.Contains("PBTH=",TString::kIgnoreCase)) {//Thickness of the Pb(fECPbRadThicknes)
     610           0 :         sscanf(addOpt.Data(),"PBTH=%f", &fECPbRadThickness);
     611           0 :       } else if(addOpt.Contains("SCTH=",TString::kIgnoreCase)) {//Thickness of the Sc(fECScintThick)
     612           0 :         sscanf(addOpt.Data(),"SCTH=%f", &fECScintThick);
     613           0 :       } else if(addOpt.Contains("LATSS=",TString::kIgnoreCase)) {// Thickness of lateral steel strip (fLateralSteelStrip)
     614           0 :         sscanf(addOpt.Data(),"LATSS=%f", &fLateralSteelStrip);
     615           0 :         AliDebug(2,Form(" fLateralSteelStrip %f (new) \n", fLateralSteelStrip));
     616           0 :       } else if(addOpt.Contains("ILOSS=",TString::kIgnoreCase)) {// As in Geant
     617           0 :         sscanf(addOpt.Data(),"ALLILOSS=%i", &fILOSS);
     618           0 :         AliDebug(2,Form(" fILOSS %i \n", fILOSS));
     619           0 :       } else if(addOpt.Contains("IHADR=",TString::kIgnoreCase)) {// As in Geant
     620           0 :         sscanf(addOpt.Data(),"ALLIHADR=%i", &fIHADR);
     621           0 :         AliDebug(2,Form(" fIHADR %i \n", fIHADR));
     622             :       }
     623             :     }
     624           0 :   }
     625          10 : }
     626             : 
     627             : //__________________________________________________________________
     628             : void AliEMCALEMCGeometry::DefineSamplingFraction(const Text_t* mcname, const Text_t* mctitle)
     629             : {
     630             :   // Jun 05,2006
     631             :   // Look http://rhic.physics.wayne.edu/~pavlinov/ALICE/SHISHKEBAB/RES/linearityAndResolutionForTRD1.html
     632             :   // Keep for compatibilty
     633             :   //
     634             :   
     635             :   // Sampling factor for G3
     636           2 :   fSampling = 10.87; // Default value - Nov 25,2010
     637           1 :   if(fNECLayers == 69) {        // 10% layer reduction
     638           0 :     fSampling = 12.55;
     639           1 :   } else if(fNECLayers == 61) { // 20% layer reduction
     640           0 :     fSampling = 12.80;
     641           1 :   } else if(fNECLayers == 77) {
     642           1 :     if(fGeoName.Contains("V1")){
     643           1 :       fSampling = 10.87; //Adding paper sheets and cover plate; Nov 25,2010
     644           1 :     } else if   (fECScintThick>0.159 && fECScintThick<0.161) { // original sampling fraction, equal layers
     645           0 :       fSampling = 12.327; // fECScintThick = fECPbRadThickness = 0.160;
     646           0 :     } else if (fECScintThick>0.175 && fECScintThick<0.177) { // 10% Pb thicknes reduction
     647           0 :       fSampling = 10.5; // fECScintThick = 0.176, fECPbRadThickness=0.144;
     648           0 :     } else if(fECScintThick>0.191 && fECScintThick<0.193) { // 20% Pb thicknes reduction
     649           0 :       fSampling = 8.93; // fECScintThick = 0.192, fECPbRadThickness=0.128;
     650           0 :     }
     651             :   }
     652             : 
     653             :   // Default sampling factor for G3, modify it for other transport model
     654           1 :   TString mcName  = mcname;
     655           1 :   TString mcTitle = mctitle;
     656             :     
     657             :   Float_t samplingFactorTranportModel = 1. ;
     658           3 :   if     (mcName.Contains("Geant3")) samplingFactorTranportModel = 1.;//0.988 // Do nothing
     659           0 :   else if(mcName.Contains("Fluka") ) samplingFactorTranportModel = 1.; // To be set
     660           0 :   else if(mcName.Contains("Geant4"))
     661             :   {
     662           0 :     if     ( mcTitle.Contains("EMV-EMCAL") ) samplingFactorTranportModel = 0.86 ; // EMC list but for EMCal 
     663           0 :     else if( mcTitle.Contains("EMV") )       samplingFactorTranportModel = 1.096; // 0.906, 0.896 (OPT)
     664             :     else                                     samplingFactorTranportModel = 0.86 ; // 1.15 (CHIPS), 1.149 (BERT), 1.147 (BERT_CHIPS) 
     665             :   }      
     666             :   
     667           5 :   AliInfo(Form("MC modeler <%s>, Title <%s>: Sampling %2.3f, model fraction with respect to G3 %2.3f, final sampling %2.3f",
     668             :                mcName.Data(),mcTitle.Data(),fSampling,samplingFactorTranportModel,fSampling*samplingFactorTranportModel));
     669             :   
     670           1 :   fSampling*=samplingFactorTranportModel;
     671             :   
     672           1 : }
     673             : 
     674             : //________________________________________________________________________________________________
     675             : Double_t AliEMCALEMCGeometry::GetPhiCenterOfSMSec(Int_t nsupmod) const
     676             : {
     677             :   //returns center of supermodule in phi
     678         180 :   int i = nsupmod/2;
     679          90 :   return fPhiCentersOfSMSec[i];
     680             : 
     681             : }
     682             : 
     683             : //________________________________________________________________________________________________
     684             : Double_t AliEMCALEMCGeometry::GetPhiCenterOfSM(Int_t nsupmod) const
     685             : {
     686             :   //returns center of supermodule in phi
     687        2472 :   int i = nsupmod/2;
     688        1236 :   return fPhiCentersOfSM[i];
     689             : 
     690             : }
     691             : 
     692             : //________________________________________________________________________________________________
     693             : Bool_t AliEMCALEMCGeometry::GetPhiBoundariesOfSM(Int_t nSupMod, Double_t &phiMin, Double_t &phiMax) const
     694             : {
     695             :   // 0<= nSupMod <=17; phi in rad
     696             :   static int i;
     697         420 :   if(nSupMod<0 || nSupMod >12+fnSupModInDCAL-1) return kFALSE;
     698         140 :   i = nSupMod/2;
     699         140 :   phiMin = (Double_t)fPhiBoundariesOfSM[2*i];
     700         140 :   phiMax = (Double_t)fPhiBoundariesOfSM[2*i+1];
     701         140 :   return kTRUE;
     702         140 : }
     703             : 
     704             : //________________________________________________________________________________________________
     705             : Bool_t AliEMCALEMCGeometry::GetPhiBoundariesOfSMGap(Int_t nPhiSec, Double_t &phiMin, Double_t &phiMax) const
     706             : {
     707             :   // 0<= nPhiSec <=max; phi in rad
     708             :   // 0;  gap boundaries between  0th&2th  | 1th&3th SM
     709             :   // 1;  gap boundaries between  2th&4th  | 3th&5th SM
     710             :   // 2;  gap boundaries between  4th&6th  | 5th&7th SM
     711             :   // 3;  gap boundaries between  6th&8th  | 7th&9th SM
     712             :   // 4;  gap boundaries between  8th&10th | 9th&11th SM
     713             :   // 5;  gap boundaries between 10th&12th | 11h&13th SM
     714             :   //             ...
     715           0 :   if(nPhiSec<0 || nPhiSec >5+fnSupModInDCAL/2-1) return kFALSE;
     716           0 :   phiMin = fPhiBoundariesOfSM[2*nPhiSec+1];
     717           0 :   phiMax = fPhiBoundariesOfSM[2*nPhiSec+2];
     718           0 :   return kTRUE;
     719           0 : }
     720             : 
     721             : //________________________________________________________________________________________________
     722             : int AliEMCALEMCGeometry::ParseString(const TString &topt, TObjArray &Opt)
     723             : { 
     724             :         //Parse string, does what? GCB 08/09
     725          20 :         Ssiz_t begin, index, end, end2;
     726          10 :         begin = index = end = end2 = 0;
     727          10 :         TRegexp separator("[^ ;,\\t\\s/]+");
     728          60 :         while ( (begin < topt.Length()) && (index != kNPOS) ) {
     729             :                 // loop over given options
     730          10 :                 index = topt.Index(separator,&end,begin);
     731          10 :                 if (index >= 0 && end >= 1) {
     732          20 :                         TString substring(topt(index,end));
     733          40 :                         Opt.Add(new TObjString(substring.Data()));
     734          10 :                 }
     735          10 :                 begin += end+1;
     736             :         }
     737          10 :         return Opt.GetEntries();
     738          10 : }
     739             : 

Generated by: LCOV version 1.11