//================================================================
// Simplified VDC layout for Garfield
//
// VDC consists of one wire plane and two HV planes.
// Garfield forces us to use this orientation of the VDC since
// in Garfiled you can only define a X-RANGE **only** for a XT-PLOT ...
// (There is no YT-PLOT defined in Garfield)
//
// | | /
// | * |/
// | | |
// | * /| Y |
// | / | |
// | * | ------> X
// | / | used coordinate system
// |/ * |
// | |
// /| * |
// / | |
// / | * |
//
// The track Angle within garfield is in respect to the Y axis !!!
// So the track angle is alpha=90-beta for Garfield.
//=================================================================
Double_t angle(Double_t *x,Double_t *par)
{
Double_t Alpha = 0.0; // Initialize output value
Double_t Phi = par[0]; // Phi , nominal+-~20 deg due to Main Magnet dispersion
Double_t Theta = x[0]; // Theta, nominal 45+-5 deg, tilt angle of VDC
// x[0]: running variable
// Gamma_CutPlane defined by Mainz: angle of cut plane (perp. to wire )
// 90-Gamma_CutPlane is string angle in respect to Qweak long frame
// /
// ------------- Y
// | / | |
// | / | |
// ------------- -------- X
// /
// / wire angle par[1] measure in respect to X-axis
//
// The CutPlane is measured in respect to the Y-axis
// par[1]: Qweak wire string angle measured against VDC long side
// : identical to the Gamma_CutPlane Angle measured against VDC short side
// The famous angle transformation formula:
Alpha = 90.0 - TMath::ATan( (TMath::Sqrt( TMath::Power(TMath::Tan(x[0]*TMath::DegToRad()),2) + TMath::Power(TMath::Tan(par[0]*TMath::DegToRad()),2) )) * TMath::Cos( par[1]*TMath::DegToRad() - TMath::ATan(TMath::Tan(par[0]*TMath::DegToRad())/TMath::Tan(x[0]*TMath::DegToRad()) )) )*TMath::RadToDeg() ;
return Alpha;
}
void TrackAngleTrafo()
{
gROOT->Reset();
gStyle->SetOptStat(kFALSE); // no statistics box
Double_t Theta_Min = 30.0; //degree
Double_t Theta_Max = 60.0; //degree
//-------------------------------------------------------
c1 = new TCanvas("c1","TrackAngleTrafo",200,10,700,500);
c1->Divide(1,2);
c1_1->SetGridx();
c1_1->SetGridy();
c1_2->SetGridx();
c1_2->SetGridy();
//-------------------------------------------------------
Int_t color[9] = {kMagenta,kBlue,kBlue,kBlue,kRed,kRed,kRed, kGreen,kBlack};
Int_t lstyle[9] = {1, 1, 2, 4, 1, 2, 4, 1, 1};
Double_t UWire_StringAngle[9] = { 0.1, 30.0, 30.0, 30.0, 45.0, 45.0, 45.0, 60.0, 90.0};
Double_t VWire_StringAngle[9] = {-0.1, -30.0, -30.0, -30.0, -45.0, -45.0, -45.0, -60.0, -90.0};
Double_t Phi_Angle[9] = { 0.0, 0.0, -20.0, 20.0, 0.0, -20.0, 20.0, 0.0, 0.0};
const char *const uftitle[9] =
{
"uhurz1",
"uhurz2",
"uhurz3",
"uhurz4",
"uhurz5",
"uhurz6",
"uhurz7",
"uhurz8",
"uhurz9"
};
const char *const vftitle[9] =
{
"vhurz1",
"vhurz2",
"vhurz3",
"vhurz4",
"vhurz5",
"vhurz6",
"vhurz7",
"vhurz8",
"vhurz9"
};
TF1 *utrafo[9];
TF1 *vtrafo[9];
for(int j = 0; j < 9; j++)
{
utrafo[j]= new TF1(uftitle[j],angle, Theta_Min, Theta_Max, 3);
utrafo[j]->SetParName(0,"Phi");
utrafo[j]->SetParameter(0, Phi_Angle[j]);
utrafo[j]->SetParName(1,"Wire_StringAngle");
utrafo[j]->SetParameter(1, UWire_StringAngle[j]);
utrafo[j]->SetParName(2,"Offset");
utrafo[j]->SetParameter(2, 0.0);
utrafo[j]->SetLineColor(color[j]);
utrafo[j]->SetLineStyle(lstyle[j]);
utrafo[j]->SetLineWidth(1);
cout << "--------------" << endl;
cout << "Theta= 45, Phi= " << Phi_Angle[j] << ", Wire Angle= " << UWire_StringAngle[j] <<", Alpha= " << utrafo[j]->Eval(45.0) << endl;
}
cout << "################################" << endl;
for(int j = 0; j < 9; j++)
{
vtrafo[j]= new TF1(vftitle[j],angle, Theta_Min, Theta_Max, 3);
vtrafo[j]->SetParName(0,"Phi");
vtrafo[j]->SetParameter(0, Phi_Angle[j]);
vtrafo[j]->SetParName(1,"Wire_StringAngle");
vtrafo[j]->SetParameter(1, VWire_StringAngle[j]);
vtrafo[j]->SetParName(2,"Offset");
vtrafo[j]->SetParameter(2, 0.0);
vtrafo[j]->SetLineColor(color[j]);
vtrafo[j]->SetLineStyle(lstyle[j]);
vtrafo[j]->SetLineWidth(1);
cout << "--------------" << endl;
cout << "Theta= 45, Phi= " << Phi_Angle[j] << ", Wire Angle= " << VWire_StringAngle[j] <<", Alpha= " << vtrafo[j]->Eval(45.0) << endl;
}
//=======================================================
c1->cd(1);
utrafo[0]->SetTitle("Track Angle Transformation on U-Plane");
utrafo[0]->GetYaxis()->SetRangeUser(0,95);
utrafo[0]->GetYaxis()->SetTitle("Garfield Track Angle (Alpha)");
utrafo[0]->GetXaxis()->SetTitle("Tilt Angle of VDC");
utrafo[0]->Draw();
for(int j = 1; j < 9; j++) {utrafo[j]->Draw("same");}
const char *const ulegendentry[9] =
{
"Wire StringAngle = 1 deg, Phi = 0 deg",
"Wire StringAngle = 30 deg, Phi = 0 deg",
"Wire StringAngle = 30 deg, Phi = -20 deg",
"Wire StringAngle = 30 deg, Phi = +20 deg",
"Wire StringAngle = 45 deg, Phi = 0 deg",
"Wire StringAngle = 45 deg, Phi = -20 deg",
"Wire StringAngle = 45 deg, Phi = +20 deg",
"Wire StringAngle = 60 deg, Phi = 0 deg",
"Wire StringAngle = 90 deg, Phi = 0 deg"
};
TLegend *uleg = new TLegend(0.58,0.82,0.98,0.98);
for(int j = 0; j < 9; j++)
{
uleg->AddEntry(utrafo[j],ulegendentry[j],"l");
}
uleg->SetTextFont(62);
uleg->SetTextSize(0.030);
uleg->Draw();
c1->Update();
//=======================================================
c1->cd(2);
vtrafo[0]->SetTitle("Track Angle Transformation on V-Plane");
vtrafo[0]->GetYaxis()->SetRangeUser(0.0,95.0);
vtrafo[0]->GetYaxis()->SetTitle("Garfield Track Angle (Alpha)");
vtrafo[0]->GetXaxis()->SetTitle("Tilt Angle of VDC");
vtrafo[0]->Draw();
for(int j = 1; j < 9; j++) {vtrafo[j]->Draw("same");}
const char *const vlegendentry[9] =
{
"Wire StringAngle = -1 deg, Phi = 0 deg",
"Wire StringAngle = -30 deg, Phi = 0 deg",
"Wire StringAngle = -30 deg, Phi = -20 deg",
"Wire StringAngle = -30 deg, Phi = +20 deg",
"Wire StringAngle = -45 deg, Phi = 0 deg",
"Wire StringAngle = -45 deg, Phi = -20 deg",
"Wire StringAngle = -45 deg, Phi = +20 deg",
"Wire StringAngle = -60 deg, Phi = 0 deg",
"Wire StringAngle = -90 deg, Phi = 0 deg"
};
TLegend *vleg = new TLegend(0.58,0.82,0.98,0.98);
for(int j = 0; j < 9; j++)
{
vleg->AddEntry(vtrafo[j],vlegendentry[j],"l");
}
vleg->SetTextFont(62);
vleg->SetTextSize(0.030);
vleg->Draw();
c1->Update();
//=======================================================
}
|