// $Id$
-// $MpId: testAnyPadIterators.C,v 1.12 2005/08/24 08:53:27 ivana Exp $
+// $MpId: testAnyPadIterators.C,v 1.13 2005/09/26 16:05:24 ivana Exp $
//
// Test macro for reading sector, and iterate over it
void testAnyPadIterators(AliMpStationType station = kStation1,
AliMpPlaneType plane = kBendingPlane,
+ Bool_t rootInput = false,
Int_t i=50, Int_t j=50)
{
- AliMpSectorReader r(station, plane);
- AliMpSector* sect = r.BuildSector();
+ AliMpSector *sector = 0;
+ if (!rootInput) {
+ AliMpSectorReader r(station, plane);
+ sector=r.BuildSector();
+ }
+ else {
+ TString filePath = AliMpFiles::Instance()->SectorFilePath(station,plane);
+ filePath.ReplaceAll("zones.dat", "sector.root");
+
+ TFile f(filePath.Data(), "READ");
+ sector = (AliMpSector*)f.Get("Sector");
+ }
TCanvas *canv = new TCanvas("canv");
canv->Divide(2,2);
//canv_1->Divide(2);
canv->cd(1);
- MarkPads(AliMpSectorPadIterator(sect), 150, 250, kFALSE);
+ MarkPads(AliMpSectorPadIterator(sector), 150, 250, kFALSE);
canv->cd(2);
- AliMpVMotif* motif = sect->FindMotif(TVector2(300,30));
+ AliMpVMotif* motif = sector->FindMotif(TVector2(300,30));
if (motif) {
AliMpMotifType* motifType = motif->GetMotifType();
} else cout<<"No motif found at given position..."<<endl;
canv->cd(3);
- //MarkPads(*AliMpPadIteratorPtr(AliMpSectorSegmentation(sect)->CreateIterator(AliMpIntPair(i,j)))
- AliMpSectorSegmentation segm(sect);
+ //MarkPads(*AliMpPadIteratorPtr(AliMpSectorSegmentation(sector)->CreateIterator(AliMpIntPair(i,j)))
+ AliMpSectorSegmentation segm(sector);
AliMpPad pad = segm.PadByIndices(AliMpIntPair(i,j));
- MarkPads(AliMpNeighboursPadIterator(&AliMpSectorSegmentation(sect),pad)
+ MarkPads(AliMpNeighboursPadIterator(&AliMpSectorSegmentation(sector),pad)
,i+8,j+8);
cout<<"________________ Neighbours __________________________"<<endl;
canv->cd(4);
Int_t motifPosId = 20;
if (plane == kNonBendingPlane) motifPosId = 19;
- AliMpMotifPosition* motifPos = sect->GetMotifMap()->FindMotifPosition(motifPosId);
+ AliMpMotifPosition* motifPos = sector->GetMotifMap()->FindMotifPosition(motifPosId);
if (motifPos){
//MarkPads(*AliMpPadIteratorPtr(motifPos->CreateIterator()),15,15);
MarkPads(AliMpMotifPositionPadIterator(motifPos),15,15);
// $Id$
-// $MpId: testExistingPads.C,v 1.10 2005/08/24 08:53:27 ivana Exp $
+// $MpId: testExistingPads.C,v 1.11 2005/09/26 16:05:25 ivana Exp $
//
// Test macro for testing which pad is seen as "existing" by AliMpSector.
void testExistingPads(AliMpStationType station = kStation1,
- AliMpPlaneType plane = kBendingPlane)
+ AliMpPlaneType plane = kBendingPlane,
+ Bool_t rootInput = false)
{
- AliMpSectorReader r(station, plane);
- AliMpSector *sector=r.BuildSector();
+ AliMpSector *sector = 0;
+ if (!rootInput) {
+ AliMpSectorReader r(station, plane);
+ sector=r.BuildSector();
+ }
+ else {
+ TString filePath = AliMpFiles::Instance()->SectorFilePath(station,plane);
+ filePath.ReplaceAll("zones.dat", "sector.root");
+
+ TFile f(filePath.Data(), "READ");
+ sector = (AliMpSector*)f.Get("Sector");
+ }
+
AliMpSectorSegmentation segmentation(sector);
AliMpVPainter* painter = AliMpVPainter::CreatePainter(sector);
// $Id$
-// $MpId: testGraphics.C,v 1.11 2005/08/24 08:53:27 ivana Exp $
+// $MpId: testGraphics.C,v 1.12 2005/09/26 16:05:25 ivana Exp $
//
// Test macro for drawing sector data.
void testGraphics(AliMpStationType station = kStation1,
- AliMpPlaneType plane = kBendingPlane)
+ AliMpPlaneType plane = kBendingPlane,
+ Bool_t rootInput = false)
{
- AliMpSectorReader r(station, plane);
- AliMpSector *sector=r.BuildSector();
+ AliMpSector *sector = 0;
+ if (!rootInput) {
+ AliMpSectorReader r(station, plane);
+ sector=r.BuildSector();
+ }
+ else {
+ TString filePath = AliMpFiles::Instance()->SectorFilePath(station,plane);
+ filePath.ReplaceAll("zones.dat", "sector.root");
+
+ TFile f(filePath.Data(), "READ");
+ sector = (AliMpSector*)f.Get("Sector");
+ }
+
AliMpVPainter *painter=AliMpVPainter::CreatePainter(sector);
TCanvas* canvas = new TCanvas();
// $Id$
-// $MpId: testIndicesLimits.C,v 1.3 2005/08/24 08:53:27 ivana Exp $
+// $MpId: testIndicesLimits.C,v 1.4 2005/09/26 16:05:25 ivana Exp $
//
// Test macro for indices limits.
void testIndicesLimits(AliMpStationType station = kStation1,
- AliMpPlaneType plane = kBendingPlane)
+ AliMpPlaneType plane = kBendingPlane,
+ Bool_t rootInput = false)
{
- AliMpSectorReader reader(station, plane);
- //reader.SetVerboseLevel(1);
-
- // Read data
- AliMpSector* sector = reader.BuildSector();
+ AliMpSector *sector = 0;
+ if (!rootInput) {
+ AliMpSectorReader r(station, plane);
+ sector=r.BuildSector();
+ }
+ else {
+ TString filePath = AliMpFiles::Instance()->SectorFilePath(station,plane);
+ filePath.ReplaceAll("zones.dat", "sector.root");
+
+ TFile f(filePath.Data(), "READ");
+ sector = (AliMpSector*)f.Get("Sector");
+ }
// Loop over rows
for (Int_t i=0; i<sector->GetNofRows(); i++) {
// $Id$
-// $MpId: testMotifTypeIterators.C,v 1.10 2005/08/24 08:53:27 ivana Exp $
+// $MpId: testMotifTypeIterators.C,v 1.11 2005/09/26 16:05:25 ivana Exp $
//
// Test macro for reading motif type data and iterate over them.
void testMotifTypeIterators(AliMpStationType station = kStation1,
- AliMpPlaneType plane = kBendingPlane)
+ AliMpPlaneType plane = kBendingPlane,
+ Bool_t rootInput = false)
{
TString names;
TString names2;
// $Id$
-// $MpId: testNeighboursPadIterator.C,v 1.8 2005/08/24 08:53:27 ivana Exp $
+// $MpId: testNeighboursPadIterator.C,v 1.9 2005/09/26 16:05:25 ivana Exp $
//
// Test macro for reading sector, and iterate over it
void testNeighboursPadIterator(AliMpStationType station = kStation1,
AliMpPlaneType plane = kBendingPlane,
+ Bool_t rootInput = false,
Int_t i=50, Int_t j=50)
{
- if (!gInterpreter->IsLoaded("mlibs.C")){
- gROOT->LoadMacro("mlibs.C");
- gInterpreter->ProcessLine("mlibs()");
+ AliMpSector *sector = 0;
+ if (!rootInput) {
+ AliMpSectorReader r(station, plane);
+ sector=r.BuildSector();
+ }
+ else {
+ TString filePath = AliMpFiles::Instance()->SectorFilePath(station,plane);
+ filePath.ReplaceAll("zones.dat", "sector.root");
+
+ TFile f(filePath.Data(), "READ");
+ sector = (AliMpSector*)f.Get("Sector");
}
- AliMpSectorReader r(station, plane);
- AliMpSector* sect = r.BuildSector();
AliMpSectorSegmentation segm(sect);
TCanvas *can = new TCanvas("canv");
// $Id$
-// $MpId: testPadDimensions.C,v 1.4 2005/08/24 08:53:27 ivana Exp $
+// $MpId: testPadDimensions.C,v 1.5 2005/09/26 16:05:25 ivana Exp $
//
// Test macro for testing retrieving of pad dimensions from
// the map in AliMpSectorSegmentation.
void testPadDimensions(AliMpStationType station = kStation1,
- AliMpPlaneType plane = kBendingPlane)
+ AliMpPlaneType plane = kBendingPlane,
+ Bool_t rootInput = false)
{
- AliMpSectorReader r(station, plane);
- AliMpSector* sector=r.BuildSector();
+ AliMpSector *sector = 0;
+ if (!rootInput) {
+ AliMpSectorReader r(station, plane);
+ sector=r.BuildSector();
+ }
+ else {
+ TString filePath = AliMpFiles::Instance()->SectorFilePath(station,plane);
+ filePath.ReplaceAll("zones.dat", "sector.root");
+
+ TFile f(filePath.Data(), "READ");
+ sector = (AliMpSector*)f.Get("Sector");
+ }
+
AliMpSectorSegmentation segmentation(sector);
segmentation.PrintZones();
// $Id$
-// $MpId: testPadsUpEtc.C,v 1.6 2005/08/24 08:53:27 ivana Exp $
+// $MpId: testPadsUpEtc.C,v 1.7 2005/09/26 16:05:25 ivana Exp $
//
// Test macro that starts from a given pad and prints
// all pads up, down, right, left from this pad
// (up to the plane border).
void testPadsUpEtc(AliMpStationType station = kStation1,
- AliMpPlaneType planeType = kBendingPlane)
+ AliMpPlaneType plane = kBendingPlane,
+ Bool_t rootInput = false)
{
- AliMpSectorReader reader(station, planeType);
- AliMpSector* sector = reader.BuildSector();
+ AliMpSector *sector = 0;
+ if (!rootInput) {
+ AliMpSectorReader r(station, plane);
+ sector=r.BuildSector();
+ }
+ else {
+ TString filePath = AliMpFiles::Instance()->SectorFilePath(station,plane);
+ filePath.ReplaceAll("zones.dat", "sector.root");
+
+ TFile f(filePath.Data(), "READ");
+ sector = (AliMpSector*)f.Get("Sector");
+ }
+
AliMpSectorSegmentation segmentation(sector);
AliMpIntPair indices(85, 101);
- if( planeType == kNonBendingPlane) indices = AliMpIntPair(129, 10);
+ if( plane == kNonBendingPlane) indices = AliMpIntPair(129, 10);
AliMpPad pad;
if (segmentation.HasPad(indices)) {
// $Id$
-// $MpId: testPrintLimits.C,v 1.7 2005/08/24 08:53:27 ivana Exp $
+// $MpId: testPrintLimits.C,v 1.8 2005/09/26 16:05:25 ivana Exp $
//
// Test macro for making an output file, where all mapping elements
// indices & positions are written.
void testPrintLimits(AliMpStationType station = kStation1,
- AliMpPlaneType plane = kBendingPlane, ostream& out=cout)
+ AliMpPlaneType plane = kBendingPlane,
+ Bool_t rootInput = false,
+ ostream& out=cout)
{
- AliMpSectorReader r(station, plane);
+ AliMpSector *sector = 0;
+ if (!rootInput) {
+ AliMpSectorReader r(station, plane);
+ sector=r.BuildSector();
+ }
+ else {
+ TString filePath = AliMpFiles::Instance()->SectorFilePath(station,plane);
+ filePath.ReplaceAll("zones.dat", "sector.root");
- AliMpSector *sector=r.BuildSector();
+ TFile f(filePath.Data(), "READ");
+ sector = (AliMpSector*)f.Get("Sector");
+ }
AliMpVPainter* painter = AliMpVPainter::CreatePainter(sector);
painter->Draw("ZSSMP");
// $Id$
-// $MpId: testReadMotifType.C,v 1.11 2005/08/24 08:53:27 ivana Exp $
+// $MpId: testReadMotifType.C,v 1.12 2005/09/26 16:05:25 ivana Exp $
//
// Test macro for reading motif type data.
void testReadMotifType(AliMpStationType station = kStation1,
- AliMpPlaneType plane = kBendingPlane)
+ AliMpPlaneType plane = kBendingPlane,
+ Bool_t rootInput = false)
{
AliMpMotifReader r(station, plane);
//r.SetVerboseLevel(2);
// $Id$
-// $MpId: testReadSector.C,v 1.13 2005/09/02 10:57:47 ivana Exp $
+// $MpId: testReadSector.C,v 1.14 2005/09/26 16:04:07 ivana Exp $
//
// Test macro for reading sector data.
#include <iomanip>
void testReadSector(AliMpStationType station = kStation1,
- AliMpPlaneType plane = kBendingPlane)
+ AliMpPlaneType plane = kBendingPlane,
+ Bool_t rootInput = false)
{
- AliMpSectorReader reader(station, plane);
- //reader.SetVerboseLevel(1);
-
- // Read data
- AliMpSector* sector = reader.BuildSector();
+ AliMpSector *sector = 0;
+ if (!rootInput) {
+ AliMpSectorReader r(station, plane);
+ //reader.SetVerboseLevel(1);
+ sector=r.BuildSector();
+
+ // Write sector on Root file
+ TString filePath = AliMpFiles::Instance()->SectorFilePath(station,plane);
+ filePath.ReplaceAll("zones.dat", "sector.root");
+ TFile f(filePath.Data(), "RECREATE");
+ sector->Write();
+ f.Close();
+ }
+ else {
+ TString filePath = AliMpFiles::Instance()->SectorFilePath(station,plane);
+ filePath.ReplaceAll("zones.dat", "sector.root");
+
+ TFile f(filePath.Data(), "READ");
+ sector = (AliMpSector*)f.Get("Sector");
+ }
+
cout << endl;
// Sector geometry
// $Id$
-// $MpId: testSectorAreaIterator.C,v 1.3 2005/08/24 08:53:27 ivana Exp $
+// $MpId: testSectorAreaIterator.C,v 1.4 2005/09/26 16:05:25 ivana Exp $
//
// Test macro for iterating over the whole sector
}
void testSectorAreaIterator(AliMpStationType station = kStation1,
- AliMpPlaneType planeType = kBendingPlane)
+ AliMpPlaneType plane = kBendingPlane,
+ Bool_t rootInput = false)
{
- AliMpSectorReader reader(station, planeType);
- AliMpSector* sector = reader.BuildSector();
+ AliMpSector *sector = 0;
+ if (!rootInput) {
+ AliMpSectorReader r(station, plane);
+ sector=r.BuildSector();
+ }
+ else {
+ TString filePath = AliMpFiles::Instance()->SectorFilePath(station,plane);
+ filePath.ReplaceAll("zones.dat", "sector.root");
+
+ TFile f(filePath.Data(), "READ");
+ sector = (AliMpSector*)f.Get("Sector");
+ }
+
AliMpSectorSegmentation segmentation(sector);
AliMpArea area;
// $Id$
-// $MpId: testSectorFind.C,v 1.8 2005/08/24 08:53:27 ivana Exp $
+// $MpId: testSectorFind.C,v 1.9 2005/09/26 16:05:25 ivana Exp $
//
// Test macro for which verify that all FindPosition, FindIndices
// and FindLocation methods are consistents between them.
void testSectorFind(AliMpStationType station = kStation1,
- AliMpPlaneType plane = kBendingPlane)
+ AliMpPlaneType plane = kBendingPlane,
+ Bool_t rootInput = false)
{
- AliMpSectorReader r(station, plane);
+ AliMpSector *sector = 0;
+ if (!rootInput) {
+ AliMpSectorReader r(station, plane);
+ sector=r.BuildSector();
+ }
+ else {
+ TString filePath = AliMpFiles::Instance()->SectorFilePath(station,plane);
+ filePath.ReplaceAll("zones.dat", "sector.root");
+
+ TFile f(filePath.Data(), "READ");
+ sector = (AliMpSector*)f.Get("Sector");
+ }
- AliMpSector *sector=r.BuildSector();
AliMpSectorSegmentation segmentation(sector);
AliMpVPainter* painter = AliMpVPainter::CreatePainter(sector);
painter->Draw("ZSSMP");
// $Id$
-// $MpId: testSectorPadIterators.C,v 1.7 2005/08/24 08:53:27 ivana Exp $
+// $MpId: testSectorPadIterators.C,v 1.8 2005/09/26 16:05:25 ivana Exp $
//
// Test macro for reading sector, and iterate over it
void testSectorPadIterators(AliMpStationType station = kStation1,
- AliMpPlaneType plane = kBendingPlane)
+ AliMpPlaneType plane = kBendingPlane,
+ Bool_t rootInput = false)
{
- AliMpSectorReader r(station, plane);
- AliMpSector* sect = r.BuildSector();
+ AliMpSector *sector = 0;
+ if (!rootInput) {
+ AliMpSectorReader r(station, plane);
+ sector=r.BuildSector();
+ }
+ else {
+ TString filePath = AliMpFiles::Instance()->SectorFilePath(station,plane);
+ filePath.ReplaceAll("zones.dat", "sector.root");
+
+ TFile f(filePath.Data(), "READ");
+ sector = (AliMpSector*)f.Get("Sector");
+ }
Int_t num=0;
const Double_t xmax=150;
const Double_t ymax=250;
- AliMpSectorPadIterator it = AliMpSectorPadIterator(sect);
+ AliMpSectorPadIterator it = AliMpSectorPadIterator(sector);
for (it.First(); ! it.IsDone(); it.Next()) {
AliMpIntPair indices = it.CurrentItem().GetIndices();
marker->Draw();
}
- delete sect;
+ delete sector;
}