void testPadDimensions(AliMq::Station12Type station, AliMp::PlaneType plane) { AliMpDataProcessor mp; AliMpDataMap* dataMap = mp.CreateDataMap("data"); AliMpDataStreams dataStreams(dataMap); AliMpSectorReader r(dataStreams, station, plane); AliMpSector* sector = r.BuildSector(); AliMpSectorSegmentation segmentation(sector); segmentation.PrintZones(); TVector2 previousDimensions; for (Int_t i=1; i<segmentation.MaxPadIndexX()+1;i++) for (Int_t j=1;j<segmentation.MaxPadIndexY()+1;++j) { if ( segmentation.HasPadByIndices(i,j) ) { // Check pad dimensions AliMpPad pad = segmentation.PadByIndices(i,j); TVector2 dimensions = segmentation.PadDimensions(segmentation.Zone(pad)); if ( dimensions.X() != previousDimensions.X() || dimensions.Y() != previousDimensions.Y() ) { // Print dimensions cout << "Pad: " << "(" << i << "," << j << ")"; cout << " dimensions: (" << dimensions.X() << ", " << dimensions.Y() << ")" << endl; previousDimensions = dimensions; } } } }
void testIndicesLimits(AliMq::Station12Type station,AliMp::PlaneType plane) { AliMpDataProcessor mp; AliMpDataMap* dataMap = mp.CreateDataMap("data"); AliMpDataStreams dataStreams(dataMap); AliMpSectorReader r(station, plane); AliMpSector *sector=r.BuildSector(dataStreams); AliMpSectorSegmentation segmentation(sector); // Loop over rows for (Int_t i=0; i<sector->GetNofRows(); i++) { AliMpRow* row = sector->GetRow(i); cout << i << "th row limits: "; AliMp::PairPut(cout, row->GetLowIndicesLimit()) << " "; AliMp::PairPut(cout, row->GetHighIndicesLimit()) << endl; // Loop over row segments for (Int_t j=0; j<row->GetNofRowSegments(); j++) { AliMpVRowSegment* rowSegment = row->GetRowSegment(j); cout << " " << j << "th row segment limits: "; AliMp::PairPut(cout, rowSegment->GetLowIndicesLimit()) << " "; AliMp::PairPut(cout, rowSegment->GetHighIndicesLimit()) << endl; // Loop over motif positions for (Int_t k=0; k<rowSegment->GetNofMotifs(); k++) { Int_t mposID = rowSegment->GetMotifPositionId(k); AliMpMotifPosition* mPos = sector->GetMotifMap()->FindMotifPosition(mposID); if (mPos) { cout << " " << mPos->GetID() << " motif position limits: "; AliMp::PairPut(cout, mPos->GetLowIndicesLimit()) << " "; AliMp::PairPut(cout, mPos->GetHighIndicesLimit()) << endl; } else { cerr << "Motif position " << mposID << " not found in the map" << endl; } } } } delete sector; }
void testReadSector(AliMq::Station12Type station, AliMp::PlaneType plane) { AliMpDataProcessor mp; AliMpDataMap* dataMap = mp.CreateDataMap("data"); AliMpDataStreams dataStreams(dataMap); AliMpSectorReader r(dataStreams, station, plane); AliMpSector* sector = r.BuildSector(); // Sector geometry sector->PrintGeometry(); cout << endl; // Find row test /* if (plane == AliMp::kBendingPlane) cout << "0th row low border " << sector->FindRow(TVector2(0., 0.))->GetID() << endl; if (plane == AliMp::kNonBendingPlane) cout << "0th row low border " << sector->FindRow(TVector2(0., 0.215))->GetID() << endl; cout << "in 0th row " << sector->FindRow(TVector2(0., 2.5))->GetID() << endl; cout << "0th row up border " << sector->FindRow(TVector2(0., 6.72))->GetID() << endl; cout << "in 4th row " << sector->FindRow(TVector2(0., 30.))->GetID() << endl; if (plane == AliMp::kBendingPlane) cout << "12th row up border " << sector->FindRow(TVector2(0., 89.46))->GetID() << endl; if (plane == AliMp::kNonBendingPlane) cout << "12th row up border " << sector->FindRow(TVector2(0., 84.84))->GetID() << endl; cout << endl; */ // Find motif position test /* Int_t ids[15] = { 19, 14, 9, 32, 36, 136, 187, 212, 207, 220, 1, 131, 239, 243, 250 }; for (Int_t i=0; i<15 ; i++) { Int_t id = ids[i]; id |= AliMpConstants::ManuMask(plane); cout << "Motif pos " << std::setw(3) << id; if (!sector->FindRowSegment(id)) { cout << " not found." << endl; } else { cout << " found in : " << sector->FindRow(id)->GetID() << " row, " << " motif id: " << sector->FindRowSegment(id)->GetMotif(0)->GetID().Data() << endl; } } cout << endl; */ // Find motif by coordinates test /* for (Int_t i=0; i<2 ; i++) { TVector2 pos(0.5, 18.6 - i*2.); // i=0 in motif 1001, // i=1 outside (below) motif 1001 AliMpVMotif* motif = sector->FindMotif(pos); cout << "In the position " << pos.X() << " " << pos.Y(); if (motif) cout << " found motif " << motif->GetID() << endl; else cout << " motif not found " << endl; } */ // Find special motif test /* if (plane == AliMp::kNonBendingPlane) { Int_t ids[6] = { 20, 46, 47, 74, 75, 76 }; for (Int_t i=0; i<6 ; i++) { Int_t id = ids[i]; cout << "Motif pos " << id; if (!sector->FindRowSegment(id)) { cout << " not found." << endl; } else { cout << " found in : " << sector->FindRow(id)->GetID() << " row, " << " position : " << sector->FindPosition(id).X() << " " << sector->FindPosition(id).Y() << endl; } } } cout << endl; */ // Motif map sector->GetMotifMap()->Print(); delete sector; }
void testGraphics(AliMq::Station12Type station, AliMp::PlaneType plane) { AliMpDataProcessor mp; AliMpDataMap* dataMap = mp.CreateDataMap("data"); AliMpDataStreams dataStreams(dataMap); AliMpSectorReader r(dataStreams, station, plane); AliMpSector* sector = r.BuildSector(); AliMpVPainter* painter = AliMpVPainter::CreatePainter(sector); TCanvas* canvas = new TCanvas(); TCanvas* canvas2 = new TCanvas(); TCanvas* c[4]; for (int i=0;i<4;++i) { c[i] = new TCanvas(); c[i]->Divide(2,2); } //first, paint the whole sector canvas->cd(); painter->Draw(""); //now paint each rows c[0]->cd(1); painter->Draw("R"); //paint each row segments in each row c[0]->cd(2); painter->Draw("RS"); //paint each motifs, in each row segments in each row c[0]->cd(3); painter->Draw("RSMP"); //paint each pads, in each motifs, in each row segments in each row c[0]->cd(4); painter->Draw("RSMT"); /////////////////////////////// //now paint each rows, wwith its name c[1]->cd(1); painter->Draw("RT"); //paint each row segments in each row, and its name c[1]->cd(2); painter->Draw("RST"); //paint each motifs, in each row segments in each row c[1]->cd(3); painter->Draw("RSMX"); c[1]->cd(4); painter->Draw("RSMI"); /////////////////////////////// //now paint each zones c[2]->cd(1); painter->Draw("Z"); //paint each sub-zones, in each zones c[2]->cd(2); painter->Draw("ZS"); //paint each row segments, in each sub-zone, ... c[2]->cd(3); painter->Draw("ZSS"); // each motifs, in each row segments, ... c[2]->cd(4); painter->Draw("ZSSM"); /////////////////////////////// //now paint each zones with its name c[3]->cd(1); painter->Draw("ZT"); //paint each sub-zones, in each zones with its name c[3]->cd(2); painter->Draw("ZST"); //paint each row segments, in each sub-zone, ... with its name c[3]->cd(3); painter->Draw("ZSST"); // each motifs, in each row segments, ... with its name c[3]->cd(4); painter->Draw("ZSSMT"); // now, draw a specific motif, in a whole canvas, and // print all its pad names Int_t id = sector->GetRow(5)->GetRowSegment(0)->GetMotifPositionId(0); AliMpMotifPosition* motifPos = sector->GetMotifMap()->FindMotifPosition(id); AliMpVPainter* motifPainter = AliMpVPainter::CreatePainter(motifPos); CreateTCanvas("onepad ","One motif ", station, plane); motifPainter->Draw("PT"); ////////////////////////////// //now paint motifs with their real contours and mani Ids canvas2->cd(); painter->Draw("RSMCI"); }
//______________________________________________________________________________ void testSt345Pads() { AliMpDataProcessor mp; AliMpDataMap* dataMap = mp.CreateDataMap("data"); AliMpDataStreams dataStreams(dataMap); AliMpSlatMotifMap* motifMap = new AliMpSlatMotifMap(); AliMpSt345Reader reader(motifMap); Int_t ok(0); for ( Int_t i = 0; i < NSLATS; ++i ) { Bool_t slatOK(kTRUE); TString slatName( slatTypeNames[i] ); AliMpSlat* bending = reader.ReadSlat(dataStreams,slatName.Data(),AliMp::kBendingPlane); AliMpSlat* nonbending = reader.ReadSlat(dataStreams,slatName.Data(),AliMp::kNonBendingPlane); Int_t NumberOfBendingPads(0); Int_t NumberOfNonBendingPads(0); Int_t xcheck_b(0); Int_t xcheck_nb(0); Int_t nc_b(0); Int_t nc_nb(0); if ( bending ) { NumberOfBendingPads = Count(*bending); xcheck_b = Iterate(*bending); nc_b = CircularTest(*bending); } else { cout << "Could not read bending plane of slat " << slatName.Data() << endl; } if ( nonbending ) { NumberOfNonBendingPads = Count(*nonbending); xcheck_nb = Iterate(*nonbending); nc_nb = CircularTest(*nonbending); } else { cout << "Could not read bending plane of slat " << slatName.Data() << endl; } cout << setw(10) << slatName << " BENDING : " << setw(5) << NumberOfBendingPads << " NONBENDING : " << setw(5) << NumberOfNonBendingPads << " CT for " << (nc_b+nc_nb) << " pads "; if ( nc_b>0 && nc_nb>0 ) { cout << "OK."; } else { slatOK = kFALSE; cout << "FAILED."; } cout << endl; if ( nonbending ) XCheck(*nonbending); if ( bending ) XCheck(*bending); if ( xcheck_b != NumberOfBendingPads ) { cout << setw(20) << " Bending : HasPad and Iterator give different results !" << " " << NumberOfBendingPads << " vs " << xcheck_b << endl; slatOK = kFALSE; } if ( xcheck_nb != NumberOfNonBendingPads ) { cout << setw(20) << " NonBending : HasPad and Iterator give different results !" << " " << NumberOfNonBendingPads << " vs " << xcheck_nb << endl; slatOK = kFALSE; } if (slatOK) ++ok; } if ( ok == NSLATS ) { cout << "Successfully tested " << ok << " slats" << endl; } else { cout << "Failed to read " << (NSLATS-ok) << " out of " << NSLATS << " slats" << endl; } }