]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
CDB is passed via environment variable
authorkharlov <kharlov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 7 Mar 2006 18:56:25 +0000 (18:56 +0000)
committerkharlov <kharlov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 7 Mar 2006 18:56:25 +0000 (18:56 +0000)
PHOS/AliPHOS.cxx
PHOS/AliPHOS.h

index f3027d1f74061ad75f10d14183ae1169712af105..0dbd4ba71d7ebfd734440236490907cac5e6ddfa 100644 (file)
@@ -16,6 +16,9 @@
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.93  2005/11/22 08:45:11  kharlov
+ * Calibration is read from CDB if any (Boris Polichtchouk)
+ *
  * Revision 1.92  2005/11/03 13:09:19  hristov
  * Removing meaningless const declarations (linuxicc)
  *
@@ -87,11 +90,26 @@ Double_t AliPHOS::fgTimeTrigger = 100E-9 ;      // 100ns, just for a reference
 AliPHOS::AliPHOS(const char* name, const char* title): AliDetector(name, title)
 {
   //   ctor : title is used to identify the layout
+
+  // Check if CDB_PATH is defined and take alignment data from CDB
+  AliPHOSAlignData* alignda = 0;
+  if (gSystem->Getenv("CDB_PATH")) {
+    TString cdbPath = gSystem->Getenv("CDB_PATH");
+    AliCDBStorage *cdbStorage = AliCDBManager::Instance()->GetStorage(cdbPath);
+    if (cdbStorage != NULL) {
+      alignda  =
+       (AliPHOSAlignData*)(cdbStorage->Get("PHOS/Alignment/Geometry",0)->GetObject());
+      if(AliLog::GetGlobalDebugLevel()>0) alignda->Print();
+    }
+    else {
+      Fatal("AliPHOS", "No CDB storage at the path %s", cdbPath.Data()) ;
+    }
+  }
   
   fHighCharge        = 8.2 ;          // adjusted for a high gain range of 5.12 GeV (10 bits)
   fHighGain          = 6.64 ; 
   fHighLowGainFactor = 16. ;          // adjusted for a low gain range of 82 GeV (10 bits) 
-  fLowGainOffset     = GetGeometry()->GetNModules() + 1 ;   
+  fLowGainOffset     = GetGeometry(alignda)->GetNModules() + 1 ;   
     // offset added to the module id to distinguish high and low gain data
 }
 
@@ -103,7 +121,7 @@ AliPHOS::~AliPHOS()
 //____________________________________________________________________________
 void AliPHOS::Copy(TObject &obj)const
 {
-  // copy method to be used byy the cpy ctor
+  // copy method to be used by the cpy ctor
   TObject::Copy(obj);
   
   AliPHOS &phos = static_cast<AliPHOS &>(obj); 
index bd1ecb35cf8753f59511e82bc46e4067c46b3018..c4c22d7edc813f11a32310780312c2772e0c85c0 100644 (file)
@@ -7,6 +7,9 @@
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.64  2005/11/03 13:09:19  hristov
+ * Removing meaningless const declarations (linuxicc)
+ *
  * Revision 1.63  2005/07/26 13:32:39  kharlov
  * Restoring raw data fit from version of 29-Aug-2004
  *
@@ -36,6 +39,7 @@ class TRandom ;
 #include "AliDetector.h" 
 #include "AliLog.h"
 #include "AliPHOSGeometry.h" 
+class AliPHOSAlignData;
 
 class AliPHOS : public AliDetector {
 
@@ -62,6 +66,8 @@ public:
   virtual void  FinishRun() {;}
   virtual AliPHOSGeometry * GetGeometry() const 
   {return AliPHOSGeometry::GetInstance(GetTitle(),"") ;  }
+  virtual AliPHOSGeometry * GetGeometry(AliPHOSAlignData *alignda) const 
+  {return AliPHOSGeometry::GetInstance(GetTitle(),"",alignda) ;  }
   virtual void    Hits2SDigits();
   virtual Int_t   IsVersion(void) const = 0 ;  
   // Raw Read Out