1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 **************************************************************************/
19 Responsible: Raphaelle Bailhache (rbailhache@ikf.uni-frankfurt.de)
20 Code to analyze the TRD calibration and to produce OCDB entries
24 gSystem->Load("libANALYSIS");
25 gSystem->Load("libTRDcalib");
27 AliTRDPreprocessorOffline proces;
28 TString ocdbPath="local:////"
29 ocdbPath+=gSystem->GetFromPipe("pwd");
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
40 #include "Riostream.h"
50 #include "TProfile2D.h"
51 #include "AliTRDCalDet.h"
52 #include "AliTRDCalPad.h"
53 #include "AliCDBMetaData.h"
55 #include "AliCDBManager.h"
56 #include "AliCDBStorage.h"
57 #include "AliTRDCalibraMode.h"
58 #include "AliTRDCalibraFit.h"
59 #include "AliTRDCalibraVdriftLinearFit.h"
60 #include "AliTRDPreprocessorOffline.h"
61 #include "AliTRDCalChamberStatus.h"
62 #include "AliTRDCommonParam.h"
65 ClassImp(AliTRDPreprocessorOffline)
67 AliTRDPreprocessorOffline::AliTRDPreprocessorOffline():
68 TNamed("TPCPreprocessorOffline","TPCPreprocessorOffline"),
70 fNameList("TRDCalib"),
72 fCalDetVdriftUsed(0x0),
77 fAliTRDCalibraVdriftLinearFit(0x0),
80 fPlots(new TObjArray(9)),
81 fCalibObjects(new TObjArray(9)),
83 fSubVersionGainUsed(0),
84 fFirstRunVdriftUsed(0),
85 fVersionVdriftUsed(0),
86 fSubVersionVdriftUsed(0),
87 fSwitchOnValidation(kTRUE),
88 fVdriftValidated(kFALSE),
89 fExBValidated(kFALSE),
91 fMinStatsVdriftT0PH(800*20),
92 fMinStatsVdriftLinear(800),
95 fBackCorrectGain(kFALSE),
96 fBackCorrectVdrift(kTRUE),
97 fNotEnoughStatisticsForTheGain(kFALSE),
98 fNotEnoughStatisticsForTheVdriftLinear(kFALSE),
103 // default constructor
106 //_________________________________________________________________________________________________________________
107 AliTRDPreprocessorOffline::~AliTRDPreprocessorOffline() {
112 if(fCalDetGainUsed) delete fCalDetGainUsed;
113 if(fCalDetVdriftUsed) delete fCalDetVdriftUsed;
114 if(fCalDetExBUsed) delete fCalDetExBUsed;
115 if(fCH2d) delete fCH2d;
116 if(fPH2d) delete fPH2d;
117 if(fPRF2d) delete fPRF2d;
118 if(fAliTRDCalibraVdriftLinearFit) delete fAliTRDCalibraVdriftLinearFit;
119 if(fNEvents) delete fNEvents;
120 if(fAbsoluteGain) delete fAbsoluteGain;
121 if(fPlots) delete fPlots;
122 if(fCalibObjects) delete fCalibObjects;
125 //___________________________________________________________________________________________________________________
127 void AliTRDPreprocessorOffline::CalibVdriftT0(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage){
129 // make calibration of the drift velocity
131 // file - the location of input file
132 // startRunNumber, endRunNumber - run validity period
133 // ocdbStorage - path to the OCDB storage
134 // - if empty - local storage 'pwd' uesed
135 if (ocdbStorage.Length()<=0) ocdbStorage="local://"+gSystem->GetFromPipe("pwd")+"/OCDB";
139 fVdriftValidated = kTRUE;
140 fT0Validated = kTRUE;
141 fExBValidated = kTRUE;
142 fNotEnoughStatisticsForTheVdriftLinear = kFALSE;
144 // 2. extraction of the information
146 if(ReadVdriftLinearFitGlobal(file) && fCalDetVdriftUsed && fCalDetExBUsed) AnalyzeVdriftLinearFit();
147 if(ReadVdriftT0Global(file)) AnalyzeVdriftT0();
149 // 3. Append QA plots
151 //MakeDefaultPlots(fVdriftArray,fVdriftArray);
154 // 4. validate OCDB entries
156 if(fSwitchOnValidation==kTRUE && ValidateVdrift()==kFALSE) {
157 //AliError("TRD vdrift OCDB parameters out of range!");
158 fVdriftValidated = kFALSE;
160 if(fSwitchOnValidation==kTRUE && ValidateT0()==kFALSE) {
161 //AliError("TRD t0 OCDB parameters out of range!");
162 fT0Validated = kFALSE;
164 if(fSwitchOnValidation==kTRUE && ValidateExB()==kFALSE) {
165 //AliError("TRD t0 OCDB parameters out of range!");
166 fExBValidated = kFALSE;
172 if(fVdriftValidated) UpdateOCDBVdrift(startRunNumber,endRunNumber,ocdbStorage);
173 if(fT0Validated) UpdateOCDBT0(startRunNumber,endRunNumber,ocdbStorage);
174 if(fExBValidated) UpdateOCDBExB(startRunNumber,endRunNumber,ocdbStorage);
177 //_________________________________________________________________________________________________________________
179 void AliTRDPreprocessorOffline::CalibGain(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage){
181 // make calibration of the drift velocity
183 // file - the location of input file
184 // startRunNumber, endRunNumber - run validity period
185 // ocdbStorage - path to the OCDB storage
186 // - if empty - local storage 'pwd' uesed
187 if (ocdbStorage.Length()<=0) ocdbStorage="local://"+gSystem->GetFromPipe("pwd")+"/OCDB";
189 fNotEnoughStatisticsForTheGain = kFALSE;
192 if(!ReadGainGlobal(file)) return;
195 // 2. extraction of the information
198 if(fBackCorrectGain) CorrectFromDetGainUsed();
199 if(fBackCorrectVdrift) CorrectFromDetVdriftUsed();
201 // 3. Append QA plots
203 //MakeDefaultPlots(fVdriftArray,fVdriftArray);
206 // 4. validate OCDB entries
208 if(fSwitchOnValidation==kTRUE && ValidateGain()==kFALSE) {
209 //AliError("TRD gain OCDB parameters out of range!");
216 if((!fCalDetVdriftUsed) || (fCalDetVdriftUsed && fVdriftValidated)) UpdateOCDBGain(startRunNumber,endRunNumber,ocdbStorage);
220 //________________________________________________________________________________________________________________
222 void AliTRDPreprocessorOffline::CalibPRF(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage){
224 // make calibration of the drift velocity
226 // file - the location of input file
227 // startRunNumber, endRunNumber - run validity period
228 // ocdbStorage - path to the OCDB storage
229 // - if empty - local storage 'pwd' uesed
230 if (ocdbStorage.Length()<=0) ocdbStorage="local://"+gSystem->GetFromPipe("pwd")+"/OCDB";
233 if(!ReadPRFGlobal(file)) return;
236 // 2. extraction of the information
240 // 3. Append QA plots
242 //MakeDefaultPlots(fVdriftArray,fVdriftArray);
246 // 4. validate OCDB entries
248 if(fSwitchOnValidation==kTRUE && ValidatePRF()==kFALSE) {
249 //AliError("TRD prf OCDB parameters out of range!");
256 UpdateOCDBPRF(startRunNumber,endRunNumber,ocdbStorage);
259 //________________________________________________________________________________________________________________
261 void AliTRDPreprocessorOffline::CalibChamberStatus(Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage){
263 // make calibration of the chamber status
265 // startRunNumber, endRunNumber - run validity period
266 // ocdbStorage - path to the OCDB storage
267 // - if empty - local storage 'pwd' uesed
268 if (ocdbStorage.Length()<=0) ocdbStorage="local://"+gSystem->GetFromPipe("pwd")+"/OCDB";
271 // 2. extraction of the information
273 if(!AnalyzeChamberStatus()) return;
275 // 3. Append QA plots
277 //MakeDefaultPlots(fVdriftArray,fVdriftArray);
281 // 4. validate OCDB entries
283 if(fSwitchOnValidation==kTRUE && ValidateChamberStatus()==kFALSE) {
284 //AliError("TRD Chamber status OCDB parameters not ok!");
291 if((!fNotEnoughStatisticsForTheGain) && (!fNotEnoughStatisticsForTheGain)) UpdateOCDBChamberStatus(startRunNumber,endRunNumber,ocdbStorage);
294 //______________________________________________________________________________________________________
295 Bool_t AliTRDPreprocessorOffline::Init(const Char_t* fileName){
297 // read the calibration used during the reconstruction
300 if(ReadVdriftT0Global(fileName)) {
302 TString nameph = fPH2d->GetTitle();
303 fFirstRunVdriftUsed = GetFirstRun(nameph);
304 fVersionVdriftUsed = GetVersion(nameph);
305 fSubVersionVdriftUsed = GetSubVersion(nameph);
307 //printf("Found Version %d, Subversion %d for vdrift\n",fVersionVdriftUsed,fSubVersionVdriftUsed);
311 if(ReadGainGlobal(fileName)) {
313 TString namech = fCH2d->GetTitle();
314 fVersionGainUsed = GetVersion(namech);
315 fSubVersionGainUsed = GetSubVersion(namech);
317 //printf("Found Version %d, Subversion %d for gain\n",fVersionGainUsed,fSubVersionGainUsed);
321 if(fVersionVdriftUsed == 0) fStatusPos = fStatusPos |kVdriftErrorOld;
322 if(fVersionGainUsed == 0) fStatusPos = fStatusPos | kGainErrorOld;
327 //___________________________________________________________________________________________________________________
329 Bool_t AliTRDPreprocessorOffline::ReadGainGlobal(const Char_t* fileName){
331 // read calibration entries from file
333 if(fCH2d) return kTRUE;
334 TFile fcalib(fileName);
335 TObjArray * array = (TObjArray*)fcalib.Get(fNameList);
337 TH2I *ch2d = (TH2I *) array->FindObject("CH2d");
338 if(!ch2d) return kFALSE;
339 fCH2d = (TH2I*)ch2d->Clone();
340 //fNEvents = (TH1I *) array->FindObject("NEvents");
341 //fAbsoluteGain = (TH2F *) array->FindObject("AbsoluteGain");
343 TH2I *ch2d = (TH2I *) fcalib.Get("CH2d");
344 if(!ch2d) return kFALSE;
345 fCH2d = (TH2I*)ch2d->Clone();
346 //fNEvents = (TH1I *) fcalib.Get("NEvents");
347 //fAbsoluteGain = (TH2F *) fcalib.Get("AbsoluteGain");
349 fCH2d->SetDirectory(0);
350 //printf("title of CH2d %s\n",fCH2d->GetTitle());
355 //_________________________________________________________________________________________________________________
357 Bool_t AliTRDPreprocessorOffline::ReadVdriftT0Global(const Char_t* fileName){
359 // read calibration entries from file
361 if(fPH2d) return kTRUE;
362 TFile fcalib(fileName);
363 TObjArray * array = (TObjArray*)fcalib.Get(fNameList);
365 TProfile2D *ph2d = (TProfile2D *) array->FindObject("PH2d");
366 if(!ph2d) return kFALSE;
367 fPH2d = (TProfile2D*)ph2d->Clone();
368 //fNEvents = (TH1I *) array->FindObject("NEvents");
370 TProfile2D *ph2d = (TProfile2D *) fcalib.Get("PH2d");
371 if(!ph2d) return kFALSE;
372 fPH2d = (TProfile2D*)ph2d->Clone();
373 //fNEvents = (TH1I *) fcalib.Get("NEvents");
375 fPH2d->SetDirectory(0);
376 //printf("title of PH2d %s\n",fPH2d->GetTitle());
381 //___________________________________________________________________________________________________________________
383 Bool_t AliTRDPreprocessorOffline::ReadVdriftLinearFitGlobal(const Char_t* fileName){
385 // read calibration entries from file
387 if(fAliTRDCalibraVdriftLinearFit) return kTRUE;
388 TFile fcalib(fileName);
389 TObjArray * array = (TObjArray*)fcalib.Get(fNameList);
391 fAliTRDCalibraVdriftLinearFit = (AliTRDCalibraVdriftLinearFit *) array->FindObject("AliTRDCalibraVdriftLinearFit");
392 //fNEvents = (TH1I *) array->FindObject("NEvents");
394 fAliTRDCalibraVdriftLinearFit = (AliTRDCalibraVdriftLinearFit *) fcalib.Get("AliTRDCalibraVdriftLinearFit");
395 //fNEvents = (TH1I *) fcalib.Get("NEvents");
397 if(!fAliTRDCalibraVdriftLinearFit) {
398 //printf("No AliTRDCalibraVdriftLinearFit\n");
404 //_____________________________________________________________________________________________________________
406 Bool_t AliTRDPreprocessorOffline::ReadPRFGlobal(const Char_t* fileName){
408 // read calibration entries from file
410 if(fPRF2d) return kTRUE;
411 TFile fcalib(fileName);
412 TObjArray * array = (TObjArray*)fcalib.Get(fNameList);
414 TProfile2D *prf2d = (TProfile2D *) array->FindObject("PRF2d");
415 if(!prf2d) return kFALSE;
416 fPRF2d = (TProfile2D*)prf2d->Clone();
417 //fNEvents = (TH1I *) array->FindObject("NEvents");
419 TProfile2D *prf2d = (TProfile2D *) fcalib.Get("PRF2d");
420 if(!prf2d) return kFALSE;
421 fPRF2d = (TProfile2D*)prf2d->Clone();
422 //fNEvents = (TH1I *) fcalib.Get("NEvents");
424 fPRF2d->SetDirectory(0);
425 //printf("title of PRF2d %s\n",fPRF2d->GetTitle());
430 //__________________________________________________________________________________________________________
432 Bool_t AliTRDPreprocessorOffline::AnalyzeGain(){
434 // Analyze gain - produce the calibration objects
437 AliTRDCalibraFit *calibra = AliTRDCalibraFit::Instance();
438 calibra->SetMinEntries(fMinStatsGain); // If there is less than 1000 entries in the histo: no fit
439 calibra->AnalyseCH(fCH2d);
441 Int_t nbtg = 6*4*18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb0(0))
442 + 6* 18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb2(0));
443 Int_t nbfit = calibra->GetNumberFit();
444 Int_t nbE = calibra->GetNumberEnt();
448 Bool_t meanother = kFALSE;
451 (nbfit >= 0.5*nbE) && (nbE > 30)) {
452 // create the cal objects
453 if(!fBackCorrectGain) {
454 calibra->PutMeanValueOtherVectorFit(1,kTRUE);
457 TObjArray object = calibra->GetVectorFit();
458 AliTRDCalDet *calDetGain = calibra->CreateDetObjectGain(&object,meanother);
459 TH1F *coefGain = calDetGain->MakeHisto1DAsFunctionOfDet();
460 // Put them in the array
461 fCalibObjects->AddAt(calDetGain,kGain);
462 fPlots->AddAt(coefGain,kGain);
467 fNotEnoughStatisticsForTheGain = kTRUE;
468 Int_t minStatsGain = fMinStatsGain*30;
469 calibra->SetMinEntries(minStatsGain); // Because we do it for all, we increase this
470 Double_t gainoverallnotnormalized = calibra->AnalyseCHAllTogether(fCH2d);
471 if(fCalDetGainUsed && (gainoverallnotnormalized > 0.0)) {
472 AliTRDCalDet *calDetGain = new AliTRDCalDet(*fCalDetGainUsed);
473 Double_t oldmean = fCalDetGainUsed->CalcMean(kFALSE);
474 //printf("oldmean %f\n",oldmean);
476 Double_t scalefactor = calibra->GetScaleFactorGain();
477 //printf("Correction factor %f\n",gainoverallnotnormalized*scalefactor);
478 calDetGain->Multiply(gainoverallnotnormalized*scalefactor/oldmean);
479 //printf("newmean %f\n",calDetGain->CalcMean(kFALSE));
480 TH1F *coefGain = calDetGain->MakeHisto1DAsFunctionOfDet();
481 fCalibObjects->AddAt(calDetGain,kGain);
482 fPlots->AddAt(coefGain,kGain);
485 fStatusNeg = fStatusNeg | kGainNotEnoughStatsButFill;
488 fStatusPos = fStatusPos | kGainErrorOld;
492 if(gainoverallnotnormalized <= 0.0) fStatusNeg = fStatusNeg | kGainNotEnoughStatsNotFill;
493 if(!fCalDetGainUsed) fStatusPos = fStatusPos | kGainErrorOld;
497 calibra->ResetVectorFit();
502 //_____________________________________________________________________________________________________
503 Bool_t AliTRDPreprocessorOffline::AnalyzeVdriftT0(){
505 // Analyze VdriftT0 - produce the calibration objects
508 AliTRDCalibraFit *calibra = AliTRDCalibraFit::Instance();
509 calibra->SetMinEntries(fMinStatsVdriftT0PH); // If there is less than 1000 entries in the histo: no fit
510 calibra->AnalysePH(fPH2d);
512 Int_t nbtg = 6*4*18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb0(1))
513 + 6* 18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb2(1));
514 Int_t nbfit = calibra->GetNumberFit();
515 Int_t nbfitSuccess = calibra->GetNumberFitSuccess();
516 Int_t nbE = calibra->GetNumberEnt();
518 //printf("nbtg %d, nbfit %d, nbE %d, nbfitSuccess %d\n",nbtg,nbfit,nbE,nbfitSuccess);
522 (nbfit >= 0.5*nbE) && (nbE > 30) && (nbfitSuccess > 30)) {
523 //printf("Pass the cut for VdriftT0\n");
524 // create the cal objects
525 calibra->RemoveOutliers(1,kFALSE);
526 calibra->PutMeanValueOtherVectorFit(1,kFALSE);
527 calibra->RemoveOutliers2(kFALSE);
528 calibra->PutMeanValueOtherVectorFit2(1,kFALSE);
530 TObjArray object = calibra->GetVectorFit();
531 AliTRDCalDet *calDetVdrift = calibra->CreateDetObjectVdrift(&object);
532 TH1F *coefVdriftPH = calDetVdrift->MakeHisto1DAsFunctionOfDet();
533 AliTRDCalPad *calPadVdrift = (AliTRDCalPad *)calibra->CreatePadObjectVdrift(&object,calDetVdrift);
534 TH1F *coefPadVdrift = calPadVdrift->MakeHisto1D();
535 object = calibra->GetVectorFit2();
536 AliTRDCalDet *calDetT0 = calibra->CreateDetObjectT0(&object);
537 TH1F *coefT0 = calDetT0->MakeHisto1DAsFunctionOfDet();
538 AliTRDCalPad *calPadT0 = (AliTRDCalPad *)calibra->CreatePadObjectT0(&object,calDetT0);
539 TH1F *coefPadT0 = calPadT0->MakeHisto1D();
540 // Put them in the array
541 fCalibObjects->AddAt(calDetT0,kT0PHDet);
542 fCalibObjects->AddAt(calDetVdrift,kVdriftPHDet);
543 fCalibObjects->AddAt(calPadT0,kT0PHPad);
544 fCalibObjects->AddAt(calPadVdrift,kVdriftPHPad);
545 fPlots->AddAt(coefVdriftPH,kVdriftPHDet);
546 fPlots->AddAt(coefT0,kT0PHDet);
547 fPlots->AddAt(coefPadVdrift,kVdriftPHPad);
548 fPlots->AddAt(coefPadT0,kT0PHPad);
553 //printf("Not enough stats timeoffset\n");
554 fStatusNeg = fStatusNeg | kTimeOffsetNotEnoughStatsNotFill;
556 calibra->ResetVectorFit();
561 //____________________________________________________________________________________________________________________
562 Bool_t AliTRDPreprocessorOffline::AnalyzeVdriftLinearFit(){
564 // Analyze vdrift linear fit - produce the calibration objects
567 //printf("Analyse linear fit\n");
570 AliTRDCalibraFit *calibra = AliTRDCalibraFit::Instance();
571 calibra->SetCalDetVdriftExB(fCalDetVdriftUsed,fCalDetExBUsed);
572 calibra->SetMinEntries(fMinStatsVdriftLinear); // If there is less than 1000 entries in the histo: no fit
573 //printf("Fill PE Array\n");
574 fAliTRDCalibraVdriftLinearFit->FillPEArray();
575 //printf("AliTRDCalibraFit\n");
576 calibra->AnalyseLinearFitters(fAliTRDCalibraVdriftLinearFit);
580 Int_t nbfit = calibra->GetNumberFit();
581 Int_t nbE = calibra->GetNumberEnt();
586 if ((nbfit >= 0.5*nbE) && (nbE > 30)) {
587 // create the cal objects
588 //calibra->RemoveOutliers(1,kTRUE);
589 calibra->PutMeanValueOtherVectorFit(1,kTRUE);
590 //calibra->RemoveOutliers2(kTRUE);
591 calibra->PutMeanValueOtherVectorFit2(1,kTRUE);
593 TObjArray object = calibra->GetVectorFit();
594 AliTRDCalDet *calDetVdrift = calibra->CreateDetObjectVdrift(&object,kTRUE);
595 TH1F *coefDriftLinear = calDetVdrift->MakeHisto1DAsFunctionOfDet();
596 object = calibra->GetVectorFit2();
597 AliTRDCalDet *calDetLorentz = calibra->CreateDetObjectLorentzAngle(&object);
598 TH1F *coefLorentzAngle = calDetLorentz->MakeHisto1DAsFunctionOfDet();
599 //if(!calDetLorentz) printf("No lorentz created\n");
600 // Put them in the array
601 fCalibObjects->AddAt(calDetVdrift,kVdriftLinear);
602 fCalibObjects->AddAt(calDetLorentz,kLorentzLinear);
603 fPlots->AddAt(coefDriftLinear,kVdriftLinear);
604 fPlots->AddAt(coefLorentzAngle,kLorentzLinear);
609 fNotEnoughStatisticsForTheVdriftLinear = kTRUE;
610 Int_t minNumberOfEntriesForAll = fMinStatsVdriftLinear*30;
611 calibra->SetMinEntries(minNumberOfEntriesForAll); // Because we do it for all, we increase this
612 Double_t vdriftoverall = -100.0;
613 Double_t exboverall = 100.0;
614 calibra->AnalyseLinearFittersAllTogether(fAliTRDCalibraVdriftLinearFit,vdriftoverall,exboverall);
615 //printf("Found mean vdrift %f and exb %f\n",vdriftoverall,exboverall);
616 if(fCalDetVdriftUsed && (vdriftoverall > 0.0) && (exboverall < 70.0)) {
617 AliTRDCalDet *calDetVdrift = new AliTRDCalDet(*fCalDetVdriftUsed);
618 AliTRDCalDet *calDetLorentz = new AliTRDCalDet(*fCalDetExBUsed);
619 Double_t oldmeanvdrift = fCalDetVdriftUsed->CalcMean(kFALSE);
620 Double_t oldmeanexb = fCalDetExBUsed->CalcMean(kFALSE);
621 //printf("oldmean %f\n",oldmean);
622 if((oldmeanvdrift > 0.0) && (oldmeanexb < 70.0)) {
623 //printf("Correction factor %f\n",vdriftoverall);
624 calDetVdrift->Multiply(vdriftoverall/oldmeanvdrift);
625 calDetLorentz->Multiply(exboverall/oldmeanexb);
626 //printf("newmean %f\n",calDetVdrift->CalcMean(kFALSE));
627 TH1F *coefDriftLinear = calDetVdrift->MakeHisto1DAsFunctionOfDet();
628 TH1F *coefLorentzAngle = calDetLorentz->MakeHisto1DAsFunctionOfDet();
629 // Put them in the array
630 fCalibObjects->AddAt(calDetVdrift,kVdriftLinear);
631 fCalibObjects->AddAt(calDetLorentz,kLorentzLinear);
632 fPlots->AddAt(coefDriftLinear,kVdriftLinear);
633 fPlots->AddAt(coefLorentzAngle,kLorentzLinear);
636 fStatusNeg = fStatusNeg | kVdriftNotEnoughStatsButFill;
639 if(oldmeanvdrift) fStatusPos = fStatusPos | kVdriftErrorOld;
640 if(oldmeanexb) fStatusPos = fStatusPos | kExBErrorOld;
644 if((vdriftoverall <= 0.0) && (exboverall > 70.0)) fStatusNeg = fStatusNeg | kVdriftNotEnoughStatsNotFill;
645 if(!fCalDetVdriftUsed) fStatusPos = fStatusPos | kVdriftErrorOld;
646 if(!fCalDetExBUsed) fStatusPos = fStatusPos | kExBErrorOld;
650 calibra->ResetVectorFit();
655 //________________________________________________________________________________________________________________
657 Bool_t AliTRDPreprocessorOffline::AnalyzePRF(){
659 // Analyze PRF - produce the calibration objects
662 AliTRDCalibraFit *calibra = AliTRDCalibraFit::Instance();
663 calibra->SetMinEntries(fMinStatsPRF); // If there is less than 1000 entries in the histo: no fit
664 calibra->AnalysePRFMarianFit(fPRF2d);
666 Int_t nbtg = 6*4*18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb0(2))
667 + 6* 18*((Int_t) ((AliTRDCalibraMode *)calibra->GetCalibraMode())->GetDetChamb2(2));
668 Int_t nbfit = calibra->GetNumberFit();
669 Int_t nbE = calibra->GetNumberEnt();
675 (nbfit >= 0.95*nbE) && (nbE > 30)) {
676 // create the cal objects
677 TObjArray object = calibra->GetVectorFit();
678 AliTRDCalPad *calPadPRF = (AliTRDCalPad*) calibra->CreatePadObjectPRF(&object);
679 TH1F *coefPRF = calPadPRF->MakeHisto1D();
680 // Put them in the array
681 fCalibObjects->AddAt(calPadPRF,kPRF);
682 fPlots->AddAt(coefPRF,kPRF);
687 calibra->ResetVectorFit();
693 //_____________________________________________________________________________
694 Bool_t AliTRDPreprocessorOffline::AnalyzeChamberStatus()
697 // Produce AliTRDCalChamberStatus out of calibration results
700 // set up AliTRDCalChamberStatus
701 AliTRDCalChamberStatus *CalChamberStatus = new AliTRDCalChamberStatus();
702 for(Int_t det = 0; det < 540; det++) CalChamberStatus->SetStatus(det,1);
704 // get calibration objects
705 AliTRDCalDet *calDetGain = (AliTRDCalDet *) fCalibObjects->At(kGain);
706 AliTRDCalDet *calDetVDrift = (AliTRDCalDet *) fCalibObjects->At(kVdriftLinear);
707 AliTRDCalDet *calDetExB = (AliTRDCalDet *) fCalibObjects->At(kLorentzLinear);
710 if((!calDetGain) || (!calDetVDrift) || (!fCH2d) || (!calDetExB)) return kFALSE;
713 Double_t gainmean = calDetGain->GetMean();
714 Double_t vdriftmean = calDetVDrift->GetMean();
715 Double_t exbmean = calDetExB->GetMean();
717 Double_t gainrms = calDetGain->GetRMSRobust();
718 Double_t vdriftrms = calDetVDrift->GetRMSRobust();
719 Double_t exbrms = calDetExB->GetRMSRobust();
721 //printf("Gain mean: %f, rms: %f\n",gainmean,gainrms);
722 //printf("Vdrift mean: %f, rms: %f\n",vdriftmean,vdriftrms);
723 //printf("ExB mean: %f, rms: %f\n",exbmean,exbrms);
726 if((TMath::Abs(gainrms) < 0.001) || (TMath::Abs(vdriftrms) < 0.001) || (TMath::Abs(exbrms) < 0.0000001)) return kFALSE;
728 // mask chambers with empty gain entries
730 for (Int_t idet = 0; idet < 540; idet++) {
733 TH1I *projch = (TH1I *) fCH2d->ProjectionX("projch",idet+1,idet+1,(Option_t *)"e");
734 Double_t entries = projch->GetEntries();
737 Double_t gain = calDetGain->GetValue(idet);
740 Double_t vdrift = calDetVDrift->GetValue(idet);
743 Double_t exb = calDetExB->GetValue(idet);
747 TMath::Abs(gainmean-gain) > (15.0*gainrms) ||
748 TMath::Abs(vdriftmean-vdrift) > (15.0*vdriftrms) ||
749 TMath::Abs(exbmean-exb) > (50.0*exbrms)) {
751 //printf(" chamber det %03d masked \n",idet);
752 //printf(" gainmean %f and gain %f, gainrms %f \n",gainmean,gain,gainrms);
753 //printf(" vdriftmean %f and vdrift %f, vdriftrms %f \n",vdriftmean,vdrift,vdriftrms);
754 //printf(" exbmean %f and exb %f, exbrms %f \n",exbmean,exb,exbrms);
756 CalChamberStatus->SetStatus(idet,AliTRDCalChamberStatus::kMasked);
761 // installed supermodules+1 -> abort
762 if(counter > (7+1)*30) {
763 printf("ERROR: more than one SM to be masked!! \n Abort...\n");
764 if(projch) delete projch;
774 for(Int_t sm=0; sm < 18; sm++) {
776 for(Int_t det = 0; det < 30; det++){
777 Int_t detector = sm*30+det;
778 if(CalChamberStatus->IsMasked(detector)) counter++;
781 for(Int_t det = 0; det < 30; det++){
782 Int_t detector = sm*30+det;
783 CalChamberStatus->SetStatus(detector,AliTRDCalChamberStatus::kInstalled);
788 fCalibObjects->AddAt(CalChamberStatus,kChamberStatus);
794 //________________________________________________________________________________________________
795 void AliTRDPreprocessorOffline::CorrectFromDetGainUsed() {
797 // Correct from the gas gain used afterwards
799 AliTRDCalDet *calDetGain = (AliTRDCalDet *) fCalibObjects->At(kGain);
800 if(!calDetGain) return;
806 for(Int_t det = 0; det < 540; det++) {
808 Float_t gaininit = fCalDetGainUsed->GetValue(det);
809 Float_t gainout = calDetGain->GetValue(det);
812 if(TMath::Abs(gainout-1.0) > 0.000001) {
813 mean += (gaininit*gainout);
817 if(nbdet > 0) mean = mean/nbdet;
819 for(Int_t det = 0; det < 540; det++) {
821 Float_t gaininit = fCalDetGainUsed->GetValue(det);
822 Float_t gainout = calDetGain->GetValue(det);
824 if(TMath::Abs(gainout-1.0) > 0.000001) {
825 Double_t newgain = gaininit*gainout;
826 if(newgain < 0.1) newgain = 0.1;
827 if(newgain > 1.9) newgain = 1.9;
828 calDetGain->SetValue(det,newgain);
831 Double_t newgain = mean;
832 if(newgain < 0.1) newgain = 0.1;
833 if(newgain > 1.9) newgain = 1.9;
834 calDetGain->SetValue(det,newgain);
840 //________________________________________________________________________________________________
841 void AliTRDPreprocessorOffline::CorrectFromDetVdriftUsed() {
843 // Correct from the drift velocity
846 //printf("Correct for vdrift\n");
848 AliTRDCalDet *calDetGain = (AliTRDCalDet *) fCalibObjects->At(kGain);
849 if(!calDetGain) return;
851 Int_t detVdrift = kVdriftPHDet;
852 if(fMethodSecond) detVdrift = kVdriftLinear;
853 AliTRDCalDet *calDetVdrift = (AliTRDCalDet *) fCalibObjects->At(detVdrift);
854 if(!calDetVdrift) return;
857 if(!fNotEnoughStatisticsForTheVdriftLinear) {
858 for(Int_t det = 0; det < 540; det++) {
860 Float_t vdriftinit = fCalDetVdriftUsed->GetValue(det);
861 Float_t vdriftout = calDetVdrift->GetValue(det);
863 Float_t gain = calDetGain->GetValue(det);
864 if(vdriftout > 0.0) gain = gain*vdriftinit/vdriftout;
865 if(gain < 0.1) gain = 0.1;
866 if(gain > 1.9) gain = 1.9;
867 calDetGain->SetValue(det,gain);
872 Float_t vdriftinit = fCalDetVdriftUsed->CalcMean(kFALSE);
873 Float_t vdriftout = calDetVdrift->CalcMean(kFALSE);
874 Float_t factorcorrectif = 1.0;
875 if(vdriftout > 0.0) factorcorrectif = vdriftinit/vdriftout;
876 for(Int_t det = 0; det < 540; det++) {
877 Float_t gain = calDetGain->GetValue(det);
878 gain = gain*factorcorrectif;
879 if(gain < 0.1) gain = 0.1;
880 if(gain > 1.9) gain = 1.9;
881 calDetGain->SetValue(det,gain);
887 //_________________________________________________________________________________________________________________
888 void AliTRDPreprocessorOffline::UpdateOCDBGain(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath){
893 AliCDBMetaData *metaData= new AliCDBMetaData();
894 metaData->SetObjectClassName("AliTRDCalDet");
895 metaData->SetResponsible("Raphaelle Bailhache");
896 metaData->SetBeamPeriod(1);
898 AliCDBId id1("TRD/Calib/ChamberGainFactor", startRunNumber, endRunNumber);
899 AliCDBStorage * gStorage = AliCDBManager::Instance()->GetStorage(storagePath);
900 AliTRDCalDet *calDet = (AliTRDCalDet *) fCalibObjects->At(kGain);
901 if(calDet) gStorage->Put(calDet, id1, metaData);
905 //___________________________________________________________________________________________________________________
906 void AliTRDPreprocessorOffline::UpdateOCDBExB(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath){
911 Int_t detExB = kLorentzLinear;
912 if(!fMethodSecond) return;
916 AliCDBMetaData *metaData= new AliCDBMetaData();
917 metaData->SetObjectClassName("AliTRDCalDet");
918 metaData->SetResponsible("Raphaelle Bailhache");
919 metaData->SetBeamPeriod(1);
921 AliCDBId id1("TRD/Calib/ChamberExB", startRunNumber, endRunNumber);
922 AliCDBStorage * gStorage = AliCDBManager::Instance()->GetStorage(storagePath);
923 AliTRDCalDet *calDet = (AliTRDCalDet *) fCalibObjects->At(detExB);
924 if(calDet) gStorage->Put(calDet, id1, metaData);
925 //if(!calDet) printf("No caldet\n");
928 //___________________________________________________________________________________________________________________
929 void AliTRDPreprocessorOffline::UpdateOCDBVdrift(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath){
934 Int_t detVdrift = kVdriftPHDet;
936 if(fMethodSecond) detVdrift = kVdriftLinear;
938 AliCDBMetaData *metaData= new AliCDBMetaData();
939 metaData->SetObjectClassName("AliTRDCalDet");
940 metaData->SetResponsible("Raphaelle Bailhache");
941 metaData->SetBeamPeriod(1);
943 AliCDBId id1("TRD/Calib/ChamberVdrift", startRunNumber, endRunNumber);
944 AliCDBStorage * gStorage = AliCDBManager::Instance()->GetStorage(storagePath);
945 AliTRDCalDet *calDet = (AliTRDCalDet *) fCalibObjects->At(detVdrift);
946 if(calDet) gStorage->Put(calDet, id1, metaData);
952 AliCDBMetaData *metaDataPad= new AliCDBMetaData();
953 metaDataPad->SetObjectClassName("AliTRDCalPad");
954 metaDataPad->SetResponsible("Raphaelle Bailhache");
955 metaDataPad->SetBeamPeriod(1);
957 AliCDBId id1Pad("TRD/Calib/LocalVdrift", startRunNumber, endRunNumber);
958 AliTRDCalPad *calPad = (AliTRDCalPad *) fCalibObjects->At(kVdriftPHPad);
959 if(calPad) gStorage->Put(calPad, id1Pad, metaDataPad);
964 //________________________________________________________________________________________________________________________
965 void AliTRDPreprocessorOffline::UpdateOCDBT0(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath){
970 AliCDBMetaData *metaData= new AliCDBMetaData();
971 metaData->SetObjectClassName("AliTRDCalDet");
972 metaData->SetResponsible("Raphaelle Bailhache");
973 metaData->SetBeamPeriod(1);
975 AliCDBId id1("TRD/Calib/ChamberT0", startRunNumber, endRunNumber);
976 AliCDBStorage * gStorage = AliCDBManager::Instance()->GetStorage(storagePath);
977 AliTRDCalDet *calDet = (AliTRDCalDet *) fCalibObjects->At(kT0PHDet);
978 if(calDet) gStorage->Put(calDet, id1, metaData);
982 AliCDBMetaData *metaDataPad= new AliCDBMetaData();
983 metaDataPad->SetObjectClassName("AliTRDCalPad");
984 metaDataPad->SetResponsible("Raphaelle Bailhache");
985 metaDataPad->SetBeamPeriod(1);
987 AliCDBId id1Pad("TRD/Calib/LocalT0", startRunNumber, endRunNumber);
988 AliTRDCalPad *calPad = (AliTRDCalPad *) fCalibObjects->At(kT0PHPad);
989 if(calPad) gStorage->Put(calPad, id1Pad, metaDataPad);
994 //_________________________________________________________________________________________________________________
995 void AliTRDPreprocessorOffline::UpdateOCDBPRF(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath){
1000 AliCDBMetaData *metaData= new AliCDBMetaData();
1001 metaData->SetObjectClassName("AliTRDCalPad");
1002 metaData->SetResponsible("Raphaelle Bailhache");
1003 metaData->SetBeamPeriod(1);
1005 AliCDBId id1("TRD/Calib/PRFWidth", startRunNumber, endRunNumber);
1006 AliCDBStorage * gStorage = AliCDBManager::Instance()->GetStorage(storagePath);
1007 AliTRDCalPad *calPad = (AliTRDCalPad *) fCalibObjects->At(kPRF);
1008 if(calPad) gStorage->Put(calPad, id1, metaData);
1012 //_________________________________________________________________________________________________________________
1013 void AliTRDPreprocessorOffline::UpdateOCDBChamberStatus(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath){
1015 // Update OCDB entry
1018 AliCDBMetaData *metaData= new AliCDBMetaData();
1019 metaData->SetObjectClassName("AliTRDCalChamberStatus");
1020 metaData->SetResponsible("Raphaelle Bailhache");
1021 metaData->SetBeamPeriod(1);
1023 AliCDBId id1("TRD/Calib/ChamberStatus", startRunNumber, endRunNumber);
1024 AliCDBStorage * gStorage = AliCDBManager::Instance()->GetStorage(storagePath);
1025 AliTRDCalChamberStatus *calChamberStatus = (AliTRDCalChamberStatus *) fCalibObjects->At(kChamberStatus);
1026 if(calChamberStatus) gStorage->Put(calChamberStatus, id1, metaData);
1030 //__________________________________________________________________________________________________________________________
1031 Bool_t AliTRDPreprocessorOffline::ValidateGain() {
1033 // Validate OCDB entry
1036 AliTRDCalDet *calDet = (AliTRDCalDet *) fCalibObjects->At(kGain);
1038 Double_t mean = calDet->GetMean();
1039 Double_t rms = calDet->GetRMSRobust();
1040 if((mean > 0.2) && (mean < 1.4) && (rms < 0.5)) return kTRUE;
1041 //if((mean > 0.2) && (mean < 1.4)) return kTRUE;
1043 fStatusPos = fStatusPos | kGainErrorRange;
1052 //__________________________________________________________________________________________________________________________
1053 Bool_t AliTRDPreprocessorOffline::ValidateVdrift(){
1055 // Update OCDB entry
1058 Int_t detVdrift = kVdriftPHDet;
1061 if(fMethodSecond) detVdrift = kVdriftLinear;
1063 AliTRDCalDet *calDet = (AliTRDCalDet *) fCalibObjects->At(detVdrift);
1065 Double_t mean = calDet->GetMean();
1066 Double_t rms = calDet->GetRMSRobust();
1067 //printf("Vdrift::mean %f, rms %f\n",mean,rms);
1068 if(!((mean > 1.0) && (mean < 2.0) && (rms < 0.5))) {
1069 fStatusPos = fStatusPos | kVdriftErrorRange;
1075 if(!fMethodSecond) {
1076 AliTRDCalPad *calPad = (AliTRDCalPad *) fCalibObjects->At(kVdriftPHPad);
1078 Double_t mean = calPad->GetMean();
1079 Double_t rms = calPad->GetRMS();
1080 //printf("Vdrift::meanpad %f, rmspad %f\n",mean,rms);
1081 if(!((mean > 0.9) && (mean < 1.1) && (rms < 0.6))) {
1082 fStatusPos = fStatusPos | kVdriftErrorRange;
1092 //__________________________________________________________________________________________________________________________
1093 Bool_t AliTRDPreprocessorOffline::ValidateExB(){
1095 // Update OCDB entry
1098 AliTRDCalDet *calDet = (AliTRDCalDet *) fCalibObjects->At(kLorentzLinear);
1100 Double_t mean = calDet->GetMean();
1101 Double_t rms = calDet->GetRMSRobust();
1102 //printf("Vdrift::mean %f, rms %f\n",mean,rms);
1103 if(!((mean > -1.0) && (mean < 1.0) && (rms < 0.5))) {
1104 fStatusNeg = fStatusNeg | kExBErrorRange;
1112 //__________________________________________________________________________________________________________________________
1113 Bool_t AliTRDPreprocessorOffline::ValidateT0(){
1115 // Update OCDB entry
1118 AliTRDCalDet *calDet = (AliTRDCalDet *) fCalibObjects->At(kT0PHDet);
1119 AliTRDCalPad *calPad = (AliTRDCalPad *) fCalibObjects->At(kT0PHPad);
1120 if(calDet && calPad) {
1121 Double_t meandet = calDet->GetMean();
1122 Double_t rmsdet = calDet->GetRMSRobust();
1123 Double_t meanpad = calPad->GetMean();
1124 //Double_t rmspad = calPad->GetRMS();
1125 //printf("T0::minimum %f, rmsdet %f,meanpad %f, rmspad %f\n",meandet,rmsdet,meanpad,rmspad);
1126 if((meandet > -1.5) && (meandet < 5.0) && (rmsdet < 4.0) && (meanpad < 5.0) && (meanpad > -0.5)) return kTRUE;
1128 fStatusPos = fStatusPos | kTimeOffsetErrorRange;
1135 //__________________________________________________________________________________________________________________________
1136 Bool_t AliTRDPreprocessorOffline::ValidatePRF() const{
1138 // Update OCDB entry
1141 AliTRDCalPad *calPad = (AliTRDCalPad *) fCalibObjects->At(kPRF);
1143 Double_t meanpad = calPad->GetMean();
1144 Double_t rmspad = calPad->GetRMS();
1145 //printf("PRF::meanpad %f, rmspad %f\n",meanpad,rmspad);
1146 if((meanpad < 1.0) && (rmspad < 0.8)) return kTRUE;
1153 //__________________________________________________________________________________________________________________________
1154 Bool_t AliTRDPreprocessorOffline::ValidateChamberStatus(){
1156 // Update OCDB entry
1159 AliTRDCalChamberStatus *calChamberStatus = (AliTRDCalChamberStatus *) fCalibObjects->At(kChamberStatus);
1160 if(calChamberStatus) {
1161 Int_t detectormasked = 0;
1162 for(Int_t det = 0; det < 540; det++) {
1163 if(calChamberStatus->IsMasked(det)) detectormasked++;
1165 //printf("Number of chambers masked %d\n",detectormasked);
1166 if(detectormasked > 40) {
1167 fStatusPos = fStatusPos | kChamberStatusErrorRange;
1175 //_____________________________________________________________________________
1176 Int_t AliTRDPreprocessorOffline::GetVersion(TString name) const
1179 // Get version from the title
1183 const Char_t *version = "Ver";
1184 if(!strstr(name.Data(),version)) return -1;
1185 const Char_t *after = "Subver";
1186 if(!strstr(name.Data(),after)) return -1;
1188 for(Int_t ver = 0; ver < 999999999; ver++) {
1190 TString vertry(version);
1194 //printf("vertry %s and name %s\n",vertry.Data(),name.Data());
1196 if(strstr(name.Data(),vertry.Data())) return ver;
1204 //_____________________________________________________________________________
1205 Int_t AliTRDPreprocessorOffline::GetSubVersion(TString name) const
1208 // Get subversion from the title
1212 const Char_t *subversion = "Subver";
1213 if(!strstr(name.Data(),subversion)) return -1;
1214 const Char_t *after = "FirstRun";
1215 if(!strstr(name.Data(),after)) {
1218 if(!strstr(name.Data(),after)) return -1;
1221 for(Int_t ver = 0; ver < 999999999; ver++) {
1223 TString vertry(subversion);
1227 //printf("vertry %s and name %s\n",vertry.Data(),name.Data());
1229 if(strstr(name.Data(),vertry.Data())) return ver;
1237 //_____________________________________________________________________________
1238 Int_t AliTRDPreprocessorOffline::GetFirstRun(TString name) const
1241 // Get first run from the title
1245 const Char_t *firstrun = "FirstRun";
1246 if(!strstr(name.Data(),firstrun)) return -1;
1247 const Char_t *after = "Nz";
1248 if(!strstr(name.Data(),after)) return -1;
1251 for(Int_t ver = 0; ver < 999999999; ver++) {
1253 TString vertry(firstrun);
1257 //printf("vertry %s and name %s\n",vertry.Data(),name.Data());
1259 if(strstr(name.Data(),vertry.Data())) return ver;
1266 //_____________________________________________________________________________
1267 Bool_t AliTRDPreprocessorOffline::CheckStatus(Int_t status, Int_t bitMask) const
1270 // Checks the status
1273 return (status & bitMask) ? kTRUE : kFALSE;
1276 //_____________________________________________________________________________
1277 Int_t AliTRDPreprocessorOffline::GetStatus() const
1280 // Checks the status
1281 // fStatusPos: errors
1282 // fStatusNeg: only info
1285 if(fStatusPos > 0) return fStatusPos;
1286 else return (-TMath::Abs(fStatusNeg));
1289 //_____________________________________________________________________________
1290 void AliTRDPreprocessorOffline::PrintStatus() const
1296 AliInfo(Form("The error status is %d",fStatusPos));
1297 AliInfo(Form("IsGainErrorOld? %d",(Int_t)IsGainErrorOld()));
1298 AliInfo(Form("IsVdriftErrorOld? %d",(Int_t)IsVdriftErrorOld()));
1299 AliInfo(Form("IsGainErrorRange? %d",(Int_t)IsGainErrorRange()));
1300 AliInfo(Form("IsVdriftErrorRange? %d",(Int_t)IsVdriftErrorRange()));
1301 AliInfo(Form("IsTimeOffsetErrorRange? %d",(Int_t)IsTimeOffsetErrorRange()));
1302 AliInfo(Form("IsChamberStatusErrorRange? %d",(Int_t)IsChamberStatusErrorRange()));
1305 AliInfo(Form("The info status is %d",fStatusNeg));
1306 AliInfo(Form("IsGainNotEnoughStatsButFill? %d",(Int_t)IsGainNotEnoughStatsButFill()));
1307 AliInfo(Form("IsVdriftNotEnoughStatsButFill? %d",(Int_t)IsVdriftNotEnoughStatsButFill()));
1308 AliInfo(Form("IsGainNotEnoughStatsNotFill? %d",(Int_t)IsGainNotEnoughStatsNotFill()));
1309 AliInfo(Form("IsVdriftNotEnoughStatsNotFill? %d",(Int_t)IsVdriftNotEnoughStatsNotFill()));
1310 AliInfo(Form("IsTimeOffsetNotEnoughStatsNotFill? %d",(Int_t)IsTimeOffsetNotEnoughStatsNotFill()));
1312 AliInfo(Form("IsExBErrorRange? %d",(Int_t)IsExBErrorRange()));
1313 AliInfo(Form("IsExBErrorOld? %d",(Int_t)IsExBErrorOld()));
1316 //___________________________________________________________________________________
1317 void AliTRDPreprocessorOffline::SetCalDetVdrift(AliTRDCalDet *calDetVdriftUsed)
1320 fCalDetVdriftUsed = calDetVdriftUsed;
1322 fCalDetExBUsed = new AliTRDCalDet("lorentz angle tan","lorentz angle tan (detector value)");
1323 for(Int_t k = 0; k < 540; k++){
1324 fCalDetExBUsed->SetValue(k,AliTRDCommonParam::Instance()->GetOmegaTau(fCalDetVdriftUsed->GetValue(k)));
1325 //printf("Set the exb object for detector %d, vdrift %f and exb %f\n",k,fCalDetVdriftUsed->GetValue(k),fCalDetExBUsed->GetValue(k));