]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- Protection to avoid storing DCS datapoints taken outside run
authorlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 2 Sep 2009 13:29:55 +0000 (13:29 +0000)
committerlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 2 Sep 2009 13:29:55 +0000 (13:29 +0000)
(Diego)

MUON/AliMUONHVSubprocessor.cxx
MUON/AliMUONTriggerDCSSubprocessor.cxx
MUON/AliMUONVSubprocessor.cxx
MUON/AliMUONVSubprocessor.h
MUON/TestMUONPreprocessor.C

index c4529d6a7f65b2617826a994e8aad267ef606c27..f639b7a970ae0ce89ce55e5b82cdf49a6b8d1995 100644 (file)
@@ -133,8 +133,8 @@ AliMUONHVSubprocessor::Process(TMap* dcsAliasMap)
       }
       else
       {
-        //FIXME : should insure here that values are only the ones within run
-        //limits (startTime<timestamp<endTime)
+       RemoveValuesOutsideRun(values);
+
         hv.Add(new TObjString(aliasName.Data()),values);
       }
     }
index 3d434e3da1f295f11f69b49e6fc660e6c2e89db9..4476895d479dc0c4aac851ca4f6bb1da13b266a5 100644 (file)
@@ -36,6 +36,7 @@
 
 #include "AliCDBMetaData.h"
 #include "AliLog.h"
+#include "AliDCSValue.h"
 
 #include "Riostream.h"
 #include "TMap.h"
@@ -119,8 +120,8 @@ AliMUONTriggerDCSSubprocessor::Process(TMap* dcsAliasMap)
       else
       {
        TObjArray* values = static_cast<TObjArray*>(dcsMapPair->Value()->Clone());
-        //FIXME : should insure here that values are only the ones within run
-        //limits (startTime<timestamp<endTime)
+       RemoveValuesOutsideRun(values);
+
         dcsMap.Add(new TObjString(aliasName.Data()),values);
       }
     }
index 79f523fb0f6d6bf010d3a2254733e4ec134b4d1c..9391585ff5f3f1f77c78d5fa9475e244af58e0b4 100644 (file)
@@ -15,6 +15,8 @@
 
 // $Id$
 
+#include "TObjArray.h"
+#include "AliDCSValue.h"
 #include "AliMUONVSubprocessor.h"
 
 //-----------------------------------------------------------------------------
@@ -36,7 +38,9 @@ ClassImp(AliMUONVSubprocessor)
 AliMUONVSubprocessor::AliMUONVSubprocessor(AliMUONPreprocessor* master,
                                            const char* name,
                                            const char* title)
-: TNamed(name,title), fMaster(master)
+  : TNamed(name,title), fMaster(master),
+    fStartTime(0),
+    fEndTime(0)
 {
   /// ctor
 }
@@ -50,9 +54,34 @@ AliMUONVSubprocessor::~AliMUONVSubprocessor()
 //_____________________________________________________________________________
 void
 AliMUONVSubprocessor::Initialize(Int_t /*run*/, 
-                                 UInt_t /*startTime*/
-                                 UInt_t /*endTime*/)
+                                 UInt_t startTime
+                                 UInt_t endTime)
 {
   /// optional
+  fStartTime = startTime;
+  fEndTime = endTime;
+}
+
+//_____________________________________________________________________________
+Bool_t
+AliMUONVSubprocessor::RemoveValuesOutsideRun(TObjArray* values)
+{
+  /// Remove values outside run time limits
+
+  TIter next(values);
+  AliDCSValue* val = 0x0;
+
+  Bool_t removedValues = kFALSE;
+       
+  while ( ( val = static_cast<AliDCSValue*>(next()) ) )
+  {
+    if ( val->GetTimeStamp() < fStartTime || val->GetTimeStamp() > fEndTime ) {
+      values->Remove(val);
+      removedValues = kTRUE;
+    }
+  }
+  values->Compress();
+
+  return removedValues;
 }
 
index a9a7e9c5f6d8c754fb3dd913770af45091d2074f..094bc74253bf70d88c88001dbc1b16b343c2ee95 100644 (file)
@@ -17,6 +17,7 @@
 #endif
 
 class TMap;
+class TObjectArray;
 class AliMUONPreprocessor;
 
 class AliMUONVSubprocessor : public TNamed
@@ -34,6 +35,8 @@ public:
 protected:
   /// Return the pointer to our master
   AliMUONPreprocessor* Master() const { return fMaster; }
+
+  Bool_t RemoveValuesOutsideRun ( TObjArray* values );
   
   /// Not implemented
   AliMUONVSubprocessor();
@@ -44,8 +47,10 @@ protected:
   
 private:
   AliMUONPreprocessor* fMaster; ///< Pointer to our master
+  UInt_t fStartTime; ///< Start time of run
+  UInt_t fEndTime;   ///< End time of run
   
-  ClassDef(AliMUONVSubprocessor,1) // Base class of MUON shuttle sub(pre)processors
+  ClassDef(AliMUONVSubprocessor,2) // Base class of MUON shuttle sub(pre)processors
 };
 
 #endif
index 214cbb32828eda7be31ca7ca8719346ed35a6b2f..682398304e3957b3d6ee508ea2cf434a29a02fd0 100644 (file)
@@ -29,6 +29,7 @@
 /// the rootlogon.C there) before compiling this macro :
 /// <pre>
 /// gSystem->Load("$ALICE_ROOT/SHUTTLE/TestShuttle/libTestShuttle");
+/// gSystem->Load("$ALICE_ROOT/MUON/libMUONshuttle");
 /// </pre>
 ///
 /// Having $ALICE_ROOT/SHUTTLE/TestShuttle directory in your LD_LIBRARY_PATH