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"
24 #include "AliMpSegmentation.h"
25 #include "AliMpDDLStore.h"
28 #include "AliShuttleInterface.h"
29 #include "Riostream.h"
30 #include "TObjArray.h"
32 //-----------------------------------------------------------------------------
33 /// \class AliMUONPreprocessor
35 /// Shuttle preprocessor for MUON subsystems (TRK and TRG)
37 /// It's simply a manager class that deals with a list of sub-tasks
38 /// (of type AliMUONVSubprocessor).
40 /// \author Laurent Aphecetche
41 //-----------------------------------------------------------------------------
44 ClassImp(AliMUONPreprocessor)
47 //_____________________________________________________________________________
48 AliMUONPreprocessor::AliMUONPreprocessor(const char* detName, AliShuttleInterface* shuttle)
49 : AliPreprocessor(detName, shuttle),
50 fSubprocessors(new TObjArray()),
56 //_____________________________________________________________________________
57 AliMUONPreprocessor::~AliMUONPreprocessor()
60 delete fSubprocessors;
63 //_____________________________________________________________________________
65 AliMUONPreprocessor::ClearSubprocessors()
67 /// Empty our subprocessor list
68 fSubprocessors->Clear();
72 //_____________________________________________________________________________
74 AliMUONPreprocessor::Add(AliMUONVSubprocessor* sub, Bool_t processDCS)
76 /// Add a subprocessor to our list of workers
77 fSubprocessors->Add(sub);
78 if ( processDCS == kTRUE ) fProcessDCS = processDCS;
81 //_____________________________________________________________________________
83 AliMUONPreprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime)
85 /// Load mapping and initialize subtasks
87 // Delete previous mapping
88 delete AliMpSegmentation::Instance(false);
89 delete AliMpDDLStore::Instance(false);
91 // Load mapping from CDB for this run
92 GetFromOCDB("Calib", "Mapping");
93 GetFromOCDB("Calib", "DDLStore");
95 // loop over subtasks and initialize them
96 for ( Int_t i = 0; i <= fSubprocessors->GetLast(); ++i )
98 Subprocessor(i)->Initialize(run,startTime,endTime);
102 //_____________________________________________________________________________
104 AliMUONPreprocessor::Process(TMap* dcsAliasMap)
106 /// loop over subtasks to make them work
109 for ( Int_t i = 0; i <= fSubprocessors->GetLast(); ++i )
111 rv += Subprocessor(i)->Process(dcsAliasMap);
116 //_____________________________________________________________________________
118 AliMUONPreprocessor::Print(Option_t* opt) const
121 cout << "<AliMUONPreprocessor> subprocessors :" << endl;
122 for ( Int_t i=0; i <= fSubprocessors->GetLast(); ++i )
124 Subprocessor(i)->Print(opt);
128 //_____________________________________________________________________________
129 AliMUONVSubprocessor*
130 AliMUONPreprocessor::Subprocessor(Int_t i) const
132 /// return i-th subprocessor
133 if ( i >= 0 && i <= fSubprocessors->GetLast() )
135 return static_cast<AliMUONVSubprocessor*>(fSubprocessors->At(i));