2 // $MpId: testMotifTypeIterators.C,v 1.11 2005/09/26 16:05:25 ivana Exp $
4 // Test macro for reading motif type data and iterate over them.
6 void testMotifTypeIterators(AliMpStationType station = kStation1,
7 AliMpPlaneType plane = kBendingPlane,
8 Bool_t rootInput = false)
13 if ( station == kStation1 )
14 if ( plane == kBendingPlane )
17 names = "ABCDEFGHIJKLMN";
18 else if ( station == kStation2 )
19 if ( plane == kBendingPlane ) {
20 names ="ABCDEFGHIJKLMNOPQRSTUVWXY";
21 names2 ="abcdefghimnptuvvvvv";
25 names = "ABCEFGHIJKLMN";
26 names2 ="abcdefgijklmnopqrstuwvvvvv";
29 Int_t nofMotifs = names.Length() + names2.Length();
30 // cout << " nofMotifs: " << nofMotifs << endl;
32 TH2C* histos[] = new TH2C* [nofMotifs];
33 TCanvas* canv[] = new TCanvas* [1+(nofMotifs-1)/4];
35 for (i=0;i<1+(nofMotifs-1)/4;++i){
36 // canv[i] = new TCanvas(Form("canv%d",i),"Iterator viewing...");
37 // CINT limitation on DEC
39 TString cname("canv"); cname += i;
40 canv[i] = new TCanvas(cname.Data(),"Iterator viewing...");
45 AliMpMotifReader r(station, plane);
46 //r.SetVerboseLevel(2);
48 for (i=0;i<nofMotifs;++i){
55 mname = names2(i-names.Length(), 1);
57 mname += i - names.Length() - (names2.Length()-nv-1);
61 //if (i==36) continue;
62 // break for these motifs (St2, BP) - to be investigated
64 AliMpMotifType *mt = r.BuildMotifType(mname);
66 canv[i/4]->cd(1+ (i%4));
67 //histos[i] = new TH2C(Form("h%d",i),Form("Motif type %c",names[i]),
68 // mt->GetNofPadsX(),-0.5,mt->GetNofPadsX()-0.5,
69 // mt->GetNofPadsY(),-0.5,mt->GetNofPadsY()-0.5);
70 // CINT limitation on DEC
72 TString hname("h"); hname += i;
74 histos[i] = new TH2C(hname.Data(), mname.Data(),
75 mt->GetNofPadsX(),-0.5,mt->GetNofPadsX()-0.5,
76 mt->GetNofPadsY(),-0.5,mt->GetNofPadsY()-0.5);
78 cout<<"Motif Type "<<mt->GetID()<<endl;
79 cout<<"--------------------------------"<<endl;
82 AliMpMotifTypePadIterator it = AliMpMotifTypePadIterator(mt);
84 for (it.First(); ! it.IsDone(); it.Next()) {
85 cout << "Iterator " << num << ' '<< it.CurrentItem().GetIndices() << endl;
87 histos[i]->Fill(it.CurrentItem().GetIndices().GetFirst(),
88 it.CurrentItem().GetIndices().GetSecond(),num);
92 histos[i]->Draw("text");