fGainCosmic(0), // calibration component for cosmic
fGainMult(0),
fAlignTree(0), // alignment tree
- fSwitchOnValidation(kFALSE) // flag to switch on validation of OCDB parameters
+ fSwitchOnValidation(kFALSE), // flag to switch on validation of OCDB parameters
+ fMinGain(2.0),
+ fMaxGain(3.0),
+ fMaxVdriftCorr(0.03)
{
//
// default constructor
TObjArray *hisArray =timeDrift->GetHistoDrift();
{for (Int_t i=0; i<hisArray->GetEntriesFast(); i++){
THnSparse* addHist=(THnSparse*)hisArray->UncheckedAt(i);
- if (addHist->GetEntries()<fMinEntries) continue;
if (!addHist) continue;
+ if (addHist->GetEntries()<fMinEntries) continue;
TH1D* histo =addHist->Projection(3);
TH1D* histoTime=addHist->Projection(0);
printf("%s\t%f\t%d\t%d\n",histo->GetName(), histo->GetEntries(),histo->FindFirstBinAbove(0),histo->FindLastBinAbove(0));
gStorage->Put(fVdriftArray, (*id1), metaData);
}
-Bool_t AliTPCPreprocessorOffline::ValidateTimeGain(Double_t minGain, Double_t maxGain)
+Bool_t AliTPCPreprocessorOffline::ValidateTimeGain()
{
//
// Validate time gain corrections
//
Printf("ValidateTimeGain..." );
+ Float_t minGain = fMinGain;
+ Float_t maxGain = fMaxGain;
TGraphErrors *gr = (TGraphErrors*)fGainArray->FindObject("TGRAPHERRORS_MEAN_GAIN_BEAM_ALL");
- if(!gr) return kFALSE;
+ if (!gr) {
+ gr = (TGraphErrors*)fGainArray->FindObject("TGRAPHERRORS_MEAN_GAIN_COSMIC_ALL");
+ if (!gr) return kFALSE;
+ Printf("Assuming given run is a cosmic run. Using gain calibration from Fermi-plateau muons.");
+ }
if(gr->GetN()<1) return kFALSE;
// check whether gain in the range
}
-Bool_t AliTPCPreprocessorOffline::ValidateTimeDrift(Double_t maxVDriftCorr)
+Bool_t AliTPCPreprocessorOffline::ValidateTimeDrift()
{
//
// Validate time drift velocity corrections
//
Printf("ValidateTimeDrift..." );
+ Float_t maxVDriftCorr = fMaxVdriftCorr;
+
TGraphErrors* gr = (TGraphErrors*)fVdriftArray->FindObject("ALIGN_ITSB_TPC_DRIFTVD");
Printf("ALIGN_ITSB_TPC_DRIFTVD graph = %p",gr);
Double_t *erry=new Double_t[npoints0];
//
//
- if (npoints0<kMinPoints) return 0;
+ if (npoints0<kMinPoints) {
+ delete []outx;
+ delete []outy;
+ delete []errx;
+ delete []erry;
+ return 0;
+ }
for (Int_t iter=0; iter<3; iter++){
npoints=0;
for (Int_t ipoint=0; ipoint<npoints0; ipoint++){
THnSparse* newHist=hist->Projection(4,dim);
newHist->SetName(name);
TGraphErrors* graph=AliTPCcalibBase::FitSlices(newHist,2,0,400,100,0.05,0.95, kTRUE);
+ if (!graph) {
+ printf("Graph =%s filtered out\n", name.Data());
+ continue;
+ }
printf("name=%s graph=%i, N=%i\n", name.Data(), graph==0, graph->GetN());
Int_t pos=name.Index("_");
name=name(pos,name.Capacity()-pos);
graphName.ToUpper();
//
graph = FilterGraphDrift(graph, kErrSigmaCut, kMedianCutAbs);
- if (!graph) {
- printf("Graph =%s filtered out\n", name.Data());
- continue;
- }
//
if (graph){
graph->SetMarkerStyle(i%8+20);
arrayTRD=timeDrift->GetAlignTRDTPC();
arrayTOF=timeDrift->GetAlignTOFTPC();
- if (arrayITS->GetEntries()>0) mstatITS= AliTPCcalibDButil::MakeStatRelKalman(arrayITS,0.9,50,0.025);
- if (arrayTOF->GetEntries()>0) mstatTOF= AliTPCcalibDButil::MakeStatRelKalman(arrayTOF,0.9,1000,0.025);
- if (arrayTRD->GetEntries()>0) mstatTRD= AliTPCcalibDButil::MakeStatRelKalman(arrayTRD,0.9,50,0.025);
+ if (arrayITS->GetEntries()>0) mstatITS= AliTPCcalibDButil::MakeStatRelKalman(arrayITS,0.7,50,fMaxVdriftCorr);
+ if (arrayTOF->GetEntries()>0) mstatTOF= AliTPCcalibDButil::MakeStatRelKalman(arrayTOF,0.7,1000,fMaxVdriftCorr);
+ if (arrayTRD->GetEntries()>0) mstatTRD= AliTPCcalibDButil::MakeStatRelKalman(arrayTRD,0.7,50,fMaxVdriftCorr);
//
TObjArray * arrayITSP= AliTPCcalibDButil::SmoothRelKalman(arrayITS,*mstatITS, 0, 5.);
TObjArray * arrayITSM= AliTPCcalibDButil::SmoothRelKalman(arrayITS,*mstatITS, 1, 5.);
// add graphs for laser
//
const Double_t delayL0L1 = 0.071; //this is hack for 1/2 weeks
- THnSparse *hisN=0;
+ //THnSparse *hisN=0;
TGraphErrors *grLaser[6]={0,0,0,0,0,0};
- hisN = timeDrift->GetHistVdriftLaserA(0);
+ //hisN = timeDrift->GetHistVdriftLaserA(0);
if (timeDrift->GetHistVdriftLaserA(0)){
grLaser[0]=MakeGraphFilter0(timeDrift->GetHistVdriftLaserA(0),0,2,5,delayL0L1);
grLaser[0]->SetName("GRAPH_MEAN_DELAY_LASER_ALL_A");
fGraphCosmic->GetY()[i] *= FPtoMIPratio;
}
}
- fGraphCosmic->Draw("lp");
- grfFitCosmic->SetLineColor(2);
- grfFitCosmic->Draw("lu");
+ fGraphCosmic->Draw("lp");
+ if (grfFitCosmic) {
+ grfFitCosmic->SetLineColor(2);
+ grfFitCosmic->Draw("lu");
+ }
fGainArray->AddLast(gainHistoCosmic);
//fGainArray->AddLast(canvasCosmic->Clone());
delete canvasCosmic;
//const char *cptype[5]={"dy","dz","dsnp","dtheta","d1pt"};
const char * hname[5]={"dy","dz","dsnp","dtheta","d1pt"};
Int_t run=0;
- AliTPCcalibTime *calibTime= (AliTPCcalibTime*) f.Get("calibTime");
+ AliTPCcalibTime *calibTime = 0;
+ TObjArray * array = (TObjArray*)f.Get("TPCCalib");
+ if (array){
+ calibTime = (AliTPCcalibTime *)array->FindObject("calibTime");
+ } else {
+ calibTime = (AliTPCcalibTime*)f.Get("calibTime");
+ }
if (!calibTime) return;
TTreeSRedirector *pcstream = new TTreeSRedirector("meanITSVertex.root");
+ //
Int_t ihis=0;
THnSparse *his = calibTime->GetResHistoTPCITS(ihis);
if (his){
his->GetAxis(3)->SetRangeUser(-0.35,0.35);
AliTPCCorrection::MakeDistortionMap(his,pcstream, Form("ITS%s",hname[ihis]),run,85.,ihis,5);
}
+ ihis=1;
+ his = calibTime->GetResHistoTPCITS(ihis);
+ if (his){
+ his->GetAxis(1)->SetRangeUser(-1.1,1.1);
+ his->GetAxis(2)->SetRange(0,1000000);
+ his->GetAxis(3)->SetRangeUser(-0.35,0.35);
+ AliTPCCorrection::MakeDistortionMap(his,pcstream, Form("ITS%s",hname[ihis]),run,85.,ihis,5);
+ }
ihis=2;
his = calibTime->GetResHistoTPCITS(ihis);
if (his){
his->GetAxis(3)->SetRangeUser(-0.35,0.35);
AliTPCCorrection::MakeDistortionMap(his,pcstream, Form("Vertex%s",hname[ihis]),run,0.,ihis,5);
+ }
+ ihis=1;
+ his = calibTime->GetResHistoTPCvertex(ihis);
+ if (his){
+ his->GetAxis(1)->SetRangeUser(-1.1,1.1);
+ his->GetAxis(2)->SetRange(0,1000000);
+ his->GetAxis(3)->SetRangeUser(-0.35,0.35);
+ AliTPCCorrection::MakeDistortionMap(his,pcstream, Form("Vertex%s",hname[ihis]),run,0.,ihis,5);
+
+ }
+ ihis=0;
+ his = calibTime->GetResHistoTPCTOF(ihis);
+ if (his){
+ his->GetAxis(1)->SetRangeUser(-1.1,1.1);
+ his->GetAxis(2)->SetRange(0,1000000);
+ his->GetAxis(3)->SetRangeUser(-0.35,0.35);
+ AliTPCCorrection::MakeDistortionMap(his,pcstream, Form("TOF%s",hname[ihis]),run,0.,ihis,10);
+
+ }
+ ihis=0;
+ his = calibTime->GetResHistoTPCTRD(ihis);
+ if (his){
+ his->GetAxis(1)->SetRangeUser(-1.1,1.1);
+ his->GetAxis(2)->SetRange(0,1000000);
+ his->GetAxis(3)->SetRangeUser(-0.35,0.35);
+ AliTPCCorrection::MakeDistortionMap(his,pcstream, Form("TRD%s",hname[ihis]),run,0.,ihis,10);
+
}
delete pcstream;
}
rAngles[2]=paramC[index+1]*0.001; rAngles[6] =-paramC[index+1]*0.001;
matrixGlobal->SetRotation(rAngles);
//
- AliTPCCalibGlobalMisalignment *fitAlignTime =new AliTPCCalibGlobalMisalignment;
+ AliTPCCalibGlobalMisalignment *fitAlignTime =0;
fitAlignTime =new AliTPCCalibGlobalMisalignment;
fitAlignTime->SetName("FitAlignTime");
fitAlignTime->SetTitle("FitAlignTime");