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 **************************************************************************/
17 #include "AliTPCPreprocessor.h"
19 #include "AliCDBMetaData.h"
20 #include "AliDCSValue.h"
22 #include "AliTPCSensorTempArray.h"
24 #include <TTimeStamp.h>
26 const char kFname[]="$ALICE_ROOT/TPC/Cal";
27 const char kAmandaStringTemp[] = "tpc_PT_%d.Temperature";
30 // This class is the SHUTTLE preprocessor for the TPC detector.
31 // It contains several components, this far the part containing
32 // temperatures is implemented
35 ClassImp(AliTPCPreprocessor)
37 //______________________________________________________________________________________________
38 AliTPCPreprocessor::AliTPCPreprocessor(const char* detector, AliShuttleInterface* shuttle) :
39 AliPreprocessor(detector, shuttle),
44 //______________________________________________________________________________________________
45 // AliTPCPreprocessor::AliTPCPreprocessor(const AliTPCPreprocessor& org) :
46 // AliPreprocessor(org),
49 // // copy constructor not implemented
50 // // -- missing underlying copy constructor in AliPreprocessor
52 // Fatal("AliTPCPreprocessor", "copy constructor not implemented");
54 // // fTemp = new AliTPCSensorTempArray(*(org.fTemp));
57 //______________________________________________________________________________________________
58 AliTPCPreprocessor::~AliTPCPreprocessor()
64 //______________________________________________________________________________________________
65 AliTPCPreprocessor& AliTPCPreprocessor::operator = (const AliTPCPreprocessor& )
67 Fatal("operator =", "assignment operator not implemented");
72 //______________________________________________________________________________________________
73 void AliTPCPreprocessor::Initialize(Int_t run, UInt_t startTime,
76 // Creates AliTestDataDCS object
78 AliPreprocessor::Initialize(run, startTime, endTime);
80 AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", run,
81 TTimeStamp(startTime).AsString(),
82 TTimeStamp(endTime).AsString()));
84 fTemp = new AliTPCSensorTempArray(fStartTime, fEndTime, kFname);
85 fTemp->SetAmandaString(kAmandaStringTemp);
88 //______________________________________________________________________________________________
89 UInt_t AliTPCPreprocessor::Process(TMap* dcsAliasMap)
91 // Fills data into TPC calibrations objects
93 if (!dcsAliasMap) return 0;
95 // Amanda servers provide information directly through dcsAliasMap
97 // Temperature sensors are processed by AliTPCCalTemp
99 UInt_t tempResult = MapTemperature(dcsAliasMap);
100 UInt_t result=tempResult;
102 // Other calibration information will be retrieved through FXS files
104 // TList* fileSourcesDAQ = GetFile(AliShuttleInterface::kDAQ, "pedestals");
105 // const char* fileNamePed = GetFile(AliShuttleInterface::kDAQ, "pedestals", "LDC1");
107 // TList* fileSourcesHLT = GetFile(AliShuttleInterface::kHLT, "calib");
108 // const char* fileNameHLT = GetFile(AliShuttleInterface::kHLT, "calib", "LDC1");
113 //______________________________________________________________________________________________
114 UInt_t AliTPCPreprocessor::MapTemperature(TMap* dcsAliasMap)
117 // extract DCS temperature maps. Perform fits to save space
120 TMap *map = fTemp->ExtractDCS(dcsAliasMap);
122 fTemp->MakeSplineFit(map);
123 AliInfo(Form("Temperature values extracted, fits performed.\n"));
125 AliError(Form("No temperature map extracted.\n"));
126 Log("AliTPCPreprocsessor: no temperature map extracted. \n");
130 // Now store the final CDB file
133 AliCDBMetaData metaData;
134 metaData.SetBeamPeriod(0);
135 metaData.SetResponsible("Haavard Helstrup");
136 metaData.SetComment("Preprocessor AliTPC data base entries.");
138 result = Store("Calib", "Temperature", fTemp, &metaData, 0, 0);
143 } // revert to new return code conventions