]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDcalibDB.cxx
One header file for PYQUEN only.
[u/mrichter/AliRoot.git] / TRD / AliTRDcalibDB.cxx
index f456cf47b51f18b6016d2233dc41af7ac96f2d62..6d047c89d624f68ffb7186f03e775849c1d9f9e5 100644 (file)
@@ -44,8 +44,8 @@
 #include "Cal/AliTRDCalROC.h"
 #include "Cal/AliTRDCalPad.h"
 #include "Cal/AliTRDCalDet.h"
-#include "Cal/AliTRDCalGlobals.h"
-#include "Cal/AliTRDCalPIDLQ.h"
+#include "Cal/AliTRDCalFEE.h"
+#include "Cal/AliTRDCalPID.h"
 #include "Cal/AliTRDCalMonitoring.h"
 #include "Cal/AliTRDCalChamberStatus.h"
 #include "Cal/AliTRDCalPadStatus.h"
@@ -241,9 +241,11 @@ const TObject *AliTRDcalibDB::GetCachedCDBObject(Int_t id)
     case kIDMonitoringData : 
       return CacheCDBEntry(kIDMonitoringData    ,"TRD/Calib/MonitoringData"); 
       break;
-    case kIDGlobals : 
-      return CacheCDBEntry(kIDGlobals           ,"TRD/Calib/Globals"); 
+    case kIDFEE : 
+      return CacheCDBEntry(kIDFEE               ,"TRD/Calib/FEE"); 
       break;
+    case kIDPIDNN : 
+      return CacheCDBEntry(kIDPIDNN             ,"TRD/Calib/PIDNN");
     case kIDPIDLQ : 
       return CacheCDBEntry(kIDPIDLQ             ,"TRD/Calib/PIDLQ"); 
       break;
@@ -357,6 +359,49 @@ Float_t AliTRDcalibDB::GetVdrift(Int_t det, Int_t col, Int_t row)
   return calChamber->GetValue(det) * roc->GetValue(col,row);
 
 }
+//_____________________________________________________________________________
+AliTRDCalROC *AliTRDcalibDB::GetVdriftROC(Int_t det)
+{
+  //
+  // Returns the Vdrift calibration object for a given ROC
+  // containing one number per pad 
+  //
+  
+  const AliTRDCalPad     *calPad     = dynamic_cast<const AliTRDCalPad *> 
+                                       (GetCachedCDBObject(kIDVdriftPad));
+  if (!calPad) {
+    return 0;
+  }
+
+  AliTRDCalROC           *roc        = calPad->GetCalROC(det);
+  if (!roc) {
+    return 0;
+  }
+  else {
+    return roc;
+  }
+
+}
+
+//_____________________________________________________________________________
+const AliTRDCalDet *AliTRDcalibDB::GetVdriftDet()
+{
+  //
+  // Returns the Vdrift calibration object
+  // containing one number per detector
+  //
+  
+  const AliTRDCalDet     *calChamber = dynamic_cast<const AliTRDCalDet *> 
+                                       (GetCachedCDBObject(kIDVdriftChamber));
+  if (!calChamber) {
+    return 0;
+  }
+  else {
+    return calChamber;
+  }
+
+}
 
 //_____________________________________________________________________________
 Float_t AliTRDcalibDB::GetVdriftAverage(Int_t det)
@@ -402,7 +447,7 @@ Float_t AliTRDcalibDB::GetT0(Int_t det, Int_t col, Int_t row)
   return calChamber->GetValue(det) + roc->GetValue(col,row);
 
 }
-
 //_____________________________________________________________________________
 AliTRDCalROC *AliTRDcalibDB::GetT0ROC(Int_t det)
 {
@@ -567,6 +612,30 @@ Float_t AliTRDcalibDB::GetGainFactorAverage(Int_t det)
 
 }
 
+//_____________________________________________________________________________
+AliTRDCalROC *AliTRDcalibDB::GetPRFROC(Int_t det)
+{
+  //
+  // Returns the PRF calibration object for a given ROC
+  // containing one number per pad 
+  //
+  
+  const AliTRDCalPad     *calPad     = dynamic_cast<const AliTRDCalPad *> 
+                                       (GetCachedCDBObject(kIDPRFWidth));
+  if (!calPad) {
+    return 0;
+  }
+
+  AliTRDCalROC           *roc        = calPad->GetCalROC(det);
+  if (!roc) {
+    return 0;
+  }
+  else {
+    return roc;
+  }
+
+}
+
 //_____________________________________________________________________________
 Float_t AliTRDcalibDB::GetPRFWidth(Int_t det, Int_t col, Int_t row)
 {
@@ -596,13 +665,13 @@ Int_t AliTRDcalibDB::GetNumberOfTimeBins()
   // Returns the number of time bins which are read-out.
   //
 
-  const AliTRDCalGlobals *calGlobal = dynamic_cast<const AliTRDCalGlobals *> 
-                                      (GetCachedCDBObject(kIDGlobals));
-  if (!calGlobal) {
+  const AliTRDCalFEE *calFEE     = dynamic_cast<const AliTRDCalFEE *> 
+                                   (GetCachedCDBObject(kIDFEE));
+  if (!calFEE) {
     return -1;
   }
 
-  return calGlobal->GetNumberOfTimeBins();
+  return calFEE->GetNumberOfTimeBins();
 
 }
 
@@ -613,8 +682,8 @@ Char_t AliTRDcalibDB::GetPadStatus(Int_t det, Int_t col, Int_t row)
   // Returns the status of the given pad
   //
 
-  const AliTRDCalPadStatus *cal     = dynamic_cast<const AliTRDCalPadStatus *> 
-                                      (GetCachedCDBObject(kIDPadStatus));
+  const AliTRDCalPadStatus *cal  = dynamic_cast<const AliTRDCalPadStatus *> 
+                                   (GetCachedCDBObject(kIDPadStatus));
   if (!cal) {
     return -1;
   }
@@ -731,14 +800,20 @@ Bool_t AliTRDcalibDB::IsChamberMasked(Int_t det)
 }
 
 //_____________________________________________________________________________
-const AliTRDCalPIDLQ *AliTRDcalibDB::GetPIDLQObject()
+const AliTRDCalPID *AliTRDcalibDB::GetPIDObject(const Int_t method)
 {
   //
   // Returns the object storing the distributions for PID with likelihood
   //
 
-  return dynamic_cast<const AliTRDCalPIDLQ *> 
-         (GetCachedCDBObject(kIDPIDLQ));
+  switch(method) {
+    case 0: return dynamic_cast<const AliTRDCalPID *> 
+                              (GetCachedCDBObject(kIDPIDNN));
+    case 1: return dynamic_cast<const AliTRDCalPID *>
+                              (GetCachedCDBObject(kIDPIDLQ));
+  }
+
+  return 0;
 
 }