1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 #include "AliMUONPreprocessor.h"
20 #include "AliMUONPedestalSubprocessor.h"
21 #include "AliMUONHVSubprocessor.h"
22 #include "AliMUONGMSSubprocessor.h"
25 #include "AliShuttleInterface.h"
26 #include "Riostream.h"
27 #include "TObjArray.h"
29 /// \class AliMUONPreprocessor
31 /// Shuttle preprocessor for MUON subsystems (TRK and TRG)
33 /// It's simply a manager class that deals with a list of sub-tasks
34 /// (of type AliMUONVSubprocessor).
36 /// \author Laurent Aphecetche
39 ClassImp(AliMUONPreprocessor)
42 //_____________________________________________________________________________
43 AliMUONPreprocessor::AliMUONPreprocessor(const char* detName, AliShuttleInterface* shuttle)
44 : AliPreprocessor(detName, shuttle),
45 fSubprocessors(new TObjArray()),
51 //_____________________________________________________________________________
52 AliMUONPreprocessor::~AliMUONPreprocessor()
55 delete fSubprocessors;
58 //_____________________________________________________________________________
60 AliMUONPreprocessor::ClearSubprocessors()
62 /// Empty our subprocessor list
63 fSubprocessors->Clear();
67 //_____________________________________________________________________________
69 AliMUONPreprocessor::Add(AliMUONVSubprocessor* sub, Bool_t processDCS)
71 /// Add a subprocessor to our list of workers
72 fSubprocessors->Add(sub);
73 if ( processDCS == kTRUE ) fProcessDCS = processDCS;
76 //_____________________________________________________________________________
78 AliMUONPreprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime)
80 /// loop over subtasks and initialize them
81 for ( Int_t i = 0; i <= fSubprocessors->GetLast(); ++i )
83 Subprocessor(i)->Initialize(run,startTime,endTime);
87 //_____________________________________________________________________________
89 AliMUONPreprocessor::Process(TMap* dcsAliasMap)
91 /// loop over subtasks to make them work
94 for ( Int_t i = 0; i <= fSubprocessors->GetLast(); ++i )
96 rv += Subprocessor(i)->Process(dcsAliasMap);
101 //_____________________________________________________________________________
103 AliMUONPreprocessor::Print(Option_t* opt) const
106 cout << "<AliMUONPreprocessor> subprocessors :" << endl;
107 for ( Int_t i=0; i <= fSubprocessors->GetLast(); ++i )
109 Subprocessor(i)->Print(opt);
113 //_____________________________________________________________________________
114 AliMUONVSubprocessor*
115 AliMUONPreprocessor::Subprocessor(Int_t i) const
117 /// return i-th subprocessor
118 if ( i >= 0 && i <= fSubprocessors->GetLast() )
120 return static_cast<AliMUONVSubprocessor*>(fSubprocessors->At(i));