Reflecting changes in AliPreprocessor
[u/mrichter/AliRoot.git] / MUON / AliMUONPreprocessor.cxx
CommitLineData
ea199e33 1/**************************************************************************
2* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3* *
4* Author: The ALICE Off-line Project. *
5* Contributors are mentioned in the code where appropriate. *
6* *
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**************************************************************************/
15
16// $Id$
17
18#include "AliMUONPreprocessor.h"
57e176c0 19
ea199e33 20#include "AliMUONPedestalSubprocessor.h"
57e176c0 21#include "AliMUONHVSubprocessor.h"
fee1d02b 22#include "AliMUONGMSSubprocessor.h"
23
24#include "AliLog.h"
57e176c0 25#include "AliShuttleInterface.h"
ea199e33 26#include "Riostream.h"
fee1d02b 27#include "TObjArray.h"
ea199e33 28
29/// \class AliMUONPreprocessor
30///
31/// Shuttle preprocessor for MUON subsystems (TRK and TRG)
32///
33/// It's simply a manager class that deals with a list of sub-tasks
34/// (of type AliMUONVSubprocessor).
35///
36/// \author Laurent Aphecetche
37
38/// \cond CLASSIMP
39ClassImp(AliMUONPreprocessor)
40/// \endcond
41
42//_____________________________________________________________________________
6c7a0c0f 43AliMUONPreprocessor::AliMUONPreprocessor(const char* detName, AliShuttleInterface* shuttle)
44: AliPreprocessor(detName, shuttle),
d489129d 45 fSubprocessors(new TObjArray()),
46 fProcessDCS(kFALSE)
ea199e33 47{
6c7a0c0f 48 /// ctor
ea199e33 49}
50
51//_____________________________________________________________________________
52AliMUONPreprocessor::~AliMUONPreprocessor()
53{
54 /// dtor
55 delete fSubprocessors;
56}
57
58//_____________________________________________________________________________
59void
eca96915 60AliMUONPreprocessor::ClearSubprocessors()
6c7a0c0f 61{
62 /// Empty our subprocessor list
eca96915 63 fSubprocessors->Clear();
d489129d 64 fProcessDCS = kFALSE;
6c7a0c0f 65}
66
67//_____________________________________________________________________________
68void
d489129d 69AliMUONPreprocessor::Add(AliMUONVSubprocessor* sub, Bool_t processDCS)
6c7a0c0f 70{
71 /// Add a subprocessor to our list of workers
72 fSubprocessors->Add(sub);
d489129d 73 if ( processDCS == kTRUE ) fProcessDCS = processDCS;
6c7a0c0f 74}
75
76//_____________________________________________________________________________
77void
ea199e33 78AliMUONPreprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime)
79{
80 /// loop over subtasks and initialize them
81 for ( Int_t i = 0; i <= fSubprocessors->GetLast(); ++i )
82 {
83 Subprocessor(i)->Initialize(run,startTime,endTime);
84 }
85}
86
87//_____________________________________________________________________________
88UInt_t
89AliMUONPreprocessor::Process(TMap* dcsAliasMap)
90{
91 /// loop over subtasks to make them work
92 UInt_t rv(0);
93
94 for ( Int_t i = 0; i <= fSubprocessors->GetLast(); ++i )
95 {
96 rv += Subprocessor(i)->Process(dcsAliasMap);
97 }
98 return rv;
99}
100
101//_____________________________________________________________________________
102void
103AliMUONPreprocessor::Print(Option_t* opt) const
104{
105 /// output to screen
106 cout << "<AliMUONPreprocessor> subprocessors :" << endl;
107 for ( Int_t i=0; i <= fSubprocessors->GetLast(); ++i )
108 {
109 Subprocessor(i)->Print(opt);
110 }
111}
112
113//_____________________________________________________________________________
114AliMUONVSubprocessor*
115AliMUONPreprocessor::Subprocessor(Int_t i) const
116{
117 /// return i-th subprocessor
118 if ( i >= 0 && i <= fSubprocessors->GetLast() )
119 {
120 return static_cast<AliMUONVSubprocessor*>(fSubprocessors->At(i));
121 }
122 return 0x0;
123}