{ TFile *file = new TFile("simparams.root"); if (!gGeoManager) { file->Get("FairBaseParSet"); TGeoManager *geoMan = gGeoManager; if(!geoMan) { file->Get("FairGeoParSet"); geoMan = gGeoManager; if(!geoMan) { cout << "Could not find valid GeoManager. Abort now!" << endl; exit(1); } } PndGeoSttPar *parameters = file.Get("PndGeoSttPar"); PndSttMapCreator *mapper = new PndSttMapCreator(parameters); TClonesArray *fTubeArray = mapper->FillTubeArray(); TCanvas *c = new TCanvas("c", "", 400, 0, 900, 900); TH2F *h2 = new TH2F("h2", "", 100, 470, 670, 100, -100, 100); h2->SetStats(kFALSE); h2->Draw(); TArc *arc = NULL; TMarker *mrk = NULL; TMarker *center = NULL; PndSttTube *tube = NULL; int itube = 0; while(itube != -1) { c->Clear(); c->Draw(); h2->Draw(); // draw all the tubes for(itube = 1; itube < fTubeArray->GetEntriesFast(); itube++) { tube = (PndSttTube*) fTubeArray->At(itube); arc = new TArc(tube->GetPosition().Z()*10, tube->GetPosition().Y()*10, 0.5*10); arc->Draw("SAME"); center = new TMarker(tube->GetPosition().Z()*10, tube->GetPosition().Y()*10, 6); center->Draw("SAME"); } // ............................ cout << "WHICH tube do you want to test? [to exit type -1]" << endl; cin >> itube; if(itube == -1) exit(0); cout << "TESTING tube " << itube << endl; tube = (PndSttTube*) fTubeArray.At(itube); if(!tube) { cout << "this tube does not exist" << endl; continue; } TArrayI neighborings = tube->GetNeighborings(); cout << "nof neighboring tubes: " << neighborings->GetSize() << endl; arc = new TArc(tube->GetPosition().Z()*10, tube->GetPosition().Y()*10, 0.5*10); arc->SetFillColor(kYellow); arc->Draw("SAME"); center = new TMarker(tube->GetPosition().Z()*10, tube->GetPosition().Y()*10, 6); center->Draw("SAME"); for(int inei = 0; inei < neighborings.GetSize(); inei++) { tube = (PndSttTube*) fTubeArray.At(neighborings.At(inei)); TVector3 position = tube->GetPosition(); cout << " " << neighborings.At(inei); arc = new TArc(position.Z()*10, position.Y()*10, 0.5*10); arc->SetFillColor(3); arc->Draw("SAME"); center = new TMarker(position.Z()*10, position.Y()*10, 6); center->Draw("SAME"); } cout << endl; c->Update(); c->Modified(); } }