3 // Test macro for reading motif type data and iterate over them.
5 void testMotifTypeIterators(AliMpStationType station = kStation1,
6 AliMpPlaneType plane = kBendingPlane)
11 if ( station == kStation1 )
12 if ( plane == kBendingPlane )
15 names = "ABCDEFGHIJKLMN";
16 else if ( station == kStation2 )
17 if ( plane == kBendingPlane ) {
18 names ="ABCDEFGHIJKLMNOPQRSTUVWXY";
19 names2 ="abcdefghimnptuvvvvv";
23 names = "ABCEFGHIJKLMN";
24 names2 ="abcdefgijklmnopqrstuwvvvvv";
27 Int_t nofMotifs = names.Length() + names2.Length();
28 // cout << " nofMotifs: " << nofMotifs << endl;
30 TH2C* histos[] = new TH2C* [nofMotifs];
31 TCanvas* canv[] = new TCanvas* [1+(nofMotifs-1)/4];
33 for (i=0;i<1+(nofMotifs-1)/4;++i){
34 // canv[i] = new TCanvas(Form("canv%d",i),"Iterator viewing...");
35 // CINT limitation on DEC
37 TString cname("canv"); cname += i;
38 canv[i] = new TCanvas(cname.Data(),"Iterator viewing...");
43 AliMpReader r(station, plane);
44 //r.SetVerboseLevel(2);
46 for (i=0;i<nofMotifs;++i){
53 mname = names2(i-names.Length(), 1);
55 mname += i - names.Length() - (names2.Length()-nv-1);
59 //if (i==36) continue;
60 // break for these motifs (St2, BP) - to be investigated
62 AliMpMotifType *mt = r.BuildMotifType(mname);
64 canv[i/4]->cd(1+ (i%4));
65 //histos[i] = new TH2C(Form("h%d",i),Form("Motif type %c",names[i]),
66 // mt->GetNofPadsX(),-0.5,mt->GetNofPadsX()-0.5,
67 // mt->GetNofPadsY(),-0.5,mt->GetNofPadsY()-0.5);
68 // CINT limitation on DEC
70 TString hname("h"); hname += i;
72 histos[i] = new TH2C(hname.Data(), mname.Data(),
73 mt->GetNofPadsX(),-0.5,mt->GetNofPadsX()-0.5,
74 mt->GetNofPadsY(),-0.5,mt->GetNofPadsY()-0.5);
76 cout<<"Motif Type "<<mt->GetID()<<endl;
77 cout<<"--------------------------------"<<endl;
80 AliMpMotifTypePadIterator it = AliMpMotifTypePadIterator(mt);
82 for (it.First(); ! it.IsDone(); it.Next()) {
83 cout << "Iterator " << num << ' '<< it.CurrentItem().GetIndices() << endl;
85 histos[i]->Fill(it.CurrentItem().GetIndices().GetFirst(),
86 it.CurrentItem().GetIndices().GetSecond(),num);
90 histos[i]->Draw("text");