]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONPreprocessor.cxx
Generation of generic AOD by the test script of MUON
[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
ce8e7dbe 24#include "AliMpSegmentation.h"
25#include "AliMpDDLStore.h"
26
fee1d02b 27#include "AliLog.h"
57e176c0 28#include "AliShuttleInterface.h"
ea199e33 29#include "Riostream.h"
fee1d02b 30#include "TObjArray.h"
ea199e33 31
3d1463c8 32//-----------------------------------------------------------------------------
ea199e33 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
3d1463c8 41//-----------------------------------------------------------------------------
ea199e33 42
43/// \cond CLASSIMP
44ClassImp(AliMUONPreprocessor)
45/// \endcond
46
47//_____________________________________________________________________________
6c7a0c0f 48AliMUONPreprocessor::AliMUONPreprocessor(const char* detName, AliShuttleInterface* shuttle)
49: AliPreprocessor(detName, shuttle),
d489129d 50 fSubprocessors(new TObjArray()),
51 fProcessDCS(kFALSE)
ea199e33 52{
6c7a0c0f 53 /// ctor
ea199e33 54}
55
56//_____________________________________________________________________________
57AliMUONPreprocessor::~AliMUONPreprocessor()
58{
59 /// dtor
60 delete fSubprocessors;
61}
62
6c7a0c0f 63//_____________________________________________________________________________
64void
eca96915 65AliMUONPreprocessor::ClearSubprocessors()
6c7a0c0f 66{
67 /// Empty our subprocessor list
eca96915 68 fSubprocessors->Clear();
d489129d 69 fProcessDCS = kFALSE;
6c7a0c0f 70}
71
72//_____________________________________________________________________________
73void
d489129d 74AliMUONPreprocessor::Add(AliMUONVSubprocessor* sub, Bool_t processDCS)
6c7a0c0f 75{
76 /// Add a subprocessor to our list of workers
77 fSubprocessors->Add(sub);
d489129d 78 if ( processDCS == kTRUE ) fProcessDCS = processDCS;
6c7a0c0f 79}
80
ea199e33 81//_____________________________________________________________________________
82void
83AliMUONPreprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime)
84{
ce8e7dbe 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
ea199e33 96 for ( Int_t i = 0; i <= fSubprocessors->GetLast(); ++i )
97 {
98 Subprocessor(i)->Initialize(run,startTime,endTime);
99 }
100}
101
102//_____________________________________________________________________________
103UInt_t
104AliMUONPreprocessor::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//_____________________________________________________________________________
117void
118AliMUONPreprocessor::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//_____________________________________________________________________________
129AliMUONVSubprocessor*
130AliMUONPreprocessor::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}