AliRoot Core  3abf5b4 (3abf5b4)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONHVSubprocessor.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 "AliMUONHVSubprocessor.h"
30 #include "AliMUONPreprocessor.h"
31 
32 #include "AliMpDEIterator.h"
33 #include "AliMpDEManager.h"
34 #include "AliMpDCSNamer.h"
35 
36 #include "AliCDBMetaData.h"
37 #include "AliLog.h"
38 
39 #include "Riostream.h"
40 #include "TMap.h"
41 #include "TObjString.h"
42 
43 #include "AliMUONCalibrationData.h"
44 
48 
49 //_____________________________________________________________________________
51 : AliMUONVSubprocessor(master,
52  "HV",
53  "Get MUON Tracker HV values from DCS"), fIncludeHVCurrents(includeHVcurrents)
54 {
56 }
57 
58 //_____________________________________________________________________________
60 {
62 }
63 
64 //_____________________________________________________________________________
65 UInt_t
67 {
69 
70  TMap hv;
71  hv.SetOwner(kTRUE);
72 
74 
75  AliMpDCSNamer hvNamer("TRACKER");
76 
77  AliMpDEIterator deIt;
78 
79  deIt.First();
80 
81  TObjArray aliases;
82  aliases.SetOwner(kTRUE);
83 
84  // we first generate a list of expected MCH DCS aliases we'll then look for
85 
86  while ( !deIt.IsDone() )
87  {
88  Int_t detElemId = deIt.CurrentDEId();
89 
90  switch ( AliMpDEManager::GetStationType(detElemId) )
91  {
92  case AliMp::kStation12:
93  {
94  for ( int i = 0; i <3; ++i)
95  {
96  aliases.Add(new TObjString(hvNamer.DCSAliasName(detElemId,i)));
97  if ( fIncludeHVCurrents )
98  {
99  aliases.Add(new TObjString(hvNamer.DCSAliasName(detElemId,i,AliMpDCSNamer::kDCSI)));
100  }
101  }
102  }
103  break;
104  case AliMp::kStation345:
105  {
106  aliases.Add(new TObjString(hvNamer.DCSAliasName(detElemId)));
107  if ( fIncludeHVCurrents )
108  {
109  aliases.Add(new TObjString(hvNamer.DCSAliasName(detElemId,0,AliMpDCSNamer::kDCSI)));
110  }
111  for ( int i = 0; i < hvNamer.NumberOfPCBs(detElemId); ++i)
112  {
113  aliases.Add(new TObjString(hvNamer.DCSSwitchAliasName(detElemId,i)));
114  }
115  }
116  break;
117  default:
118  break;
119  };
120 
121  deIt.Next();
122  }
123 
124  TIter next(&aliases);
125  TObjString* alias;
126  Bool_t kNoAliases(kTRUE);
127  Int_t aliasNotFound(0);
128  Int_t valueNotFound(0);
129 
130  TObjArray temporaryOut; // due to a bug in PVSS some iMon aliases cause problem
131  // we remove them for the moment.
132  temporaryOut.SetOwner(kTRUE);
133 
134  temporaryOut.Add(new TObjString("MchHvLvLeft/Chamber06Left/Slat10.actual.iMon"));
135  temporaryOut.Add(new TObjString("MchHvLvLeft/Chamber06Left/Slat11.actual.iMon"));
136  temporaryOut.Add(new TObjString("MchHvLvLeft/Chamber06Left/Slat12.actual.iMon"));
137  temporaryOut.Add(new TObjString("MchHvLvLeft/Chamber07Left/Slat10.actual.iMon"));
138  temporaryOut.Add(new TObjString("MchHvLvLeft/Chamber07Left/Slat11.actual.iMon"));
139  temporaryOut.Add(new TObjString("MchHvLvLeft/Chamber07Left/Slat12.actual.iMon"));
140  temporaryOut.Add(new TObjString("MchHvLvLeft/Chamber08Left/Slat10.actual.iMon"));
141  temporaryOut.Add(new TObjString("MchHvLvLeft/Chamber08Left/Slat11.actual.iMon"));
142  temporaryOut.Add(new TObjString("MchHvLvLeft/Chamber08Left/Slat12.actual.iMon"));
143  temporaryOut.Add(new TObjString("MchHvLvLeft/Chamber09Left/Slat10.actual.iMon"));
144  temporaryOut.Add(new TObjString("MchHvLvLeft/Chamber09Left/Slat11.actual.iMon"));
145  temporaryOut.Add(new TObjString("MchHvLvLeft/Chamber09Left/Slat12.actual.iMon"));
146  temporaryOut.Add(new TObjString("MchHvLvRight/Chamber06Right/Slat10.actual.iMon"));
147  temporaryOut.Add(new TObjString("MchHvLvRight/Chamber06Right/Slat11.actual.iMon"));
148  temporaryOut.Add(new TObjString("MchHvLvRight/Chamber06Right/Slat12.actual.iMon"));
149  temporaryOut.Add(new TObjString("MchHvLvRight/Chamber07Right/Slat10.actual.iMon"));
150  temporaryOut.Add(new TObjString("MchHvLvRight/Chamber07Right/Slat11.actual.iMon"));
151  temporaryOut.Add(new TObjString("MchHvLvRight/Chamber07Right/Slat12.actual.iMon"));
152  temporaryOut.Add(new TObjString("MchHvLvRight/Chamber08Right/Slat10.actual.iMon"));
153  temporaryOut.Add(new TObjString("MchHvLvRight/Chamber08Right/Slat11.actual.iMon"));
154  temporaryOut.Add(new TObjString("MchHvLvRight/Chamber08Right/Slat12.actual.iMon"));
155  temporaryOut.Add(new TObjString("MchHvLvRight/Chamber09Right/Slat10.actual.iMon"));
156  temporaryOut.Add(new TObjString("MchHvLvRight/Chamber09Right/Slat11.actual.iMon"));
157  temporaryOut.Add(new TObjString("MchHvLvRight/Chamber09Right/Slat12.actual.iMon"));
158 
159  while ( ( alias = static_cast<TObjString*>(next()) ) )
160  {
161  TString aliasName(alias->String());
162 
163  if ( temporaryOut.FindObject(alias->String().Data() ) )
164  {
165  // skip problematic aliases
166  continue;
167  }
168 
169  TPair* hvPair = static_cast<TPair*>(dcsAliasMap->FindObject(aliasName.Data()));
170  if (!hvPair)
171  {
172  ++aliasNotFound;
173  }
174  else
175  {
176  kNoAliases = kFALSE;
177  TObjArray* values = static_cast<TObjArray*>(hvPair->Value()->Clone());
178  if (!values)
179  {
180  ++valueNotFound;
181  }
182  else
183  {
184  RemoveValuesOutsideRun(values);
185  hv.Add(new TObjString(aliasName.Data()),values);
186  }
187  }
188  }
189 
190  if ( kNoAliases )
191  {
192  Master()->Log("ERROR : no DCS values found");
193  return 1;
194  }
195 
196  if ( aliasNotFound )
197  {
198  Master()->Log(Form("WARNING %d aliases not found",aliasNotFound));
199  }
200 
201  if ( valueNotFound )
202  {
203  Master()->Log(Form("WARNING %d values not found",valueNotFound));
204  }
205 
206  Master()->Log("INFO Aliases successfully read in");
207 
208  AliCDBMetaData metaData;
209  metaData.SetBeamPeriod(0);
210  metaData.SetResponsible("MUON TRK");
211  metaData.SetComment("Computed by AliMUONHVSubprocessor $Id$");
212 
213  Bool_t validToInfinity(kFALSE);
214 
215  Bool_t result = Master()->Store("Calib","HV",&hv,&metaData,0,validToInfinity);
216 
217  return ( result != kTRUE); // return 0 if everything is ok
218 }
219 
static UInt_t PatchHVDCSAliasesSt1WasAppliedMask()
A subprocessor to read HV values for one run.
The iterator over detection elements.
station 1,2 (quadrants)
AliMUONPreprocessor * Master() const
Return the pointer to our master.
#define TObjArray
Bool_t IsDone() const
station 3,4,5 (slats)
Collection of methods usefull to DCS handling for MUON TRK and TRG.
Definition: AliMpDCSNamer.h:22
Int_t NumberOfPCBs(Int_t detElemId) const
Int_t CurrentDEId() const
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
Bool_t RemoveValuesOutsideRun(TObjArray *values)
Base class for a shuttle sub-task for MUON (either TRK or TRG)
static AliMp::StationType GetStationType(Int_t detElemId)
void Log(const char *message)
Publish AliPreprocessor::Log function.
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.
TString DCSSwitchAliasName(Int_t detElemId, Int_t pcbNumber) const
Shuttle preprocessor for MUON subsystems (TRK and TRG)
TString DCSAliasName(Int_t detElemId, Int_t sector=0, Int_t dcsMeasure=0) const
virtual UInt_t Process(TMap *dcsAliasMap)
Process this sub-task.