]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDPreprocessor.cxx
Small modifications by Raphaelle
[u/mrichter/AliRoot.git] / TRD / AliTRDPreprocessor.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 /* $Id$ */
17
18 ////////////////////////////////////////////////////////////////////////////
19 //                                                                        //
20 // This class is a first implementation for the TRD.                      //
21 // It takes data from HLT and computes the parameters                     //
22 // and stores both reference data and online calibration                  //
23 // parameters in the CDB                                                  //
24 // It alsotakes DCS data, does spline fits                                //
25 // and stores both reference data and spline fits results                 //
26 // in the CDB                                                             //
27 //                                                                        //
28 // Author:                                                                //
29 //   R. Bailhache (R.Bailhache@gsi.de)                                    //
30 //   W. Monange   (w.monange@gsi.de)                                      //
31 //                                                                        //
32 ////////////////////////////////////////////////////////////////////////////
33
34 #include "AliTRDPreprocessor.h"
35
36 #include <TFile.h>
37 #include <TProfile2D.h>
38 #include <TStopwatch.h>
39 #include <TObjString.h>
40 #include <TString.h>
41 #include <TList.h>
42 #include <TCollection.h>
43
44 #include "AliCDBMetaData.h"
45 #include "AliLog.h"
46
47 #include "AliTRDSensorArray.h"
48 #include "AliTRDCalibraFit.h"
49 #include "AliTRDCalibraMode.h"
50 #include "AliTRDCalibPadStatus.h"
51 #include "Cal/AliTRDCalDet.h"
52 #include "Cal/AliTRDCalPadStatus.h"
53
54 ClassImp(AliTRDPreprocessor)
55
56 //______________________________________________________________________________________________
57 AliTRDPreprocessor::AliTRDPreprocessor(AliShuttleInterface *shuttle)
58   :AliPreprocessor("TRD", shuttle),
59    fVdriftHLT(0)
60 {
61   //
62   // Constructor
63   //
64
65 }
66
67 //______________________________________________________________________________________________
68 AliTRDPreprocessor::~AliTRDPreprocessor()
69 {
70   //
71   // Destructor
72   //
73
74 }
75
76 //______________________________________________________________________________________________
77 void AliTRDPreprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime)
78 {
79   //
80   // Initialization routine for the TRD preprocessor
81   //
82
83   AliPreprocessor::Initialize(run,startTime,endTime);
84
85 }
86
87 //______________________________________________________________________________________________
88 UInt_t AliTRDPreprocessor::Process(TMap* dcsAliasMap)
89 {
90   //
91   // Process DCS and calibration part for HLT
92   //
93
94   TString runType = GetRunType();
95   Log(Form("runtype %s\n",runType.Data()));
96   
97   if (runType=="PEDESTAL_RUN"){
98     if(ExtractPedestals()) return 1;
99     return 0;
100   } 
101
102   //
103   // DCS
104   //
105   
106   if(ProcessDCS(dcsAliasMap)) return 1;
107
108   //
109   // Process the calibration data for the HLT and DAQ part
110   //
111   
112   if (runType=="PHYSICS"){
113     //TString runPar = GetRunParameter("HLTStatus")
114     //if(runPar=="1") {
115     if(ExtractHLT()) return 1;
116     //if (fResult > 0) return fResult;
117     //} 
118     if(!fVdriftHLT) {
119       if(ExtractDriftVelocityDAQ()) return 1;
120     }
121   }
122   
123   return 0;  
124   
125 }
126
127 //______________________________________________________________________________
128 Bool_t AliTRDPreprocessor::ProcessDCS(TMap * dcsAliasMap)
129 {
130   Bool_t error=kFALSE;
131
132   AliCDBMetaData metaData;
133   metaData.SetBeamPeriod(0);
134   metaData.SetResponsible("Wilfried Monange/Raphaelle Bailhache");
135   metaData.SetComment("TRD calib test");
136         
137         
138   Log ("****** DCS ******\n");
139         
140   TObjArray * list=AliTRDSensorArray::GetList ();
141         
142   if (list == 0x0) {
143     Log ("Error during AliTRDSensorArray::GetList");
144     Log ("DCS will not be processing");
145     return kTRUE;
146   }
147
148   Int_t nEntries = list->GetEntries ();
149   Log (Form ("%d alias loaded", nEntries));
150                 
151   Bool_t * results=new Bool_t [nEntries];
152   Int_t  * nGraph=new Int_t [nEntries];
153                 
154   for (Int_t iAlias = 0; iAlias < nEntries; iAlias++) {
155                         
156     AliTRDSensorArray * oneTRDDCS = (AliTRDSensorArray *)list->At (iAlias);
157                         
158     oneTRDDCS->SetStartTime (TTimeStamp (fStartTime));
159     oneTRDDCS->SetEndTime (TTimeStamp (fEndTime));
160                         
161     Log (Form("Processing DCS : \"%s\"", oneTRDDCS->GetStoreName ().Data ()));
162                         
163     TMap * map;
164
165     map=oneTRDDCS->ExtractDCS (dcsAliasMap);
166                 
167     nGraph [iAlias] = map->GetEntries ();
168                 
169     if (nGraph [iAlias] == 0) {
170       Log("No TGraph for this dcsDatapointAlias : not stored");
171       results [iAlias] = kFALSE;
172       continue;
173     }
174                 
175     oneTRDDCS->SetGraph(map);
176     results[iAlias]=Store("Calib", oneTRDDCS->GetStoreName().Data(), oneTRDDCS, &metaData, 0, kTRUE); 
177     delete map;         
178
179     //results [iAlias] = StoreReferenceData("Calib", oneTRDDCS->GetStoreName ().Data (), oneTRDDCS, &metaData); 
180
181
182     if (!results[iAlias]) {
183       AliError("Problem during StoreRef DCS");
184       error=kTRUE;
185     }
186
187
188     //BEGIN TEST (should not be removed ...)
189     /*
190     oneTRDDCS->ClearGraph();
191     oneTRDDCS->ClearFit();
192     oneTRDDCS->SetDiffCut2 (0.1);
193     map=oneTRDDCS->ExtractDCS (dcsAliasMap);
194     oneTRDDCS->SetGraph (map);
195     Store("Calib", ("cut_"+oneTRDDCS->GetStoreName()).Data(), oneTRDDCS, &metaData, 0, kTRUE); 
196     delete map;
197
198
199     if(iAlias==1 || iAlias==19) continue;
200     
201     oneTRDDCS->ClearGraph();
202     oneTRDDCS->ClearFit();
203     oneTRDDCS->SetDiffCut2(0);
204     map=oneTRDDCS->ExtractDCS(dcsAliasMap);
205     oneTRDDCS->MakeSplineFit(map);
206     Store("Calib", ("fit_"+oneTRDDCS->GetStoreName()).Data() , oneTRDDCS, &metaData, 0, kTRUE); 
207     delete map;
208
209      
210     oneTRDDCS->ClearGraph(); 
211     oneTRDDCS->ClearFit();
212     oneTRDDCS->SetDiffCut2 (0.1);
213     map=oneTRDDCS->ExtractDCS (dcsAliasMap);
214     oneTRDDCS->MakeSplineFit(map);
215     Store("Calib", ("cutfit_"+oneTRDDCS->GetStoreName()).Data() , oneTRDDCS, &metaData, 0, kTRUE); 
216     delete map;
217     */    
218     //END TEST
219
220       
221       
222   }
223                 
224   Log ("         Summury of DCS :\n");
225   Log (Form("%30s %10s %10s", "dcsDatapointAlias", "Stored ?", "# graph"));
226   for (Int_t iAlias = 0; iAlias < nEntries; iAlias++) {
227     AliTRDSensorArray * oneTRDDCS = (AliTRDSensorArray *)list->At (iAlias);
228     Log (Form ("%30s %10s %4d", 
229                oneTRDDCS->GetStoreName ().Data (),
230                results[iAlias] ? "ok" : "X",
231                nGraph [iAlias]));
232   }
233   Log ("*********** End of DCS **********");
234   
235   delete results;
236   delete nGraph;
237
238   return error;
239 }
240
241 //______________________________________________________________________________________________
242 Bool_t AliTRDPreprocessor::ExtractPedestals()
243 {
244   //
245   // Pedestal running on LDCs at the DAQ
246   //
247  
248   Bool_t error = kFALSE;
249
250   // Init a AliTRDCalibPadStatus
251   AliTRDCalibPadStatus calPedSum = AliTRDCalibPadStatus();
252
253   AliCDBMetaData metaData;
254   metaData.SetBeamPeriod(0);
255   metaData.SetResponsible("Raphaelle Bailhache");
256   metaData.SetComment("TRD calib test");
257   
258   // Sum the contributions of the LDCs
259   TList * listpad = GetFileSources(kDAQ,"PADSTATUS");
260   if (!listpad) {
261     Log("No list found for the PEDESTRAL Run");
262     return kTRUE;
263   }
264   
265   // loop through all files from LDCs
266   
267   UInt_t index = 0;
268   while (listpad->At(index)!=NULL) {
269     TObjString* fileNameEntry = (TObjString*) listpad->At(index);
270     if (fileNameEntry != NULL)
271       {
272         TString fileName = GetFile(kDAQ, "PADSTATUS",
273                                    fileNameEntry->GetString().Data());
274         if(fileName.Length() ==0){
275           Log(Form("Error by retrieving the file %d for the pedestal",(Int_t)index));
276           delete listpad;
277           return kTRUE;
278         }
279         
280         TFile *f = TFile::Open(fileName);
281         AliTRDCalibPadStatus *calPed;
282         f->GetObject("calibpadstatus",calPed);
283         
284         if(calPed){
285           
286           // analyse
287           calPed->AnalyseHisto();
288           
289           // store as reference data
290           TString name("PadStatus");
291           name += (Int_t)index;
292           if(!StoreReferenceData("DAQData",(const char *)name,(TObject *) calPed,&metaData)){
293             Log(Form("Error storing AliTRDCalibPadStatus object %d as reference data",(Int_t)index));
294             error = kTRUE;
295           }
296           
297           
298           // Add to the calPedSum
299           for (Int_t idet=0; idet<540; idet++) {
300             AliTRDCalROC *rocMean  = calPed->GetCalRocMean(idet, kFALSE);
301             if ( rocMean )  calPedSum.SetCalRocMean(rocMean,idet);
302             AliTRDCalROC *rocRMS = calPed->GetCalRocRMS(idet, kFALSE);
303             if ( rocRMS )  calPedSum.SetCalRocRMS(rocRMS,idet);
304           }// det loop
305         } // calPed
306       } // fileNameEntry
307     ++index;
308   }// while (list)
309   Log(Form("%d elements found in the list for the pedestal",(Int_t)index));
310   if(index==0){
311     delete listpad;
312     return kTRUE;
313   }
314   //
315   // Store pedestal entry to OCDB
316   //
317   
318   
319   // Create Pad Status
320   AliTRDCalPadStatus *calPadStatus = calPedSum.CreateCalPadStatus();
321   AliCDBMetaData md3; 
322   md3.SetObjectClassName("AliTRDCalPadStatus");
323   md3.SetResponsible("Raphaelle Bailhache");
324   md3.SetBeamPeriod(1);
325   md3.SetComment("TRD calib test");
326   if(!Store("Calib","PadStatus"    ,(TObject *)calPadStatus, &md3, 0, kTRUE)){
327     Log("Error storing the pedestal");
328     delete listpad;
329     return kTRUE;
330   }
331   
332   delete listpad;
333   return error; 
334
335 }
336 //______________________________________________________________________________________________
337 Bool_t AliTRDPreprocessor::ExtractDriftVelocityDAQ()
338 {
339   //
340   // Drift velocity DA running on monitoring servers at the DAQ
341   //
342
343   Bool_t error = kFALSE; 
344
345   // Objects for HLT and DAQ zusammen
346   AliTRDCalibraFit *calibra = AliTRDCalibraFit::Instance();
347   AliCDBMetaData metaData;
348   metaData.SetBeamPeriod(0);
349   metaData.SetResponsible("Raphaelle Bailhache");
350   metaData.SetComment("TRD calib test");
351   // Store the infos for the detector
352   AliCDBMetaData md1; 
353   md1.SetObjectClassName("AliTRDCalDet");
354   md1.SetResponsible("Raphaelle Bailhache");
355   md1.SetBeamPeriod(0);
356   md1.SetComment("TRD calib test");
357   // Store the infos for the pads
358   AliCDBMetaData md2; 
359   md2.SetObjectClassName("AliTRDCalPad");
360   md2.SetResponsible("Raphaelle Bailhache");
361   md2.SetBeamPeriod(0);
362   md2.SetComment("TRD calib test");
363
364
365
366
367   // Take the file from the DAQ file exchange server
368   TList *listdaq = GetFileSources(kDAQ,"VDRIFT");
369   if (!listdaq) {
370     Log("No list found for vdrift (DAQ)");
371     return kTRUE;
372   }
373   
374   if(listdaq->GetSize() !=1){
375     Log(Form("Problem on the size of the list: %d (DAQ)",listdaq->GetSize()));
376     delete listdaq;
377     return kTRUE;
378   }
379   
380   TObjString* fileNameEntry = (TObjString*) listdaq->At(0);
381   if(fileNameEntry != NULL){
382     TString fileName = GetFile(kDAQ, "VDRIFT",
383                                fileNameEntry->GetString().Data());
384     if(fileName.Length() ==0){
385       Log("Error retrieving the file vdrift (DAQ)");
386       delete listdaq;
387       return kTRUE;
388     }
389     TFile *filedaq = TFile::Open(fileName);
390     TProfile2D *histodriftvelocity = (TProfile2D *) filedaq->Get("PH2d");
391     if (histodriftvelocity) {
392       
393       // store as reference data
394       if(!StoreReferenceData("DAQData","VdriftT0",(TObject *) histodriftvelocity,&metaData)){
395         Log("Error storing 2D Profile for vdrift from the DAQ");
396         error = kTRUE;
397       }
398       
399       // analyse
400       
401       Log("Take the PH reference data. Now we will try to fit\n");
402       calibra->SetMinEntries(2000); // If there is less than 2000
403       calibra->AnalysePH(histodriftvelocity);
404       
405       Int_t nbtg = 6*4*18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb0(1))
406         + 6*  18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb2(1));
407       Int_t nbfit        = calibra->GetNumberFit();
408       Int_t nbE        = calibra->GetNumberEnt();
409       
410       // if enough statistics store the results
411       if ((nbtg >                  0) && 
412           (nbfit        >= 0.95*nbE)) {
413         // create the cal objects
414         TObjArray object      = calibra->GetVectorFit();
415         AliTRDCalDet *objdriftvelocitydet = calibra->CreateDetObjectVdrift(&object,kTRUE);
416         TObject *objdriftvelocitypad = calibra->CreatePadObjectVdrift();
417         object              = calibra->GetVectorFit2();
418         AliTRDCalDet *objtime0det         = calibra->CreateDetObjectT0(&object,kTRUE);
419         TObject *objtime0pad         = calibra->CreatePadObjectT0();
420         calibra->ResetVectorFit();
421         // store
422         if(!Store("Calib","ChamberVdrift"    ,(TObject *) objdriftvelocitydet,&md1,0,kTRUE)){
423           Log("Error storing the calibration object for the chamber vdrift (DAQ)");
424           error = kTRUE;
425         }
426         if(!Store("Calib","ChamberT0"        ,(TObject *) objtime0det        ,&md1,0,kTRUE)){
427           Log("Error storing the calibration object for the chamber t0 (DAQ)");
428           error = kTRUE;
429         }
430         if(!Store("Calib","LocalVdrift"      ,(TObject *) objdriftvelocitypad,&md2,0,kTRUE)){
431           Log("Error storing the calibration object for the local drift velocity (DAQ)");
432           error = kTRUE;
433         }
434         if(!Store("Calib","LocalT0"          ,(TObject *) objtime0pad        ,&md2,0,kTRUE)){
435           Log("Error storing the calibration object for the local time0 (DAQ)");
436           error = kTRUE;
437         }
438       }
439       else{
440         Log("Not enough statistics for the average pulse height (DAQ)");
441       }
442     } // histo here
443   }// if fileNameEntry
444   
445   delete listdaq; 
446   return error; 
447   
448 }
449 //______________________________________________________________________________________________
450 Bool_t AliTRDPreprocessor::ExtractHLT()
451 {
452   //
453   // Gain, vdrift and PRF calibration running on HLT
454   // return kFALSE if NULL pointer to the list
455   //
456
457   Bool_t error = kFALSE;
458
459   // Objects for HLT and DAQ zusammen
460   AliTRDCalibraFit *calibra = AliTRDCalibraFit::Instance();
461   AliCDBMetaData metaData;
462   metaData.SetBeamPeriod(0);
463   metaData.SetResponsible("Raphaelle Bailhache");
464   metaData.SetComment("TRD calib test");
465   // Store the infos for the detector
466   AliCDBMetaData md1; 
467   md1.SetObjectClassName("AliTRDCalDet");
468   md1.SetResponsible("Raphaelle Bailhache");
469   md1.SetBeamPeriod(0);
470   md1.SetComment("TRD calib test");
471   // Store the infos for the pads
472   AliCDBMetaData md2; 
473   md2.SetObjectClassName("AliTRDCalPad");
474   md2.SetResponsible("Raphaelle Bailhache");
475   md2.SetBeamPeriod(0);
476   md2.SetComment("TRD calib test");
477
478   
479   // Take the file from the HLT file exchange server
480   TList *listhlt = GetFileSources(kHLT,"GAINDRIFTPRF");
481   if (!listhlt) {
482     Log("No list found for the HLT");
483     return kTRUE;
484   }
485
486   if(listhlt->GetSize() != 1) {
487     Log(Form("Problem on the size of the list: %d (HLT)",listhlt->GetSize()));
488     delete listhlt;
489     return kTRUE;
490   }
491   
492   TObjString* fileNameEntry = (TObjString*) listhlt->At(0);
493   if(fileNameEntry != NULL){
494     TString fileName = GetFile(kHLT, "GAINDRIFTPRF",
495                                fileNameEntry->GetString().Data());
496     if(fileName.Length() ==0){
497       Log("Error retrieving the file (HLT)");
498       delete listhlt;
499       return kTRUE;
500     }
501     // Take the file
502     TFile *filehlt = TFile::Open(fileName);
503     
504     
505     // gain
506     TH2I *histogain = (TH2I *) filehlt->Get("CH2d");
507     histogain->SetDirectory(0);
508     if (histogain) {
509       // store the reference data
510       if(!StoreReferenceData("HLTData","Gain",(TObject *) histogain,&metaData)){
511         Log("Error storing 2D histos for gain");
512         error = kTRUE;
513       }
514       // analyse
515       Log("Take the CH reference data. Now we will try to fit\n");
516       calibra->SetMinEntries(1000); // If there is less than 1000 entries in the histo: no fit
517       calibra->AnalyseCH(histogain);
518       Int_t nbtg = 6*4*18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb0(0))
519         + 6*  18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb2(0));
520       Int_t nbfit       = calibra->GetNumberFit();
521       Int_t nbE         = calibra->GetNumberEnt();
522       // enough statistics
523       if ((nbtg >                  0) && 
524           (nbfit        >= 0.95*nbE)) {
525         // create the cal objects
526         TObjArray object           = calibra->GetVectorFit();
527         AliTRDCalDet *objgaindet   = calibra->CreateDetObjectGain(&object,calibra->GetScaleFitFactor(),kTRUE);
528         TObject *objgainpad        = calibra->CreatePadObjectGain();
529         // store them
530         if(!Store("Calib","ChamberGainFactor",(TObject *) objgaindet         ,&md1,0,kTRUE)){
531           Log("Error storing the calibration object for the chamber gain");
532           error = kTRUE;
533         }
534         if(!Store("Calib","LocalGainFactor"  ,(TObject *) objgainpad         ,&md2,0,kTRUE)){
535           Log("Error storing the calibration object for the local gain factor");
536           error = kTRUE;
537         }
538       }
539       calibra->ResetVectorFit();
540     }// if histogain
541     
542     
543     
544     // vdrift
545     fVdriftHLT = kFALSE;
546     TProfile2D *histodriftvelocity = (TProfile2D *) filehlt->Get("PH2d");
547     histodriftvelocity->SetDirectory(0);
548     if (histodriftvelocity) {
549       // store the reference data
550       if(!StoreReferenceData("HLTData","VdriftT0",(TObject *) histodriftvelocity,&metaData)){
551         Log("Error storing 2D Profile for average pulse height (HLT)");
552         error = kTRUE;
553       }
554       // analyse
555       Log("Take the PH reference data. Now we will try to fit\n");
556       calibra->SetMinEntries(1000*20); // If there is less than 20000
557       calibra->AnalysePH(histodriftvelocity);
558       Int_t nbtg = 6*4*18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb0(1))
559         + 6*  18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb2(1));
560       Int_t nbfit        = calibra->GetNumberFit();
561       Int_t nbE          = calibra->GetNumberEnt();
562       // enough statistics
563       if ((nbtg >                  0) && 
564           (nbfit        >= 0.95*nbE)) {
565         // create the cal objects
566         TObjArray object  = calibra->GetVectorFit();
567         AliTRDCalDet *objdriftvelocitydet = calibra->CreateDetObjectVdrift(&object,kTRUE);
568         TObject *objdriftvelocitypad      = calibra->CreatePadObjectVdrift();
569         object              = calibra->GetVectorFit2();
570         AliTRDCalDet *objtime0det  = calibra->CreateDetObjectT0(&object,kTRUE);
571         TObject *objtime0pad       = calibra->CreatePadObjectT0();
572         // store them
573         if(!Store("Calib","ChamberVdrift"    ,(TObject *) objdriftvelocitydet,&md1,0,kTRUE)){
574           Log("Error storing the calibration object for the chamber vdrift (HLT)");
575           error = kTRUE;                
576         }
577         if(!Store("Calib","ChamberT0"        ,(TObject *) objtime0det        ,&md1,0,kTRUE)){
578           Log("Error storing the calibration object for the chamber t0 (HLT)");
579           error = kTRUE;
580         }
581         if(!Store("Calib","LocalVdrift"      ,(TObject *) objdriftvelocitypad,&md2,0,kTRUE)){
582           Log("Error storing the calibration object for the local drift velocity (HLT)");
583           error = kTRUE;
584         }
585         if(!Store("Calib","LocalT0"          ,(TObject *) objtime0pad        ,&md2,0,kTRUE)){
586           Log("Error storing the calibration object for the local time0 (HLT)");
587           error = kTRUE;
588         }
589         fVdriftHLT = kTRUE;
590       }
591       calibra->ResetVectorFit();
592     }// if TProfile2D
593     
594     
595     // prf
596     TProfile2D *histoprf = (TProfile2D *) filehlt->Get("PRF2d");
597     histoprf->SetDirectory(0);
598     if (histoprf) {
599       // store reference data
600       if(!StoreReferenceData("HLTData","PRF",(TObject *) histoprf,&metaData)){
601         Log("Error storing the 2D Profile for Pad Response Function");
602         error = kTRUE;
603       }
604       // analyse
605       Log("Take the PRF reference data. Now we will try to fit\n");
606       calibra->SetMinEntries(600); // If there is less than 20000
607       calibra->AnalysePRFMarianFit(histoprf);
608       Int_t nbtg = 6*4*18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb0(2))
609         + 6*  18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb2(2));
610       Int_t nbfit        = calibra->GetNumberFit();
611       Int_t nbE          = calibra->GetNumberEnt();
612       // enough statistics
613       if ((nbtg >                  0) && 
614           (nbfit        >= 0.95*nbE)) {
615         // create cal pad objects 
616         TObjArray object            = calibra->GetVectorFit();
617         TObject *objPRFpad          = calibra->CreatePadObjectPRF(&object);
618         // store them
619         if(!Store("Calib","PRFWidth"         ,(TObject *) objPRFpad          ,&md2,0,kTRUE)){
620           Log("Error storing the calibration object for the Pad Response Function");
621           error = kTRUE;
622         }
623       }
624       calibra->ResetVectorFit();
625     }// if PRF
626   }// if fileNameEntry
627   
628   delete listhlt;
629   return error;
630   
631 }