]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Changes for correct initialization of Geant4 (Mihaela)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 5 Feb 2007 10:43:25 +0000 (10:43 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 5 Feb 2007 10:43:25 +0000 (10:43 +0000)
13 files changed:
EMCAL/AliEMCAL.cxx
EMCAL/AliEMCAL.h
HMPID/AliHMPIDv1.cxx
PHOS/AliPHOS.cxx
PHOS/AliPHOS.h
PMD/AliPMD.h
PMD/AliPMDv0.cxx
PMD/AliPMDv1.cxx
T0/AliT0v1.cxx
T0/AliT0v2.cxx
TRD/AliTRD.cxx
ZDC/AliZDCv1.cxx
ZDC/AliZDCv2.cxx

index 0d7e5d7047741868171e7cbaa990728ecffe6cd9..87c647600df3ca94b1fd472bf45d2a835cc11d8f 100644 (file)
@@ -17,6 +17,9 @@
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.49  2007/01/22 17:29:12  pavlinov
+ * EMCAL geometry can be created independently form anything now
+ *
  * Revision 1.48  2006/12/19 02:34:13  pavlinov
  * clean up the EMCAL name scheme : super module -> module -> tower (or cell)
  *
@@ -85,7 +88,7 @@ AliEMCAL::AliEMCAL()
 {
   // Default ctor 
   fName = "EMCAL" ;
-  Init();
+  InitConstants();
 
 }
 
@@ -101,7 +104,7 @@ AliEMCAL::AliEMCAL(const char* name, const char* title)
     fLowGainOffset(0)
 {
   //   ctor : title is used to identify the layout
-  Init();
+  InitConstants();
 
 }
 
@@ -112,7 +115,7 @@ AliEMCAL::~AliEMCAL()
 }
 
 //____________________________________________________________________________
-void AliEMCAL::Init(void)
+void AliEMCAL::InitConstants()
 {
   //initialize EMCAL values
   fBirkC0 = 1;
@@ -126,78 +129,10 @@ void AliEMCAL::Init(void)
 }
 
 //____________________________________________________________________________
