From: wiechula Date: Sun, 3 Nov 2013 14:30:36 +0000 (+0000) Subject: o add possibility to switch off the SC scale factor calculation X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=5414766fc9a2ddc67af4bc150d6d2ca8623b95c7 o add possibility to switch off the SC scale factor calculation o add residual histogram for SC calibration studies o add single histogram for dY deviations --- diff --git a/TPC/Upgrade/AliToyMCEventGenerator.cxx b/TPC/Upgrade/AliToyMCEventGenerator.cxx index d52aab10f80..344a39aa4f2 100644 --- a/TPC/Upgrade/AliToyMCEventGenerator.cxx +++ b/TPC/Upgrade/AliToyMCEventGenerator.cxx @@ -50,6 +50,7 @@ AliToyMCEventGenerator::AliToyMCEventGenerator() ,fUseMaterialBudget(kFALSE) ,fIsLaser(kTRUE) ,fPrereadSCList(kFALSE) + ,fCalculateScaling(kTRUE) { fTPCParam = AliTPCcalibDB::Instance()->GetParameters(); fTPCParam->ReadGeoMatrices(); @@ -73,6 +74,7 @@ AliToyMCEventGenerator::AliToyMCEventGenerator(const AliToyMCEventGenerator &gen ,fUseMaterialBudget(gen.fUseMaterialBudget) ,fIsLaser(gen.fIsLaser) ,fPrereadSCList(gen.fPrereadSCList) + ,fCalculateScaling(gen.fCalculateScaling) { // gRandom->SetSeed(); @@ -771,7 +773,7 @@ void AliToyMCEventGenerator::SetSCScalingFactor() // between the fluctuation map and the average map // - if ( !(HasSCList() && fTPCCorrection && fTPCCorrectionAv && fEvent) ) return; + if ( !(fCalculateScaling && HasSCList() && fTPCCorrection && fTPCCorrectionAv && fEvent) ) return; // loop over several z, r and phi bins and find a factor that minimises // the distortions between the current map and the average map diff --git a/TPC/Upgrade/AliToyMCEventGenerator.h b/TPC/Upgrade/AliToyMCEventGenerator.h index 7a7a024ae5a..eaad57ec50d 100644 --- a/TPC/Upgrade/AliToyMCEventGenerator.h +++ b/TPC/Upgrade/AliToyMCEventGenerator.h @@ -82,6 +82,9 @@ class AliToyMCEventGenerator : public TObject { Bool_t GetPrereadSCList() const { return fPrereadSCList; } Bool_t HasSCList() const { return !fSCListFile.IsNull(); } + void SetCalculateScaling(Bool_t val) { fCalculateScaling = val; } + Bool_t GetCalculateScaling() const { return fCalculateScaling; } + static Float_t GetSCScalingFactor(AliTPCCorrection *corr, AliTPCCorrection *averageCorr, Float_t &chi2); static void SetCorrectionFromFile(TString file, AliTPCCorrection* &corr); @@ -115,10 +118,11 @@ class AliToyMCEventGenerator : public TObject { Bool_t fUseMaterialBudget; // use material budget in tracking? Bool_t fIsLaser; // is a laser event? Bool_t fPrereadSCList; // preread all SC files from the SC list + Bool_t fCalculateScaling; // calculate scaling factor void InitSpaceChargeList(); - ClassDef(AliToyMCEventGenerator, 1) + ClassDef(AliToyMCEventGenerator, 2) }; diff --git a/TPC/Upgrade/AliToyMCReconstruction.cxx b/TPC/Upgrade/AliToyMCReconstruction.cxx index 11527834a64..ff319932f77 100644 --- a/TPC/Upgrade/AliToyMCReconstruction.cxx +++ b/TPC/Upgrade/AliToyMCReconstruction.cxx @@ -65,6 +65,7 @@ AliToyMCReconstruction::AliToyMCReconstruction() : TObject() , fAllClusters("AliTPCclusterMI",10000) , fMapTrackEvent(10000) , fMapTrackTrackInEvent(10000) +, fHnDelta(0x0) , fIsAC(kFALSE) { // @@ -152,6 +153,14 @@ void AliToyMCReconstruction::RunReco(const char* file, Int_t nmaxEv) const Double_t kMass = TDatabasePDG::Instance()->GetParticle("pi+")->Mass(); Double_t lastT0=0; + + // residuals + // binning r, phi, z, delta + const Int_t nbins=4; + Int_t bins[nbins] = {16, 18*5, 50, 80}; + Double_t xmin[nbins] = {86. , 0., -250., -2.}; + Double_t xmax[nbins] = {250., 2*TMath::Pi(), 250., 2.}; + fHnDelta = new THnF("hn", "hn", nbins, bins, xmin, xmax); for (Int_t iev=0; ievGetFile()->cd(); + fHnDelta->Write(); + delete arrClustRes; Cleanup(); } @@ -1255,6 +1267,8 @@ AliExternalTrackParam* AliToyMCReconstruction::GetFittedTrackFromSeed(const AliT // create track AliExternalTrackParam *track = new AliExternalTrackParam(*seed); + // track copy for propagation + AliExternalTrackParam trCopy(*tr); Int_t ncls=(fClusterType == 0)?tr->GetNumberOfSpacePoints():tr->GetNumberOfDistSpacePoints(); @@ -1272,6 +1286,9 @@ AliExternalTrackParam* AliToyMCReconstruction::GetFittedTrackFromSeed(const AliT const Double_t refX = tr->GetX(); const Double_t kMass = TDatabasePDG::Instance()->GetParticle("pi+")->Mass(); + + // parametrised track resolution + Double_t trackRes=gRandom->Gaus(); // loop over all other points and add to the track for (Int_t ipoint=ncls-1; ipoint>=0; --ipoint){ @@ -1338,6 +1355,23 @@ AliExternalTrackParam* AliToyMCReconstruction::GetFittedTrackFromSeed(const AliT clRes->SetY((track->GetY()-prot.GetY())/( sqrt ( prot.GetCov()[3] + track->GetSigmaY2()) ) ); clRes->SetZ((track->GetZ()-prot.GetZ())/( sqrt ( prot.GetCov()[5] + track->GetSigmaZ2()) ) ); } + + // fill cluster residuals to ideal track for calibration studies + // ideal cluster position + trCopy.Rotate(track->GetAlpha()); + AliTrackerBase::PropagateTrackTo(&trCopy,prot.GetX(),kMass,5,kFALSE,kMaxSnp,0,kFALSE,fUseMaterial); + // binning r, phi, z, delta (0=rphi, 1=z) + // resolution parametrisation + Double_t oneOverPt = TMath::Abs(trCopy.GetSigned1Pt()); + Double_t radius = trCopy.GetX(); + Double_t resRphi = 0.004390 + oneOverPt*(-0.136403) + oneOverPt*radius*(0.002266) + oneOverPt*radius*radius*(-0.000006); + + Double_t resRphiRandom = resRphi*trackRes; + Double_t deviation = track->GetY()+resRphiRandom-prot.GetY(); + + // rphi residuals + Double_t xx[4]={prot.GetX(), trCopy.Phi(), trCopy.GetZ(),deviation}; + fHnDelta->Fill(xx); Double_t pointPos[2]={0,0}; Double_t pointCov[3]={0,0,0}; @@ -2578,7 +2612,9 @@ void AliToyMCReconstruction::Cleanup() delete fEvent; fEvent = 0x0; - + + delete fHnDelta; + fHnDelta=0x0; // delete fTree; fTree=0x0; diff --git a/TPC/Upgrade/AliToyMCReconstruction.h b/TPC/Upgrade/AliToyMCReconstruction.h index c1c015ccd58..d319c0c0ad8 100644 --- a/TPC/Upgrade/AliToyMCReconstruction.h +++ b/TPC/Upgrade/AliToyMCReconstruction.h @@ -6,6 +6,7 @@ #include #include #include +#include class TTree; @@ -194,6 +195,8 @@ public: TExMap fMapTrackEvent; // map global track number -> event number TExMap fMapTrackTrackInEvent; // map global track number -> track in event + THn *fHnDelta; // histogram with residuals + Bool_t fIsAC; // if we are tracking with sector arrays running from 0-36 rather than 0-18 ClassDef(AliToyMCReconstruction,0) diff --git a/TPC/Upgrade/macros/finalPlots.C b/TPC/Upgrade/macros/finalPlots.C index 4894a73f3af..5788ff99b9d 100644 --- a/TPC/Upgrade/macros/finalPlots.C +++ b/TPC/Upgrade/macros/finalPlots.C @@ -193,6 +193,27 @@ void finalPlots(const char* filesEps20, TString saveDir="") cResParams->cd(6); leg->Draw(); SaveCanvas(cResParams); + + TCanvas *cResRPhi=GetCanvas("ResRPhi","Resolution of rPhi"); + TLegend *leg2=new TLegend(.12,.7,.48,.95); + TObjArray arr; + Int_t i=0; + for (Int_t it=0; it<3; ++it) { + TH1F *hResParams=new TH1F(Form("hResParams_%d_%d",i,it), + Form(";%s;#tracks",titles[i].Data()), + 100,min[i],max[i]); + drawStr=Form("%strackITS2.fP[%d]-tRealITS2.fP[%d]",type[it].Data(),i,i); + tEps20->Draw(drawStr+Form(">>hResParams_%d_%d",i,it),"","goff"); + hResParams->SetLineColor(colors[it]); + arr.Add(hResParams); + } + leg2->AddEntry(arr.At(0),"no distortions (ideal)","l"); + leg2->AddEntry(arr.At(1),"distorted/corrected (t_{0})","l"); + leg2->AddEntry(arr.At(2),"distorted/corrected (t_{0}^{seed})","l"); + DrawOnTop(cResRPhi,arr,kTRUE); + leg2->Draw("same"); + SaveCanvas(cResRPhi); + } @@ -257,7 +278,7 @@ void SetStyle() { const Int_t NCont=255; //const Int_t NCont=50; - + TH1::AddDirectory(); TStyle *st = new TStyle("mystyle","mystyle"); gROOT->GetStyle("Plain")->Copy((*st)); st->SetTitleX(0.1);