Fix to HV datapoints retrieval in case the HV is switched off before run-completed...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 30 Nov 2009 11:12:14 +0000 (11:12 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 30 Nov 2009 11:12:14 +0000 (11:12 +0000)
VZERO/AliVZERODataDCS.cxx
VZERO/AliVZERODataDCS.h
VZERO/AliVZEROPreprocessor.cxx

index 44f20af..86eb002 100644 (file)
@@ -46,6 +46,8 @@ AliVZERODataDCS::AliVZERODataDCS():
        fRun(0),
        fStartTime(0),
        fEndTime(0),
+       fDaqStartTime(0),
+       fDaqEndTime(0),
     fGraphs("TGraph",kNGraphs),
        fFEEParameters(NULL),
        fIsProcessed(kFALSE)
@@ -60,11 +62,13 @@ AliVZERODataDCS::AliVZERODataDCS():
 }
 
 //_____________________________________________________________________________
-AliVZERODataDCS::AliVZERODataDCS(Int_t nRun, UInt_t startTime, UInt_t endTime):
+AliVZERODataDCS::AliVZERODataDCS(Int_t nRun, UInt_t startTime, UInt_t endTime, UInt_t daqStartTime, UInt_t daqEndTime):
        TObject(),
        fRun(nRun),
        fStartTime(startTime),
        fEndTime(endTime),
+       fDaqStartTime(daqStartTime),
+       fDaqEndTime(daqEndTime),
        fGraphs("TGraph",kNGraphs),
        fFEEParameters(new TMap()),
        fIsProcessed(kFALSE)
@@ -77,9 +81,11 @@ AliVZERODataDCS::AliVZERODataDCS(Int_t nRun, UInt_t startTime, UInt_t endTime):
         fMeanHV[i]      = 100.0;
      fWidthHV[i]     = 0.0; 
        }
-       AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", nRun,
+       AliInfo(Form("\n\tRun %d \n\tTime Created %s \n\tTime Completed %s \n\tDAQ start %s \n\tDAQ end %s  ", nRun,
                TTimeStamp(startTime).AsString(),
-               TTimeStamp(endTime).AsString()));
+               TTimeStamp(endTime).AsString(),
+               TTimeStamp(daqStartTime).AsString(),
+               TTimeStamp(daqEndTime).AsString()));
        
        fFEEParameters->SetOwnerValue();
        Init();
@@ -134,11 +140,14 @@ void AliVZERODataDCS::ProcessData(TMap& aliasMap){
 
        while((aValue = (AliDCSValue*) iterarray.Next())) {
                        values[iValue] = aValue->GetFloat();
+                       UInt_t currentTime = aValue->GetTimeStamp();
+                       times[iValue] = (Double_t) (currentTime);
+                       
                        if(iValue>0) {
                                if(values[iValue-1]>0.) variation = TMath::Abs(values[iValue]-values[iValue-1])/values[iValue-1];
+                               if(currentTime>fDaqEndTime && variation>0.10) continue;
                                if(variation > 0.10) fDeadChannel[GetOfflineChannel(iAlias)] = kTRUE;
                        }
-                       times[iValue] = (Double_t) (aValue->GetTimeStamp());
                        fHv[iAlias]->Fill(values[iValue]);
                        printf("%s %f Dead=%d\n",fAliasNames[iAlias].Data(),values[iValue],fDeadChannel[GetOfflineChannel(iAlias)]);
                        iValue++;
index 67b34ff..19ad122 100644 (file)
@@ -24,15 +24,19 @@ public:
   enum {kHvMin=0, kHvMax=3000};
   
   AliVZERODataDCS();
-  AliVZERODataDCS(Int_t nRun, UInt_t startTime, UInt_t endTime);
+  AliVZERODataDCS(Int_t nRun, UInt_t timeCreated, UInt_t timeCompleted, UInt_t daqStart, UInt_t daqEnd);
   ~AliVZERODataDCS();
   
   void SetRun(Int_t run) {fRun = run;}
   void SetStartTime(Int_t startTime) {fStartTime = startTime;}
   void SetEndTime(Int_t endTime) {fEndTime = endTime;}
+  void SetDaqStartTime(Int_t startTime) {fDaqStartTime = startTime;}
+  void SetDaqEndTime(Int_t endTime) {fDaqEndTime = endTime;}
   Int_t GetRun() const {return fRun;}
   Int_t GetStartTime() const {return fStartTime;}
   Int_t GetEndTime() const {return fEndTime;}
+  Int_t GetDaqStartTime() const {return fDaqStartTime;}
+  Int_t GetDaqEndTime() const {return fDaqEndTime;}
   
   void ProcessData(TMap& aliasMap);
   
@@ -69,9 +73,10 @@ private:
   void CreateGraph(int i, int dim, const Double_t *x, const Double_t *y);
     
   Int_t fRun;       // Run number
-  Int_t fStartTime; // start time
-  Int_t fEndTime;   // end time
-  
+  Int_t fStartTime; // start time (time created)
+  Int_t fEndTime;   // end time (time completed)
+  UInt_t fDaqStartTime; // DAQ start time
+  UInt_t fDaqEndTime;   // DAQ end time
   
   TString fAliasNames[kNAliases];        // aliases for DCS data
   TClonesArray fGraphs;                         // Array containing  graphics
@@ -83,7 +88,7 @@ private:
     
   Bool_t fIsProcessed;                   // bool to know processing status
   
-  ClassDef(AliVZERODataDCS, 4);
+  ClassDef(AliVZERODataDCS, 5);
 };
 
 #endif
index f538c37..e95c932 100644 (file)
@@ -70,8 +70,10 @@ void AliVZEROPreprocessor::Initialize(Int_t run, UInt_t startTime,
    // fEndTime   = endTime;
    fStartTime = GetStartTimeDCSQuery ();
    fEndTime   = GetEndTimeDCSQuery ();
-
-       fData      = new AliVZERODataDCS(fRun, fStartTime, fEndTime);
+   time_t daqStart = (time_t) (((TString)GetRunParameter("DAQ_time_start")).Atoi());
+   time_t daqEnd   = (time_t) (((TString)GetRunParameter("DAQ_time_end")).Atoi());
+   
+       fData      = new AliVZERODataDCS(fRun, fStartTime, fEndTime,(UInt_t)daqStart, (UInt_t)daqEnd);
        fFEEData   = new AliVZERODataFEE(fRun, fStartTime, fEndTime);           
    
 }