move to AliTRDcalibDB::GetNumberOfTimeBinsDCS() (Raphaelle)
authorabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 30 Nov 2009 08:51:56 +0000 (08:51 +0000)
committerabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 30 Nov 2009 08:51:56 +0000 (08:51 +0000)
PWG1/TRD/AliTRDcalibration.cxx
PWG1/TRD/AliTRDcalibration.h

index 82a7907..bc3bcf8 100644 (file)
@@ -98,7 +98,7 @@ AliTRDcalibration::AliTRDcalibration()
   ,fVdriftLinear(kTRUE)
   ,flow(0)
   ,fhigh(30)
-  ,fNbTimeBins(30)
+  ,fNbTimeBins(0)
   ,ffillZero(kFALSE)
   ,fnormalizeNbOfCluster(kFALSE)
   ,fmaxCluster(0)
@@ -154,8 +154,14 @@ void AliTRDcalibration::CreateOutputObjects()
   OpenFile(0, "RECREATE");
   
   // Number of time bins
-  AliTRDcalibDB *cal = AliTRDcalibDB::Instance();
-  fNbTimeBins = cal->GetNumberOfTimeBins();
+  if(fNbTimeBins==0) {
+    AliTRDcalibDB *cal = AliTRDcalibDB::Instance();
+    fNbTimeBins = cal->GetNumberOfTimeBinsDCS();
+    if(fNbTimeBins <= 0){ 
+      AliWarning(Form("No of TimeBins from DB [%d] use default [30]", fNbTimeBins));
+      fNbTimeBins = 30;
+    }
+  }
   
   // instance calibration: what to calibrate
   fTRDCalibraFillHisto = AliTRDCalibraFillHisto::Instance();
@@ -189,7 +195,7 @@ void AliTRDcalibration::CreateOutputObjects()
   fTRDCalibraFillHisto->SetDebugLevel(DebugLevel()); //debug stuff
 
   // Init the stuff
-  fTRDCalibraFillHisto->Init2Dhistos(); // initialise the histos
+  fTRDCalibraFillHisto->Init2Dhistos(fNbTimeBins); // initialise the histos
 
   // cuts
   fTRDCalibraFillHisto->SetNumberClusters(flow); // At least flow clusters
@@ -1368,6 +1374,4 @@ Int_t AliTRDcalibration::GetNumberOfGroupsPRF(const char* nametitle) const
     return 6;
   }
   else return -1;
-
 }
index 0c24a2c..bddc66e 100644 (file)
@@ -80,6 +80,7 @@ public:
   void SetHisto2d(Bool_t histo2d)                                   {fHisto2d=histo2d;};
   void SetVector2d(Bool_t vector2d)                                 {fVector2d=vector2d;};
   void SetVdriftLinear(Bool_t vdriftLinear)                         {fVdriftLinear = vdriftLinear;};
+  void SetNbTimeBins(Int_t nbTimeBins)                              {fNbTimeBins=nbTimeBins;};
   void SetLow(Int_t low)                                            {flow=low;};
   void SetHigh(Int_t high)                                          {fhigh=high;};
   void SetNz(Short_t nz, Int_t i)                                   {fNz[i]=nz;};
@@ -148,4 +149,3 @@ private:
   ClassDef(AliTRDcalibration, 1) // calibration task
 };
 #endif
-