]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
status entry produced by AliTPCPreprocessor
authorhaavard <haavard@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 18 Jan 2008 14:45:36 +0000 (14:45 +0000)
committerhaavard <haavard@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 18 Jan 2008 14:45:36 +0000 (14:45 +0000)
TPC/AliTPCPreprocessor.cxx

index eb16bb53fb794d098dd779851cebc8c472939f1c..8a3d8919b84a90099c83410b505f23ed433e29a9 100644 (file)
 #include "TFile.h"
 #include "TTree.h"
 #include "TEnv.h"
+#include "TParameter.h"
 
 #include <TTimeStamp.h>
 
 const Int_t kValCutTemp = 100;               // discard temperatures > 100 degrees
 const Int_t kDiffCutTemp = 5;               // discard temperature differences > 5 degrees
-const TString kPedestalRunType = "PEDESTAL_RUN";  // pedestal run identifier
-const TString kPulserRunType = "PULSER_RUN";   // pulser run identifier
+const TString kPedestalRunType = "PEDESTAL";  // pedestal run identifier
+const TString kPulserRunType = "PULSER";   // pulser run identifier
 const TString kPhysicsRunType = "PHYSICS";   // physics run identifier
 const TString kStandAloneRunType = "STANDALONE"; // standalone run identifier
 const TString kDaqRunType = "DAQ"; // DAQ run identifier
@@ -93,7 +94,9 @@ void AliTPCPreprocessor::Initialize(Int_t run, UInt_t startTime,
 {
   // Creates AliTestDataDCS object
 
-  AliPreprocessor::Initialize(run, startTime, endTime);
+  UInt_t startTimeLocal = startTime-3600;
+
+  AliPreprocessor::Initialize(run, startTimeLocal, endTime);
 
        AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", run,
                TTimeStamp(startTime).AsString(),
@@ -123,7 +126,7 @@ void AliTPCPreprocessor::Initialize(Int_t run, UInt_t startTime,
           fConfigOK = kFALSE;
           return;
         }
-        fTemp = new AliTPCSensorTempArray(fStartTime, fEndTime, confTree, kAmandaTemp);
+        fTemp = new AliTPCSensorTempArray(startTimeLocal, endTime, confTree, kAmandaTemp);
        fTemp->SetValCut(kValCutTemp);
        fTemp->SetDiffCut(kDiffCutTemp);
        }
@@ -142,7 +145,7 @@ void AliTPCPreprocessor::Initialize(Int_t run, UInt_t startTime,
            fConfigOK = kFALSE;
            return;
         }
-        fHighVoltage = new AliDCSSensorArray(fStartTime, fEndTime, confTree);
+        fHighVoltage = new AliDCSSensorArray(startTimeLocal, endTime, confTree);
       }
 }
 
@@ -153,10 +156,23 @@ UInt_t AliTPCPreprocessor::Process(TMap* dcsAliasMap)
 
   // Amanda servers provide information directly through dcsAliasMap
 
-  if (!dcsAliasMap) return 9;
-  if (dcsAliasMap->GetEntries() == 0 ) return 9;
   if (!fConfigOK) return 9;
   UInt_t result = 0;
+  TObjArray *resultArray = new TObjArray();
+  TString errorHandling = fConfEnv->GetValue("ErrorHandling","ON");
+  errorHandling.ToUpper();
+  TObject * status;
+
+  UInt_t dcsResult=0;
+  if (errorHandling == "OFF" ) {
+    if (!dcsAliasMap) dcsResult=1;
+    if (dcsAliasMap->GetEntries() == 0 ) dcsResult=1;  
+    status = new TParameter<int>("dcsResult",dcsResult);
+    resultArray->Add(status);
+  } else {
+    if (!dcsAliasMap) return 9;
+    if (dcsAliasMap->GetEntries() == 0 ) return 9;
+  }
 
   TString runType = GetRunType();
 
@@ -167,6 +183,8 @@ UInt_t AliTPCPreprocessor::Process(TMap* dcsAliasMap)
   if (tempConf != "OFF" ) {
     UInt_t tempResult = MapTemperature(dcsAliasMap);
     result=tempResult;
+    status = new TParameter<int>("tempResult",tempResult);
+    resultArray->Add(status);
   }
 
   // High Voltage recordings
@@ -177,6 +195,8 @@ UInt_t AliTPCPreprocessor::Process(TMap* dcsAliasMap)
   if (hvConf != "OFF" ) { 
    UInt_t hvResult = MapHighVoltage(dcsAliasMap);
    result+=hvResult;
+   status = new TParameter<int>("hvResult",hvResult);
+   resultArray->Add(status);
  }
 
   // Other calibration information will be retrieved through FXS files
@@ -209,6 +229,8 @@ UInt_t AliTPCPreprocessor::Process(TMap* dcsAliasMap)
        if ( pedestalResult == 0 ) break;
      }
      result += pedestalResult;
+     status = new TParameter<int>("pedestalResult",pedestalResult);
+     resultArray->Add(status);
     }
   }
 
@@ -234,6 +256,8 @@ UInt_t AliTPCPreprocessor::Process(TMap* dcsAliasMap)
        if ( pulserResult == 0 ) break;
      }
      result += pulserResult;
+     status = new TParameter<int>("pulserResult",pulserResult);
+     resultArray->Add(status);
     }
   }
 
@@ -263,12 +287,18 @@ UInt_t AliTPCPreprocessor::Process(TMap* dcsAliasMap)
        if ( ceResult == 0 ) break;
      }
      result += ceResult;
+     status = new TParameter<int>("ceResult",ceResult);
+     resultArray->Add(status);
     }
   }
   
-  TString errorHandling = fConfEnv->GetValue("ErrorHandling","ON");
-  errorHandling.ToUpper();
   if (errorHandling == "OFF" ) {
+    AliCDBMetaData metaData;
+    metaData.SetBeamPeriod(0);
+    metaData.SetResponsible("Haavard Helstrup");
+    metaData.SetComment("Preprocessor AliTPC status.");
+    Store("Calib", "PreprocStatus", resultArray, &metaData, 0, kFALSE);
+    resultArray->Delete();
    return 0;
   } else { 
    return result;