ac19b54340f2e0e42acc0396c373f599ec85379a
[u/mrichter/AliRoot.git] / MUON / mapping / macros / testPadsUpEtc.C
1 // $Id$
2 // $MpId: testPadsUpEtc.C,v 1.6 2005/08/24 08:53:27 ivana Exp $
3 //
4 // Test macro that starts from a given pad and prints 
5 // all pads up, down, right, left from this pad
6 // (up to the plane border).
7
8 void testPadsUpEtc(AliMpStationType station = kStation1,
9                    AliMpPlaneType  planeType = kBendingPlane)
10 {
11   AliMpSectorReader reader(station, planeType);  
12   AliMpSector* sector = reader.BuildSector();
13   AliMpSectorSegmentation segmentation(sector);
14   
15   AliMpIntPair indices(85, 101);
16   if( planeType == kNonBendingPlane) indices = AliMpIntPair(129, 10);
17  
18   AliMpPad pad;
19   if (segmentation.HasPad(indices)) {
20           
21     pad = segmentation.PadByIndices(indices);
22     cout << "Pad:      "  << pad << endl << endl;
23   
24     cout << "######### GO UP  ############### " << endl;
25
26     AliMpPadPair nextPads(pad, pad);
27     while (nextPads.GetFirst().IsValid()) {
28       nextPads = segmentation.PadsUp(nextPads.GetFirst());
29       cout << " up    1: "  << nextPads.GetFirst() << endl;    
30       cout << "       2: "  << nextPads.GetSecond() << endl;    
31     }
32
33     cout << "######### GO DOWN  ############### " << endl;
34
35     nextPads = AliMpPadPair(pad, pad);
36     while (nextPads.GetFirst().IsValid()) {
37       nextPads = segmentation.PadsDown(nextPads.GetFirst());
38       cout << " down  1: "  << nextPads.GetFirst() << endl;    
39       cout << "       2: "  << nextPads.GetSecond() << endl;    
40     }
41
42     cout << "######### GO RIGHT  ############### " << endl;
43
44     nextPads = AliMpPadPair(pad, pad);
45     while (nextPads.GetFirst().IsValid()) {
46       nextPads = segmentation.PadsRight(nextPads.GetFirst());
47       cout << " right 1: "  << nextPads.GetFirst() << endl;    
48       cout << "       2: "  << nextPads.GetSecond() << endl;    
49     }
50
51     cout << "######### GO LEFT  ############### " << endl;
52
53     nextPads = AliMpPadPair(pad, pad);
54     while (nextPads.GetFirst().IsValid()) {
55       nextPads = segmentation.PadsLeft(nextPads.GetFirst());
56       cout << " left  1: "  << nextPads.GetFirst() << endl;    
57       cout << "       2: "  << nextPads.GetSecond() << endl;    
58     }
59   }  
60 }