1 /**************************************************************************
2 * Copyright(c) 2007, 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 **************************************************************************/
16 #include "AliTPCPreprocessor.h"
18 #include "AliCDBMetaData.h"
19 #include "AliDCSValue.h"
21 #include "AliTPCSensorTempArray.h"
23 #include <TTimeStamp.h>
26 // This class is the SHUTTLE preprocessor for the TPC detector.
27 // It contains several components, this far the part containing
28 // temperatures is implemented
31 ClassImp(AliTPCPreprocessor)
33 //______________________________________________________________________________________________
34 AliTPCPreprocessor::AliTPCPreprocessor(const char* detector, AliShuttleInterface* shuttle) :
35 AliPreprocessor(detector, shuttle),
41 //______________________________________________________________________________________________
42 AliTPCPreprocessor::~AliTPCPreprocessor()
49 //______________________________________________________________________________________________
50 void AliTPCPreprocessor::Initialize(Int_t run, UInt_t startTime,
53 // Creates AliTestDataDCS object
55 AliPreprocessor::Initialize(run, startTime, endTime);
57 AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", run,
58 TTimeStamp(startTime).AsString(),
59 TTimeStamp(endTime).AsString()));
61 fTemp = new AliTPCSensorTempArray(fStartTime, fEndTime);
64 //______________________________________________________________________________________________
65 UInt_t AliTPCPreprocessor::Process(TMap* dcsAliasMap)
67 // Fills data into TPC calibrations objects
69 if (!dcsAliasMap) return 0;
71 // Amanda servers provide information directly through dcsAliasMap
73 // Temperature sensors are processed by AliTPCCalTemp
75 UInt_t tempResult = MapTemperature(dcsAliasMap);
76 UInt_t result=tempResult;
78 // Other calibration information will be retrieved through FXS files
80 // TList* fileSourcesDAQ = GetFile(AliShuttleInterface::kDAQ, "pedestals");
81 // const char* fileNamePed = GetFile(AliShuttleInterface::kDAQ, "pedestals", "LDC1");
83 // TList* fileSourcesHLT = GetFile(AliShuttleInterface::kHLT, "calib");
84 // const char* fileNameHLT = GetFile(AliShuttleInterface::kHLT, "calib", "LDC1");
89 //______________________________________________________________________________________________
90 UInt_t AliTPCPreprocessor::MapTemperature(TMap* dcsAliasMap)
93 // extract DCS temperature maps. Perform fits to save space
95 TMap *map = fTemp->ExtractDCS(dcsAliasMap);
97 fTemp->MakeSplineFit(map);
98 AliInfo(Form("Temperature values extracted, fits performed.\n"));
100 AliError(Form("No temperature map extracted.\n"));
101 Log("AliTPCPreprocsessor: no temperature map extracted. \n");
104 // Now store the final CDB file
106 AliCDBMetaData metaData;
107 metaData.SetBeamPeriod(0);
108 metaData.SetResponsible("Haavard Helstrup");
109 metaData.SetComment("Preprocessor AliTPC data base entries.");
111 UInt_t result = Store("TPC/Calib/Temperature", "Data", fTemp, &metaData, 0, 0);