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