]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/STEER/AliGeomManager.cxx
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / STEER / STEER / AliGeomManager.cxx
index 5855bf571b5a9739d0bc41e9bca96593b8a4df0b..1a5b924a505ca8045bc403cc20e3443a0dea9330 100644 (file)
@@ -53,7 +53,7 @@ Int_t AliGeomManager::fgLayerSize[kLastLayer - kFirstLayer] = {
   5, 5,     // PHOS,CPV
   7,        // HMPID ??
   1,         // MUON ??
-  12        // EMCAL
+  22        // EMCAL and DCAL
 };
 
 const char* AliGeomManager::fgLayerName[kLastLayer - kFirstLayer] = {
@@ -98,11 +98,22 @@ AliAlignObj** AliGeomManager::fgAlignObjs[kLastLayer - kFirstLayer] = {
   0x0
 };
 
-const char* AliGeomManager::fgkDetectorName[AliGeomManager::fgkNDetectors] = {"GRP","ITS","TPC","TRD","TOF","PHOS","HMPID","EMCAL","MUON","FMD","ZDC","PMD","T0","VZERO","ACORDE","AD","MFT"};
+const char* AliGeomManager::fgkDetectorName[AliGeomManager::fgkNDetectors] =
+{"GRP","ITS","TPC","TRD","TOF","PHOS","HMPID","EMCAL","MUON","FMD","ZDC","PMD","T0","VZERO","ACORDE","AD","MFT","FIT"};
 Int_t AliGeomManager::fgNalignable[fgkNDetectors] = {0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
 
 TGeoManager* AliGeomManager::fgGeometry = 0x0;
 
+//_____________________________________________________________________________
+void AliGeomManager::Destroy()
+{
+  // destroy the manager as well as gGeoManager (if it was not attached to fgGeometry)
+  TGeoManager::UnlockGeometry();
+  delete gGeoManager;
+  fgGeometry = gGeoManager = 0;
+  ResetPNEntriesLUT();
+}
+
 //_____________________________________________________________________________
 void AliGeomManager::LoadGeometry(const char *geomFileName)
 {
@@ -561,18 +572,21 @@ Bool_t AliGeomManager::CheckSymNamesLUT(const char* /*detsToBeChecked*/)
 
   // Check over the ten EMCAL full supermodules and the two EMCAL half supermodules
   TString emcalSM;
-  TString baseEmcalSM("ALIC_1/XEN1_1/SM");
+  TString baseEmcalSM("ALIC_1/XEN1_1/");
   Bool_t emcalActive=kFALSE;
-  Bool_t emcalSMs[12] = {kFALSE};
-  for(Int_t sm=0; sm<12; sm++)
+  Bool_t emcalSMs[22] = {kFALSE};
+  for(Int_t sm=0; sm<22; sm++)
   {
     emcalSM=baseEmcalSM;
     if(sm<10){
-       emcalSM += "OD_";
-       emcalSM += (sm+1);
-    }else{
-       emcalSM += "10_";
-       emcalSM += (sm-9);
+      emcalSM += "SMOD_";
+      emcalSM += (sm+1);
+    }else if(sm/2 == 5){
+      emcalSM += "SM10_";
+      emcalSM += (sm-9);
+    }else if(sm > 11){
+      emcalSM += "DCSM_";
+      emcalSM += (sm-11);
     }
     if(fgGeometry->CheckPath(emcalSM.Data()))
     {
@@ -1102,15 +1116,18 @@ Bool_t AliGeomManager::CheckSymNamesLUT(const char* /*detsToBeChecked*/)
     TString str = "EMCAL/FullSupermodule";
     modnum=0;
 
-    for (Int_t iModule=1; iModule <= 12; iModule++) {
-      if(!emcalSMs[iModule-1]) continue;
+    for (Int_t iModule=0; iModule < 22; iModule++) {
+      if(!emcalSMs[iModule]) continue;
       symname = str;
-      symname += iModule;
-      if(iModule >10) {
+      symname += iModule+1;
+      if(iModule/2 == 5) {// 10,11
        symname = "EMCAL/HalfSupermodule";
-       symname += iModule-10;
+       symname += iModule-9;
+      }else if(iModule > 11) {// 12 ~ 21
+        symname = "EMCAL/DCALSupermodule";
+        symname += iModule-11;
       }
-      modnum = iModule-1;
+      modnum = iModule;
       uid = LayerToVolUID(kEMCAL,modnum);
       pne = fgGeometry->GetAlignableEntryByUID(uid);
       if(!pne)
@@ -1576,7 +1593,7 @@ void AliGeomManager::InitNalignable()
 }
   
 //_____________________________________________________________________________
-Bool_t AliGeomManager::ApplyAlignObjsFromCDB(const char* AlignDetsList)
+Bool_t AliGeomManager::ApplyAlignObjsFromCDB(const char* alignDetsList)
 {
   // Calls AddAlignObjsFromCDBSingleDet for the detectors appearing in
   // the list passed as argument (called by AliSimulation and
@@ -1597,8 +1614,8 @@ Bool_t AliGeomManager::ApplyAlignObjsFromCDB(const char* AlignDetsList)
   TString alObjsNotLoaded="";
   TString alObjsLoaded="";
 
-  TString AlignDetsString(AlignDetsList);
-  TObjArray *detsarr = AlignDetsString.Tokenize(' ');
+  TString alignDetsString(alignDetsList);
+  TObjArray *detsarr = alignDetsString.Tokenize(' ');
   TIter iter(detsarr);
   TObjString *str = 0;
   
@@ -1732,23 +1749,6 @@ Bool_t AliGeomManager::ApplyAlignObjsToGeom(const char* fileName, const char* cl
 
 }
 
-//_____________________________________________________________________________
-Bool_t AliGeomManager::ApplyAlignObjsToGeom(AliCDBParam* param, AliCDBId& Id)
-{
-  // read collection of alignment objects (AliAlignObj derived) saved
-  // in the TClonesArray ClArrayName in the AliCDBEntry identified by
-  // param (to get the AliCDBStorage) and Id; apply the alignment objects
-  // to the geometry
-  //
-
-  AliCDBStorage* storage = AliCDBManager::Instance()->GetStorage(param);
-  AliCDBEntry* entry = storage->Get(Id);
-  TClonesArray* alignObjArray = ((TClonesArray*) entry->GetObject());
-
-  return ApplyAlignObjsToGeom(*alignObjArray);
-
-}
-
 //_____________________________________________________________________________
 Bool_t AliGeomManager::ApplyAlignObjsToGeom(const char* uri, const char* path, Int_t runnum, Int_t version, Int_t sversion)
 {
@@ -1758,10 +1758,12 @@ Bool_t AliGeomManager::ApplyAlignObjsToGeom(const char* uri, const char* path, I
   // to the geometry
   //
 
-  AliCDBParam* param = AliCDBManager::Instance()->CreateParameter(uri);
+  AliCDBStorage* storage = AliCDBManager::Instance()->GetStorage(uri);
   AliCDBId id(path, runnum, runnum, version, sversion);
+  AliCDBEntry* entry = storage->Get(id);
+  TClonesArray* alignObjArray = dynamic_cast<TClonesArray*>(entry->GetObject());
 
-  return ApplyAlignObjsToGeom(param, id);
+  return ApplyAlignObjsToGeom(*alignObjArray);
 
 }