1 #include "AliSTARTPreprocessor.h"
3 #include "AliCDBMetaData.h"
4 #include "AliDCSValue.h"
6 #include "AliSTARTCalc.h"
8 #include <TTimeStamp.h>
11 #include "AliSTARTDqclass.h"
13 ClassImp(AliSTARTPreprocessor)
15 //____________________________________________________
16 AliSTARTPreprocessor::AliSTARTPreprocessor(const char* detector, AliShuttleInterface* shuttle) :
17 AliPreprocessor(detector, shuttle)
22 AliSTARTPreprocessor::~AliSTARTPreprocessor()
27 UInt_t AliSTARTPreprocessor::Process(TMap* dcsAliasMap )
30 if(!dcsAliasMap) return 0;
33 // AliDCSValue *aValue;
34 Float_t hv[24]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
36 for(int j=0; j<24; j++){
37 TString aliasName =Form("T0HV%d",j);
38 // printf("aliasname: %s\n",aliasName.Data());
39 aliasArr = dynamic_cast<TObjArray*> (dcsAliasMap->GetValue(aliasName.Data()));
41 AliError(Form("Alias %s not found!", aliasName.Data()));
44 AliDCSValue *aValue=dynamic_cast<AliDCSValue*> (aliasArr->At(0));
45 // printf("I'm here! %f %x\n", aValue->GetFloat(), aValue->GetTimeStamp());
46 hv[j]= aValue->GetFloat()*100;
47 //Float_t timestamp= (Float_t) (aValue->GetTimeStamp());
48 // printf("hello! hv = %f timestamp = %f\n" ,hv[j], timestamp);
53 AliSTARTCalc *calibdata = new AliSTARTCalc();
55 const char* TimefileName = GetFile(kDAQ, "TIME", "LDC0");
59 TFile *file = TFile::Open(TimefileName);
60 if(!file || !file->IsOpen())
62 printf("File from DAQ does not exist.");
65 AliSTARTDqclass *tempdata = dynamic_cast<AliSTARTDqclass*> (file->Get("Time"));
66 for(Int_t i=0;i<24;i++){
67 numbers[i] = tempdata->GetTime(i);
68 // printf("\nnumbers: %f\n",numbers[i]);
74 calibdata->SetTime(numbers, hv);
77 AliCDBMetaData metaData;
78 metaData.SetBeamPeriod(0);
79 metaData.SetResponsible("Tomek&Michal");
80 metaData.SetComment("This preprocessor returns time to be used for reconstruction.");
82 UInt_t result = Store("Calib","Data", calibdata, &metaData);