PredictionProcessor/AliHLTPredictionProcessorDummy.h
PredictionProcessor/AliHLTPendolinoLogger.h
PredictionProcessor/AliHLTPendolinoLoggerDump.h
- PredictionProcessor/HLT/AliHLTPredicProcTempMonitor.h
- PredictionProcessor/HLT/AliHLTPredictionProcessorHLT.h
PredictionProcessor/GRP/AliHLTPredictionProcessorGRP.h
PredictionProcessor/MUON/AliHLTPredictionProcessorMCH.h
PredictionProcessor/MUON/AliHLTPredictionProcessorMTR.h
+++ /dev/null
-// $Id$
-
-//**************************************************************************
-//* This file is property of and copyright by the ALICE HLT Project *
-//* ALICE Experiment at CERN, All rights reserved. *
-//* *
-//* Primary Authors: Sebastian Bablok <Sebastian.Bablok@ift.uib.no> *
-//* for The ALICE HLT Project. *
-//* *
-//* Permission to use, copy, modify and distribute this software and its *
-//* documentation strictly for non-commercial purposes is hereby granted *
-//* without fee, provided that the above copyright notice appears in all *
-//* copies and that both the copyright notice and this permission notice *
-//* appear in the supporting documentation. The authors make no claims *
-//* about the suitability of this software for any purpose. It is *
-//* provided "as is" without express or implied warranty. *
-//**************************************************************************
-
-/** @file AliHLTPredicProcTempMonitor.cxx
- @author Sebastian Bablok
- @date
- @brief
-*/
-
-#include "AliHLTPredicProcTempMonitor.h"
-
-#include <AliCDBMetaData.h>
-#include <AliCDBEntry.h>
-#include <AliDCSValue.h>
-
-#include <TMap.h>
-#include <TObjString.h>
-#include <TObjArray.h>
-
-#include <TTimeStamp.h>
-
-
-ClassImp(AliHLTPredicProcTempMonitor)
-
-
-const TString AliHLTPredicProcTempMonitor::kPath2("CalibMonitor");
-
-const TString AliHLTPredicProcTempMonitor::kPath3("DCSTempMon");
-
-const TString AliHLTPredicProcTempMonitor::kCreator("S. Bablok (HLT)");
-
-const TString AliHLTPredicProcTempMonitor::kComment("Calib Object for monitoring DCS temperature values in HLT.");
-
-const TString AliHLTPredicProcTempMonitor::kAliRootVersion("");
-
-const UInt_t AliHLTPredicProcTempMonitor::kUnableToStoreObject = 7;
-
-//const TString AliHLTPredicProcTempMonitor::kAmandaTempSensor = "TPC_PT_%d_TEMPERATURE";
-
-
-AliHLTPredicProcTempMonitor::AliHLTPredicProcTempMonitor(
- const char* detector, AliHLTPendolino* pendolino) :
- AliHLTPredictionProcessorInterface(detector, pendolino),
- fPredict(true), fRun(0), fStartTime(0), fEndTime(0), fBField("") {
- // C-tor for AliHLTPredicProcTempMonitor
-// fPredict = true;
-// fRun = 0;
-// fStartTime = 0;
-// fEndTime = 0;
-}
-
-
-AliHLTPredicProcTempMonitor::~AliHLTPredicProcTempMonitor() {
- // D-tor for AliHLTPredicProcTempMonitor
-
-}
-
-
-UInt_t AliHLTPredicProcTempMonitor::makePrediction(Bool_t doPrediction) {
- // switch for prediction making in AliHLTPredicProcTempMonitor
- Log("AliHLTPredicProcTempMonitor + B-Field extractor: prediction switched on");
- fPredict = doPrediction;
- return 0;
-}
-
-
-void AliHLTPredicProcTempMonitor::Initialize(Int_t run, UInt_t startTime,
- UInt_t endTime) {
- // initializes AliHLTPredicProcTempMonitor
- fRun = run;
- fStartTime = startTime;
- fEndTime = endTime;
-
- TString msg("Initialized HLT PredictionProcessor; Run: ");
- msg += fRun;
- msg += ", start time: ";
- msg += fStartTime;
- msg += ", end time: ";
- msg += fEndTime;
- msg += ".";
- Log(msg.Data());
-}
-
-
-UInt_t AliHLTPredicProcTempMonitor::Process(TMap* dcsAliasMap) {
- // processes the DCS value map in AliHLTPredicProcTempMonitor
- UInt_t beamPeriod = 0;
-
- UInt_t retVal = 0;
- UInt_t tempRet = 0;
- Int_t start = 0;
- TMap* tempMap = 0;
- Bool_t infiniteValid = kFALSE;
-
-
- //test GetFromOCDB() calls
- AliCDBEntry* entry = GetFromOCDB(kPath2.Data(), kPath3.Data());
- if (entry == 0) {
- // No object in HCDB -> discarding old values
- TString msg("No '" + kPath2 + "/" + kPath3 +
- "' in HCDB, most likely first round, filling object now...");
- Log(msg.Data());
- tempMap = dcsAliasMap;
-
- } else {
- Log("Old data is already stored in HCDB, but now discarding that...");
- tempMap = dcsAliasMap;
-
-// If old data shall be included use lines below and uncomment lines above
-/*
- Log("Adding new DCS value to old Temperature map...");
- // Adding new DCS values to old Temperature map
- tempMap = (TMap*) entry->GetObject();
-
- TMapIter iter(dcsAliasMap); // iterator for values in TMap
- TObject* aKey;
-
- while ((aKey = iter.Next())) {
- tempMap->Add(aKey, dcsAliasMap->GetValue(aKey));
- }
-*/
- }
-
- AliCDBMetaData meta(kCreator.Data(), beamPeriod, kAliRootVersion.Data(),
- kComment.Data());
-
- if (Store(kPath2.Data(), kPath3.Data(), (TObject*) tempMap, &meta, start,
- infiniteValid)) {
- TString msg(" +++ Successfully stored object '" + kPath2 + "/" + kPath3 +
- "' in HCDB.");
- Log(msg.Data());
- } else {
- TString msg(" *** Storing of object '" + kPath2 + "/" + kPath3 +
- "' in HCDB failed.");
- Log(msg.Data());
- retVal = kUnableToStoreObject;
- }
-
- // extract B-Field
- tempRet = ExtractBField(dcsAliasMap);
- retVal = tempRet & retVal; // combine retvals
-
- return retVal;
-}
-
-UInt_t AliHLTPredicProcTempMonitor::ExtractBField(TMap* dcsAliasMap) {
- // extracts the B-field value from DCS value map
-
- TString stringId = "L3Current"; // "dcs_magnet:Magnet/ALICESolenoid.Current";
-
- Float_t BField = 0;
- Bool_t bRet = GetSensorValue(dcsAliasMap,stringId.Data(),&BField);
-
- if (bRet) {
- BField = BField / 60000; // If we get field, take this away and change SensorValue
- TString dummy("-solenoidBZ ");
- dummy += BField;
- TObjString dummy2(dummy.Data());
- fBField = dummy2;
- Log(Form("BField set to %s", fBField.String().Data()));
- } else {
- return 1;
- }
-
- TString path2("Config");
- TString path3("BField");
- Int_t start = 0;
-
- TString comment("BField");
- AliCDBMetaData meta(this->GetName(), 0, "unknownAliRoot", comment.Data());
-
- if (Store(path2.Data(), path3.Data(), (TObject*) (&fBField), &meta, start,
- kTRUE)) {
- Log(" +++ Successfully stored object ;-)");
- } else {
- Log(" *** Storing of OBJECT failed!!");
- return 7;
- }
-
- return 0;
-}
-
-Bool_t AliHLTPredicProcTempMonitor::GetSensorValue(TMap* dcsAliasMap,
- const char* stringId, Float_t *value) {
- // retreives the sensor value
- // return last value read from sensor specified by stringId
-
- TObjArray* valueSet;
- TPair* pair = (TPair*) (dcsAliasMap->FindObject(stringId));
- if (pair) {
- valueSet = (TObjArray*) (pair->Value());
- if (valueSet) {
- Int_t nentriesDCS = (valueSet->GetEntriesFast()) - 1;
- if (nentriesDCS >= 0) {
- AliDCSValue* val = (AliDCSValue*) (valueSet->At(nentriesDCS));
- if (val) {
- *value = val->GetFloat();
- return kTRUE;
- }
- }
- }
- }
- return kFALSE;
-}
-
-TMap* AliHLTPredicProcTempMonitor::produceTestData(TString /*aliasName*/) {
- // produces test data for AliHLTPredicProcTempMonitor
- TMap* resultMap = 0;
-
- // here has to come real dummy data :-)
- resultMap = new TMap();
- TTimeStamp tt;
- Float_t fval = 33.3;
- TObjString* name = new TObjString("L3Current");
- AliDCSValue* val = new AliDCSValue(fval, tt.GetTime());
- TObjArray* arr = new TObjArray();
- arr->Add(val);
- resultMap->Add(name, arr);
-
- return resultMap;
-}
-
-
+++ /dev/null
-//-*- Mode: C++ -*-
-// $Id$
-
-#ifndef ALI_HLT_PREDICT_PROC_TEMP_MONITOR_H
-#define ALI_HLT_PREDICT_PROC_TEMP_MONITOR_H
-//* This file is property of and copyright by the ALICE HLT Project *
-//* ALICE Experiment at CERN, All rights reserved. *
-//* See cxx source for full Copyright notice *
-
-/** @file AliHLTPredicProcTempMonitor.h
- @author Sebastian Bablok
- @date
- @brief
-*/
-
-#include "AliHLTPredictionProcessorInterface.h"
-
-#include <TObjString.h>
-
-
-/**
- * Implementation of an AliHLTPredictionProcessor for monitoring DCS
- * Temperatur values inside the HLT.
- *
- * @author Sebastian Bablok
- * @author Gaute Oevrebekk (extention for B-Field)
- *
- * @date 2007-12-03
- * @date 2008-03-04
- */
-class AliHLTPredicProcTempMonitor : public AliHLTPredictionProcessorInterface {
- public:
-
- /** Static const defining path part 2 */
- static const TString kPath2; // defining path part 2
- /** Static const defining path part 3 */
- static const TString kPath3; //defining path part 3
- /** Static const defining creator of HCDB object */
- static const TString kCreator; // defining creator of HCDB object
- /** Static const defining comment for HCDB object */
- static const TString kComment; // defining comment for HCDB object
- /** Static const defining aliroot version */
- static const TString kAliRootVersion; // defining aliroot version
- /** Static const defining error ret val for storage error */
- static const UInt_t kUnableToStoreObject; // defining error ret val for storage error
-// static const TString kAmandaTempSensor;
-
- /**
- * Constructor for AliHLTPredictionProcessorDummy
- *
- * @param detector string defining the detector to which the
- * PredictionProcessor belongs to
- * @param pendolino pointer to the hosting pendolino (derived from
- * AliShuttleInterface)
- */
- AliHLTPredicProcTempMonitor(const char* detector,
- AliHLTPendolino* pendolino);
-
- /**
- * Destructor for AliHLTPredictionProcessorDummy
- */
- virtual ~AliHLTPredicProcTempMonitor();
-
- /**
- * Pure virtual function to force the Prediction Processor to implement
- * a function to flag that prediction making is required.
- * This function is called by the Pendolino before the fetched DCS data
- * is handed in for (prediction) processing.
- *
- * @param doPrediction if true, prediction making shall be switched on,
- * if false, switched off.
- *
- * @return 0 on success; a value greater than 0 refers to an error
- */
- virtual UInt_t makePrediction(Bool_t doPrediction = true);
-
- /**
- * Pure Virtual function, implemented in the detector specific
- * PredictionProcessors to initialize them.
- *
- * @param run run number
- * @param startTime start time of data
- * @param endTime end time of data
- */
- virtual void Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
-
- /**
- * Function called by the Pendolino for each participating subdetector
- * producing the required condition settings. This includes the
- * encoding of a prediction to the values due to the fact, that only
- * data up to now can be fetched from DCS (the latest data can also be
- * up to 2 min old until it is received on HLT side). To write the data
- * to the HCDB, the detector specific implementation of this class has
- * to call the appropriated storing function provided by the interface.
- *
- * @param dcsAliasMap the map containing aliases and corresponding DCS
- * values and timestamps
- *
- * @return 0 on success; a value greater than 0 refers to an error
- */
- virtual UInt_t Process(TMap* dcsAliasMap);
-
- /**
- * Indicates if DCS data shall be processed.
- * NOTE: should always return true, since it is used as prediction
- * processor, which will only process DCS data
- *
- * @return true if DCS data can be processed, else false. Note: if false
- * the Pendolino would stop, so make sure that it is true.
- */
- virtual Bool_t ProcessDCS();
-
- /**
- * Function to let the PredictionProcessor produce dummy input data,
- * that can be used in Pendolino tests, where no DCS Archieve DB is
- * contacted. This function is called by the Pendolino, the result is
- * given back to the PredictionProcessor via the Process(...) call.
- * Since the DCSMaps requested from DCS are detector specific, the
- * PredictionProcessor should know, how the maps look like, that it
- * expects.
- * NOTE: The clean - up (delete) of the TMap will be performed by the
- * Pendolino after the usage. The PredictionProcessor has never to
- * call delete on the returned TMap pointer.
- *
- * @param aliasName optional parameter, that can be given in order to
- * create a DCSMap for dedicated aliases. For a general test
- * this paramter should be empty. If more than one alias name
- * shall be specified, they are separated by blanks " ".
- *
- * @return DCSMap containing dummy data for testing the Pendolino.
- */
- virtual TMap* produceTestData(TString aliasName = "");
-
-
- protected:
-
- /**
- * Function to extract the B-Field from the DCS map.
- *
- * @param dcsAliasMap the DCS map, containing the AliDCSValues
- *
- * @return 0 in case of success, else an error code
- */
- UInt_t ExtractBField(TMap* dcsAliasMap);
-
- /**
- * Function to extract a float AliDCSValue by its name from the DCS map
- *
- * @param dcsAliasMap the DCS value map
- * @param stringId the name of the desired AliDCSValue - float
- * @param value pointer to a float, where the extratced value shall be stored
- * (out parameter)
- *
- * @return true in case of success, else false
- */
- Bool_t GetSensorValue(TMap* dcsAliasMap, const char* stringId,
- Float_t* value);
-
- private:
- /**
- * Disabled Copy constructor
- * (parent class is disabled so derived class does the same)
- */
- AliHLTPredicProcTempMonitor(
- const AliHLTPredicProcTempMonitor& predictPro);
-
- /**
- * Disabled Assignment operator
- * (parent class is disabled so derived class does the same)
- */
- AliHLTPredicProcTempMonitor& operator=(
- const AliHLTPredicProcTempMonitor& rhs);
-
-
- /**
- * Function to extract the actual values from the DCSMap
- *
- * @param inputMap pointer to the DCSMap as input
- * @param outputMap pointer to the Map where to store the extracted
- * values
- *
- * @return true in case of success, else false
- */
-// Bool_t extractTempvalues(TMap* inputMap, TMap* outputMap);
-
- /**
- * Stores if prediction shall be made
- */
- Bool_t fPredict; // flag for prediction making
-
- /**
- * Stores the run number
- */
- Int_t fRun; // Stores the run number
-
- /**
- * Stores the start time of the to process DCS data
- */
- UInt_t fStartTime; // Stores the start time of the to process DCS data
-
- /**
- * Stores the end time of the to process DCS data
- */
- UInt_t fEndTime; // Stores the end time of the to process DCS data
-
- /**
- * Stores the extracted B-Field in a TObjString
- */
- TObjString fBField; // Stores the extracted B-Field in a TObjString
-
- /** ClassDef of AliHLTPredicProcTempMonitor for AliRoot */
- ClassDef(AliHLTPredicProcTempMonitor, 4);
-
-};
-
-
-inline Bool_t AliHLTPredicProcTempMonitor::ProcessDCS() {
- // indicates if DCS values are processed; always true
- return true;
-}
-
-#endif
-
-
+++ /dev/null
-// $Id$
-
-//**************************************************************************
-//* This file is property of and copyright by the ALICE HLT Project *
-//* ALICE Experiment at CERN, All rights reserved. *
-//* *
-//* Primary Authors: Gaute Ovrebekk *
-//* for The ALICE HLT Project. *
-//* *
-//* Permission to use, copy, modify and distribute this software and its *
-//* documentation strictly for non-commercial purposes is hereby granted *
-//* without fee, provided that the above copyright notice appears in all *
-//* copies and that both the copyright notice and this permission notice *
-//* appear in the supporting documentation. The authors make no claims *
-//* about the suitability of this software for any purpose. It is *
-//* provided "as is" without express or implied warranty. *
-//**************************************************************************
-
-/** @file AliHLTPredictionProcessorHLT.cxx
- @author Gaute Ovrebekk
- @date
- @brief
-*/
-
-#include "AliHLTPredictionProcessorHLT.h"
-
-#include <AliCDBMetaData.h>
-#include <AliCDBEntry.h>
-
-// new
-#include <TObjArray.h>
-#include <AliDCSValue.h>
-
-
-ClassImp(AliHLTPredictionProcessorHLT)
-
-AliHLTPredictionProcessorHLT::AliHLTPredictionProcessorHLT(
- const char* detector, AliHLTPendolino* pendolino) :
- AliHLTPredictionProcessorInterface(detector, pendolino),
- fPredict(true), fRun(0), fStartTime(0), fEndTime(0) {
- // C-tor for AliHLTPredictionProcessorHLT
-// fPredict = false;
-// fRun = 0;
-// fStartTime = 0;
-// fEndTime = 0;
-}
-
-
-AliHLTPredictionProcessorHLT::~AliHLTPredictionProcessorHLT() {
- // D-tor for AliHLTPredictionProcessorHLT
-}
-
-
-UInt_t AliHLTPredictionProcessorHLT::makePrediction(Bool_t doPrediction) {
- // switch for prediction making
- Log("Prediction switched on");
- fPredict = doPrediction;
- return 0;
-}
-
-
-void AliHLTPredictionProcessorHLT::Initialize(Int_t run, UInt_t startTime,
- UInt_t endTime) {
- // initializes AliHLTPredictionProcessorHLT
- fRun = run;
- fStartTime = startTime;
- fEndTime = endTime;
-
- TString msg("Initialized HLT PredictProc. Run: ");
- msg += fRun;
- msg += ", start time: ";
- msg += fStartTime;
- msg += ", end time: ";
- msg += fEndTime;
- msg += ".";
- Log(msg.Data());
-
- if (fPredict) {
- Log("HLT PredictProc has prediction switched ON.");
- } else {
- Log("Prediction is switched OFF.");
- }
-}
-
-
-UInt_t AliHLTPredictionProcessorHLT::Process(TMap* dcsAliasMap) {
- // processes the DCS value map
-
- if (!dcsAliasMap) return 9;
- if (dcsAliasMap->GetEntries() == 0 ) return 9;
-
- UInt_t retVal = 0;
- // there is currently no object to create
-
- return retVal;
-}
-
-TMap* AliHLTPredictionProcessorHLT::produceTestData(TString /*aliasName*/) {
- // produces test data for AliHLTPredictionProcessorHLT
- TMap* resultMap = 0;
-
- // here has to come real dummy data :-)
- resultMap = new TMap();
-
- return resultMap;
-}
-
-
+++ /dev/null
-//-*- Mode: C++ -*-
-// $Id$
-
-#ifndef ALI_HLT_PREDICTION_PROCESSOR_HLT_H
-#define ALI_HLT_PREDICTION_PROCESSOR_HLT_H
-//* This file is property of and copyright by the ALICE HLT Project *
-//* ALICE Experiment at CERN, All rights reserved. *
-//* See cxx source for full Copyright notice *
-
-/** @file AliHLTPredictionProcessorHLT.h
- @author Gaute Ovrebekk
- @date
- @brief
-*/
-
-#include "AliHLTPredictionProcessorInterface.h"
-
-//new
-#include <TObjString.h>
-
-
-/**
- * Predition Processor for prepering b-field values for general HLT components.
- *
- * @author Sebastian Bablok, Gaute Ovrebekk
- *
- * @date 2007-10-24
- */
-class AliHLTPredictionProcessorHLT : public AliHLTPredictionProcessorInterface {
- public:
-
- /**
- * Constructor for AliHLTPredictionProcessorHLT
- *
- * @param detector string defining the detector to which the
- * PredictionProcessor belongs to
- * @param pendolino pointer to the hosting pendolino (derived from
- * AliShuttleInterface)
- */
- AliHLTPredictionProcessorHLT(const char* detector,
- AliHLTPendolino* pendolino);
-
- /**
- * Destructor for AliHLTPredictionProcessorHLT
- */
- virtual ~AliHLTPredictionProcessorHLT();
-
- /**
- * Virtual function to force the Prediction Processor to implement
- * a function to flag that prediction making is required.
- * This function is called by the Pendolino before the fetched DCS data
- * is handed in for (prediction) processing.
- *
- * @param doPrediction if true, prediction making shall be switched on,
- * if false, switched off.
- *
- * @return 0 on success; a value greater than 0 refers to an error
- */
- virtual UInt_t makePrediction(Bool_t doPrediction = true);
-
- /**
- * Virtual function, implemented in the detector specific
- * PredictionProcessors to initialize them.
- *
- * @param run run number
- * @param startTime start time of data
- * @param endTime end time of data
- */
- virtual void Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
-
- /**
- * Function called by the Pendolino for each participating subdetector
- * producing the required condition settings. This includes the
- * encoding of a prediction to the values due to the fact, that only
- * data up to now can be fetched from DCS (the latest data can also be
- * up to 2 min old until it is received on HLT side). To write the data
- * to the HCDB, the detector specific implementation of this class has
- * to call the appropriated storing function provided by the interface.
- *
- * @param dcsAliasMap the map containing aliases and corresponding DCS
- * values and timestamps
- *
- * @return 0 on success; a value greater than 0 refers to an error
- */
- virtual UInt_t Process(TMap* dcsAliasMap);
-
- /**
- * Indicates if DCS data shall be processed.
- * NOTE: should always return true, since it is used as prediction
- * processor, which will only process DCS data
- *
- * @return true if DCS data can be processed, else false. Note: if false
- * the Pendolino would stop, so make sure that it is true.
- */
- virtual Bool_t ProcessDCS();
-
- /**
- * Function to let the PredictionProcessor produce dummy input data,
- * that can be used in Pendolino tests, where no DCS Archieve DB is
- * contacted. This function is called by the Pendolino, the result is
- * given back to the PredictionProcessor via the Process(...) call.
- * Since the DCSMaps requested from DCS are detector specific, the
- * PredictionProcessor should know, how the maps look like, that it
- * expects.
- * NOTE: The clean - up (delete) of the TMap will be performed by the
- * Pendolino after the usage. The PredictionProcessor has never to
- * call delete on the returned TMap pointer.
- *
- * @param aliasName optional parameter, that can be given in order to
- * create a DCSMap for dedicated aliases. For a general test
- * this paramter should be empty. If more than one alias name
- * shall be specified, they are separated by blanks " ".
- *
- * @return DCSMap containing dummy data for testing the Pendolino.
- */
- virtual TMap* produceTestData(TString aliasName = "");
-
-
- protected:
-
- private:
- /**
- * Disabled Copy constructor
- * (parent class is disabled so derived class does the same)
- */
- AliHLTPredictionProcessorHLT(
- const AliHLTPredictionProcessorHLT& predictPro);
-
- /**
- * Disabled Assignment operator
- * (parent class is disabled so derived class does the same)
- */
- AliHLTPredictionProcessorHLT& operator=(
- const AliHLTPredictionProcessorHLT& rhs);
-
- /**
- * Stores if prediction shall be made
- */
- Bool_t fPredict; // flag for prediction making
-
- /**
- * Stores the run number
- */
- Int_t fRun; // Stores the run number
-
- /**
- * Stores the start time of the to process DCS data
- */
- UInt_t fStartTime; // Stores the start time of the to process DCS data
-
- /**
- * Stores the end time of the to process DCS data
- */
- UInt_t fEndTime; // Stores the end time of the to process DCS data
-
- ClassDef(AliHLTPredictionProcessorHLT, 2);
-
-};
-
-
-inline Bool_t AliHLTPredictionProcessorHLT::ProcessDCS() {
- // indicates if DCS values are processed; always true
- return true;
-}
-
-#endif
-
-