In Initialize(): test if the preprocessor is applicable before
[u/mrichter/AliRoot.git] / MUON / AliMUONTrackerPreprocessor.cxx
CommitLineData
a6882d5b 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 "AliMUONTrackerPreprocessor.h"
19
20#include "AliMUONPedestalSubprocessor.h"
21#include "AliMUONHVSubprocessor.h"
22#include "AliMUONGMSSubprocessor.h"
505bc496 23#include "AliMUONGainSubprocessor.h"
a6882d5b 24
25#include "AliLog.h"
26#include "AliShuttleInterface.h"
27#include "Riostream.h"
28#include "TObjArray.h"
29
3d1463c8 30//-----------------------------------------------------------------------------
a6882d5b 31/// \class AliMUONTrackerPreprocessor
32///
33/// Shuttle preprocessor for MUON tracker
34///
35/// It's simply a manager class that deals with a list of sub-tasks
36/// (of type AliMUONVSubprocessor).
37///
38/// \author Laurent Aphecetche
3d1463c8 39//-----------------------------------------------------------------------------
a6882d5b 40
41/// \cond CLASSIMP
42ClassImp(AliMUONTrackerPreprocessor)
43/// \endcond
44
45//_____________________________________________________________________________
46AliMUONTrackerPreprocessor::AliMUONTrackerPreprocessor(AliShuttleInterface* shuttle)
7e59ccd2 47: AliMUONPreprocessor("MCH",shuttle),
48 fPedestalSubprocessor(new AliMUONPedestalSubprocessor(this)),
49 fGMSSubprocessor(new AliMUONGMSSubprocessor(this)),
505bc496 50 fHVSubprocessor(new AliMUONHVSubprocessor(this)),
51 fGainSubprocessor(new AliMUONGainSubprocessor(this))
a6882d5b 52{
53 /// ctor.
54}
55
56//_____________________________________________________________________________
57AliMUONTrackerPreprocessor::~AliMUONTrackerPreprocessor()
58{
59 /// dtor
7e59ccd2 60
61 delete fPedestalSubprocessor;
62 delete fGMSSubprocessor;
63 delete fHVSubprocessor;
505bc496 64 delete fGainSubprocessor;
a6882d5b 65}
66
67//_____________________________________________________________________________
68void
69AliMUONTrackerPreprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime)
70{
52f6e34b 71 /// Re-register the subprocessor(s) depending on the actual runType
ddec2e53 72
7e59ccd2 73 ClearSubprocessors();
a6882d5b 74
75 TString runType = GetRunType();
7e59ccd2 76
2ab3623b 77 fIsValid = kTRUE;
581ece00 78 fIsApplicable = kTRUE;
2ab3623b 79
a6882d5b 80 if ( runType == "PEDESTAL_RUN" ) // FIXME : check the name
81 {
7e59ccd2 82 Add(fPedestalSubprocessor); // to be called only for pedestal runs
a6882d5b 83 Log("INFO-Will run Pedestal subprocessor");
84 }
85 else if ( runType == "ELECTRONICS_CALIBRATION_RUN" ) // FIXME : check the name
86 {
505bc496 87 Add(new AliMUONGainSubprocessor(this)); // to be called only for gain runs
88 Log("INFO-Will run Gain subprocessor");
a6882d5b 89 }
90 else if ( runType == "GMS" ) // FIXME : check the name
91 {
7e59ccd2 92 Add(fGMSSubprocessor);
a6882d5b 93 Log("INFO-Will run GMS subprocessor");
94 }
95 else if ( runType == "PHYSICS" ) // FIXME : check the name
96 {
d489129d 97 Bool_t useDCS(kTRUE);
98 Add(fHVSubprocessor,useDCS); // to be called only for physics runs
a6882d5b 99 Log("INFO-Will run HV subprocessor");
100 }
101 else
102 {
581ece00 103 fIsApplicable = kFALSE;
a6882d5b 104 }
105
106 AliMUONPreprocessor::Initialize(run,startTime,endTime);
107
108}