X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TPC%2FTestAnalisys.C;h=dab0215b5851feb2b9a8b0c3982ae42e6883bbaf;hb=57dc06f21b0aaf2c3d33efa001667fffd390e285;hp=1536ff506cb309c55f333d304a98a17ad1e8e487;hpb=72008ac9bce73ce1fe30d73828bea9660007af82;p=u%2Fmrichter%2FAliRoot.git diff --git a/TPC/TestAnalisys.C b/TPC/TestAnalisys.C index 1536ff506cb..dab0215b585 100644 --- a/TPC/TestAnalisys.C +++ b/TPC/TestAnalisys.C @@ -3,6 +3,7 @@ .L TestAnalisys.C+ AddChains(868); // AddChains(runNumber); Select(); // make default selection of data + MakePictures("pic868"); */ #include "TFile.h" @@ -10,6 +11,7 @@ #include "TChain.h" #include "TString.h" #include "TLegend.h" +#include "TStyle.h" #include "TCut.h" #include "TF1.h" #include "TProfile.h" @@ -26,7 +28,7 @@ #include "AliTrackReference.h" #include "AliTPCParam.h" #include "AliDetector.h" -#include "AliStack.h" +#include "AliStack.h" #include "AliGenInfo.h" @@ -35,6 +37,8 @@ void Select(); // make default selection +void SelectLaser(); // make default selection for laser tracks + void AddChains(Int_t run); // add all the trees with selected run number to the chain void MakePictures(char *dirname); // make default pictures @@ -48,6 +52,9 @@ void SysZX(TCut cut0, char * description); // TProfile * ProfileMaxRow(TCut cut0, char *name, Int_t max); TProfile * ProfileMaxPhi(TCut cut0, char *name, Int_t max); +TProfile * ProfileMaxZ(TCut cut0, char *name, Int_t max); +TProfile * ProfileQRow(TCut cut0, char *name, Int_t max); +TProfile * ProfileQPhi(TCut cut0, char *name, Int_t max); TProfile * ProfileQZ(TCut cut0, char *name, Int_t max); TCanvas * NoiseSector(TCut cut0, char * description, Int_t maxrow, Int_t maxpad); @@ -81,6 +88,16 @@ void MakePictures(char *dirname){ // // // + // Define Uli Style + gROOT->SetStyle("Plain"); + gStyle->SetFillColor(10); + gStyle->SetPadColor(10); + gStyle->SetCanvasColor(10); + gStyle->SetStatColor(10); + + gStyle->SetPalette(1,0); + gStyle->SetNumberContours(50); + // const Int_t kMinCl = 200; char chshell[100]; sprintf(chshell,"mkdir %s", dirname); @@ -109,19 +126,29 @@ void MakePictures(char *dirname){ c.cd(); sprintf(chdesc,"%s Sector %d IROC",runDesc.Data(), isector); sprintf(chcut1,"Cl.fDetector==%d", isector); - prof = ProfileMaxRow(chcut1, chdesc, 70); + prof = ProfileQRow(chcut1, chdesc, 70); sprintf(chshell,"%s/qrow_sec%dIROC.eps", dirname,isector); prof->Draw(); c.Update(); c.Print(chshell); + prof = ProfileMaxRow(chcut1, chdesc, 70); + sprintf(chshell,"%s/maxrow_sec%dIROC.eps", dirname,isector); + prof->Draw(); + c.Update(); + c.Print(chshell); // sprintf(chdesc,"%s Sector %d OROC",runDesc.Data(), isector); sprintf(chcut1,"Cl.fDetector==%d", isector+36); - prof = ProfileMaxRow(chcut1, chdesc, 100); + prof = ProfileQRow(chcut1, chdesc, 100); sprintf(chshell,"%s/qrow_sec%dOROC.eps", dirname,isector); prof->Draw(); c.Update(); c.Print(chshell); + prof = ProfileMaxRow(chcut1, chdesc, 100); + sprintf(chshell,"%s/maxrow_sec%dOROC.eps", dirname,isector); + prof->Draw(); + c.Update(); + c.Print(chshell); // // charge phi // @@ -143,19 +170,21 @@ void MakePictures(char *dirname){ // // charge z // + c.cd(); sprintf(chdesc,"%s Sector %d IROC",runDesc.Data(), isector); sprintf(chcut1,"Cl.fDetector==%d", isector); prof = ProfileQZ(chcut1, chdesc,20); sprintf(chshell,"%s/qz_sec%dIROC.eps", dirname,isector); - prof->Draw(); + // prof->Draw(); c.Update(); c.Print(chshell); // + c.cd(); sprintf(chdesc,"%s Sector %d OROC",runDesc.Data(), isector); sprintf(chcut1,"Cl.fDetector==%d", isector+36); prof = ProfileQZ(chcut1, chdesc,20); sprintf(chshell,"%s/qz_sec%dOROC.eps", dirname,isector); - prof->Draw(); + //prof->Draw(); c.Update(); c.Print(chshell); // @@ -180,6 +209,7 @@ void MakePictures(char *dirname){ SysYX(chcut1,chdesc); sprintf(chshell,"%s/deltayx_sec%d.eps", dirname,isector); c.Print(chshell); + c.cd(); SysZX(chcut1,chdesc); sprintf(chshell,"%s/deltazx_sec%d.eps", dirname,isector); c.Print(chshell); @@ -234,9 +264,9 @@ void AddChains(Int_t run){ runDesc+=run; // TPC tracks // - sprintf(strcl,"ls run%d*/TPCtracks.root > /tmp/files.txt", run); + sprintf(strcl,"ls *%d*/TPCtracks.root > files.txt", run); gSystem->Exec(strcl); - in0.open("/tmp/files.txt"); + in0.open("files.txt"); for (;in0>>sfile;){ if (sfile.Length()==0) break; printf("%s\n",sfile.Data()); @@ -249,9 +279,9 @@ void AddChains(Int_t run){ } // // Fitted signals - sprintf(strcl,"ls run%d*/FitSignal.root > /tmp/files.txt", run); + sprintf(strcl,"ls *%d*/FitSignal.root > files.txt", run); gSystem->Exec(strcl); - in1.open("/tmp/files.txt"); + in1.open("files.txt"); for (;in1>>sfile;){ if (sfile.Length()==0) break; printf("%s\n",sfile.Data()); @@ -264,9 +294,9 @@ void AddChains(Int_t run){ } // // Fitted pedestal - sprintf(strcl,"ls run%d*/TPCsignal.root > /tmp/files.txt", run); + sprintf(strcl,"ls *%d*/TPCsignal.root > files.txt", run); gSystem->Exec(strcl); - in2.open("/tmp/files.txt"); + in2.open("files.txt"); for (;in2>>sfile;){ if (sfile.Length()==0) break; printf("%s\n",sfile.Data()); @@ -279,10 +309,10 @@ void AddChains(Int_t run){ // chainPed.Add(sfile.Data()); } // - // Fitted pedestal - sprintf(strcl,"ls run%d*/TPCsignal.root > /tmp/files.txt", run); + // Random signals + sprintf(strcl,"ls *%d*/TPCsignal.root > files.txt", run); gSystem->Exec(strcl); - in4.open("/tmp/files.txt"); + in4.open("files.txt"); for (;in4>>sfile;){ if (sfile.Length()==0) break; printf("%s\n",sfile.Data()); @@ -290,7 +320,7 @@ void AddChains(Int_t run){ TTree * tree =(TTree*)f.Get("SignalB"); if (tree){ f.Close(); - chainPed.Add(sfile.Data()); + chainSignal.Add(sfile.Data()); } // chainPed.Add(sfile.Data()); } @@ -298,9 +328,9 @@ void AddChains(Int_t run){ // Rec points trees // printf("\n IMPORT REC points"); - sprintf(strcl,"ls run%d*/*RecPoints* > /tmp/files.txt", run); + sprintf(strcl,"ls *%d*/*RecPoints* > files.txt", run); gSystem->Exec(strcl); - in3.open("/tmp/files.txt"); + in3.open("files.txt"); for (;in3>>sfile;){ if (sfile.Length()==0) break; printf("%s\n",sfile.Data()); @@ -320,13 +350,33 @@ void Select(){ // // base cut on the tracks // - comp.fTree->Draw(">>listTracks","Track.fN>50&&abs(Track.fP4)<0.001"); + comp.fTree->Draw(">>listTracks","Etrack.fTPCncls>30&&abs(Etrack.fIp.fP[4])<1"); comp.fTree->SetEventList(listTracks); // compF.fTree->Draw(">>listFitS","p2>0&&p2<5&&p1<900&&p0<10000&&p4<1&&p4>0&&p5SetEventList(listFitS); } +void SelectLaser(){ + // + // base cut on the tracks + // + comp.fTree->Draw(">>listTracks","Etrack.fTPCncls>20&&abs(Etrack.fIp.fP[4])<1&&abs(Etrack.fIp.fP[3])<0.01"); + comp.fTree->SetEventList(listTracks); + // + compF.fTree->Draw(">>listFitS","p2>0&&p2<5&&p1<900&&p0<10000&&p4<1&&p4>0&&p5SetEventList(listFitS); + // + // make default aliases + // + // laser z beam + comp.fTree->SetAlias("lz0","abs(Etrack.fIp.fP[1]-20)<5"); + comp.fTree->SetAlias("lz1","abs(Etrack.fIp.fP[1]-70)<20"); + comp.fTree->SetAlias("lz2","abs(Etrack.fIp.fP[1]-150)<20"); + comp.fTree->SetAlias("lz3","abs(Etrack.fIp.fP[1]-210)<20"); + +} + void PRFYZ(TCut cut0, TCut cut1, char * description){ @@ -337,10 +387,10 @@ void PRFYZ(TCut cut0, TCut cut1, char * description){ TF1 * f1 = new TF1("fdiff","sqrt([0]*[0]+(250-x)*[1]*[1])"); f1->SetParameter(1,0.2); f1->SetParameter(0,0.2); - comp.DrawXY("Cl.fZ","sqrt(Cl.fSigmaY2)","Track.fTrackPoints.GetAngleY()<0.05","Track.fTrackPoints.fTX>0"+cut0,5,10,240,-0,1); + comp.DrawXY("abs(Cl.fZ)","sqrt(Cl.fSigmaY2)","abs(Track.fTrackPoints.GetAngleY())<0.05","Track.fTrackPoints.fTX>0"+cut0,5,10,240,-0,1); TH1F * prfInnerY = (TH1F*)comp.fMean->Clone(); - comp.DrawXY("Cl.fZ","sqrt(Cl.fSigmaY2)","Track.fTrackPoints.GetAngleY()<0.05","Track.fTrackPoints.fTX>0"+cut1,5,10,240,-0,1); + comp.DrawXY("abs(Cl.fZ)","sqrt(Cl.fSigmaY2)","abs(Track.fTrackPoints.GetAngleY())<0.05","Track.fTrackPoints.fTX>0"+cut1,5,10,240,-0,1); TH1F * prfOuterY = (TH1F*)comp.fMean->Clone(); // // @@ -406,10 +456,10 @@ void ResYZ(TCut cut0, TCut cut1, char * description){ TF1 * f1 = new TF1("fdiff","sqrt([0]*[0]+(250-x)*[1]*[1])"); f1->SetParameter(1,0.2); f1->SetParameter(0,0.2); - comp.DrawXY("Cl.fZ","Track.fTrackPoints.GetY()-Cl.GetY()","Track.fTrackPoints.GetAngleY()<0.05","Track.fTrackPoints.fTX>0"+cut0,5,10,240,-0.5,0.5); + comp.DrawXY("abs(Cl.fZ)","Track.fTrackPoints.GetY()-Cl.GetY()","abs(Track.fTrackPoints.GetAngleY())<0.05","Track.fTrackPoints.fTX>0"+cut0,5,10,240,-0.5,0.5); TH1F * prfInnerY = (TH1F*)comp.fRes->Clone(); - comp.DrawXY("Cl.fZ","Track.fTrackPoints.GetY()-Cl.GetY()","Track.fTrackPoints.GetAngleY()<0.05","Track.fTrackPoints.fTX>0"+cut1,5,10,240,-0.5,0.5); + comp.DrawXY("abs(Cl.fZ)","Track.fTrackPoints.GetY()-Cl.GetY()","abs(Track.fTrackPoints.GetAngleY())<0.05","Track.fTrackPoints.fTX>0"+cut1,5,10,240,-0.5,0.5); TH1F * prfOuterY = (TH1F*)comp.fRes->Clone(); // // @@ -452,7 +502,7 @@ void SysZX(TCut cut0, char * description){ // // TProfile * profA = new TProfile("profZ","profZ",70,89,250); - comp.fTree->Draw("Cl.fZ-Track.fTrackPoints.GetZ():Track.fTrackPoints.GetX()>>profZ","abs(Cl.fZ-Track.fTrackPoints.GetZ())<1&&Track.fTrackPoints.fTX>10"+cut0,"prof"); + comp.fTree->Draw("abs(Cl.fZ)-abs(Track.fTrackPoints.GetZ()):Track.fTrackPoints.GetX()>>profZ","abs(abs(Cl.fZ)-abs(Track.fTrackPoints.GetZ()))<1&&Track.fTrackPoints.fTX>10"+cut0,"prof"); profA->SetXTitle("Local X (cm)"); profA->SetYTitle("Mean #Delta Z (cm)"); TLegend *legend = new TLegend(0.55,0.25,0.85,0.30, description); @@ -466,9 +516,9 @@ TProfile * ProfileMaxRow(TCut cut0, char *name, Int_t max){ TProfile *profA = new TProfile(name,name,max,0,max-1); char expr[100]; sprintf(expr,"Cl.fMax:Cl.fRow>>%s",name); - comp.fTree->Draw(expr,"Cl.fZ>0&&Cl.fMax<500"+cut0,"prof"); + comp.fTree->Draw(expr,"abs(Cl.fZ)>0&&Cl.fMax<500"+cut0,"prof"); profA->SetXTitle("Pad Row"); - profA->SetYTitle("Amplitude (ADC)"); + profA->SetYTitle("Amplitude at maxima (ADC)"); return profA; } @@ -479,9 +529,35 @@ TProfile * ProfileMaxPhi(TCut cut0, char *name, Int_t max){ TProfile *profA = new TProfile(name,name,max,-0.14,0.14); char expr[100]; sprintf(expr,"Cl.fMax:Cl.fY/Cl.fX>>%s",name); - comp.fTree->Draw(expr,"Cl.fZ>0&&Cl.fMax<500"+cut0,"prof"); + comp.fTree->Draw(expr,"abs(Cl.fZ)>0&&Cl.fMax<500"+cut0,"prof"); profA->SetXTitle("Local #phi(rad)"); - profA->SetYTitle("Amplitude (ADC)"); + profA->SetYTitle("Amplitude at maxima (ADC)"); + return profA; +} + +TProfile * ProfileQRow(TCut cut0, char *name, Int_t max){ + // + // make profile histrogram of amplitudes + // + TProfile *profA = new TProfile(name,name,max,0,max-1); + char expr[100]; + sprintf(expr,"Cl.fQ:Cl.fRow>>%s",name); + comp.fTree->Draw(expr,"abs(Cl.fZ)>0&&Cl.fMax<500"+cut0,"prof"); + profA->SetXTitle("Pad Row"); + profA->SetYTitle("Total charge(ADC)"); + return profA; +} + +TProfile * ProfileQPhi(TCut cut0, char *name, Int_t max){ + // + // make profile histrogram of amplitudes + // + TProfile *profA = new TProfile(name,name,max,-0.14,0.14); + char expr[100]; + sprintf(expr,"Cl.fQ:Cl.fY/Cl.fX>>%s",name); + comp.fTree->Draw(expr,"abs(Cl.fZ)>0&&Cl.fMax<500"+cut0,"prof"); + profA->SetXTitle("Local #phi(rad)"); + profA->SetYTitle("Total charge (ADC)"); return profA; } @@ -489,14 +565,38 @@ TProfile * ProfileQZ(TCut cut0, char *name, Int_t max){ // // make profile histrogram of amplitudes // - TF1 * f1 = new TF1("f1","[0]+[1]*[0]*(250-x)"); + TF1 * fline = new TF1("fline","[0]+[1]*[0]*(250-x)"); + TF1 * f1 = new TF1("f1","[0]*exp(-[1]*(250-x))"); TProfile *profA = new TProfile(name,name,max,0,250); char expr[100]; - sprintf(expr,"Cl.fQ:Cl.fZ>>%s",name); - comp.fTree->Draw(expr,"Cl.fZ>0&&Cl.fMax<500"+cut0,"prof"); + sprintf(expr,"Cl.fQ:abs(Cl.fZ)>>%s",name); + comp.fTree->Draw(expr,"abs(Cl.fZ)>0&&Cl.fMax<500"+cut0,"prof"); profA->SetXTitle("Z position (cm)"); profA->SetYTitle("Amplitude (ADC)"); char chc[100]; + profA->Fit(fline); + f1->SetParameter(0,fline->GetParameter(0)); + f1->SetParameter(1,fline->GetParameter(1)); + profA->Fit(f1); + sprintf(chc,"Exponential fit params: p_{0} = %f p_{1} = %f",f1->GetParameter(0),f1->GetParameter(1)); + printf("%s",chc); + TLegend *legend = new TLegend(0.25,0.12,0.85,0.25, chc); + legend->Draw(); + return profA; +} + +TProfile * ProfileMaxZ(TCut cut0, char *name, Int_t max){ + // + // make profile histrogram of amplitudes + // + TF1 * f1 = new TF1("f1","[0]+[1]*[0]*(250-x)"); + TProfile *profA = new TProfile(name,name,max,0,250); + char expr[100]; + sprintf(expr,"Cl.fMax:abs(Cl.fZ)>>%s",name); + comp.fTree->Draw(expr,"abs(Cl.fZ)>0&&Cl.fMax<500"+cut0,"prof"); + profA->SetXTitle("Z position (cm)"); + profA->SetYTitle("Amplitude at maxima (ADC)"); + char chc[100]; profA->Fit(f1); sprintf(chc,"p_{0} = %f p_{1} = %f",f1->GetParameter(0),f1->GetParameter(1)); TLegend *legend = new TLegend(0.25,0.12,0.85,0.35, chc); @@ -602,3 +702,5 @@ TCanvas * NoiseSector(TCut cut0, char * description, Int_t maxrow, Int_t maxpa return c; } + +