Fix by Raphaelle for JIRA ticket ALIROOT-5590
authorcblume <Christoph.Blume@cern.ch>
Wed, 27 Aug 2014 12:13:25 +0000 (14:13 +0200)
committercblume <Christoph.Blume@cern.ch>
Wed, 27 Aug 2014 12:13:57 +0000 (14:13 +0200)
TRD/AliTRDCalibraFillHisto.cxx
TRD/AliTRDCalibraFillHisto.h
TRD/AliTRDPreprocessorOffline.cxx

index 45d0238..800babf 100644 (file)
@@ -153,6 +153,7 @@ AliTRDCalibraFillHisto::AliTRDCalibraFillHisto()
   ,fCutWithVdriftCalib(kFALSE)
   ,fMinNbTRDtracklets(0)
   ,fMinTRDMomentum(0.0)
+  ,fTakeSnapshot(kTRUE)
   ,fFirstRunGain(0)
   ,fVersionGainUsed(0)
   ,fSubVersionGainUsed(0)
@@ -245,6 +246,7 @@ AliTRDCalibraFillHisto::AliTRDCalibraFillHisto(const AliTRDCalibraFillHisto &c)
   ,fCutWithVdriftCalib(c.fCutWithVdriftCalib)
   ,fMinNbTRDtracklets(c.fMinNbTRDtracklets)
   ,fMinTRDMomentum(c.fMinTRDMomentum)
+  ,fTakeSnapshot(c.fTakeSnapshot)
   ,fFirstRunGain(c.fFirstRunGain)
   ,fVersionGainUsed(c.fVersionGainUsed)
   ,fSubVersionGainUsed(c.fSubVersionGainUsed)
@@ -569,7 +571,13 @@ Bool_t AliTRDCalibraFillHisto::InitCalDet()
 
   // DB Setting
   // Get cal
