AliRoot Core  3abf5b4 (3abf5b4)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONLVSubprocessor.cxx
Go to the documentation of this file.
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 //-----------------------------------------------------------------------------
27 //-----------------------------------------------------------------------------
28 
29 #include "AliMUONLVSubprocessor.h"
30 #include "AliMUONPreprocessor.h"
31 
32 #include "AliMpDCSNamer.h"
33 
34 #include "AliCDBMetaData.h"
35 #include "AliLog.h"
36 
37 #include "Riostream.h"
38 #include "TMap.h"
39 #include "TObjString.h"
40 
41 #include "AliMUONCalibrationData.h"
42 
46 
47 //_____________________________________________________________________________
49 : AliMUONVSubprocessor(master,
50  "LV",
51  "Get MUON Tracker LV values from DCS")
52 {
54 }
55 
56 //_____________________________________________________________________________
58 {
60 }
61 
62 //_____________________________________________________________________________
63 UInt_t
65 {
67 
68  TMap lv;
69  lv.SetOwner(kTRUE);
70 
71  AliMpDCSNamer hvNamer("TRACKER");
72 
73  // we first generate a list of expected MCH DCS aliases we'll then look for
74  TObjArray* aliases = hvNamer.GenerateAliases("Group");
75 
76  Master()->Log(Form("INFO : will look for %d LV aliases",aliases->GetEntries()));
77 
78  TIter next(aliases);
79  TObjString* alias;
80  Bool_t kNoAliases(kTRUE);
81  Int_t valueNotFound(0);
82  TList aliasesNotFound;
83  aliasesNotFound.SetOwner(kTRUE);
84 
85  while ( ( alias = static_cast<TObjString*>(next()) ) )
86  {
87  TString aliasName(alias->String());
88 
89  TPair* lvPair = static_cast<TPair*>(dcsAliasMap->FindObject(aliasName.Data()));
90  if (!lvPair)
91  {
92  aliasesNotFound.Add(new TObjString(aliasName));
93  }
94  else
95  {
96  kNoAliases = kFALSE;
97  TObjArray* values = static_cast<TObjArray*>(lvPair->Value()->Clone());
98  if (!values)
99  {
100  ++valueNotFound;
101  }
102  else
103  {
104  RemoveValuesOutsideRun(values);
105  lv.Add(new TObjString(aliasName.Data()),values);
106  }
107  }
108  }
109 
110  if ( kNoAliases )
111  {
112  Master()->Log("ERROR : no DCS values found");
113  delete aliases;
114  return 1;
115  }
116 
117  if ( aliasesNotFound.GetEntries() )
118  {
119  Master()->Log(Form("WARNING %d aliases not found : ",aliasesNotFound.GetEntries()));
120  TIter nextNotFound(&aliasesNotFound);
121  TObjString* str;
122  TString msg;
123  while (( str = static_cast<TObjString*>(nextNotFound())))
124  {
125  msg += str->String();
126  msg += "\n";
127  }
128  Master()->Log(msg.Data());
129  }
130 
131  if ( valueNotFound )
132  {
133  Master()->Log(Form("WARNING %d values not found",valueNotFound));
134  }
135 
136  Master()->Log(Form("INFO %d/%d aliases successfully read in.",aliases->GetEntries()-aliasesNotFound.GetEntries(),aliases->GetEntries()));
137 
138  AliCDBMetaData metaData;
139  metaData.SetBeamPeriod(0);
140  metaData.SetResponsible("MUON TRK");
141  metaData.SetComment("Computed by AliMUONLVSubprocessor $Id$");
142 
143  Bool_t validToInfinity(kFALSE);
144 
145  Bool_t result = Master()->Store("Calib","LV",&lv,&metaData,0,validToInfinity);
146 
147  delete aliases;
148 
149  return ( result != kTRUE); // return 0 if everything is ok
150 }
virtual UInt_t Process(TMap *dcsAliasMap)
Process this sub-task.
AliMUONPreprocessor * Master() const
Return the pointer to our master.
#define TObjArray
Collection of methods usefull to DCS handling for MUON TRK and TRG.
Definition: AliMpDCSNamer.h:22
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
Bool_t RemoveValuesOutsideRun(TObjArray *values)
Base class for a shuttle sub-task for MUON (either TRK or TRG)
void Log(const char *message)
Publish AliPreprocessor::Log function.
A subprocessor to read LV values for one run.
TObjArray * GenerateAliases(const char *pattern="") const
Bool_t Store(const char *pathLevel2, const char *pathLevel3, TObject *object, AliCDBMetaData *metaData, Int_t validityStart=0, Bool_t validityInfinite=kFALSE)
Publish AliPreprocessor::Store function.
Shuttle preprocessor for MUON subsystems (TRK and TRG)