diff --git a/macro/beamtime/hd2020/pl_all_Track2D.C b/macro/beamtime/hd2020/pl_all_Track2D.C index 668b37b101b8cc23e208050a265f647bf0ad0c54..382bc4ed578e69fa27531edeeb6455becd270e63 100644 --- a/macro/beamtime/hd2020/pl_all_Track2D.C +++ b/macro/beamtime/hd2020/pl_all_Track2D.C @@ -1,136 +1,122 @@ -void pl_all_Track2D(Int_t iOpt=1, Int_t iNSt=2) -{ +void pl_all_Track2D(Int_t iOpt = 1, Int_t iNSt = 2) { // TCanvas *can = new TCanvas("can22","can22"); - // can->Divide(2,2); + // can->Divide(2,2); // TCanvas *can = new TCanvas("can","can",48,55,700,900); - TCanvas *can = new TCanvas("can","can",48,56,900,900); - can->Divide(5,6,0.01,0.01); - // can->Divide(2,2,0,0); - Float_t lsize=0.07; + TCanvas* can = new TCanvas("can", "can", 48, 56, 900, 900); + can->Divide(5, 6, 0.01, 0.01); + // can->Divide(2,2,0,0); + Float_t lsize = 0.07; - gPad->SetFillColor(0); - gStyle->SetPalette(1); - gStyle->SetLabelSize(lsize); + gPad->SetFillColor(0); + gStyle->SetPalette(1); + gStyle->SetLabelSize(lsize); - //gStyle->SetOptStat(kTRUE); - //gROOT->cd(); - //gROOT->SetDirLevel(2); + //gStyle->SetOptStat(kTRUE); + //gROOT->cd(); + //gROOT->SetDirLevel(2); - TH2 *h; - TH2 *h2; - const Int_t iType[6]={0,9,5,5,7,8}; - const Int_t iSmNum[6]={5,1,1,1,1,1}; - const Int_t iRpcNum[6]={5,1,1,1,1,8}; - TString cOpt; + TH2* h; + TH2* h2; + const Int_t iType[6] = {0, 9, 5, 5, 7, 8}; + const Int_t iSmNum[6] = {5, 1, 1, 1, 1, 1}; + const Int_t iRpcNum[6] = {5, 1, 1, 1, 1, 8}; + TString cOpt; - switch(iOpt){ - case 0: - cOpt="Size"; - break; - case 1: - cOpt="Pos"; - break; - case 2: - cOpt="TOff"; - break; - case 3: - cOpt="Tot"; - break; - case 4: - cOpt="Walk"; - break; - case 5: - cOpt="Walk"; - break; - case 6: - cOpt="Mul"; - break; - case 7: - cOpt="Trms"; - break; - case 8: - cOpt="DelPos"; - break; - case 9: - cOpt="DelTOff"; - break; - case 10: - cOpt="DelMatPos"; - break; - case 11: - cOpt="DelMatTOff"; - break; - default: - ; - } + switch (iOpt) { + case 0: cOpt = "Size"; break; + case 1: cOpt = "Pos"; break; + case 2: cOpt = "TOff"; break; + case 3: cOpt = "Tot"; break; + case 4: cOpt = "Walk"; break; + case 5: cOpt = "Walk"; break; + case 6: cOpt = "Mul"; break; + case 7: cOpt = "Trms"; break; + case 8: cOpt = "DelPos"; break; + case 9: cOpt = "DelTOff"; break; + case 10: cOpt = "DelMatPos"; break; + case 11: cOpt = "DelMatTOff"; break; + default:; + } - Int_t iDet=0; - Double_t dAvMean=0.; - Double_t dAvRMS=0.; - Int_t iCanv=0; + Int_t iDet = 0; + Double_t dAvMean = 0.; + Double_t dAvRMS = 0.; + Int_t iCanv = 0; - for(Int_t iSt=0; iSt<iNSt; iSt++){ - // cout << "plot station "<<iSt<<" with "<< iSmNum[iSt] <<" modules of "<<iRpcNum[iSt]<<" Rpcs each"<<endl; - for(Int_t iSm=0; iSm<iSmNum[iSt];iSm++){ - //cout << "plot module at station "<<iSt<<" with "<< iSmNum[iSt] <<" modules of "<<iRpcNum[iSt]<<" Rpcs each"<<endl; - for(Int_t iRp=0; iRp<iRpcNum[iSt];iRp++){ - //cout << "plot rpc at station "<<iSt<<" with "<< iSmNum[iSt] <<" modules of "<<iRpcNum[iSt]<<" Rpcs each"<<endl; - can->cd(iCanv+1); iCanv++; - gROOT->cd(); - TString hname=""; - Int_t iCol=1; - switch(iOpt) { - case 4: - for (Int_t iSide=0; iSide<2; iSide++) - for (Int_t iCh=0; iCh<32; iCh++) { - hname=Form("cal_SmT%01d_sm%03d_rpc%03d_Ch%03d_S%d_%s",iType[iSt],iSm,iRp,iCh,iSide,cOpt.Data()); - h=(TH2 *)gROOT->FindObjectAny(hname); - if (h!=NULL) { - TProfile *hProf=h->ProfileX(Form("%s_pfx%d%d",hname.Data(),iCh,iSide)); - hProf->SetLineColor(iCol); - hProf->SetLineStyle(1); - hProf->SetMarkerColor(iCol); - hProf->SetMarkerStyle(24+iSide); - iCol++; - if(iCh==0) iCol=1; - if(iCh==0 && iSide==0) { - hProf->SetMaximum(0.4); - hProf->SetMinimum(-0.4); - hProf->GetXaxis()->SetRangeUser(0.,10.); - hProf->Draw("LP"); - } else { - hProf->Draw("LPsame"); - } - } - - } - break; - default: - hname=Form("cal_SmT%01d_sm%03d_rpc%03d_%s",iType[iSt],iSm,iRp,cOpt.Data()); - h=(TH2 *)gROOT->FindObjectAny(hname); - if (h!=NULL) { - if (iOpt == 2 || iOpt==2 ) { - gPad->SetLogz(); - } - h->Draw("colz"); - h->ProfileX()->Draw("same"); - iDet++; - dAvMean += h->ProfileX()->GetMean(2); - dAvRMS += h->ProfileX()->GetRMS(2); - cout << "TrackQA " << cOpt.Data() <<" for TSR " << iType[iSt] << iSm << iRp << ": Off "<< h->ProfileX()->GetMean(2) - << ", RMS "<< h->ProfileX()->GetRMS(2) << endl; - } - } - } + for (Int_t iSt = 0; iSt < iNSt; iSt++) { + // cout << "plot station "<<iSt<<" with "<< iSmNum[iSt] <<" modules of "<<iRpcNum[iSt]<<" Rpcs each"<<endl; + for (Int_t iSm = 0; iSm < iSmNum[iSt]; iSm++) { + //cout << "plot module at station "<<iSt<<" with "<< iSmNum[iSt] <<" modules of "<<iRpcNum[iSt]<<" Rpcs each"<<endl; + for (Int_t iRp = 0; iRp < iRpcNum[iSt]; iRp++) { + //cout << "plot rpc at station "<<iSt<<" with "<< iSmNum[iSt] <<" modules of "<<iRpcNum[iSt]<<" Rpcs each"<<endl; + can->cd(iCanv + 1); + iCanv++; + gROOT->cd(); + TString hname = ""; + Int_t iCol = 1; + switch (iOpt) { + case 4: + for (Int_t iSide = 0; iSide < 2; iSide++) + for (Int_t iCh = 0; iCh < 32; iCh++) { + hname = Form("cal_SmT%01d_sm%03d_rpc%03d_Ch%03d_S%d_%s", + iType[iSt], + iSm, + iRp, + iCh, + iSide, + cOpt.Data()); + h = (TH2*) gROOT->FindObjectAny(hname); + if (h != NULL) { + TProfile* hProf = + h->ProfileX(Form("%s_pfx%d%d", hname.Data(), iCh, iSide)); + hProf->SetLineColor(iCol); + hProf->SetLineStyle(1); + hProf->SetMarkerColor(iCol); + hProf->SetMarkerStyle(24 + iSide); + iCol++; + if (iCh == 0) iCol = 1; + if (iCh == 0 && iSide == 0) { + hProf->SetMaximum(0.4); + hProf->SetMinimum(-0.4); + hProf->GetXaxis()->SetRangeUser(0., 10.); + hProf->Draw("LP"); + } else { + hProf->Draw("LPsame"); + } + } + } + break; + default: + hname = Form("cal_SmT%01d_sm%03d_rpc%03d_%s", + iType[iSt], + iSm, + iRp, + cOpt.Data()); + h = (TH2*) gROOT->FindObjectAny(hname); + if (h != NULL) { + if (iOpt == 2 || iOpt == 2) { gPad->SetLogz(); } + h->Draw("colz"); + h->ProfileX()->Draw("same"); + iDet++; + dAvMean += h->ProfileX()->GetMean(2); + dAvRMS += h->ProfileX()->GetRMS(2); + cout << "TrackQA " << cOpt.Data() << " for TSR " << iType[iSt] + << iSm << iRp << ": Off " << h->ProfileX()->GetMean(2) + << ", RMS " << h->ProfileX()->GetRMS(2) << endl; + } + } + } + } } - } - dAvMean /= (Double_t)iDet; - dAvRMS /= (Double_t)iDet; - cout << "TrackQA " << cOpt.Data() <<": AvOff "<< dAvMean << ", AvRMS "<< dAvRMS << endl; - dAvMean=TMath::Abs(dAvMean); - gROOT->ProcessLine(Form(".! echo %d > %sAvOff.res", (Int_t)(dAvMean*1.E4),cOpt.Data())); - gROOT->ProcessLine(Form(".! echo %d > %sAvRMS.res", (Int_t)(dAvRMS*1.E4),cOpt.Data())); - - can->SaveAs(Form("pl_all_Track_%s.pdf",cOpt.Data())); + dAvMean /= (Double_t) iDet; + dAvRMS /= (Double_t) iDet; + cout << "TrackQA " << cOpt.Data() << ": AvOff " << dAvMean << ", AvRMS " + << dAvRMS << endl; + dAvMean = TMath::Abs(dAvMean); + gROOT->ProcessLine( + Form(".! echo %d > %sAvOff.res", (Int_t)(dAvMean * 1.E4), cOpt.Data())); + gROOT->ProcessLine( + Form(".! echo %d > %sAvRMS.res", (Int_t)(dAvRMS * 1.E4), cOpt.Data())); -} + can->SaveAs(Form("pl_all_Track_%s.pdf", cOpt.Data())); +} diff --git a/macro/beamtime/pl_over_trk.C b/macro/beamtime/pl_over_trk.C index e9af558ef74448094bd9994840299212775fa531..0524c9c935d9387de2b7e76643465d62d281effe 100644 --- a/macro/beamtime/pl_over_trk.C +++ b/macro/beamtime/pl_over_trk.C @@ -208,13 +208,13 @@ void pl_over_trk(Int_t NSt = 4) { if (h1 != NULL) { h1->Draw(""); gPad->SetLogy(); - hname = Form("hCalDY0"); - TH1 *h1y = (TH1*) gROOT->FindObjectAny(hname); + hname = Form("hCalDY0"); + TH1* h1y = (TH1*) gROOT->FindObjectAny(hname); h1y->SetLineColor(2); h1y->Draw("same"); } else { cout << hname << " not found" << endl; - } + } can->cd(14); gROOT->cd(); diff --git a/macro/beamtime/pl_pull_trk.C b/macro/beamtime/pl_pull_trk.C index 7f7283c6f3cc00943043d548670972b409ef81a4..d18f38f1b3fe2025b54ed1adf870fb9afa69944e 100644 --- a/macro/beamtime/pl_pull_trk.C +++ b/macro/beamtime/pl_pull_trk.C @@ -1,4 +1,7 @@ -void pl_pull_trk(Int_t NSt = 8, Int_t iVar = 0, Int_t iFit = 0, Int_t iDrop=-1) { +void pl_pull_trk(Int_t NSt = 8, + Int_t iVar = 0, + Int_t iFit = 0, + Int_t iDrop = -1) { // TCanvas *can = new TCanvas("can22","can22"); // can->Divide(2,2); TCanvas* can = new TCanvas("can", "can", 50, 0, 800, 800); @@ -31,8 +34,8 @@ void pl_pull_trk(Int_t NSt = 8, Int_t iVar = 0, Int_t iFit = 0, Int_t iDrop=-1) Double_t vSigErr[MSt]; Double_t vResErr[MSt]; // if (h!=NULL) h->Delete(); - Int_t iCan = 1; - Int_t iIndSt=0; + Int_t iCan = 1; + Int_t iIndSt = 0; TString var; Double_t Nall; @@ -54,18 +57,18 @@ void pl_pull_trk(Int_t NSt = 8, Int_t iVar = 0, Int_t iFit = 0, Int_t iDrop=-1) gPad->SetLogy(); gPad->SetGridx(); if (iFit > 0) { - Double_t dFMean = h1->GetMean(); - Double_t dFLim = 3.0 * h1->GetRMS(); + Double_t dFMean = h1->GetMean(); + Double_t dFLim = 3.0 * h1->GetRMS(); Double_t dBinSize = h1->GetBinWidth(1); - dFLim=TMath::Max(dFLim,5.*dBinSize); + dFLim = TMath::Max(dFLim, 5. * dBinSize); TFitResultPtr fRes = h1->Fit("gaus", "S", "", dFMean - dFLim, dFMean + dFLim); //cout << " fRes = "<< fRes <<endl; if (-1 == fRes) continue; - if ( iDrop == iSt ) { // drop station from deconvolution - continue; - } - cout << "Add " << iSt << " as station index " << iIndSt << endl; + if (iDrop == iSt) { // drop station from deconvolution + continue; + } + cout << "Add " << iSt << " as station index " << iIndSt << endl; vSt[iIndSt] = iSt; vMean[iIndSt] = fRes->Parameter(1); vSig[iIndSt] = fRes->Parameter(2); diff --git a/macro/beamtime/pl_trk_Walk.C b/macro/beamtime/pl_trk_Walk.C index 4597de1dc2242ba36d7a436c67db949b6ad9bdb5..da00db6b3723161b7a190622157008ff86aa9db6 100644 --- a/macro/beamtime/pl_trk_Walk.C +++ b/macro/beamtime/pl_trk_Walk.C @@ -1,133 +1,150 @@ -void pl_trk_Walk(Int_t iId=900, Int_t iOpt=1, Double_t dMax=0.) -{ +void pl_trk_Walk(Int_t iId = 900, Int_t iOpt = 1, Double_t dMax = 0.) { // TCanvas *can = new TCanvas("can22","can22"); - // can->Divide(2,2); + // can->Divide(2,2); // TCanvas *can = new TCanvas("can","can",48,55,700,900); - TCanvas *can = new TCanvas("can","can",48,56,1400,900); - // can->Divide(2,2,0,0); - Float_t lsize=0.07; + TCanvas* can = new TCanvas("can", "can", 48, 56, 1400, 900); + // can->Divide(2,2,0,0); + Float_t lsize = 0.07; - gPad->SetFillColor(0); - gStyle->SetPalette(1); - gStyle->SetLabelSize(lsize); + gPad->SetFillColor(0); + gStyle->SetPalette(1); + gStyle->SetLabelSize(lsize); - //gStyle->SetOptStat(kTRUE); - //gROOT->cd(); - //gROOT->SetDirLevel(2); + //gStyle->SetOptStat(kTRUE); + //gROOT->cd(); + //gROOT->SetDirLevel(2); - TH2 *h; - TH2 *h2; - Int_t iRp=iId%10; - Int_t iSm=((iId-iRp)/10 )%10; - Int_t iTy=(iId-iSm*10-iRp)/100; + TH2* h; + TH2* h2; + Int_t iRp = iId % 10; + Int_t iSm = ((iId - iRp) / 10) % 10; + Int_t iTy = (iId - iSm * 10 - iRp) / 100; - TString cOpt="Walk"; + TString cOpt = "Walk"; - Int_t iDet=0; - Int_t iCanv=0; + Int_t iDet = 0; + Int_t iCanv = 0; - gROOT->cd(); - TString hname=""; - Int_t iCol=1; - switch(iOpt) { - case 0:; - break; - case 1: - { - can->Divide(4,8,0.01,0.01); - for (Int_t iCh=0; iCh<32; iCh++) { - can->cd(iCanv+1); iCanv++; - for (Int_t iSide=0; iSide<2; iSide++) { - hname=Form("cal_SmT%01d_sm%03d_rpc%03d_Ch%03d_S%d_%s",iTy,iSm,iRp,iCh,iSide,cOpt.Data()); - h=(TH2 *)gROOT->FindObjectAny(hname); - if (h!=NULL) { - TProfile *hProf=h->ProfileX(Form("%s_pfx%d%d",hname.Data(),iCh,iSide)); - iCol=iSide+2; + gROOT->cd(); + TString hname = ""; + Int_t iCol = 1; + switch (iOpt) { + case 0:; break; + case 1: { + can->Divide(4, 8, 0.01, 0.01); + for (Int_t iCh = 0; iCh < 32; iCh++) { + can->cd(iCanv + 1); + iCanv++; + for (Int_t iSide = 0; iSide < 2; iSide++) { + hname = Form("cal_SmT%01d_sm%03d_rpc%03d_Ch%03d_S%d_%s", + iTy, + iSm, + iRp, + iCh, + iSide, + cOpt.Data()); + h = (TH2*) gROOT->FindObjectAny(hname); + if (h != NULL) { + TProfile* hProf = + h->ProfileX(Form("%s_pfx%d%d", hname.Data(), iCh, iSide)); + iCol = iSide + 2; hProf->SetLineColor(iCol); hProf->SetMarkerColor(iCol); - hProf->SetMarkerStyle(20+iSide); - if(iSide==0) { - if(dMax>0.) { - hProf->SetMaximum(dMax); - hProf->SetMinimum(-dMax); - } - hProf->Draw(); - } else { - hProf->Draw("same"); - } - } - - } - } - break; - - case 20: - { - can->Divide(4,8,0.01,0.01); - for (Int_t iCh=0; iCh<32; iCh++) { - can->cd(iCanv+1); iCanv++; - Int_t iSide=0; - hname=Form("cal_SmT%01d_sm%03d_rpc%03d_Ch%03d_S%d_%s",iTy,iSm,iRp,iCh,iSide,cOpt.Data()); - h=(TH2 *)gROOT->FindObjectAny(hname); - if (h!=NULL) { - if(dMax>0.) { -// h->GetYAxis()->SetMaximum(dMax); -// h->GetYAxis()->SetMinimum(-dMax); - } - h->Draw("colz"); - } - } - } - break; - - case 21: - { - can->Divide(4,8,0.01,0.01); - for (Int_t iCh=0; iCh<32; iCh++) { - can->cd(iCanv+1); iCanv++; - Int_t iSide=1; - hname=Form("cal_SmT%01d_sm%03d_rpc%03d_Ch%03d_S%d_%s",iTy,iSm,iRp,iCh,iSide,cOpt.Data()); - h=(TH2 *)gROOT->FindObjectAny(hname); - if (h!=NULL) { - h->Draw("colz"); - } - } - } - break; - - case 200: - { - can->Divide(4,8,0.01,0.01); - for (Int_t iCh=0; iCh<32; iCh++) { - can->cd(iCanv+1); iCanv++; - Int_t iSide=0; - hname=Form("cl_SmT%01d_sm%03d_rpc%03d_Ch%03d_S%d_%s",iTy,iSm,iRp,iCh,iSide,cOpt.Data()); - h=(TH2 *)gROOT->FindObjectAny(hname); - if (h!=NULL) { - h->Draw("colz"); - } - } - } - break; - - case 201: - { - can->Divide(4,8,0.01,0.01); - for (Int_t iCh=0; iCh<32; iCh++) { - can->cd(iCanv+1); iCanv++; - Int_t iSide=1; - hname=Form("cl_SmT%01d_sm%03d_rpc%03d_Ch%03d_S%d_%s",iTy,iSm,iRp,iCh,iSide,cOpt.Data()); - h=(TH2 *)gROOT->FindObjectAny(hname); - if (h!=NULL) { - h->Draw("colz"); - } - } - } - break; - - default: - ; - } - } - can->SaveAs(Form("pl_trk_Walk_%d.pdf",iId)); -} + hProf->SetMarkerStyle(20 + iSide); + if (iSide == 0) { + if (dMax > 0.) { + hProf->SetMaximum(dMax); + hProf->SetMinimum(-dMax); + } + hProf->Draw(); + } else { + hProf->Draw("same"); + } + } + } + } + break; + + case 20: { + can->Divide(4, 8, 0.01, 0.01); + for (Int_t iCh = 0; iCh < 32; iCh++) { + can->cd(iCanv + 1); + iCanv++; + Int_t iSide = 0; + hname = Form("cal_SmT%01d_sm%03d_rpc%03d_Ch%03d_S%d_%s", + iTy, + iSm, + iRp, + iCh, + iSide, + cOpt.Data()); + h = (TH2*) gROOT->FindObjectAny(hname); + if (h != NULL) { + if (dMax > 0.) { + // h->GetYAxis()->SetMaximum(dMax); + // h->GetYAxis()->SetMinimum(-dMax); + } + h->Draw("colz"); + } + } + } break; + + case 21: { + can->Divide(4, 8, 0.01, 0.01); + for (Int_t iCh = 0; iCh < 32; iCh++) { + can->cd(iCanv + 1); + iCanv++; + Int_t iSide = 1; + hname = Form("cal_SmT%01d_sm%03d_rpc%03d_Ch%03d_S%d_%s", + iTy, + iSm, + iRp, + iCh, + iSide, + cOpt.Data()); + h = (TH2*) gROOT->FindObjectAny(hname); + if (h != NULL) { h->Draw("colz"); } + } + } break; + + case 200: { + can->Divide(4, 8, 0.01, 0.01); + for (Int_t iCh = 0; iCh < 32; iCh++) { + can->cd(iCanv + 1); + iCanv++; + Int_t iSide = 0; + hname = Form("cl_SmT%01d_sm%03d_rpc%03d_Ch%03d_S%d_%s", + iTy, + iSm, + iRp, + iCh, + iSide, + cOpt.Data()); + h = (TH2*) gROOT->FindObjectAny(hname); + if (h != NULL) { h->Draw("colz"); } + } + } break; + + case 201: { + can->Divide(4, 8, 0.01, 0.01); + for (Int_t iCh = 0; iCh < 32; iCh++) { + can->cd(iCanv + 1); + iCanv++; + Int_t iSide = 1; + hname = Form("cl_SmT%01d_sm%03d_rpc%03d_Ch%03d_S%d_%s", + iTy, + iSm, + iRp, + iCh, + iSide, + cOpt.Data()); + h = (TH2*) gROOT->FindObjectAny(hname); + if (h != NULL) { h->Draw("colz"); } + } + } break; + + default:; + } + } + can->SaveAs(Form("pl_trk_Walk_%d.pdf", iId)); +} diff --git a/macro/beamtime/pl_vert_trk.C b/macro/beamtime/pl_vert_trk.C index 9975cab8da19cc62682cf80d8ce80e6d97f6158c..f4ad939271e89558aac1eeda808765e5f7322509 100644 --- a/macro/beamtime/pl_vert_trk.C +++ b/macro/beamtime/pl_vert_trk.C @@ -1,4 +1,4 @@ -void pl_vert_trk(Double_t dFitWidth=0.) { +void pl_vert_trk(Double_t dFitWidth = 0.) { // TCanvas *can = new TCanvas("can22","can22"); // can->Divide(2,2); TCanvas* can = new TCanvas("can", "can", 50, 0, 800, 800); @@ -29,55 +29,64 @@ void pl_vert_trk(Double_t dFitWidth=0.) { can->cd(2); gROOT->cd(); - Double_t MeanX0=0.; - Double_t SigX0=0.; - Double_t MeanX0Err=0.; - Double_t SigX0Err=0.; - h1 = (TH1*) h2->ProjectionX(); + Double_t MeanX0 = 0.; + Double_t SigX0 = 0.; + Double_t MeanX0Err = 0.; + Double_t SigX0Err = 0.; + h1 = (TH1*) h2->ProjectionX(); if (h1 != NULL) { Double_t dFMean = h1->GetMean(); Double_t dFLim = 2.0 * h1->GetRMS(); - dFMean=h1->GetBinCenter( h1-> GetMaximumBin() ); - if(dFitWidth > 0.) dFLim=dFitWidth; + dFMean = h1->GetBinCenter(h1->GetMaximumBin()); + if (dFitWidth > 0.) dFLim = dFitWidth; TFitResultPtr fRes = - h1->Fit("gaus", "QS", "", dFMean - dFLim, dFMean + dFLim); + h1->Fit("gaus", "QS", "", dFMean - dFLim, dFMean + dFLim); //cout << " fRes = "<< fRes <<endl; if (-1 != fRes) { MeanX0 = fRes->Parameter(1); SigX0 = fRes->Parameter(2); - MeanX0Err = 0.; + MeanX0Err = 0.; MeanX0Err = fRes->ParError(1); SigX0Err = fRes->ParError(2); - } + } } - Double_t MeanY0=0.; - Double_t SigY0=0.; - Double_t MeanY0Err=0.; - Double_t SigY0Err=0.; - h1 = (TH1*) h2->ProjectionY(); + Double_t MeanY0 = 0.; + Double_t SigY0 = 0.; + Double_t MeanY0Err = 0.; + Double_t SigY0Err = 0.; + h1 = (TH1*) h2->ProjectionY(); if (h1 != NULL) { Double_t dFMean = h1->GetMean(); Double_t dFLim = 2.0 * h1->GetRMS(); - dFMean=h1->GetBinCenter( h1-> GetMaximumBin() ); - if(dFitWidth > 0.) dFLim=dFitWidth; + dFMean = h1->GetBinCenter(h1->GetMaximumBin()); + if (dFitWidth > 0.) dFLim = dFitWidth; TFitResultPtr fRes = - h1->Fit("gaus", "QS", "same", dFMean - dFLim, dFMean + dFLim); - h1->SetLineColor(7); + h1->Fit("gaus", "QS", "same", dFMean - dFLim, dFMean + dFLim); + h1->SetLineColor(7); //cout << " fRes = "<< fRes <<endl; if (-1 != fRes) { MeanY0 = fRes->Parameter(1); SigY0 = fRes->Parameter(2); - MeanY0Err = 0.; + MeanY0Err = 0.; MeanY0Err = fRes->ParError(1); SigY0Err = fRes->ParError(2); - } + } } - - - cout << Form("TrkXY0_0: MeanX %6.2f (%5.2f), SigX %6.2f (%5.2f) ",MeanX0, MeanX0Err, SigX0, SigX0Err) - << Form(" MeanY %6.2f (%5.2f), SigY %6.2f (%5.2f) ",MeanY0, MeanY0Err, SigY0, SigY0Err) << endl; - + + + cout << Form("TrkXY0_0: MeanX %6.2f (%5.2f), SigX %6.2f (%5.2f) ", + MeanX0, + MeanX0Err, + SigX0, + SigX0Err) + << Form(" MeanY %6.2f (%5.2f), SigY %6.2f (%5.2f) ", + MeanY0, + MeanY0Err, + SigY0, + SigY0Err) + << endl; + can->cd(3); gROOT->cd(); hname = Form("hTrklXY0_1"); @@ -85,54 +94,62 @@ void pl_vert_trk(Double_t dFitWidth=0.) { if (h2 != NULL) { h2->Draw("colz"); gPad->SetLogz(); - Double_t MeanX1=0.; - Double_t SigX1=0.; - Double_t MeanX1Err=0.; - Double_t SigX1Err=0.; - h1 = (TH1*) h2->ProjectionX(); - if (h1 != NULL) { + Double_t MeanX1 = 0.; + Double_t SigX1 = 0.; + Double_t MeanX1Err = 0.; + Double_t SigX1Err = 0.; + h1 = (TH1*) h2->ProjectionX(); + if (h1 != NULL) { Double_t dFMean = h1->GetMean(); Double_t dFLim = 2.0 * h1->GetRMS(); - dFMean=h1->GetBinCenter( h1-> GetMaximumBin() ); - if(dFitWidth > 0.) dFLim=dFitWidth; + dFMean = h1->GetBinCenter(h1->GetMaximumBin()); + if (dFitWidth > 0.) dFLim = dFitWidth; TFitResultPtr fRes = h1->Fit("gaus", "QS", "", dFMean - dFLim, dFMean + dFLim); //cout << " fRes = "<< fRes <<endl; if (-1 != fRes) { - MeanX1 = fRes->Parameter(1); - SigX1 = fRes->Parameter(2); - MeanX1Err = 0.; - MeanX1Err = fRes->ParError(1); - SigX1Err = fRes->ParError(2); - } - - Double_t MeanY1=0.; - Double_t SigY1=0.; - Double_t MeanY1Err=0.; - Double_t SigY1Err=0.; - h1 = (TH1*) h2->ProjectionY(); - if (h1 != NULL) { - Double_t dFMean = h1->GetMean(); - Double_t dFLim = 2.0 * h1->GetRMS(); - dFMean=h1->GetBinCenter( h1-> GetMaximumBin() ); - if(dFitWidth > 0.) dFLim=dFitWidth; - TFitResultPtr fRes = + MeanX1 = fRes->Parameter(1); + SigX1 = fRes->Parameter(2); + MeanX1Err = 0.; + MeanX1Err = fRes->ParError(1); + SigX1Err = fRes->ParError(2); + } + + Double_t MeanY1 = 0.; + Double_t SigY1 = 0.; + Double_t MeanY1Err = 0.; + Double_t SigY1Err = 0.; + h1 = (TH1*) h2->ProjectionY(); + if (h1 != NULL) { + Double_t dFMean = h1->GetMean(); + Double_t dFLim = 2.0 * h1->GetRMS(); + dFMean = h1->GetBinCenter(h1->GetMaximumBin()); + if (dFitWidth > 0.) dFLim = dFitWidth; + TFitResultPtr fRes = h1->Fit("gaus", "QS", "same", dFMean - dFLim, dFMean + dFLim); h1->SetLineColor(7); //cout << " fRes = "<< fRes <<endl; if (-1 != fRes) { - MeanY1 = fRes->Parameter(1); - SigY1 = fRes->Parameter(2); - MeanY1Err = 0.; - MeanY1Err = fRes->ParError(1); - SigY1Err = fRes->ParError(2); - } - } - - cout << Form("TrkXY0_1: MeanX %6.2f (%5.2f), SigX %6.2f (%5.2f) ",MeanX1, MeanX1Err, SigX1, SigX1Err) - << Form(" MeanY %6.2f (%5.2f), SigY %6.2f (%5.2f) ",MeanY1, MeanY1Err, SigY1, SigY1Err) << endl; - - } + MeanY1 = fRes->Parameter(1); + SigY1 = fRes->Parameter(2); + MeanY1Err = 0.; + MeanY1Err = fRes->ParError(1); + SigY1Err = fRes->ParError(2); + } + } + + cout << Form("TrkXY0_1: MeanX %6.2f (%5.2f), SigX %6.2f (%5.2f) ", + MeanX1, + MeanX1Err, + SigX1, + SigX1Err) + << Form(" MeanY %6.2f (%5.2f), SigY %6.2f (%5.2f) ", + MeanY1, + MeanY1Err, + SigY1, + SigY1Err) + << endl; + } } else { cout << hname << " not found" << endl; @@ -159,58 +176,67 @@ void pl_vert_trk(Double_t dFitWidth=0.) { } else { cout << hname << " not found" << endl; } - + can->cd(10); if (h2 != NULL) { h2->Draw("colz"); gPad->SetLogz(); - Double_t MeanX1=0.; - Double_t SigX1=0.; - Double_t MeanX1Err=0.; - Double_t SigX1Err=0.; - h1 = (TH1*) h2->ProjectionX(); - if (h1 != NULL) { + Double_t MeanX1 = 0.; + Double_t SigX1 = 0.; + Double_t MeanX1Err = 0.; + Double_t SigX1Err = 0.; + h1 = (TH1*) h2->ProjectionX(); + if (h1 != NULL) { Double_t dFMean = h1->GetMean(); Double_t dFLim = 2.0 * h1->GetRMS(); - dFMean=h1->GetBinCenter( h1-> GetMaximumBin() ); - if(dFitWidth > 0.) dFLim=dFitWidth; + dFMean = h1->GetBinCenter(h1->GetMaximumBin()); + if (dFitWidth > 0.) dFLim = dFitWidth; TFitResultPtr fRes = h1->Fit("gaus", "QS", "", dFMean - dFLim, dFMean + dFLim); //cout << " fRes = "<< fRes <<endl; if (-1 != fRes) { - MeanX1 = fRes->Parameter(1); - SigX1 = fRes->Parameter(2); - MeanX1Err = 0.; - MeanX1Err = fRes->ParError(1); - SigX1Err = fRes->ParError(2); - } - - Double_t MeanY1=0.; - Double_t SigY1=0.; - Double_t MeanY1Err=0.; - Double_t SigY1Err=0.; - h1 = (TH1*) h2->ProjectionY(); - if (h1 != NULL) { - Double_t dFMean = h1->GetMean(); - Double_t dFLim = 2.0 * h1->GetRMS(); - dFMean=h1->GetBinCenter( h1-> GetMaximumBin() ); - if(dFitWidth > 0.) dFLim=dFitWidth; - TFitResultPtr fRes = + MeanX1 = fRes->Parameter(1); + SigX1 = fRes->Parameter(2); + MeanX1Err = 0.; + MeanX1Err = fRes->ParError(1); + SigX1Err = fRes->ParError(2); + } + + Double_t MeanY1 = 0.; + Double_t SigY1 = 0.; + Double_t MeanY1Err = 0.; + Double_t SigY1Err = 0.; + h1 = (TH1*) h2->ProjectionY(); + if (h1 != NULL) { + Double_t dFMean = h1->GetMean(); + Double_t dFLim = 2.0 * h1->GetRMS(); + dFMean = h1->GetBinCenter(h1->GetMaximumBin()); + if (dFitWidth > 0.) dFLim = dFitWidth; + TFitResultPtr fRes = h1->Fit("gaus", "QS", "same", dFMean - dFLim, dFMean + dFLim); h1->SetLineColor(7); //cout << " fRes = "<< fRes <<endl; if (-1 != fRes) { - MeanY1 = fRes->Parameter(1); - SigY1 = fRes->Parameter(2); - MeanY1Err = 0.; - MeanY1Err = fRes->ParError(1); - SigY1Err = fRes->ParError(2); - } - } - - cout << Form("VTX0: MeanX %6.2f (%5.2f), SigX %6.2f (%5.2f) ",MeanX1, MeanX1Err, SigX1, SigX1Err) - << Form(" MeanY %6.2f (%5.2f), SigY %6.2f (%5.2f) ",MeanY1, MeanY1Err, SigY1, SigY1Err) << endl; - } + MeanY1 = fRes->Parameter(1); + SigY1 = fRes->Parameter(2); + MeanY1Err = 0.; + MeanY1Err = fRes->ParError(1); + SigY1Err = fRes->ParError(2); + } + } + + cout << Form("VTX0: MeanX %6.2f (%5.2f), SigX %6.2f (%5.2f) ", + MeanX1, + MeanX1Err, + SigX1, + SigX1Err) + << Form(" MeanY %6.2f (%5.2f), SigY %6.2f (%5.2f) ", + MeanY1, + MeanY1Err, + SigY1, + SigY1Err) + << endl; + } } @@ -258,5 +284,4 @@ void pl_vert_trk(Double_t dFitWidth=0.) { cout << hname << " not found" << endl; } can->SaveAs(Form("pl_vtx.pdf")); - } diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20a_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20a_mcbm.C index ad18141ecd25560373e6654f630ec03e7e9cab3e..c64eecb92215e906d573a3a52c6b69fe69443256 100644 --- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20a_mcbm.C +++ b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20a_mcbm.C @@ -44,8 +44,8 @@ const TString FileNameInfo = fileTag + "_mcbm.geo.info"; // TOF_Z_Front corresponds to front cover of outer super module towers const Float_t TOF_Z_Front_Stand = 247.2; // = z=298 mCBM@SIS18 -const Float_t TOF_X_Front_Stand = 0.; // = z=298 mCBM@SIS18 -const Float_t TOF_Z_Front = 0.; // = z=298 mCBM@SIS18 +const Float_t TOF_X_Front_Stand = 0.; // = z=298 mCBM@SIS18 +const Float_t TOF_Z_Front = 0.; // = z=298 mCBM@SIS18 //const Float_t TOF_Z_Front = 130; // = z=225 mCBM@SIS18 //const Float_t TOF_Z_Front = 250; // SIS 100 hadron //const Float_t TOF_Z_Front = 450; // SIS 100 hadron @@ -317,19 +317,19 @@ void Create_TOF_Geometry_v20a_mcbm() { TGeoTranslation* stand_trans_local = new TGeoTranslation("", TOF_X_Front_Stand, 0., 0.); TGeoTranslation* stand_trans = - new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand); + new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand); TGeoCombiTrans* stand_combi_trans = - new TGeoCombiTrans(*stand_trans, *tof_rotation); - + new TGeoCombiTrans(*stand_trans, *tof_rotation); + // Nov 2019 run // TGeoTranslation* stand_trans = new TGeoTranslation("", 12., 0., TOF_Z_Front_Stand); // TGeoTranslation* stand_trans = new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand); TGeoRotation* stand_rot = new TGeoRotation(); stand_rot->RotateY(0.55); - //stand_rot->RotateY(1.0); + //stand_rot->RotateY(1.0); TGeoCombiTrans* stand_combi_trans_local = new TGeoCombiTrans(*stand_trans_local, *stand_rot); - + //tof->AddNode(tofstand, 1, stand_combi_trans); tof->AddNode(tofstand, 1, stand_combi_trans_local); //tof->AddNode(tofstand, 1); diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20b_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20b_mcbm.C index 2ee08762e5637a81dd1512d11e9bb3463634897b..ccf46779da76753233773f3517d505aed9fa0767 100644 --- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20b_mcbm.C +++ b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20b_mcbm.C @@ -45,7 +45,7 @@ const TString FileNameInfo = fileTag + "_mcbm.geo.info"; // TOF_Z_Front corresponds to front cover of outer super module towers const Float_t TOF_Z_Front_Stand = 247.2; // = z=298 mCBM@SIS18 -const Float_t TOF_X_Front_Stand = -1.6; // = z=298 mCBM@SIS18 +const Float_t TOF_X_Front_Stand = -1.6; // = z=298 mCBM@SIS18 const Float_t TOF_Z_Front = 0; // = z=298 mCBM@SIS18 //const Float_t TOF_Z_Front = 130; // = z=225 mCBM@SIS18 //const Float_t TOF_Z_Front = 250; // SIS 100 hadron @@ -213,7 +213,7 @@ const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = const Float_t Star2_First_Z_Position = TOF_Z_Front + 16.5; const Float_t Star2_Delta_Z_Position = 0.; const Float_t Star2_First_Y_Position = 30.35; // -const Float_t Star2_Delta_Y_Position = 0.; // +const Float_t Star2_Delta_Y_Position = 0.; // const Float_t Star2_rotate_Z = -90.; const Int_t Star2_NTypes = 1; const Float_t Star2_Types[Star2_NTypes] = {9.}; diff --git a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20f_mcbm.C b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20f_mcbm.C index 64a14cc67c57779c7eee5d9730859d39cf20d889..7b7df27b06931ccae026696fb68d8c9a33fb1aaf 100644 --- a/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20f_mcbm.C +++ b/macro/mcbm/geometry/tof/Create_TOF_Geometry_v20f_mcbm.C @@ -45,8 +45,8 @@ const TString FileNameInfo = fileTag + "_mcbm.geo.info"; // TOF_Z_Front corresponds to front cover of outer super module towers const Float_t TOF_Z_Front_Stand = 247.2; // = z=298 mCBM@SIS18 -const Float_t TOF_X_Front_Stand = 0.; // = z=298 mCBM@SIS18 -const Float_t TOF_Z_Front = 0.; // = z=298 mCBM@SIS18 +const Float_t TOF_X_Front_Stand = 0.; // = z=298 mCBM@SIS18 +const Float_t TOF_Z_Front = 0.; // = z=298 mCBM@SIS18 //const Float_t TOF_Z_Front = 130; // = z=225 mCBM@SIS18 //const Float_t TOF_Z_Front = 250; // SIS 100 hadron //const Float_t TOF_Z_Front = 450; // SIS 100 hadron @@ -213,7 +213,7 @@ const Float_t Outer_Module_Number[Outer_Module_NTypes][Outer_Module_Col] = const Float_t Star2_First_Z_Position = TOF_Z_Front + 16.5; const Float_t Star2_Delta_Z_Position = 0.; const Float_t Star2_First_Y_Position = 30.35; // -const Float_t Star2_Delta_Y_Position = 0.; // +const Float_t Star2_Delta_Y_Position = 0.; // const Float_t Star2_rotate_Z = -90.; const Int_t Star2_NTypes = 1; const Float_t Star2_Types[Star2_NTypes] = {9.}; @@ -325,10 +325,10 @@ void Create_TOF_Geometry_v20f_mcbm() { TGeoTranslation* stand_trans_local = new TGeoTranslation("", TOF_X_Front_Stand, 0., 0.); TGeoTranslation* stand_trans = - new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand); + new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand); TGeoCombiTrans* stand_combi_trans = - new TGeoCombiTrans(*stand_trans, *tof_rotation); - + new TGeoCombiTrans(*stand_trans, *tof_rotation); + // Nov 2019 run // TGeoTranslation* stand_trans = new TGeoTranslation("", 12., 0., TOF_Z_Front_Stand); // TGeoTranslation* stand_trans = new TGeoTranslation("", 0., 0., TOF_Z_Front_Stand); @@ -337,7 +337,7 @@ void Create_TOF_Geometry_v20f_mcbm() { //stand_rot->RotateY(1.0); TGeoCombiTrans* stand_combi_trans_local = new TGeoCombiTrans(*stand_trans_local, *stand_rot); - + //tof->AddNode(tofstand, 1, stand_combi_trans); tof->AddNode(tofstand, 1, stand_combi_trans_local); //tof->AddNode(tofstand, 1); diff --git a/sim/detectors/tof/CbmTofDigitize.cxx b/sim/detectors/tof/CbmTofDigitize.cxx index f536b3bcaef429a3c8b0c5f327a0f36c666d7e71..f5e9c11efea2514c1e62b39440011abc3fe58166 100644 --- a/sim/detectors/tof/CbmTofDigitize.cxx +++ b/sim/detectors/tof/CbmTofDigitize.cxx @@ -2362,7 +2362,7 @@ Bool_t CbmTofDigitize::DigitizeFlatDisc() { Double_t dChargeCentral = dClustCharge * ComputeClusterAreaOnChannel( - iChanId, dClusterSize, poipos_local[0], poipos_local[1]); + iChanId, dClusterSize, poipos_local[0], poipos_local[1]); LOG(debug2) << "CbmTofDigitize::DigitizeFlatDisc: ChargeCentral " << dChargeCentral << ", " << dClustCharge << Form(", 0x%08x", iChanId) << ", " << dClusterSize << ", " @@ -2721,7 +2721,7 @@ Bool_t CbmTofDigitize::DigitizeFlatDisc() { Double_t dChargeSideCh = dClustCharge * ComputeClusterAreaOnChannel( - iSideChId, dClusterSize, poipos_local[0], poipos_local[1]); + iSideChId, dClusterSize, poipos_local[0], poipos_local[1]); dChargeSideCh /= dClustArea; if (dClustCharge + 0.0000001 < dChargeSideCh) { LOG(error) << "CbmTofDigitize::DigitizeFlatDisc => Side Charge " @@ -2970,7 +2970,7 @@ Bool_t CbmTofDigitize::DigitizeFlatDisc() { Double_t dChargeSideCh = dClustCharge * ComputeClusterAreaOnChannel( - iSideChId, dClusterSize, poipos_local[0], poipos_local[1]); + iSideChId, dClusterSize, poipos_local[0], poipos_local[1]); dChargeSideCh /= dClustArea; // Fee Threshold on charge @@ -3047,7 +3047,7 @@ Bool_t CbmTofDigitize::DigitizeFlatDisc() { Double_t dChargeSideCh = dClustCharge * ComputeClusterAreaOnChannel( - iSideChId, dClusterSize, poipos_local[0], poipos_local[1]); + iSideChId, dClusterSize, poipos_local[0], poipos_local[1]); // Fee Threshold on charge if (dChargeSideCh @@ -4134,16 +4134,16 @@ Bool_t CbmTofDigitize::DigitizeGaussCharge() { dClustToReadout = TMath::Sqrt( TMath::Power(poipos_local[1], 2) + TMath::Power( - poipos_local[0] - - (+(1 - 2 * iRow) * fChannelInfo->GetSizex() / 2.0), - 2)); + poipos_local[0] + - (+(1 - 2 * iRow) * fChannelInfo->GetSizex() / 2.0), + 2)); else // Horizontal => base = bottom/upper edge dClustToReadout = TMath::Sqrt( TMath::Power(poipos_local[0], 2) + TMath::Power( - poipos_local[1] - - (-(1 - 2 * iRow) * fChannelInfo->GetSizey() / 2.0), - 2)); + poipos_local[1] + - (-(1 - 2 * iRow) * fChannelInfo->GetSizey() / 2.0), + 2)); dPadTime += gRandom->Gaus(0.0, fdTimeResElec)