-  AliCDBEntry *entry = AliCDBManager::Instance()->Get("TRD/Calib/ChamberGainFactor",fFirstRunGain,fVersionGainUsed,fSubVersionGainUsed);
+  AliCDBEntry *entry = 0x0;
+  if(fTakeSnapshot) { 
+    entry = AliCDBManager::Instance()->Get("TRD/Calib/ChamberGainFactor");
+  }   
+  else { 
+    entry = AliCDBManager::Instance()->Get("TRD/Calib/ChamberGainFactor",fFirstRunGain,fVersionGainUsed,fSubVersionGainUsed); 
+  }
   if(!entry) {
     AliError("No gain det calibration entry found");
     return kFALSE;
index 3d13043..7319aa1 100644 (file)
@@ -103,6 +103,7 @@ class AliTRDCalibraFillHisto : public TObject {
          void     SetLinearFitterDebugOn(Bool_t debug = kTRUE)              { fLinearFitterDebugOn = debug;         }
           void     SetExbAltFitOn(Bool_t fiton = kTRUE)                      { fExbAltFitOn      = fiton;}
          void     SetScaleWithTPCSignal(Bool_t scaleWithTPCSignal = kTRUE)  { fScaleWithTPCSignal = scaleWithTPCSignal;}
+         void     SetTakeSnapshot(Bool_t takesnapshot)                 { fTakeSnapshot = takesnapshot;   }
          void     SetFirstRunGain(Int_t firstRunGain)                       { fFirstRunGain = firstRunGain;   }
          void     SetVersionGainUsed(Int_t versionGainUsed)                 { fVersionGainUsed = versionGainUsed;   }
          void     SetSubVersionGainUsed(Int_t subVersionGainUsed)           { fSubVersionGainUsed = subVersionGainUsed;   }
@@ -224,6 +225,7 @@ AliTRDCalibraVector *GetCalibraVector() const                                { r
          Int_t    fMinNbTRDtracklets;      // Min number of TRD tracklets
          Float_t  fMinTRDMomentum;         // Min TRD momentum
   // Back correction
+         Bool_t   fTakeSnapshot;           // Take from snapshot
          Int_t    fFirstRunGain;           // FirstRunGain 
          Int_t    fVersionGainUsed;        // VersionGainUsed 
          Int_t    fSubVersionGainUsed;     // SubVersionGainUsed
@@ -348,7 +350,7 @@ AliTRDCalibraVector *GetCalibraVector() const                                { r
   AliTRDCalibraFillHisto();
   virtual ~AliTRDCalibraFillHisto(); 
     
-  ClassDef(AliTRDCalibraFillHisto,7)                         // TRD Calibration class
+  ClassDef(AliTRDCalibraFillHisto,8)                         // TRD Calibration class
 
 };
   
index 50de15f..67a440b 100644 (file)
@@ -502,7 +502,7 @@ Bool_t AliTRDPreprocessorOffline::ReadStatusGlobal(const Char_t* fileName){
   // 
   if(fSparse) return kTRUE;
   TFile fcalib(fileName);
-  TObjArray * array = (TObjArray*)fcalib.Get(fNameList);
+  TList * array = (TList*)fcalib.Get(fNameList);
   if (array){
     fSparse = (THnSparseI *) array->FindObject("NumberOfEntries");
     if(!fSparse) return kFALSE;
@@ -532,7 +532,7 @@ Bool_t AliTRDPreprocessorOffline::ReadGainGlobal(const Char_t* fileName){
   // 
   if(fCH2d) return kTRUE;
   TFile fcalib(fileName);
-  TObjArray * array = (TObjArray*)fcalib.Get(fNameList);
+  TList * array = (TList*)fcalib.Get(fNameList);
   if (array){
     TH2I *ch2d = (TH2I *) array->FindObject("CH2d");
     if(!ch2d) {
@@ -564,7 +564,7 @@ Bool_t AliTRDPreprocessorOffline::ReadVdriftT0Global(const Char_t* fileName){
   // 
   if(fPH2d) return kTRUE;
   TFile fcalib(fileName);
-  TObjArray * array = (TObjArray*)fcalib.Get(fNameList);
+  TList * array = (TList*)fcalib.Get(fNameList);
   if (array){
     TProfile2D *ph2d = (TProfile2D *) array->FindObject("PH2d");
     if(!ph2d) {
@@ -594,7 +594,7 @@ Bool_t AliTRDPreprocessorOffline::ReadVdriftLinearFitGlobal(const Char_t* fileNa
   // 
   if(fAliTRDCalibraVdriftLinearFit) return kTRUE;
   TFile fcalib(fileName);
-  TObjArray * array = (TObjArray*)fcalib.Get(fNameList);
+  TList * array = (TList*)fcalib.Get(fNameList);
   if (array){
     AliTRDCalibraVdriftLinearFit * dummy = (AliTRDCalibraVdriftLinearFit *) array->FindObject("AliTRDCalibraVdriftLinearFit");
     fAliTRDCalibraVdriftLinearFit = dummy ? (AliTRDCalibraVdriftLinearFit *) dummy->Clone() : 0x0;
@@ -618,7 +618,7 @@ Bool_t AliTRDPreprocessorOffline::ReadExbAltFitGlobal(const Char_t* fileName){
   // 
   if(fAliTRDCalibraExbAltFit) return kTRUE;
   TFile fcalib(fileName);
-  TObjArray * array = (TObjArray*)fcalib.Get(fNameList);
+  TList * array = (TList*)fcalib.Get(fNameList);
   if (array){
      AliTRDCalibraExbAltFit * dummy = (AliTRDCalibraExbAltFit *) array->FindObject("AliTRDCalibraExbAltFit");
      fAliTRDCalibraExbAltFit = dummy ? (AliTRDCalibraExbAltFit *)dummy->Clone() : 0x0;
@@ -643,7 +643,7 @@ Bool_t AliTRDPreprocessorOffline::ReadPRFGlobal(const Char_t* fileName){
   // 
   if(fPRF2d) return kTRUE;
   TFile fcalib(fileName);
-  TObjArray * array = (TObjArray*)fcalib.Get(fNameList);
+  TList * array = (TList*)fcalib.Get(fNameList);
   if (array){
     TProfile2D *prf2d = (TProfile2D *) array->FindObject("PRF2d");
     if(!prf2d) {