2 // $MpId: testPadsUpEtc.C,v 1.8 2005/10/28 15:36:08 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 #if !defined(__CINT__) || defined(__MAKECINT__)
10 #include "AliMpStation12Type.h"
11 #include "AliMpPlaneType.h"
12 #include "AliMpDataProcessor.h"
13 #include "AliMpDataMap.h"
14 #include "AliMpDataStreams.h"
15 #include "AliMpSector.h"
16 #include "AliMpSectorSegmentation.h"
17 #include "AliMpSectorReader.h"
19 #include <Riostream.h>
23 void testPadsUpEtc(AliMq::Station12Type station, AliMp::PlaneType plane)
25 AliMpDataProcessor mp;
26 AliMpDataMap* dataMap = mp.CreateDataMap("data");
27 AliMpDataStreams dataStreams(dataMap);
29 AliMpSectorReader r(dataStreams, station, plane);
30 AliMpSector* sector = r.BuildSector();
31 AliMpSectorSegmentation segmentation(sector);
33 AliMpIntPair indices(85, 101);
34 if( plane == AliMp::kNonBendingPlane) indices = AliMpIntPair(129, 10);
37 if (segmentation.HasPad(indices)) {
39 pad = segmentation.PadByIndices(indices);
40 cout << "Pad: " << pad << endl << endl;
42 cout << "######### GO UP ############### " << endl;
44 AliMpPadPair nextPads(pad, pad);
45 while (nextPads.GetFirst().IsValid()) {
46 nextPads = segmentation.PadsUp(nextPads.GetFirst());
47 cout << " up 1: " << nextPads.GetFirst() << endl;
48 cout << " 2: " << nextPads.GetSecond() << endl;
51 cout << "######### GO DOWN ############### " << endl;
53 nextPads = AliMpPadPair(pad, pad);
54 while (nextPads.GetFirst().IsValid()) {
55 nextPads = segmentation.PadsDown(nextPads.GetFirst());
56 cout << " down 1: " << nextPads.GetFirst() << endl;
57 cout << " 2: " << nextPads.GetSecond() << endl;
60 cout << "######### GO RIGHT ############### " << endl;
62 nextPads = AliMpPadPair(pad, pad);
63 while (nextPads.GetFirst().IsValid()) {
64 nextPads = segmentation.PadsRight(nextPads.GetFirst());
65 cout << " right 1: " << nextPads.GetFirst() << endl;
66 cout << " 2: " << nextPads.GetSecond() << endl;
69 cout << "######### GO LEFT ############### " << endl;
71 nextPads = AliMpPadPair(pad, pad);
72 while (nextPads.GetFirst().IsValid()) {
73 nextPads = segmentation.PadsLeft(nextPads.GetFirst());
74 cout << " left 1: " << nextPads.GetFirst() << endl;
75 cout << " 2: " << nextPads.GetSecond() << endl;
82 AliMq::Station12Type station[2] = { AliMq::kStation1, AliMq::kStation2 };
83 AliMp::PlaneType plane[2] = { AliMp::kBendingPlane, AliMp::kNonBendingPlane };
85 for ( Int_t is = 0; is < 2; is++ ) {
86 for ( Int_t ip = 0; ip < 2; ip++ ) {
88 cout << "Running testPadsUpEtc for "
89 << AliMq::Station12TypeName(station[is]) << " "
90 << AliMp::PlaneTypeName(plane[ip]) << " ... " << endl;
92 testPadsUpEtc(station[is], plane[ip]);
94 cout << "... end running " << endl << endl;