2 // $MpId: testPadsUpEtc.C,v 1.7 2005/09/26 16:05:25 ivana Exp $
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).
8 void testPadsUpEtc(AliMpStationType station = kStation1,
9 AliMpPlaneType plane = kBendingPlane,
10 Bool_t rootInput = false)
12 AliMpSector *sector = 0;
14 AliMpSectorReader r(station, plane);
15 sector=r.BuildSector();
18 TString filePath = AliMpFiles::Instance()->SectorFilePath(station,plane);
19 filePath.ReplaceAll("zones.dat", "sector.root");
21 TFile f(filePath.Data(), "READ");
22 sector = (AliMpSector*)f.Get("Sector");
25 AliMpSectorSegmentation segmentation(sector);
27 AliMpIntPair indices(85, 101);
28 if( plane == kNonBendingPlane) indices = AliMpIntPair(129, 10);
31 if (segmentation.HasPad(indices)) {
33 pad = segmentation.PadByIndices(indices);
34 cout << "Pad: " << pad << endl << endl;
36 cout << "######### GO UP ############### " << endl;
38 AliMpPadPair nextPads(pad, pad);
39 while (nextPads.GetFirst().IsValid()) {
40 nextPads = segmentation.PadsUp(nextPads.GetFirst());
41 cout << " up 1: " << nextPads.GetFirst() << endl;
42 cout << " 2: " << nextPads.GetSecond() << endl;
45 cout << "######### GO DOWN ############### " << endl;
47 nextPads = AliMpPadPair(pad, pad);
48 while (nextPads.GetFirst().IsValid()) {
49 nextPads = segmentation.PadsDown(nextPads.GetFirst());
50 cout << " down 1: " << nextPads.GetFirst() << endl;
51 cout << " 2: " << nextPads.GetSecond() << endl;
54 cout << "######### GO RIGHT ############### " << endl;
56 nextPads = AliMpPadPair(pad, pad);
57 while (nextPads.GetFirst().IsValid()) {
58 nextPads = segmentation.PadsRight(nextPads.GetFirst());
59 cout << " right 1: " << nextPads.GetFirst() << endl;
60 cout << " 2: " << nextPads.GetSecond() << endl;
63 cout << "######### GO LEFT ############### " << endl;
65 nextPads = AliMpPadPair(pad, pad);
66 while (nextPads.GetFirst().IsValid()) {
67 nextPads = segmentation.PadsLeft(nextPads.GetFirst());
68 cout << " left 1: " << nextPads.GetFirst() << endl;
69 cout << " 2: " << nextPads.GetSecond() << endl;