3 // Test macro for reading motif type data and iterate over them.
5 void testMotifTypeIterators(AliMpStationType station = kStation1,
6 AliMpPlaneType plane = kBendingPlane)
8 TString names="ABCDEFGHI";
11 TH2C* histos[] = new TH2C* [names.Length()];
12 TCanvas* canv[] = new TCanvas* [1+(names.Length()-1)/4];
14 for (i=0;i<1+(names.Length()-1)/4;++i){
15 // canv[i] = new TCanvas(Form("canv%d",i),"Iterator viewing...");
16 // CINT limitation on DEC
18 TString cname("canv"); cname += i;
19 canv[i] = new TCanvas(cname.Data(),"Iterator viewing...");
24 AliMpReader r(station, plane);
25 //r.SetVerboseLevel(2);
27 for (i=0;i<names.Length();++i){
28 AliMpMotifType *mt = r.BuildMotifType(names[i]);
29 canv[i/4]->cd(1+ (i%4));
30 //histos[i] = new TH2C(Form("h%d",i),Form("Motif type %c",names[i]),
31 // mt->GetNofPadsX(),-0.5,mt->GetNofPadsX()-0.5,
32 // mt->GetNofPadsY(),-0.5,mt->GetNofPadsY()-0.5);
33 // CINT limitation on DEC
35 TString hname("h"); hname += i;
36 TString mname = names(i,1);
38 histos[i] = new TH2C(hname.Data(), mname.Data(),
39 mt->GetNofPadsX(),-0.5,mt->GetNofPadsX()-0.5,
40 mt->GetNofPadsY(),-0.5,mt->GetNofPadsY()-0.5);
42 cout<<"Motif Type "<<mt->GetID()<<endl;
43 cout<<"--------------------------------"<<endl;
46 AliMpMotifTypePadIterator it = AliMpMotifTypePadIterator(mt);
48 for (it.First(); ! it.IsDone(); it.Next()) {
49 cout << "Iterator " << num << ' '<< it.CurrentItem().GetIndices() << endl;
51 histos[i]->Fill(it.CurrentItem().GetIndices().GetFirst(),
52 it.CurrentItem().GetIndices().GetSecond(),num);
57 histos[i]->Draw("text");