]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/macros/testPlaneFind.C
We do not need HERWIG and TPHIC by default in aliroot
[u/mrichter/AliRoot.git] / MUON / mapping / macros / testPlaneFind.C
1 // $Id$
2 //
3 // Test macro that runs the segmentation circle test
4 // (finds pad by location, position and indices in a circle)
5 // over the whole plane.
6
7 void testPlane(AliMpPlane* plane)
8 {
9   AliMpPlaneSegmentation planeSegmentation(plane);
10   
11   //AliMpVPainter* painter = AliMpVPainter::CreatePainter(sector);
12   //painter->Draw("ZSSMP");
13
14   for (Int_t isec=0; isec<4; isec++) {
15              // 0  x>=0, y>=0
16              // 1  x>=0, y <0
17              // 2  x <0, y>=0
18              // 3  x <0, y <0
19
20     cout << "Verifying sector " << isec << "....." << endl;
21     
22     for (Int_t i = AliMpConstants::StartPadIndex(); i<AliMpConstants::StartPadIndex()+90; i++){
23      
24       Int_t iscale = 1;
25       if (isec >1) iscale = -1;
26     
27       cout << "Verifying column " << i << "....." << endl;
28
29       for (Int_t j = AliMpConstants::StartPadIndex(); j<AliMpConstants::StartPadIndex()+20; j++) {
30
31         Int_t jscale = 1;  
32         if (isec == 1 || isec == 3) jscale = -1;
33         
34         if (planeSegmentation.HasPad(AliMpIntPair(i*iscale, j*jscale))) {
35         
36           planeSegmentation.PadByIndices(AliMpIntPair(i*iscale, j*jscale)).Print();
37           cout << "test result " 
38                << planeSegmentation.CircleTest(AliMpIntPair(i*iscale, j*jscale))
39                << endl;    
40         }
41         else {
42           cout << " has not indices  " << AliMpIntPair(i*iscale, j*jscale) << endl;
43         }  
44       }
45     }
46   }  
47 }
48
49 void testPlaneFind(AliMpStationType station = kStation1,
50                    AliMpPlaneType planeType = kBendingPlane)
51 {
52   cout << endl;
53
54   cout << "Testing plane1 ..." << endl;
55   AliMpPlane* plane1 = AliMpPlane::Create(station, planeType);
56   testPlane(plane1);
57   delete plane1;
58   cout << endl; 
59
60   cout << "Testing plane2 ..." << endl; 
61   AliMpPlane* plane2 
62     = AliMpPlane::Create(station, planeType, 
63                          TVector2(), TVector2(-10., 10.), TVector2(), TVector2());
64   testPlane(plane2);
65   delete plane2;  
66 }