#include "TpcPadPlane.h" #include "TpcGem.h" #include "TpcPadShapePool.h" #include #include #include "TCanvas.h" #include "TVector2.h" #include "TWbox.h" #include "TPad.h" void plotPadPlane(){ TpcGem* _gem=new TpcGem(5000, // Gain 0.02); // Spread TpcPadShapePool* _padShapes = new TpcPadShapePool("2mmPads.dat", *_gem, 0.5, // lookup range 0.02, // Lookup Step 0.01); // LookupIntegrationStep TpcPadPlane* _padPlane= new TpcPadPlane(100,100, 1.,1., -50.,-50.); // Put Pads into PadPlane _padPlane->ReadFromFile("padplane.dat", _padShapes); std::cout<<*_padPlane<Range(-50,-50,50,50); // plot regions int npads=_padPlane->GetNPads(); std::vector regmin(1000); std::vector regmax(1000); for(int k=0;k<1000;k++){ regmin[k].Set(9999.,9999.); regmax[k].Set(-9999.,-9999.); } for(int i=0;iGetPad(i); int sectorid=apad->sectorId(); regmin[sectorid].Set(min(apad->x(),regmin[sectorid].X()), min(apad->y(),regmin[sectorid].Y())); regmax[sectorid].Set(max(apad->x(),regmax[sectorid].X()), max(apad->y(),regmax[sectorid].Y())); } int counter=0; for(int j=0;j<1000;++j){ if(regmin[j].Mod()>100 || regmax[j].Mod()>100) continue; std::cout<<"Sector["<SetBorderSize(0); b->SetFillColor(j%5); b->Draw(); ++counter; } std::cout<Update(); c->Draw(); c->SaveAs("regions.eps"); }