Welcome Page Qweak
Region 3 Drift Chambers
Construction Software DAQ Internal Physics
  Software related Topics  Not logged in Qweak
Message ID: 153     Entry time: 05/24/2005 09:07:49 PM
 Author: Klaus Grimm 
 Type: Simulation 
 Category: Root 
 Subject: Track Angle Tranformation review 
 Record date: 05/24/2005 09:07:31 PM 
As a last check I compared the "Garfield" tracking angle alpha extracted by the Geant4 simulation and with 
my self derived analytic expression.
To my surprise the analytical value for alpha favored clearly a 45deg string angle  ...
After several recalculations I found a nasty bug in my ROOT macro causing this confusion. 
=> we still favor 30deg wire string angle

Here are some values:

Theta: VDC tilting angle in respect to incoming track
Gamma: Wire stringing angle in respect to long side of VDC
Alpha: Projected tracking angle needed for garfield simulation



Theta    Gamma        Phi       Alpha
--------------------------------------
45        45           0         54.7          like for Hall A VDCs
                     -20         65.8
                     -10         59.8
                     +10         50.2
                     +20         46.0
-------------------------------------
45        30           0         49.1
                     -20         55.6
                     -10         52.1
                     +10         46.3
                     +20         43.7
-------------------------------------

.
Attachment 1: TrackAngleTrafo.gif  27 kB  | Hide | Hide all
TrackAngleTrafo.gif
Attachment 2: TrackAngleTrafo.pdf  15 kB
Attachment 3: TrackAngleTrafo_Zoom.gif  26 kB  | Hide | Hide all
TrackAngleTrafo_Zoom.gif
Attachment 4: TrackAngleTrafo_Zoom.pdf  13 kB
Attachment 5: TrackAngleTrafo_DPhi=20.gif  26 kB  | Hide | Hide all
TrackAngleTrafo_DPhi=20.gif
Attachment 6: TrackAngleTrafo_DPhi=20_Zoom.gif  28 kB  | Hide | Hide all
TrackAngleTrafo_DPhi=20_Zoom.gif
Attachment 7: TrackAngleTrafo_DPhi=20.pdf  15 kB
Attachment 8: TrackAngleTrafo_DPhi=20_Zoom.pdf  14 kB
Attachment 9: TrackAngleTrafo.C  7 kB  | Hide | Hide all
//================================================================
// 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();


		//=======================================================




}	

Attachment 10: TrackingAngleTrafo_Basics.pdf  212 kB
ELOG V2.6.0-beta