]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONPreprocessor.cxx
Using common definition of gas mixture ArCO280. In the old defintion of ArCO2 (medium...
[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 "AliMpSegmentation.h"
25 #include "AliMpDDLStore.h"
26
27 #include "AliLog.h"
28 #include "AliShuttleInterface.h"
29 #include "Riostream.h"
30 #include "TObjArray.h"
31
32 //-----------------------------------------------------------------------------
33 /// \class AliMUONPreprocessor
34 ///
35 /// Shuttle preprocessor for MUON subsystems (TRK and TRG)
36 /// 
37 /// It's simply a manager class that deals with a list of sub-tasks 
38 /// (of type AliMUONVSubprocessor).
39 ///
40 /// \author Laurent Aphecetche
41 //-----------------------------------------------------------------------------
42
43 /// \cond CLASSIMP
44 ClassImp(AliMUONPreprocessor)
45 /// \endcond
46
47 //_____________________________________________________________________________
48 AliMUONPreprocessor::AliMUONPreprocessor(const char* detName, AliShuttleInterface* shuttle)
49 : AliPreprocessor(detName, shuttle),
50   fSubprocessors(new TObjArray()),
51   fProcessDCS(kFALSE)
52 {
53   /// ctor
54 }
55
56 //_____________________________________________________________________________
57 AliMUONPreprocessor::~AliMUONPreprocessor()
58 {
59   /// dtor
60   delete fSubprocessors;
61 }
62
63 //_____________________________________________________________________________
64 void
65 AliMUONPreprocessor::ClearSubprocessors()
66 {
67   /// Empty our subprocessor list
68   fSubprocessors->Clear();
69   fProcessDCS = kFALSE;
70 }
71
72 //_____________________________________________________________________________
73 void
74 AliMUONPreprocessor::Add(AliMUONVSubprocessor* sub, Bool_t processDCS)
75 {
76   /// Add a subprocessor to our list of workers
77   fSubprocessors->Add(sub);
78   if ( processDCS == kTRUE ) fProcessDCS = processDCS;
79 }
80
81 //_____________________________________________________________________________
82 void
83 AliMUONPreprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime)
84 {
85 /// Load mapping and initialize subtasks  
86
87   // Delete previous mapping
88   delete AliMpSegmentation::Instance(false);
89   delete AliMpDDLStore::Instance(false);
90   
91   // Load mapping from CDB for this run
92   GetFromOCDB("Calib", "Mapping");
93   GetFromOCDB("Calib", "DDLStore");
94
95   // loop over subtasks and initialize them
96   for ( Int_t i = 0; i <= fSubprocessors->GetLast(); ++i )
97   {
98     Subprocessor(i)->Initialize(run,startTime,endTime);
99   }
100 }
101
102 //_____________________________________________________________________________
103 UInt_t
104 AliMUONPreprocessor::Process(TMap* dcsAliasMap)
105 {
106   /// loop over subtasks to make them work
107   UInt_t rv(0);
108   
109   for ( Int_t i = 0; i <= fSubprocessors->GetLast(); ++i )
110   {
111     rv += Subprocessor(i)->Process(dcsAliasMap);
112   }
113   return rv;
114 }
115
116 //_____________________________________________________________________________
117 void
118 AliMUONPreprocessor::Print(Option_t* opt) const
119 {
120   /// output to screen
121   cout << "<AliMUONPreprocessor> subprocessors :" << endl;
122   for ( Int_t i=0; i <= fSubprocessors->GetLast(); ++i )
123   {
124     Subprocessor(i)->Print(opt);
125   }
126 }
127
128 //_____________________________________________________________________________
129 AliMUONVSubprocessor*
130 AliMUONPreprocessor::Subprocessor(Int_t i) const
131 {
132   /// return i-th subprocessor
133   if ( i >= 0 && i <= fSubprocessors->GetLast() )
134   {
135     return static_cast<AliMUONVSubprocessor*>(fSubprocessors->At(i));
136   }
137   return 0x0;
138 }