AliRoot Core  v5-06-15 (45dab64)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONTriggerDCSSubprocessor.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 
30 #include "AliMUONPreprocessor.h"
31 
32 #include "AliMpDEIterator.h"
33 #include "AliMpDEManager.h"
34 #include "AliMpConstants.h"
35 #include "AliMpDCSNamer.h"
36 
37 #include "AliCDBMetaData.h"
38 #include "AliLog.h"
39 #include "AliDCSValue.h"
40 
41 #include "Riostream.h"
42 #include "TMap.h"
43 #include "TObjString.h"
44 
48 
49 //_____________________________________________________________________________
51 : AliMUONVSubprocessor(master,
52  "TriggerDCS",
53  "Get MUON Trigger HV and Current values from DCS")
54 {
56 }
57 
58 //_____________________________________________________________________________
60 {
62 }
63 
64 //_____________________________________________________________________________
65 UInt_t
67 {
69 
70  TMap dcsMap;
71  dcsMap.SetOwner(kTRUE);
72 
73  AliMpDCSNamer dcsMapNamer("TRIGGER");
74 
75  AliMpDEIterator deIt;
76 
77  deIt.First();
78 
79  TObjArray aliases;
80  aliases.SetOwner(kTRUE);
81 
82  // we first generate a list of expected MTR DCS aliases we'll then look for
83 
84  while ( !deIt.IsDone() )
85  {
86  Int_t detElemId = deIt.CurrentDEId();
87 
89 
90  for(Int_t iMeas=0; iMeas<AliMpDCSNamer::kNDCSMeas; iMeas++){
91  aliases.Add(new TObjString(dcsMapNamer.DCSAliasName(detElemId, 0, iMeas)));
92  }
93 
94  }
95 
96  deIt.Next();
97  }
98 
99  TIter next(&aliases);
100  TObjString* alias;
101  Bool_t kNoAliases(kTRUE);
102  Int_t aliasNotFound(0);
103  Int_t valueNotFound(0);
104 
105  while ( ( alias = static_cast<TObjString*>(next()) ) )
106  {
107  TString aliasName(alias->String());
108  TPair* dcsMapPair = static_cast<TPair*>(dcsAliasMap->FindObject(aliasName.Data()));
109  if (!dcsMapPair)
110  {
111  ++aliasNotFound;
112  }
113  else
114  {
115  kNoAliases = kFALSE;
116  if (!dcsMapPair->Value())
117  {
118  ++valueNotFound;
119  }
120  else
121  {
122  TObjArray* values = static_cast<TObjArray*>(dcsMapPair->Value()->Clone());
123  RemoveValuesOutsideRun(values);
124 
125  dcsMap.Add(new TObjString(aliasName.Data()),values);
126  }
127  }
128  }
129 
130  if ( kNoAliases )
131  {
132  Master()->Log("ERROR : no DCS values found");
133  return 1;
134  }
135 
136  if ( aliasNotFound )
137  {
138  Master()->Log(Form("WARNING %d aliases not found",aliasNotFound));
139  }
140 
141  if ( valueNotFound )
142  {
143  Master()->Log(Form("WARNING %d values not found",valueNotFound));
144  }
145 
146  Master()->Log("INFO Aliases successfully read in");
147 
148  AliCDBMetaData metaData;
149  metaData.SetBeamPeriod(0);
150  metaData.SetResponsible("MUON TRG");
151  metaData.SetComment("Computed by AliMUONTriggerDCSSubprocessor $Id$");
152 
153  Bool_t validToInfinity(kFALSE);
154 
155  Bool_t result = Master()->Store("Calib","TriggerDCS",&dcsMap,&metaData,0,validToInfinity);
156 
157  return ( result != kTRUE); // return 0 if everything is ok
158 }
159 
The iterator over detection elements.
AliMUONPreprocessor * Master() const
Return the pointer to our master.
#define TObjArray
Bool_t IsDone() const
Collection of methods usefull to DCS handling for MUON TRK and TRG.
Definition: AliMpDCSNamer.h:21
Int_t CurrentDEId() const
virtual UInt_t Process(TMap *dcsAliasMap)
Process this sub-task.
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.
trigger stations (slats)
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.
A subprocessor to read TriggerDCS values for one run.
Shuttle preprocessor for MUON subsystems (TRK and TRG)
Number of measured quantities.
Definition: AliMpDCSNamer.h:70
TString DCSAliasName(Int_t detElemId, Int_t sector=0, Int_t dcsMeasure=0) const