}
}
-void AliTPCExBEffectiveSector::MakeResidualMap(THnBase * hisInput, const char *sname, Int_t ptype, Int_t dtype){
- //
- // Make cluster residual map from the n-dimensional histogram
- // hisInput supposed to have given format:
- // - 4 Dim - delta, sector, localX, kZ
- // Vertex position assumed to be at (0,0,0)
- TTreeSRedirector *pcstream=new TTreeSRedirector(sname);
- //
- Int_t nbins1=hisInput->GetAxis(1)->GetNbins();
- Int_t nbins2=hisInput->GetAxis(2)->GetNbins();
- Int_t nbins3=hisInput->GetAxis(3)->GetNbins();
- TF1 *fgaus=0;
- TH3F * hisResMap3D =
- new TH3F("his3D","his3D",
- nbins1,hisInput->GetAxis(1)->GetXmin(), hisInput->GetAxis(1)->GetXmax(),
- nbins2,hisInput->GetAxis(2)->GetXmin(), hisInput->GetAxis(2)->GetXmax(),
- nbins3,hisInput->GetAxis(3)->GetXmin(), hisInput->GetAxis(3)->GetXmax());
- hisResMap3D->GetXaxis()->SetTitle("sector");
- hisResMap3D->GetYaxis()->SetTitle("localX");
- hisResMap3D->GetZaxis()->SetTitle("kZ");
-
- TH2F * hisResMap2D[4] ={0,0,0,0};
- for (Int_t i=0; i<4; i++){
- hisResMap2D[i]=
- new TH2F(Form("his2D_0%d",i),Form("his2D_0%d",i),
- nbins1,hisInput->GetAxis(1)->GetXmin(), hisInput->GetAxis(1)->GetXmax(),
- nbins2,hisInput->GetAxis(2)->GetXmin(), hisInput->GetAxis(2)->GetXmax());
- hisResMap2D[i]->GetXaxis()->SetTitle("sector");
- hisResMap2D[i]->GetYaxis()->SetTitle("localX");
- }
- //
- //
- //
- TF1 * f1= 0;
- Int_t axis0[4]={0,1,2,3};
- Int_t axis1[4]={0,1,2,3};
- for (Int_t ibin1=1; ibin1<nbins1; ibin1+=1){
- // phi- sector range
- hisInput->GetAxis(1)->SetRange(ibin1-1,ibin1+1);
- THnBase *his1=(THnBase *)hisInput->ProjectionND(4,axis0);
- Double_t sector=hisInput->GetAxis(1)->GetBinCenter(ibin1);
- //
- for (Int_t ibin2=1; ibin2<nbins2; ibin2+=1){
- // local x range
- // kz fits
- his1->GetAxis(2)->SetRange(ibin2-1,ibin2+1);
- THnBase *his2=(THnBase *)his1->ProjectionND(4,axis1);
- Double_t localX=hisInput->GetAxis(2)->GetBinCenter(ibin2);
- //
- //A side
- his2->GetAxis(3)->SetRangeUser(0.01,0.3);
- TH1 * hisA = his2->Projection(0);
- Double_t meanA= hisA->GetMean();
- Double_t rmsA= hisA->GetRMS();
- Double_t entriesA= hisA->GetEntries();
- delete hisA;
- //C side
- his2->GetAxis(3)->SetRangeUser(0.01,0.3);
- TH1 * hisC = his2->Projection(0);
- Double_t meanC= hisC->GetMean();
- Double_t rmsC= hisC->GetRMS();
- Double_t entriesC= hisC->GetEntries();
- delete hisC;
- his2->GetAxis(3)->SetRangeUser(-1.2,1.2);
- TH2 * hisAC = his2->Projection(0,3);
- TProfile *profAC = hisAC->ProfileX();
- delete hisAC;
- profAC->Fit("pol1","QNR","QNR",0.05,1);
- if (!f1) f1=(TF1*)gROOT->FindObject("pol1");
- Double_t offsetA=f1->GetParameter(0);
- Double_t slopeA=f1->GetParameter(1);
- Double_t offsetAE=f1->GetParError(0);
- Double_t slopeAE=f1->GetParError(1);
- Double_t chi2A=f1->GetChisquare()/f1->GetNumberFreeParameters();
- profAC->Fit("pol1","QNR","QNR",-1.1,-0.1);
- f1=(TF1*)gROOT->FindObject("pol1");
- Double_t offsetC=f1->GetParameter(0);
- Double_t slopeC=f1->GetParameter(1);
- Double_t offsetCE=f1->GetParError(0);
- Double_t slopeCE=f1->GetParError(1);
- Double_t chi2C=f1->GetChisquare()/f1->GetNumberFreeParameters();
- printf("%f\t%f\t%f\t%f\t%f\t%f\t%f\n", sector,localX, entriesA+entriesC, slopeA,slopeC, chi2A, chi2C);
-
- (*pcstream)<<"deltaFit"<<
- "sector="<<sector<<
- "localX="<<localX<<
- "meanA="<<meanA<<
- "rmsA="<<rmsA<<
- "entriesA="<<entriesA<<
- "meanC="<<meanC<<
- "rmsC="<<rmsC<<
- "entriesC="<<entriesC<<
- "offsetA="<<offsetA<<
- "slopeA="<<slopeA<<
- "offsetAE="<<offsetAE<<
- "slopeAE="<<slopeAE<<
- "chi2A="<<chi2A<<
- "offsetC="<<offsetC<<
- "slopeC="<<slopeC<<
- "offsetCE="<<offsetCE<<
- "slopeCE="<<slopeCE<<
- "chi2C="<<chi2C<<
- "\n";
- //
- hisResMap2D[0]->SetBinContent(ibin1,ibin2, offsetA);
- hisResMap2D[1]->SetBinContent(ibin1,ibin2, slopeA);
- hisResMap2D[2]->SetBinContent(ibin1,ibin2, offsetC);
- hisResMap2D[3]->SetBinContent(ibin1,ibin2, slopeC);
-
- for (Int_t ibin3=1; ibin3<nbins3; ibin3++){
- Double_t kZ=hisInput->GetAxis(3)->GetBinCenter(ibin3);
- if (TMath::Abs(kZ)<0.05) continue; // crossing
- his2->GetAxis(3)->SetRange(ibin3,ibin3);
- if (TMath::Abs(kZ)>0.15){
- his2->GetAxis(3)->SetRange(ibin3,ibin3);
- }
- TH1 * his = his2->Projection(0);
- Double_t mean= his->GetMean();
- Double_t rms= his->GetRMS();
- Double_t entries= his->GetEntries();
- //printf("%f\t%f\t%f\t%f\t%f\t%f\n", sector,localX,kZ, entries, mean,rms);
- hisResMap3D->SetBinContent(ibin1,ibin2,ibin3, mean);
- Double_t phi=TMath::Pi()*sector/9;
- if (phi>TMath::Pi()) phi+=TMath::Pi();
- Double_t meanG=0;
- Double_t rmsG=0;
- if (entries>50){
- if (!fgaus) {
- his->Fit("gaus","Q","goff");
- fgaus= (TF1*)((his->GetListOfFunctions()->FindObject("gaus"))->Clone());
- }
- if (fgaus) {
- his->Fit(fgaus,"Q","goff");
- meanG=fgaus->GetParameter(1);
- rmsG=fgaus->GetParameter(2);
- }
- }
- Double_t dsec=sector-Int_t(sector)-0.5;
- Double_t snp=dsec*TMath::Pi()/9.;
- (*pcstream)<<"delta"<<
- "ptype="<<ptype<<
- "dtype="<<dtype<<
- "sector="<<sector<<
- "dsec="<<dsec<<
- "snp="<<snp<<
- "phi="<<phi<<
- "localX="<<localX<<
- "kZ="<<kZ<<
- "theta="<<kZ<<
- "mean="<<mean<<
- "rms="<<rms<<
- "meanG="<<meanG<<
- "rmsG="<<rmsG<<
- "entries="<<entries<<
- "meanA="<<meanA<<
- "rmsA="<<rmsA<<
- "entriesA="<<entriesA<<
- "meanC="<<meanC<<
- "rmsC="<<rmsC<<
- "entriesC="<<entriesC<<
- "offsetA="<<offsetA<<
- "slopeA="<<slopeA<<
- "chi2A="<<chi2A<<
- "offsetC="<<offsetC<<
- "slopeC="<<slopeC<<
- "chi2C="<<chi2C<<
- "\n";
- delete his;
- }
- delete his2;
- }
- delete his1;
- }
- hisResMap3D->Write();
- hisResMap2D[0]->Write();
- hisResMap2D[1]->Write();
- hisResMap2D[2]->Write();
- hisResMap2D[3]->Write();
- delete pcstream;
-}
#include "AliTPCParamSR.h"
#include "AliTPCcalibTimeGain.h"
#include "AliTPCcalibGainMult.h"
+#include "AliTPCcalibAlign.h"
#include "AliSplineFit.h"
#include "AliTPCComposedCorrection.h"
#include "AliTPCExBTwist.h"
#include "TChain.h"
#include "TCut.h"
#include "AliTrackerBase.h"
+#include "AliTracker.h"
#include "AliTPCPreprocessorOffline.h"
-
+#include "AliTPCCorrectionFit.h"
ClassImp(AliTPCPreprocessorOffline)
void AliTPCPreprocessorOffline::MakeFitTime(){
//
- // mak aligment fit - store results in the file
+ // make aligment fit - store results in the file
//
const Int_t kMinEntries=1000;
MakeChainTime();
void AliTPCPreprocessorOffline::MakeChainTime(){
+ //
+ //
//
TFile f("CalibObjects.root");
+
// const char *cdtype[7]={"ITS","TRD","Vertex","TOF","TPC","TPC0","TPC1"};
//const char *cptype[5]={"dy","dz","dsnp","dtheta","d1pt"};
const char * hname[5]={"dy","dz","dsnp","dtheta","d1pt"};
calibTime = (AliTPCcalibTime*)f.Get("calibTime");
}
if (!calibTime) return;
+ AliTPCCorrectionFit::CreateAlignMaps(AliTracker::GetBz(), run);
TTreeSRedirector *pcstream = new TTreeSRedirector("meanITSVertex.root");
//
Int_t ihis=0;
f->Close();
}
-
-