]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/mapping/macros/testSt12SectorPadIterators.C
Replacement of AliMpIntPair object with algoritmic
[u/mrichter/AliRoot.git] / MUON / mapping / macros / testSt12SectorPadIterators.C
CommitLineData
66e0997c 1// $Id$
04728794 2// $MpId: testSectorPadIterators.C,v 1.11 2006/03/15 13:07:07 ivana Exp $
66e0997c 3//
4// Test macro for reading sector, and iterate over it
5
f05d3eb1 6#if !defined(__CINT__) || defined(__MAKECINT__)
7
8#include "AliMpStation12Type.h"
9#include "AliMpPlaneType.h"
10#include "AliMpDataProcessor.h"
11#include "AliMpDataMap.h"
12#include "AliMpDataStreams.h"
13#include "AliMpSector.h"
14#include "AliMpSectorPadIterator.h"
15#include "AliMpSectorReader.h"
16#include "AliMpArea.h"
17#include "AliMpVPadIterator.h"
18#include "AliMpVPainter.h"
168e9c4d 19#include "AliMpEncodePair.h"
f05d3eb1 20
21#include <Riostream.h>
22#include <TCanvas.h>
23#include <TMarker.h>
24
25#endif
26
6aa39548 27TCanvas* CreateTCanvas(const TString& name, const TString& title,
28 AliMq::Station12Type station, AliMp::PlaneType plane)
29{
30 TString newName(name);
31 TString newTitle(title);
32 TString unique = AliMq::Station12TypeName(station) + AliMp::PlaneTypeName(plane);
33 newName += unique;
34 newTitle += unique;
35 return new TCanvas(newName.Data(), newTitle.Data());
36}
37
f05d3eb1 38void testSectorPadIterators(AliMq::Station12Type station, AliMp::PlaneType plane)
66e0997c 39{
f05d3eb1 40 AliMpDataProcessor mp;
41 AliMpDataMap* dataMap = mp.CreateDataMap("data");
42 AliMpDataStreams dataStreams(dataMap);
334be4b7 43
f05d3eb1 44 AliMpSectorReader r(dataStreams, station, plane);
45 AliMpSector* sector = r.BuildSector();
66e0997c 46
47 Int_t num=0;
48
f05d3eb1 49 //new TCanvas("canv");
6aa39548 50 CreateTCanvas("", "", station, plane);
66e0997c 51
52 const Double_t xmax=150;
53 const Double_t ymax=250;
54
334be4b7 55 AliMpSectorPadIterator it = AliMpSectorPadIterator(sector);
66e0997c 56
57 for (it.First(); ! it.IsDone(); it.Next()) {
168e9c4d 58 Long_t indices = it.CurrentItem().GetIndices();
59 cout<<"Iterator number "<< num << " at ";
60 AliMp::PairPut(cout, indices) << endl;
04728794 61 num++;
168e9c4d 62 TMarker* marker = new TMarker( (Double_t)AliMp::PairFirst(indices) /xmax,
63 (Double_t)AliMp::PairSecond(indices)/ymax,
66e0997c 64 2);
65 marker->Draw();
66 }
67
334be4b7 68 delete sector;
66e0997c 69}
f05d3eb1 70
6aa39548 71void testSt12SectorPadIterators()
f05d3eb1 72{
73 AliMq::Station12Type station[2] = { AliMq::kStation1, AliMq::kStation2 };
74 AliMp::PlaneType plane[2] = { AliMp::kBendingPlane, AliMp::kNonBendingPlane };
75
76 for ( Int_t is = 0; is < 2; is++ ) {
77 for ( Int_t ip = 0; ip < 2; ip++ ) {
78
79 cout << "Running testSectorPadIterators for "
80 << AliMq::Station12TypeName(station[is]) << " "
81 << AliMp::PlaneTypeName(plane[ip]) << " ... " << endl;
82
83 testSectorPadIterators(station[is], plane[ip]);
84
85 cout << "... end running " << endl << endl;
86 }
87 }
88}
89