,fCalROC(0x0)
,fCalDet2(0x0)
,fCalROC2(0x0)
+ ,fCalDetVdriftUsed(0x0)
+ ,fCalDetExBUsed(0x0)
,fCurrentCoefDetector(0x0)
,fCurrentCoefDetector2(0x0)
,fVectorFit(0)
,fCalROC(0x0)
,fCalDet2(0x0)
,fCalROC2(0x0)
+,fCalDetVdriftUsed(0x0)
+,fCalDetExBUsed(0x0)
,fCurrentCoefDetector(0x0)
,fCurrentCoefDetector2(0x0)
,fVectorFit(0)
if(c.fCalROC) fCalROC = new AliTRDCalROC(*c.fCalROC);
if(c.fCalROC2) fCalROC = new AliTRDCalROC(*c.fCalROC2);
+ if(c.fCalDetVdriftUsed) fCalDetVdriftUsed = new AliTRDCalDet(*c.fCalDetVdriftUsed);
+ if(c.fCalDetExBUsed) fCalDetExBUsed = new AliTRDCalDet(*c.fCalDetExBUsed);
+
fVectorFit.SetName(c.fVectorFit.GetName());
for(Int_t k = 0; k < c.fVectorFit.GetEntriesFast(); k++){
AliTRDFitInfo *fitInfo = new AliTRDFitInfo();
if ( fCalDet2 ) delete fCalDet2;
if ( fCalROC ) delete fCalROC;
if ( fCalROC2 ) delete fCalROC2;
+ if ( fCalDetVdriftUsed) delete fCalDetVdriftUsed;
+ if ( fCalDetExBUsed) delete fCalDetExBUsed;
if( fCurrentCoefDetector ) delete [] fCurrentCoefDetector;
if( fCurrentCoefDetector2 ) delete [] fCurrentCoefDetector2;
fVectorFit.Delete();
// CalculDatabaseVdriftandTan
CalculVdriftLorentzCoef();
+ //printf("AliTRDCalibraFit::AnalyzeVdriftLinearFit detector %d, vdrift %f and %f and exB %f and %f\n",idet,fCalDetVdriftUsed->GetValue(idet),fCurrentCoef[1],fCalDetExBUsed->GetValue(idet),fCurrentCoef2[1]);
// Statistics
fNumberFitSuccess ++;
}
//____________Functions fit Online CH2d________________________________________
-Double_t AliTRDCalibraFit::AnalyseLinearFittersAllTogether(AliTRDCalibraVdriftLinearFit *calivdli)
+void AliTRDCalibraFit::AnalyseLinearFittersAllTogether(AliTRDCalibraVdriftLinearFit *calivdli, Double_t &vdriftoverall, Double_t &exboverall)
{
//
// The linear method
//
+ // Get the mean vdrift and exb used
+ Double_t meanvdriftused = 0.0;
+ Double_t meanexbused = 0.0;
+ Double_t counterdet = 0.0;
+ if((!fCalDetVdriftUsed) || (!fCalDetExBUsed)) {
+ vdriftoverall = -100.0;
+ exboverall = 100.0;
+ return;
+ }
+
// Add histos
TH2S *linearfitterhisto = 0x0;
for(Int_t idet = 0; idet < 540; idet++){
TH2S * u = calivdli->GetLinearFitterHistoForce(idet);
+ Double_t detectorentries = u->Integral();
+ meanvdriftused += fCalDetVdriftUsed->GetValue(idet)*detectorentries;
+ meanexbused += fCalDetExBUsed->GetValue(idet)*detectorentries;
+ counterdet += detectorentries;
+
+ //printf("detectorentries %f\n",detectorentries);
+
+ //printf("AliTRDCalibraFit::AnalyzeVdriftLinearFitsAllTogether detector %d, vdrift %f and exB %f\n",idet,fCalDetVdriftUsed->GetValue(idet),fCalDetExBUsed->GetValue(idet));
+
if(idet == 0) linearfitterhisto = u;
else linearfitterhisto->Add(u);
}
+ if(counterdet > 0.0){
+ meanvdriftused = meanvdriftused/counterdet;
+ meanexbused = meanexbused/counterdet;
+ }
+ else {
+ vdriftoverall = -100.0;
+ exboverall = 100.0;
+ return;
+ }
+
+
+ //printf("AliTRDCalibraFit::AnalyzeVdriftLinearFitsAllTogether MEAN vdrift %f and exB %f\n",meanvdriftused,meanexbused);
// Fit
//printf("AnalyseLinearFittersAllTogether::Find %d entries\n",entries);
//printf("Minstats %d\n",fMinEntries);
- // Eval the linear fitter
+
+
+ // Eval the linear fitter
if(entries > fMinEntries){
TVectorD par = TVectorD(2);
//printf("Fit\n");
//printf("Take the param\n");
linearfitter.GetParameters(par);
//printf("Done\n");
- par.Print();
+ //par.Print();
//printf("Finish\n");
// Put the fCurrentCoef
fCurrentCoef[0] = -par[1];
// here the database must be the one of the reconstruction for the lorentz angle....
- fCurrentCoef2[0] = (par[0]+fCurrentCoef[1]*fCurrentCoef2[1])/fCurrentCoef[0];
+ if(fCurrentCoef[0] > 0.0) fCurrentCoef2[0] = (par[0]+meanvdriftused*meanexbused)/fCurrentCoef[0];
+ else fCurrentCoef2[0] = 100.0;
+
+ }
+ else {
+
+ fCurrentCoef[0] = -100.0;
+ fCurrentCoef2[0] = 100.0;
- return fCurrentCoef[0];
}
- else return -100.0;
}
else {
- return -100.0;
+
+ fCurrentCoef[0] = -100.0;
+ fCurrentCoef2[0] = 100.0;
+
}
+ vdriftoverall = fCurrentCoef[0];
+ exboverall = fCurrentCoef2[0];
+
+
delete linearfitterhisto;
delete fDebugStreamer;
fDebugStreamer = 0x0;
for (Int_t col = 0; col < colMax; col++) {
value = coef[(Int_t)(col*rowMax+row)];
if(value > 70.0) {
- if((ofwhat == 0) && (meanAll > -1.5) && (countAll > 15)) coef[(Int_t)(col*rowMax+row)] = meanAll+100.0;
+ if((ofwhat == 0) && (meanAll > -3.0) && (countAll > 15)) coef[(Int_t)(col*rowMax+row)] = meanAll+100.0;
if(ofwhat == 1){
- if((meanDetector[detector] > -1.5) && (countDetector[detector] > 20)) coef[(Int_t)(col*rowMax+row)] = meanDetector[detector]+100.0;
- else if((meanSupermodule[sector] > -1.5) && (countSupermodule[sector] > 15)) coef[(Int_t)(col*rowMax+row)] = meanSupermodule[sector]+100.0;
- else if((meanAll > -1.5) && (countAll > 15)) coef[(Int_t)(col*rowMax+row)] = meanAll+100.0;
+ if((meanDetector[detector] > -3.0) && (countDetector[detector] > 20)) coef[(Int_t)(col*rowMax+row)] = meanDetector[detector]+100.0;
+ else if((meanSupermodule[sector] > -3.0) && (countSupermodule[sector] > 15)) coef[(Int_t)(col*rowMax+row)] = meanSupermodule[sector]+100.0;
+ else if((meanAll > -3.0) && (countAll > 15)) coef[(Int_t)(col*rowMax+row)] = meanAll+100.0;
}
}
// Debug
if(count > 0) mean = mean/count;
*/
value = ((AliTRDFitInfo *) vectorFit->At(k))->GetCoef()[0];
- object->SetValue(detector,-TMath::Abs(value));
+ if(value > 70.0) value = value-100.0;
+ object->SetValue(detector,value);
}
return object;
fCurrentCoefDetector2[k] = 0.0;
}
- //printf("test0\n");
-
- AliTRDcalibDB *cal = AliTRDcalibDB::Instance();
- if (!cal) {
- AliInfo("Could not get calibDB");
- return kFALSE;
- }
-
- //Get the CalDet object
- if(fAccCDB){
- if(fCalDet) delete fCalDet;
- if(fCalDet2) delete fCalDet2;
- fCalDet = new AliTRDCalDet(*(cal->GetVdriftDet()));
- //printf("test1\n");
- fCalDet2 = new AliTRDCalDet("lorentz angle tan","lorentz angle tan (detector value)");
- //printf("test2\n");
- for(Int_t k = 0; k < 540; k++){
- fCalDet2->SetValue(k,AliTRDCommonParam::Instance()->GetOmegaTau(fCalDet->GetValue(k)));
- }
- //printf("test3\n");
- }
- else{
- Float_t devalue = 1.5;
- Float_t devalue2 = AliTRDCommonParam::Instance()->GetOmegaTau(1.5);
- if(fCalDet) delete fCalDet;
- if(fCalDet2) delete fCalDet2;
- //printf("test1\n");
- fCalDet = new AliTRDCalDet("ChamberVdrift","TRD drift velocities (detector value)");
- fCalDet2 = new AliTRDCalDet("lorentz angle tan","lorentz angle tan (detector value)");
- //printf("test2\n");
- for(Int_t k = 0; k < 540; k++){
- fCalDet->SetValue(k,devalue);
- fCalDet2->SetValue(k,devalue2);
- }
- //printf("test3\n");
- }
+ if((!fCalDetVdriftUsed) || (!fCalDetExBUsed)) return kFALSE;
+
return kTRUE;
}
-
//____________Functions for initialising the AliTRDCalibraFit in the code_________
void AliTRDCalibraFit::InitfCountDetAndfCount(Int_t i)
{
else if (fNbDet > 0){
Int_t firstdetector = fCountDet;
Int_t lastdetector = fCountDet+fNbDet;
- AliInfo(Form("The element %d containing the detectors %d to %d has not enough statistic to be fitted"
- ,idect,firstdetector,lastdetector));
+ //AliInfo(Form("The element %d containing the detectors %d to %d has not enough statistic to be fitted",idect,firstdetector,lastdetector));
// loop over detectors
for(Int_t det = firstdetector; det < lastdetector; det++){
}
else {
- AliInfo(Form("The element %d in this detector %d has not enough statistic to be fitted"
- ,idect-(fCount-(fCalibraMode->GetNfragZ(0)*fCalibraMode->GetNfragRphi(0))),fCountDet));
+//AliInfo(Form("The element %d in this detector %d has not enough statistic to be fitted",idect-(fCount-(fCalibraMode->GetNfragZ(0)*fCalibraMode->GetNfragRphi(0))),fCountDet));
// Calcul the coef from the database choosen
CalculChargeCoefMean(kFALSE);
Int_t firstdetector = fCountDet;
Int_t lastdetector = fCountDet+fNbDet;
- AliInfo(Form("The element %d containing the detectors %d to %d has not enough statistic to be fitted"
- ,idect,firstdetector,lastdetector));
+//AliInfo(Form("The element %d containing the detectors %d to %d has not enough statistic to be fitted",idect,firstdetector,lastdetector));
// loop over detectors
for(Int_t det = firstdetector; det < lastdetector; det++){
}
else {
- AliInfo(Form("The element %d in this detector %d has not enough statistic to be fitted"
- ,idect-(fCount-(fCalibraMode->GetNfragZ(1)*fCalibraMode->GetNfragRphi(1))),fCountDet));
+//AliInfo(Form("The element %d in this detector %d has not enough statistic to be fitted",idect-(fCount-(fCalibraMode->GetNfragZ(1)*fCalibraMode->GetNfragRphi(1))),fCountDet));
CalculVdriftCoefMean();
CalculT0CoefMean();
Int_t firstdetector = fCountDet;
Int_t lastdetector = fCountDet+fNbDet;
- AliInfo(Form("The element %d containing the detectors %d to %d has not enough statistic to be fitted"
- ,idect,firstdetector,lastdetector));
+// AliInfo(Form("The element %d containing the detectors %d to %d has not enough statistic to be fitted",idect,firstdetector,lastdetector));
// loop over detectors
for(Int_t det = firstdetector; det < lastdetector; det++){
}
else {
- AliInfo(Form("The element %d in this detector %d has not enough statistic to be fitted"
- ,idect-(fCount-(fCalibraMode->GetNfragZ(2)*fCalibraMode->GetNfragRphi(2))),fCountDet));
+// AliInfo(Form("The element %d in this detector %d has not enough statistic to be fitted",idect-(fCount-(fCalibraMode->GetNfragZ(2)*fCalibraMode->GetNfragRphi(2))),fCountDet));
CalculPRFCoefMean();
for (Int_t k = 0; k < factor; k++) {
fCurrentCoefDetector[k] = -TMath::Abs(fCurrentCoef[1]);
// should be negative
- fCurrentCoefDetector2[k] = +TMath::Abs(fCurrentCoef2[1]);
+ fCurrentCoefDetector2[k] = fCurrentCoef2[1]+100.0;
}
- //Put default opposite sign
+ //Put default opposite sign only for vdrift
fCurrentCoef[0] = -TMath::Abs(fCurrentCoef[1]);
fCurrentCoefE = 0.0;
- fCurrentCoef2[0] = +TMath::Abs(fCurrentCoef2[1]);
+ fCurrentCoef2[0] = fCurrentCoef2[1]+100.0;
fCurrentCoefE2 = 0.0;
FillFillLinearFitter();
if (fNbDet > 0){
Int_t firstdetector = fCountDet;
Int_t lastdetector = fCountDet+fNbDet;
- AliInfo(Form("The element %d containing the detectors %d to %d has been fitted"
- ,idect,firstdetector,lastdetector));
+ // AliInfo(Form("The element %d containing the detectors %d to %d has been fitted",idect,firstdetector,lastdetector));
// loop over detectors
for(Int_t det = firstdetector; det < lastdetector; det++){
Int_t firstdetector = fCountDet;
Int_t lastdetector = fCountDet+fNbDet;
- AliInfo(Form("The element %d containing the detectors %d to %d has been fitted"
- ,idect,firstdetector,lastdetector));
+// AliInfo(Form("The element %d containing the detectors %d to %d has been fitted",idect,firstdetector,lastdetector));
// loop over detectors
for(Int_t det = firstdetector; det < lastdetector; det++){
Int_t firstdetector = fCountDet;
Int_t lastdetector = fCountDet+fNbDet;
- AliInfo(Form("The element %d containing the detectors %d to %d has been fitted"
- ,idect,firstdetector,lastdetector));
+// AliInfo(Form("The element %d containing the detectors %d to %d has been fitted",idect,firstdetector,lastdetector));
// loop over detectors
for(Int_t det = firstdetector; det < lastdetector; det++){
// For the detector fCountDet, mean drift velocity and tan lorentzangle
//
- fCurrentCoef[1] = fCalDet->GetValue(fCountDet);
- fCurrentCoef2[1] = fCalDet2->GetValue(fCountDet);
+ fCurrentCoef[1] = fCalDetVdriftUsed->GetValue(fCountDet);
+ fCurrentCoef2[1] = fCalDetExBUsed->GetValue(fCountDet);
return kTRUE;
}
// Function for integration range of the charge
void RangeChargeIntegration(Float_t vdrift, Float_t t0, Int_t &begin, Int_t &peak, Int_t &end) const;
+
+ // ExB calibration
+ void SetCalDetVdriftExB(AliTRDCalDet *calDetVdriftUsed,AliTRDCalDet *calDetExBUsed) {fCalDetVdriftUsed = calDetVdriftUsed; fCalDetExBUsed = calDetExBUsed;};
// Functions fit for CH
Bool_t AnalyseCH(const TH2I *ch);
// Functions fit for vdrift/lorentzangle
Bool_t AnalyseLinearFitters(AliTRDCalibraVdriftLinearFit *calivdli);
- Double_t AnalyseLinearFittersAllTogether(AliTRDCalibraVdriftLinearFit *calivdli);
+ void AnalyseLinearFittersAllTogether(AliTRDCalibraVdriftLinearFit *calivdli, Double_t &vdriftoverall, Double_t &exboverall);
// Pad Calibration
Bool_t SetModeCalibration(TString name, Int_t i);
AliTRDCalROC *fCalROC; // Current calib object
AliTRDCalDet *fCalDet2; // Current calib object
AliTRDCalROC *fCalROC2; // Current calib object
+
+ AliTRDCalDet *fCalDetVdriftUsed; // ExB calibration
+ AliTRDCalDet *fCalDetExBUsed; // ExB calibration
// Current values detector
#include "AliTRDCalibraVdriftLinearFit.h"
#include "AliTRDPreprocessorOffline.h"
#include "AliTRDCalChamberStatus.h"
+#include "AliTRDCommonParam.h"
ClassImp(AliTRDPreprocessorOffline)
fNameList("TRDCalib"),
fCalDetGainUsed(0x0),
fCalDetVdriftUsed(0x0),
+ fCalDetExBUsed(0x0),
fCH2d(0x0),
fPH2d(0x0),
fPRF2d(0x0),
fSubVersionVdriftUsed(0),
fSwitchOnValidation(kTRUE),
fVdriftValidated(kFALSE),
+ fExBValidated(kFALSE),
fT0Validated(kFALSE),
fMinStatsVdriftT0PH(800*20),
fMinStatsVdriftLinear(800),
if(fCalDetGainUsed) delete fCalDetGainUsed;
if(fCalDetVdriftUsed) delete fCalDetVdriftUsed;
+ if(fCalDetExBUsed) delete fCalDetExBUsed;
if(fCH2d) delete fCH2d;
if(fPH2d) delete fPH2d;
if(fPRF2d) delete fPRF2d;
//
fVdriftValidated = kTRUE;
fT0Validated = kTRUE;
+ fExBValidated = kTRUE;
fNotEnoughStatisticsForTheVdriftLinear = kFALSE;
//
// 2. extraction of the information
//
- if(ReadVdriftLinearFitGlobal(file)) AnalyzeVdriftLinearFit();
+ if(ReadVdriftLinearFitGlobal(file) && fCalDetVdriftUsed && fCalDetExBUsed) AnalyzeVdriftLinearFit();
if(ReadVdriftT0Global(file)) AnalyzeVdriftT0();
//
// 3. Append QA plots
//AliError("TRD t0 OCDB parameters out of range!");
fT0Validated = kFALSE;
}
+ if(fSwitchOnValidation==kTRUE && ValidateExB()==kFALSE) {
+ //AliError("TRD t0 OCDB parameters out of range!");
+ fExBValidated = kFALSE;
+ }
//
// 5. update of OCDB
//
//
if(fVdriftValidated) UpdateOCDBVdrift(startRunNumber,endRunNumber,ocdbStorage);
if(fT0Validated) UpdateOCDBT0(startRunNumber,endRunNumber,ocdbStorage);
- UpdateOCDBExB(startRunNumber,endRunNumber,ocdbStorage);
+ if(fExBValidated) UpdateOCDBExB(startRunNumber,endRunNumber,ocdbStorage);
}
//_________________________________________________________________________________________________________________
if(fVersionVdriftUsed == 0) fStatusPos = fStatusPos |kVdriftErrorOld;
if(fVersionGainUsed == 0) fStatusPos = fStatusPos | kGainErrorOld;
-
+
return kTRUE;
}
ok = kTRUE;
}
else {
+ //printf("Not enough stats timeoffset\n");
fStatusNeg = fStatusNeg | kTimeOffsetNotEnoughStatsNotFill;
}
calibra->ResetVectorFit();
AliTRDCalibraFit *calibra = AliTRDCalibraFit::Instance();
+ calibra->SetCalDetVdriftExB(fCalDetVdriftUsed,fCalDetExBUsed);
calibra->SetMinEntries(fMinStatsVdriftLinear); // If there is less than 1000 entries in the histo: no fit
//printf("Fill PE Array\n");
fAliTRDCalibraVdriftLinearFit->FillPEArray();
fNotEnoughStatisticsForTheVdriftLinear = kTRUE;
Int_t minNumberOfEntriesForAll = fMinStatsVdriftLinear*30;
calibra->SetMinEntries(minNumberOfEntriesForAll); // Because we do it for all, we increase this
- Double_t vdriftoverall = calibra->AnalyseLinearFittersAllTogether(fAliTRDCalibraVdriftLinearFit);
- if(fCalDetVdriftUsed && (vdriftoverall > 0.0)) {
+ Double_t vdriftoverall = -100.0;
+ Double_t exboverall = 100.0;
+ calibra->AnalyseLinearFittersAllTogether(fAliTRDCalibraVdriftLinearFit,vdriftoverall,exboverall);
+ //printf("Found mean vdrift %f and exb %f\n",vdriftoverall,exboverall);
+ if(fCalDetVdriftUsed && (vdriftoverall > 0.0) && (exboverall < 70.0)) {
AliTRDCalDet *calDetVdrift = new AliTRDCalDet(*fCalDetVdriftUsed);
- Double_t oldmean = fCalDetVdriftUsed->CalcMean(kFALSE);
+ AliTRDCalDet *calDetLorentz = new AliTRDCalDet(*fCalDetExBUsed);
+ Double_t oldmeanvdrift = fCalDetVdriftUsed->CalcMean(kFALSE);
+ Double_t oldmeanexb = fCalDetExBUsed->CalcMean(kFALSE);
//printf("oldmean %f\n",oldmean);
- if(oldmean > 0.0) {
+ if((oldmeanvdrift > 0.0) && (oldmeanexb < 70.0)) {
//printf("Correction factor %f\n",vdriftoverall);
- calDetVdrift->Multiply(vdriftoverall/oldmean);
+ calDetVdrift->Multiply(vdriftoverall/oldmeanvdrift);
+ calDetLorentz->Multiply(exboverall/oldmeanexb);
//printf("newmean %f\n",calDetVdrift->CalcMean(kFALSE));
TH1F *coefDriftLinear = calDetVdrift->MakeHisto1DAsFunctionOfDet();
+ TH1F *coefLorentzAngle = calDetLorentz->MakeHisto1DAsFunctionOfDet();
// Put them in the array
fCalibObjects->AddAt(calDetVdrift,kVdriftLinear);
+ fCalibObjects->AddAt(calDetLorentz,kLorentzLinear);
fPlots->AddAt(coefDriftLinear,kVdriftLinear);
+ fPlots->AddAt(coefLorentzAngle,kLorentzLinear);
//
ok = kTRUE;
fStatusNeg = fStatusNeg | kVdriftNotEnoughStatsButFill;
}
else {
- fStatusPos = fStatusPos | kVdriftErrorOld;
+ if(oldmeanvdrift) fStatusPos = fStatusPos | kVdriftErrorOld;
+ if(oldmeanexb) fStatusPos = fStatusPos | kExBErrorOld;
}
}
else {
- if(vdriftoverall <= 0.0) fStatusNeg = fStatusNeg | kVdriftNotEnoughStatsNotFill;
+ if((vdriftoverall <= 0.0) && (exboverall > 70.0)) fStatusNeg = fStatusNeg | kVdriftNotEnoughStatsNotFill;
if(!fCalDetVdriftUsed) fStatusPos = fStatusPos | kVdriftErrorOld;
+ if(!fCalDetExBUsed) fStatusPos = fStatusPos | kExBErrorOld;
}
}
// get calibration objects
AliTRDCalDet *calDetGain = (AliTRDCalDet *) fCalibObjects->At(kGain);
AliTRDCalDet *calDetVDrift = (AliTRDCalDet *) fCalibObjects->At(kVdriftLinear);
+ AliTRDCalDet *calDetExB = (AliTRDCalDet *) fCalibObjects->At(kLorentzLinear);
// Check
- if((!calDetGain) || (!calDetVDrift) || (!fCH2d)) return kFALSE;
+ if((!calDetGain) || (!calDetVDrift) || (!fCH2d) || (!calDetExB)) return kFALSE;
// Gain
Double_t gainmean = calDetGain->GetMean();
Double_t vdriftmean = calDetVDrift->GetMean();
+ Double_t exbmean = calDetExB->GetMean();
Double_t gainrms = calDetGain->GetRMSRobust();
Double_t vdriftrms = calDetVDrift->GetRMSRobust();
+ Double_t exbrms = calDetExB->GetRMSRobust();
//printf("Gain mean: %f, rms: %f\n",gainmean,gainrms);
//printf("Vdrift mean: %f, rms: %f\n",vdriftmean,vdriftrms);
-
+ //printf("ExB mean: %f, rms: %f\n",exbmean,exbrms);
+
// Check
- if((TMath::Abs(gainrms) < 0.001) || (TMath::Abs(vdriftrms) < 0.001)) return kFALSE;
+ if((TMath::Abs(gainrms) < 0.001) || (TMath::Abs(vdriftrms) < 0.001) || (TMath::Abs(exbrms) < 0.0000001)) return kFALSE;
// mask chambers with empty gain entries
//Int_t counter = 0;
// vdrift
Double_t vdrift = calDetVDrift->GetValue(idet);
+ // exb
+ Double_t exb = calDetExB->GetValue(idet);
+
if(entries<=0.5 ||
TMath::Abs(gainmean-gain) > (15.0*gainrms) ||
- TMath::Abs(vdriftmean-vdrift) > (15.0*vdriftrms)) {
+ TMath::Abs(vdriftmean-vdrift) > (15.0*vdriftrms) ||
+ TMath::Abs(exbmean-exb) > (50.0*exbrms)) {
//printf(" chamber det %03d masked \n",idet);
//printf(" gainmean %f and gain %f, gainrms %f \n",gainmean,gain,gainrms);
//printf(" vdriftmean %f and vdrift %f, vdriftrms %f \n",vdriftmean,vdrift,vdriftrms);
+ //printf(" exbmean %f and exb %f, exbrms %f \n",exbmean,exb,exbrms);
+
CalChamberStatus->SetStatus(idet,AliTRDCalChamberStatus::kMasked);
//counter++;
}
return ok;
+ }
+ //__________________________________________________________________________________________________________________________
+ Bool_t AliTRDPreprocessorOffline::ValidateExB(){
+ //
+ // Update OCDB entry
+ //
+
+ AliTRDCalDet *calDet = (AliTRDCalDet *) fCalibObjects->At(kLorentzLinear);
+ if(calDet) {
+ Double_t mean = calDet->GetMean();
+ Double_t rms = calDet->GetRMSRobust();
+ //printf("Vdrift::mean %f, rms %f\n",mean,rms);
+ if(!((mean > -1.0) && (mean < 1.0) && (rms < 0.5))) {
+ fStatusNeg = fStatusNeg | kExBErrorRange;
+ return kFALSE;
+ }
+ else return kTRUE;
+ }
+ else return kFALSE;
+
}
//__________________________________________________________________________________________________________________________
Bool_t AliTRDPreprocessorOffline::ValidateT0(){
AliInfo(Form("IsGainNotEnoughStatsNotFill? %d",(Int_t)IsGainNotEnoughStatsNotFill()));
AliInfo(Form("IsVdriftNotEnoughStatsNotFill? %d",(Int_t)IsVdriftNotEnoughStatsNotFill()));
AliInfo(Form("IsTimeOffsetNotEnoughStatsNotFill? %d",(Int_t)IsTimeOffsetNotEnoughStatsNotFill()));
+
+ AliInfo(Form("IsExBErrorRange? %d",(Int_t)IsExBErrorRange()));
+ AliInfo(Form("IsExBErrorOld? %d",(Int_t)IsExBErrorOld()));
}
+//___________________________________________________________________________________
+void AliTRDPreprocessorOffline::SetCalDetVdrift(AliTRDCalDet *calDetVdriftUsed)
+{
+
+ fCalDetVdriftUsed = calDetVdriftUsed;
+
+ fCalDetExBUsed = new AliTRDCalDet("lorentz angle tan","lorentz angle tan (detector value)");
+ for(Int_t k = 0; k < 540; k++){
+ fCalDetExBUsed->SetValue(k,AliTRDCommonParam::Instance()->GetOmegaTau(fCalDetVdriftUsed->GetValue(k)));
+ //printf("Set the exb object for detector %d, vdrift %f and exb %f\n",k,fCalDetVdriftUsed->GetValue(k),fCalDetExBUsed->GetValue(k));
+ }
+
+};
kChamberStatus = 7,
kPRF = 8
};
- enum { kGainNotEnoughStatsButFill = 2, kVdriftNotEnoughStatsButFill = 4, kGainNotEnoughStatsNotFill = 8, kVdriftNotEnoughStatsNotFill = 16, kTimeOffsetNotEnoughStatsNotFill = 32};
- enum { kGainErrorOld = 2, kVdriftErrorOld = 4, kGainErrorRange = 8, kVdriftErrorRange = 16, kTimeOffsetErrorRange = 32, kChamberStatusErrorRange = 64};
+ enum { kGainNotEnoughStatsButFill = 2,
+ kVdriftNotEnoughStatsButFill = 4,
+ kGainNotEnoughStatsNotFill = 8,
+ kVdriftNotEnoughStatsNotFill = 16,
+ kTimeOffsetNotEnoughStatsNotFill = 32,
+ kExBErrorRange = 64};
+ enum { kGainErrorOld = 2,
+ kVdriftErrorOld = 4,
+ kExBErrorOld = 8,
+ kGainErrorRange = 16,
+ kVdriftErrorRange = 32,
+ kTimeOffsetErrorRange = 64,
+ kChamberStatusErrorRange = 128};
AliTRDPreprocessorOffline();
Bool_t IsVdriftNotEnoughStatsNotFill() const
{ return CheckStatus(fStatusNeg, kVdriftNotEnoughStatsNotFill); };
Bool_t IsTimeOffsetNotEnoughStatsNotFill() const
- { return CheckStatus(fStatusNeg, kVdriftNotEnoughStatsNotFill); };
+ { return CheckStatus(fStatusNeg, kTimeOffsetNotEnoughStatsNotFill); };
+ Bool_t IsExBErrorRange() const
+ { return CheckStatus(fStatusNeg, kExBErrorRange); };
Bool_t IsGainErrorOld() const
{ return CheckStatus(fStatusPos, kGainErrorOld); };
Bool_t IsVdriftErrorOld() const
{ return CheckStatus(fStatusPos, kVdriftErrorOld); };
+ Bool_t IsExBErrorOld() const
+ { return CheckStatus(fStatusPos, kExBErrorOld); };
Bool_t IsGainErrorRange() const
{ return CheckStatus(fStatusPos, kGainErrorRange); };
Bool_t IsVdriftErrorRange() const
void SetNameList(TString nameList) { fNameList = nameList;};
TString GetNameList() const { return fNameList;};
void SetCalDetGain(AliTRDCalDet *calDetGainUsed) {fCalDetGainUsed = calDetGainUsed;};
- void SetCalDetVdrift(AliTRDCalDet *calDetVdriftUsed) {fCalDetVdriftUsed = calDetVdriftUsed;};
+ void SetCalDetVdrift(AliTRDCalDet *calDetVdriftUsed);
+ void SetCalDetVdriftExB(AliTRDCalDet *calDetVdriftUsed,AliTRDCalDet *calDetExBUsed) {fCalDetVdriftUsed = calDetVdriftUsed; fCalDetExBUsed = calDetExBUsed;};
void SetSwitchOnValidation(Bool_t switchOnValidation) {fSwitchOnValidation = switchOnValidation;};
AliTRDCalDet *GetCalDetGain() const { return fCalDetGainUsed;};
AliTRDCalDet *GetCalDetVdrift() const { return fCalDetVdriftUsed;};
Bool_t ValidateGain();
Bool_t ValidateVdrift();
+ Bool_t ValidateExB();
Bool_t ValidateT0();
Bool_t ValidatePRF() const;
Bool_t ValidateChamberStatus();
TString fNameList; // Name of the list
AliTRDCalDet *fCalDetGainUsed; // CalDet used and to be corrected for
AliTRDCalDet *fCalDetVdriftUsed; // CalDet used and to be corrected for
+ AliTRDCalDet *fCalDetExBUsed; // CalDet used and to be corrected for
TH2I *fCH2d; // Gain
TProfile2D *fPH2d; // Drift velocity first method
TProfile2D *fPRF2d; // PRF
Int_t fSubVersionVdriftUsed; // SubVersionVdriftUsed
Bool_t fSwitchOnValidation; // Validation
Bool_t fVdriftValidated; // Vdrift validation
+ Bool_t fExBValidated; // ExB validation
Bool_t fT0Validated; // T0 validation
Int_t fMinStatsVdriftT0PH; // MinStats VdriftT0
Int_t fMinStatsVdriftLinear; // MinStats Vdrift Linear