]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDcalibDB.cxx
Fixed usage of esdVtx for v0s
[u/mrichter/AliRoot.git] / TRD / AliTRDcalibDB.cxx
index 4eff278aed89615853b4a44e1c8d6138eca560cf..e1442252a83426a89152c0f012733815f429b2b6 100644 (file)
@@ -30,6 +30,7 @@
 
 #include <TMath.h>
 #include <TRandom.h>
+#include <TClonesArray.h>
 
 #include "AliCDBManager.h"
 #include "AliCDBStorage.h"
@@ -37,6 +38,7 @@
 #include "AliLog.h"
 
 #include "AliTRDcalibDB.h"
+#include "AliTRDrecoParam.h"
 #include "AliTRDgeometry.h"
 #include "AliTRDpadPlane.h"
 #include "AliTRDCommonParam.h"
@@ -256,6 +258,9 @@ const TObject *AliTRDcalibDB::GetCachedCDBObject(Int_t id)
     case kIDPIDLQ : 
       return CacheCDBEntry(kIDPIDLQ             ,"TRD/Calib/PIDLQ"); 
       break;
+    case kIDRecoParam : 
+      return CacheCDBEntry(kIDRecoParam             ,"TRD/Calib/RecoParam"); 
+      break;
 
   }
 
@@ -272,7 +277,7 @@ AliCDBEntry *AliTRDcalibDB::GetCDBEntry(const char *cdbPath)
     
   AliCDBEntry *entry = AliCDBManager::Instance()->Get(cdbPath,fRun);
   if (!entry) { 
-    AliFatal(Form("Failed to get entry: %s",cdbPath));
+    AliError(Form("Failed to get entry: %s",cdbPath));
     return 0; 
   }
   
@@ -813,6 +818,18 @@ Char_t AliTRDcalibDB::GetChamberStatus(Int_t det)
 
 }
 
+//_____________________________________________________________________________
+AliTRDrecoParam* AliTRDcalibDB::GetRecoParam(Int_t */*eventtype*/)
+{
+  const TClonesArray *recos = dynamic_cast<const TClonesArray*>(GetCachedCDBObject(kIDRecoParam));
+  if(!recos) return 0x0;
+
+  // calculate entry based on event type info
+  Int_t n = 0; //f(eventtype[0], eventtype[1], ....)
+  return (AliTRDrecoParam*)recos->UncheckedAt(n);
+}
+
+
 //_____________________________________________________________________________
 Bool_t AliTRDcalibDB::IsPadMasked(Int_t det, Int_t col, Int_t row)
 {
@@ -915,16 +932,16 @@ Bool_t AliTRDcalibDB::IsChamberMasked(Int_t det)
 }
 
 //_____________________________________________________________________________
-const AliTRDCalPID *AliTRDcalibDB::GetPIDObject(AliTRDrecoParam::AliTRDpidMethod method)
+const AliTRDCalPID *AliTRDcalibDB::GetPIDObject(AliTRDReconstructor::AliTRDpidMethod method)
 {
   //
   // Returns the object storing the distributions for PID with likelihood
   //
 
   switch(method) {
-  case AliTRDrecoParam::kLQPID: 
+  case AliTRDReconstructor::kLQPID: 
     return dynamic_cast<const AliTRDCalPID *>(GetCachedCDBObject(kIDPIDLQ));
-  case AliTRDrecoParam::kNNPID: 
+  case AliTRDReconstructor::kNNPID: 
     return dynamic_cast<const AliTRDCalPID *>(GetCachedCDBObject(kIDPIDNN));
   }
 
@@ -1149,7 +1166,7 @@ void AliTRDcalibDB::SamplePRF()
 
 //_____________________________________________________________________________
 Int_t AliTRDcalibDB::PadResponse(Double_t signal, Double_t dist
-                                , Int_t layer, Double_t *pad) const
+                               , Int_t layer, Double_t *pad) const
 {
   //
   // Applies the pad response
@@ -1157,7 +1174,7 @@ Int_t AliTRDcalibDB::PadResponse(Double_t signal, Double_t dist
   // something dependent on calibration values
   //
 
-  Int_t iBin  = ((Int_t) (( - dist - fPRFlo) / fPRFwid));
+  Int_t iBin  = ((Int_t) ((-dist - fPRFlo) / fPRFwid));
   Int_t iOff  = layer * fPRFbin;
 
   Int_t iBin0 = iBin - fPRFpad + iOff;