]>
Commit | Line | Data |
---|---|---|
66e0997c | 1 | // $Id$ |
57ff4119 | 2 | // $MpId: testPadsUpEtc.C,v 1.8 2005/10/28 15:36:08 ivana Exp $ |
66e0997c | 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, | |
334be4b7 | 9 | AliMpPlaneType plane = kBendingPlane, |
10 | Bool_t rootInput = false) | |
66e0997c | 11 | { |
334be4b7 | 12 | AliMpSector *sector = 0; |
13 | if (!rootInput) { | |
14 | AliMpSectorReader r(station, plane); | |
15 | sector=r.BuildSector(); | |
16 | } | |
17 | else { | |
57ff4119 | 18 | TString filePath = AliMpFiles::SectorFilePath(station,plane); |
334be4b7 | 19 | filePath.ReplaceAll("zones.dat", "sector.root"); |
20 | ||
21 | TFile f(filePath.Data(), "READ"); | |
22 | sector = (AliMpSector*)f.Get("Sector"); | |
23 | } | |
24 | ||
e8c253a0 | 25 | AliMpSectorSegmentation segmentation(sector); |
66e0997c | 26 | |
e8c253a0 | 27 | AliMpIntPair indices(85, 101); |
334be4b7 | 28 | if( plane == kNonBendingPlane) indices = AliMpIntPair(129, 10); |
66e0997c | 29 | |
30 | AliMpPad pad; | |
e8c253a0 | 31 | if (segmentation.HasPad(indices)) { |
66e0997c | 32 | |
e8c253a0 | 33 | pad = segmentation.PadByIndices(indices); |
66e0997c | 34 | cout << "Pad: " << pad << endl << endl; |
35 | ||
36 | cout << "######### GO UP ############### " << endl; | |
37 | ||
38 | AliMpPadPair nextPads(pad, pad); | |
39 | while (nextPads.GetFirst().IsValid()) { | |
e8c253a0 | 40 | nextPads = segmentation.PadsUp(nextPads.GetFirst()); |
66e0997c | 41 | cout << " up 1: " << nextPads.GetFirst() << endl; |
42 | cout << " 2: " << nextPads.GetSecond() << endl; | |
43 | } | |
44 | ||
45 | cout << "######### GO DOWN ############### " << endl; | |
46 | ||
47 | nextPads = AliMpPadPair(pad, pad); | |
48 | while (nextPads.GetFirst().IsValid()) { | |
e8c253a0 | 49 | nextPads = segmentation.PadsDown(nextPads.GetFirst()); |
66e0997c | 50 | cout << " down 1: " << nextPads.GetFirst() << endl; |
51 | cout << " 2: " << nextPads.GetSecond() << endl; | |
52 | } | |
53 | ||
54 | cout << "######### GO RIGHT ############### " << endl; | |
55 | ||
56 | nextPads = AliMpPadPair(pad, pad); | |
57 | while (nextPads.GetFirst().IsValid()) { | |
e8c253a0 | 58 | nextPads = segmentation.PadsRight(nextPads.GetFirst()); |
66e0997c | 59 | cout << " right 1: " << nextPads.GetFirst() << endl; |
60 | cout << " 2: " << nextPads.GetSecond() << endl; | |
61 | } | |
62 | ||
63 | cout << "######### GO LEFT ############### " << endl; | |
64 | ||
65 | nextPads = AliMpPadPair(pad, pad); | |
66 | while (nextPads.GetFirst().IsValid()) { | |
e8c253a0 | 67 | nextPads = segmentation.PadsLeft(nextPads.GetFirst()); |
66e0997c | 68 | cout << " left 1: " << nextPads.GetFirst() << endl; |
69 | cout << " 2: " << nextPads.GetSecond() << endl; | |
70 | } | |
71 | } | |
72 | } |