]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/macros/testSt12SectorFind.C
Patch for the pointer to AOD event
[u/mrichter/AliRoot.git] / MUON / mapping / macros / testSt12SectorFind.C
1 // $Id$
2 // $MpId: testSectorFind.C,v 1.10 2005/10/28 15:36:08 ivana Exp $
3 //
4 // Test macro for which verify that all FindPosition, FindIndices
5 // and FindLocation methods are consistents between them.
6
7 #if !defined(__CINT__) || defined(__MAKECINT__)
8
9 #include "AliMpStation12Type.h"
10 #include "AliMpPlaneType.h"
11 #include "AliMpDataProcessor.h"
12 #include "AliMpDataMap.h"
13 #include "AliMpDataStreams.h"
14 #include "AliMpSector.h"
15 #include "AliMpSectorSegmentation.h"
16 #include "AliMpSectorReader.h"
17 #include "AliMpArea.h"
18 #include "AliMpVPadIterator.h"
19 #include "AliMpVPainter.h"
20
21 #include <Riostream.h>
22 #include <TCanvas.h>
23
24 #endif
25
26 TCanvas* CreateTCanvas(const TString& name, const TString& title,
27                        AliMq::Station12Type station, AliMp::PlaneType plane)
28 {
29   TString newName(name);
30   TString newTitle(title);
31   TString unique = AliMq::Station12TypeName(station) + AliMp::PlaneTypeName(plane);
32   newName += unique;
33   newTitle += unique;
34   return new TCanvas(newName.Data(), newTitle.Data());
35 }                     
36
37 void testSectorFind(AliMq::Station12Type station, AliMp::PlaneType plane) 
38 {
39   AliMpDataProcessor mp;
40   AliMpDataMap* dataMap = mp.CreateDataMap("data");
41   AliMpDataStreams dataStreams(dataMap);
42
43   AliMpSectorReader r(dataStreams, station, plane);
44   AliMpSector* sector = r.BuildSector();
45   AliMpSectorSegmentation segmentation(sector);
46   
47   CreateTCanvas("", "", station, plane);
48   AliMpVPainter* painter = AliMpVPainter::CreatePainter(sector);
49   painter->Draw("ZSSMP");
50
51   for (Int_t i=0; i<90;i++){
52     cout<<"Verifying column "<<i<<"....."<<endl;
53
54     for (Int_t j=0;j<230;++j)
55       segmentation.CircleTest(i,j);    
56   }
57 }
58
59 void testSt12SectorFind()
60 {
61   AliMq::Station12Type  station[2] = { AliMq::kStation1, AliMq::kStation2 }; 
62   AliMp::PlaneType      plane[2]   = { AliMp::kBendingPlane, AliMp::kNonBendingPlane };
63   
64   for ( Int_t is = 0; is < 2; is++ ) {
65     for ( Int_t ip = 0; ip < 2; ip++ ) {
66     
67       cout << "Running testSectorFind for " 
68            << AliMq::Station12TypeName(station[is]) << "  "
69            << AliMp::PlaneTypeName(plane[ip])  << " ... " << endl;
70        
71       testSectorFind(station[is], plane[ip]);
72     
73       cout << "... end running " << endl << endl;
74     }  
75   }   
76 }  
77