]> git.uio.no Git - u/mrichter/AliRoot.git/blob - T0/AliT0PreprocessorOffline.cxx
0a0e40b0fab6189a1039efe6650dabfacfdc91bf
[u/mrichter/AliRoot.git] / T0 / AliT0PreprocessorOffline.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
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  **************************************************************************/
15
16 /*
17
18 */   
19 // T0 preprocessor:
20 // 2) takes data after  pass0 , 
21 // processes it, and stores either to OCDB .
22
23
24 #include "AliT0PreprocessorOffline.h"
25 #include "AliT0CalibTimeEq.h"
26 #include "AliCDBStorage.h"
27 #include "AliCDBMetaData.h"
28 #include "AliCDBManager.h"
29
30 #include "AliCDBEntry.h"
31 #include "AliLog.h"
32
33 #include <TTimeStamp.h>
34 #include <TFile.h>
35 #include <TObjString.h>
36 #include <TNamed.h>
37 #include "TClass.h"
38
39
40 ClassImp(AliT0PreprocessorOffline)
41
42 //____________________________________________________
43 AliT0PreprocessorOffline::AliT0PreprocessorOffline():
44 TNamed("AliT0PreprocessorOffline","AliT0PreprocessorOffline")
45 {
46   //constructor
47 }
48 //____________________________________________________
49
50 AliT0PreprocessorOffline::~AliT0PreprocessorOffline()
51 {
52   //destructor
53
54 }
55 //____________________________________________________
56 //____________________________________________________
57
58 void AliT0PreprocessorOffline::CalibOffsetChannels(TString filePhysName, Int_t ustartRun, Int_t uendRun, TString ocdbStorage)
59 {
60
61
62   //Processing data from DAQ Physics run
63   AliInfo("Processing Time Offset between channels");
64   if (filePhysName)
65     {
66       AliT0CalibTimeEq *offline = new AliT0CalibTimeEq();
67       offline->Reset();
68       Bool_t writeok = offline->ComputeOfflineParams(filePhysName.Data());
69       AliCDBMetaData metaData;
70       metaData.SetBeamPeriod(1);
71       metaData.SetResponsible("Alla Maevskaya");
72       metaData.SetComment("Time equalizing result with slew");
73       
74       if (writeok)  {
75         AliCDBId* id1=NULL;
76         id1=new AliCDBId("T0/Calib/TimeDelay", ustartRun, uendRun);
77         AliCDBStorage* gStorage = AliCDBManager::Instance()->GetStorage(ocdbStorage);
78         gStorage->Put(offline, (*id1), &metaData);
79       }
80       else {
81         
82            AliWarning(Form("writeok = %d not enough data for equalizing",writeok));
83       }           
84    
85       delete offline;
86     }
87         
88
89 }