2 // $MpId: testAllIndices.C,v 1.7 2005/08/24 08:53:27 ivana Exp $
4 // Test macro for testing which pad is seen as "existing" by AliMpSector.
6 void testAllIndices(AliMp::StationType station = AliMp::kStation1,
7 AliMp::PlaneType plane = AliMp::kBendingPlane)
9 AliMpSectorReader r(station, plane);
11 AliMpSector *sector=r.BuildSector();
12 AliMpSectorSegmentation segmentation(sector);
13 AliMpVPainter* painter = AliMpVPainter::CreatePainter(sector);
15 TCanvas* c1 = new TCanvas("view",
16 "MSectorPainter::Draw() output (view per pad)");
17 painter->Draw("ZSSMP");
20 Int_t maxPadIndexX = segmentation.MaxPadIndexX();
21 Int_t maxPadIndexY = segmentation.MaxPadIndexY();
23 // Define histogram limits
24 Int_t nx = (maxPadIndexX/10 + 1)*10;
25 Int_t ny = (maxPadIndexY/10 + 1)*10;
26 TH2C* histo = new TH2C("histo","Existing pads",
27 nx, -0.5, nx-0.5, ny, -0.5, ny-0.5);
31 if (station == AliMp::kStation2) {
35 TH2F* histo2 = new TH2F("histo2","Existing positions",
36 nx2, 0, nx2*2, ny2, 0, ny2*2);
39 TCanvas* c2 = new TCanvas("c2","Only existing pads are filled");
40 TCanvas* c3 = new TCanvas("c3","Positions");
42 for (Int_t irow=0;irow<sector->GetNofRows();irow++){
43 AliMpRow* row = sector->GetRow(irow);
45 for (Int_t iseg=0;iseg<row->GetNofRowSegments();iseg++){
46 AliMpVRowSegment* seg = row->GetRowSegment(iseg);
48 for (Int_t imot=0;imot<seg->GetNofMotifs();imot++){
49 AliMpMotifPosition* motifPos
50 = sector->GetMotifMap()->FindMotifPosition(seg->GetMotifPositionId(imot));
52 for (Int_t gassNum=0;gassNum<64;gassNum++){
53 if (motifPos->GetMotif()->GetMotifType()->FindConnectionByGassiNum(gassNum)){
55 AliMpPad pad = segmentation.PadByLocation(AliMpIntPair(motifPos->GetID(),gassNum));
56 if (pad != AliMpPad::Invalid()) {
57 histo->Fill (pad.GetIndices().GetFirst(),
58 pad.GetIndices().GetSecond());
59 histo2->Fill(pad.Position().X(),