New classes for shuttle (Laurent)
[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"
19#include "TObjArray.h"
20#include "AliMUONPedestalSubprocessor.h"
21#include "Riostream.h"
22
23/// \class AliMUONPreprocessor
24///
25/// Shuttle preprocessor for MUON subsystems (TRK and TRG)
26///
27/// It's simply a manager class that deals with a list of sub-tasks
28/// (of type AliMUONVSubprocessor).
29///
30/// \author Laurent Aphecetche
31
32/// \cond CLASSIMP
33ClassImp(AliMUONPreprocessor)
34/// \endcond
35
36//_____________________________________________________________________________
37AliMUONPreprocessor::AliMUONPreprocessor(const char* detector,
38 AliShuttleInterface* shuttle)
39: AliPreprocessor(detector,shuttle), fSubprocessors(new TObjArray[kLast])
40{
41 /// ctor. Builds the list of subtasks
42 ///
43 /// \todo FIXME: should test detector wrt to tracker or trigger to
44 /// instantiate the correct list of subtasks, which should be :
45 /// Tracker :
46 /// pedestals
47 /// gains
48 /// deadchannels
49 /// gms
50 ///
51 /// Trigger :
52 /// masks
53 /// lut
54 ///
55 fSubprocessors->AddAt(new AliMUONPedestalSubprocessor(this),kPedestal);
56}
57
58//_____________________________________________________________________________
59AliMUONPreprocessor::~AliMUONPreprocessor()
60{
61 /// dtor
62 delete fSubprocessors;
63}
64
65//_____________________________________________________________________________
66void
67AliMUONPreprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime)
68{
69 /// loop over subtasks and initialize them
70 for ( Int_t i = 0; i <= fSubprocessors->GetLast(); ++i )
71 {
72 Subprocessor(i)->Initialize(run,startTime,endTime);
73 }
74}
75
76//_____________________________________________________________________________
77UInt_t
78AliMUONPreprocessor::Process(TMap* dcsAliasMap)
79{
80 /// loop over subtasks to make them work
81 UInt_t rv(0);
82
83 for ( Int_t i = 0; i <= fSubprocessors->GetLast(); ++i )
84 {
85 rv += Subprocessor(i)->Process(dcsAliasMap);
86 }
87 return rv;
88}
89
90//_____________________________________________________________________________
91void
92AliMUONPreprocessor::Print(Option_t* opt) const
93{
94 /// output to screen
95 cout << "<AliMUONPreprocessor> subprocessors :" << endl;
96 for ( Int_t i=0; i <= fSubprocessors->GetLast(); ++i )
97 {
98 Subprocessor(i)->Print(opt);
99 }
100}
101
102//_____________________________________________________________________________
103AliMUONVSubprocessor*
104AliMUONPreprocessor::Subprocessor(Int_t i) const
105{
106 /// return i-th subprocessor
107 if ( i >= 0 && i <= fSubprocessors->GetLast() )
108 {
109 return static_cast<AliMUONVSubprocessor*>(fSubprocessors->At(i));
110 }
111 return 0x0;
112}