Update Log() calls (Laurent)
[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
fee1d02b 42const TString AliMUONPreprocessor::fgkTrackerDetName = "MCH";
43const TString AliMUONPreprocessor::fgkTriggerDetName = "MTR";
44
ea199e33 45//_____________________________________________________________________________
fee1d02b 46AliMUONPreprocessor::AliMUONPreprocessor(const TString& detName,
ea199e33 47 AliShuttleInterface* shuttle)
fee1d02b 48: AliPreprocessor(detName.Data(),shuttle),
49// fSubprocessors(new TObjArray[kLast])
50 fSubprocessors(new TObjArray())
ea199e33 51{
52 /// ctor. Builds the list of subtasks
fee1d02b 53 /// Tests detector wrt to tracker or trigger to
ea199e33 54 /// instantiate the correct list of subtasks, which should be :
55 /// Tracker :
fee1d02b 56 /// - pedestals
57 /// - gains
58 /// - deadchannels
59 /// - gms
ea199e33 60 ///
61 /// Trigger :
fee1d02b 62 /// - masks
63 /// - lut
64
d3f57575 65 if ( detName == fgkTrackerDetName )
66 {
57e176c0 67 TString runType = shuttle->GetRunParameter("RunType");
68 if ( runType == "PEDESTAL_RUN" ) // FIXME : check the name
69 {
70 fSubprocessors->Add(new AliMUONPedestalSubprocessor(this)); // to be called only for pedestal runs
d3f57575 71 Log("INFO-Will run Pedestal subprocessor");
57e176c0 72 }
73 else if ( runType == "ELECTRONICS_CALIBRATION_RUN" ) // FIXME : check the name
74 {
d3f57575 75 Log("WARNING-Subprocessor for gains not yet implemented");
57e176c0 76 //fSubprocessors->Add(new AliMUONGainSubprocessor(this)); // to be called only for gain runs
77 }
78 else if ( runType == "GMS" ) // FIXME : check the name
79 {
80 fSubprocessors->Add(new AliMUONGMSSubprocessor(this));
d3f57575 81 Log("INFO-Will run GMS subprocessor");
57e176c0 82 }
83 else if ( runType == "PHYSICS" ) // FIXME : check the name
84 {
85 fSubprocessors->Add(new AliMUONHVSubprocessor(this)); // to be called only for physics runs
d3f57575 86 Log("INFO-Will run HV subprocessor");
87 }
88 else
89 {
90 Log(Form("ERROR-Unknown RunType=%",runType.Data()));
57e176c0 91 }
fee1d02b 92 }
d3f57575 93 else if ( detName == fgkTriggerDetName )
94 {
95 Log("WARNING-Trigger subprocessors not yet implemented.");
fee1d02b 96 }
d3f57575 97 else
98 {
fee1d02b 99 // Wrong detector name
d3f57575 100 Log("ERROR-Wrong detector name.");
fee1d02b 101 }
ea199e33 102}
103
104//_____________________________________________________________________________
105AliMUONPreprocessor::~AliMUONPreprocessor()
106{
107 /// dtor
108 delete fSubprocessors;
109}
110
111//_____________________________________________________________________________
112void
113AliMUONPreprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime)
114{
115 /// loop over subtasks and initialize them
116 for ( Int_t i = 0; i <= fSubprocessors->GetLast(); ++i )
117 {
118 Subprocessor(i)->Initialize(run,startTime,endTime);
119 }
120}
121
122//_____________________________________________________________________________
123UInt_t
124AliMUONPreprocessor::Process(TMap* dcsAliasMap)
125{
126 /// loop over subtasks to make them work
127 UInt_t rv(0);
128
129 for ( Int_t i = 0; i <= fSubprocessors->GetLast(); ++i )
130 {
131 rv += Subprocessor(i)->Process(dcsAliasMap);
132 }
133 return rv;
134}
135
136//_____________________________________________________________________________
137void
138AliMUONPreprocessor::Print(Option_t* opt) const
139{
140 /// output to screen
141 cout << "<AliMUONPreprocessor> subprocessors :" << endl;
142 for ( Int_t i=0; i <= fSubprocessors->GetLast(); ++i )
143 {
144 Subprocessor(i)->Print(opt);
145 }
146}
147
148//_____________________________________________________________________________
149AliMUONVSubprocessor*
150AliMUONPreprocessor::Subprocessor(Int_t i) const
151{
152 /// return i-th subprocessor
153 if ( i >= 0 && i <= fSubprocessors->GetLast() )
154 {
155 return static_cast<AliMUONVSubprocessor*>(fSubprocessors->At(i));
156 }
157 return 0x0;
158}