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 const TString AliMUONPreprocessor::fgkTrackerDetName = "MCH";
43 const TString AliMUONPreprocessor::fgkTriggerDetName = "MTR";
45 //_____________________________________________________________________________
46 AliMUONPreprocessor::AliMUONPreprocessor(const TString& detName,
47 AliShuttleInterface* shuttle)
48 : AliPreprocessor(detName.Data(),shuttle),
49 // fSubprocessors(new TObjArray[kLast])
50 fSubprocessors(new TObjArray())
52 /// ctor. Builds the list of subtasks
53 /// Tests detector wrt to tracker or trigger to
54 /// instantiate the correct list of subtasks, which should be :
65 if ( detName == fgkTrackerDetName )
67 TString runType = shuttle->GetRunParameter("RunType");
68 if ( runType == "PEDESTAL_RUN" ) // FIXME : check the name
70 fSubprocessors->Add(new AliMUONPedestalSubprocessor(this)); // to be called only for pedestal runs
71 Log("INFO-Will run Pedestal subprocessor");
73 else if ( runType == "ELECTRONICS_CALIBRATION_RUN" ) // FIXME : check the name
75 Log("WARNING-Subprocessor for gains not yet implemented");
76 //fSubprocessors->Add(new AliMUONGainSubprocessor(this)); // to be called only for gain runs
78 else if ( runType == "GMS" ) // FIXME : check the name
80 fSubprocessors->Add(new AliMUONGMSSubprocessor(this));
81 Log("INFO-Will run GMS subprocessor");
83 else if ( runType == "PHYSICS" ) // FIXME : check the name
85 fSubprocessors->Add(new AliMUONHVSubprocessor(this)); // to be called only for physics runs
86 Log("INFO-Will run HV subprocessor");
90 Log(Form("ERROR-Unknown RunType=%",runType.Data()));
93 else if ( detName == fgkTriggerDetName )
95 Log("WARNING-Trigger subprocessors not yet implemented.");
99 // Wrong detector name
100 Log("ERROR-Wrong detector name.");
104 //_____________________________________________________________________________
105 AliMUONPreprocessor::~AliMUONPreprocessor()
108 delete fSubprocessors;
111 //_____________________________________________________________________________
113 AliMUONPreprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime)
115 /// loop over subtasks and initialize them
116 for ( Int_t i = 0; i <= fSubprocessors->GetLast(); ++i )
118 Subprocessor(i)->Initialize(run,startTime,endTime);
122 //_____________________________________________________________________________
124 AliMUONPreprocessor::Process(TMap* dcsAliasMap)
126 /// loop over subtasks to make them work
129 for ( Int_t i = 0; i <= fSubprocessors->GetLast(); ++i )
131 rv += Subprocessor(i)->Process(dcsAliasMap);
136 //_____________________________________________________________________________
138 AliMUONPreprocessor::Print(Option_t* opt) const
141 cout << "<AliMUONPreprocessor> subprocessors :" << endl;
142 for ( Int_t i=0; i <= fSubprocessors->GetLast(); ++i )
144 Subprocessor(i)->Print(opt);
148 //_____________________________________________________________________________
149 AliMUONVSubprocessor*
150 AliMUONPreprocessor::Subprocessor(Int_t i) const
152 /// return i-th subprocessor
153 if ( i >= 0 && i <= fSubprocessors->GetLast() )
155 return static_cast<AliMUONVSubprocessor*>(fSubprocessors->At(i));