-AliDigitizer* AliEMCAL::CreateDigitizer(AliRunDigitizer* manager) const
-{
-  //create and return the digitizer
-  return new AliEMCALDigitizer(manager);
-}
-
-//____________________________________________________________________________
-void AliEMCAL::CreateMaterials()
+void AliEMCAL::Init()
 {
-  // Definitions of materials to build EMCAL and associated tracking media.
-  // media number in idtmed are 1599 to 1698.
-
-  AliEMCALGeometry* geom = GetGeometry();
-
-  // --- Air ---               
-  Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
-  Float_t zAir[4]={6.,7.,8.,18.};
-  Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
-  Float_t dAir = 1.20479E-3;
-  AliMixture(0, "Air$", aAir, zAir, dAir, 4, wAir) ;
-
-  // --- Lead ---                                                                     
-  AliMaterial(1, "Pb$", 207.2, 82, 11.35, 0.56, 0., 0, 0) ;
-
-
-  // --- The polysterene scintillator (CH) ---
-  Float_t aP[2] = {12.011, 1.00794} ;
-  Float_t zP[2] = {6.0, 1.0} ;
-  Float_t wP[2] = {1.0, 1.0} ;
-  Float_t dP = 1.032 ;
-
-  AliMixture(2, "Polystyrene$", aP, zP, dP, -2, wP) ;
-
-  // --- Aluminium ---
-  AliMaterial(3, "Al$", 26.98, 13., 2.7, 8.9, 999., 0, 0) ;
-  // ---         Absorption length is ignored ^
-
-  // 25-aug-04 by PAI - see  PMD/AliPMDv0.cxx for STEEL definition
-  Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
-  Float_t zsteel[4] = { 26.,24.,28.,14. };
-  Float_t wsteel[4] = { .715,.18,.1,.005 };
-  AliMixture(4, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
-
-  // DEFINITION OF THE TRACKING MEDIA
-
-  // for EMCAL: idtmed[1599->1698] equivalent to fIdtmed[0->100]
+  //EMCAL cuts
   Int_t * idtmed = fIdtmed->GetArray() - 1599 ; 
-  Int_t   isxfld = gAlice->Field()->Integ() ;
-  Float_t sxmgmx = gAlice->Field()->Max() ;
-
-  // Air                                                                         -> idtmed[1599]
- AliMedium(0, "Air$", 0, 0,
-            isxfld, sxmgmx, 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
-
-  // The Lead                                                                      -> idtmed[1600]
-  AliMedium(1, "Lead$", 1, 0,
-            isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ;
-
- // The scintillator of the CPV made of Polystyrene scintillator                   -> idtmed[1601]
-  float deemax = 0.1; // maximum fractional energy loss in one step (0 < DEEMAX ≤ 1);i
-  AliMedium(2, "Scintillator$", 2, 1,
-            isxfld, sxmgmx, 10.0, 0.001, deemax, 0.001, 0.001, 0, 0) ;
-
-  // Various Aluminium parts made of Al                                            -> idtmed[1602]
-  AliMedium(3, "Al$", 3, 0,
-             isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.001, 0.001, 0, 0) ;
-
-  // 25-aug-04 by PAI : see  PMD/AliPMDv0.cxx for STEEL definition                 -> idtmed[1603]
-  AliMedium(4, "S steel$", 4, 0, 
-             isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.001, 0.001, 0, 0) ;
-
 // --- Set decent energy thresholds for gamma and electron tracking
 
   // Tracking threshold for photons and electrons in Lead 
@@ -258,12 +193,84 @@ void AliEMCAL::CreateMaterials()
   gMC->Gstpar(idtmed[1603], "DCUTE", cutele) ;
   gMC->Gstpar(idtmed[1603], "DCUTM", cutele) ;
 
+  AliEMCALGeometry* geom = GetGeometry();
   if(geom->GetILOSS()>=0) {
     for(int i=1600; i<=1603; i++) gMC->Gstpar(idtmed[i], "LOSS", geom->GetILOSS()) ; 
   } 
   if(geom->GetIHADR()>=0) {
     for(int i=1600; i<=1603; i++) gMC->Gstpar(idtmed[i], "HADR", geom->GetIHADR()) ; 
   }
+}
+
+//____________________________________________________________________________
+AliDigitizer* AliEMCAL::CreateDigitizer(AliRunDigitizer* manager) const
+{
+  //create and return the digitizer
+  return new AliEMCALDigitizer(manager);
+}
+
+//____________________________________________________________________________
+void AliEMCAL::CreateMaterials()
+{
+  // Definitions of materials to build EMCAL and associated tracking media.
+  // media number in idtmed are 1599 to 1698.
+  // --- Air ---               
+  Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
+  Float_t zAir[4]={6.,7.,8.,18.};
+  Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
+  Float_t dAir = 1.20479E-3;
+  AliMixture(0, "Air$", aAir, zAir, dAir, 4, wAir) ;
+
+  // --- Lead ---                                                                     
+  AliMaterial(1, "Pb$", 207.2, 82, 11.35, 0.56, 0., 0, 0) ;
+
+
+  // --- The polysterene scintillator (CH) ---
+  Float_t aP[2] = {12.011, 1.00794} ;
+  Float_t zP[2] = {6.0, 1.0} ;
+  Float_t wP[2] = {1.0, 1.0} ;
+  Float_t dP = 1.032 ;
+
+  AliMixture(2, "Polystyrene$", aP, zP, dP, -2, wP) ;
+
+  // --- Aluminium ---
+  AliMaterial(3, "Al$", 26.98, 13., 2.7, 8.9, 999., 0, 0) ;
+  // ---         Absorption length is ignored ^
+
+  // 25-aug-04 by PAI - see  PMD/AliPMDv0.cxx for STEEL definition
+  Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
+  Float_t zsteel[4] = { 26.,24.,28.,14. };
+  Float_t wsteel[4] = { .715,.18,.1,.005 };
+  AliMixture(4, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
+
+  // DEFINITION OF THE TRACKING MEDIA
+
+  // for EMCAL: idtmed[1599->1698] equivalent to fIdtmed[0->100]
+  Int_t   isxfld = gAlice->Field()->Integ() ;
+  Float_t sxmgmx = gAlice->Field()->Max() ;
+
+  // Air                                                                         -> idtmed[1599]
+ AliMedium(0, "Air$", 0, 0,
+            isxfld, sxmgmx, 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
+
+  // The Lead                                                                      -> idtmed[1600]
+  AliMedium(1, "Lead$", 1, 0,
+            isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ;
+
+ // The scintillator of the CPV made of Polystyrene scintillator                   -> idtmed[1601]
+  float deemax = 0.1; // maximum fractional energy loss in one step (0 < DEEMAX â\89¤ 1);i
+  AliMedium(2, "Scintillator$", 2, 1,
+            isxfld, sxmgmx, 10.0, 0.001, deemax, 0.001, 0.001, 0, 0) ;
+
+  // Various Aluminium parts made of Al                                            -> idtmed[1602]
+  AliMedium(3, "Al$", 3, 0,
+             isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.001, 0.001, 0, 0) ;
+
+  // 25-aug-04 by PAI : see  PMD/AliPMDv0.cxx for STEEL definition                 -> idtmed[1603]
+  AliMedium(4, "S steel$", 4, 0, 
+             isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.001, 0.001, 0, 0) ;
+
 
   //set constants for Birk's Law implentation
   fBirkC0 =  1;
index 2c9346a0123ea3716cc3b27c458cf0f5841a30b5..0d253b9a712b61d499dfa28ef3f8d5e622b70bc3 100644 (file)
@@ -7,6 +7,9 @@
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.40  2006/12/05 17:19:26  gustavo
+ * Updated AliEMCAL::Digits2Raw, reads first provisional RCU mapping files to make Raw data with new AliCaloAltroMapping and AliCaloRawStream
+ *
  *
  */
 //_________________________________________________________________________
@@ -54,6 +57,7 @@ class AliEMCAL : public AliDetector {
   virtual AliEMCALGeometry * GetGeometry() const 
     {return AliEMCALGeometry::GetInstance(GetTitle(),"") ;  }   
   virtual void    Hits2SDigits();
+  virtual void    Init(); 
   virtual Int_t   IsVersion(void) const = 0 ;   
   
   virtual AliTriggerDetector* CreateTriggerDetector() const 
@@ -85,7 +89,7 @@ protected:
   static Double_t RawResponseFunction(Double_t *x, Double_t *par) ; 
   void FitRaw(Bool_t lowGainFlag, TGraph * gLowGain, TGraph * gHighGain, TF1* signalF, Double_t & energy, Double_t & time) ;
 
-  void Init(void);  //initializes some params
+  void InitConstants();  //initializes some params
 
   Int_t fBirkC0;    // constants for Birk's Law implementation
   Double_t fBirkC1; // constants for Birk's Law implementation
index 08b63acea55bb5f566abb085da4cbbb358ad9cd6..da3c26c37eed2ff45c03b6b9616a157d8d041112 100644 (file)
@@ -59,37 +59,7 @@ void AliHMPIDv1::CreateMaterials()
 // Arguments: none
 //   Returns: none    
   AliDebug(1,"Start v1 HMPID.");
-  
-  Float_t emin=5.5,emax=8.5;         //Photon energy range,[eV]
-
-  TF2 *pRaIF=new TF2("RidxRad","sqrt(1+0.554*(1239.84/x)^2/((1239.84/x)^2-5796)-0.0005*(y-20))"                                       ,emin,emax,0,50); //DiMauro mail temp 0-50 degrees C
-  TF1 *pWiIF=new TF1("RidxWin","sqrt(1+46.411/(10.666*10.666-x*x)+228.71/(18.125*18.125-x*x))"                                        ,emin,emax);      //SiO2 idx TDR p.35
-  TF1 *pGaIF=new TF1("RidxGap","1+0.12489e-6/(2.62e-4 - x*x/1239.84/1239.84)"                                                         ,emin,emax);      //?????? from where  
-
-  TF1 *pRaAF=new TF1("RabsRad","(x<7.8)*(gaus+gaus(3))+(x>=7.8)*0.0001"                                                               ,emin,emax);  //fit from DiMauro data 28.10.03 
-  pRaAF->SetParameters(3.20491e16,-0.00917890,0.742402,3035.37,4.81171,0.626309);
-  TF1 *pWiAF=new TF1("RabsWin","(x<8.2)*(818.8638-301.0436*x+36.89642*x*x-1.507555*x*x*x)+(x>=8.2)*0.0001"                            ,emin,emax);  //fit from DiMauro data 28.10.03 
-  TF1 *pGaAF=new TF1("RabsGap","(x<7.75)*6512.399+(x>=7.75)*3.90743e-2/(-1.655279e-1+6.307392e-2*x-8.011441e-3*x*x+3.392126e-4*x*x*x)",emin,emax);  //????? from where  
-  
-  TF1 *pQeF =new TF1("Qe"    ,"0+(x>6.07267)*0.344811*(1-exp(-1.29730*(x-6.07267)))"                                                  ,emin,emax);  //fit from DiMauro data 28.10.03  
-
-  const Int_t kNbins=30;       //number of photon energy points
-  Float_t aEckov [kNbins]; 
-  Float_t aAbsRad[kNbins], aAbsWin[kNbins], aAbsGap[kNbins], aAbsMet[kNbins];
-  Float_t aIdxRad[kNbins], aIdxWin[kNbins], aIdxGap[kNbins], aIdxMet[kNbins], aIdxPc[kNbins]; 
-  Float_t                                                    aQeAll [kNbins], aQePc [kNbins];
-                            
-  for(Int_t i=0;i<kNbins;i++){
-    Float_t eV=emin+0.1*i;  //Ckov energy in eV
-    aEckov [i] =1e-9*eV;    //Ckov energy in GeV
-    aAbsRad[i]=pRaAF->Eval(eV); aIdxRad[i]=1.292;//pRaIF->Eval(eV,20);      //Simulation for 20 degress C       
-    aAbsWin[i]=pWiAF->Eval(eV); aIdxWin[i]=1.5787;//pWiIF->Eval(eV);
-    aAbsGap[i]=pGaAF->Eval(eV); aIdxGap[i]=1.0005;//pGaIF->Eval(eV);    aQeAll[i] =1;                     //QE for all other materials except for PC must be 1.  
-    aAbsMet[i] =0.0001;                aIdxMet[i]=0;                                             //metal ref idx must be 0 in order to reflect photon
-                                       aIdxPc [i]=1;           aQePc [i]=pQeF->Eval(eV);         //PC ref idx must be 1 in order to apply photon to QE conversion 
-                                       
-  }
-  
+    
 //data from PDG booklet 2002     density [gr/cm^3] rad len [cm] abs len [cm]    
   Float_t   aAir[4]={12,14,16,36}    ,   zAir[4]={6,7,8,18} ,   wAir[4]={0.000124,0.755267,0.231781,0.012827} , dAir=0.00120479; Int_t nAir=4;//mixture 0.9999999
   Float_t aC6F14[2]={ 12.01 , 18.99} , zC6F14[2]={ 6 , 9}   , wC6F14[2]={6 , 14} , dC6F14=1.68    ; Int_t nC6F14=-2;
@@ -120,16 +90,7 @@ void AliHMPIDv1::CreateMaterials()
     AliMaterial(++matId,"Cu"  ,aCu  ,zCu  ,dCu  ,radCu  ,absCu  );  AliMedium(kCu  ,"Cu"  , matId, unsens, itgfld, maxfld, tmaxfd, stemax, deemax, epsil, stmin);
     AliMaterial(++matId,"W"   ,aW   ,zW   ,dW   ,radW   ,absW   );  AliMedium(kW   ,"W"   , matId, unsens, itgfld, maxfld, tmaxfd, stemax, deemax, epsil, stmin);
     AliMaterial(++matId,"Al"  ,aAl  ,zAl  ,dAl  ,radAl  ,absAl  );  AliMedium(kAl  ,"Al"  , matId, unsens, itgfld, maxfld, tmaxfd, stemax, deemax, epsil, stmin);
-  
-    gMC->SetCerenkov((*fIdtmed)[kC6F14]    , kNbins, aEckov, aAbsRad  , aQeAll , aIdxRad );    
-    gMC->SetCerenkov((*fIdtmed)[kSiO2]     , kNbins, aEckov, aAbsWin  , aQeAll , aIdxWin );    
-    gMC->SetCerenkov((*fIdtmed)[kCH4]      , kNbins, aEckov, aAbsGap  , aQeAll , aIdxGap );    
-    gMC->SetCerenkov((*fIdtmed)[kCu]       , kNbins, aEckov, aAbsMet  , aQeAll , aIdxMet );    
-    gMC->SetCerenkov((*fIdtmed)[kW]        , kNbins, aEckov, aAbsMet  , aQeAll , aIdxMet ); //n=0 means reflect photons       
-    gMC->SetCerenkov((*fIdtmed)[kCsI]      , kNbins, aEckov, aAbsMet  , aQePc  , aIdxPc  ); //n=1 means convert photons    
-    gMC->SetCerenkov((*fIdtmed)[kAl]       , kNbins, aEckov, aAbsMet  , aQeAll , aIdxMet );    
-  
-  delete pRaAF;delete pWiAF;delete pGaAF; delete pRaIF; delete pWiIF; delete pGaIF; delete pQeF;
+    
     AliDebug(1,"Stop v1 HMPID.");
 
   TString ttl=GetTitle(); if(!ttl.Contains("ShowOptics")) return;              //user didn't aks to plot optical curves
@@ -139,7 +100,12 @@ void AliHMPIDv1::CreateMaterials()
   const Int_t kWinM=26 , kWinC=kBlue;  
   const Int_t kGapM=25 , kGapC=kGreen;  
   const Int_t kPcM = 2 , kPcC =kMagenta;  
-  
+  const Int_t kNbins=30;       //number of photon energy points
+
+  Float_t aEckov [kNbins]; 
+  Float_t aAbsRad[kNbins], aAbsWin[kNbins], aAbsGap[kNbins];
+  Float_t aIdxRad[kNbins], aIdxWin[kNbins], aIdxGap[kNbins]; 
+  Float_t aQePc [kNbins];  
   Float_t aTraRad[kNbins],aTraWin[kNbins],aTraGap[kNbins],aTraTot[kNbins];
   for(Int_t i=0;i<kNbins;i++){//calculate probability for photon to survive during transversing a volume of material with absorption length  
     aTraRad[i]=TMath::Exp(-AliHMPIDDigit::SizeRad()/ (aAbsRad[i]+0.0001)); //radiator
@@ -297,6 +263,43 @@ void AliHMPIDv1::Init()
   fIdPc      = gMC->VolId("Rpc");
   fIdAmpGap  = gMC->VolId("Rgap");
   fIdProxGap = gMC->VolId("Rgap");
+  const Int_t kNbins=30;       //number of photon energy points
+  Float_t emin=5.5,emax=8.5;         //Photon energy range,[eV]
+  Float_t aEckov [kNbins]; 
+  Float_t aAbsRad[kNbins], aAbsWin[kNbins], aAbsGap[kNbins], aAbsMet[kNbins];
+  Float_t aIdxRad[kNbins], aIdxWin[kNbins], aIdxGap[kNbins], aIdxMet[kNbins], aIdxPc[kNbins]; 
+  Float_t                                                    aQeAll [kNbins], aQePc [kNbins];
+
+  TF2 *pRaIF=new TF2("RidxRad","sqrt(1+0.554*(1239.84/x)^2/((1239.84/x)^2-5796)-0.0005*(y-20))"                                       ,emin,emax,0,50); //DiMauro mail temp 0-50 degrees C
+  TF1 *pWiIF=new TF1("RidxWin","sqrt(1+46.411/(10.666*10.666-x*x)+228.71/(18.125*18.125-x*x))"                                        ,emin,emax);      //SiO2 idx TDR p.35
+  TF1 *pGaIF=new TF1("RidxGap","1+0.12489e-6/(2.62e-4 - x*x/1239.84/1239.84)"                                                         ,emin,emax);      //?????? from where  
+
+  TF1 *pRaAF=new TF1("RabsRad","(x<7.8)*(gaus+gaus(3))+(x>=7.8)*0.0001"                                                               ,emin,emax);  //fit from DiMauro data 28.10.03 
+  pRaAF->SetParameters(3.20491e16,-0.00917890,0.742402,3035.37,4.81171,0.626309);
+  TF1 *pWiAF=new TF1("RabsWin","(x<8.2)*(818.8638-301.0436*x+36.89642*x*x-1.507555*x*x*x)+(x>=8.2)*0.0001"                            ,emin,emax);  //fit from DiMauro data 28.10.03 
+  TF1 *pGaAF=new TF1("RabsGap","(x<7.75)*6512.399+(x>=7.75)*3.90743e-2/(-1.655279e-1+6.307392e-2*x-8.011441e-3*x*x+3.392126e-4*x*x*x)",emin,emax);  //????? from where  
+  
+  TF1 *pQeF =new TF1("Qe"    ,"0+(x>6.07267)*0.344811*(1-exp(-1.29730*(x-6.07267)))"                                                  ,emin,emax);  //fit from DiMauro data 28.10.03  
+                            
+  for(Int_t i=0;i<kNbins;i++){
+    Float_t eV=emin+0.1*i;  //Ckov energy in eV
+    aEckov [i] =1e-9*eV;    //Ckov energy in GeV
+    aAbsRad[i]=pRaAF->Eval(eV); aIdxRad[i]=1.292;//pRaIF->Eval(eV,20);      //Simulation for 20 degress C       
+    aAbsWin[i]=pWiAF->Eval(eV); aIdxWin[i]=1.5787;//pWiIF->Eval(eV);
+    aAbsGap[i]=pGaAF->Eval(eV); aIdxGap[i]=1.0005;//pGaIF->Eval(eV);    aQeAll[i] =1;                     //QE for all other materials except for PC must be 1.  
+    aAbsMet[i] =0.0001;                aIdxMet[i]=0;                                             //metal ref idx must be 0 in order to reflect photon
+                                       aIdxPc [i]=1;           aQePc [i]=pQeF->Eval(eV);         //PC ref idx must be 1 in order to apply photon to QE conversion 
+                                       
+  }
+  gMC->SetCerenkov((*fIdtmed)[kC6F14]    , kNbins, aEckov, aAbsRad  , aQeAll , aIdxRad );    
+  gMC->SetCerenkov((*fIdtmed)[kSiO2]     , kNbins, aEckov, aAbsWin  , aQeAll , aIdxWin );    
+  gMC->SetCerenkov((*fIdtmed)[kCH4]      , kNbins, aEckov, aAbsGap  , aQeAll , aIdxGap );    
+  gMC->SetCerenkov((*fIdtmed)[kCu]       , kNbins, aEckov, aAbsMet  , aQeAll , aIdxMet );    
+  gMC->SetCerenkov((*fIdtmed)[kW]        , kNbins, aEckov, aAbsMet  , aQeAll , aIdxMet ); //n=0 means reflect photons       
+  gMC->SetCerenkov((*fIdtmed)[kCsI]      , kNbins, aEckov, aAbsMet  , aQePc  , aIdxPc  ); //n=1 means convert photons    
+  gMC->SetCerenkov((*fIdtmed)[kAl]       , kNbins, aEckov, aAbsMet  , aQeAll , aIdxMet );    
+  delete pRaAF;delete pWiAF;delete pGaAF; delete pRaIF; delete pWiIF; delete pGaIF; delete pQeF;
+
   AliDebug(1,"Stop v1 HMPID.");    
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
index b951f0ef7bfe360e6dfe3f25041b7b6188de9a8c..4d0c5814cfedbe978f79655a99174f07ec8a57c9 100644 (file)
@@ -16,6 +16,9 @@
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.108  2007/02/01 10:34:47  hristov
+ * Removing warnings on Solaris x86
+ *
  * Revision 1.107  2007/01/29 16:29:37  kharlov
  * Digits2Raw(): special workaround for digits with time out of range
  *
@@ -303,7 +306,6 @@ void AliPHOS::CreateMaterials()
   // DEFINITION OF THE TRACKING MEDIA
 
   // for PHOS: idtmed[699->798] equivalent to fIdtmed[0->100]
-  Int_t * idtmed = fIdtmed->GetArray() - 699 ; 
   Int_t   isxfld = gAlice->Field()->Integ() ;
   Float_t sxmgmx = gAlice->Field()->Max() ;
 
@@ -386,8 +388,16 @@ void AliPHOS::CreateMaterials()
   // Air                                                                            -> idtmed[798] 
   AliMedium(99, "Air          $", 99, 0,
             isxfld, sxmgmx, 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
+}
 
+//_____________________________________________________________________________
+void AliPHOS::Init()
+{
+  //
+  // Initialises cuts for PHOS
+  //
   // --- Set decent energy thresholds for gamma and electron tracking
+  Int_t * idtmed = fIdtmed->GetArray() - 699 ; 
 
   // Tracking threshold for photons and electrons in the scintillator crystal 
   gMC->Gstpar(idtmed[699], "CUTGAM",0.5E-4) ; 
@@ -419,7 +429,6 @@ void AliPHOS::CreateMaterials()
   gMC->Gstpar(idtmed[715], "LOSS",2.) ;
   gMC->Gstpar(idtmed[715], "DRAY",0.) ;
   gMC->Gstpar(idtmed[715], "STRA",2.) ;
-
 }
 
 //____________________________________________________________________________
index b79044ee39961803bdadb121d6bcb51d1f8aa2b2..ec9a44fcabb342e376f697ac82bd0655bd8f1280 100644 (file)
@@ -7,6 +7,9 @@
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.70  2007/01/17 17:28:56  kharlov
+ * Extract ALTRO sample generation to a separate class AliPHOSPulseGenerator
+ *
  * Revision 1.69  2006/11/14 17:11:15  hristov
  * Removing inheritances from TAttLine, TAttMarker and AliRndm in AliModule. The copy constructor and assignment operators are moved to the private part of the class and not implemented. The corresponding changes are propagated to the detectors
  *
@@ -79,7 +82,7 @@ public:
 
   virtual void    Hits2SDigits();
   virtual Int_t   IsVersion(void) const = 0 ;  
-
+  virtual void    Init();
   virtual AliTriggerDetector* CreateTriggerDetector() const 
     { return new AliPHOSTrigger(); }
 
index 4246a6da6f79e7ee417b975ad467a212f4685025..31508f090a9b0db162202ee1cc8516fef4876645 100644 (file)
@@ -31,6 +31,7 @@ public:
   virtual void  BuildGeometry();
   virtual void  CreateGeometry() {}
   virtual void  CreateMaterials() {}
+  virtual void  Init() {}
   virtual Int_t IsVersion() const =0;
   virtual void  SetPAR(Float_t p1, Float_t p2, Float_t p3, Float_t p4);
   virtual void  SetIN(Float_t p1, Float_t p2, Float_t p3, Float_t p4, Float_t p5);
index 15b1b695c45df5982f7b6ee18c2b2c65c87318f9..5ee8ce8d1cb7432e1be134f98c80adc25689bfbc 100644 (file)
@@ -776,7 +776,6 @@ void AliPMDv0::CreateMaterials()
   
   //  cout << " Inside create materials " << endl;
 
-  Int_t *idtmed = fIdtmed->GetArray()-599;
   Int_t isxfld = gAlice->Field()->Integ();
   Float_t sxmgmx = gAlice->Field()->Max();
   
@@ -848,7 +847,33 @@ void AliPMDv0::CreateMaterials()
   AliMedium(98, "Vacuum  $", 98, 0, 0, isxfld, sxmgmx, 1., .1, .10, 10);
   AliMedium(99, "Air gaps$", 99, 0, 0, isxfld, sxmgmx, 1., .1, .10, .1);
 
-  
+}
+
+//_____________________________________________________________________________
+void AliPMDv0::Init()
+{
+  //
+  // Initialises PMD detector after it has been built
+  //
+  Int_t i;
+  //  kdet=1;
+  //
+  if(AliLog::GetGlobalDebugLevel()>0) {
+      printf("\n%s: ",ClassName());
+      for(i=0;i<35;i++) printf("*");
+      printf(" PMD_INIT ");
+      for(i=0;i<35;i++) printf("*");
+      printf("\n%s: ",ClassName());
+      printf("                 PMD simulation package (v0) initialised\n");
+      printf("%s: parameters of pmd\n", ClassName());
+      printf("%s: %10.2f %10.2f %10.2f \
+      %10.2f\n",ClassName(),fgkCellRadius,fgkCellWall,fgkCellDepth,fgkZdist );
+      printf("%s: ",ClassName());
+      for(i=0;i<80;i++) printf("*");
+      printf("\n");
+  }
+  Int_t *idtmed = fIdtmed->GetArray()-599;
+  fMedSens=idtmed[605-1];
   // --- Generate explicitly delta rays in the iron, aluminium and lead --- 
   gMC->Gstpar(idtmed[600], "LOSS", 3.);
   gMC->Gstpar(idtmed[600], "DRAY", 1.);
@@ -899,33 +924,6 @@ void AliPMDv0::CreateMaterials()
   gMC->Gstpar(idtmed[604], "CUTMUO", 1e-5);
 }
 
-//_____________________________________________________________________________
-void AliPMDv0::Init()
-{
-  //
-  // Initialises PMD detector after it has been built
-  //
-  Int_t i;
-  //  kdet=1;
-  //
-  if(AliLog::GetGlobalDebugLevel()>0) {
-      printf("\n%s: ",ClassName());
-      for(i=0;i<35;i++) printf("*");
-      printf(" PMD_INIT ");
-      for(i=0;i<35;i++) printf("*");
-      printf("\n%s: ",ClassName());
-      printf("                 PMD simulation package (v0) initialised\n");
-      printf("%s: parameters of pmd\n", ClassName());
-      printf("%s: %10.2f %10.2f %10.2f \
-      %10.2f\n",ClassName(),fgkCellRadius,fgkCellWall,fgkCellDepth,fgkZdist );
-      printf("%s: ",ClassName());
-      for(i=0;i<80;i++) printf("*");
-      printf("\n");
-  }
-  Int_t *idtmed = fIdtmed->GetArray()-599;
-  fMedSens=idtmed[605-1];
-}
-
 //_____________________________________________________________________________
 void AliPMDv0::StepManager()
 {
index a97a71efc413fdfb36a7b74fe4f210712327e52d..004bf06ea425858a48112d7d54dd4395e3510467 100644 (file)
@@ -1383,7 +1383,6 @@ void AliPMDv1::CreateMaterials()
   //
   //  cout << " Inside create materials " << endl;
 
-  Int_t *idtmed = fIdtmed->GetArray()-599;
   Int_t isxfld = gAlice->Field()->Integ();
   Float_t sxmgmx = gAlice->Field()->Max();
   
@@ -1454,6 +1453,25 @@ void AliPMDv1::CreateMaterials()
   AliMedium(98, "Vacuum  $", 98, 0, 0, isxfld, sxmgmx, 1., .1, .10, 10);
   AliMedium(99, "Air gaps$", 99, 0, 0, isxfld, sxmgmx, 1., .1, .10, .1);
   
+  AliDebug(1,"Outside create materials");
+
+}
+
+//_____________________________________________________________________________
+void AliPMDv1::Init()
+{
+  //
+  // Initialises PMD detector after it has been built
+  //
+
+  //
+  AliDebug(2,"Inside Init");
+  AliDebug(2,"PMD simulation package (v1) initialised");
+  AliDebug(2,"parameters of pmd");
+  AliDebug(2,Form("%10.2f %10.2f %10.2f %10.2f\n",
+                 fgkCellRadius,fgkCellWall,fgkCellDepth,fgkZdist));
+  Int_t *idtmed = fIdtmed->GetArray()-599;
+  fMedSens=idtmed[605-1];
   // --- Generate explicitly delta rays in the iron, aluminium and lead --- 
   gMC->Gstpar(idtmed[600], "LOSS", 3.);
   gMC->Gstpar(idtmed[600], "DRAY", 1.);
@@ -1496,27 +1514,6 @@ void AliPMDv1::CreateMaterials()
   gMC->Gstpar(idtmed[604], "CUTNEU", 1e-5);
   gMC->Gstpar(idtmed[604], "CUTHAD", 1e-5);
   gMC->Gstpar(idtmed[604], "CUTMUO", 1e-5);
-
-  AliDebug(1,"Outside create materials");
-
-}
-
-//_____________________________________________________________________________
-void AliPMDv1::Init()
-{
-  //
-  // Initialises PMD detector after it has been built
-  //
-
-  //
-  AliDebug(2,"Inside Init");
-  AliDebug(2,"PMD simulation package (v1) initialised");
-  AliDebug(2,"parameters of pmd");
-  AliDebug(2,Form("%10.2f %10.2f %10.2f %10.2f\n",
-                 fgkCellRadius,fgkCellWall,fgkCellDepth,fgkZdist));
-  Int_t *idtmed = fIdtmed->GetArray()-599;
-  fMedSens=idtmed[605-1];
-
 }
 
 //_____________________________________________________________________________
index 413a3fd7cffd47a0d2c82ca8c7a76de7c94e8dc9..7b1025fb6ff94b53f20f90279414539f3b19419c 100644 (file)
@@ -441,8 +441,6 @@ void AliT0v1::CreateMaterials()
    Float_t sxmgmx = gAlice->Field()->Max();
    //   Float_t a,z,d,radl,absl,buf[1];
    // Int_t nbuf;
-   Int_t *idtmed = fIdtmed->GetArray();
-
 // AIR
                                                                                 
    Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
@@ -536,8 +534,47 @@ void AliT0v1::CreateMaterials()
    AliMedium(17, "T0 OpAir$", 22, 0, isxfld, sxmgmx, 10., .1, 1., .003, .003);
    AliMedium(18, "T0 OpAirNext$", 23, 0, isxfld, sxmgmx, 10., .1, 1., .003, .003);
     AliMedium(19, "OpticalGlassCathode$", 24, 1, isxfld, sxmgmx, 10., .01, .1, .003, .003);
+   
+   AliDebugClass(1,": ++++++++++++++Medium set++++++++++");
+   
+   
+}
+//---------------------------------------------------------------------
+void AliT0v1::DrawDetector()
+{
+//
+// Draw a shaded view of the Forward multiplicity detector version 0
+//
+  
+  //Set ALIC mother transparent
+  gMC->Gsatt("ALIC","SEEN",0);
+  //
+  //Set volumes visible
+  //  gMC->Gsatt("0STR","SEEN",0);
+  //  gMC->Gsatt("0INS","SEEN",0);
+  // gMC->Gsatt("0PMT","SEEN",1);
+  // gMC->Gsatt("0DIV","SEEN",1);
+  //
+  gMC->Gdopt("hide","off");
+  gMC->Gdopt("shad","on");
+  gMC->SetClipBox(".");
+  gMC->SetClipBox("*",0,1000,-1000,1000,-1000,1000);
+  gMC->DefaultRange();
+  gMC->Gdraw("alic",90,0,0,-35,9.5,.6,0.6);
+  //gMC->Gdraw("alic",0,0,0,10,9.5,.8,0.8); //other side view
+  gMC->Gdhead(1111,"T-Zero detector");
+  gMC->Gdopt("hide","off");
+}
 
-
+//-------------------------------------------------------------------
+void AliT0v1::Init()
+{
+// Initialises version 0 of the Forward Multiplicity Detector
+//
+//Int_t *idtmed  = gAlice->Idtmed();
+  AliT0::Init();
+  fIdSens1=gMC->VolId("0REG");
+   Int_t *idtmed = fIdtmed->GetArray();
 // Definition Cherenkov parameters
    int i;
    const Int_t kNbins=31;
@@ -587,46 +624,6 @@ void AliT0v1::CreateMaterials()
    gMC->SetCerenkov (idtmed[kOpGlassCathode], kNbins, aPckov, aAbsSiO2,efficAll , rindexSiO2 );
   gMC->SetCerenkov (idtmed[kOpAir], kNbins, aPckov,absorAir , efficAll,rindexAir );
    gMC->SetCerenkov (idtmed[kOpAirNext], kNbins, aPckov,absorbCathodeNext , efficAll, rindexCathodeNext);
-   
-   AliDebugClass(1,": ++++++++++++++Medium set++++++++++");
-   
-   
-}
-//---------------------------------------------------------------------
-void AliT0v1::DrawDetector()
-{
-//
-// Draw a shaded view of the Forward multiplicity detector version 0
-//
-  
-  //Set ALIC mother transparent
-  gMC->Gsatt("ALIC","SEEN",0);
-  //
-  //Set volumes visible
-  //  gMC->Gsatt("0STR","SEEN",0);
-  //  gMC->Gsatt("0INS","SEEN",0);
-  // gMC->Gsatt("0PMT","SEEN",1);
-  // gMC->Gsatt("0DIV","SEEN",1);
-  //
-  gMC->Gdopt("hide","off");
-  gMC->Gdopt("shad","on");
-  gMC->SetClipBox(".");
-  gMC->SetClipBox("*",0,1000,-1000,1000,-1000,1000);
-  gMC->DefaultRange();
-  gMC->Gdraw("alic",90,0,0,-35,9.5,.6,0.6);
-  //gMC->Gdraw("alic",0,0,0,10,9.5,.8,0.8); //other side view
-  gMC->Gdhead(1111,"T-Zero detector");
-  gMC->Gdopt("hide","off");
-}
-
-//-------------------------------------------------------------------
-void AliT0v1::Init()
-{
-// Initialises version 0 of the Forward Multiplicity Detector
-//
-//Int_t *idtmed  = gAlice->Idtmed();
-  AliT0::Init();
-  fIdSens1=gMC->VolId("0REG");
 
    AliDebug(1,Form("%s: *** T0 version 1 initialized ***\n",ClassName()));
 
index 826a643eea836d777d580c3a0425bc608829fa89..d04abed19759e88ba3ef648859929b31379e4c45 100644 (file)
@@ -191,52 +191,6 @@ void AliT0v2::CreateMaterials()
    Float_t wribber[3] = { 6., 12.,  1.};
    Float_t denribber  = 0.8;
    
-// Definition Cherenkov parameters
-  const Int_t NUMENTRIES = 32;
-
-  Float_t ppckov[NUMENTRIES] =
-            { 2.034E-9, 2.068E-9, 2.103E-9, 2.139E-9,
-              2.177E-9, 2.216E-9, 2.256E-9, 2.298E-9,
-              2.341E-9, 2.386E-9, 2.433E-9, 2.481E-9,
-              2.532E-9, 2.585E-9, 2.640E-9, 2.697E-9,
-              2.757E-9, 2.820E-9, 2.885E-9, 2.954E-9,
-              3.026E-9, 3.102E-9, 3.181E-9, 3.265E-9,
-              3.353E-9, 3.446E-9, 3.545E-9, 3.649E-9,
-              3.760E-9, 3.877E-9, 4.002E-9, 4.136E-9 };
-
-  Float_t rindex_qwarz[NUMENTRIES] =
-            { 1.458, 1.458, 1.458, 1.458, 1.458, 1.458, 1.458,
-              1.458, 1.458, 1.458, 1.458, 1.458, 1.458, 1.458,
-              1.458, 1.458, 1.458, 1.458, 1.458, 1.458, 1.458,
-              1.458, 1.458, 1.458, 1.458, 1.458, 1.458, 1.458,
-              1.458, 1.458, 1.458, 1.458 };
-
-  Float_t rindex_air[NUMENTRIES] =
-            { 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
-              1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
-              1., 1., 1., 1. };
-
-  Float_t effic_all[NUMENTRIES] =
-            { 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
-              1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
-              1., 1., 1., 1. };
-              
-  Float_t absor_qwarz[NUMENTRIES] =
-           { 2000., 2000., 2000., 2000., 2000., 2000., 2000., 
-             2000., 2000., 2000., 2000., 2000., 2000., 2000.,
-             2000., 2000., 2000., 2000., 2000., 2000., 2000.,
-             2000., 2000., 2000., 2000., 2000., 2000., 2000.,
-             2000., 2000., 2000., 2000. };
-
-  Float_t absor_air[NUMENTRIES] =
-           { 200., 200., 200., 200., 200., 200., 200., 
-             200., 200., 200., 200., 200., 200., 200.,
-             200., 200., 200., 200., 200., 200., 200.,
-             200., 200., 200., 200., 200., 200., 200.,
-             200., 200., 200., 200. };
-   
-  Int_t *idtmed = fIdtmed->GetArray();
-
     
    AliMaterial (0, "T0 Steel$", 55.850, 26., 7.87, 1.76, 999);
    AliMaterial (1, "T0 Vacuum$", 1.e-16, 1.e-16, 1.e-16, 1.e16, 999);
@@ -265,9 +219,6 @@ void AliT0v2::CreateMaterials()
    AliMedium (8, "Steel$", 0, 0, isxfld, sxmgmx, 1., .001, 1., .001, .001);
    AliMedium (9, "Ribber  $", 7, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003);
    AliMedium(11, "Brass  $", 6, 0, isxfld, sxmgmx, 10., .01, .1, .003, .003);
-
-   gMC->SetCerenkov (idtmed[6], NUMENTRIES, ppckov, absor_qwarz, effic_all, rindex_qwarz);
-   gMC->SetCerenkov (idtmed[1], NUMENTRIES, ppckov, absor_air, effic_all, rindex_air);
 }
 
 
@@ -304,6 +255,54 @@ void AliT0v2::Init()
 
   AliT0::Init();
   fIdSens1 = gMC->VolId ("0REG");
+// Definition Cherenkov parameters
+  const Int_t NUMENTRIES = 32;
+
+  Float_t ppckov[NUMENTRIES] =
+            { 2.034E-9, 2.068E-9, 2.103E-9, 2.139E-9,
+              2.177E-9, 2.216E-9, 2.256E-9, 2.298E-9,
+              2.341E-9, 2.386E-9, 2.433E-9, 2.481E-9,
+              2.532E-9, 2.585E-9, 2.640E-9, 2.697E-9,
+              2.757E-9, 2.820E-9, 2.885E-9, 2.954E-9,
+              3.026E-9, 3.102E-9, 3.181E-9, 3.265E-9,
+              3.353E-9, 3.446E-9, 3.545E-9, 3.649E-9,
+              3.760E-9, 3.877E-9, 4.002E-9, 4.136E-9 };
+
+  Float_t rindex_qwarz[NUMENTRIES] =
+            { 1.458, 1.458, 1.458, 1.458, 1.458, 1.458, 1.458,
+              1.458, 1.458, 1.458, 1.458, 1.458, 1.458, 1.458,
+              1.458, 1.458, 1.458, 1.458, 1.458, 1.458, 1.458,
+              1.458, 1.458, 1.458, 1.458, 1.458, 1.458, 1.458,
+              1.458, 1.458, 1.458, 1.458 };
+
+  Float_t rindex_air[NUMENTRIES] =
+            { 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+              1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+              1., 1., 1., 1. };
+
+  Float_t effic_all[NUMENTRIES] =
+            { 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+              1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
+              1., 1., 1., 1. };
+              
+  Float_t absor_qwarz[NUMENTRIES] =
+           { 2000., 2000., 2000., 2000., 2000., 2000., 2000., 
+             2000., 2000., 2000., 2000., 2000., 2000., 2000.,
+             2000., 2000., 2000., 2000., 2000., 2000., 2000.,
+             2000., 2000., 2000., 2000., 2000., 2000., 2000.,
+             2000., 2000., 2000., 2000. };
+
+  Float_t absor_air[NUMENTRIES] =
+           { 200., 200., 200., 200., 200., 200., 200., 
+             200., 200., 200., 200., 200., 200., 200.,
+             200., 200., 200., 200., 200., 200., 200.,
+             200., 200., 200., 200., 200., 200., 200.,
+             200., 200., 200., 200. };
+   
+  Int_t *idtmed = fIdtmed->GetArray();
+
+   gMC->SetCerenkov (idtmed[6], NUMENTRIES, ppckov, absor_qwarz, effic_all, rindex_qwarz);
+   gMC->SetCerenkov (idtmed[1], NUMENTRIES, ppckov, absor_air, effic_all, rindex_air);
 
   printf ("*** T0 version 2 initialized ***\n");
 }
index 8b0ce742af379b450807a67dfe598ff9c91d2ac3..983d8e3cea86b04d85ecda653a3f3837c82cae89 100644 (file)
@@ -623,10 +623,6 @@ void AliTRD::CreateMaterials()
   AliMedium(25,"Serv-Cu"    , 5,0,isxfld,sxmgmx
               ,tmaxfd,stemax,deemax,epsil,stmin);
 
-  // Special tracking options for charged particles for XeCO2
-  gMC->Gstpar((* fIdtmed)[9],"DRAY",1.0);
-  gMC->Gstpar((* fIdtmed)[9],"STRA",1.0); 
-
   // Save the density values for the TRD absorbtion
   Float_t dmy  = 1.39;
   fFoilDensity = dmy;
@@ -707,6 +703,9 @@ void AliTRD::Init()
   if (fGeometry->IsVersion() != 1) {
     AliError("Not a valid geometry");
   }
+  // Special tracking options for charged particles for XeCO2
+  gMC->Gstpar((* fIdtmed)[9],"DRAY",1.0);
+  gMC->Gstpar((* fIdtmed)[9],"STRA",1.0); 
   
 }
 
index f097b576938e945c50f84c16f1345b08b7764eb5..cf030c8086ad8865ee96c1e057531084efb74b15 100644 (file)
@@ -986,8 +986,15 @@ void AliZDCv1::CreateMaterials()
   
   ifield =2;
   fieldm = 45.;
-  AliMedium(11, "ZVOIM", 11, isvol, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
-  
+  AliMedium(11, "ZVOIM", 11, isvol, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin);  
+} 
+
+//_____________________________________________________________________________
+void AliZDCv1::Init()
+{
+  InitTables();
+  Int_t *idtmed = fIdtmed->GetArray();  
+  Int_t i;
   // Thresholds for showering in the ZDCs 
   i = 1; //tantalum
   gMC->Gstpar(idtmed[i], "CUTGAM", .001);
@@ -1078,12 +1085,6 @@ void AliZDCv1::CreateMaterials()
 //  fMedSensTDI = idtmed[6];  // Sensitive volume: TDI Cu shield
 //  fMedSensPI  = idtmed[7];  // Sensitive volume: beam pipes
   fMedSensGR  = idtmed[12]; // Sensitive volume: air into the grooves
-} 
-
-//_____________________________________________________________________________
-void AliZDCv1::Init()
-{
- InitTables();
 }
 
 //_____________________________________________________________________________
index fa0c2b2c3068425ca72053ef677470b5a0f1eb50..ac348c3c87d47976e0f78e364baf2b2988e77112 100644 (file)
@@ -898,10 +898,7 @@ void AliZDCv2::CreateMaterials()
   // Create Materials for the Zero Degree Calorimeter
   //
   
-  Int_t *idtmed = fIdtmed->GetArray();
-  
   Float_t dens, ubuf[1], wmat[2], a[2], z[2];
-  Int_t i;
   
   // --- Store in UBUF r0 for nuclear radius calculation R=r0*A**1/3 
 
@@ -1015,8 +1012,37 @@ void AliZDCv2::CreateMaterials()
   AliMedium(12,"ZAIR", 12, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
   //
   AliMedium(11,"ZVOIM", 11, isvol, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
-  AliMedium(13,"ZIRONE",13, isvol, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
-  
+  AliMedium(13,"ZIRONE",13, isvol, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin);  
+} 
+
+//_____________________________________________________________________________
+void AliZDCv2::AddAlignableVolumes() const
+{
+ //
+ // Create entries for alignable volumes associating the symbolic volume
+ // name with the corresponding volume path. Needs to be syncronized with
+ // eventual changes in the geometry.
+ //
+ Int_t modnum = 0;
+ TString volpath1 = "ALIC_1/ZDC_1/ZNEU_1";
+ TString volpath2 = "ALIC_1/ZDC_1/ZPRO_1";
+
+ TString symname1="ZDC/NeutronZDC";
+ TString symname2="ZDC/ProtonZDC";
+
+ if(!gGeoManager->SetAlignableEntry(symname1.Data(),volpath1.Data()))
+     AliFatal(Form("Alignable entry %s not created. Volume path %s not valid",   symname1.Data(),volpath1.Data()));
+
+ if(!gGeoManager->SetAlignableEntry(symname2.Data(),volpath2.Data()))
+     AliFatal(Form("Alignable entry %s not created. Volume path %s not valid",   symname2.Data(),volpath2.Data()));
+}
+
+//_____________________________________________________________________________
+void AliZDCv2::Init()
+{
+ InitTables();
+  Int_t i;
+  Int_t *idtmed = fIdtmed->GetArray();
   // Thresholds for showering in the ZDCs 
   i = 1; //tantalum
   gMC->Gstpar(idtmed[i], "CUTGAM", .001);
@@ -1112,35 +1138,7 @@ void AliZDCv2::CreateMaterials()
   fMedSensZEM = idtmed[5];  // Sensitive volume: ZEM passive material
   fMedSensTDI = idtmed[6];  // Sensitive volume: TDI Cu shield
   fMedSensPI  = idtmed[7];  // Sensitive volume: beam pipes
-  fMedSensGR  = idtmed[12]; // Sensitive volume: air into the grooves
-} 
-
-//_____________________________________________________________________________
-void AliZDCv2::AddAlignableVolumes() const
-{
- //
- // Create entries for alignable volumes associating the symbolic volume
- // name with the corresponding volume path. Needs to be syncronized with
- // eventual changes in the geometry.
- //
- Int_t modnum = 0;
- TString volpath1 = "ALIC_1/ZDC_1/ZNEU_1";
- TString volpath2 = "ALIC_1/ZDC_1/ZPRO_1";
-
- TString symname1="ZDC/NeutronZDC";
- TString symname2="ZDC/ProtonZDC";
-
- if(!gGeoManager->SetAlignableEntry(symname1.Data(),volpath1.Data()))
-     AliFatal(Form("Alignable entry %s not created. Volume path %s not valid",   symname1.Data(),volpath1.Data()));
-
- if(!gGeoManager->SetAlignableEntry(symname2.Data(),volpath2.Data()))
-     AliFatal(Form("Alignable entry %s not created. Volume path %s not valid",   symname2.Data(),volpath2.Data()));
-}
-
-//_____________________________________________________________________________
-void AliZDCv2::Init()
-{
- InitTables();
+  fMedSensGR  = idtmed[12]; // Sensitive volume: air into the grooves  
 }
 
 //_____________________________________________________________________________