1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 //-----------------------------------------------------------------------------
19 /// \class AliMUONTriggerDCSSubprocessor
21 /// A subprocessor to read Trigger DCS values for one run
23 /// It simply creates a copy of the dcsAliasMap w/o information
24 /// from the MUON TRG, and dumps this copy into the CDB
26 /// \author Diego Stocco, Subatech
27 //-----------------------------------------------------------------------------
29 #include "AliMUONTriggerDCSSubprocessor.h"
30 #include "AliMUONPreprocessor.h"
32 #include "AliMpDEIterator.h"
33 #include "AliMpDEManager.h"
34 #include "AliMpConstants.h"
35 #include "AliMpDCSNamer.h"
37 #include "AliCDBMetaData.h"
39 #include "AliDCSValue.h"
41 #include "Riostream.h"
43 #include "TObjString.h"
46 ClassImp(AliMUONTriggerDCSSubprocessor)
49 //_____________________________________________________________________________
50 AliMUONTriggerDCSSubprocessor::AliMUONTriggerDCSSubprocessor(AliMUONPreprocessor* master)
51 : AliMUONVSubprocessor(master,
53 "Get MUON Trigger HV and Current values from DCS")
58 //_____________________________________________________________________________
59 AliMUONTriggerDCSSubprocessor::~AliMUONTriggerDCSSubprocessor()
64 //_____________________________________________________________________________
66 AliMUONTriggerDCSSubprocessor::Process(TMap* dcsAliasMap)
68 /// Make another alias map from dcsAliasMap, considering only MUON TRK aliases.
71 dcsMap.SetOwner(kTRUE);
73 AliMpDCSNamer dcsMapNamer("TRIGGER");
80 aliases.SetOwner(kTRUE);
82 // we first generate a list of expected MTR DCS aliases we'll then look for
84 while ( !deIt.IsDone() )
86 Int_t detElemId = deIt.CurrentDEId();
88 if ( AliMpDEManager::GetStationType(detElemId) == AliMp::kStationTrigger) {
90 for(Int_t iMeas=0; iMeas<AliMpDCSNamer::kNDCSMeas; iMeas++){
91 aliases.Add(new TObjString(dcsMapNamer.DCSChannelName(detElemId, 0, iMeas)));
101 Bool_t kNoAliases(kTRUE);
102 Int_t aliasNotFound(0);
103 Int_t valueNotFound(0);
105 while ( ( alias = static_cast<TObjString*>(next()) ) )
107 TString aliasName(alias->String());
108 TPair* dcsMapPair = static_cast<TPair*>(dcsAliasMap->FindObject(aliasName.Data()));
116 if (!dcsMapPair->Value())
122 TObjArray* values = static_cast<TObjArray*>(dcsMapPair->Value()->Clone());
123 RemoveValuesOutsideRun(values);
125 dcsMap.Add(new TObjString(aliasName.Data()),values);
132 Master()->Log("ERROR : no DCS values found");
138 Master()->Log(Form("WARNING %d aliases not found",aliasNotFound));
143 Master()->Log(Form("WARNING %d values not found",valueNotFound));
146 Master()->Log("INFO Aliases successfully read in");
148 AliCDBMetaData metaData;
149 metaData.SetBeamPeriod(0);
150 metaData.SetResponsible("MUON TRG");
151 metaData.SetComment("Computed by AliMUONTriggerDCSSubprocessor $Id$");
153 Bool_t validToInfinity(kFALSE);
155 Bool_t result = Master()->Store("Calib","TriggerDCS",&dcsMap,&metaData,0,validToInfinity);
157 return ( result != kTRUE); // return 0 if everything is ok