]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONVSubprocessor.cxx
bookkeep pt hard info when generating on-the-fly pythia events
[u/mrichter/AliRoot.git] / MUON / AliMUONVSubprocessor.cxx
index 0866ff618768d3c004c16bab7801a600e22811ef..8cf3c40d53d9b85bdedb89229f3a30c9d77c4953 100644 (file)
 
 // $Id$
 
+#include "TObjArray.h"
+#include "AliDCSValue.h"
 #include "AliMUONVSubprocessor.h"
 
+//-----------------------------------------------------------------------------
 /// \class AliMUONVSubprocessor
 ///
 /// Base class for a shuttle sub-task for MUON (either TRK or TRG)
@@ -25,7 +28,7 @@
 /// to be performed within the MUON shuttle's preprocessors
 ///
 /// \author Laurent Aphecetche
-///
+//-----------------------------------------------------------------------------
 
 /// \cond CLASSIMP
 ClassImp(AliMUONVSubprocessor)
@@ -35,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
 }
@@ -47,11 +52,37 @@ AliMUONVSubprocessor::~AliMUONVSubprocessor()
 }
 
 //_____________________________________________________________________________
-void
+Bool_t
 AliMUONVSubprocessor::Initialize(Int_t /*run*/, 
-                                 UInt_t /*startTime*/
-                                 UInt_t /*endTime*/)
+                                 UInt_t startTime
+                                 UInt_t endTime)
 {
   /// optional
+  fStartTime = startTime; // time_created
+  fEndTime = endTime; // time_completed
+  return kTRUE;
+}
+
+//_____________________________________________________________________________
+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;
 }