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"
19 #include "AliMUONPedestalSubprocessor.h"
20 #include "AliMUONGMSSubprocessor.h"
24 #include "Riostream.h"
25 #include "TObjArray.h"
27 /// \class AliMUONPreprocessor
29 /// Shuttle preprocessor for MUON subsystems (TRK and TRG)
31 /// It's simply a manager class that deals with a list of sub-tasks
32 /// (of type AliMUONVSubprocessor).
34 /// \author Laurent Aphecetche
37 ClassImp(AliMUONPreprocessor)
40 const TString AliMUONPreprocessor::fgkTrackerDetName = "MCH";
41 const TString AliMUONPreprocessor::fgkTriggerDetName = "MTR";
43 //_____________________________________________________________________________
44 AliMUONPreprocessor::AliMUONPreprocessor(const TString& detName,
45 AliShuttleInterface* shuttle)
46 : AliPreprocessor(detName.Data(),shuttle),
47 // fSubprocessors(new TObjArray[kLast])
48 fSubprocessors(new TObjArray())
50 /// ctor. Builds the list of subtasks
51 /// Tests detector wrt to tracker or trigger to
52 /// instantiate the correct list of subtasks, which should be :
63 if ( detName == fgkTrackerDetName ) {
64 fSubprocessors->Add(new AliMUONPedestalSubprocessor(this));
65 fSubprocessors->Add(new AliMUONGMSSubprocessor(this));
67 else if ( detName == fgkTriggerDetName ) {
68 AliWarningStream() << "Trigger subprocessors not yet implemented." << endl;
71 // Wrong detector name
72 AliErrorStream() << "Wrong detector name." << endl;
76 //_____________________________________________________________________________
77 AliMUONPreprocessor::~AliMUONPreprocessor()
80 delete fSubprocessors;
83 //_____________________________________________________________________________
85 AliMUONPreprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime)
87 /// loop over subtasks and initialize them
88 for ( Int_t i = 0; i <= fSubprocessors->GetLast(); ++i )
90 Subprocessor(i)->Initialize(run,startTime,endTime);
94 //_____________________________________________________________________________
96 AliMUONPreprocessor::Process(TMap* dcsAliasMap)
98 /// loop over subtasks to make them work
101 for ( Int_t i = 0; i <= fSubprocessors->GetLast(); ++i )
103 rv += Subprocessor(i)->Process(dcsAliasMap);
108 //_____________________________________________________________________________
110 AliMUONPreprocessor::Print(Option_t* opt) const
113 cout << "<AliMUONPreprocessor> subprocessors :" << endl;
114 for ( Int_t i=0; i <= fSubprocessors->GetLast(); ++i )
116 Subprocessor(i)->Print(opt);
120 //_____________________________________________________________________________
121 AliMUONVSubprocessor*
122 AliMUONPreprocessor::Subprocessor(Int_t i) const
124 /// return i-th subprocessor
125 if ( i >= 0 && i <= fSubprocessors->GetLast() )
127 return static_cast<AliMUONVSubprocessor*>(fSubprocessors->At(i));