]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/macros/testPadsUpEtc.C
Added the possibility to do diagnostics histograms.
[u/mrichter/AliRoot.git] / MUON / mapping / macros / testPadsUpEtc.C
1 // $Id$
2 // $MpId: testPadsUpEtc.C,v 1.8 2005/10/28 15:36:08 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  plane = kBendingPlane,
10                    Bool_t rootInput = false)
11 {
12   AliMpSector *sector = 0;
13   if (!rootInput) {
14     AliMpSectorReader r(station, plane);
15     sector=r.BuildSector();
16   }
17   else  {
18     TString filePath = AliMpFiles::SectorFilePath(station,plane);
19     filePath.ReplaceAll("zones.dat", "sector.root"); 
20
21     TFile f(filePath.Data(), "READ");
22     sector = (AliMpSector*)f.Get("Sector");
23   }  
24     
25   AliMpSectorSegmentation segmentation(sector);
26   
27   AliMpIntPair indices(85, 101);
28   if( plane == kNonBendingPlane) indices = AliMpIntPair(129, 10);
29  
30   AliMpPad pad;
31   if (segmentation.HasPad(indices)) {
32           
33     pad = segmentation.PadByIndices(indices);
34     cout << "Pad:      "  << pad << endl << endl;
35   
36     cout << "######### GO UP  ############### " << endl;
37
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;    
43     }
44
45     cout << "######### GO DOWN  ############### " << endl;
46
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;    
52     }
53
54     cout << "######### GO RIGHT  ############### " << endl;
55
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;    
61     }
62
63     cout << "######### GO LEFT  ############### " << endl;
64
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;    
70     }
71   }  
72 }