]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALv0.cxx
attempt to address new coverity reports for AliCalo stuff and QA checker
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALv0.cxx
index c8df86bfc123bff9739e6a82384722e1ecc9a49e..26fcb6ba433e2322add1aa58645364401d8a967a 100644 (file)
 #include <TVector2.h>
 #include <cassert>
 
-//--- EMCAL system---
-#include "AliEMCALShishKebabTrd1Module.h"
-
 // --- Standard library ---
 
 //#include <stdio.h>
 
 // --- AliRoot header files ---
-
-#include "AliEMCALv0.h"
-#include "AliEMCALGeometry.h"
 #include "AliRun.h"
 #include "AliLog.h"
 #include "AliGeomManager.h"
+
+//--- EMCAL system---
+#include "AliEMCALShishKebabTrd1Module.h"
+#include "AliEMCALv0.h"
+#include "AliEMCALGeometry.h"
 #include "AliEMCALSpaceFrame.h"
 
+
+
 ClassImp(AliEMCALv0)
 
 // EMCAL material: look to the AliEMCAL.cxx
@@ -97,8 +98,11 @@ AliEMCALv0::AliEMCALv0(const char *name, const char *title)
   fGeometry = g;
   fSampleWidth = double(g->GetECPbRadThick()+g->GetECScintThick());
   if(gn.Contains("V1")) fSampleWidth += 2.*g->GetTrd1BondPaperThick();
-  printf("<I> AliEMCALv0::AliEMCALv : fGeometry %p : gMC %p : fSampleWidth %5.4f\n", 
-        fGeometry, gMC, fSampleWidth);
+  AliDebug(2,Form("fGeometry %p : gMC %p : fSampleWidth %5.4f\n", 
+        fGeometry, gMC, fSampleWidth));
+  //Set geometry name again, in case it was changed during the initialization of the geometry.
+  SetTitle(fGeometry->GetEMCGeometry()->GetName());
+
 }
 
 //______________________________________________________________________
@@ -126,15 +130,16 @@ void AliEMCALv0::CreateGeometry()
   
   Float_t envelopA[10];
   if(gn.Contains("WSUC") ) { // TRD1 for WSUC facility
-    // 17-may-05 - just BOX
-    envelopA[0] = 26;
-    envelopA[1] = 15;
-    envelopA[2] = 30;
+    // Nov 25,2010
+    envelopA[0] = 30.;
+    envelopA[1] = 30;
+    envelopA[2] = 20;
     gMC->Gsvolu("XEN1", "BOX", fIdTmedArr[kIdSC], envelopA, 3) ;
     fEnvelop1.Set(3);
     for(int i=0; i<3; i++) fEnvelop1[i] = envelopA[i]; // 23-may-05  
-    // Position the EMCAL Mother Volume (XEN1) in WSUC  
-    gMC->Gspos("XEN1", 1, "WSUC", 0.0, 0.0, 0.0, fIdRotm, "ONLY") ;
+    // Position the EMCAL Mother Volume (XEN1) in WSUC.
+    // Look to AliEMCALWsuCosmicRaySetUp.  
+    gMC->Gspos("XEN1", 1, "WSUC", 0.0, 0.0, + 265., fIdRotm, "ONLY") ;
   } else { 
     envelopA[0] = geom->GetArm1PhiMin();                         // minimum phi angle
     envelopA[1] = geom->GetArm1PhiMax() - geom->GetArm1PhiMin(); // angular range in phi
@@ -162,11 +167,12 @@ void AliEMCALv0::CreateGeometry()
   AliDebug(2,Form("Shish-Kebab geometry : %s", GetTitle())); 
   CreateShishKebabGeometry();
 
+  if(gn.Contains("WSUC")==0) { // Nov 24,2010 for TB
   //Space Frame
-  AliDebug(2,"Creating EMCAL Space Frame");
-  fCalFrame = new AliEMCALSpaceFrame();
-  fCalFrame->CreateGeometry();
-
+    AliDebug(2,"Creating EMCAL Space Frame");
+    fCalFrame = new AliEMCALSpaceFrame();
+    fCalFrame->CreateGeometry();
+  }
 }
 
 //______________________________________________________________________
@@ -374,7 +380,7 @@ void AliEMCALv0::CreateSmod(const char* mother)
   } else {
     par[2]  = 350./2.; // 11-oct-04 - for 26 division
     AliDebug(2,Form(" par[0] %7.2f (old) \n",  par[0]));
-    Float_t *parSM = g->GetSuperModulesPars(); 
+    Float_t parSM[] = {g->GetSuperModulesPar(0),g->GetSuperModulesPar(1),g->GetSuperModulesPar(2)};
     for(int i=0; i<3; i++) par[i] = parSM[i];
   }
   gMC->Gsvolu("SMOD", "BOX", fIdTmedArr[kIdAIR], par, 3);
@@ -967,7 +973,7 @@ void AliEMCALv0::AddAlignableVolumesInALICE() const
   // eventual changes in the geometry.
   //
 
-  Float_t * pars = GetGeometry()->GetSuperModulesPars();
+  Float_t pars[] = {GetGeometry()->GetSuperModulesPar(0),GetGeometry()->GetSuperModulesPar(1),GetGeometry()->GetSuperModulesPar(2)};
   double rpos = (GetGeometry()->GetEnvelop(0) + GetGeometry()->GetEnvelop(1))/2.;
   double phi, phiRad, xpos, ypos, zpos;