]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDPreprocessorOffline.cxx
removing unnecessary include file
[u/mrichter/AliRoot.git] / TRD / AliTRDPreprocessorOffline.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   Responsible: marian.ivanov@cern.ch 
20   Code to analyze the TPC calibration and to produce OCDB entries  
21
22
23    .x ~/rootlogon.C
24    gSystem->Load("libANALYSIS");
25    gSystem->Load("libTPCcalib");
26
27    AliTRDPreprocessorOffline proces;
28    TString ocdbPath="local:////"
29    ocdbPath+=gSystem->GetFromPipe("pwd");
30
31    proces.CalibTimeGain("CalibObjects.root",run0,run1,ocdbPath);
32    proces.CalibTimeVdrift("CalibObjects.root",run0,run1,ocdbPath);
33   // take the raw calibration data from the file CalibObjects.root 
34   // and make a OCDB entry with run  validity run0-run1
35   // results are stored at the ocdbPath - local or alien ...
36   // default storage ""- data stored at current working directory 
37  
38 */
39 #include "Riostream.h"
40 #include <fstream>
41 #include "TFile.h"
42 #include "TCanvas.h"
43 #include "TLegend.h"
44 #include "TH2I.h"
45 #include "TH1I.h"
46 #include "TH2F.h"
47 #include "TH1F.h"
48 #include "TProfile2D.h"
49 #include "AliTRDCalDet.h"
50 #include "AliTRDCalPad.h"
51 #include "AliCDBMetaData.h"
52 #include "AliCDBId.h"
53 #include "AliCDBManager.h"
54 #include "AliCDBStorage.h"
55 #include "AliTRDCalibraMode.h"
56 #include "AliTRDCalibraFit.h"
57 #include "AliTRDCalibraVdriftLinearFit.h"
58 #include "AliTRDPreprocessorOffline.h"
59
60
61 ClassImp(AliTRDPreprocessorOffline)
62
63 AliTRDPreprocessorOffline::AliTRDPreprocessorOffline():
64   TNamed("TPCPreprocessorOffline","TPCPreprocessorOffline"),
65   fMethodSecond(kTRUE),
66   fNameList("TRDCalib"),
67   fCalDetGainUsed(0x0),
68   fCH2d(0x0),
69   fPH2d(0x0),
70   fPRF2d(0x0),
71   fAliTRDCalibraVdriftLinearFit(0x0),
72   fNEvents(0x0),
73   fAbsoluteGain(0x0),
74   fPlots(new TObjArray(8)),
75   fCalibObjects(new TObjArray(8))
76 {
77   //
78   // default constructor
79   //
80 }
81
82 AliTRDPreprocessorOffline::~AliTRDPreprocessorOffline() {
83   //
84   // Destructor
85   //
86
87   if(fCalDetGainUsed) delete fCalDetGainUsed;
88   if(fCH2d) delete fCH2d;
89   if(fPH2d) delete fPH2d;
90   if(fPRF2d) delete fPRF2d;
91   if(fAliTRDCalibraVdriftLinearFit) delete fAliTRDCalibraVdriftLinearFit;
92   if(fNEvents) delete fNEvents;
93   if(fAbsoluteGain) delete fAbsoluteGain;
94   if(fPlots) delete fPlots;
95   if(fCalibObjects) delete fCalibObjects;
96   
97 }
98
99 void AliTRDPreprocessorOffline::CalibVdriftT0(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage){
100   //
101   // make calibration of the drift velocity
102   // Input parameters:
103   //      file                             - the location of input file
104   //      startRunNumber, endRunNumber     - run validity period 
105   //      ocdbStorage                      - path to the OCDB storage
106   //                                       - if empty - local storage 'pwd' uesed
107   if (ocdbStorage.Length()<=0) ocdbStorage="local://"+gSystem->GetFromPipe("pwd")+"/OCDB";
108   //
109   // 1. Initialization 
110   //
111   //
112   // 2. extraction of the information
113   //
114   if(ReadVdriftT0Global(file)) AnalyzeVdriftT0();
115   if(ReadVdriftLinearFitGlobal(file)) AnalyzeVdriftLinearFit();
116   //
117   // 3. Append QA plots
118   //
119   //MakeDefaultPlots(fVdriftArray,fVdriftArray);
120   //
121   //
122   // 4. update of OCDB
123   //
124   //
125   UpdateOCDBVdrift(startRunNumber,endRunNumber,ocdbStorage);
126   UpdateOCDBT0(startRunNumber,endRunNumber,ocdbStorage);
127
128 }
129
130
131 void AliTRDPreprocessorOffline::CalibGain(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage){
132   //
133   // make calibration of the drift velocity
134   // Input parameters:
135   //      file                             - the location of input file
136   //      startRunNumber, endRunNumber     - run validity period 
137   //      ocdbStorage                      - path to the OCDB storage
138   //                                       - if empty - local storage 'pwd' uesed
139   if (ocdbStorage.Length()<=0) ocdbStorage="local://"+gSystem->GetFromPipe("pwd")+"/OCDB";
140   //
141   // 1. Initialization 
142   if(!ReadGainGlobal(file)) return;
143   //
144   //
145   // 2. extraction of the information
146   //
147   AnalyzeGain();
148   if(fCalDetGainUsed) CorrectFromDetGainUsed();
149   //
150   // 3. Append QA plots
151   //
152   //MakeDefaultPlots(fVdriftArray,fVdriftArray);
153   //
154   //
155   // 4. update of OCDB
156   //
157   //
158   UpdateOCDBGain(startRunNumber,endRunNumber,ocdbStorage);
159   
160 }
161
162
163 void AliTRDPreprocessorOffline::CalibPRF(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage){
164   //
165   // make calibration of the drift velocity
166   // Input parameters:
167   //      file                             - the location of input file
168   //      startRunNumber, endRunNumber     - run validity period 
169   //      ocdbStorage                      - path to the OCDB storage
170   //                                       - if empty - local storage 'pwd' uesed
171   if (ocdbStorage.Length()<=0) ocdbStorage="local://"+gSystem->GetFromPipe("pwd")+"/OCDB";
172   //
173   // 1. Initialization 
174   if(!ReadPRFGlobal(file)) return;
175   //
176   //
177   // 2. extraction of the information
178   //
179   AnalyzePRF();
180   //
181   // 3. Append QA plots
182   //
183   //MakeDefaultPlots(fVdriftArray,fVdriftArray);
184   //
185   //
186   // 4. update of OCDB
187   //
188   //
189   UpdateOCDBPRF(startRunNumber,endRunNumber,ocdbStorage);
190   
191 }
192
193
194 Bool_t AliTRDPreprocessorOffline::ReadGainGlobal(const Char_t* fileName){
195   //
196   // read calibration entries from file
197   // 
198   TFile fcalib(fileName);
199   TObjArray * array = (TObjArray*)fcalib.Get(fNameList);
200   if (array){
201     TH2I *ch2d = (TH2I *) array->FindObject("CH2d");
202     if(!ch2d) return kFALSE;
203     fCH2d = (TH2I*)ch2d->Clone();
204     //fNEvents = (TH1I *) array->FindObject("NEvents");
205     //fAbsoluteGain = (TH2F *) array->FindObject("AbsoluteGain");
206   }else{
207     TH2I *ch2d = (TH2I *) fcalib.Get("CH2d");
208     if(!ch2d) return kFALSE;
209     fCH2d = (TH2I*)ch2d->Clone();
210     //fNEvents = (TH1I *) fcalib.Get("NEvents");
211     //fAbsoluteGain = (TH2F *) fcalib.Get("AbsoluteGain");
212   }
213   fCH2d->SetDirectory(0);
214   //printf("title of CH2d %s\n",fCH2d->GetTitle());
215
216   return kTRUE;
217   
218 }
219
220 Bool_t AliTRDPreprocessorOffline::ReadVdriftT0Global(const Char_t* fileName){
221   //
222   // read calibration entries from file
223   // 
224   TFile fcalib(fileName);
225   TObjArray * array = (TObjArray*)fcalib.Get(fNameList);
226   if (array){
227     TProfile2D *ph2d = (TProfile2D *) array->FindObject("PH2d");
228     if(!ph2d) return kFALSE;
229     fPH2d = (TProfile2D*)ph2d->Clone();
230     //fNEvents = (TH1I *) array->FindObject("NEvents");
231   }else{
232     TProfile2D *ph2d = (TProfile2D *) fcalib.Get("PH2d");
233     if(!ph2d) return kFALSE;
234     fPH2d = (TProfile2D*)ph2d->Clone();
235     //fNEvents = (TH1I *) fcalib.Get("NEvents");
236   }
237   fPH2d->SetDirectory(0);
238   //printf("title of PH2d %s\n",fPH2d->GetTitle());
239   
240   return kTRUE;
241   
242 }
243
244 Bool_t AliTRDPreprocessorOffline::ReadVdriftLinearFitGlobal(const Char_t* fileName){
245   //
246   // read calibration entries from file
247   // 
248   TFile fcalib(fileName);
249   TObjArray * array = (TObjArray*)fcalib.Get(fNameList);
250   if (array){
251     fAliTRDCalibraVdriftLinearFit = (AliTRDCalibraVdriftLinearFit *) array->FindObject("AliTRDCalibraVdriftLinearFit");
252     //fNEvents = (TH1I *) array->FindObject("NEvents");
253   }else{
254     fAliTRDCalibraVdriftLinearFit = (AliTRDCalibraVdriftLinearFit *) fcalib.Get("AliTRDCalibraVdriftLinearFit");
255     //fNEvents = (TH1I *) fcalib.Get("NEvents");
256   }
257   if(!fAliTRDCalibraVdriftLinearFit) {
258     //printf("No AliTRDCalibraVdriftLinearFit\n");
259     return kFALSE;
260   }
261   return kTRUE;
262   
263 }
264
265 Bool_t AliTRDPreprocessorOffline::ReadPRFGlobal(const Char_t* fileName){
266   //
267   // read calibration entries from file
268   // 
269   TFile fcalib(fileName);
270   TObjArray * array = (TObjArray*)fcalib.Get(fNameList);
271   if (array){
272     TProfile2D *prf2d = (TProfile2D *) array->FindObject("PRF2d");
273     if(!prf2d) return kFALSE;
274     fPRF2d = (TProfile2D*)prf2d->Clone();
275     //fNEvents = (TH1I *) array->FindObject("NEvents");
276   }else{
277     TProfile2D *prf2d = (TProfile2D *) fcalib.Get("PRF2d");
278     if(!prf2d) return kFALSE;
279     fPRF2d = (TProfile2D*)prf2d->Clone();
280     //fNEvents = (TH1I *) fcalib.Get("NEvents");
281   }
282   fPRF2d->SetDirectory(0);
283   //printf("title of PRF2d %s\n",fPRF2d->GetTitle());
284   
285   return kTRUE;
286
287 }
288
289
290
291 Bool_t AliTRDPreprocessorOffline::AnalyzeGain(){
292   //
293   // Analyze gain - produce the calibration objects
294   //
295
296   AliTRDCalibraFit *calibra = AliTRDCalibraFit::Instance();
297   calibra->SetMinEntries(800); // If there is less than 1000 entries in the histo: no fit
298   calibra->AnalyseCH(fCH2d);
299
300   Int_t nbtg = 6*4*18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb0(0))
301     + 6*  18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb2(0));
302   Int_t nbfit       = calibra->GetNumberFit();
303   Int_t nbE         = calibra->GetNumberEnt();
304
305
306   Bool_t ok = kFALSE;
307   // enough statistics
308   if ((nbtg >                  0) && 
309       (nbfit        >= 0.5*nbE) && (nbE > 30)) {
310     // create the cal objects
311     calibra->PutMeanValueOtherVectorFit(1,kTRUE);
312     TObjArray object           = calibra->GetVectorFit();
313     AliTRDCalDet *calDetGain   = calibra->CreateDetObjectGain(&object);
314     TH1F *coefGain  = calDetGain->MakeHisto1DAsFunctionOfDet();
315     // Put them in the array
316     fCalibObjects->AddAt(calDetGain,kGain);
317     fPlots->AddAt(coefGain,kGain);
318     //
319     ok = kTRUE;
320   }
321   
322   calibra->ResetVectorFit();
323   
324   return ok;
325   
326 }
327
328 Bool_t AliTRDPreprocessorOffline::AnalyzeVdriftT0(){
329   //
330   // Analyze VdriftT0 - produce the calibration objects
331   //
332
333   AliTRDCalibraFit *calibra = AliTRDCalibraFit::Instance();
334   calibra->SetMinEntries(800*20); // If there is less than 1000 entries in the histo: no fit
335   calibra->AnalysePH(fPH2d);
336
337   Int_t nbtg = 6*4*18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb0(1))
338     + 6*  18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb2(1));
339   Int_t nbfit       = calibra->GetNumberFit();
340   Int_t nbfitSuccess = calibra->GetNumberFitSuccess();
341   Int_t nbE         = calibra->GetNumberEnt();
342
343   //printf("nbtg %d, nbfit %d, nbE %d, nbfitSuccess %d\n",nbtg,nbfit,nbE,nbfitSuccess);
344
345   Bool_t ok = kFALSE;
346   if ((nbtg >                  0) && 
347       (nbfit        >= 0.5*nbE) && (nbE > 30) && (nbfitSuccess > 30)) {
348     //printf("Pass the cut for VdriftT0\n");
349     // create the cal objects
350     calibra->RemoveOutliers(1,kFALSE);
351     calibra->PutMeanValueOtherVectorFit(1,kFALSE);
352     calibra->RemoveOutliers2(kFALSE);
353     calibra->PutMeanValueOtherVectorFit2(1,kFALSE);
354     //
355     TObjArray object = calibra->GetVectorFit();
356     AliTRDCalDet *calDetVdrift = calibra->CreateDetObjectVdrift(&object);
357     TH1F *coefVdriftPH  = calDetVdrift->MakeHisto1DAsFunctionOfDet();
358     AliTRDCalPad *calPadVdrift = (AliTRDCalPad *)calibra->CreatePadObjectVdrift(&object,calDetVdrift);
359     TH1F *coefPadVdrift   = calPadVdrift->MakeHisto1D();
360     object       = calibra->GetVectorFit2();
361     AliTRDCalDet *calDetT0  = calibra->CreateDetObjectT0(&object);
362     TH1F *coefT0  = calDetT0->MakeHisto1DAsFunctionOfDet();
363     AliTRDCalPad *calPadT0 = (AliTRDCalPad *)calibra->CreatePadObjectT0(&object,calDetT0);
364     TH1F *coefPadT0  = calPadT0->MakeHisto1D();
365     // Put them in the array
366     fCalibObjects->AddAt(calDetT0,kT0PHDet);
367     fCalibObjects->AddAt(calDetVdrift,kVdriftPHDet);
368     fCalibObjects->AddAt(calPadT0,kT0PHPad);
369     fCalibObjects->AddAt(calPadVdrift,kVdriftPHPad);
370     fPlots->AddAt(coefVdriftPH,kVdriftPHDet);
371     fPlots->AddAt(coefT0,kT0PHDet);
372     fPlots->AddAt(coefPadVdrift,kVdriftPHPad);
373     fPlots->AddAt(coefPadT0,kT0PHPad);
374     //
375     ok = kTRUE;
376   }
377   calibra->ResetVectorFit();
378  
379   return ok;
380   
381 }
382
383 Bool_t AliTRDPreprocessorOffline::AnalyzeVdriftLinearFit(){
384   //
385   // Analyze vdrift linear fit - produce the calibration objects
386   //
387
388   AliTRDCalibraFit *calibra = AliTRDCalibraFit::Instance();
389   calibra->SetMinEntries(800); // If there is less than 1000 entries in the histo: no fit
390   fAliTRDCalibraVdriftLinearFit->FillPEArray();
391   calibra->AnalyseLinearFitters(fAliTRDCalibraVdriftLinearFit);
392
393   //Int_t nbtg        = 540;
394   Int_t nbfit       = calibra->GetNumberFit();
395   Int_t nbE         = calibra->GetNumberEnt();
396
397   
398   Bool_t ok = kFALSE;
399   // enough statistics
400   if ((nbfit        >= 0.5*nbE) && (nbE > 30)) {
401     // create the cal objects
402     //calibra->RemoveOutliers(1,kTRUE);
403     calibra->PutMeanValueOtherVectorFit(1,kTRUE);
404     //calibra->RemoveOutliers2(kTRUE);
405     calibra->PutMeanValueOtherVectorFit2(1,kTRUE);
406     //
407     TObjArray object  = calibra->GetVectorFit();
408     AliTRDCalDet *calDetVdrift = calibra->CreateDetObjectVdrift(&object,kTRUE);
409     TH1F *coefDriftLinear      = calDetVdrift->MakeHisto1DAsFunctionOfDet();
410     object                     = calibra->GetVectorFit2();
411     AliTRDCalDet *calDetLorentz = calibra->CreateDetObjectLorentzAngle(&object);
412     TH1F *coefLorentzAngle = calDetLorentz->MakeHisto1DAsFunctionOfDet();
413     // Put them in the array
414     fCalibObjects->AddAt(calDetVdrift,kVdriftLinear);
415     fCalibObjects->AddAt(calDetLorentz,kLorentzLinear);
416     fPlots->AddAt(coefDriftLinear,kVdriftLinear);
417     fPlots->AddAt(coefLorentzAngle,kLorentzLinear);
418     //
419     ok = kTRUE;
420   }
421   
422   calibra->ResetVectorFit();
423   
424   return ok;
425   
426 }
427
428
429 Bool_t AliTRDPreprocessorOffline::AnalyzePRF(){
430   //
431   // Analyze PRF - produce the calibration objects
432   //
433
434   AliTRDCalibraFit *calibra = AliTRDCalibraFit::Instance();
435   calibra->SetMinEntries(600); // If there is less than 1000 entries in the histo: no fit
436   calibra->AnalysePRFMarianFit(fPRF2d);
437
438   Int_t nbtg = 6*4*18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb0(2))
439     + 6*  18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb2(2));
440   Int_t nbfit       = calibra->GetNumberFit();
441   Int_t nbE         = calibra->GetNumberEnt();
442
443   
444   Bool_t ok = kFALSE;
445   // enough statistics
446   if ((nbtg >                  0) && 
447       (nbfit        >= 0.95*nbE) && (nbE > 30)) {
448     // create the cal objects
449     TObjArray object  = calibra->GetVectorFit();
450     AliTRDCalPad *calPadPRF = (AliTRDCalPad*) calibra->CreatePadObjectPRF(&object);
451     TH1F *coefPRF           = calPadPRF->MakeHisto1D();
452     // Put them in the array
453     fCalibObjects->AddAt(calPadPRF,kPRF);
454     fPlots->AddAt(coefPRF,kPRF);
455     //
456     ok = kTRUE;
457   }
458   
459   calibra->ResetVectorFit();
460   
461   return ok;
462   
463 }
464
465 void AliTRDPreprocessorOffline::CorrectFromDetGainUsed() {
466
467   AliTRDCalDet *calDetGain = (AliTRDCalDet *) fCalibObjects->At(kGain);
468   if(!calDetGain) return;
469
470   for(Int_t det = 0; det < 540; det++) {
471     
472     Float_t gaininit = fCalDetGainUsed->GetValue(det);
473     Float_t gainout = calDetGain->GetValue(det);
474     
475     calDetGain->SetValue(det,gaininit*gainout);
476
477   }
478
479
480 }
481
482 void AliTRDPreprocessorOffline::UpdateOCDBGain(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath){
483   //
484   // Update OCDB entry
485   //
486   
487   AliCDBMetaData *metaData= new AliCDBMetaData();
488   metaData->SetObjectClassName("AliTRDCalDet");
489   metaData->SetResponsible("Raphaelle Bailhache");
490   metaData->SetBeamPeriod(1);
491   
492   AliCDBId id1("TRD/Calib/ChamberGainFactor", startRunNumber, endRunNumber);
493   AliCDBStorage * gStorage = AliCDBManager::Instance()->GetStorage(storagePath);
494   AliTRDCalDet *calDet = (AliTRDCalDet *) fCalibObjects->At(kGain);
495   if(calDet) gStorage->Put(calDet, id1, metaData);
496   //else {
497   //  printf("No calDet object for Gain\n");
498   //}
499
500     
501
502 }
503
504 void AliTRDPreprocessorOffline::UpdateOCDBVdrift(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath){
505   //
506   // Update OCDB entry
507   //
508
509   Int_t detVdrift = kVdriftPHDet;
510   
511   if(fMethodSecond) detVdrift = kVdriftLinear;
512   
513   AliCDBMetaData *metaData= new AliCDBMetaData();
514   metaData->SetObjectClassName("AliTRDCalDet");
515   metaData->SetResponsible("Raphaelle Bailhache");
516   metaData->SetBeamPeriod(1);
517   
518   AliCDBId id1("TRD/Calib/ChamberVdrift", startRunNumber, endRunNumber);
519   AliCDBStorage * gStorage = AliCDBManager::Instance()->GetStorage(storagePath);
520   AliTRDCalDet *calDet = (AliTRDCalDet *) fCalibObjects->At(detVdrift);
521   if(calDet) gStorage->Put(calDet, id1, metaData);
522   //else {
523   //  printf("No calDet object for Vdrift\n");
524   //}
525
526   //
527
528   if(!fMethodSecond) {
529     
530     AliCDBMetaData *metaDataPad= new AliCDBMetaData();
531     metaDataPad->SetObjectClassName("AliTRDCalPad");
532     metaDataPad->SetResponsible("Raphaelle Bailhache");
533     metaDataPad->SetBeamPeriod(1);
534     
535     AliCDBId id1Pad("TRD/Calib/LocalVdrift", startRunNumber, endRunNumber);
536     AliTRDCalPad *calPad = (AliTRDCalPad *) fCalibObjects->At(kVdriftPHPad);
537     if(calPad) gStorage->Put(calPad, id1Pad, metaDataPad);
538     //else {
539     //  printf("No calPad object for Vdrift\n");
540     //}
541
542   
543   }
544
545 }
546
547 void AliTRDPreprocessorOffline::UpdateOCDBT0(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath){
548   //
549   // Update OCDB entry
550   //
551   
552   AliCDBMetaData *metaData= new AliCDBMetaData();
553   metaData->SetObjectClassName("AliTRDCalDet");
554   metaData->SetResponsible("Raphaelle Bailhache");
555   metaData->SetBeamPeriod(1);
556   
557   AliCDBId id1("TRD/Calib/ChamberT0", startRunNumber, endRunNumber);
558   AliCDBStorage * gStorage = AliCDBManager::Instance()->GetStorage(storagePath);
559   AliTRDCalDet *calDet = (AliTRDCalDet *) fCalibObjects->At(kT0PHDet);
560   if(calDet) gStorage->Put(calDet, id1, metaData);
561   //else {
562   //  printf("No calDet object for T0\n");
563   //}
564  
565
566   //
567
568   AliCDBMetaData *metaDataPad= new AliCDBMetaData();
569   metaDataPad->SetObjectClassName("AliTRDCalPad");
570   metaDataPad->SetResponsible("Raphaelle Bailhache");
571   metaDataPad->SetBeamPeriod(1);
572   
573   AliCDBId id1Pad("TRD/Calib/LocalT0", startRunNumber, endRunNumber);
574   AliTRDCalPad *calPad = (AliTRDCalPad *) fCalibObjects->At(kT0PHPad);
575   if(calPad) gStorage->Put(calPad, id1Pad, metaDataPad);
576   //else {
577   //  printf("No calPad object for T0\n");
578   //}
579
580
581 }
582
583 void AliTRDPreprocessorOffline::UpdateOCDBPRF(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath){
584   //
585   // Update OCDB entry
586   //
587   
588   AliCDBMetaData *metaData= new AliCDBMetaData();
589   metaData->SetObjectClassName("AliTRDCalPad");
590   metaData->SetResponsible("Raphaelle Bailhache");
591   metaData->SetBeamPeriod(1);
592   
593   AliCDBId id1("TRD/Calib/PRFWidth", startRunNumber, endRunNumber);
594   AliCDBStorage * gStorage = AliCDBManager::Instance()->GetStorage(storagePath);
595   AliTRDCalPad *calPad = (AliTRDCalPad *) fCalibObjects->At(kPRF);
596   if(calPad) gStorage->Put(calPad, id1, metaData);
597   //else {
598   //  printf("No calPad object for PRF\n");
599   //}
600  
601
602 }
603