]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTrackerConditionDataMaker.cxx
Fix related to change of data member name in the base class.
[u/mrichter/AliRoot.git] / MUON / AliMUONTrackerConditionDataMaker.cxx
index cf2e056d29eec5e79c2e84ce9c2e38cff62502ae..4379f55757c42303bbf691d3435febff74f2288f 100644 (file)
@@ -40,6 +40,7 @@ ClassImp(AliMUONTrackerConditionDataMaker)
 #include "AliMUONDigitCalibrator.h"
 #include "AliMUONPadStatusMaker.h"
 #include "AliMUONPadStatusMapMaker.h"
+#include "AliMUONRejectList.h"
 #include "AliMUONTrackerData.h"
 #include "AliMUONTrackerIO.h"
 #include "AliMpArrayI.h"
@@ -56,11 +57,22 @@ ClassImp(AliMUONTrackerConditionDataMaker)
 #include <sstream>
 #include "TSystem.h"
 
+//_____________________________________________________________________________
+AliMUONTrackerConditionDataMaker::AliMUONTrackerConditionDataMaker():
+AliMUONVTrackerDataMaker(),
+fData(0x0),
+fSource(""),
+fIsOwnerOfData(kTRUE)
+{
+  /// default ctor to be able to stream
+}
+
 //_____________________________________________________________________________
 AliMUONTrackerConditionDataMaker::AliMUONTrackerConditionDataMaker(Int_t runNumber, const char* ocdbPath, const char* type):
 AliMUONVTrackerDataMaker(),
 fData(0x0),
-fSource(Form("%s-%010d-%s",ocdbPath,runNumber,type))
+fSource(Form("%s-%010d-%s",ocdbPath,runNumber,type)),
+fIsOwnerOfData(kTRUE)
 {
   /// ctor from OCDB
 
@@ -68,16 +80,35 @@ fSource(Form("%s-%010d-%s",ocdbPath,runNumber,type))
        
        AliCDBManager::Instance()->SetDefaultStorage(ocdbPath);
 
-  Int_t startOfValidity;
-  AliMUONVStore* store = CreateStore(runNumber,ocdbPath,type,startOfValidity);
-  AliDebug(1,Form("runNumber=%d ocdbPath=%s type=%s startOfValidity=%d store=%p",
-                  runNumber,ocdbPath,type,startOfValidity,store));
-  if ( store )
+  TString stype(type);
+  stype.ToUpper();
+  
+  if ( stype == "REJECTLIST" ) 
   {
-    fData = CreateData(type,*store,startOfValidity);
-  }  
+    
+    Int_t startOfValidity(0);
+    
+    AliMUONRejectList* rl = AliMUONCalibrationData::CreateRejectList(runNumber,&startOfValidity);    
 
-  delete store;
+    if (rl)
+    {
+      fData = new AliMUONTrackerData(Form("RL%d",startOfValidity),"RejectList",*rl);
+    }
+    
+    delete rl;
+  }
+  else
+  {
+    Int_t startOfValidity;
+    AliMUONVStore* store = CreateStore(runNumber,ocdbPath,type,startOfValidity);
+    AliDebug(1,Form("runNumber=%d ocdbPath=%s type=%s startOfValidity=%d store=%p",
+                    runNumber,ocdbPath,type,startOfValidity,store));
+    if ( store )
+    {
+      fData = CreateData(type,*store,startOfValidity);
+    }
+    // we do not delete the store, as it's supposedly part of the OCDB cache...
+  }
   
   AliCDBManager::Instance()->SetDefaultStorage(storage);
 }
@@ -86,7 +117,8 @@ fSource(Form("%s-%010d-%s",ocdbPath,runNumber,type))
 AliMUONTrackerConditionDataMaker::AliMUONTrackerConditionDataMaker(const char* filename, const char* type):
 AliMUONVTrackerDataMaker(),
 fData(0x0),
-fSource(Form("%s-%s",filename,type))
+fSource(Form("%s-%s",filename,type)),
+fIsOwnerOfData(kTRUE)
 {
   /// ctor from an ASCII file
   
@@ -120,7 +152,9 @@ fSource(Form("%s-%s",filename,type))
 AliMUONTrackerConditionDataMaker::AliMUONTrackerConditionDataMaker(const char* data, const char* type, Bool_t) :
 AliMUONVTrackerDataMaker(),
 fData(0x0),
-fSource(Form("direct-%s",type))
+fSource(Form("direct-%s",type)),
+fIsOwnerOfData(kTRUE)
+
 {
   /// ctor from a string containing the ASCII data
   /// the last parameter is there just to distinguish this ctor from the previous one
@@ -141,7 +175,7 @@ fSource(Form("direct-%s",type))
 AliMUONTrackerConditionDataMaker::~AliMUONTrackerConditionDataMaker()
 {
   /// dtor
-  delete fData;
+  if ( fIsOwnerOfData ) delete fData;
 }
 
 
@@ -281,14 +315,23 @@ AliMUONTrackerConditionDataMaker::CreateHVStore(TMap& m)
       AliDCSValue* v;
       Float_t hvValue(0);
       Int_t n(0);
+      Int_t noff(0);
+      
       while ( ( v = static_cast<AliDCSValue*>(n2()) ) )
       {
         hvValue += v->GetFloat();
+        if ( v->GetFloat() < AliMpDCSNamer::TrackerHVOFF() ) ++noff;
         ++n;
       }
       hvValue *= switchValue;  
       
       if ( n ) hvValue /= n;
+
+      if (noff>0 && noff<n) 
+      {
+        // that's a trip
+        hvValue = -1.0;        
+      }
       
       Int_t nofChannels(AliMpConstants::ManuNofChannels());
       
@@ -438,6 +481,7 @@ AliMUONTrackerConditionDataMaker::CreateStore(Int_t runNumber,
     if ( ocdb ) 
     {
       store = AliMUONCalibrationData::CreateOccupancyMap(runNumber,&startOfValidity);
+      if (store) store = static_cast<AliMUONVStore*>(store->Clone());
     }
     else
     {